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 public class Mod implements IXposedHookLoadPackage {
10 // Just a helper function, useful to figure out package names
11 private void tryToLoad(String className, ClassLoader loader) {
13 XposedHelpers.findClass(className, loader);
14 XposedBridge.log(" Found " + className);
16 catch (Throwable t) {}
19 public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
20 if (!lpparam.packageName.equals("android"))
23 final Class<?> userHandle = XposedHelpers.findClass("android.os.UserHandle", lpparam.classLoader);
24 final Class<?> notifyTask = XposedHelpers.findClass("com.android.server.devicepolicy.DevicePolicyManagerService$MonitoringCertNotificationTask", lpparam.classLoader);
26 XposedHelpers.findAndHookMethod(notifyTask, "manageNotification", userHandle,
27 new XC_MethodReplacement() {
29 protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Throwable {
30 XposedBridge.log("Not showing FUD notification");