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);