I have an Android 10 device whose bootloader is unlocked. I have downloaded its firmware, modified it and get the adb shell rooted in recovery. Following are the steps for it:
- Download AIK
- Extract recovery.img and modified ramdisk/default.prop as follows:
ro.secure=0
ro.adb.secure=0
security.perf_harden=0
ro.debuggable=1
persist.sys.usb.config=adb,mtp
- Replace split_img/recovery.img-zImage with permissive kernel(built from kernel sources)
- Repack it and flash it on the device.
- Reboot to recovery and run adb shell. It will be rooted.
I want to add simple chmod 666 /dev/diag
command and I have mounted system with stock recovery mount system option and then tried to do following:
- Write chmod command at the end of init.rc.
- Tried creating new rc scripts under /system/etc/init/ folder. New rc script has just chmod command written in it.
- Tried appending(e.g. echo "chmod 666 /dev/diag" >> /system/etc/init/cameraserver.rc) chmod command in other rc files in /system/etc/init/ folder.
All were not able to change the required permissions. init.rc
changes lost after reboot. Other files/changes persist after reboot but doesn't change the permission of diag port.
OTOH, I was able to make a system app with changes in /system/app/ folder.
Is there anything else that I can try to run the chmod command after phone boots?