android - android中accountManager的getPassword中的SecurityException

标签 android google-account accountmanager getpasswd

我正在尝试找回谷歌帐户的密码,但得到 String pwd = AccountManager.get(mContext).getPassword(account) 处的安全异常。 此外,我已在 androidManifest.xml 中授予权限 account_manager, authenticator, get_account, 管理账户。

代码:

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: WARN/AccountManagerService(2248): caller uid 1000 与验证者的 uid 不同

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

08-04 06:38:30.821: WARN/System.err(2804): java.lang.SecurityException: caller uid 1000 不同于 验证者的uid

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

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

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

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

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

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

最佳答案

据我read this post ,错误是因为配置不匹配。您需要详细了解

关于android - android中accountManager的getPassword中的SecurityException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3403885/

相关文章:

android - 使用 token 的谷歌身份验证

google-signin - 如何或在哪里可以看到在 Google 控制台中使用 Google SignIn 登录的用户?

python - 使用 Python 使用 Google、Facebook 或 Twitter 帐户登录网站

java - 检查数据是否已经存在于表中,或者检查表是否为空

java - 如何从父类(super class)到子类重用代码 Intent Intent=new Intent(context,Activity.class) ?

android - 如何在您的 Android 应用程序中使用谷歌帐户

Android 服务交换总是崩溃

android - 使用 AccountManager 处理登录和记住我

android - android studio 中 View 对象的 ClassCastException

java - Android Studio : Code in previous screen not continuing after calling "finish()" in activity