Skip to content

Commit

Permalink
Fix a issue on Android 15
Browse files Browse the repository at this point in the history
  • Loading branch information
YuKongA committed Oct 1, 2024
1 parent 5188535 commit 6bf5fd2
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions app/src/main/kotlin/top/yukonga/mediaControlBlur/MainHook.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6bf5fd2

Please sign in to comment.