If you don’t set a sharedUserId in Android, a unique one is automatically assigned to the application, according to the Android documentation.
But in what way is the sharedUserId unique? Is it only unique to the application, i.e. does an application have the same sharedUserId on all devices? This would mean that you can find it out for one installation programatically and use that value for a second app.
Or is the ID a random value that is different on every single device?
All Linux user accounts are unique.
android:sharedUserIdsays that 2+ apps, signed by the same signing key, should share a Linux user account. By default, they each get their own Linux user account.It has the same
android:sharedUserIdvalue wherever you choose to use it. The Linux user account, though, will be different for different devices.I wouldn’t say “random”, as I do not know the precise algorithm that is used to choose the number.