diff --git a/KeepSplitScreenRatio/Readme.md b/KeepSplitScreenRatio/Readme.md new file mode 100644 index 0000000..d3fbc20 --- /dev/null +++ b/KeepSplitScreenRatio/Readme.md @@ -0,0 +1,5 @@ +# KeepSplitScreenRatio + +Keep the split screen ratio, when switching one of the split apps. + +Only required on Android 14 and later, since previous versions did not force a split resize in this situation. diff --git a/KeepSplitScreenRatio/build.gradle.kts b/KeepSplitScreenRatio/build.gradle.kts new file mode 100644 index 0000000..5ba30dd --- /dev/null +++ b/KeepSplitScreenRatio/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + alias(libs.plugins.buildlogic.android.application) + alias(libs.plugins.buildlogic.kotlin.android) +} + +android { + namespace = "com.programminghoch10.KeepSplitScreenRatio" + + defaultConfig { + minSdk = 34 + targetSdk = 36 + } +} diff --git a/KeepSplitScreenRatio/src/main/AndroidManifest.xml b/KeepSplitScreenRatio/src/main/AndroidManifest.xml new file mode 100644 index 0000000..cd5b2b9 --- /dev/null +++ b/KeepSplitScreenRatio/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/KeepSplitScreenRatio/src/main/assets/xposed_init b/KeepSplitScreenRatio/src/main/assets/xposed_init new file mode 100644 index 0000000..420f227 --- /dev/null +++ b/KeepSplitScreenRatio/src/main/assets/xposed_init @@ -0,0 +1 @@ +com.programminghoch10.KeepSplitScreenRatio.Hook diff --git a/KeepSplitScreenRatio/src/main/java/com/programminghoch10/KeepSplitScreenRatio/Hook.kt b/KeepSplitScreenRatio/src/main/java/com/programminghoch10/KeepSplitScreenRatio/Hook.kt new file mode 100644 index 0000000..1526f4c --- /dev/null +++ b/KeepSplitScreenRatio/src/main/java/com/programminghoch10/KeepSplitScreenRatio/Hook.kt @@ -0,0 +1,29 @@ +package com.programminghoch10.KeepSplitScreenRatio + +import android.os.IBinder +import de.robv.android.xposed.IXposedHookLoadPackage +import de.robv.android.xposed.XposedHelpers +import de.robv.android.xposed.callbacks.XC_LoadPackage +import de.robv.android.xposed.XC_MethodHook as MethodHook + +class Hook : IXposedHookLoadPackage { + + override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { + if (lpparam.packageName != "com.android.systemui") return + + val SplitScreenTransitionsClass = XposedHelpers.findClass("com.android.wm.shell.splitscreen.SplitScreenTransitions", lpparam.classLoader) + XposedHelpers.findAndHookMethod( + SplitScreenTransitionsClass, + "setEnterTransition", + IBinder::class.java, + "android.window.RemoteTransition", + Int::class.java, + Boolean::class.java, + object : MethodHook() { + override fun beforeHookedMethod(param: MethodHookParam) { + param.args[3] = false + } + }, + ) + } +} diff --git a/KeepSplitScreenRatio/src/main/res/values/arrays.xml b/KeepSplitScreenRatio/src/main/res/values/arrays.xml new file mode 100644 index 0000000..f8495b0 --- /dev/null +++ b/KeepSplitScreenRatio/src/main/res/values/arrays.xml @@ -0,0 +1,6 @@ + + + + com.android.systemui + + diff --git a/metadata/com.programminghoch10.KeepSplitScreenRatio/en-US/full_description.txt b/metadata/com.programminghoch10.KeepSplitScreenRatio/en-US/full_description.txt new file mode 100644 index 0000000..52731c0 --- /dev/null +++ b/metadata/com.programminghoch10.KeepSplitScreenRatio/en-US/full_description.txt @@ -0,0 +1,3 @@ +Keep the split screen ratio, when switching one of the split apps. + +Only required on Android 14 and later, since previous versions did not force a split resize in this situation. diff --git a/metadata/com.programminghoch10.KeepSplitScreenRatio/en-US/short_description.txt b/metadata/com.programminghoch10.KeepSplitScreenRatio/en-US/short_description.txt new file mode 100644 index 0000000..0662932 --- /dev/null +++ b/metadata/com.programminghoch10.KeepSplitScreenRatio/en-US/short_description.txt @@ -0,0 +1 @@ +Keep the split screen ratio, when switching one of the split apps. diff --git a/metadata/com.programminghoch10.KeepSplitScreenRatio/en-US/title.txt b/metadata/com.programminghoch10.KeepSplitScreenRatio/en-US/title.txt new file mode 100644 index 0000000..ef58b8a --- /dev/null +++ b/metadata/com.programminghoch10.KeepSplitScreenRatio/en-US/title.txt @@ -0,0 +1 @@ +KeepSplitScreenRatio diff --git a/settings.gradle.kts b/settings.gradle.kts index 08d3d26..19fd583 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -55,6 +55,7 @@ include(":ClassHunter") include(":CodecMod") include(":DontResetIfBootedAndConnected") include(":FreeNotifications") +include(":KeepSplitScreenRatio") include(":MotionEventMod") include(":MuteSlf4jWarnings") include(":OpenWifiOnTop")