ADB Root Enabler

anasfanani

Magisk
v1.3
Version
9.91 KB
Size
Jun 8, 2024
Updated

Module Info

  • Contributors anasfanani, xweiba
  • Source Code View Repository
  • Tags
    #ADB #ADB Root #Wireless ADB #Broken Screen #system.prop #Magisk Module #anasfanani

About this module

ADB Root Enabler by anasfanani switches ADB on and removes the "Allow USB debugging?" authorization prompt. The main use is a phone whose screen is broken: you can't tap that prompt, but with this module installed you can still connect from a PC, over USB or over the network.

What it changes

The module has no scripts. It's a single system.prop that Magisk applies at boot:

ro.debuggable=0            # 1 in the debugable variant
ro.adb.secure=0
persist.service.adb.enable=1
persist.service.debuggable=0   # 1 in the debugable variant
persist.sys.usb.config=mtp,adb
service.adb.tcp.port=33445     # 5555 in the two -5555 variants
  • ro.adb.secure=0 turns off ADB's RSA key check, so no authorization prompt appears.
  • persist.sys.usb.config=mtp,adb keeps USB in file transfer (MTP) plus ADB mode.
  • service.adb.tcp.port makes adbd listen on the network as well, so you can connect over Wi-Fi (added in v1.3 by xweiba).
  • ro.debuggable=1, only in the debugable variant, marks the build as debuggable. adbd needs that before adb root will restart it as root; with the other two you get a normal shell and use su.

Which zip to pick

Zipro.debuggableTCP port
Adb-Root-Enabler-v1.3.zip033445
Adb-Root-Enabler-5555-v1.3.zip05555
Adb-Root-Enabler-debugable-5555-v1.3.zip15555

Port 5555 is the one adb connect assumes by default. Install only one variant; they share the module ID Adb-Root-Enabler, so a new one replaces the old.

Installation

  1. Install the zip from the Modules screen in Magisk, or flash it in TWRP. The installer uses Magisk's own installer functions, so Magisk v20.4 or newer has to be on the phone either way.
  2. Reboot.
  3. Connect over USB with adb devices, or over the network with adb connect <phone-ip>:5555 (or :33445 for the default zip).
  4. On the debugable variant, adb root restarts adbd as root. On the others, run adb shell and then su.

To undo it, remove the module in Magisk and reboot. Version 1.2, the older release, came in adb-only, mtp and rndis USB variants and has no network port.