https://github.com/jakeler/adb-root
Script to transfer files over adb as root
https://github.com/jakeler/adb-root
Last synced: 12 months ago
JSON representation
Script to transfer files over adb as root
- Host: GitHub
- URL: https://github.com/jakeler/adb-root
- Owner: Jakeler
- Created: 2018-09-19T22:06:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-04T20:29:41.000Z (about 6 years ago)
- Last Synced: 2025-04-14T19:41:14.804Z (about 1 year ago)
- Language: Python
- Size: 5.86 KB
- Stars: 19
- Watchers: 1
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ADB root push/pull
This script allows to push/pull files as root over adb (rooted Android device with working busybox/toybox required).
```
usage: adb-root.py [-h] [-m MODE] [-o OWNER] [-c] [--verbose]
[--verbosity {DEBUG,INFO,WARNING,ERROR}]
{push,pull} source target
read/write files as root on any Android device
positional arguments:
{push,pull} pull to copy from device, push to copy to device
source path of the file to copy
target destination for the copied file
optional arguments:
-h, --help show this help message and exit
-m MODE, --mode MODE set mode of file (chmod notation)
-o OWNER, --owner OWNER set owner and group of file (chown notation)
-c, --check calculate and compare hashsum after transfer
--verbose, -v Increase verbosity from default warning level
--verbosity {DEBUG,INFO,WARNING,ERROR} Directly set logging level
```
### Technical background
Detailed:
It reads the file to stdout, sends the stream over adb to a root shell, which writes it with dd to disk/flash.
Changing mode/owner and is done with directly calling chmod/chown and the hashsum check with sha256.
Recursive handling of directories is currently not implemented, but planned for the future.
### Speed
In my tests comparable to the normal adb push/pull, about USB 2.0 performance (30 MB/s). Small files can be drastically slower, because of the shell spawning overhead.