Android:扩展库

时间:2017-08-19 06:51:00

标签: java android security android-library

我开发了一个Android应用程序,我使用了一个名为cacheword的开源库来处理它的密码。现在我想为它设置另一个密码,我的意思是我希望我的应用程序有两个密码!但我不能这样做,因为根据这个库的这个功能:

public void setPassphrase(char[] passphrase) throws GeneralSecurityException {
        PassphraseSecrets ps;
        if(SecretsManager.isInitialized(this.mContext)) {
            ps = PassphraseSecrets.fetchSecrets(this.mContext, passphrase);
        } else {
            ps = PassphraseSecrets.initializeSecrets(this.mContext, passphrase);
            if(ps == null) {
                throw new GeneralSecurityException("initializeSecrets could not save the secrets.");
            }
        }

        this.setCachedSecrets(ps);
    }

它只能设置一个密码。所以我决定以某种方式更改此方法并处理第二个密码!但是当我开始这样做时,我明白它并不太容易! :))因为它使用了库的其他功能!你能帮帮我怎样才能解决这个问题!?!

0 个答案:

没有答案