From a28a5eb9fa72d4ad060c40482865255977a41991 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 22 Jan 2014 18:25:41 +0100 Subject: [PATCH] Fixed allowing applications for queryIntentActivities Fixes #1147 --- CHANGELOG.md | 5 ++-- .../bokhorst/xprivacy/XPackageManager.java | 29 ++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c1a01e0b..1391a1793 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/biz/bokhorst/xprivacy/XPackageManager.java b/src/biz/bokhorst/xprivacy/XPackageManager.java index 720ec7746..108981dff 100644 --- a/src/biz/bokhorst/xprivacy/XPackageManager.java +++ b/src/biz/bokhorst/xprivacy/XPackageManager.java @@ -99,30 +99,39 @@ private List filterApplicationInfo(List origin private List filterPackageInfo(List original) { ArrayList result = new ArrayList(); - 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 filterProviderInfo(List original) { ArrayList result = new ArrayList(); - 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 filterResolveInfo(List original) { ArrayList result = new ArrayList(); - 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); } }