update comments

This commit is contained in:
tehcneko 2024-05-27 20:33:35 +08:00
parent 5a5fa2ba19
commit f9a1c1321e

View File

@ -43,55 +43,61 @@ 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) {
// ScreenCapture in WindowManagerService (U)
try { try {
// Screenshot
hookScreenCapture(classLoader); hookScreenCapture(classLoader);
} catch (Throwable t) { } catch (Throwable t) {
log("hook ScreenCapture failed", t); log("hook ScreenCapture failed", t);
} }
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { // Screenshot detection (U)
try { try {
// Blackout permission check hookActivityTaskManagerService(classLoader);
hookActivityManagerService(classLoader);
} catch (Throwable t) { } catch (Throwable t) {
log("hook ActivityManagerService failed", t); log("hook ActivityTaskManagerService failed", t);
} }
// Xiaomi HyperOS (U)
try {
hookHyperOS(classLoader);
} catch (ClassNotFoundException ignored) {
} catch (Throwable t) {
log("hook HyperOS failed", t);
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
// Blackout permission check (S~T)
try {
hookActivityManagerService(classLoader);
} catch (Throwable t) {
log("hook ActivityManagerService failed", t);
}
}
// WifiDisplay (S~U) / OverlayDisplay (S~U) / VirtualDisplay (U)
try { try {
// WifiDisplay
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)
try { try {
// MediaProjection
hookVirtualDisplayAdapter(classLoader); hookVirtualDisplayAdapter(classLoader);
} catch (Throwable t) { } catch (Throwable t) {
log("hook VirtualDisplayAdapter failed", t); log("hook VirtualDisplayAdapter failed", t);
} }
} }
// secureLocked flag (S-)
try { try {
// Screenshot // Screenshot
hookWindowState(classLoader); hookWindowState(classLoader);
} catch (Throwable t) { } catch (Throwable t) {
log("hook WindowState failed", t); log("hook WindowState failed", t);
} }
try {
hookHyperOS(classLoader);
} catch (ClassNotFoundException ignored) {
} catch (Throwable t) {
log("hook HyperOS failed", t);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
try {
hookActivityTaskManagerService(classLoader);
} catch (Throwable t) {
log("hook ActivityTaskManagerService failed", t);
}
}
} }
@SuppressLint("PrivateApi") @SuppressLint("PrivateApi")
@ -126,8 +132,8 @@ public class DisableFlagSecure extends XposedModule {
case "com.miui.screenshot": case "com.miui.screenshot":
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S &&
Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
// ScreenCapture in App (S~T)
try { try {
// Screenshot
hookScreenCapture(classLoader); hookScreenCapture(classLoader);
} catch (Throwable t) { } catch (Throwable t) {
log("hook ScreenCapture failed", t); log("hook ScreenCapture failed", t);