Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can an app give its permission to another application in android?

I have an application say A that have all the permissions enabled at installation. Another app Say B don't have a permission and want to get that permission. Can B communicate with A, So that A can transfer its permission to B.

PLS reply, I'm stuck here. I want to get some permissions dynamically. Is this the best idea or any other idea?

like image 317
scari Avatar asked Oct 14 '25 14:10

scari


1 Answers

As far as I know, apps can't necessarily give permissions to other apps, BUT AppB could inherit permissions from AppA IF you are the developer of both apps. If both AppA and AppB declare the same sharedUserId value in their manifest (android:sharedUserId="xyz") AND both AppA and AppB are signed with the same signature, then Android will consider them to be the same app as far as permissions go. So, AppB could exist on the device without permission "perm1" for example. Then, AppA could be installed with "perm1". IF AppA and AppB have the same sharedUserId and signature then, when AppA is installed, AppB will be "granted" "perm1".

I haven't tested this just now, but I know it used to work (as of a year ago or so).

like image 69
user1098205 Avatar answered Oct 17 '25 03:10

user1098205