fix: use persistent=false on Android 16 to prevent system phone process crash#465
Open
xiemobiao wants to merge 1 commit into
Open
fix: use persistent=false on Android 16 to prevent system phone process crash#465xiemobiao wants to merge 1 commit into
xiemobiao wants to merge 1 commit into
Conversation
在 Android 16 (SDK 36) 上,调用 overrideConfig(persistent=true) 会导致 com.android.phone 系统进程崩溃,抛出 SecurityException。由于崩溃发生在 不同的进程中,应用的 try-catch 无法捕获该异常。 此修改通过检测 SDK 版本,在 Android 16+ 上直接使用 persistent=false, 从根本上避免崩溃。代价是重启后运营商配置会丢失,但可通过 Shizuku 重新应用,属于可接受的折衷方案。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
It seems the boolean value of |
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.
Summary
overrideConfig(persistent=true)crashes thecom.android.phonesystem process withSecurityException: overrideConfig with persistent=true only can be invoked by system appcom.android.phone, not the app itself), so the existing try-catch inBrokerInstrumentation.ktcannot catch itBuild.VERSION.SDK_INTand usespersistent=falseon Android 16+, preventing the crash entirelyChanges
BrokerInstrumentation.kt: Replace try-catch fallback with SDK version check, usepersistent=falsedirectly on API 36+Moder.kt: Apply the same fix tooverrideConfigDirectly()Test plan
🤖 Generated with Claude Code