TWRP Recovery and patched boot for D09 Prime 2

I am trying to rebuild the Prime 2 ROM for anyone who uses an AT&T based SIM for Tracfone, Straight Talk or similar services that go through AT&T so that you can edit the APN’s. I have no idea at this point if this will work until later tonight. I used SuperR’s Kitchen in Linux in a VirtualBox to achive the build. Due to the complexity of getting files in and out of a Ubuntu Linux VirtualBox I decided to just upload it. Once done I’ll download and install it to test. If it works out I’ll make it available here for anyone who may want it.

That is basically a included feature of TWRP to backup the super.img in case anything was accidentally modified, as not every smartphone has this rather convenient firmware flashing procedure like mediatek does.

2 Likes

Well that was a ton of fun :crazy_face: Upload aborted after about 80 minutes. So I decided to try getting it out of the Virtual box onto my computer - every which way to Sunday. Finally got the super.img. @none do you think it would be better to try flashing it with TWRP or SP Flashtool?

Well my mod didn’t work - not too surprised as it’s Android 10… Thank goodness for all involved in creating TWRP for this watch as I had a real problem after flashing my super.img in SP Flashtool. First time it went to a blank screen with a few dots near the bottom. I tried flashing a couple more times with slight variations of vbmeta.img and vbmeta_system.img but all black screened. So I went back to the stock super.img and still had the same black screen result. Fortunately I had backed up the super.img with TWRP and upon doing a restore with TWRP all was good. This was the first time I tried restoring the Super with TWRP - good to know that works too.

The one other option I could try with SuperR Kitchen is to make a signed zip of the super.img and the try flashing it with TWRP. Any thoughts on that?

Yes, because of the encryption.
As I said before, you can’t just cross flash image files which do not match your key.

There is some work going on to see if the “add APN” can be used on the watches. It is tricky as some stuff has been removed or disabled so that the OS is suitable for the watches. The firmware team in China are looking at it.

I will let you know

1 Like

did you use the super.img directly in superR kitchen? From what I can find it doesn’t seem like SuperR have support for super partitions. you could try with only the system.img and afterwards flash it through fastbootd (adb reboot fastboot instead of adb reboot bootloader)

1 Like

Thanks pablo11, While I resolved the APN problem on my watch with the hotswap trick I was hoping it might be an easier fix for others in that situation. At this point I’m still trying some things but don’t really expect to have success with the SuperR kitchen. Android 10 is a b**ch.

@noidremained, Yes I copied the super.img into the kitchen from the v1.4 ROM zip on my first try. Later I copied the whole ROM.zip file into the kitchen which extracted the system.img along with everything else. From there you can work on just the system.img So far I’m just winging it with the SuperR as I haven’t even read directions for using it although I’ve used other image kitchens. Some choices I am looking for help on were whether to use Meta_data, raw or sparse. I tried Meta_data and I’m fairly sure that was a wrong choice.

I noticed when I tried the first flash and got the black screen that it responded to fastboot so I was able to do ‘fastboot reboot recovery’ making it easy to restore with TWRP.

Thanks for your always knowledgeable help!

Could you please provide some photos with how the settings menu look with your original sim card inserted and how it looks after you made the workaround with the other sim card?

1 Like

@noidremained adb reboot fastboot ? don’t think I’ve seen that work on MTK - when you are doing adb reboot bootloader you have access to using fastboot unless I’ve forgotten something. Just for the heck of it I tried adb reboot fastboot and TWRP came up. Played around a bit more with SuperR but I don’t think people are having much luck with it on android 10. One more thing to try then I give up.

@none, I can try this with my other Prime 2 but as difficult as it was to get that done I don’t want to take a chance of losing the good working APN settings I now have. I’ll see what I can do after messing with this SuperR image I made (pretty sure I’ll be looking at a soft brick).

flashing system.img with fastboot results in error: system does not exist as I somewhat expected since it’s in the super.img. Worth a try anyway… rebooted and everything is fine.

@none, These pictures don’t show this very will but all the ATT Nxtgenphone APN settings are very grayed out and can’t be changed. The Straight Talk settings are brighter and can all be modified. I assume the lack of difference in brightness is my cameras autoexposure compensating. But to my eyes it is very different. Also note from the main APN screen there is no option to add another APN. Originally the APN settings menu only showed the ATT Nxtgenphone and it could not be modified at all.

Darn now I can’t get the SIM card out - never had that problem before…

Got it out - if anyone else runs into that problem try getting a fairly stiff but thin piece of paper, cut it to slightly less than width of the sim slot, bend up the tip a little and slip it in over the top of the sim card then pull out on the tray.

20210108_155154 20210108_155207 20210108_160037

1 Like

I guess it makes sense that it doesn’t work when you have twrp. There’s a difference between normal fastboot and fastbootd. Fastbootd is on the recovery partition together with recovery which makes it able to for example flash partitions that are part of the super partition

1 Like

My mistake I wasn’t aware of Fastbootd and had just assumed that was a typo. I’ll check it out later. :+1:

1 Like

So, you did not return your "review ’ samples?
The Sim card problem was in the early review samples.
The later ones have a different Sim tray and no problem.

Ok nice but why do such crazy things? what’s the plan? since we will not be able to install any other operating system.

@droidtrix
Check your PMs.
Cheers

I had a bit of a surprise with a Samsung phone on Android 10. It was an AT&T phone which in the U.S. normally has an unlockable bootloader. However a couple weeks ago some guys on XDA got contact with someone I assume is an insider who figured out a way to unlock them. This is a big deal - first ever in years of having locked bootloaders which could not be unlocked and so phones those phones could not be rooted. I worked with one of the two people doing this (helping test TWRP) who also builds custom TWRP for phones so I got this phone unlocked, rooted and TWRP installed. Now why is this relevant here?

Well because I tried modifying the Samsung boot and shutdown animation and was successful in doing that! Considering I was able to change, delete and copy things to /system/media and also /prism/media/carriers/single/ATT/media/ I would think those would be in a super partition and thus not able to write to them. But I was able to do that and they are still there after multiple reboots. So I am surprised I can’t change the bootanimation on the Kospet P2 especially considering how much more locked down Samsung and AT&T normally is. Kospet’s boot animation is in /system/media also. Just another curiosity which I’m guessing someone with more knowledge might be able to explain. :wink:

It is a lot to do with the chosen architecture used to build the system.
There are several different methods and reading the Magisk documentation actually helps explain.
I highly recommend that you have a look… Especially even further into the CANARY build docs…

So basically it depends on partitioning and levels of security used.
I hope this helps on your journey to enlightenment and possible root :+1::+1:

1 Like

you can actually change the boot animation on the prime 2 quite easily. and I changed it myself before I even found the easy method. I’m planning to write a long post soon which will include this, I just haven’t found the time for it yet

3 Likes