[Q] Decrypting after flashing the factory image - Nexus 6 Q&A, Help & Troubleshooting

When a new Android version is released I like to do a completely fresh install of everything. How do I adjust my routine in the future, to make sure I'm decrypted?
This is what I normally do, with one new step at the bottom, to avoid (?) encryption.
Download the factory image and run the flash-all script.
The phone automatically starts up Android after that. I don't do the setup, but return to the bootloader.
I flash TWRP and immediately reboot to recovery.
I push ElementalX (no force encrypt) and SuperSU to the /sdcard and flash both using TWRP.
New: I reboot to the bootloader and run 'fastboot erase userdata'.
I reboot to system and go through with the setup.
Now my questions are:
Will it work (will I avoid encryption by doing these steps)?
Is it the best way of doing it (most sane, fewest steps)?
Is userdata the only partitition that normally gets encryptet? What about the system partition for example?
EDIT: For future reference. What I suggest here won't work. Look at post #9 for something that will.

you can download bootnoforceencrypt.img rename it as boot.img and overwrite the file and you dont need to flash kernel or smthng else. what i did was that but i followed not flash.all i did it one by one writing down the commands. That is the best and rock solid way. Did that 3 days ago.
Good luck
stokholm said:
When a new Android version is released I like to do a completely fresh install of everything. How do I adjust my routine in the future, to make sure I'm decrypted?
This is what I normally do, with one new step at the bottom, to avoid (?) encryption.
Download the factory image and run the flash-all script.
The phone automatically starts up Android after that. I don't do the setup, but return to the bootloader.
I flash TWRP and immediately reboot to recovery.
I push ElementalX (no force encrypt) and SuperSU to the /sdcard and flash both using TWRP.
New: I reboot to the bootloader and run 'fastboot erase userdata'.
I reboot to system and go through with the setup.
Now my questions are:
Will it work (will I avoid encryption by doing these steps)?
Is it the best way of doing it (most sane, fewest steps)?
Is userdata the only partitition that normally gets encryptet? What about the system partition for example?
Click to expand...
Click to collapse

I want to use the ElementalX kernel anyway, so there's no point in flashing the modified boot image.
So still looking for answers. But thanks.

Download and flash a zip that someone here makes then flash the kernel.
But yeah.
fastboot flash system.img
fastboot erase userdata
fastboot flash userdata.img
fastboot flash radio.img
That's all that's needed. Push SuperSU to sdcard and boot.

rootSU said:
Download and flash a zip that someone here makes then flash the kernel.
But yeah.
fastboot flash system.img
fastboot erase userdata
fastboot flash userdata.img
fastboot flash radio.img
That's all that's needed. Push SuperSU to sdcard and boot.
Click to expand...
Click to collapse
Thanks, but do I still need that zip you're taking about, if I install ElementalX anyway? Isn't boot.img supplied by ElementalX?
And I'm not sure I understand. Would my procedure fail?

stokholm said:
Thanks, but do I still need that zip you're taking about, if I install ElementalX anyway? Isn't boot.img supplied by ElementalX?
And I'm not sure I understand. Would my procedure fail?
Click to expand...
Click to collapse
Forget the zip, I wasn't fully taking into account what you wanted (full wipe)
Your method would work fine but you're doing multiple unnecessary steps, only becoming necessary because you're using the flash-all method.
Flash-all flashes system, userdata, radio, recovery, cache, boot
Then you have to replace recovery and boot.
My method flashes system, userdata, radio.
It leaves recovery and boot as is so nothing more to do then. ...except flash root.

Thanks a lot rootSU. That makes sense. I think I'll use your method.
But theoretically,would I need to flash userdata.img after the erase, like you're doing? With my method that is.

stokholm said:
Thanks a lot rootSU. That makes sense. I think I'll use your method.
But theoretically,would I need to flash userdata.img after the erase, like you're doing? With my method that is.
Click to expand...
Click to collapse
Possibly not. Both should work independently, but we're doubling up here just in case. You could try both. They'll show sdcard though.

Well I ended up trying actually. "fastboot erase userdata" was neither enough nor necessary. Erasing it left me without one, so I ended up in a boot loop. And I found out that "fastboot flash userdata userdata.img" actually runs "erase" prior to the flashing. So this worked as I wanted it to:
Download the factory image and run the flash-all script.
The phone automatically starts up Android after that. Don't do the setup, but return to the bootloader.
Flash userdata.img (again), since it was encrypted during the first boot.
Flash TWRP and reboot to recovery.
Push (adb push) ElementalX and SuperSU to the /sdcard and flash both using TWRP.
Reboot to system. This time userdata isn't encrypted because ElementalX doesn't force encryption.

Related

[Q]noob figuring out update path with Stock+root+Xposed

So after much flailing, I think I understand how to manage updates... but I'm not sure. I currently have root and Xposed installed on 5.1.1.
My plan when the next update comes:
get the factory image from google
Unzip the zip.
Inside that, there is the image-shamu zip, which I'll also unzip.
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash recovery twrp-xxx-shamu.img
from twrp
Reroot and reboot
boot back to recovery and install Xposed again.
Is that about right? what am I missing here?
ninjaaron said:
So after much flailing, I think I understand how to manage updates... but I'm not sure. I currently have root and Xposed installed on 5.1.1.
My plan when the next update comes:
1. get the factory image from google
Unzip the zip.
Inside that, there is the image-shamu zip, which I'll also unzip.
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash recovery twrp-xxx-shamu.img
from twrp
Reroot and reboot
boot back to recovery and install Xposed again.
Is that about right? what am I missing here?
Click to expand...
Click to collapse
That would work though no need to flash recovery if you already have it.. But yes, other than that, probably the best way.
Edit, also no need to reboot between flashing SuperSU zip and Xposed zip
Thanks. The last time I tried to flash system.img, twrp was bork'd, but maybe it was just a fluke. I did a lot of weird things today to figure this stuff out, and maybe it was something else.

Manually flashing 6.0, will this approach still work?

To start: 5.1.1 (LMY48M), rooted, with TWRP for recovery
For every 5.x update so far, this has been my procedure using fastboot:
Flash boot.img
Flash radio.img
Flash system.img
After successfully updated, I'd use WugFresh's Nexus toolkit to root and flash TWRP.
I'm a fan of not needing to flash userdata.img, as I don't think that should be necessary given that the OTA wouldn't wipe installed apps and such.
I've read other threads about using fastboot to upgrade and am concerned about the boot warnings, which seem to require a custom kernel to circumvent. My question is: will the above approach still work? Do I need to flash any other files? If I need to flash a custom kernel, where do I get it, how do I flash it (is it just a custom boot.img?), and at which point in the flash sequence should I apply it?
Secondly, has anyone tried gaining root through the Nexus toolkit once upgraded to 6.0?
I'm looking for recommendations so I don't spend hours trying to unbrick my device. Thanks!
You'll also want to flash the 6.0 bootloader and why are you using the toolkit to flash twrp when you can flash it in fastboot along with the rest of the files?
Ah OK, I'll flash the bootloader image as well. Anything else to be concerned with? The toolkit has a feature to root + flash twrp as a feature, so I just use that.
Do the bootloader first, then reboot the bootloader before you flash anything else. There are instructions floating around here some where or you can google nexus 6 flash factory images. You don't have to flash user data as this will format all you data/ apps.
Just download the latest SuperSu zip (2.50) and put it on your SDcard. If you flash as you suggested and then boot directly into recovery, you will still have TWRP. If you don't flash the stock recovery.img to replace TWRP, it will replace on first boot anyway, unless you root imeediately, but you are probably booting to use the toolkit, which replaces recovery only to have to use the toolkit to flash recovery anwyay.
So do your flashes, boot straight into recovery, flash the supersu zip on your sdcard. Done.

Can I install Android 9 (Nov. patch) over 8.1.0 Unlocked bootloader?

Hi! So a little while ago I unlocked my bootloader, rooted my device, enabled camera2api and installed gcam and modules. Is there any way I can go back to the original 8.1.0 in order to get the OTA updates and get the November patch that comes with andoid 9? Then unlock the bootloader again, enable camera2api and install gcam and modules?
I soft bricked my phone in my first attempt to unlock the bootloader so I decided to ask here for help first
mirunaa said:
Hi! So a little while ago I unlocked my bootloader, rooted my device, enabled camera2api and installed gcam and modules. Is there any way I can go back to the original 8.1.0 in order to get the OTA updates and get the November patch that comes with andoid 9? Then unlock the bootloader again, enable camera2api and install gcam and modules?
I soft bricked my phone in my first attempt to unlock the bootloader so I decided to ask here for help first
Click to expand...
Click to collapse
You don't need to lock bootloader to get OTA updates. Keep it unlocked if you want to get back to stock android.
First uninstall all the Magisk modules you've downloaded. Then flash stock boot.img and system.img (If you've edited build.prop without adb shell). After this you'll be on stock android and you'll get OTA updates.
Where do I find stock boot.img and system.img?
Also, will my phone factory reset after this procedure?
mirunacont said:
Where do I find stock boot.img and system.img?
Also, will my phone factory reset after this procedure?
Click to expand...
Click to collapse
Which version of Oreo are you on? Tell me the build number.
And your phone won't factory reset after this.
---------- Post added at 07:31 PM ---------- Previous post was at 07:23 PM ----------
[email protected] said:
Which version of Oreo are you on? Tell me the build number.
And your phone won't factory reset after this.
Click to expand...
Click to collapse
Download this - https://android.googleapis.com/pack.../f9b27203a7d6dd2c6709f238d9953c6d4e18c04b.zip
Then extract the files and then find the boot.img and system.img. Flash the images from fastboot using -
Code:
fastboot flash boot_a boot.img
fastboot flash boot_b boot.img
fastboot flash system_a system.img
fastboot flash system_b system.img
Extract the Images & Flash Them Individually
you have to flash the system images individually. This method takes some extra work, but it can be used to un-root, update, or un-brick your device without losing existing data.
Start by extracting any additional archives from the factory images package. Sometimes, factory images packages can contain a series of three or four nested archives, so make sure to unzip all of them. From there, copy all of the image files to the main platform-tools folder—in other words, don't leave them in any sub-folders. From here, there are two images that you can get rid of: cache.img and userdata.img. These are the images that will overwrite your data and cache with blank space, so if you don't flash them, your existing data will remain intact.
Of the remaining images, six make up the core elements of Android: boot, bootloader, radio, recovery, system, and vendor.
The boot image contains the kernel, so if you just want to get rid of a custom kernel that's causing issues with your device, you only have to flash this one. To do that, type the following command into the ADB shell window:
fastboot flash boot <boot image file name>.img
Next is the bootloader image—this is the the interface that you're using to flash images with Fastboot commands. So to update your bootloader, type:
fastboot flash bootloader <bootloader image file name>.img
Once you've done that, you should reload the bootloader so that you can continue flashing images on the newer version. To do that, type:
fastboot reboot-bootloader
After that, we have the radio image. This one controls connectivity on your device, so if you're having problems with Wi-Fi or mobile data, or if you just want to update your radio, type:
fastboot flash radio <radio image file name>.img
Then there's recovery. This is something you may or may not want to flash, depending on the modifications you've made. For example, if you've installed TWRP custom recovery, flashing this image will overwrite your modification and replace it with the stock recovery interface. So if you're just updating your modded device, you should skip this one. Otherwise, if you plan to keep your phone stock and want the newer version of stock recovery, type:
fastboot flash recovery <recovery file name>.img
Next up is the big one: The system image. This one contains all of the files that make up the actual Android OS. As such, it's the most essential part of any update.
However you may not be updating your phone. You may just be re-flashing the stock firmware to recover from a soft brick. If this is the case, the system image is often the only image you need to flash in order to fix everything, because it contains the entirety of Android. In other words, if you flash this image and nothing else, it will undo any changes you made with root access and put everything back the way it was.
So as a cure-all in most soft brick situations, or as a method for getting the core part of an Android update, type:
fastboot flash system <system file name>.img
Finally, there's the vendor image. This is only present on newer phones, so don't worry if it's not in your factory images package. But if it's there, it contains a few important files, so type the following line to get this partition updated:
fastboot flash vendor <vendor file name>.img
After you've sent any or all of the above commands, you'll be ready to restart your device and boot into Android. To do that, type:
fastboot reboot.
At this point, your device should be fully updated, or if you were trying to recover from a soft brick, it should be running flawlessly.
Hello everyone
Please i'm in France and would like to upgrade to Pie
When i try nby updater no update appear
i'm on 8.1 with Nov Sec Patch

Help! I really screwed up...

It all started when I tried to temporarily boot into the TWRP img file. It didn't work so I tried flashing the file to boot_a. Then I installed TWRP through the installer (stupidly didn't wipe the caches) and... Well. When I try to boot into System through TWRP, it gets COMPLETELY stuck at the powered by Android logo screen. No amount or combination of button holding will shut it off and I actually had to let the battery (thank you SO MUCH for non-removable batteries by the way, smartphone manufacturers >_>) drain before it would actually boot again. Rebooting it into Download mode will get it stuck in there too where every time I hold the power button and shut it off, it will just reboot right back into Download mode again. And now, here's probably the worst part. I CAN'T UNLOCK the critical partition to flash when in Download mode, so I can't use the OST tool! When I try to unlock it, it just complains that flashing unlock is not allowed even though the rest of the bootloader is completely unlocked.
TL;DR - When I power the phone up it goes straight into TWRP. Booting to System totally freezes it and the Bootloader puts it in a loop when I try to power it off. Critical partition is locked for some reason. I CAN get around the bootloader loop though and get back to TWRP by switching active slots and rebooting.
Did you flash the TWRP installer to your active boot partition or your inactive one? If you flashed it to the active one, you can't get into system anymore because TWRP is your boot partition.
If you are on Oreo, and you flashed to the inactive slot, and then patched the active slot, you have to reboot into the active slot recovery and flash the Magisk installer to disable verification of the partitions.
If you can get into the bootloader, and you still have the unlock key from nokia, do fastboot flash unlock <unlock.key>, and then fastboot oem unlock_critical. Then you should be able to flash using OST.
THMSP said:
do fastboot flash unlock <unlock.key>, and then fastboot oem unlock_critical. Then you should be able to flash using OST.
Click to expand...
Click to collapse
This unlocked it! Thank you! <3
I also did have an issue with the OST tool complaining that the updater was out of date, but changing the .mlf file and leaving it unpacked when I opened it in OST seemed to make it work perfectly. My phone is now booting just fine and back to stock!
Now I just need to solve the original problem I had. How can I install TWRP to recovery since the img file wouldn't temporarily boot last time?
EDIT: Apparently unlocking the critical partition seemed to solve the problem of the TWRP image file not temporarily booting as well!
S5Guy said:
EDIT: Apparently unlocking the critical partition seemed to solve the problem of the TWRP image file not temporarily booting as well!
Click to expand...
Click to collapse
No, thats because you flashed back the May firmware, where fastboot boot was still working properly. It only broke after the august update. If you want TWRP on newer security patch versions, you can get it here: https://bit.ly/nokia-nb1 in the folder "Boot Images". Those images are prepatched, you can safely flash them to your active boot partition. It also contains stock images for restoring before updating.
THMSP said:
No, thats because you flashed back the May firmware, where fastboot boot was still working properly. It only broke after the august update. If you want TWRP on newer security patch versions, you can get it here: https://bit.ly/nokia-nb1 in the folder "Boot Images". Those images are prepatched, you can safely flash them to your active boot partition. It also contains stock images for restoring before updating.
Click to expand...
Click to collapse
Yeah looks like you're right. Letting it update back to Android 9 deleted TWRP and made fastboot boot for TWRP nonfunctional again.
Wait, so can I use that TWRP boot image you specified to boot temporarily to TWRP and then run the installer zip? Or will that not work and I'll have to flash the img directly from the bootloader?
S5Guy said:
Wait, so can I use that TWRP boot image you specified to boot temporarily to TWRP and then run the installer zip? Or will that not work and I'll have to flash the img directly from the bootloader?
Click to expand...
Click to collapse
You have to flash it directly to your boot partition. fastboot boot will work for nothing (and even if it worked those images would just send you directly into the system)
THMSP said:
No, thats because you flashed back the May firmware, where fastboot boot was still working properly. It only broke after the august update. If you want TWRP on newer security patch versions, you can get it here: https://bit.ly/nokia-nb1 in the folder "Boot Images". Those images are prepatched, you can safely flash them to your active boot partition. It also contains stock images for restoring before updating.
Click to expand...
Click to collapse
Alright! fastboot flash boot_a (TWRP image) worked! Thank you so much for all the help. <333

Phone goes into fastboot mode after I reboot, can't get into system or recovery

My phone keeps getting stuck on fastboot mode.
I'll flash the standard MIUI ROM using the MiFlash Tool, then I flash a custom recovery and a custom ROM(EvolutionX in this case), everything works and I can set up my phone, but as soon as I reboot I can no longer boot into android or recovery. i've tried flashing multiple recoveries using fastboot and straight up booting a recovery using "fastboot boot recovery.img" but it still always go to fastboot. The only solution is to start the process all over again, and obviously that's just not an option since I can never turn my phone off after that.
Any tips?
I think I got it solved, at least I got it to reboot into Android and TWRP.
I used this guide, but I'll write the steps I took here in case you're having the same issue. I wound up using xiaomi.eu MIUI rom, but it shouldn't matter what you use, I'll assume you're stuck in fastboot.
Do "fastboot flash vendor vendor.img", you get this vendor.img from the fastboot version of the official MIUI ROM, after you decompress the .tar.gz it should be in the "images" folder
Do "fastboot flash recovery twrp.img" then "fastboot boot twrp.img", this should flash twrp as your recovery and then boot into it, for some reason it only worked with the official twrp, not orange fox.
Assuming you got into TWRP you should now flash the latest firmware(I got mine from xiaomifirmwareupdater.com) make sure you download just the firmware not the entire rom, mine was named something like fw_raphael_miui... .zip
Format data (not wipe, format, it's a separate option in TWRP), it should ask you to type yes, so do that.
Flash whatever ROM you want
Hopefully this helps you, I hate finding forum posts marked "solved" but with no instructions. I also tried the "vbmeta_dv_shivsom.img" method some threads mentioned but it didn't work
Here's a pastebin of the guide I used in case the original link goes down
You can get all the files I mentioned from xiaomifirmwareupdater.com and the official TWRP site
Out of all that, the one instruction that solves it is the format data step. This is the magic step required. You always need to do this when flashing over MIUI.
Flashing vendor was totally irrelevant.
This will tell you what you need to do.
Simple Guide to flashing successfully
Here's a quick guide to some of the basics. Which recovery. ---------------------------- Use the latest from here. https://forum.xda-developers.com/k20-pro/development/recovery-unofficial-twrp-xiaomi-redmi-t3944363/post79823568 Do not use Orange...
forum.xda-developers.com
Thanks a lot man! I'm having this issue and it is beyond annoying. I've lost so much time with this BS.
Edit: Does not help actually
I just had the same problem with my Lamentablet.
I was trying stuff up and restarted it in fastboot mode and got stuck there.
So, ways to deal with it:
adb reboot recovery
rebooted the tablet in recovery mode. All I had then was to press the power button to activate Reboot. Solved! From now on it boots normally.
Meanwhile I had discovered that by typing
fasboot continue
the tablet would resume, but at the next reboot cycle, power down + up cycle or reboot after a crash, the tablet would reboot into fastboot mode...
And I found this out when it crashed (it's not called a Lamentablet for nothing!).
Luckily I had a PC with Linux around. It didn't have the software installed but drivers were already in the Kernel and installing adb and fastboot was a matter of mere seconds. If I didn't have an easily ready PC at hand, this tablet would have become a brick until plugged in and rebooted...
OMG Thanks dude.... I'm literally working to installing custom rom on redmi 7a from stock rom but I don't know what reason that make my phone always stuck on fastboot when format data, before this was fine.
Osga21 said:
I think I got it solved, at least I got it to reboot into Android and TWRP.
I used this guide, but I'll write the steps I took here in case you're having the same issue. I wound up using xiaomi.eu MIUI rom, but it shouldn't matter what you use, I'll assume you're stuck in fastboot.
Do "fastboot flash vendor vendor.img", you get this vendor.img from the fastboot version of the official MIUI ROM, after you decompress the .tar.gz it should be in the "images" folder
Do "fastboot flash recovery twrp.img" then "fastboot boot twrp.img", this should flash twrp as your recovery and then boot into it, for some reason it only worked with the official twrp, not orange fox.
Assuming you got into TWRP you should now flash the latest firmware(I got mine from xiaomifirmwareupdater.com) make sure you download just the firmware not the entire rom, mine was named something like fw_raphael_miui... .zip
Format data (not wipe, format, it's a separate option in TWRP), it should ask you to type yes, so do that.
Flash whatever ROM you want
Hopefully this helps you, I hate finding forum posts marked "solved" but with no instructions. I also tried the "vbmeta_dv_shivsom.img" method some threads mentioned but it didn't work
Here's a pastebin of the guide I used in case the original link goes down
You can get all the files I mentioned from xiaomifirmwareupdater.com and the official TWRP site
Click to expand...
Click to collapse
thanks bro. flashing vendor after a format from twrp did the good

Categories

Resources