Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tehcneko committed May 27, 2024
1 parent 5a5fa2b commit da76bb4
Showing 1 changed file with 23 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,49 +43,56 @@ public void onSystemServerLoaded(@NonNull SystemServerLoadedParam param) {
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
// ScreenCapture in WindowManagerService (U)
try {
// Screenshot
hookScreenCapture(classLoader);
} catch (Throwable t) {
log("hook ScreenCapture failed", t);
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
try {
// Blackout permission check
hookActivityManagerService(classLoader);
} catch (Throwable t) {
log("hook ActivityManagerService failed", t);
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 / OverlayDisplay / VirtualDisplay (U)
try {
// WifiDisplay
hookDisplayControl(classLoader);
} catch (Throwable t) {
log("hook DisplayControl failed", t);
}

// VirtualDisplay with MediaProjection (S~U)
try {
// MediaProjection
hookVirtualDisplayAdapter(classLoader);
} catch (Throwable t) {
log("hook VirtualDisplayAdapter failed", t);
}
}

// secureLocked flag (S-)
try {
// Screenshot
hookWindowState(classLoader);
} catch (Throwable 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) {
// Xiaomi HyperOS (U)
try {
hookHyperOS(classLoader);
} catch (ClassNotFoundException ignored) {
} catch (Throwable t) {
log("hook HyperOS failed", t);
}

// Screenshot detection (U)
try {
hookActivityTaskManagerService(classLoader);
} catch (Throwable t) {
Expand Down Expand Up @@ -126,8 +133,8 @@ public void onPackageLoaded(@NonNull PackageLoadedParam param) {
case "com.miui.screenshot":
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S &&
Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
// ScreenCapture in App (S~T)
try {
// Screenshot
hookScreenCapture(classLoader);
} catch (Throwable t) {
log("hook ScreenCapture failed", t);
Expand Down

0 comments on commit da76bb4

Please sign in to comment.