fix:修复"允许冻结受保护的应用"无法冻结应用商店(com.xiaomi.market) - #1670
Open
wjy1065676928 wants to merge 1 commit into
Open
Conversation
原实现仅 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)
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
原实现仅 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可以正常冻结应用商店