Flashing stock to second partition? - Google Pixel Questions & Answers

hey everyone,
I was looking around for a possible way to get around the root catchers, ie. android pay, snapchat, etc. and someone casually mentioned they use a clean partition to use those services and then boot their rooted partition for everything else. I've checked my secondary slot (_a) and it doesn't boot at all so im sure I've only got half some stuff flashed to it.
Is it as simple as switching to my secondary, booting into bootloader and simply flashing the required files like I did for my main partition? or do I need to just fastboot my system.img and boot.img? More importantly, does this actually work?
-I'm on 7.1.1 with TWRP alpha2 and SR5
Thank you thank you!
edit1: found this through some searching, my new question is assuming I use the "_a" prefix for the commands I should not touch my active slot correct?
edit2: It worked! For anyone wondering I just used the first set of commands from the thread linked in edit1. My custom kernel stayed on the system and I am able to use apps that normally lock out root!

I think it's important to flash both partitions and use the ignore secondary option and also make sure that the -w is not in the command line . Don't know the specifics, but a normal flash includes some files in the other partition, files it won't find if you only flash one slot. I could be wrong, but that's how I did it. Couldn't get it to run right when I only flashed one slot.ymmv.

dtrud0h said:
I think it's important to flash both partitions and use the ignore secondary option and also make sure that the -w is not in the command line . Don't know the specifics, but a normal flash includes some files in the other partition, files it won't find if you only flash one slot. I could be wrong, but that's how I did it. Couldn't get it to run right when I only flashed one slot.ymmv.
Click to expand...
Click to collapse
Alright so to confirm, since I seem to always confuse myself, as long as I remove the "-w" and use the command to not touch the other partition my data and what not should be fine? I haven't messed with the flash all in a while so I might just manually input those commands to make certain I don't mess up haha.

I'll tell you what happened with me.
I could run the altered.scripts/bat files, but the last segment wouldn't run.. . meaning the script would flash boot, and radio but wouldn't run the update command portion. I had to copy and paste into fastboot the last instruction anyway. I don't know why but that's what happened. One thing is to make sure image file message in the script matches what you have downloaded and extracted
. Either edit the bat or sh file accordingly.

Related

Hello all - real quick question for rom extract and update build

I have been messing around with a G1 I have had on loan for a little bit and just bought the Google Magic / Ion from ebay the one release from dev convention but anyway I want to start messing around with that one for a little and was wondering how I would be able to pull the current build from it and turn into a update.zip or img that i would be able to flash back and will also post online to try other builds and so forth. This one seems like is speical for that phone as has a custom boot screen and so forth not really sure about the rest of features or anything. and also already being fully unlocked is nice if I want to stay with T-Mo or bounce ship but also to get a start on software dev. Any help on how to pull the build and package in an update file would be very helpfull and like I said if it can be done and you guys want I will post it online too.
YES i would like to know too how to create the update.zip from a nand backup. thanx
I think after doing more research I should be able in theory to follow haykuros guide and obtain root and pull the files with adb but that would be like a rooted backup then I guess. I think that should work. But was wondering about just like a stock backup of possible.
I think it is impossible to make a non-root backup from what I have seen, as the backup process itself is only made possible by having root access.
The reason why it was not possible is that, if you are able to backup the whole thing, you may be able to crack the apps downloaded from app market (considering that they are java programs, and consider how -easy- to crack java programs).
On further tests without doing mods to phone it is capable of fast boot I know I can pull system and data imgs for different aspects would it be possible to pull recovery and maybe or how I might be able to turn that to a nbh
Well I was able to find recovery files from htc at the following address:
http://www.htc.com/www/support/android/google-io-device.html
But I am pretty sure that this does not include the spl. Is there a way I can pull it from the phone.
This also may be moot as I was looking thru the rooting files. Does not look like the bootloader is replaced at all but yeh if anyone can say how to backup I will post for all as well.
I do not know if I understood what you all want
but you dont need to make a update.zip from your nand backup
just put the files of your nandroid backup - the img files - into your tools folder of the android sdk
open your windows cmd
change to the tools folder of your android sdk
start your phone in fastboot (the one with the skaterboards)
connect your phone to the pc
and enter the following commands
fastboot erase system -w
fastboot erase boot
fastboot flash system system.img
fastboot flash userdata data.img
fastboot flash boot boot.img
fastboot reboot
with this you will put the files from your nandbackup on your phone and everything is restored
Yeh I have nandroid backups of my g1 muliple times and was never really worried about it. This great community has had 3 different versions of the SPL on the pages. I was looking to try and make a full nbh file of it like for rc29 on dream or a way to pull the bootloader as well. All other default images, radio, system , data, is pulled with adb and then also can be downloaded from htc but do not include spl at all. Not sure if rooting it will change the spl but would like to pull anyway to see what can tweak on it.

[Q] recovery.img and recovery-from-boot.p

Hi all,
I am trying to make sense of how the android system is made up w.r.t to boot/kernel.
I have been looking at the .img files in the build (I built for the "passion" device), and have been googling around to find some more information about the various .img files.
I ran into a nice HOWTO in android-dls.com 's WIKI, titled HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images (I'm sorry, I'm a new user so XDA won't allow me to post links. I will try to modify my post a soon as I'm granted permission for that)
but I am afraid it is a little outdated:
I have several questions, but I will try to be brief, so I'll focus on
one of them, and if that works I'll proceed to the next questions, all related to "Android bringup for dummy embedded linux kernel experts".
I am fairly aware of differences between different linux
configurations, and I am very familiar with linux bringup concepts, so I will just use common examples from the linux world as my terminology. Hope it will be clear enough.
I understood that boot.img a combination of a kernel (e.g. bzImage in linux) and an initial ramdisk (e.g. initrd.gz), wrapped by some header, as in common linux kernel loading practice (piggy.o etc.).
Now, the aforementioned HOWTO says that the "recovery" image is built on
the same way, and that it is stored on the target's /system/
recovery.img .
I would assume that this would be compound of the ramdisk-
recovery.img, and some other kernel.
Now, the problem is that:
1. This /system/recovery.img does not exist from what I saw (on my
Motorola XOOM tablet)
2. What does exist is /system/boot-from-recovery.p , which is
created during the boot process in obj/PACKAGING/
recovery_patch_intermediates/recovery_from_boot.p .
I saw tons of posts referring to the files, all said that "in order to
replace the rescue disk image, this file needs to be renamed" - but I
am looking for a way to figure out what it is, and how to extract its
contents.
I assume /system/recovery.img is deprecated, is that correct?
3. I did not see any flash devices in /proc/mtd (which is strange).
I searched for hours before sending this post, so I would appreciate
your help. I also posted a similar message at the google android-building group, but it has not been answered yet, and I got the impression that these forums are more active and can help me get where I need.
If it is not the right place to ask the question please let me know -
I just assume this is a general android concept and not device
specific.
Thanks,
Ron
I meant of course /system/recovery-from-boot.p , and not recovery-from.boot.p
-R
Hi,
I don't know if you managed to find out what "recovery-from-boot.p" is, since this is quite an old post, but I think I'll try to help anyway.
recovery.img is not deprecated at all. From my own experience, it looks like "recovery-from-boot.p" is a protection measure introduced in Gingerbread, but not the recovery itself. What it does is replacing any recovery currently installed on the phone with the default one on every boot.
I discovered it after flashing a custom recovery on my Android 2.3.4 phone. It worked, but just during the first boot. The next time I rebooted the phone, the default recovery image was there again. After browsing several sites, I found that "recovery-from-boot.p" is responsible for that.
So, if you flash a custom recovery image on a Gingerbread phone and want to keep it forever, you must delete this "recovery-from-boot.p" from /system, or at least rename it. That way, your new custom recovery will never get overwritten buy the default one, unless you do it yourself.
I hope this helps you and clarifies this question.
Well, it helped me. I'm new to rooting and just came across mention of this file. I am trying to learn 'why' as well as 'how'', so your post was informative.
Was going to ask a dumb question but I figured it out
i need to delet those files
bigrammy said:
Was going to ask a dumb question but I figured it out
Click to expand...
Click to collapse
Hello
can't delete those files >> i am rooted but every time i delete or rename it take permission then nothing happen >> how i can delete them plsssssssssssssssssssssssssssssssssssssss
recovery from boot p
ahmed morsy said:
Hello
can't delete those files >> i am rooted but every time i delete or rename it take permission then nothing happen >> how i can delete them plsssssssssssssssssssssssssssssssssssssss
Click to expand...
Click to collapse
Hey good day. Did you get your problem fixed...? I have an xt912 it has the same file. For days I've been trying to wipe the phone. Tryed rooting it. I tryed reprogramming it. And I got through with all of that. But everytime the phone boots up it goes back to the same state. Then I used a root browser and while exploring I saw this recovery from boot file. I need help. And I don't think I can downgrade the Motorola phones. Thanks in advance.
jman0 said:
Hi,
I don't know if you managed to find out what "recovery-from-boot.p" is, since this is quite an old post, but I think I'll try to help anyway.
recovery.img is not deprecated at all. From my own experience, it looks like "recovery-from-boot.p" is a protection measure introduced in Gingerbread, but not the recovery itself. What it does is replacing any recovery currently installed on the phone with the default one on every boot.
I discovered it after flashing a custom recovery on my Android 2.3.4 phone. It worked, but just during the first boot. The next time I rebooted the phone, the default recovery image was there again. After browsing several sites, I found that "recovery-from-boot.p" is responsible for that.
So, if you flash a custom recovery image on a Gingerbread phone and want to keep it forever, you must delete this "recovery-from-boot.p" from /system, or at least rename it. That way, your new custom recovery will never get overwritten buy the default one, unless you do it yourself.
I hope this helps you and clarifies this question.
Click to expand...
Click to collapse
i have deleted it . then flash recovery ,, but it failed .. it wont even now go to stock recovery itself.. any help..
Does recovery from boot has to do anything with ota update applying ? or it will cause issues in system update ?
I have recovery-from-boot.p in my system and i cant root my phone i cant change the recovery img ... Help?
I hadn't had to deal with this for some time, perhaps because I've updated my devices (Nexus 4, Nexus 5, Nexus 7 '13) with the factory images, with "-w" removed from flash-all, then flashing CWM's recovery, ensure SuperSU was installed, then continuing. Today, I used the new OTA image on my Hammerhead/N5, and recovery-from-boot.p seems to be up to its old tricks again.
Solution is simple.
Flash your alternate Recovery in fastboot, fastboot flash recovery [recovery image file] . Boot into Recovery. Apply/install root app (typically via sideload). Mount /system. adb shell mv /system/recovery-from-boot.p /system/recovery-from-boot.p.bak. Reboot. Done. (If you're unfamiliar with fastboot, adb, and flashing new recovery partitions, you have some reading to do. Commence RTFM.)
I also used to have to move /system/etc/install-recovery.sh but that seems to be gone in Marshmallow. :} Or moved...?
well, after following a guide I have extracted the system.img from a pure-nexus ROM(The ROM I'm currently using), now I can see that "recovery-from-boot.p" file is responsible for recovery lock in my phone. I'll keep it short and straight to the question
"Can I remove this file and rebuild the .dat file and flash it?, so that I won't have any other problems at all"
I want to know if recovery-from-boot.p file is linked to anything other than just locking the recovery or re-flashing it innumerable times.

Newb question

Not exactly a newbie but I've been on iPhone for a while and I'm reaquainting myself with rooting.
But I made a made a stupid mistake. I accidentally downloaded a rom for the pixel 2 rather than three and flashed it. I can't get back into recovery or boot up at all. It gets into bootloader menu however.
My question is does flashing stock image from fastboot delete my internal storage? i.e. where my nandroid would be stored? If so, any way to keep storage files? Or do I just need to start at square one?
Sent from my iPhone using Tapatalk
alsgarage said:
Not exactly a newbie but I've been on iPhone for a while and I'm reaquainting myself with rooting.
But I made a made a stupid mistake. I accidentally downloaded a rom for the pixel 2 rather than three and flashed it. I can't get back into recovery or boot up at all. It gets into bootloader menu however.
My question is does flashing stock image from fastboot delete my internal storage? i.e. where my nandroid would be stored? If so, any way to keep storage files? Or do I just need to start at square one?
Click to expand...
Click to collapse
Edit the flash-all.bat file and remove the -w near the end. That will save user data and apps. It may not work though, ROMs often require a data wipe when you remove them. But since yours never booted up I am hopeful.
Thanks! I'll be able to give it a shot later. I'll let you know[emoji106]
Sent from my iPhone using Tapatalk
alsgarage said:
Not exactly a newbie but I've been on iPhone for a while and I'm reaquainting myself with rooting.
But I made a made a stupid mistake. I accidentally downloaded a rom for the pixel 2 rather than three and flashed it. I can't get back into recovery or boot up at all. It gets into bootloader menu however.
My question is does flashing stock image from fastboot delete my internal storage? i.e. where my nandroid would be stored? If so, any way to keep storage files? Or do I just need to start at square one?
Sent from my iPhone using Tapatalk
Click to expand...
Click to collapse
You can flash the factory image without wiping the phone. However, to do this, you need to edit a file named flash-all.bat (if you're using Linux, you need to edit the file named flash-all.sh). Open the file in a text editor and near the end of the file you'll see a line that says this.
Code:
fastboot -w update image-blueline-pq2a.190405.003.zip
Remove the -w so it looks like this.
Code:
fastboot update image-blueline-pq2a.190405.003.zip
Save it, then close it, then reopen it to make sure the -w is gone. Doing that should allow you to flash it without wiping the phone. That said, since you flashed the wrong image to begin with, I don't know if it will boot without wiping data or not. You can give it a try though. If it doesn't boot, you can add the -w back and do it again. Hopefully it'll boot with the -w removed. Can't hurt to try.
robocuff said:
You can flash the factory image without wiping the phone. However, to do this, you need to edit a file named flash-all.bat (if you're using Linux, you need to edit the file named flash-all.sh). Open the file in a text editor and near the end of the file you'll see a line that says this.
Code:
fastboot -w update image-blueline-pq2a.190405.003.zip
Remove the -w so it looks like this.
Code:
fastboot update image-blueline-pq2a.190405.003.zip
Save it, then close it, then reopen it to make sure the -w is gone. Doing that should allow you to flash it without wiping the phone. That said, since you flashed the wrong image to begin with, I don't know if it will boot without wiping data or not. You can give it a try though. If it doesn't boot, you can add the -w back and do it again. Hopefully it'll boot with the -w removed. Can't hurt to try.
Click to expand...
Click to collapse
Thanks for the help. I tried this but no go. Oh well, it was worth a shot. And I learned a couple things in the process. I hadn't opened notepad in a long time.
Sent from my iPhone using Tapatalk

[h910] rooted Oreo stock-based - get fingerprints AND radio working (if one isnt)

Hello everyone, I'm a total noob but I solved a problem which I couldn't find the answer to, so I thought I'd share. Please take care following my noob advice, I'm not responsible for anything which goes wrong with your phone (and if it gets complex, I probably don't have the skills to help)!!
What was my problem?
When I went from Nougat to Oreo, my radio broke (no cell reception). However I had the files from LGUP, so I could flash "fsg" "modem" "modemst1" and "modemst2" in fastboot (as explained here) which did indeed fix my modem problem, giving me back radio and data. However, this also made the fingerprint scanner disappear from my phone's settings menu. As far as I could tell, this wasn't a problem related to encryption (as discussed in AO ROM thread a lot, which is what I'm now running), rather 'twas a problem with the firmware! So I was loving Alpha Omega, but left without fingerprint scanner since radio isn't really optional on a phone.
Solution?
Please remember, I'm a noob and have only done this for my own phone, a h910, I don't know if i will work for you or on other models!!
Basically, I mish-mashed the two modem files from Oreo and Nougat, to get both things working!
Steps I took:
1) Use Linux - I couldn't get the files to open properly in windows, and didn't find a way to write to the image files.
2) Find a stock "modem.img" file from Oreo (i searched on google "stock oreo h910 modem and it came straight up) - I think I am too new on this forum to post outside links so you'll have to search for it.
3) Find a stock modem file from nougat (I used my original LGUP dump file from nougat, renamed to .img) I'm not sure if it is important that this came from your phone or not, if you followed all the instructions on the dirtysanta root guide, you'll have this as part of your LGUP backup.
NOTE: both of these files were 86 Mb (helped me feel confident I'd found the right thing on google)
4) Create backup copies of both, and append ".img" to your LGUP "modem" file. Call the backup of your OREO modem (the one you got off of google) "MyModem.img", just to keep it clear for later.
5) Mount the NOUGAT img first in a terminal (might have to make a mount point first), for me this was like this:
Code:
sudo mkdir /mnt/modemfiles
mount -o loop /path/to/your/nougat-modem-file.img /mnt/modemfiles
You obviously have to put the file path to where you saved your NOUGAT modem image - the one from LGUP!
6) You should now be able to see the nougat modem .img mounted as a disk in "places" on your file explorer. Go there, and copy the contents into a new folder somewhere easy to find (make a folder on your desktop called NougatModem.) There are two folders iniside, one called "image" and one called "verinfo".
7) Now you can un-mount, as we have what we need from it, easiest to do by just right-clicking it in file explorer and select unmount.
8) Next we will mount the image which will become your new (hopefully working!) modem, but it has to be writeable, so using the same mount point we would do
Code:
sudo mount -o loop,rw /path/to/MyModem.img /mnt/modemfiles
Remember that "MyModem.img" should be your backup OREO image - where all the firmware works but you don't get radio.
9) Now basically comes replacing a few files in the OREO modem (which we have mounted) with ones from your original NOUGAT backup (which are in that folder on your desktop). I couldn't remember if cp command replaced things with the same name, so I used rm to remove files, and then cp to replace them once they were gone.
a) first it is the folder called modem_pr, inside image
Code:
sudo rm -R /mnt/modemfiles/image/modem_pr/
b)next were all the files in the image directory which were modem.SOMETHING
Code:
sudo rm /mnt/modemfiles/image/modem.*
10) Finally we have to replace those files and the folder with the same things from our NOUGAT folder which is on our desktop, using the copy command. I will put the commands as if you did name that folder NougatModem
a) so first the folder which we removed
Code:
sudo cp -r ~/Desktop/NougatModem/image/modem_pr/ /mnt/modemfiles/image/
b) now all the files again, using the wildcard for the different extensions
Code:
sudo cp ~/Desktop/NougatModem/image/modem.* /mnt/modemfiles/image/
So if all went to plan, you now have an image (which you can unmount), called MyModem.img, which you can flash in fastboot to the modem parition (fastboot flash modem /path/to/MyModem.img) and if it works for you like it did for me, you have cell reception, data (after putting in APN if it's needed) and fingerprint scanner all working on OREO. Again, I'm on Alpha Omega, loving the rom and now going to go play a bit.
I've not been on the forum long, but have just gained a HUGE insight into how much time people put into making guides and helping others learn (this has taken me ages haha). Thanks to everyone for your hard work and community spirit, please let me know if this works for you or if it provides any interesting insight as I really did it blind (I had no idea if it would work, and was just making some slightly educated guesses - I got lucky!). Also, if the instructions are hard to follow and you have a hint, I'm happy to edit them to make them clearer.
ENJOY!!
PS - I know the linux commands could be better haha, using more than one mount point too might have been easier, but I figured that I'd just keep it exactly the same as how I did it since I'm a noob and would be more likely to screw something up in the instructions, if I changed it without trying at the same time!
EDIT: I could also upload my "patched" modem image, but not sure if it will work for other people's phones, or if it has "personal" or unique info in it (basically if it would be safe to do so) - If someone who knows tells me it'd be good to go, I'm happy to share it if it would save people from having to go through the whole process. I guess I hope posting all this will be a learning thing for others too Gotta have some justification haha!!
You are to be commended on your well presented write up. But I'm sure there is an easier way to get data and fingerprint working without going through all of that.
I don't have an original H910 device but I did flash H910 oreo kdz on my device and data did not work at all. Didn't test fingerprint. All I did was flash modem using lgup patched from another variant and that solved it.
ezzony said:
You are to be commended on your well presented write up. But I'm sure there is an easier way to get data and fingerprint working without going through all of that.
I don't have an original H910 device but I did flash H910 oreo kdz on my device and data did not work at all. Didn't test fingerprint. All I did was flash modem using lgup patched from another variant and that solved it.
Click to expand...
Click to collapse
Thank you for the commendation haha! What a mission!
So I'm guessing you flashed a different version's KDZ?? As far as I'm aware from lots of reading here on xda, there are no KDZ files for the h910. For me the kdz from h915 worked perfectly for example, apart from data. And that was the story with a few things I flashed, KDZ or ZIPs, they would break data, I'd flash the modem, and that would break the fingerprint scanner. Hence this long-winded solution lol.
If you have an original h910 kdz that people don't know about that'd be interesting in itself!!
No, I flashed a H910 ZIP that someone kindly uploaded here somewhere. Then I flashed back the modem from a Verizon kdz.
You are the best, I have been trying to solve this for a long time, I tried flashing many things it thanks to you I now have a working fingerprint and data. Although I am a complete noob for using linux I just used it for the first time using live boot. This is a challenge for noobs but worth it at the end and big thanks.
Why not just cross flash to us996 and walk away? 0_o You get a newer modem this way. I think you have to enable bands on some devices but on h910 I don't think even this matters. You are just downgrading the modem and keeping the new bootstrap. Still from what I read this is encryption issue. There was a supposedly a rsa key change during the update... without them matching the bootstrap will not will not load fingerprint software as it's not trusted unless it matches.
Vortell said:
Why not just cross flash to us996 and walk away? 0_o You get a newer modem this way. I think you have to enable bands on some devices but on h910 I don't think even this matters. You are just downgrading the modem and keeping the new bootstrap. Still from what I read this is encryption issue. There was a supposedly a rsa key change during the update... without them matching the bootstrap will not will not load fingerprint software as it's not trusted unless it matches.
Click to expand...
Click to collapse
So should I flash the whole ROM or just the modem of us996 to have both working?
DesrtSailor said:
You are the best, I have been trying to solve this for a long time, I tried flashing many things it thanks to you I now have a working fingerprint and data. Although I am a complete noob for using linux I just used it for the first time using live boot. This is a challenge for noobs but worth it at the end and big thanks.
Click to expand...
Click to collapse
Just wanted to say that made my day when I read that the original post had helped you out Cheers for letting me know
Awesome!! Thanks for this. Where did you get the idea of what files to change? Just curious.
I am still tinkering. I have an LGUP dump from:
ATT Stock
A-O Nougat install
A-O Oreo install
I was mix and matching the modem files with various modemst1 and modemst2 files. I did this because it seemed that I got better signal strength with the A-O Nougat install... but I got the kernel panic/modem crash whenever I lost signal on the phone. But with this hand made modem file - no crash. But now I am going to continue mix/match and see what crashes and what gives the best signal strength.
Anyway thanks a bunch!!
Please give me the patched modem file, please send it to [email protected]
I would root then try activity launcher or some sort if hidden menu launcher to get band menu. Alternatively get Network signal guru and lock bands. That how i did it in los 17.1 not sure if it would work on stock. I went from hspa to lte doing it in h915(it's a Canadian h910). I even crossflashed to us996 and left it that way. Says it even says band 66 was unlocked in the app but it has not been tested yet. Either way I got band 4 and 12 once I did this.

How To Guide [Walkthrough] Manually updating to Android 12 on a rooted Motorola Edge (2021).

I'm a total noob, and was scared pant-less at the thought of bricking my device, but I was successful!
First off, I backed up my data. First by manually copying off photos, and creating a SMS backup (I have QKSMS), etc., then:
adb backup -all
In retrospect, I should've used --shared to also backup the apps themselves.
Anyways, then I downloaded the latest stock ROM for my device; I used the Lenovo Rescue and Smart Assistant for this. You have to plug the phone in, and follow the rescue process up to the point of getting it to download the ROM, and stop there. It tells you where it downloads the ROM (dropdown download menu), and you can open it in the file browser. DO NOT KEEP GOING OR THE RESCUE ASSISTANT WILL WIPE YOUR PHONE AND DO A FRESH INSTALL OF THE ROM. Thankfully it's very easy to tell when you get up to this point, so you can't really just accidentally let it do that.
Once you navigate to the folder where the ROM files are located, you'll see many files. I was overwhelmed at first, not knowing what I might have to flash over. Thankfully, there is a file called flashfile.xml, this file details the files needed to be flashed over. We cannot directly use this file, but we can infer from the file which files need to be flashed onto which partitions.
For more info: https://www.droidwin.com/flash-stock-firmware-via-fastboot-commands/
First however, we'll need to patch the boot.img file. Copy it over to your phone, use the magisk app to patch the file, and overwrite the original boot.img file.
Then open and read the xml file and you'll see "<step" lines. Which look like:
<step MD5="0e28dd7d9c003732a01c9c675c387dd3" filename="gpt.bin" operation="flash" partition="partition"/>
The important bits we need are "filename=" and "partition=". from there you can interpolate those into the "fastboot flash" command to flash the required files over.
fastboot flash [partition] [filename]
Repeat this process for each line that has "operation="flash"" in it. Ignore the lines with "operation="erase"", since those wipe various parts of your phone, such as with a clean install.
Once finished, you can reboot your phone to Android 12.
That should be it. I hope this helps someone out. Please PLEASE give me feedback, if there was anything wrong, or things you think I could've done better. Thanks.
Whoa this is way overkill. You just need to restore the boot image, take the ota, and patch the new inactive boot before rebooting.
If magisk doesn't have a backup of the boot image, you can create supply one for it, or just manually write the boot image.
Supplying magisk:
1. Calculate sha1 of the original boot.img.
2. Create directory /data/magisk_backup_<SHA1>
3. Gzip original boot.img and save boot.img.gz in the new directory.
4. In Magisk, uninstall magisk => restore images.
Otherwise, just write the original boot.img to /dev/block/by-name/boot_a or boot_b depending on which one is active with dd.
Make sure to install magisk to inactive slot after taking the ota and before rebooting. This automatically saves the new original boot for next time.
--
Unrelated, but I had forced ro.vendor.hw.dualsim to true, and was about to order a dual sim tray to test. IMEI1 was intact, but 2 was blank as expected (hadn't cleared modemst1/2 yet, but would've expected imei2 to goto 0 at best). But upon taking the July OTA, IMEI1 went to 0 (imei2 still blank) and I had no cell (sim disabled and untoggleable). Erased modemst1/2 to no avail, but reverting to single sim and wiping modemst1/2 brings the imei back. Anyone else test dual sim on berlna?
ziddey said:
Whoa this is way overkill. You just need to restore the boot image, take the ota, and patch the new inactive boot before rebooting.
If magisk doesn't have a backup of the boot image, you can create supply one for it, or just manually write the boot image.
Supplying magisk:
1. Calculate sha1 of the original boot.img.
2. Create directory /data/magisk_backup_<SHA1>
3. Gzip original boot.img and save boot.img.gz in the new directory.
4. In Magisk, uninstall magisk => restore images.
Otherwise, just write the original boot.img to /dev/block/by-name/boot_a or boot_b depending on which one is active with dd.
Make sure to install magisk to inactive slot after taking the ota and before rebooting. This automatically saves the new original boot for next time.
--
Unrelated, but I had forced ro.vendor.hw.dualsim to true, and was about to order a dual sim tray to test. IMEI1 was intact, but 2 was blank as expected (hadn't cleared modemst1/2 yet, but would've expected imei2 to goto 0 at best). But upon taking the July OTA, IMEI1 went to 0 (imei2 still blank) and I had no cell (sim disabled and untoggleable). Erased modemst1/2 to no avail, but reverting to single sim and wiping modemst1/2 brings the imei back. Anyone else test dual sim on berlna?
Click to expand...
Click to collapse
I tried doing the OTA method based off a guide, but it didn't work.
How am I supposed to restore the boot image without a reboot? In the guide I followed, you "uninstalled Magisk", then directly went and got the OTA, before then patching Magisk to the OTA version and finally rebooting.
The problem was, there was no update, or so the updater told me.
I also don't really understand what the whole "Supplying Magisk" bit is about.
This is why I'm a noob lol. I did the "overkill" method because I didn't know any other way of doing it. How else am I to supply Magisk with a boot image, if the OTA method doesn't work?
Addendum Edit: Please forgive me for my ignorance. Sorry. I really appreciate you trying to enlighten me on better methods.
For the record, I have used and understand (at least the basics) of gzip, dd, calculating checksums, and using magisk. I'm just still clueless of what exactly your instructions are trying to accomplish.
ruq said:
I'm a total noob, and was scared pant-less at the thought of bricking my device, but I was successful!
First off, I backed up my data. First by manually copying off photos, and creating a SMS backup (I have QKSMS), etc., then:
adb backup -all
In retrospect, I should've used --shared to also backup the apps themselves.
Anyways, then I downloaded the latest stock ROM for my device; I used the Lenovo Rescue and Smart Assistant for this. You have to plug the phone in, and follow the rescue process up to the point of getting it to download the ROM, and stop there. It tells you where it downloads the ROM (dropdown download menu), and you can open it in the file browser. DO NOT KEEP GOING OR THE RESCUE ASSISTANT WILL WIPE YOUR PHONE AND DO A FRESH INSTALL OF THE ROM. Thankfully it's very easy to tell when you get up to this point, so you can't really just accidentally let it do that.
Once you navigate to the folder where the ROM files are located, you'll see many files. I was overwhelmed at first, not knowing what I might have to flash over. Thankfully, there is a file called flashfile.xml, this file details the files needed to be flashed over. We cannot directly use this file, but we can infer from the file which files need to be flashed onto which partitions.
For more info: https://www.droidwin.com/flash-stock-firmware-via-fastboot-commands/
First however, we'll need to patch the boot.img file. Copy it over to your phone, use the magisk app to patch the file, and overwrite the original boot.img file.
Then open and read the xml file and you'll see "<step" lines. Which look like:
<step MD5="0e28dd7d9c003732a01c9c675c387dd3" filename="gpt.bin" operation="flash" partition="partition"/>
The important bits we need are "filename=" and "partition=". from there you can interpolate those into the "fastboot flash" command to flash the required files over.
fastboot flash [partition] [filename]
Repeat this process for each line that has "operation="flash"" in it. Ignore the lines with "operation="erase"", since those wipe various parts of your phone, such as with a clean install.
Once finished, you can reboot your phone to Android 12.
That should be it. I hope this helps someone out. Please PLEASE give me feedback, if there was anything wrong, or things you think I could've done better. Thanks.
Click to expand...
Click to collapse
Thank you for sharing your findings! I recently purchased this phone and was able to install the July OTA update & maintain root by following this video:

Categories

Resources