This is a project regarding having more control over an Android device without rooting it.
Within Android, Android Debug Bridge (adb
) provides a capability (as a shell
user priviledge) for Android developers to debug and develope.
shell
user priviledge allows me to run my backend on an Android device without having too much of the restrictions, and is the candidate I'm looking for.
Therefore, run commands under this condition is my target.
To access Android Debug Bridge (adb
), normally a developer requires a PC to get connect with it either through USB or internet.
Due to my development of backend software was fully setup on top of an Android device, route command and data out of Android device to a PC and route back again simply for accessing
adb
is over-killing.
Route commands through internet seems to be a good idea to me, however, the wireless debugging feature (introduced since Android 11) enables debugging port only when presenting the pairing information after user clicked the Pair device with pairing code button.
The randomly generated pairing information got dismissed when leaving this Settings UI page.
- Having following apps installed (through F-Droid):
-
Adjust Developer options within Settings app
Wireless debugging:
Set to ONAllow screen overlays on Settings:
Set to ON -
Close Settings app
-
Launch Termux:Float
A terminal would be float on screen
-
Launch Settings app again
Termux:Float remains stay on top of Settings app
-
Clicked the Pair device with pairing code button within Wireless debugging
A pop-up dialog show-up with pairing information
-
Move focus to Termux:Float and issue pairing commands:
1. adb pair localhost:[port number] [pair code]
2. adb connect localhost:[connect port]
-
Verify the status of pairing
-
Get into
~/.android/
folder within Termux (or Termux:Float) Issue command:adb keygen
-
Issue command
ps axw
and kill suspicious process as much as possible.
Some users reported unable to pair due to certificate issues There're two options which might help:
[LinkedIn](https://www.linkedin.com/in/bonian-chen-6781635a)
2023/06/29 First Draft