First, the preparatory work:
Make_ext4fs, mkuserimg.sh, Simg2img,
Put them in the same directory as the. IMG.EXT4 (or. img) file that you want to modify
Second, the conversion source file is the IMG format (. img skipped)
Use the./simg2img src des command to convert USERDATA.IMG.EXT4 format files
Terminal input:
./simg2img USERDATA.IMG.EXT4 Userdata.img
Three, Mount image
Create a new directory to mount this IMG to use on this directory
Terminal input:
sudo mkdir usermain
Create a new directory named Usermain
Continue typing:
Mount-t Ext4-o Loop Userdata.img.ext4 usermain
After the mount is successful, you can manage the files in the IMG in the resource manager.
Iv. Modifying the contents of the image
Create an App directory in the Usermain directory and copy the built-in APK file into it.
sudo mkdir app
Five, RePack
Packaged as. img
Terminal input
777 ./make_ext4fs. /make_ext4fs-l 512m-s-a data userdata_out.img./usermain
Android has a removable app built into the data directory