From 1a30b65118b884d8799c3ab1feaaae39254e0b8b Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 23 May 2015 13:13:48 +0200 Subject: [PATCH] Fixed telephony manager restrictions Refs #2195 --- src/biz/bokhorst/xprivacy/XPrivacy.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/biz/bokhorst/xprivacy/XPrivacy.java b/src/biz/bokhorst/xprivacy/XPrivacy.java index 5979730bd..fa82cc43b 100644 --- a/src/biz/bokhorst/xprivacy/XPrivacy.java +++ b/src/biz/bokhorst/xprivacy/XPrivacy.java @@ -321,13 +321,15 @@ private void hookSystem(Object am, ClassLoader classLoader) throws Throwable { hookAll(XSmsManager.getInstances(true), classLoader, mSecret, false); // Telephone service - hookAll(XTelephonyManager.getInstances(null, true), classLoader, mSecret, false); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) + hookAll(XTelephonyManager.getInstances(null, true), classLoader, mSecret, false); // Usage statistics manager hookAll(XUsageStatsManager.getInstances(true), classLoader, mSecret, false); // Wi-Fi service hookAll(XWifiManager.getInstances(null, true), classLoader, mSecret, false); + /* * Add pure system server hooks */ @@ -418,8 +420,11 @@ private void hookPackage(String packageName, ClassLoader classLoader) { } // Phone interface manager - if ("com.android.phone".equals(packageName)) + if ("com.android.phone".equals(packageName)) { hookAll(XTelephonyManager.getPhoneInstances(), classLoader, mSecret, false); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) + hookAll(XTelephonyManager.getInstances(null, true), classLoader, mSecret, false); + } // Providers hookAll(XContentResolver.getPackageInstances(packageName, classLoader), classLoader, mSecret, false);