mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
修复A13中部分场景无法强制截图
This commit is contained in:
@@ -1,13 +1,14 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.android
|
package com.lt2333.simplicitytools.hooks.rules.all.android
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.hookAllConstructorBefore
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.utils.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||||
|
|
||||||
object DisableFlagSecureForAll : HookRegister() {
|
object DisableFlagSecureForAll : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
// TODO: 23.1.30及之后的版本无法在部分场景生效,疑似MIUI做了修改
|
|
||||||
findMethod("com.android.server.wm.WindowState") {
|
findMethod("com.android.server.wm.WindowState") {
|
||||||
name == "isSecureLocked"
|
name == "isSecureLocked"
|
||||||
}.hookBefore {
|
}.hookBefore {
|
||||||
@@ -15,6 +16,19 @@ object DisableFlagSecureForAll : HookRegister() {
|
|||||||
it.result = false
|
it.result = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
findMethod("com.android.server.wm.WindowSurfaceController") {
|
||||||
|
name == "setSecure"
|
||||||
|
}.hookBefore {
|
||||||
|
it.args[0] = false
|
||||||
|
}
|
||||||
|
hookAllConstructorBefore("com.android.server.wm.WindowSurfaceController") {
|
||||||
|
var flags = it.args[2] as Int
|
||||||
|
val secureFlag = 128
|
||||||
|
flags = flags and secureFlag.inv()
|
||||||
|
it.args[2] = flags
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user