diff --git a/app/src/main/java/io/github/lsposed/disableflagsecure/DisableFlagSecure.java b/app/src/main/java/io/github/lsposed/disableflagsecure/DisableFlagSecure.java index cdd6d18..0555c8e 100644 --- a/app/src/main/java/io/github/lsposed/disableflagsecure/DisableFlagSecure.java +++ b/app/src/main/java/io/github/lsposed/disableflagsecure/DisableFlagSecure.java @@ -40,6 +40,17 @@ public class DisableFlagSecure implements IXposedHookLoadPackage { @Override public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) { if (loadPackageParam.packageName.equals("android")) { + try { + Class windowsManagerServiceImpl = XposedHelpers.findClass("com.android.server.wm.WindowManagerServiceImpl", loadPackageParam.classLoader); + if (windowsManagerServiceImpl != null) { + XposedBridge.hookAllMethods( + windowsManagerServiceImpl, + "notAllowCaptureDisplay", + XC_MethodReplacement.returnConstant(false)); + } + } catch (Throwable t) { + XposedBridge.log(t); + } try { Class windowsState = XposedHelpers.findClass("com.android.server.wm.WindowState", loadPackageParam.classLoader); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {