似乎没有人遇到过这个问题或者没有人谈过这个问题。我为企业应用程序实现了身份验证器“概念”。并且以随机的方式,当我导航到帐户设置时,而不是左侧菜单中的帐户名称,我可以在明文中看到密码!这很奇怪,我实际上无法解释!正如你在这里看到的那样:
[更新]我使用的一些API:
accountManager.addAccount(AuthenticationActivity.ACCOUNT_TYPE,
SaurAuthenticator.AUTH_TOKEN_TYPE,
null, null, activity,
new OnCreatedAccount(activity, accountManager, handler),
null);
OnCreatedAccount运行此
Bundle bundle = future.getResult();
String accountName = bundle.getString(AccountManager.KEY_ACCOUNT_NAME);
String accountType = bundle.getString(AccountManager.KEY_ACCOUNT_TYPE);
Log.v(tag, "account created : " + accountName + " - " + accountType);
Account currentAccount = new Account(accountName, accountType);
Log.v(tag, "ask token ");
mAccountManager.getAuthToken(currentAccount, SaurAuthenticator.AUTH_TOKEN_TYPE,
null, mActivity, new OnTokenAcquired(mHandler), null);
我的AuthenticationActivity(显示登录名和密码TextView
)我有一个方法finishLogin:
String accountName = intent.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);
final Account account = new Account(accountName, intent.getStringExtra(AccountManager.KEY_ACCOUNT_TYPE));
if (getIntent().getBooleanExtra(ARG_IS_ADDING_NEW_ACCOUNT, false)) {
String authtoken = intent.getStringExtra(AccountManager.KEY_AUTHTOKEN);
// Creating the account on the device and setting the auth token we got
manager.addAccountExplicitly(account, null, null);
// If do not call setAuthToken cause other unnecessary server call
manager.setAuthToken(account, SaurAuthenticator.AUTH_TOKEN_TYPE, authtoken);
// Force auto sync for this account
ContentResolver.setSyncAutomatically(account, DataCacheContract.AUTHORITY, true);
}
setAccountAuthenticatorResult(intent.getExtras());
setResult(RESULT_OK, intent);
我希望我的英语是正确的:)
感谢您的帮助!