Skip to content

[Bug]: HyperOS 4.0.8 上 shade blur hook 失败(BlurProvider 内部类已迁移至 ShadeBlendBlurControllerImpl),连带 applyElementViewBlend 不触发,1.2.2 #51

Not planned

Description

@luhaoshen

环境

  • 设备:2509FPN0BC
  • HyperOS:OS4.0.8.0.XPBCNXM,build CP2A.260605.016
  • HyperChanger:1.2.2(versionCode 1020239)
  • SystemUI:/system_ext/priv-app/MiuiSystemUI/MiuiSystemUI.apk,ro.secure=1 非 debuggable
  • LSPosed zygisk,SELinux Enforcing

问题现象

SystemUI 启动后立即出现:

[MCProbe] shade blur hook failed: java.lang.IllegalArgumentException:
  no class com.miui.systemui.shade.blur.ShadeBlendBlurController$BlurProvider

后果:

  1. shade blur provider 相关 hook 全部未安装
  2. 面板模糊(soft glass on shade)功能失效
  3. 连带 com.android.systemui.statusbar.notification.utils.NotificationUtil.applyElementViewBlend 近乎不被调用(开机后仅 1 次),模块自身日志为 MCMini: MediaViewGlassEffect recorded no material calls

根因

HyperOS 4.0.8 重构了 shade blur 的类结构,$BlurProvider 内部类从控制器接口迁移到了实现类下:

版本 类名
4.0.x(含 4.0.6) com.miui.systemui.shade.blur.ShadeBlendBlurController$BlurProvider
4.0.8+ com.miui.systemui.shade.blur.ShadeBlendBlurControllerImpl$BlurProvider

反编译本机 SystemUI classes3.dex 可确认新布局:

Lcom/miui/systemui/shade/blur/ShadeBlendBlurController;        (interface)
Lcom/miui/systemui/shade/blur/ShadeBlendBlurControllerImpl;     (impl)
Lcom/miui/systemui/shade/blur/EmptyShadeBlendBlurController;    (empty impl)
Lcom/miui/systemui/shade/blur/ShadeBlendBlurControllerImpl$BlurProvider;
Lcom/miui/systemui/shade/blur/ShadeBlendBlurControllerImpl$start$2 .. $start$13

新类的方法签名与旧版一致,可直接复用现有 hook 逻辑:

public final applyGlassBlurBlurRatio()V
public final setBlurRatio(F)V
public final setEnabled(Z)V
public final setPassBlur(Z)V
public final updateMaxRadius(III)V
public final updateSlowdownBlurFlag(Z)V

建议修复

不要硬编码任一版本的字面类名,改为运行时按优先级探测,两者都不存在时优雅跳过(避免在任何 HyperOS 版本上抛异常导致后续 hook 全部中断):

fun findBlurProvider(loader: ClassLoader): Class<*>? =
    runCatching {
        loader.loadClass("com.miui.systemui.shade.blur.ShadeBlendBlurControllerImpl\$BlurProvider")
    }.recoverCatching {
        loader.loadClass("com.miui.systemui.shade.blur.ShadeBlendBlurController\$BlurProvider")
    }.getOrNull()

调用处判断 null 后跳过 hook 并打一行日志即可。涉及的硬编码位置至少有两处:

  • hypermusiccover/Main 里的 shade blur provider hook 注册
  • iOS shade 的 backdrop blur caller deoptimization(setBlurRatio / updateMaxRadius)

与 #49 的关系(补充数据)

#49 描述的 sCandidates 强引用链在本版本可稳定复现,且与本 issue 存在因果关联:
sCandidates 唯一的写入源 applyElementViewBlend,正因为 shade blur 路径不通而几乎不被调用,所以修复本 issue 是观测/验证 #49 的前提。

在本地对 noteCandidate 增加「写入前清扫 detached key」后实测:

版本 运行时长 ExpandableNotificationRow 通知数 比例
未修复(v5) 27h 158 19 8.3x
修复后(含本 issue 修复) 9h 26 38 0.68x ✅

已确认无异常持有者:NotificationContentView 52 = 26×2,NotificationBackgroundView 52,ViewStub 1721 个全部由 ViewForceDarkStateImpl / MutableViewStubImpl / ViewAnimationHostBridge / RenderNodeStubImpl 1:1 委托或父容器 View[][] 持有,无泄漏。

修复生效时可持续观测到:

[MCProbe] sCandidates swept detached=1 remaining=0

故建议在 #49 中一并对齐:将 noteCandidate 的写入改为跳过/清扫 detached key,比单纯调大上限或依赖 size>512 整体 clear 更有效。

附注

hypermusiccover 包对应的 Kotlin 源码不在仓库中(hypermusiccover/ 目录仅 AmapCapsuleBridge.kt、LyricParse.kt、next/),Main 类为预编译合并产物,故上述分析基于反编译结果。

Activity

  1. added
    invalid
    on Nov 26, 2026
  2. github-actions commented on Nov 26, 2026

    @github-actions

    此报告未通过自动检查,将被标记为 invalid 并自动关闭:

    • 缺少 GitHub 上传的 .log、.txt、.zip 或截图附件;外部链接和代码块中的链接不计入。

    请使用 Bug 报告表单重新提交,填写设备型号、完整 HyperOS 版本、LSPosed 框架版本与日志,并上传相关的 .log、.txt、.zip 或截图文件。
    正文有效内容需至少 60 个字符。上传前请移除日志中的个人隐私信息。

    This report is incomplete and will be labeled invalid and closed automatically. Please submit a complete report with your device model, full HyperOS version, LSPosed version and logs, at least 60 characters of actual text, and an uploaded .log, .txt, .zip or screenshot file.

    この報告は情報が不足しているため、invalid ラベルを付けて自動的に終了します。端末名、HyperOS の完全なバージョン、LSPosed のバージョンとログ、60 文字以上の本文、アップロードした .log・.txt・.zip またはスクリーンショットを添えて再投稿してください。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalid

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions