noFUDroid works on marshmallow
[noFUDroid.git] / app / src / main / java / de / ralfj / xposed / nofudroid / Mod4.java
1 package de.ralfj.xposed.nofudroid;
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 Mod4 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 }