Encrypting - Xiaomi Mi A2 Lite Questions & Answers

Hello! It's me again! Tommorow, I unlock bootloader, flash stock oreo and flash twrp. My questions is:
1. Did I need everytime after flashing android pie do this what explained in Phase 3? Link: custom rom https://forum.xda-developers.com/showpost.php?p=78029178&postcount=29
2. Everytime I want to switch rom (pie) I must do this: reboot to twrp, factory reset, flash os_system.img to system, flash gapps magisk and some other stuff then reboot?
Sorry for my probably dumb questions, because its my first treble phone!
Greeting

Related

The terrible fate of refurbished N5X

Hi,
My Nexus 5X died some days ago, and Google shiped me another one. But this new device have the unbelievable "NO RPMB" message that locks the bootloader (this is a known issue where the bootloader is automatically re-locked after each reboot, making flashing factory images an harassing journey).
I installed TWRP to flash a custom rom but after each reboot on the system,TWRP was replaced by stock recovery !
Do anyone knows how resolve this problem ? I suppose if I can flash a custom rom it will solve a great part of the problem... I'm actually thinking of sell this new phone and get another device like oneplus.
Any help will be appreciated ! ?
Atok_fr said:
Hi,
My Nexus 5X died some days ago, and Google shiped me another one. But this new device have the unbelievable "NO RPMB" message that locks the bootloader (this is a known issue where the bootloader is automatically re-locked after each reboot, making flashing factory images an harassing journey).
I installed TWRP to flash a custom rom but after each reboot on the system,TWRP was replaced by stock recovery !
Do anyone knows how resolve this problem ? I suppose if I can flash a custom rom it will solve a great part of the problem... I'm actually thinking of sell this new phone and get another device like oneplus.
Any help will be appreciated !
Click to expand...
Click to collapse
Unlock bootloader, flash TWRP and boot straight to recovery without rebooting, perform a factory reset and root. That should make TWRP stick. If it doesn't, you can then use the TWRP manager to install TWRP again.
CazeW said:
Unlock bootloader, flash TWRP and boot straight to recovery without rebooting, perform a factory reset and root. That should make TWRP stick. If it doesn't, you can then use the TWRP manager to install TWRP again.
Click to expand...
Click to collapse
Thanks mate, it worked !
CazeW said:
Unlock bootloader, flash TWRP and boot straight to recovery without rebooting, perform a factory reset and root. That should make TWRP stick. If it doesn't, you can then use the TWRP manager to install TWRP again.
Click to expand...
Click to collapse
Quick question. As I just picked up a refurb N5X on the cheap and I plan to use it (fingers crossed it does have RPMB, not holding my breath though)- how viable are custom ROMs on this thing? The reddit thread that started this all states to leave /system unmodified but other comments say that they've flashed custom kernels.
So- if this is the case, would the order be unlock bootloader>flash stock images/noencrypt>flash TWRP>boot into TWRP> factory reset> boot into Oreo> unlock bootloader and boot into TWRP when modifications need to be made?
Thanks.
negusp said:
Quick question. As I just picked up a refurb N5X on the cheap and I plan to use it (fingers crossed it does have RPMB, not holding my breath though)- how viable are custom ROMs on this thing? The reddit thread that started this all states to leave /system unmodified but other comments say that they've flashed custom kernels.
So- if this is the case, would the order be unlock bootloader>flash stock images/noencrypt>flash TWRP>boot into TWRP> factory reset> boot into Oreo> unlock bootloader and boot into TWRP when modifications need to be made?
Thanks.
Click to expand...
Click to collapse
I use a custom kernel so that works just fine, haven't tried a custom ROM though. You don't have to unlock the bootloader every time to make changes as long as you have TWRP. I'm not entirely sure but I think rooting made the TWRP stick. If not, you can still install it from the TWRP app as you have root.
After you've installed the stock images, it should be enough to boot into TWRP, do a factory reset and flash the custom ROM.
CazeW said:
I use a custom kernel so that works just fine, haven't tried a custom ROM though. You don't have to unlock the bootloader every time to make changes as long as you have TWRP. I'm not entirely sure but I think rooting made the TWRP stick. If not, you can still install it from the TWRP app as you have root.
After you've installed the stock images, it should be enough to boot into TWRP, do a factory reset and flash the custom ROM.
Click to expand...
Click to collapse
So once TWRP is installed and "stuck", it can make modifications to traditionally "root" partitions (system, data, etc.?).
Also, did you flash the noforce encrypt boot image (and then wiping userdata)? Or does the stock image work?
negusp said:
So once TWRP is installed and "stuck", it can make modifications to traditionally "root" partitions (system, data, etc.?).
Also, did you flash the noforce encrypt boot image (and then wiping userdata)? Or does the stock image work?
Click to expand...
Click to collapse
Yes. I've for example installed all the OTAs from TWRP (except Oreo).
Stock image works.
CazeW said:
Yes. I've for example installed all the OTAs from TWRP (except Oreo).
Stock image works.
Click to expand...
Click to collapse
Thanks. Does DRM content work? I've also read conflicting reports as to apps like Netflix working on Oreo.
negusp said:
Thanks. Does DRM content work? I've also read conflicting reports as to apps like Netflix working on Oreo.
Click to expand...
Click to collapse
I don't use Netflix so can't say if that works but Play Movies worked on Nougat.
CazeW said:
Unlock bootloader, flash TWRP and boot straight to recovery without rebooting, perform a factory reset and root. That should make TWRP stick. If it doesn't, you can then use the TWRP manager to install TWRP again.
Click to expand...
Click to collapse
Hello, i have the same NO RPMB problem Im using latest stock rom 8.1 (December patch), radio, bootloader and vendor.
How can i boot straight into recovery without rebooting? Do i need to flash vendor.img too? (i would like flash latest AEX rom).
If im not wrong i should do this procedure as suggested right?
- unlock bootloader from fastboot
- flash latest twrp recovery from fastboot without rebooting (this will work? Because in the N5X root thread it's written to reboot first)
- get into twrp without rebooting (how do that?)
- install root (i will use latest Magisk)
- perform factory reset
- wipe system, data, cache, and dalvik cache
- install custom rom, gapps...
- wipe cache and dalvik, and reboot
Finally i will have a rooted device with custom rom and bootloader locked again right?
Or is preferred this solution of Reddit user?
https://www.reddit.com/r/nexus5x/comments/5hj0r0/bootloop_after_lg_replaced_mainboard_bootloader
sigibian said:
Hello, i have the same NO RPMB problem Im using latest stock rom 8.1 (December patch), radio, bootloader and vendor.
How can i boot straight into recovery without rebooting? Do i need to flash vendor.img too? (i would like flash latest AEX rom).
If im not wrong i should do this procedure as suggested right?
- unlock bootloader from fastboot
- flash latest twrp recovery from fastboot without rebooting (this will work? Because in the N5X root thread it's written to reboot first)
- get into twrp without rebooting (how do that?)
- install root (i will use latest Magisk)
- perform factory reset
- wipe system, data, cache, and dalvik cache
- install custom rom, gapps...
- wipe cache and dalvik, and reboot
Finally i will have a rooted device with custom rom and bootloader locked again right?
Or is preferred this solution of Reddit user?
https://www.reddit.com/r/nexus5x/comments/5hj0r0/bootloop_after_lg_replaced_mainboard_bootloader
Click to expand...
Click to collapse
I haven't tried this with a custom ROM but I would try it like this.
- Unlock bootloader from fastboot
- Flash TWRP from fastboot
- Select boot to recovery from the fastboot menu
- Do a factory reset
- Wipe system, cache, and dalvik cache
- Flash ROM, flash Gapps
- Flash Magisk
- Reboot

Twrp and flashing a Rom

So I've done a lot of reading and there are multiple threads with steps that aren't exactly clear or contradict each other or are outdated. I just want clarification on what I believe are the steps to flash a custom rom (7.1.2 since I can wait for 8) on a brand new Pixel XL.
Setup phone to the point of enabling adb debugging and oem unlock
Fastboot unlock
Fastboot boot twrp RC1 img
Flash twrp RC2 zip in twrp
Reboot to installed twrp
Wipe system, data, caches
Flash ROM
Flash twrp again
Reboot to twrp
Flash gapps and root method (magisk working for 7.1.2 or should I be using supersu? Also which versions?)
Flash twrp again??
Boot to ROM then setup and use like normal
Should this give me custom ROM, root and twrp that I can boot directly to without a pc again? As long as I do twrp flashing after a ROM each time it'll stick? Also, I keep seeing things for setting a pin before initial twrp boot but without spending 4 days reading I can't find the reason for it. Should I be flashing vendor, bootloader and radio for the latest Nougat release BEFORE unlocking or can I do it through fastboot prior to unlocking?
Coming from Nexus 6P and that was my first run in with the bootloader, radio and vendors so I want to avoid issues for myself. Phone should be here tomorrow and want to get down to business right away lol.
Any and all information is greatly appreciated. If all of this is answered in a centralized area please point me to it and tell me I'm stupid for missing it.
Sent from my SM-N910P using Tapatalk
Found this over in PN thread. Is it accurate? Seems similar to my process.
https://forum.xda-developers.com/showthread.php?p=73846565
wgrant said:
Fastboot boot twrp RC1 img
Flash twrp RC2 zip in twrp
Reboot to installed twrp
Wipe system, data, caches
Flash ROM
Flash twrp again
Reboot to twrp
Flash gapps and root method (magisk working for 7.1.2 or should I be using supersu? Also which versions?)
Flash twrp again??
Boot to ROM then setup and use like normal
https://forum.xda-developers.com/showthread.php?p=73846565
Click to expand...
Click to collapse
Assuming the bootloader is already unlocked and disregarding the unlocking instruction, these instructions are dead on accurate. I personally dont use magisk, but maybe another user will chime in. For 7.1.2 id use supersu 2.82.
You dont have to flash twrp again after flashing gapps and supersu, but its a good practice to have.
noidea24 said:
Assuming the bootloader is already unlocked and disregarding the unlocking instruction, these instructions are dead on accurate. I personally dont use magisk, but maybe another user will chime in. For 7.1.2 id use supersu 2.82.
You dont have to flash twrp again after flashing gapps and supersu, but its a good practice to have.
Click to expand...
Click to collapse
Thank you very much. I'm about to unlock and go nuts on my phone. New phones are so fun to fiddle with!
if you want to use magisk you'll need to flash a custom kernel before you flash magisk. Also you'll need a modified magisk zip. Search around the thread you'll find one, the latest version I found was magisk v13.3.
Edit: Just found out magisk is officially support for pixel on version 14.1 Check out the magisk beta thread.

Help!! My Pixel 2 XL is stuck in the bootloader!

Hello, I was just trying to install a custom ROM (Resurrection Remix) on my phone, but now I can't get out of the bootloader.
The steps I took were:
Install TWRP
Root with Magisk (for Titanium Backup)
Factory Reset in TWRP
Flash the RR rom zip file
and now when I turn my phone on, it goes through the bootloader unlock notice and the Google screen, but then it just goes into the bootloader.
I tried going into LineageOS recovery and doing an OEM sideload, but when I go into Apply Update --> Apply from ADB, on my computer, adb devices shows nothing.
Someone please help me.
SuperModder123 said:
Hello, I was just trying to install a custom ROM (Resurrection Remix) on my phone, but now I can't get out of the bootloader.
Click to expand...
Click to collapse
So fastboot should work. You can always flash the stock ROM first and continue from there.
Instructions: https://developers.google.com/android/images
Try the following,
Go back to stock
Boot twrp
Swipe to factory reset in twrp
Flash RR ROM zip
Flash TWRP zip
Boot to system (it should go to OS)
reboot back to TWRP
Flash custom kernel (optional)
Flash Magisk for root
Boot back to system

Stuck on Mi-Logo after GSI installation

Hey guys,
I have recently bought my "Whyred" (4/64 global) and have already unlocked the bootloader.
After switching to Miui 10 global developer rom (with official MiFlash Tool) I wanted to test some custom roms. Therefore I have enabled the developer options, USB-Debugging and OEM Unlock. After this I have booted TWRP 3.2.2.0 with fastboot and flashed the TWRP image to the phone via the booted recovery. Followed by the no-verity-opt-zip (6.0) and Magisk v16.7 to root the phone.
On this basis I went back to the recovery and did a factory reset, followed by an advanced wipe of dalvik, cache, data, system and vendor. Afterwards I have moved the whyred-treble-vendor (zip-file) and the PixelExperience GSI to my phone. First I have flashed the vendor-zip and then switched to image and flashed the GSI as system-image.
And now comes the problem: when I try to reboot to the system it always states "No Os installed". By wiping the cache and data again, I am able to boot to the system, but the phone is stucked on the Mi-Logo
After recovering my phone with the MiFlash Tool (Miui 10 global developer rom), I have tried to flash the GSI in different ways according to a lot of guides I have found in the net, but nothing is working. All methods are leading to the same result: my phone stucks on Mi-Logo
Could anyone of you give me a hint about what I am doing wrong?
Thank you!
Best regards,
nkl
At a guess with wiping system and data. Your also removing changes done by "no-verity-opt-zip (6.0)", and since your still using the MIUI Bootloader the device won't boot the associated GSI.
Maybe try flashing/booting a Treble enabled custom rom, first and then install your GSI. Or avoid the whole Treble thing and just use a custom rom.
You may get more assistance in Treble specific threads/forums.
corkiejp said:
At a guess with wiping system and data. Your also removing changes done by "no-verity-opt-zip (6.0)", and since your still using the MIUI Bootloader the device won't boot the associated GSI.
Maybe try flashing/booting a Treble enabled custom rom, first and then install your GSI. Or avoid the whole Treble thing and just use a custom rom.
You may get more assistance in Treble specific threads/forums.
Click to expand...
Click to collapse
Hey,
Thank you for your quick reaction!
But did I get something wrong? Doing a factory reset and then doing an advanced wipe of dalvik, cache, data, system and vendor is more or less an essential part of all the guides out there?
So you think, I should try to flash for example LineageOS first and then take an approach on the GSI? And which steps should I take? Should I flash no-verity-opt and Magisk under Miui 10 global dev first and then flash custom, i.e. LineageOS? Or should I flash LineageOS first (on a fresh Miui dev rom) and then no-verity-opt and Magisk?
Thanks!
@nkl0806 After installing the GSI while using MIUI as the base you could try flashing no-verity-opt before trying to boot.
no-verity-opt is only required on MIUI based roms (or in your case with a GSI).
Flash a custom rom and boot it. Don't worry about magisk etc.
Then install your GSI and boot it, avoid flashing magisk or gapps.
Once it boots, go back and install magisk and gapps etc and wipe data.
Hopefully then boot and setup your GSI rom.
Also make sure your using a Treble enabled TWRP!
Noob guide to install GSI on whyred
Again look for support in Treble Threads/Forums, I haven't experiment with it, so only going by what I have read.
corkiejp said:
@nkl0806 After installing the GSI while using MIUI as the base you could try flashing no-verity-opt before trying to boot.
no-verity-opt is only required on MIUI based roms (or in your case with a GSI).
Flash a custom rom and boot it. Don't worry about magisk etc.
Then install your GSI and boot it, avoid flashing magisk or gapps.
Once it boots, go back and install magisk and gapps etc and wipe data.
Hopefully then boot and setup your GSI rom.
Also make sure your using a Treble enabled TWRP!
Noob guide to install GSI on whyred
Again look for support in Treble Threads/Forums, I haven't experiment with it, so only going by what I have read.
Click to expand...
Click to collapse
Thank you!
I have also followed this noob guide to flash the GSI, but it did not work out. Maybe I should really skip the Treble stuff and just use the normal custom rom!
I will try to flash the PixelExperience rom and not the GSI - or maybe follow another Guide and flash the Mokee rom first as a base for the GSI.
Thanks again!

**MANY** questions regarding flashing

Disclaimer: I come from the LG D802 world so I have no idea what antirb, dm-verity, authorization code or other strange protections are. Back then, any soft/hard brick could have been simply fixed by putting the phone in download mode and flashing the original software. So here I'm a bit scared to mess with the phone. I googled up all these questions, but mostly got contradictory answers so I decided to make a thread here trying to address everything.
For all the following scenarios, we'll consider that we're running the latest global MIUI with antirb = 4 (MIUI v10.0.1 OEIMIFH)
SCENARIO 1:
Let's say I want to gain root access with the original ROM (in my case: MIUI v10.0.1 OEIMIFH with antirb = 4). I understand that I have to:
1. fastboot into some custom recovery (let's say orangefox)
2. reflash redwolf from recovery
3. flash magisk
4. reboot into system
Now I should have root access, right? What about if I want to make changes to the /system partition now? From what I understand, there is a dm-verity check that detects changes to the /system partition and bootloops the phone if found. So, am I safe or not to make changes? (eg: flash youtube vanced, edit hosts, remove system apps, edit configuration files, etc)
SCENARIO 2:
I read somewhere that in order to disable all /system integrity checks, I'll have to reflash MIUI through orangefox and it will auto-patch out those checks. So, for instance, I want to flash the latest weekly xiaomi.eu ROM. (which AFAIK is China developer based and might interfere with the antirb check). The steps should be:
1. download the ROM
2. look into the .zip file and remove the firmware update script (is this necessary or orangefox will take care of it ???)
3. copy to sd
4. wipe cache, dalvik and /data (without /system and /persist)
5. flash through orangefox
6. flash magisk
7. reboot to system. done???
Now I should be able to make all sorts of changes to the phone (/system partition) without bootlooping or whatever?
SCENARIO 3:
Let's say I want to flash RR (or any other custom ROM). The instructions say that I need to have a NON-ARB firmware. What does it mean? How do I flash a NON-ARB FW if I'm on ARB 4 without bricking my phone?
SCENARIO 4:
Let's say that somehow I managed to flash a custom ROM. How can I go back to the original MIUI without bricking/losing the unlocked bootloader? Is miflash enough?
Unrelated questions:
1. How to make the custom recovery permanent? (is booting into recovery + twrp reflash enough ???)
2. Will OTA's brick my phone? (the phone being twrp'ed + magisk'ed)
3. Will OTA's remove my custom recovery?
4. What is lazyflasher and when does it have to be flashed? (or is it still required?)
5. Is it possible that the bootloader will get relocked by mistake?
6. What are the advantages of redwolf/orangefox compared to vanilla twrp?
I'd appreciate if somebody could take time to explain the steps and answer my questions (especially those from scenario 3) because I'm pretty sure there are many other users as confused as me regarding all this xiaomi flashing policy.
Scenario 3 : No you don't have to flash any firmware as you are already in latest miui version
Non ARB is for those people who is using anti3 ROM and don't want to upgrade to anti4 ROM
Just flash RR ROM without flashing any firmware file
Scenario 4 : yes using MiFlash just flash fastboot ROM or else just flash recovery ROM from custom recovery
There won't be any chances of bricking if you use MiFlash software because MiFlash checks bootloader index before flashing fastboot ROM, to be safer side always flash latest available MIUI ROM
xiaomi.eu is not a official ROM you can get official ROM from en.miui.com
To make custom recovery permanent just flash lazy flasher
No OTA will not brick your device
Yes if you flash full recovery ROM then custom ROM will be replaced by mi recovery but you can avoid this by flashing lazy flasher
No there is no chances of bootloader lock with OTA update, to lock bootloader you have to flash fastboot ROM using MiFlash software and you have to select clean all and lock option
Thank you, I finally start to understand how this phone works.
Now I have 1 more question: what about that dm verity thing? I don't feel yet ready to go to a full custom rom so I'd like to try out xiaomi.eu rom first because I understand that it is based on the chinese version of miui which comes with extra features. Will messing around with /system partion bootloop my phone? (due to the dm verity thing)
csm1n said:
Thank you, I finally start to understand how this phone works.
Now I have 1 more question: what about that dm verity thing? I don't feel yet ready to go to a full custom rom so I'd like to try out xiaomi.eu rom first because I understand that it is based on the chinese version of miui which comes with extra features. Will messing around with /system partion bootloop my phone? (due to the dm verity thing)
Click to expand...
Click to collapse
All the edited options will be over written by newly flashed ROM.
I don't know much about Dm Verity but you can flash lazy flasher to avoid dm Verity
Hopefully you will find your answer here https://forum.xda-developers.com/an...zip-lazyflasher-tool-flashing-custom-t3549210
csm1n said:
Thank you, I finally start to understand how this phone works.
Now I have 1 more question: what about that dm verity thing? I don't feel yet ready to go to a full custom rom so I'd like to try out xiaomi.eu rom first because I understand that it is based on the chinese version of miui which comes with extra features. Will messing around with /system partion bootloop my phone? (due to the dm verity thing)
Click to expand...
Click to collapse
had a G2 long time.
dm verity you can flash after installing TWRP flash file called lazyflasher or use orange fox recovery and no need to do anything. just flash and forget.
also try masik rom
I'm a newbie myself. Can I ask a few questions too?
1. If I want to root (miui 10) and install some mods, what's the best way to backup my current rom before rooting?
2. If I change my ROM to a custom ROM, how can I flash back my current ROM with OTA?
Thanks
Remig83 said:
I'm a newbie myself. Can I ask a few questions too?
1. If I want to root (miui 10) and install some mods, what's the best way to backup my current rom before rooting?
2. If I change my ROM to a custom ROM, how can I flash back my current ROM with OTA?
Thanks
Click to expand...
Click to collapse
1. TWRP Backup or ADB backup
2. You can return to stock MIUI ROM by flashing fastboot ROM using MiFlash (Recommended) or by flashing MIUI Recovery ROM

Categories

Resources