GoogleTotpAuth

手机宝令 基于 GoogleAuthenticator的totp算法的手机宝令功能,附带翻牌效果

关于我,欢迎关注
 邮箱:[email protected]  如果对你有点帮助的话,点个star哦~

Screenshots

image

特性

原理说明

Getting started

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

Add the dependency

 dependencies {
        compile 'com.github.Yuphee:GoogleTotpAuth:VERSION_CODE'
}

replace VERSION_CODE with real version name such as released in Here

notice

Both have to write, or else can not be loaded successfully.

使用方法

-seed初始化

public class MApplication extends Application{

    private static MApplication instance = null;

    public static MApplication getInstance() {
        if (null == instance) {
            instance = new MApplication();
        }
        return instance;
    }

    public MApplication() {

    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        SPUtils.init(this);
        TotpUtil.init("FZ6S5VB64HVSYLJN");// 初始化SEED
    }
}

-生成令牌


 TotpUtil.generate();

-动画相关的逻辑参考MainActivity

TODO

暂时木有