Why do I get "caller uid xxxxx different from uid authenticator" when accessing information about a different application account?

I wrote an application A that uses the AccountManager to log in. Then I wrote another application B, which uses AccountManager account information.

But when I run B, I get "java.lang.SecurityException: caller uid xxxx is different from the authenticator uid".

Signing B using a keystore file solves this problem.

However, I still want to know why this is happening and is there an alternative solution.

+4
source share
1 answer

This post is very misleading. You can only access another account if you have the same uid or the same signature as the application that has an account authenticator. There is no other solution. It would be useful for them to change the message.

This is an important precaution. If he did not have this, any application could read any user data of the user. This may contain sensitive information.

Source: read the code

+3
source

Source: https://habr.com/ru/post/1400333/


All Articles