Created
May 2, 2020 12:26
-
-
Save ylyking/fac90a1d38d7c19c012b0ab4310e920b to your computer and use it in GitHub Desktop.
HOW TO: Modify boot.img to allow usb debugging from recovery adb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ro.secure=0 | |
ro.allow.mock.location=1 | |
ro.debuggable=1 | |
persist.sys.usb.config=adb | |
ro.adb.secure=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a folder where you can work with the boot image | |
mkdir bootedit; cd bootedit | |
adb shell | |
su | |
# Create copy of boot image on sdcard | |
cat /dev/block/bootdevice/by-name/boot > /sdcard/boot.img | |
# exit from su and adb | |
exit;exit | |
# Copy boot image to desktop | |
adb pull /sdcard/boot.img | |
# Extract boot image contents (needs abootimg installed) | |
abootimg -x boot.img | |
# create initrd folder where you can work with initrd image | |
mkdir initrd;cd initrd | |
# change extension to gz (for gunzip tool) | |
mv ../initrd.img initrd.gz | |
# extract initrd contents | |
gunzip initrd.gz; cpio -id < initrd | |
# Change some default.prop values to the same as the attached default.prop file | |
nano default.prop | |
# Add binary files to path (needs to be changed to where you have them) | |
export PATH=$PATH:/home/gregor/Android/AOSPA/out/host/linux-x86/bin | |
mkbootfs . | gzip > ../newinitramfs.cpio.gz | |
cd .. | |
ls | |
# Create new bootimage, change all flags to the ones for your device | |
mkbootimg --kernel zImage --ramdisk newinitramfs.cpio.gz --base 0x80000000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100 --cmdline 'console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=30 msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 vmalloc=350M androidboot.selinux=permissive' -o newboot.img | |
adb push ./newboot.img /sdcard/newboot.img | |
cd .. | |
# Install newboot.img in TWRP and enjoy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment