Register all user accounts and passwords?

This is strictly for testing purposes. I do not create this in the application.

I am trying to register all user accounts and passwords saved

    AccountManager accountManager = AccountManager.get(this);   

    for(Account account : accountManager.getAccounts())
    {
        System.out.println(account.name + " : " + accountManager.getPassword(account));
    }

But I get an error

E / AndroidRuntime (11944): java.lang.SecurityException: caller uid XXXXX is different from the uid authenticator

I read this question , but it doesn’t actually explain how to get around this problem, just to avoid it, at least I think so.

Is there any way to solve this problem?

Thanks in advance

0
source share
1 answer

, . , AccountManager, .

, .

, , , :

AccountManager accountManager = AccountManager.get(this);
Account[] accounts = accountManager.getAccounts();
accountManager.getUserData(accounts[0], AccountManager.KEY_USERDATA);

, .

+2

All Articles