Support Android 15 Beta 4

This commit is contained in:
tehcneko 2024-08-18 09:58:52 +08:00
parent 4a811dd16a
commit caa953cd11

View File

@ -47,7 +47,7 @@ public class DisableFlagSecure extends XposedModule {
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
// Screenshot detection (U) // Screenshot detection (U~V)
try { try {
hookActivityTaskManagerService(classLoader); hookActivityTaskManagerService(classLoader);
} catch (Throwable t) { } catch (Throwable t) {
@ -64,7 +64,7 @@ public class DisableFlagSecure extends XposedModule {
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
// ScreenCapture in WindowManagerService (S~U) // ScreenCapture in WindowManagerService (S~V)
try { try {
hookScreenCapture(classLoader); hookScreenCapture(classLoader);
} catch (Throwable t) { } catch (Throwable t) {
@ -80,14 +80,14 @@ public class DisableFlagSecure extends XposedModule {
} }
} }
// WifiDisplay (S~U) / OverlayDisplay (S~U) / VirtualDisplay (U) // WifiDisplay (S~V) / OverlayDisplay (S~V) / VirtualDisplay (U~V)
try { try {
hookDisplayControl(classLoader); hookDisplayControl(classLoader);
} catch (Throwable t) { } catch (Throwable t) {
log("hook DisplayControl failed", t); log("hook DisplayControl failed", t);
} }
// VirtualDisplay with MediaProjection (S~U) // VirtualDisplay with MediaProjection (S~V4)
try { try {
hookVirtualDisplayAdapter(classLoader); hookVirtualDisplayAdapter(classLoader);
} catch (Throwable t) { } catch (Throwable t) {
@ -237,7 +237,10 @@ public class DisableFlagSecure extends XposedModule {
var displayControlClazz = Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE ? var displayControlClazz = Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE ?
classLoader.loadClass("com.android.server.display.DisplayControl") : classLoader.loadClass("com.android.server.display.DisplayControl") :
SurfaceControl.class; SurfaceControl.class;
var method = displayControlClazz.getDeclaredMethod("createDisplay", String.class, boolean.class); var method = displayControlClazz.getDeclaredMethod(
Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM ?
"createVirtualDisplay" :
"createDisplay", String.class, boolean.class);
hook(method, CreateDisplayHooker.class); hook(method, CreateDisplayHooker.class);
} }