npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@yidun/cordova-plugin-guardian

v1.0.0

Published

yidun anticheat cordova plugin

Downloads

19

Readme

Cordova Plugin Yidun Guardian

易盾反作弊cordova原生插件版,目前仅支持 Android

Installation

cordova plugin add @yidun/cordova-plugin-guardian

反作弊接入

初始化

  var $actionEl = document.getElementById('detectAction');  // 显示动作提示的元素
  var instance = new YidunGuardian({
          isCollectApk: false,  // Boolean, 是否允许采集本机已安装的软件,默认 false
          isCollectSensor: false,  // Boolean, 是否允许开始采集传感器实时数据,默认 false
          channel: '',  // String, APP渠道名称,默认空
          productNumber: '从易盾申请的productNumber'
        }, function (ev) {
          if (ev['is_init_success'] === true) { // 初始化反作弊成功
            // TODO: do something ....
            return
          } else if (ev['is_init_success'] === false) { // 初始化反作弊失败
            // TODO: do something ....
            return
          }

          if (ev['is_get_token_success'] === true) { // getToken 成功
            // TODO: 处理token, ev['token'],从 ev['token'] 获取到 token
            // do something ....
            console.log(ev['token'])
            return
          } else if (ev['is_get_token_success'] === false) {
            // TODO: do something ....
            return
          }
        }
      );

getToken 接口

// timeout 最长超时时间,单位毫秒。若没指定,则默认3000毫秒;timeout可设置范围为1000~10000毫秒
  instance.getToken(timeout: number)

setSeniorCollectStatus 接口

  // 该接口用于实时控制传感器数据的采集,可随时启用或关闭采集功能,但是必须在init之后方可调用该接口
  instance.setSeniorCollectStatus(flag: boolean)

简单示例app

cordova-plugin-guardian-demo for a complete working Cordova example for Android platforms.