Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Restrict getPackageInfo #1834

Closed
BlueMax opened this issue Jul 26, 2014 · 5 comments
Closed

Restrict getPackageInfo #1834

BlueMax opened this issue Jul 26, 2014 · 5 comments

Comments

@BlueMax
Copy link

BlueMax commented Jul 26, 2014

Can you restrict 'PackageManager/getPackageInfo' to return 'NameNotFoundException' to prevent apps enumerating installed apps (and maybe bind this to getInstalledPackages whitelist)?

@M66B
Copy link
Owner

M66B commented Jul 26, 2014

[getPackageInfo](http://developer.android.com/reference/android/content/pm/PackageManager.html#getPackageInfo%28java.lang.String, int%29) cannot be used to enumerate applications, since it returns information about one package only. Moreover, to prevent getting information about a single package would mean restricting a lot more PackageManager functions.

@BlueMax
Copy link
Author

BlueMax commented Jul 26, 2014

Just depends on the implementation. The Playstore dynamically pushes any relevant entry (package name) through it in realtime and updates the internal database accordingly. That's why getInstalledPackages misses the 'Installed' marker everywhere (including the 'All' apps tab).

@M66B M66B closed this as completed in 9ee4507 Aug 16, 2014
@M66B
Copy link
Owner

M66B commented Aug 16, 2014

Please note that there are many more methods to check if a package is installed.
It would be a performance hit if they were all hooked.
Nevertheless I guess the two hooked functions will probably cover most cases.

Note that these two new restrictions only work in AOSP mode (not in compatibility mode) and only for version 2.99.30 or later)

@M66B
Copy link
Owner

M66B commented Aug 16, 2014

The new hooks are in version 2.99.30, can you please check if it works for Play store?

@BlueMax
Copy link
Author

BlueMax commented Aug 17, 2014

Yes, works properly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants