androidtje
androidtje

Reputation: 115

Adding permissions to app manifest programmatically

I am trying to add permissions to my application manifest, so it can access other apps that the user installs at runtime. I thought the way to do this was to define a permission-tree in the manifest, and then use PackageManager.addPermission() to add permissions under that tree. However, I can't get this to work and the documentation I found wasn't conclusive. Could anybody show me how to do this by means of a simple example?

Upvotes: 5

Views: 2953

Answers (4)

Igor Costa
Igor Costa

Reputation: 184

Only rooted devices are cable of that, due to security reasons.

Upvotes: 1

NotACleverMan
NotACleverMan

Reputation: 12227

I didn't think this was possible. I thought (and was thought by a lecturer, who could also be wrong) that all the permissions had to be added as the code compiles. If you can add permissions afterwards, wouldn't that allow apps to access all of my information without my permission? There would also be no point in the confirmation screen when downloading an app, as the permissions it warns you about may not all f the permissions it is going to use.

In my opinion I don't think it should be possible. It is too easily abused. I also don't think it is possible and I think you will have a hard time finding any info on it.

Upvotes: 0

Macarse
Macarse

Reputation: 93133

Impossible in a non rooted device. Security issues involved.

Upvotes: 1

Octavian Helm
Octavian Helm

Reputation: 39604

You don't have access to other applications only to your application and to the applications running with your application's user ID.

Upvotes: 1

Related Questions