I have a system.img.ext4.lz4
file that is compatible with my Samsung S10 5G(Qualcomm) device. I have extracted system.img.ext4
file from the system.img.ext4.lz4
using unlz4 system.img.ext4.lz4
command.
I want to play with its content. So I have decided it in two steps:
Flash system.img.ext4
without modification:
tar -cvf AP.tar system.img.ext4
command, I have created a AP.tar file.AP.tar
file using Odin3 v3.13.Flash system.img.ext4
with modification:
a) Modifying
simg2img system.img.ext4 system.img
, you will get a raw image file named system.img
mkdir system
, create directory to mount system.imgsudo mount -t ext4 -o loop system.img system/
you will get all files of system.img
in system
folderls -l system/init.rc
note permissions: 750sudo chmod 777 system/init.rc
give write permissionssudo echo "#MODIFICATION " >> system/init.rc
done some modification in init.rc
sudo chmod 750 init.rc
reset init.rc
to the noted permissionsb) Calculate system sector size
tune2fs -l system.img | grep "Block size\|Block count"
you will get block size and countecho $((1553064 * 4096))
multiply both results. I got 6361350144c) Packing
sudo make_ext4fs -s -l 6361350144 -a system system_new.img sys/
you will get system_new.img
“Android Sparse Image” that has all changessudo umount system
unmount the system directoryrm -fr system
delete the system directoryd) Tar Compression
rm system.img.ext4
remove original system.img.ext4, Don’t worry you should have a backup of it in lz4 filemv system_new.img system.img.ext4
rename system_new.img to system.img.ext4 for flashing with Odin3 v3.13tar -cvf AP.tar system.img.ext4
you will get AP.tar that you can flash with Odin3 v3.13.Please suggest how can I resolve this issue? I will be very thankful to you for any little to big suggestion.
You cannot resolve this error. It's simple why. It's a modified .IMG file. Since you have a Qualcomm Snapdragon, you are not allowed to flash custom/modified software onto your phone. Reason being is because it's bootloader is locked. There is no way for you to unlock it. The reason the one called AP.IMG worked, is because it wasn't modified at all.