android中accountManager的getPassword中出现SecurityException

2024-01-07

我试图找回谷歌帐户的密码,但得到 String pwd = AccountManager.get(mContext).getPassword(account) 处出现安全异常。 我还在 androidManifest.xml 中授予了权限 account_manager、authenticator、get_account、管理帐户。

code :

android.accounts.Account[] gaccounts = AccountManager.get(mContext).getAccounts();
Log.i("parul", "2222()len :"+ gaccounts.length);
for (android.accounts.Account account: gaccounts) {
   String pwd = AccountManager.get(mContext).getPassword(account);
   Log.i("parul", "google pwd: " + pwd);
   AccountManager.get(mContext).setPassword(account, null);
   String pwdcleared = AccountManager.get(mContext).getPassword(account);
   Log.i("parul", "google pwdcleared: " + pwdcleared);
}

=================================================== ===========================

例外:

08-04 06:38:30.821:警告/AccountManagerService(2248):呼叫者uid 1000 与验证者的 uid 不同

08-04 06:38:30.821: INFO/parul(2804): 帐户抛出异常 经理尝试阻止

08-04 06:38:30.821: WARN/System.err(2804): java.lang.SecurityException: 调用者 uid 1000 与 验证者的uid

08-04 06:38:30.821: 警告/System.err(2804): 在 android.os.Parcel.readException(Parcel.java:1218)

08-04 06:38:30.821: 警告/System.err(2804): 在 android.os.Parcel.readException(Parcel.java:1206)

08-04 06:38:30.821: 警告/System.err(2804): 在 android.accounts.IAccountManager$Stub $Proxy.getPassword(IAccountManager.java:397)

08-04 06:38:30.821: 警告/System.err(2804): 在 android.accounts.AccountManager.getPassword(AccountManager.java:157)

=================================================== ===========================

如果有人知道我为什么会遇到这个问题,请帮助。 谢谢


据我所知阅读这篇文章 http://loganandandy.tumblr.com/post/613041897/caller-uid-is-different,错误是因为配置不匹配。需要你仔细推敲

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

android中accountManager的getPassword中出现SecurityException 的相关文章

随机推荐