APatch icon indicating copy to clipboard operation
APatch copied to clipboard

Random Restarts and Loss of Superuser Configuration in Latest Version

Open tofuliang opened this issue 10 months ago • 7 comments

Please check before submitting an issue/在提交 issue 前请检查

  • [x] I have searched the issues and haven't found anything relevant/我已经搜索了 issues 列表,没有发现于本问题相关内容
  • [x] If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch/修复失败或刷入修补后镜像不能启动,请前往 KernelPatch 提问
  • [x] I will upload bugreport file in APatch Manager - Settings - Report log/我会上传 bureport 文件从 APatch 管理器 - 设置 - 发送日志
  • [ ] I know how to reproduce the issue which may not be specific to my device/我知道如何重新复现这个问题

Version requirement/版本要求

  • [x] I am using latest CI version of APatch/我正在使用最新 CI 版本

Describe the bug/描述 bug

Random Restarts and Loss of Superuser Configuration after restart

Reproduce method/复现方法

just wait for it

Expected behavior/预期行为

Won't auto restarts

Actual behaviour /实际行为

Random Restarts

Screenshots/截图

Image

Logs/日志

APatch_bugreport_2025-03-11_11_43.tar.gz

Device Name/设备名称

Redmi K20 Pro

OS Version/系统版本

Android 10

APatch Version/APatch 版本

11039

Kernel Version/内核版本

4.14.117

KernelPatch Version/KernelPatch 版本

0.11.2

Additional context/其他信息

already uploaded

tofuliang avatar Mar 11 '25 07:03 tofuliang

Image I have the same problem with the newest version (11039) I before used the 10916 nightly and there I also got sometimes random losses of superuser configuration but no random restarts.

This is one logcat shortly before the restart:

03-06 22:52:56.370  3069  3072 I APatchD : apd::event: [uid_monitor] System packages list changed, sending to tx...
03-06 22:52:56.370  3070  3073 I APatchD : apd::event: [uid_monitor] System packages list changed, sending to tx...
03-06 22:52:56.743  4600  4936 I acid    : dispose()
03-06 22:52:57.145  2135  2135 D KeyguardUpdateMonitor: received broadcast android.intent.action.BATTERY_CHANGED
03-06 22:52:57.148  2135  2135 D KeyguardUpdateMonitor: handleBatteryUpdate
03-06 22:52:57.165   981   981 D [email protected]_handler: SerialClockVote: vote for UART CLK ON
03-06 22:52:57.166   981   981 D [email protected]_lock: Acquire wakelock is acquired 
03-06 22:52:57.166   981   981 I [email protected]_handler: DeviceWakeUp: Writing IBS_WAKE_IND
03-06 22:52:57.170   981  2815 I [email protected]_handler: ProcessIbsCmd: Received IBS_WAKE_ACK: 0xFC
03-06 22:52:57.171   981  2815 I [email protected]_handler: ProcessIbsCmd: Received IBS_WAKE_IND: 0xFD
03-06 22:52:57.171   981  2815 I [email protected]_handler: ProcessIbsCmd: Writing IBS_WAKE_ACK
03-06 22:52:57.197   857  3397 I netd    : trafficSwapActiveStatsMap() <0.48ms>
03-06 22:52:57.200   857  3397 I netd    : tetherGetStats() <1.47ms>
03-06 22:52:57.201   857  3397 I netd    : trafficSwapActiveStatsMap() <0.11ms>
03-06 22:52:57.203   857  3397 I netd    : tetherGetStats() <0.93ms>
03-06 22:52:57.211   981  2815 I [email protected]_handler: ProcessIbsCmd: Received IBS_SLEEP_IND: 0xFE
03-06 22:52:57.293  2135  2135 D KeyguardUpdateMonitor: received broadcast android.intent.action.BATTERY_CHANGED
03-06 22:52:57.294  2135  2135 D KeyguardUpdateMonitor: handleBatteryUpdate
03-06 22:52:57.304   981  2815 I [email protected]_handler: ProcessIbsCmd: Received IBS_WAKE_IND: 0xFD
03-06 22:52:57.305   981  2815 I [email protected]_handler: ProcessIbsCmd: Writing IBS_WAKE_ACK
03-06 22:52:57.316   857  3397 I netd    : trafficSwapActiveStatsMap() <0.29ms>
03-06 22:52:57.318   857  3397 I netd    : tetherGetStats() <1.29ms>
03-06 22:52:57.320   857  3397 I netd    : trafficSwapActiveStatsMap() <0.56ms>
03-06 22:52:57.321   857  3397 I netd    : tetherGetStats() <0.76ms>
03-06 22:52:57.345   981  2815 I [email protected]_handler: ProcessIbsCmd: Received IBS_SLEEP_IND: 0xFE
03-06 22:52:57.370  3070  3070 I APatchD : apd::supercall: [refresh_ap_package_list] Revoking 10320 root permission...
03-06 22:52:57.370  3070  3070 W APatchD : apd::supercall: [refresh_ap_package_list] Skip revoking critical uid: 0
03-06 22:52:57.370  3070  3070 W APatchD : apd::supercall: [refresh_ap_package_list] Skip revoking critical uid: 2000
03-06 22:52:57.370  3070  3070 W APatchD : apd::supercall: [refresh_ap_package_list] Skip revoking critical uid: 0

It seems like it randomly revokes the root permission of 10320 (adaway) which was the only app that had root permissions at that point. (And it was still installed) I get random restarts when I have any module installed (tried with systemless hosts or Zygest Next) or I just give root permissions to any app.

I would be able to debug further if someone helps me, what is needed, but I would be really happy too if someone can fix this.

KoljaFrahm avatar Mar 11 '25 17:03 KoljaFrahm

I have the same issue:

  • Apps selected for Superuser are forgotten time-to-time
  • Apps selected for Exclude Modifications are forgotten time-to-time (not related to the above, so sometimes both are forgotten, sometimes only one of the setting types)
  • Phone randomly restarts, usually several times in a row, and it is good for a few days after

Image

Note: I also have AdAway, working with bindhosts v1.9.7.

Let me know if I can gather some info for further troubleshooting!

UPDATE: After some time it looks like the restarts are related to installing/updating apps. Every time I manually install/update an app it has approximately like an 80% chance to end with a momentary freeze and a reboot. I guess the same happens with Play auto-updates when I experience "spontaneous" reboots.

BenceSzalai avatar Mar 15 '25 13:03 BenceSzalai

It seems that every time there's an app update, the Superuser Configuration gets lost.

tofuliang avatar Apr 03 '25 03:04 tofuliang

Maybe try disableing anything that umounts, like Exclude Modification or disabling root permission for apps. It seems there are problems with that in the latest version for now. I managed to get the latest version run rather stable with no restart after that, but still got huge amount of "[refresh_ap_package_list] Skip revoking critical uid: 0" in logcat.

LiBoHanse avatar Apr 08 '25 02:04 LiBoHanse

If I don't have any modules installed (and reset all settings), I don't get random restarts, just the loss of superuser configuration. If I don't enable any root permission, I guess nothing gets lost (nothing is there to lose), but then I can't use root ^^

KoljaFrahm avatar Apr 08 '25 08:04 KoljaFrahm

Hi, new apatch user. Is there a way to avoid these reboots, which seem to appear when a new app is installed as a matter or fact? I'd like to keep modules (for PIF), but root is not neccessary

hayvan96 avatar May 08 '25 17:05 hayvan96

I would also want to know

KoljaFrahm avatar May 14 '25 14:05 KoljaFrahm

kernel from https://github.com/Official-Ayrton990/android_kernel_xiaomi_sm8150/releases/tag/201220 pstore.zip after random reboot

Image

tofuliang avatar Nov 26 '25 02:11 tofuliang