diff --git a/app/build.gradle b/app/build.gradle index 2371985..4636858 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "io.github.fplus" minSdk 24 targetSdk 33 - versionCode 131 - versionName "1.3.2" + versionCode 135 + versionName "1.3.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/app/src/main/assets/version b/app/src/main/assets/version index 72078e8..fb06143 100644 --- a/app/src/main/assets/version +++ b/app/src/main/assets/version @@ -1 +1 @@ -1.3.2-131 \ No newline at end of file +1.3.3-135 \ No newline at end of file diff --git a/core/src/main/java/io/github/fplus/core/hook/HPhoneWindow.kt b/core/src/main/java/io/github/fplus/core/hook/HPhoneWindow.kt index 51ae115..caf73f4 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HPhoneWindow.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HPhoneWindow.kt @@ -1,8 +1,11 @@ package io.github.fplus.core.hook +import android.content.Context import android.graphics.Color +import com.freegang.extension.findMethodInvoke import de.robv.android.xposed.XC_MethodHook import io.github.fplus.core.config.ConfigV1 +import io.github.fplus.core.ui.activity.FreedomSettingActivity import io.github.xpler.core.entity.HookEntity import io.github.xpler.core.entity.OnBefore import io.github.xpler.core.hookBlockRunning @@ -19,9 +22,16 @@ class HPhoneWindow : HookEntity() { return findClass("com.android.internal.policy.PhoneWindow") } + private fun getContext(params: XC_MethodHook.MethodHookParam): Context? { + return params.thisObject.findMethodInvoke { name("getContext") } + } + @OnBefore("setStatusBarColor") fun setStatusBarColorBefore(params: XC_MethodHook.MethodHookParam, color: Int) { hookBlockRunning(params) { + if (getContext(this) is FreedomSettingActivity) + return + if (config.isImmersive) { args[0] = Color.TRANSPARENT } @@ -33,6 +43,9 @@ class HPhoneWindow : HookEntity() { @OnBefore("setNavigationBarColor") fun setNavigationBarColorBefore(params: XC_MethodHook.MethodHookParam, color: Int) { hookBlockRunning(params) { + if (getContext(this) is FreedomSettingActivity) + return + if (config.isImmersive) { args[0] = Color.TRANSPARENT }