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

Commit

Permalink
Fixed allowing applications for queryIntentActivities
Browse files Browse the repository at this point in the history
Fixes #1147
  • Loading branch information
M66B committed Jan 22, 2014
1 parent f085fac commit a28a5eb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ Test and beta releases will have experimental functions enabled by default.

**Version 1.99.6 EXPERIMENTAL**

* Corrected application name and version in update notifications, thanks @[jpeg729](https://github.com/jpeg729) ([issue](https://github.com/M66B/XPrivacy/issues/1112))
* Fixed export progress, thanks @[jpeg729](https://github.com/jpeg729)
* Fixed some settings not migrated correctly ([issue](https://github.com/M66B/XPrivacy/issues/1127))
* Fixed allowing applications for *queryIntentActivities* ([issue](https://github.com/M66B/XPrivacy/issues/1147))
* Corrected application name and version in update notifications, thanks @[jpeg729](https://github.com/jpeg729) ([issue](https://github.com/M66B/XPrivacy/issues/1112))
* Added update service with progress notifications for migration, randomization and upgrade
* Allowed secondary users to set restrictions
* Fixed some settings not migrated correctly ([issue](https://github.com/M66B/XPrivacy/issues/1127))
* Kill application is not experimental anymore and can kill applications only
* Moved privacy database to application data folder ([issue](https://github.com/M66B/XPrivacy/issues/1129))
* Added dialog for export, import, submit, fetch and toggle, big thanks @[jpeg729](https://github.com/jpeg729)
Expand Down
29 changes: 19 additions & 10 deletions src/biz/bokhorst/xprivacy/XPackageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,30 +99,39 @@ private List<ApplicationInfo> filterApplicationInfo(List<ApplicationInfo> origin

private List<PackageInfo> filterPackageInfo(List<PackageInfo> original) {
ArrayList<PackageInfo> result = new ArrayList<PackageInfo>();
for (PackageInfo appInfo : original)
if (isPackageAllowed(appInfo.packageName))
result.add(appInfo);
for (PackageInfo pkgInfo : original)
if (isPackageAllowed(pkgInfo.packageName))
result.add(pkgInfo);
return result;
}

private List<ProviderInfo> filterProviderInfo(List<ProviderInfo> original) {
ArrayList<ProviderInfo> result = new ArrayList<ProviderInfo>();
for (ProviderInfo appInfo : original)
if (isPackageAllowed(appInfo.packageName))
result.add(appInfo);
for (ProviderInfo provInfo : original)
if (isPackageAllowed(provInfo.packageName))
result.add(provInfo);
return result;
}

private List<ResolveInfo> filterResolveInfo(List<ResolveInfo> original) {
ArrayList<ResolveInfo> result = new ArrayList<ResolveInfo>();
for (ResolveInfo appInfo : original)
if (isPackageAllowed(appInfo.resolvePackageName))
result.add(appInfo);
for (ResolveInfo resInfo : original)
if (resInfo.activityInfo != null && resInfo.activityInfo.applicationInfo != null)
if (isPackageAllowed(resInfo.activityInfo.applicationInfo.packageName))
result.add(resInfo);
return result;
}

public static boolean isPackageAllowed(String packageName) {
int uid = Binder.getCallingUid();
return PrivacyManager.getSettingBool(null, uid, PrivacyManager.cSettingApplication + packageName, false, true);

if (packageName == null) {
Util.log(null, Log.WARN, "isPackageAllowed uid=" + uid + " package=" + packageName);
Util.logStack(null);
return false;
}

String name = PrivacyManager.cSettingApplication + packageName;
return PrivacyManager.getSettingBool(null, uid, name, false, true);
}
}

0 comments on commit a28a5eb

Please sign in to comment.