mirror of
https://github.com/LSPosed/DisableFlagSecure.git
synced 2025-05-05 01:59:43 +08:00
fix oplus in system server
This commit is contained in:
parent
aee7d86bb3
commit
3481cbbfac
@ -25,7 +25,6 @@ import io.github.libxposed.api.annotations.XposedHooker;
|
|||||||
@SuppressLint({"PrivateApi", "BlockedPrivateApi"})
|
@SuppressLint({"PrivateApi", "BlockedPrivateApi"})
|
||||||
public class DisableFlagSecure extends XposedModule {
|
public class DisableFlagSecure extends XposedModule {
|
||||||
private static final String SYSTEMUI = "com.android.systemui";
|
private static final String SYSTEMUI = "com.android.systemui";
|
||||||
private static final String OPLUS_SCREENSHOT = "com.oplus.screenshot";
|
|
||||||
private static final String OPLUS_APPPLATFORM = "com.oplus.appplatform";
|
private static final String OPLUS_APPPLATFORM = "com.oplus.appplatform";
|
||||||
private static final String FLYME_SYSTEMUIEX = "com.flyme.systemuiex";
|
private static final String FLYME_SYSTEMUIEX = "com.flyme.systemuiex";
|
||||||
private static final String MIUI_SCREENSHOT = "com.miui.screenshot";
|
private static final String MIUI_SCREENSHOT = "com.miui.screenshot";
|
||||||
@ -121,6 +120,14 @@ public class DisableFlagSecure extends XposedModule {
|
|||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
log("hook WindowState failed", t);
|
log("hook WindowState failed", t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// oplus dumpsys
|
||||||
|
// dumpsys window screenshot systemQuickTileScreenshotOut display_id=0
|
||||||
|
try {
|
||||||
|
hookOplus(classLoader);
|
||||||
|
} catch (Throwable ignored) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("PrivateApi")
|
@SuppressLint("PrivateApi")
|
||||||
@ -131,20 +138,6 @@ public class DisableFlagSecure extends XposedModule {
|
|||||||
var classLoader = param.getClassLoader();
|
var classLoader = param.getClassLoader();
|
||||||
var pn = param.getPackageName();
|
var pn = param.getPackageName();
|
||||||
switch (pn) {
|
switch (pn) {
|
||||||
case OPLUS_SCREENSHOT:
|
|
||||||
try {
|
|
||||||
hookOplus(classLoader);
|
|
||||||
} catch (Throwable t) {
|
|
||||||
log("hook OPlus failed", t);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
hookOplusNew(classLoader);
|
|
||||||
} catch (Throwable t) {
|
|
||||||
if (!(t instanceof ClassNotFoundException)) {
|
|
||||||
log("hook OPlus failed", t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case FLYME_SYSTEMUIEX:
|
case FLYME_SYSTEMUIEX:
|
||||||
case OPLUS_APPPLATFORM:
|
case OPLUS_APPPLATFORM:
|
||||||
// Flyme SystemUI Ext 10.3.0
|
// Flyme SystemUI Ext 10.3.0
|
||||||
@ -287,13 +280,9 @@ public class DisableFlagSecure extends XposedModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void hookOplus(ClassLoader classLoader) throws ClassNotFoundException {
|
private void hookOplus(ClassLoader classLoader) throws ClassNotFoundException {
|
||||||
var screenshotContextClazz = classLoader.loadClass("com.oplus.screenshot.screenshot.core.ScreenshotContext");
|
// caller: com.android.server.wm.OplusLongshotWindowDump#dumpWindows
|
||||||
hookMethods(screenshotContextClazz, ReturnNullHooker.class, "setScreenshotReject", "setLongshotReject");
|
var longshotMainClazz = classLoader.loadClass("com.android.server.wm.OplusLongshotMainWindow");
|
||||||
}
|
hookMethods(longshotMainClazz, ReturnFalseHooker.class, "hasSecure");
|
||||||
|
|
||||||
private void hookOplusNew(ClassLoader classLoader) throws ClassNotFoundException {
|
|
||||||
var screenshotContextClazz = classLoader.loadClass("com.oplus.screenshot.screenshot.core.ScreenshotContentContext");
|
|
||||||
hookMethods(screenshotContextClazz, ReturnNullHooker.class, "setScreenshotReject", "setLongshotReject");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.S)
|
@TargetApi(Build.VERSION_CODES.S)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
system
|
system
|
||||||
com.android.systemui
|
com.android.systemui
|
||||||
com.flyme.systemuiex
|
com.flyme.systemuiex
|
||||||
com.oplus.screenshot
|
|
||||||
com.miui.screenshot
|
com.miui.screenshot
|
||||||
com.oplus.appplatform
|
com.oplus.appplatform
|
Loading…
x
Reference in New Issue
Block a user