mrh929 / magisk-wifiadb

A magisk module to enable WiFi ADB automatically.
104 stars 16 forks source link

Magisk-WiFiADB

A Magisk module that adds the equivalent of "Wireless(WiFi) Debugging Option" to Stock ROM's running Magisk.

With this module one can have WiFi ADB enabled at all times irresepctive of whether an app is using it(ADB) or not.

Feature

Usage

Configuring WiFiADB to start on boot :

Commands to establish wireless ADB connection

Connect using the command adb connect your-device-IP:1234 - once connected all other adb commands work as they should.

Disconnect using the command adb disconnect

Toggling WiFiADB ON/OFF : Open Magisk Manager App -> Modules

use the Module switch to enable / disable WifiADB

Note : If you accidentally happen to reboot device when this module switch is turned OFF then WiFiADB will not be started on boot.

Configuration

You can configure module settings by creating a config file in module root dir (usually in /data/adb/modules/magisk-wifiadb) with the following lines of code.

ADB_PORT=1234 # your custom port no.
ENABLE_LOG=1 # 0 to disable logging.

Commands to add the above lines to the config file.

adb shell
su
cd /data/adb/modules/magisk-wifiadb/
echo -e "ADB_PORT=1234\nENABLE_LOG=1" > config

Note :

Logs

Logs if 'enabled' can be viewed at /data/local/tmp/wifiadb.log.

How Does It Work (under the hood)

WiFi adb

By setting properties in Android to enable WiFi ADB:

su
setprop service.adb.tcp.port 5555
stop adbd
start adbd