修复部分部分应用无法强制进入小窗

This commit is contained in:
乌堆小透明
2022-03-02 22:53:07 +08:00
parent 83b3262b08
commit 3f38660950
4 changed files with 43 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -2,6 +2,7 @@ package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.hook.app.android.DeleteOnPostNotification
import com.lt2333.simplicitytools.hook.app.android.DisableFlagSecure
import com.lt2333.simplicitytools.hook.app.android.RemoveSmallWindowRestrictions2
import com.lt2333.simplicitytools.hook.app.android.corepatch.CorePatch
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.XposedBridge
@@ -16,5 +17,7 @@ class Android : IXposedHookLoadPackage {
DisableFlagSecure().handleLoadPackage(lpparam)
//上层显示
DeleteOnPostNotification().handleLoadPackage(lpparam)
//解除小窗限制
RemoveSmallWindowRestrictions2().handleLoadPackage(lpparam)
}
}

View File

@@ -0,0 +1,37 @@
package com.lt2333.simplicitytools.hook.app.android
import com.lt2333.simplicitytools.util.XSPUtils
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XposedHelpers
import de.robv.android.xposed.callbacks.XC_LoadPackage
class RemoveSmallWindowRestrictions2 : IXposedHookLoadPackage {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
val classIfExists = XposedHelpers.findClassIfExists(
"com.android.server.wm.Task",
lpparam.classLoader
)
XposedHelpers.findAndHookMethod(
classIfExists,
"isResizeable",
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
if (XSPUtils.getBoolean("remove_small_window_restrictions", false)) {
param.result = true
}
}
})
XposedHelpers.findAndHookMethod(
classIfExists,
"supportsMultiWindowInDisplayAreaForFreeForm",
"com.android.server.wm.TaskDisplayArea",
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
if (XSPUtils.getBoolean("remove_small_window_restrictions", false)) {
param.result = true
}
}
})
}
}