Question :How to infuse/push/modify/install busybox SU in twrprecovery.img for getting root privilages commands
I want to take backup restore flash change some PM Package management and SM storage Management settings of my android 5.1.1 /6.0 mobile phone through adb shell commands or through twrp terminal without installing twrp or SU or rooting mobile device
- Firstly I want to take backup of mobile system.img userdata.img through adb pull command and then recover write back adb push
My concerns related to first :
a. As adb pull reads and copy data but adb push writes on the device
b. Will adb push work without rooting mobile phone without root privilages.
c. If phone bricked or something gets wrong while rooting and phone is not rooted then will adb push work or not.
Steps of commands using for backup of device
Adb devices
adb reboot bootloader
adb pull /dev/block/mmcblk0 mmcblk0.img
Adb push mmcblk0.img /dev/block/mmcblk0 mmcblk0.img
Using PM package manager on unrooted mobile android 5.1.1 with following commands but error
Adb devices adb reboot bootloader adb shell pm set-install-location 2 adb shell pm get-install-location
Error of command
/sbin/sh: pm: not found
what I understood from above error means that PM binary command file is not available in /sbin/sh/ folder as phone is not rooted so what I think if I put these binary files or install busybox within twrprecovery.img before loading and run temporary pm command so that I don't have to root the device and temporary set the changes in device.
If it's possible then kindly share the link for step by step procedure for modifying twrprecovery.img before booting in pc computer windows as I am new novice to adb shell Linux commands
Thirdly As whenever I run SM storage manager command adb shell following command on unrooted android 6.0 mobile from it gives following errors
Adb devices adb reboot bootloader adb shell sm has-adoptable adb shell sm set -force- adoptable true
It gives following errors
/sbin/sh: sm: not found
what I understood from above error means that SM binary command file is not available in /sbin/sh/ folder as phone is not rooted so what I think if I put these binary files or install busybox within twrprecovery.img before loading and run temporary pm command so that I don't have to root the device and temporary set the changes in device.
If it's possible then kindly share the link for step by step procedure for modifying Twrprecovery.img before booting in pc windows as I am new novice to adb shell Linux commands
Now if boot in fastboot mode and run twrprexovery.img or cwgmod recovery.img with these commands and then in twrp or cgmod terminal windows can I run busybox or Super user or PM SM command
Adb devices Adb boot bootloader Fastboot boot twrprecovery.img
Secondly the whole ideas is that I want to virtually temporary use twrp terminal with busybox or Super user binary to execute services packages like PM (package manager) SM (storage manager) within from twrp recovery menu terminal (loaded in fastboot boot twrprecovery.img mode). Or adb sideload If it's possible technically feasable. If yes then can we modify twrprexovery.img and infuse insert busybox in it before loading or after loading.
- Thirdly I don't want to install twrp or busybox or any super user binary file inside mobile device and don't want to install anything inside mobile except the changes alteration of settings done after execution of SM PM commands. That is I want to execute PM SM from within twrprecovery.img
adb reboot bootloader
boots into bootloader mode. Bootloader mode means fastboot mode. And if device is in fastboot mode only fastboot works, but not adb. See https://android.stackexchange.com/q/221634/2241 – Robert Aug 13 '21 at 12:09pm
,sm
and other similar commands are interfaces to access Android's services like Package Manager, Storage Manager etc. And Android OS is not running when you are in bootloader or recovery mode. So these services aren't running either. – Irfan Latif Aug 13 '21 at 15:26aboot
you can't unbrick from fastboot. just don't touch it. adb is always available in twrp, there is no problem to restore backup (2) pm, sm depends not on rooting. pm always works in android, but set-install-location is only available android 6+ (3) seen this link before, that will just format MicroSD as adoptable-storage (no root required) which is only supported since android 6+ (you don't have it therefore of no use) – alecxs Aug 15 '21 at 09:32