3

I would like to retrieve passwords of all accounts (Facebook, Dropbox, Gmail, etc) associated in my Android phone... I have tried the coding below, but not able to get the passwords...

    AccountManager am = AccountManager.get(this);
    Account [] acc = am.getAccounts();
    if (acc.length > 0){
        for (int i=0; i<acc.length; i++){
            String password = am.getPassword(acc[i]);
            listedAcc += acc[i] + " Password:" + password.toString() + "\n\n";
        }
        accounts.setText(listedAcc.toString());

Can someone troubleshoot this for me... Thanks

user1782267
  • 313
  • 4
  • 10
  • 20

1 Answers1

1

From the method API: Api

This method requires the caller to hold the permission AUTHENTICATE_ACCOUNTS and to have the same UID as the account's authenticator.

Nitin Sethi
  • 1,416
  • 1
  • 11
  • 19
  • 1
    i have added this permission in my manifest, but what does "to have the same UID as the account's authenticator" mean? – user1782267 Nov 06 '12 at 07:21
  • I think it means it needs the same android:sharedUserId in AndroidManifest.xml. You can get the same UID only if you sign the APK with the same key. – domen Jul 04 '13 at 10:41