3

What is the best way to prevent a user from downloading and installing applications which uses some specific permissions like location and sms.

Is it programatically possible to parse the manifest of an application from the market before it get installed and look for the specific permissions and alert the user?

Mithun Sreedharan
  • 49,883
  • 70
  • 181
  • 236

3 Answers3

2

What is the best way to prevent a user from downloading and installing applications which uses some specific permissions like location and sms.

Write your own firmware, where you replace the normal installer mechanism with one that enforces your desired criteria.

Android SDK applications cannot interfere with application installation.

Is it programatically possible to parse the manifest of an application from the market before it get installed and look for the specific permissions and alert the user?

No, sorry.

However, you can listen for ACTION_PACKAGE_ADDED and examine the newly-installed package via PackageManager, and alert the user at that point. Since nothing of the installed package can run immediately upon the install, I would think that there is a decent chance that your alert will appear before the user tries to use the newly-installed app.

Mithun Sreedharan
  • 49,883
  • 70
  • 181
  • 236
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
1

In the future this would be probably something you could do trough Device Administration, but right now limiting application installation based on its requested permission is not included.

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
1

One option is this snippet that decompress the apk and extracts the AndroidManifest.xml.

By the way the aapt tool for android runs on the Android OS too. You can get this information using this port

Community
  • 1
  • 1
Reno
  • 33,594
  • 11
  • 89
  • 102