Commit ebdc5e1
修复: Android 16 上 overrideConfig 导致系统电话进程崩溃
在 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>1 parent 0b4b5fe commit ebdc5e1
2 files changed
Lines changed: 8 additions & 20 deletions
Lines changed: 5 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 30 | + | |
| 31 | + | |
38 | 32 | | |
39 | 33 | | |
40 | 34 | | |
| |||
49 | 43 | | |
50 | 44 | | |
51 | 45 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 46 | + | |
| 47 | + | |
61 | 48 | | |
62 | 49 | | |
63 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
174 | 175 | | |
175 | 176 | | |
176 | | - | |
| 177 | + | |
177 | 178 | | |
178 | | - | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
0 commit comments