email - Get password from android account -
i noticed android api, have method getpassword(account account)
.
accountmanager = accountmanager.get(this); account[] allgoogleaccounts = accountmanager.getaccountsbytype("com.google"); (account account : allgoogleaccounts) { system.out.println(accountmanager.getpassword(account)); }
but have error:
11-16 10:49:08.986: warn/system.err(5732): java.lang.securityexception: caller uid 10039 different authenticator's uid 11-16 10:49:09.038: warn/system.err(5732): @ android.os.parcel.readexception(parcel.java:1247) 11-16 10:49:09.038: warn/system.err(5732): @ android.os.parcel.readexception(parcel.java:1235) 11-16 10:49:09.045: warn/system.err(5732): @ android.accounts.iaccountmanager$stub$proxy.getpassword(iaccountmanager.java:415) 11-16 10:49:09.087: warn/system.err(5732): @ android.accounts.accountmanager.getpassword(accountmanager.java:277) 11-16 10:49:09.087: warn/system.err(5732): @ com.test.account.oncreate(account.java:30) 11-16 10:49:09.107: warn/system.err(5732): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1047) 11-16 10:49:09.107: warn/system.err(5732): @ android.app.activitythread.performlaunchactivity(activitythread.java:2627) 11-16 10:49:09.125: warn/system.err(5732): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2679) 11-16 10:49:09.125: warn/system.err(5732): @ android.app.activitythread.access$2300(activitythread.java:125) 11-16 10:49:09.134: warn/system.err(5732): @ android.app.activitythread$h.handlemessage(activitythread.java:2033) 11-16 10:49:09.156: warn/system.err(5732): @ android.os.handler.dispatchmessage(handler.java:99) 11-16 10:49:09.156: warn/system.err(5732): @ android.os.looper.loop(looper.java:123) 11-16 10:49:09.166: warn/system.err(5732): @ android.app.activitythread.main(activitythread.java:4627) 11-16 10:49:09.175: warn/system.err(5732): @ java.lang.reflect.method.invokenative(native method) 11-16 10:49:09.185: warn/system.err(5732): @ java.lang.reflect.method.invoke(method.java:521) 11-16 10:49:09.185: warn/system.err(5732): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:868) 11-16 10:49:09.195: warn/system.err(5732): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:626) 11-16 10:49:09.206: warn/system.err(5732): @ dalvik.system.nativestart.main(native method)
anyone can tell me mistake?
from accountmanager.getpassword()
getpassword
: method requires caller hold permissionauthenticate_accounts
, have sameuid
account's authenticator.
the way see can password if app app created account in account manager (could mistaking though)
Comments
Post a Comment