From eaeb8e24ad76d406d83f244e5c48324d7633f8d1 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 8 Feb 2014 10:41:24 +0100 Subject: [PATCH] Do not hook if LBE installed Closes #1231 --- src/biz/bokhorst/xprivacy/PrivacyManager.java | 6 ------ src/biz/bokhorst/xprivacy/Requirements.java | 2 +- src/biz/bokhorst/xprivacy/XPrivacy.java | 8 ++++++++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/biz/bokhorst/xprivacy/PrivacyManager.java b/src/biz/bokhorst/xprivacy/PrivacyManager.java index 7751cfd6a..20c076ada 100644 --- a/src/biz/bokhorst/xprivacy/PrivacyManager.java +++ b/src/biz/bokhorst/xprivacy/PrivacyManager.java @@ -275,9 +275,6 @@ public static boolean getRestrictionExtra(final XHook hook, int uid, String rest } else if (getHook(restrictionName, methodName) == null) Util.log(hook, Log.WARN, "Unknown method=" + methodName); - if (!isApplication(uid) && Util.hasLBE()) - return false; - // Check cache boolean cached = false; CRestriction key = new CRestriction(uid, restrictionName, methodName); @@ -466,9 +463,6 @@ public static String getSetting(int uid, String name, String defaultValue, boole long start = System.currentTimeMillis(); String value = null; - if (!isApplication(uid) && Util.hasLBE()) - return defaultValue; - // Check cache boolean cached = false; boolean willExpire = false; diff --git a/src/biz/bokhorst/xprivacy/Requirements.java b/src/biz/bokhorst/xprivacy/Requirements.java index 119eea9c9..1bbf31d77 100644 --- a/src/biz/bokhorst/xprivacy/Requirements.java +++ b/src/biz/bokhorst/xprivacy/Requirements.java @@ -24,7 +24,7 @@ import android.util.Log; public class Requirements { - private static String[] cIncompatible = new String[] {}; + private static String[] cIncompatible = new String[] { "com.lbe.security" }; @SuppressWarnings("unchecked") public static void check(final Context context) { diff --git a/src/biz/bokhorst/xprivacy/XPrivacy.java b/src/biz/bokhorst/xprivacy/XPrivacy.java index e97c5dc68..e887385dd 100644 --- a/src/biz/bokhorst/xprivacy/XPrivacy.java +++ b/src/biz/bokhorst/xprivacy/XPrivacy.java @@ -44,6 +44,10 @@ public class XPrivacy implements IXposedHookLoadPackage, IXposedHookZygoteInit { @SuppressLint("InlinedApi") public void initZygote(StartupParam startupParam) throws Throwable { + // Check for LBE security master + if (Util.hasLBE()) + return; + Util.log(null, Log.INFO, String.format("Load %s", startupParam.modulePath)); // Generate secret @@ -149,6 +153,10 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable { } public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable { + // Check for LBE security master + if (Util.hasLBE()) + return; + // Log load Util.log(null, Log.INFO, String.format("Load package=%s uid=%d", lpparam.packageName, Process.myUid()));