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

Commit

Permalink
Allow own uid for getPackagesForUid and queryContentProviders
Browse files Browse the repository at this point in the history
Fixes #1871
  • Loading branch information
M66B committed Aug 12, 2014
1 parent 5a5148a commit e25ca54
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Changelog
* Since these functions were moved recently, it is not possible to update them
* Performance optimizations
* Fixed all problems reported through the support data
* Allow own uid for *getPackagesForUid* and *queryContentProviders* ([issue](/../../issues/1871))
* Updated Dutch translation
* Updated Italian translation

Expand Down
26 changes: 14 additions & 12 deletions src/biz/bokhorst/xprivacy/XPackageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,12 @@ protected void after(XParam param) throws Throwable {
break;

case Srv_getPackagesForUid:
if (param.getResult() != null)
if (isRestricted(param))
param.setResult(null);
if (param.args.length > 0 && param.args[0] instanceof Integer && param.getResult() != null) {
int uid = (Integer) param.args[0];
if (uid != Binder.getCallingUid())
if (isRestricted(param))
param.setResult(null);
}
break;

case Srv_getPersistentApplications:
Expand All @@ -188,11 +191,6 @@ protected void after(XParam param) throws Throwable {
param.setResult(filterPackageInfo((List<PackageInfo>) param.getResult()));
break;

case Srv_queryContentProviders:
if (isRestricted(param))
param.setResult(filterProviderInfo((List<ProviderInfo>) param.getResult()));
break;

case Srv_queryIntentActivities:
case Srv_queryIntentActivityOptions:
case Srv_queryIntentContentProviders:
Expand Down Expand Up @@ -236,10 +234,14 @@ protected void after(XParam param) throws Throwable {
break;

case queryContentProviders:
if (param.args.length > 0 && param.args[0] instanceof String && param.getResult() != null) {
String processName = (String) param.args[0];
if (isRestrictedExtra(param, processName))
param.setResult(filterProviderInfo((List<ProviderInfo>) param.getResult()));
case Srv_queryContentProviders:
if (param.args.length > 1 && param.args[1] instanceof Integer && param.getResult() != null) {
int uid = (Integer) param.args[1];
if (uid != Binder.getCallingUid()) {
String processName = (String) param.args[0];
if (isRestrictedExtra(param, processName))
param.setResult(filterProviderInfo((List<ProviderInfo>) param.getResult()));
}
}
break;

Expand Down

0 comments on commit e25ca54

Please sign in to comment.