From 6bf5fd237d0ae228c58a9cd2a7f3dc943d9ab8c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E7=A9=BA?= <70465933+YuKongA@users.noreply.github.com> Date: Tue, 1 Oct 2024 23:49:29 +0800 Subject: [PATCH] Fix a issue on Android 15 --- .../top/yukonga/mediaControlBlur/MainHook.kt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/top/yukonga/mediaControlBlur/MainHook.kt b/app/src/main/kotlin/top/yukonga/mediaControlBlur/MainHook.kt index 7a04826..e8159bf 100644 --- a/app/src/main/kotlin/top/yukonga/mediaControlBlur/MainHook.kt +++ b/app/src/main/kotlin/top/yukonga/mediaControlBlur/MainHook.kt @@ -72,12 +72,11 @@ class MainHook : IXposedHookLoadPackage { } else { loadClassOrNull("com.android.systemui.statusbar.notification.NotificationUtil") } - val playerTwoCircleView = - if (Build.VERSION.SDK_INT > 34) { - loadClassOrNull("com.miui.systemui.notification.media.PlayerTwoCircleView") - } else { - loadClassOrNull("com.android.systemui.statusbar.notification.mediacontrol.PlayerTwoCircleView") - } + val playerTwoCircleView = if (Build.VERSION.SDK_INT > 34) { + loadClassOrNull("com.miui.systemui.notification.media.PlayerTwoCircleView") + } else { + loadClassOrNull("com.android.systemui.statusbar.notification.mediacontrol.PlayerTwoCircleView") + } val miuiMediaControlPanel = loadClassOrNull("com.android.systemui.statusbar.notification.mediacontrol.MiuiMediaControlPanel") val statusBarStateControllerImpl = loadClassOrNull("com.android.systemui.statusbar.StatusBarStateControllerImpl") val miuiStubClass = loadClassOrNull("miui.stub.MiuiStub") @@ -245,12 +244,18 @@ class MainHook : IXposedHookLoadPackage { if (!isBackgroundBlurOpened) return@createBeforeHook (it.thisObject as ImageView).background = null - it.result = null } } catch (t: Throwable) { Log.ex(t) } + + if (Build.VERSION.SDK_INT == 35) { + val graphicsA15 = loadClassOrNull("androidx.palette.graphics.Palette\$Builder\$1") + graphicsA15?.methodFinder()?.filterByName("onPostExecute")?.first()?.createBeforeHook { + it.result = null + } + } } else -> return