Skip to content

Commit

Permalink
Removed restriction getPackagesForUid
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Jan 19, 2014
1 parent fca8000 commit fafd9de
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Test and beta releases will have experimental functions enabled by default.

**Next release**

* Removed restriction *getPackagesForUid*

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)

**Version 1.99.1 EXPERIMENTAL**
Expand All @@ -27,7 +29,7 @@ Test and beta releases will have experimental functions enabled by default.
* New features possible
* Better method for hooking the bluetooth manager
* Better method for hooking the package manager
* Hook *getPackagesForUid*, *getPackagesHoldingPermissions* (JellyBean MR2) and *queryIntentContentProviders* (Kitkat)
* Added restriction for *getPackagesForUid*, *getPackagesHoldingPermissions* (JellyBean MR2) and *queryIntentContentProviders* (Kitkat)
* Lower case randomized Android ID
* Simple registration procedure for submitting restrictions
* Moved IPC to separate category
Expand Down
1 change: 0 additions & 1 deletion assets/meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@

<Hook restriction="system" method="getInstalledApplications" dangerous="true" permissions="" sdk="1" />
<Hook restriction="system" method="getInstalledPackages" dangerous="true" permissions="" sdk="1" />
<Hook restriction="system" method="getPackagesForUid" dangerous="true" from="1.99.1" permissions="" sdk="1" />
<Hook restriction="system" method="getPackagesHoldingPermissions" dangerous="true" from="1.99.1" permissions="" sdk="1" />
<Hook restriction="system" method="getPreferredPackages" dangerous="true" permissions="" sdk="1" />
<Hook restriction="system" method="queryBroadcastReceivers" dangerous="true" permissions="" sdk="1" />
Expand Down
6 changes: 1 addition & 5 deletions src/biz/bokhorst/xprivacy/XPackageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public String getClassName() {

// public List<ApplicationInfo> getInstalledApplications(int flags)
// public List<PackageInfo> getInstalledPackages(int flags)
// public String[] getPackagesForUid(int uid)
// public List<PackageInfo> getPackagesHoldingPermissions(String[] permissions, int flags)
// public List<PackageInfo> getPreferredPackages(int flags)
// public List<ResolveInfo> queryBroadcastReceivers(Intent intent, int flags)
Expand All @@ -45,7 +44,7 @@ public String getClassName() {
// @formatter:on

private enum Methods {
getInstalledApplications, getInstalledPackages, getPackagesForUid, getPackagesHoldingPermissions, getPreferredPackages, queryBroadcastReceivers, queryContentProviders, queryIntentActivities, queryIntentActivityOptions, queryIntentContentProviders, queryIntentServices
getInstalledApplications, getInstalledPackages, getPackagesHoldingPermissions, getPreferredPackages, queryBroadcastReceivers, queryContentProviders, queryIntentActivities, queryIntentActivityOptions, queryIntentContentProviders, queryIntentServices
};

public static List<XHook> getInstances(Object instance) {
Expand Down Expand Up @@ -74,9 +73,6 @@ protected void after(MethodHookParam param) throws Throwable {
if (mMethod == Methods.getInstalledApplications) {
if (param.getResult() != null && isRestricted(param))
param.setResult(filterApplicationInfo((List<ApplicationInfo>) param.getResult()));
} else if (mMethod == Methods.getPackagesForUid) {
if (param.getResult() != null && isRestricted(param))
param.setResult(new String[0]);
} else if (mMethod == Methods.getInstalledPackages || mMethod == Methods.getPackagesHoldingPermissions
|| mMethod == Methods.getPreferredPackages) {
if (param.getResult() != null && isRestricted(param))
Expand Down

0 comments on commit fafd9de

Please sign in to comment.