cae346fc97012fe1e3b3fa7b26514e3148c489f8
[noFUDroid.git] / app / src / main / java / it / skarafaz / xposed / nwmonblocker / Mod.java
1 package it.skarafaz.xposed.nwmonblocker;
2
3 import de.robv.android.xposed.IXposedHookZygoteInit;
4 import de.robv.android.xposed.XC_MethodReplacement;
5 import de.robv.android.xposed.XposedHelpers;
6
7 /* "Network May Be Monitored" blocker for Android 4.4. */
8
9 public class Mod implements IXposedHookZygoteInit {
10     private static final String CLASS_DEVICE_POLICY_MANAGER = "android.app.admin.DevicePolicyManager";
11
12     @Override
13     public void initZygote(StartupParam startupParam) throws Throwable {
14         final Class<?> devicePolicyManager = XposedHelpers.findClass(CLASS_DEVICE_POLICY_MANAGER, null);
15
16         XposedHelpers.findAndHookMethod(devicePolicyManager, "hasAnyCaCertsInstalled", new XC_MethodReplacement() {
17             @Override
18             protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Throwable {
19                 return false;
20             }
21         });
22     }
23 }