Android - Enable ADB from recovery
Credits to @TheOnlyAnil-@Firelord^stackoverflow
a) stock recovery + rooted phone
b) custom recovery
- Files changed:
Enable ADB (1/2): enable USB debugging
same as "Settings >> Developer Opcions >> USB debugging" ON
- Connect the device to Mac or PC in recovery mode.
- Now open terminal/CMD in computer and go to platform-tools/. type and enter
adb devicesto check if the device is connected in recovery mode.
- Now type
adb shell mount dataand
adb shell mount systemto mount the respective directories.
- Get the persist.sys.usb.config file in your system using
adb pull /data/property/persist.sys.usb.config /Your directory
- Now open that file in a texteditor and edit it to
- Now push the file back in the device;
adb push /your-directory/persist.sys.usb.config /data/property
- Get the build.prop file;
adb pull /system/build.prop /your-directory
- Add these lines:
- Push build.prop back into the device;
adb push /your-dir/build.prop /system/
Verify options are not present before do it:
adb shell "grep 'persist.service.adb.enable' /system/build.prop"
Enable ADB (2/2): RSA verification
For the RSA verification that you asked to bypass, I don't know whether it would work in your device, but it worked in my little experiment. In Lollipop, the ADB keys (after authorization) are saved in
/data/misc/adb/adb_keys. Your private key is saved in computer. In Linux the directory location is
$HOME/.android/. On Windows that usually translates to
%USERPROFILE%\.android, but keys might end up in
C:\Windows\System32\config\systemprofile\.androidin some cases.
adb push ~/.android/adbkey.pub /data/misc/adb/adb_keys