1 package it.skarafaz.xposed.nwmonblocker;
3 import de.robv.android.xposed.IXposedHookLoadPackage;
4 import de.robv.android.xposed.XC_MethodReplacement;
5 import de.robv.android.xposed.XposedBridge;
6 import de.robv.android.xposed.XposedHelpers;
7 import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
9 /* "Network May Be Monitored" blocker for Android 5. */
11 public class Mod5 implements IXposedHookLoadPackage {
12 // Just a helper function, useful to figure out package names
13 private void tryToLoad(String className, ClassLoader loader) {
15 XposedHelpers.findClass(className, loader);
16 XposedBridge.log(" Found " + className);
18 catch (Throwable t) {}
21 public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
22 if (!lpparam.packageName.equals("android"))
25 final Class<?> userHandle = XposedHelpers.findClass("android.os.UserHandle", lpparam.classLoader);
26 final Class<?> notifyTask = XposedHelpers.findClass("com.android.server.devicepolicy.DevicePolicyManagerService$MonitoringCertNotificationTask", lpparam.classLoader);
28 XposedHelpers.findAndHookMethod(notifyTask, "manageNotification", userHandle,
29 new XC_MethodReplacement() {
31 protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Throwable {
32 XposedBridge.log("Not showing FUD notification");