Skip to content

fix:修复"允许冻结受保护的应用"无法冻结应用商店(com.xiaomi.market) - #1670

Open
wjy1065676928 wants to merge 1 commit into
ReChronoRain:mainfrom
wjy1065676928:pr
Open

fix:修复"允许冻结受保护的应用"无法冻结应用商店(com.xiaomi.market)#1670
wjy1065676928 wants to merge 1 commit into
ReChronoRain:mainfrom
wjy1065676928:pr

Conversation

@wjy1065676928

Copy link
Copy Markdown

原实现仅 hook AOSP 的 ProtectedPackages.isPackageStateProtected, HyperOS 已将冻结拦截迁移至 miui-services.jar 的
PackageManagerServiceImpl.shouldRestrictEnabledSettingsChange, 导致「允许冻结受保护的应用」在 HyperOS 上失效。

新增对该方法的 hook,命中即 setResult(null) 短路原方法,
放行 pm disable / disable-user(含 MIUI_CORE_APPS 名单包)。 方法/类不存在时静默跳过,兼容旧版 MIUI。

以上为DeepSeek V4撰写,实测在我的设备K90PM_3.0.308可以正常冻结应用商店

原实现仅 hook AOSP 的 ProtectedPackages.isPackageStateProtected,
HyperOS 已将冻结拦截迁移至 miui-services.jar 的
PackageManagerServiceImpl.shouldRestrictEnabledSettingsChange,
导致「允许冻结受保护的应用」在 HyperOS 上失效。

新增对该方法的 hook,命中即 setResult(null) 短路原方法,
放行 pm disable / disable-user(含 MIUI_CORE_APPS 名单包)。
方法/类不存在时静默跳过,兼容旧版 MIUI。

(cherry picked from commit 8af8c7e)
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant