phhusson / treble_experimentations

Notes about tinkering with Android Project Treble
3.4k stars 660 forks source link

How to install system.img (one file) inside super.img (two files, a and b) #2539

Closed ED4free closed 1 year ago

ED4free commented 1 year ago

Hello,

I have a smartphone Blackview BV4900s with android 11, and a Unisoc soc with which it is not possible to unlock flashing from fastboot. Fortunately I have the stock ROM, and I can flash it with SPD Flash Tool. In this ROM there is no system.img but super.img I unpacked super.bimg with imjtool (or lpunpack tool, the result is the same) as explained in this page.I saw that inside super.img there is system_a.img and system_b.img, The second one (b) is empty. I unpacked AOSP-11-system-roar-arm32_binder64-ab-vanilla.img with imjtool, I saw that there was only one file, image.img, although it is ab system partition.

My question is : how do I replace system in the stock ROM with AOSP system ? Do I replace system_a.img in super.img with image.img I extracted from AOSP ?

Thanks a lot.

Thierry

cuynu commented 1 year ago

you can't, because bootloader need to be unlocked to run or flash unsigned image

ED4free commented 1 year ago

Thanks for you answer Cuynu. I precise that I don't flash with Fastboot but with the constructor tool, like Odin for Samsung or SP Flash Tool for Mediatek. For Unisoc it is SPD Flash Tool. I have verified that I can flash with SDP Flash Tool without "Fastboot flashing unlock" (but "Unlock OEM" is enabled in Android Development Options). What I want to do is change system.img inside super.img of the stock ROM, then flash the stock ROM modified with SPD Flash Tool.

pcurz commented 1 year ago

if you can't unlock bootloader, it wont run custom images still EDIT: Check this https://www.hovatek.com/forum/thread-32287.html

cuynu commented 1 year ago

Thanks for you answer Cuynu. I precise that I don't flash with Fastboot but with the constructor tool, like Odin for Samsung or SP Flash Tool for Mediatek. For Unisoc it is SPD Flash Tool. I have verified that I can flash with SDP Flash Tool without "Fastboot flashing unlock" (but "Unlock OEM" is enabled in Android Development Options). What I want to do is change system.img inside super.img of the stock ROM, then flash the stock ROM modified with SPD Flash Tool.

you can't even flash custom unsigned image in sprd u2s diag mode (spd flash tool) without unlocking bootloader, sprd bootrom will reject flash it to super partition, i have tried on my old unisoc sc9863a phone and it doesn't work. If you don't trust me, try it and see.

ED4free commented 1 year ago

Thanks again Cyunu. I trust you. I just wanted to check that we were talking about flashing with SPD Flashtool and not not with Fastboot. It's also a sc9863a. on my phone. I'll see if Blackview accept to change with a Mediatek. Thanks for the support.

ED4free commented 1 year ago

Close : not possible

Fyramiz commented 6 months ago

You can unlock the bootloader using a python script, called unisoc-unlock or something like this, search " rooting n-one npad air tablet" on google, the tool name is there, and also how you can root you're tablet, also, after unlocking the bootloader, when you use "adb reboot bootloader" it will reboot to fastboot, not fastbootd, use "adb reboot fastboot" so you can flash you're imgae, as fastboot can't flash images unless in fastbootD