RikkaApps / Shizuku

Using system APIs directly with adb/root privileges from normal apps through a Java process started with app_process.
Apache License 2.0
11.39k stars 656 forks source link

Samsung Galaxy Z Fold 2 - Shizuku Terminated when Folding Phone #147

Closed LokeYourC3PH closed 3 years ago

LokeYourC3PH commented 3 years ago

So this issue is pretty straight forward. When I use the command to start Shizuku, it stays running even if I turn the screen off either in Folded or Unfolded mode. However, if I change from Folded to Unfolded or Unfolded to Folded, Shizuku stops working and gets seemingly terminated. Could you look into this?

EDIT: Actually, it gets terminated on my Galaxy Z Fold 2 immediately once I unplug USB and turn the screen off.

Mnky313 commented 3 years ago

I can't seem to recreate it by unplugging usb and locking the phone but I have what I assume is the same issue, Shizuku randomly stops in the background and I have not been able to trace down why.

LokeYourC3PH commented 3 years ago

Any dev update?

RikkaW commented 3 years ago

Try Android 11's built-in wireless debugging. (https://shizuku.rikka.app/guide/setup/#start-by-wireless-debugging) Also, have you followed this (https://shizuku.rikka.app/guide/setup/#_5-shizuku-randomly-stops)?

LokeYourC3PH commented 3 years ago

Try Android 11's built-in wireless debugging. (https://shizuku.rikka.app/guide/setup/#start-by-wireless-debugging) Also, have you followed this (https://shizuku.rikka.app/guide/setup/#_5-shizuku-randomly-stops)?

Yes I am using Wireless Debugging which makes it faster, but the problem still exists. And yes followed the closure guide as well. Still, the second I turn off my Fold 2 screen the server stops immediately.

LokeYourC3PH commented 3 years ago

A solution would be great, I checked if anything terminates Shizuku but no "Battery Saving" function is turned on for Shizuku at all, and nothing on my Phone kills apps so aggressively either.

LokeYourC3PH commented 3 years ago

?

RikkaW commented 3 years ago

Nothing I can do if Samsung kills adb processes (adbd restarts) when changing between folded and unfolded.

Run this before and after fold changes to check if adbd do restarts.

adb shell
pidof adbd
LokeYourC3PH commented 3 years ago

Nothing I can do if Samsung kills adb processes (adbd restarts) when changing between folded and unfolded.

Run this before and after fold changes to check if adbd do restarts.

adb shell
pidof adbd

Ok I will try that, but it can't be true because I use two other apps that use adb (and they don't fail), those being Galaxy Max Hz and SetEdit (and also SideActions). Only Shizuku fails so clearly it is something with Shizuku. But I will try the commands you mentioned.

RikkaW commented 3 years ago

Shizuku requires a daemon process runs under adb. So if adbd restarts, Shizuku's process is also killed. This is also the reason of Shizuku needs restart after rebooting.

Some other apps only use adb to grant some development permissions, it only needs to be done once and have no relationship with adbd restart. Shizuku can't uses it because Shizuku is designed to provide full adb permission.