[NB1 - Nokia 8][Android 9]Patching Stock boot.img with TWRP? - Android General

Hi!
I have coped, with DD (/dev/block/ sda6) on adb slot_a and slot_b to .img files. 64 MB (65535 KB). This is the latest OTA SP for the Official Android 9 from Nokia.
I am trying to patch TWRP onto it, but I can't find a guide for it. Does anyone have one or can tell me how-to? Should I get the TWRP from the twrp.me for my device and patch with, or how should I do it. I'm a bit rusty, it's been a while since I hacked Android.
From TWRP later I can switch slots and copy / backup that partition too, right?

Related

Advanced OTA keeping Magisk and TWRP (needs a computer)

History...
I originally wrote this guide to upgrade from 10.0.4.0 to 10.0.7.0.
I have also used this same guide to install every OTA from 10.0.7.0 to 11.0.11.0.
This guide assumes you have both Magisk and TWRP, that Magisk cannot "uninstall" (because of TWRP installation) and that you want to keep both Magisk and TWRP after installation. Parts of this guide may still be useful if you aren't in this exact situation.
If you only have Magisk, you should be able to follow these much simpler instructions: https://forum.xda-developers.com/mi-a2-lite/how-to/guide-install-magisk-proper-support-ota-t3836952
Things to have on hand:
- vanilla_boot.img (for the version you currently have)
- patched_boot.img (your current boot image with Magisk)
- TWRP img and zip (see version info below)
I think that TWRP also causes the vendor partition to be modified. It may also touch system but I have a modified bootanimation.zip which modifies system, so I can't be sure. In any case, I also have a backup of system.img and vendor.img.
Because Magisk is installed after TWRP, Magisk's "backup" of the "stock boot image" is not vanilla. This means that in order to take the OTA, I have to flash the vanilla boot image.
0 - Update your patched_boot.img
If you don't have a patched_boot.img for your current Magisk (eg. my patched_boot.img was old, since I had installed several Magisk updates), you should build a new patched_boot.img so that when you boot it, the system will continue to work.
Push the vanilla image to the phone.
Code:
adb push vanilla_boot.img /sdcard
Then get Magisk to install using the "Select and Patch a File" method, select the file you uploaded. Then pull down the patched image.
Code:
adb pull /sdcard/Download/magisk_patched.img patched_boot.img
1 - Prepare to OTA
For some reason, my carrier does not like the OTA process so I always turn on Airplane mode + Wifi.
Get to fastboot and check the current slot.
Code:
adb reboot bootloader
fastboot getvar current-slot
My current slot was b
Flash the system and vendor partitions (if necessary).
Code:
fastboot flash system_b vanilla_system.img
fastboot flash vendor_b vanilla_vendor.img
Flash vanilla and boot the patched image (so that Magisk is active and the OTA can be applied).
Code:
fastboot flash boot_b vanilla_boot.img
fastboot boot patched_boot.img
2 - Do the OTA
Install OTA (DO NOT REBOOT)
If the OTA fails
If the OTA fails, you can find out which partitions it doesn't like from the logcat. If you have a fastboot image, you can reflash the affected partitions. As previously mentioned, I've had to flash all of boot, vendor and system for each OTA.
Code:
adb logcat | grep update_engine
...
07-01 06:52:38.470 E/update_engine(935): [0701/065238.470683:ERROR:delta_performer.cc(990)] The hash of the source data on disk for this operation doesn't match the expected value. This could mean that the delta update payload was targeted for another version, or that the source partition was modified after it was installed, for example, by mounting a filesystem.
07-01 06:52:38.470 E/update_engine(935): [0701/065238.470931:ERROR:delta_performer.cc(995)] Expected: sha256|hex = A4AD686D7BF628486668446221D0089BF5915DBC1158C83D30A06222FE7D2ACB
07-01 06:52:38.471 E/update_engine(935): [0701/065238.471002:ERROR:delta_performer.cc(998)] Calculated: sha256|hex = 4CADBE88EC1C019913A0B416EB9031840D4BA6B2287A3FC814A2B8B7F9871F7D
07-01 06:52:38.473 E/update_engine(935): [0701/065238.471072:ERROR:delta_performer.cc(1009)] Operation source (offset:size) in blocks: 0:5221,5461:405,5869:1,5873:343,6221:589
07-01 06:52:38.473 E/update_engine(935): [0701/065238.473233:ERROR:delta_performer.cc(1191)] ValidateSourceHash(source_hash, operation, source_fd_, error) failed.
07-01 06:52:38.473 E/update_engine(935): [0701/065238.473340:ERROR:delta_performer.cc(298)] Failed to perform BROTLI_BSDIFF operation 187, which is the operation 0 in partition "boot"
07-01 06:52:38.473 E/update_engine(935): [0701/065238.473411:ERROR:download_action.cc(337)] Error ErrorCode::kDownloadStateInitializationError (20) in DeltaPerformer's Write method when processing the received payload -- Terminating processing
07-01 06:52:38.739 E/SystemUpdate(15410): [Execution,NonStreamingAbApplyAction] Installation failed with error code: 20.
3 - Backup the vanilla boot image
Note that you need to pull from the other slot (in my case, a).
Code:
adb shell
su
dd if=/dev/block/by-name/boot_a of=/sdcard/vanilla_boot.img bs=1024k
Backup system.img and vendor.img too (if required).
Code:
dd if=/dev/block/by-name/system_a of=/sdcard/vanilla_system.img bs=1024k
dd if=/dev/block/by-name/vendor_a of=/sdcard/vanilla_vendor.img bs=1024k
4 - Magisk patch the other slot
Use Magisk to "Install to Inactive Slot (After OTA)" (DO NOT REBOOT)
5 - Backup the patched boot image
Note that you need to pull from the other slot (in my case, a).
Code:
dd if=/dev/block/by-name/boot_a of=/sdcard/patched_boot.img bs=1024k
exit
exit
# back on your computer
adb pull /sdcard/vanilla_boot.img
adb pull /sdcard/patched_boot.img
Pull down system and vendor images too (if required).
Code:
adb pull /sdcard/vanilla_system.img
adb pull /sdcard/vanilla_vendor.img
Now you can let Magisk reboot. This is the moment of truth...
At this point you should have an upgraded, Magisk-enabled system and backups of the vanilla and patched boot images. Congratulations on completing the OTA!
If the system fails to boot
There's a few things to try before giving up if the system fails to boot...
1) Boot without Magisk (fastboot boot vanilla_boot.img). Probably indicates that a Magisk module you have is no longer compatible.
2) Boot TWRP (fastboot boot twrp.img) and poke at things. As an example, I used the /sdcard/mm program (part of Magisk Manager for recovery) to disable EdXposed when the OTA to Android 10 failed to boot.
6 - Restore TWRP
It is possible to boot TWRP from fastboot so you don't strictly need to install TWRP. I like to have it available anyway.
Old version info...
I had been using the official TWRP 3.2.3, which worked great up until 10.0.9.0. With 10.0.9.0, I couldn't get to TWRP, I just got the system destroyed screen. I could fastboot boot it, but it couldn't mount /data (a problem it has always had).
I figured out that TWRP 3.3.1-dees_troy (from the official TWRP site) works with 10.0.9.0 and up. What's more, it works (can decrypt /data) if you fastboot boot it, not just after install. So you could in theory simply not install TWRP and fastboot boot if in the event that you actually need it.
I know that people have their own favourite versions, with the offain version being popular (didn't work for me). There's OrangeFox too (also didn't work for me).
In summary, I recommend Official TWRP 3.3.1-dees_troy but if you have a favourite alternative, feel free to use it instead.
TWRP thread: https://forum.xda-developers.com/mi-a2-lite/development/official-twrp-daisy-t3855396
Download link: https://dl.twrp.me/daisy/
Restoring TWRP is the same as installing it the first time. This is the process that I use.
Flash vanilla boot, then install TWRP to it.
Code:
adb reboot bootloader
fastboot boot twrp-3.3.1-dees_troy-daisy.img
Install TWRP
Code:
adb push twrp-installer-3.3.1-dees_troy-daisy.zip /sdcard
Use TWRP to install twrp-installer-3.3.1-dees_troy-daisy.zip
I install my modified bootanimation.zip at this time.
Mount System from TWRP (it is normally already mounted for me).
From a shell:
Code:
adb shell
cd /sdcard
cp bootanimation.zip /system/system/media/bootanimation.zip
Umount System
You must re-install Magisk after installing TWRP.
Code:
adb reboot bootloader
fastboot boot patched_boot.img
Use Magisk to "Direct Install (Recommended)"
Reboot
For some reason, my carrier does not like the OTA process so at this point I normally power off the phone rather than just rebooting. When the phone boots, I can turn off airplane mode and check that a mobile data connection can be made.
7 - Confirm that everything works
Make sure the system comes up and Magisk Manager says that Magisk is installed.
Make sure you can get to TWRP. Boot while holding VOL+ or
Code:
adb reboot recovery
Make sure TWRP can see your files.
Congratulations! You have installed an OTA while keeping Magisk and TWRP!
8 - Backup boot.img with TWRP + Magisk (optional)
If you want a copy of the boot.img with both Magisk and TWRP. This pulls from the now-current slot (in my case, a). I'm not totally sure of the value of this, since I can't get fastboot to boot this image. It may come in handy if you upgrade TWRP and that breaks (since you can flash this back rather than having to install the old TWRP again).
Code:
adb shell
su
cd /sdcard
dd if=/dev/block/by-name/boot_a of=twrp_boot.img bs=1024k
exit
exit
# back on the computer
adb pull /sdcard/twrp_boot.img
Thanks. Could you upload or indicate where we can get the necessary files?
Will i loose all user data and internal storage wiped if i do this?
Thanks for sharing, looks complicated, also i think you should use a fixed twrp, since the official dont have acces to sdcard.
rossarnie said:
Thanks. Could you upload or indicate where we can get the necessary files?
Click to expand...
Click to collapse
If you have Magisk, you should already have the vanilla and patched boot.img files.
Of you don't already have Magisk, just follow the install procedure here. https://forum.xda-developers.com/mi-a2-lite/how-to/guide-install-magisk-proper-support-ota-t3836952
If you're running 10.0.4.0 without magisk and need to extract your vanilla boot.img. Use fastboot to boot into twrp and then you can do the DD command to extract boot. Use adb pull to save it to PC.
I used official TWRP from here.
https://forum.xda-developers.com/mi-a2-lite/development/official-twrp-daisy-t3855396
Apparently there's a different twrp that can access the external SD card. I don't have an external SD card so I don't need it.
dr.bahaeddin said:
Will i loose all user data and internal storage wiped if i do this?
Click to expand...
Click to collapse
I didn't lose any data.
I've never had a problem with Magisk. TWRP does tend to bootloop after install, which is why I install magisk again.
You should be able to flash the patched or vanilla boot if twrp is boot looping to fix it too. Just won't have twrp anymore.
a1291762 said:
I didn't lose any data.
Click to expand...
Click to collapse
Mind you. I have a backup of my apps and data that's off of my phone so even if I do need to factory reset I can get it back. That's a longer and more complicated guide.
Txatxiquesi said:
looks complicated.
Click to expand...
Click to collapse
Before I had twrp the standard Magisk ota process was enough. But that loses twrp and with twrp in my magsik backup, the uninstall didn't work. So extra steps are needed. Plus some extra steps to make backups of important files for the next OTA
a1291762 said:
If you have Magisk, you should already have the vanilla and patched boot.img files.
Click to expand...
Click to collapse
Hmm... This may not be the case. I'm careful to make backups but it's easy to skip this.
If you don't have a patched boot image you can backup your current boot partition from a root shell. You need to find out if you are booting a or b slot. Then
dd if=/dev/block/by-name/boot_a of=/sdcard/patched_boot.img bs=1024k
Magisk puts old stock backups into /data. I had 4 files in there which makes it hard to know what each file is.
That's why I made sure to backup my vanilla boot image immediately.
If you're stuck without a vanilla 10.0.4.0 boot you can't do the OTA. I can upload mine somewhere when I get home tonight if it's not already online.
a1291762 said:
...If you're stuck without a vanilla 10.0.4.0 boot you can't do the OTA. I can upload mine somewhere when I get home tonight if it's not already online.
Click to expand...
Click to collapse
This would be very helpful, please
FunkmasterC said:
This would be very helpful, please
Click to expand...
Click to collapse
Here is the backup I made of the 10.0.4.0 vanilla boot.img. You'll need to decompress this before flashing.
URL REMOVED
What's new on 10.0.7.0 bro? Should me wait for 10.1 update if im on 10.0.4.0 rooted?
10.0.7.0 has the March security patches. I haven't noticed any actual changes.
Thank you, your Linux commands are sick, I never know I can get the vanilla and patched boot.img like that.
Cheer~
is there an update for file version 10.0.8.0??
I only just got the notification this morning. I'll do the upgrade tonight but I expect the same process will work.
I just used the same process to go from 10.0.7.0 to 10.0.8.0. This time I was installing to slot b instead of slot a, but otherwise, things were the same.
A side note... I hadn't got around to installing TWRP 3.3.0 so I did that but it couldn't mount /data. TWRP 3.2.3 can mount /data, so I installed that again.
a1291762 said:
I just used the same process to go from 10.0.7.0 to 10.0.8.0. This time I was installing to slot b instead of slot a, but otherwise, things were the same.
A side note... I hadn't got around to installing TWRP 3.3.0 so I did that but it couldn't mount /data. TWRP 3.2.3 can mount /data, so I installed that again.
Click to expand...
Click to collapse
I have successfully updated to 10.0.8.0 with Magisk 18.1, now on Magisk 19.1, everything is running fine. I'd like to also install TWRP but refrain from doing so because of the problems (bootloops, crashes, etc) the official TWRP 3.2.3 shows with decryption in Pie and mounting external or even internal sdcard. I wonder if the latter is fixed in the inofficial fixed version. I think the benefit of TWRP is not worth the effort of repeating a1291762 wonderful tricky procedure on the monthly OTA update basis.
However the procedure is very smart, a back-to-the-roots approach of former days... great, I like it.
But I don't understand how a patched_boot.img can be created from an empty file (boot_a)?
[dd if=/dev/block/by-name/boot_a of=patched_boot.img bs=1024k] Locating the boot_a in </dev/block/by-name/> reveals a boot_a file with 0 bytes. Moreover, to unzip the zipped stock boot Image in </data/stock_boot*.img> or </sbin/.magisk/mirror/data/> I am looking for a command that just returns the boot file rather than expanding it to the full partition. Weird, can anybody help?
Thanks again to a1291762
grufty47
It appears that it is not possible to add some boot.img as attachment
grufty47 said:
I'd like to also install TWRP but refrain from doing so because of the problems (bootloops, crashes, etc) the official TWRP 3.2.3 shows with decryption in Pie and mounting external or even internal sdcard.
Click to expand...
Click to collapse
I use official TWRP 3.2.3. Only really to fix bootloop problems.
I don't have a SD and no problems mounting data.
Lots of people following the TWRP install guide seem to get bootloop. I solve that by patching boot with Magisk. Some people recommend installing an old about image.
If you have a backup of boot you can at least restore that if you have problems.
grufty47 said:
But I don't understand how a patched_boot.img can be created from an empty file (boot_a)?
Click to expand...
Click to collapse
Welcome to Unix, where nearly everything is a file.
Hard disk? /dev/sda
Partition? /dev/sda1
File? /mnt/sda1/file.txt
In this case, boot_a is a way to access a partition on the phone's flash. Actually a link (shortcut) to /dev/mmcblk0p52. Partition number 53 on flash chip 1. The size can't be seen because it's a device and not a file.
grufty47 said:
I am looking for a command that just returns the boot file rather than expanding it to the full partition.
Click to expand...
Click to collapse
dd is a command to read a device. The partition is 64M big so that's the size of the file. gzip can compress well because the actual image is only 24M big and the rest is empty.
Magisk knows how to do it. A tool called magiskboot but I don't know where it lives or how to run it.
I found this header from magiskboot. It shows how the boot.img is structured.
https://github.com/topjohnwu/Magisk/blob/master/native/jni/magiskboot/bootimg.h
I just did the 10.0.9.0 OTA. I added a section of updating your patched_boot.img (since the Magisk updates I did made my old one useless) and I changed the backup instructions due to changes in Magisk 19. If you know where the stock boot lives before reboot, please let me know.

Oukitel WP5

This is a great rugged phone, perfect for the outdoors (I'm a keen mountaineer). I couldn't see a thread so I thought I would start one! A couple of posts re. rooting to follow....
Hey @dwastell, I know this thread is a couple months old, so I wanted to see if you have any root instructions?
Do you think the process for rooting the OUKITEL K13 here on the forum will work on the WP5?
Rooted!
Hi all,
I rooted my WP5. Sorry for not having time to write a full tutorial, only a concise story. Of course this is ONLY for experienced users...
My phone is 4GB version Android 10, build 10.0_V02_20200508.
1) download the firmware from oukitel website: https://oukitel.com/pages/download-center (1)
2) download and install SP Flash Tools https://spflashtool.com/download/
3) download and install Android Platform Tools https://developer.android.com/studio/releases/platform-tools
4) connect the phone to PC and verify that adb is working
5) WARNING: make a backup af your data!
6) unlock the bootloader:
- in Developer options enable the unlock
- adb reboot bootloader
- fastboot flashing unlock
- fastboot reboot
Now the phone restarts and is completely virgin!
7) shutdown the phone.
8) using SP Flash Tools readback the following partitions:
- boot
- recovery (2)
- vbmeta
9) download the attached patched_vbmeta.img
10) transfer the boot.img that you just readback to the phone download folder
11) install Magisk Manager (today 7.5.1)
12) Use Magisk Manager to patch the boot.img and copy back to PC
13) flash the images:
- fastboot flash --disable-verification vbmeta patched_vbmeta.img
- fastboot flash boot magisk_patched.img
- fastboot reboot
14) if the phone boots up run Magisk Manager to check if it's installed.
14b) if the phone goes in bootloop... flash back the original images you have read back (do not use the firmware you downloaded from Oukitel, it's necessary only to have the scatter file (the partition table).
Enjoy
Nicola
Notes:
(1) actually there are 2 firmware available and despite having different names are the same. This fw is Android 9.
(2) not used now but may be useful in the future
Rooting the WP5
totallybeachin said:
Hey @dwastell, I know this thread is a couple months old, so I wanted to see if you have any root instructions?
Do you think the process for rooting the OUKITEL K13 here on the forum will work on the WP5?
Click to expand...
Click to collapse
I eventually succeeded in rooting my WP5 with Magisk. For a while, the firmware was not available but once the official ROM was published, I managed to patch boot.img and install via fastboot. My phone is the 4 GB version -copies of the stock and patched boot image are available at: github.com/dwastell/Oukitel_WP5_magisk
I have experienced some complications as detailed in my next post...
Cheers, Dave
Rooting the WP5
Thanks for your post Nicola. You'll see that I did succeed in rooting my phone (Android 9) with Magisk, once I was able to get hold of the stock firmware. All is working though there are a couple of points worth noting.
The phones is SAR ("system-as-root") and the magisk instructions suggest that recovery.img is patched rather than boot.img. I proceeded by patching boot.img, as in your instructions, as this seemed a better solution - and it works fine.
One problem has occurred with updates. Magisk manager appears to assume that the recovery partition is the one that has been patched. When you do the direct install for the update, partition 2 is flashed (recovery) rather than partition 26 (boot). On rebooting the phone inevitably goes into boot loop.
To avoid this, I go for "select and patch a file" option, and then install again via fastboot as per the original installation. A bit of a hassle but better than the alternative!
Does this mean you were able to root the phone but revert to android 9? Both of you mention Android 9 in your posts.
vivekiny2k said:
Does this mean you were able to root the phone but revert to android 9? Both of you mention Android 9 in your posts.
Click to expand...
Click to collapse
No. No need to revert.
I rooted an Android 10. But cited the stock Android 9 only because the scatter file (ie. the partition table) is the same.
@dwastell rooted the Android 9.
Please read better my tutorial, if something is not clear... I'm here!
N
---------- Post added at 20:10 ---------- Previous post was at 19:59 ----------
dwastell said:
The phones is SAR ("system-as-root") and the magisk instructions suggest that recovery.img is patched rather than boot.img. I proceeded by patching boot.img, as in your instructions, as this seemed a better solution - and it works fine.
Click to expand...
Click to collapse
This phone is NOT a SAR. Neither Android 9 nor 10. The proof is that patching the boot.img worked!
One problem has occurred with updates.
Click to expand...
Click to collapse
Have you unrooted before applying the update?
Which kind of update? Not all are the same!
Android version
vivekiny2k said:
Does this mean you were able to root the phone but revert to android 9? Both of you mention Android 9 in your posts.
Click to expand...
Click to collapse
My phone was originally Android 9 so no reversion...
SAR
Both "Treble Check" and "Magisk Manager" confirm that the phone is SAR. I agree this is odd.... your thoughts?
The update I was referring to is the Magisk update, handled by Magisk Manager. Given that the phone is seen as SAR, it attempts to patch recovery.img, with an ensueing boot loop.
No, I don't unroot the phone
nicolap8 said:
No. No need to revert.
I rooted an Android 10. But cited the stock Android 9 only because the scatter file (ie. the partition table) is the same.
@dwastell rooted the Android 9.
Please read better my tutorial, if something is not clear... I'm here!
N
---------- Post added at 20:10 ---------- Previous post was at 19:59 ----------
This phone is NOT a SAR. Neither Android 9 nor 10. The proof is that patching the boot.img worked!
Have you unrooted before applying the update?
Which kind of update? Not all are the same!
Click to expand...
Click to collapse
Thanks Nicola for your tutorial. I'm eager to root my WP5 Pro with Magisk, but first I need a backup of boot vbmeta and recovery. I have made extensive use of SP Flash Tools but never to readback partitions so I'm having some problems here. Could you please detail your technique to extract such files? Thank you
Michele
Build number OUKITEL_WP5Pro_EEA_V01-20200624 CPU MT6762D, 8 cores,64 Gb ROM, 4 Gb RAM.
wallace108 said:
Thanks Nicola for your tutorial. I'm eager to root my WP5 Pro with Magisk, but first I need a backup of boot vbmeta and recovery. I have made extensive use of SP Flash Tools but never to readback partitions so I'm having some problems here. Could you please detail your technique to extract such files? Thank you
Michele
Build number OUKITEL_WP5Pro_EEA_V01-20200624 CPU MT6762D, 8 cores,64 Gb ROM, 4 Gb RAM.
Click to expand...
Click to collapse
Beware: your phone is different! So I don't know:
1) Android version.
2) which kind of booting are using, read here https://topjohnwu.github.io/Magisk/install.html#knowing-your-device
Before writing an image you MUST have a backup of it!
To read back a partition with SP Flash Tools you need to know the start address end the length of the partition. This information is available only (because your phone is not yet rooted) from the scatter file (from the SAME phone).
In the Readback page hit "Add" then input a name for the image file. Follows a new dialog "Readback block start address" where you have to write the values.
After this you can give the Read Back command. If it doesn't start shutdown the phone.
N
Thank you all for
the data to root! I just got a 4/32 android 10 version. Is there a custom recovery yet? Been a looooong time since I have dabbled but want to root it and customise. I have replaced most of google apps or disabled them already but want more room. I have never created a TWRP but have been reading about it and they already have many Oukitel versions, so should I wait? TIA
Thanks, it's clear.
I bought it for my son, don't have plans to root it yet. will probably wait till later.
nicolap8 said:
No. No need to revert.
I rooted an Android 10. But cited the stock Android 9 only because the scatter file (ie. the partition table) is the same.
@dwastell rooted the Android 9.
Please read better my tutorial, if something is not clear... I'm here!
Click to expand...
Click to collapse
No Joy with
Hardware : MT6761V/WE
Model : WP5
Build number : OUKITEL_WP5_NOEEA_V01_20200701
Build date UTC : 20200701-071441
Android v : 10
Baseband v: MOLY.LR12A.R3.MP.V114.9,MOLY.LR12A.R3.MP.V114.9
Kernel v : 4.9.190+ ([email protected]) (Android (5484270 based on r353983c) clang version 9.0.3 (based on LLVM 9.0.3svn)) #2 SMP Wed Jul 1 15:19:21 CST 2020
It seems locked down as I lose adb in fastboot and even patching the boot.img I create fails. MTKdroid tools can't create scatter.
vivekiny2k said:
I bought it for my son, don't have plans to root it yet. will probably wait till later.
Click to expand...
Click to collapse
Remember that you will lose ALL YOUR DATA! Usually it's better to root before start using the phone...
oncouch1 said:
No Joy with
Build number : OUKITEL_WP5_NOEEA_V01_20200701
It seems locked down as I lose adb in fastboot and even patching the boot.img I create fails. MTKdroid tools can't create scatter.
Click to expand...
Click to collapse
You have to describe well what you have done and error messages.
Note also that your firmware is never... maybe there is some difference.
N
As of today the firmware for the WP5 PRO has not been posted yet. I'll wait. Meanwhile I want to ask Nicolap8: what does the vbmeta file do? Why is it important to patch it. Isn't patching the boot enough? Thanks
TWRP for WP5 (Pie, 4GB)
If anyone wants to install TWRP, I've built and tested it for my WP5 (Android 9.0, 4GB). A copy of the image may be found in the MISC folder at: https://github.com/dwastell/TWRP_Oukitel_WP5
Note that the data partitiion is not accessible due to encryption (not a major limitation), and that the null version of vbmeta (thanks Nicola) does need to be flashed. Also, I have had problems flashing some versions of Magisk - please read the README.md.
nicolap8 said:
Remember that you will lose ALL YOUR DATA! Usually it's better to root before start using the phone...
You have to describe well what you have done and error messages.
Note also that your firmware is never... maybe there is some difference.
N
Click to expand...
Click to collapse
Sorry it has been a while I HAD WRONG USB DRIVERS! I got bootloader unlocked and will try again.
---------- Post added at 07:13 PM ---------- Previous post was at 07:09 PM ----------
A WP5 (android 10) .zip file is now on the site. It contains less files though?
For some reason the images taken in windows are corrupt. Magical fails to run on them. The one taken in llinux patches fine. One question though the original image is 32 meg the magical patches is only 10 meg is that correct? Also the vbmeta is 8 meg off the phone but the patches 256 k?
oncouch1 said:
For some reason the images taken in windows are corrupt. Magical fails to run on them. The one taken in llinux patches fine.
Click to expand...
Click to collapse
Strange but... with W all is possible!
One question though the original image is 32 meg the magical patches is only 10 meg is that correct? Also the vbmeta is 8 meg off the phone but the patches 256 k?
Click to expand...
Click to collapse
Both are correct.
The Magisk patched image is not "filled" to the partition size.
The vbmeta also is smaller because it's empty (is present only the "index").
N

Android 11 Custom Rom for the Xperia XZs

Hi can anyone make an android 11 custom rom(Pixel experience/ evolution x/ havoc os) for this phone pls? Thank You.
Yes, you can:
go to https://forum.xda-developers.com/t/10-0-project-treble-for-xperia-xzs-2020-03-18.3976367/ then download the zip file and flash vendor.img and boot.img (steps provided in the zip).
then download any android 11 custom rom GSI having arm64 and AB or A/B NOT A only or B only and flash it with fastboot command:
Code:
fastboot flash system <GSI filename>.img
You will need to download and install adb and fastboot tools from google to get the above code working. Also have a bit of patience while first boot your custom ROM after flashing, I will take some time for it to boot up
I have tried:
- Pixel Experience Plus and non-Plus
- Corvus OS
- Havoc OS
Link to official GSI ROMs supporting Project treble devices(This device is included): https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list
i get "Invalid sparse file format at header magic"
and my phone won't boot HELP
prayagprajapati17 said:
Yes, you can:
go to https://forum.xda-developers.com/t/10-0-project-treble-for-xperia-xzs-2020-03-18.3976367/ then download the zip file and flash vendor.img and boot.img (steps provided in the zip).
then download any android 11 custom rom GSI having arm64 and AB or A/B NOT A only or B only and flash it with fastboot command:
Code:
fastboot flash system <GSI filename>.img
You will need to download and install adb and fastboot tools from google to get the above code working. Also have a bit of patience while first boot your custom ROM after flashing, I will take some time for it to boot up
I have tried:
- Pixel Experience Plus and non-Plus
- Corvus OS
- Havoc OS
Link to official GSI ROMs supporting Project treble devices(This device is included): https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list
Click to expand...
Click to collapse
i get "Invalid sparse file format at header magic"
and my phone won't boot HELP
uh btw don't be stupid like me and rename .xz to .img use 7zip to OPEN the .xz then extract the .img inside
prayagprajapati17 said:
Yes, you can:
go to https://forum.xda-developers.com/t/10-0-project-treble-for-xperia-xzs-2020-03-18.3976367/ then download the zip file and flash vendor.img and boot.img (steps provided in the zip).
then download any android 11 custom rom GSI having arm64 and AB or A/B NOT A only or B only and flash it with fastboot command:
Code:
fastboot flash system <GSI filename>.img
You will need to download and install adb and fastboot tools from google to get the above code working. Also have a bit of patience while first boot your custom ROM after flashing, I will take some time for it to boot up
I have tried:
- Pixel Experience Plus and non-Plus
- Corvus OS
- Havoc OS
Link to official GSI ROMs supporting Project treble devices(This device is included): https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list
Click to expand...
Click to collapse
How did Havoc OS work for you?
I am always afraid to flash something that doesn't say precisely that it is for the XZs. But I should mainly be concerned about the kernel, right? If the image is wrong it just won't boot? But the kernel can brick it. Is my assumption correct?
Thanks to everyone who help us illiterates out...
Cordially,
Martin Book
Just follow the guide in the xda thread link I gave, you can use and android 11 GSI ARM64 AB image and you will be fine as far as my testing goes...
Just flash the vendor.img, boot.img and after that find a GSI image with ARM64 AND AB(The file name might use some other code name for this so just make sure the one you download has AB partition).
Note: Android 12 won't work and also daily use is not recommended

[TWRP] TWRP 3.4-0-0 For Blu G90 G0310WW [MT6765][Android 10]

First released twrp for BLU G90 phone.
Whats working:
Adb
Mtp
USb-OTG
MicroSD
Flash Image
Mount System , Vendor, product (contents of SUPER).... mount allows reading the partitions, but was not able to write to them
Back-Up/Restore to/from usb (or micro sdcard).... Due to size of super.img needed to format card ext4
Logcat
Screenshot
Known bug:
**Solved with new tree file**--data decryption is not working, so not able to read or backup internal storage.--
Built with Minimum Manifest _branch 10.0 :
https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni
Kernel source :
https://github.com/mrmazakblu/Blu_G90_G0310WW_stock_kernal
Device Tree :
New
GitHub - mrmazakblu/device_PBRP_BLU_G90_G0310WW at TWRP
Contribute to mrmazakblu/device_PBRP_BLU_G90_G0310WW development by creating an account on GitHub.
github.com
Download :
Releases · mrmazakblu/device_PBRP_BLU_G90_G0310WW
Contribute to mrmazakblu/device_PBRP_BLU_G90_G0310WW development by creating an account on GitHub.
github.com
Old
https://github.com/mrmazakblu/device_TWRP_BLU_G90_G0310WW
Download : https://github.com/mrmazakblu/device_TWRP_BLU_G90_G0310WW/releases
ADB Sideload is also broken.
Shananiganeer said:
ADB Sideload is also broken.
Click to expand...
Click to collapse
Most likely due to no able to read/ write to /data there is no place to temp store the zip.
Working on alternative options at the moment, as I am having trouble getting build correct to make decrypt.
Alternative is a modified /vendor.img, so device is not encrypted. But this of course is less secure.
I reformatted /data so it was unencrypted, but still couldn't use adb sideload. I was able to use adb push to put files onto the phone, but that didn't end up mattering as without rw to /system I can't install gapps XD. I'll have some time this weekend to take a look at things and try and help debug the decryption.
Appearently, this build is only missing data decryption.
Spoke with TWRP maintainer, they said this is working as intended. Super.img partitions are not currently meant to be mounted as r/w.
After I asked about flashing GApps, I was informed that there might be changes to TWRP source to allow mounting as r/w sometime sooner or later.
mrmazak said:
Appearently, this build is only missing data decryption.
Spoke with TWRP maintainer, they said this is working as intended. Super.img partitions are not currently meant to be mounted as r/w.
After I asked about flashing GApps, I was informed that there might be changes to TWRP source to allow mounting as r/w sometime sooner or later.
Click to expand...
Click to collapse
so it may seem we are waiting on how to affectively be able to modify the dynamic partitions before we can see a fully successful root. I am fairly new to these things so might be looking at it wrong.
Ivisibl3 said:
so it may seem we are waiting on how to affectively be able to modify the dynamic partitions before we can see a fully successful root. I am fairly new to these things so might be looking at it wrong.
Click to expand...
Click to collapse
To modify it "live" yes maybe.
You can modify the extracted system, as I did , using linux mount, and flash the system back modified, just like a gsi rom.
But for root, can't say.
On the latest build, was able to mount /system r/w. And successfully change the contents of it.
The patches in twrp source is not finished yet, so normal zip installs are not coded. But using adb shell (or TWRP terminal ) seem to be working.
This New build to be uploaded on github device source, as release "test build 9"
I have the G90 Pro and would love to be able to edit the build.prop file... the phone has a ridiculously low number of volume steps for media, 7.
Is there any way to boot into TWRP temporarily and edit the file, just to see if that will increase the steps? (by adding ro.config.media_vol_steps=30 for example)
johnsag49 said:
I have the G90 Pro and would love to be able to edit the build.prop file... the phone has a ridiculously low number of volume steps for media, 7.
Is there any way to boot into TWRP temporarily and edit the file, just to see if that will increase the steps? (by adding ro.config.media_vol_steps=30 for example)
Click to expand...
Click to collapse
Well, the first thing I'm concerned with here is , I'm not sure if THIS TWRP will work on the g90 pro.
But it might be possible. I was able to mount system as r/w on my g90 in TWRP.
You would need to fastboot flash --disable-verity vbmeta and vbmeta_system to prevent red state bootloader lockout.
Ok I've found one potential bug and have a question you may be able to answer. With your build of TWRP I cannot access fastbootd. Running adb/fastboot reboot fastboot just puts me back into recovery. To change images I've been doing the following:
1. Enter bootloader and flash stock recovery you provided in your other G90 thread
2. Enter fastbootd and flash the image
3. Re-enter bootloader and flash twrp
The question I have is, how can the super partition be increased? I tried to flash the LOSQ build with gapps, but the image is > half the size of the super partition. I want to take 1GB away from the userdata partition and add it to the super partition instead. Do I mount the stock super.img in Linux and modify it to be 5GB, adjust the partitions on the eMMC so the new img will fit, flash the new super.img from bootloader, and then go into fastbootd and flash LOSQ? Where does modifying BoardConfig.mk with the new size fit in? If you don't know or don't wanna bother answering that's cool, I've been doing some digging trying to get to the bottom and I'm just not understanding how to adjust the new dynamic partition scheme.
Shananiganeer said:
Ok I've found one potential bug and have a question you may be able to answer. With your build of TWRP I cannot access fastbootd. Running adb/fastboot reboot fastboot just puts me back into recovery. To change images I've been doing the following:
1. Enter bootloader and flash stock recovery you provided in your other G90 thread
2. Enter fastbootd and flash the image
3. Re-enter bootloader and flash twrp
The question I have is, how can the super partition be increased? I tried to flash the LOSQ build with gapps, but the image is > half the size of the super partition. I want to take 1GB away from the userdata partition and add it to the super partition instead. Do I mount the stock super.img in Linux and modify it to be 5GB, adjust the partitions on the eMMC so the new img will fit, flash the new super.img from bootloader, and then go into fastbootd and flash LOSQ? Where does modifying BoardConfig.mk with the new size fit in? If you don't know or don't wanna bother answering that's cool, I've been doing some digging trying to get to the bottom and I'm just not understanding how to adjust the new dynamic partition scheme.
Click to expand...
Click to collapse
The stock /product partition is not needed in non stock roms. Google gsi flashing guide tells show to delete logical partition product.
Code:
fastboot delete-logical-partition product
This is probably what is needed.
Don't know about your plan to increase stock super.img. no idea about why you mention boardconfig.mk
This TWRP is before the patch for TWRP fastbootd, so it is not included. I have resynced source, and will see if new build works, or not. If it does will post new release.
I mentioned BoardConfig.mk because the size of the super partition is listed there, but you were totally right about the product partition and I was able to flash LOSQ+gapps after deleting it. Thanks for the assist, and your work on porting TWRP to this awesome device! Will continue to keep an eye on your work as TWRP finalizes their support for Android 10.
Will this work for the G90 Pro? My guess is not but figured I'd ask
KryptekKnight said:
Will this work for the G90 Pro? My guess is not but figured I'd ask
Click to expand...
Click to collapse
I assume not. But if you send device stock recovery, I can try to bring it up. But cannot test it, I don't have the device.
mrmazak said:
I assume not. But if you send device stock recovery, I can try to bring it up. But cannot test it, I don't have the device.
Click to expand...
Click to collapse
Would you be able to compile a Gcam pretty for this phone? I would be willing to supply you with whatever is within my means to provide
KryptekKnight said:
Would you be able to compile a Gcam pretty for this phone? I would be willing to supply you with whatever is within my means to provide
Click to expand...
Click to collapse
I have no idea about gcam
johnsag49 said:
I have the G90 Pro and would love to be able to edit the build.prop file... the phone has a ridiculously low number of volume steps for media, 7.
Is there any way to boot into TWRP temporarily and edit the file, just to see if that will increase the steps? (by adding ro.config.media_vol_steps=30 for example)
Click to expand...
Click to collapse
Sorry OP.....
I need to get 01 post of your topic to report on custom recoveries on the G90 Pro.
For new users, you should know about the Android 10 permission structure.
In TWRP or PBRP, through the File Manager, it is not possible to copy files to the superpartition. But you can copy files from the superpartition to the internal SD card.
Therefore, to modify files from the super partition, it will be necessary to extract the super partition and extract system-product-vendor to then carry out the modifications and repackage.
Using Havocv3.11 the volume issue dissapears...........
Well all, thanks to @lopestom , we may soon have a new device tree to build recovery from , and data decryption is working on first test img. New recovery would be pbrp instead of twrp.

Is it possible to come back directly from custom ROM OOS12 fw based to OOS 12?

Is it possible to come back directly from custom ROM OOS12 firmware based to OxygenOS 12? I know that you can MSM tools back to OOS11 and then update to OOS12, however my question is about going back DIRECTLY to OOS12?
No
Klusio19 said:
Is it possible to come back directly from custom ROM OOS12 firmware based to OxygenOS 12? I know that you can MSM tools back to OOS11 and then update to OOS12, however my question is about going back DIRECTLY to OOS12?
Click to expand...
Click to collapse
Here are three ways:
1. Backups using TWRP (or using dd shell commands): if you had backed up the OOS 12 Boot, DTBO, VBMeta, VBMeta_system, and super partitions then you could restore them and OOS should boot (provided you were on the same slot as when you took the backup - the contents of super are slot-specific)
2. TWRP: install a full image zip
3. Payload dumper: if you have a full image zip file, you can extract the partitions and flash the partitions mentioned in the point 1 except for super. That's a bit trickier: I've attached a file with the commands to be run in fastbootd
So, doable but not simple.
You'll also need to format data prior to booting up OOS 12.
BillGoss said:
Here are three ways:
1. Backups using TWRP (or using dd shell commands): if you had backed up the OOS 12 Boot, DTBO, VBMeta, VBMeta_system, and super partitions then you could restore them and OOS should boot (provided you were on the same slot as when you took the backup - the contents of super are slot-specific)
2. TWRP: install a full image zip
3. Payload dumper: if you have a full image zip file, you can extract the partitions and flash the partitions mentioned in the point 1 except for super. That's a bit trickier: I've attached a file with the commands to be run in fastbootd
So, doable but not simple.
You'll also need to format data prior to booting up OOS 12.
Click to expand...
Click to collapse
1st one is mine confirmed and not working
Let me make it easy just download os12 ota zip
Extract payload and put this script inside
Make it bat and run it'll flash and direct boot to os12
Make sure script habe fb-w

Categories

Resources