Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround - Keeping shizuku working after leaving wifi #864

Open
3 of 4 tasks
louis-br opened this issue Dec 31, 2024 · 0 comments
Open
3 of 4 tasks

Workaround - Keeping shizuku working after leaving wifi #864

louis-br opened this issue Dec 31, 2024 · 0 comments

Comments

@louis-br
Copy link

Requirements:

  • Shizuku version is up-to-date
  • Shizuku is downloaded from official channels (GitHub release or Google Play)
  • Shizuku is not running in a virtual environment or broken ROM (GrapheneOS)
  • (Root users) No Xposed installed / Xposed is not enabled for Shizuku

Information:

  • Shizuku version: 13.5.4.r1049.0e53409
  • Mode: adb
  • Android version: Android 14 (OneUI 6.1)
  • Device: S21 5G

Here is one way I found to work on my phone S21 5G, I haven't tried other workarounds such as "turning off and on usb debugging", described in the issues.

Related issues and discussions:

#544
#611
#225
#202
#491

By using adb tcpip <port>, you can use adb even after disabling adb over wifi:

You need wifi or usb to get an adb connection, after that it doesn't seem to be necessary to keep wifi on.

After establishing an adb connection (see below), you can run adb tcpip 5555 in the client to restart adbd (on the phone) listening on port 5555. This will disable "debugging over wifi", however you can now connect over the network or localhost on that port. You don't need to be on a network or wifi for this.

Could shizuku give more support for this method? I know it can connect to port 5555. Could it call adb tcpip 5555 optionally, with a button or a checkbox? This seems it would make shizuku more reliable to things like changing networks and losing wifi signal, however I'm not sure this makes adb more exposed security-wise. This would make it easier to find the port too.

Currently for those seeking to use adb after leaving a wifi network, you can use termux:

Pairing:

  1. Put termux on a (top) window or windowed mode / half screen
  2. On the other half, put the Settings app with the wireless debugging pairing screen
  3. Run the command with the details shown in the screen
adb pair ip:(randomly generated pairing port) <paircode>

Connecting adb:

adb connect localhost:(randomly generated port)

However you can use this workaround to avoid finding the port manually:

https://stackoverflow.com/questions/65991502/adb-over-wi-fi-android-11-on-windows-how-to-keep-a-fixed-port-or-connect-aut

for p in `nmap localhost -p 37000-44000 | awk "/\/tcp/" | cut -d/ -f1`; do adb connect localhost:$p ; done

Restarting adbd:

adb tcpip 5555

Security note: would be nice to know if it's safe to run that way, or otherwise limit incoming connections to localhost if possible, maybe using adb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant