mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-13 11:51:22 +08:00
修复部分部分应用无法强制进入小窗
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user