yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] videotech:
OTA update failed

Hi guys, I'm new to flashing. I flashed Lineage OS 16 on my Mi 8 about a month ago according to the instructions here and it worked a treat. No problems. But I also didn't ever try to update - until yesterday ;)

Before the update I uninstalled Magisk and booted into TWRP to create a backup (I also switched off lockscreen security to swipe-only before or else TWRP wasn't able to decrypt my data). Back in LOS I then pressed the "Install" button in the OTA updater. It booted into recovery, flashed the update ok (it seemed), then rebooted again and it showed the Lineage OS boot animation (that elliptic curve with the moving circles). But there it hanged, didn't ever continue to show the full Lineage OS logo and eventually just booted back into recovery again after some time. I retried a few more times but it always hanged there at the boot animation and then booted back into TWRP.

I then restored my nandroid backup in TWRP. Restore went without error and I chose to reboot into system afterwards but it then just booted back into recovery again. I tried some more but same thing. So I'm not seeing the Lineage OS boot animation anymore but only TWRP bootloop now after restoring my backup.

I then tried manually re-flashing the Lineage OS image in exactly the version I had successfully installed before the OTA update assuming that the problem with restoring backup may be that there's some mismatch after the partial OTA update. I wiped system, cache and dalvik, then re-flashed old Lineage OS image. Then I restored my backup again but that also didn't help. Still TWRP bootloop.

I then read somewhere that bootloop may happen when you don't wipe data, in particular for encrypted devices. So I wiped also data and re-flashed old LineageOS image again. I couldn't restore backup anymore then because that got wiped as well when wiping data (but I have a copy of the backup still on PC too, but have no USB OTG adapter, so can't access it right now anymore in TWRP). Anyway, so I just tried booting into system then after this clean re-flash of Lineage OS but I still just get the TWRP bootloop. So I'm stuck at that now.

Can you help me understand what went wrong in my case? So why did the OTA update fail to boot? And why did restoring the backup also not solve the problem again? And how can I get back on track now? (preferably without having to start entirely from scratch, so at least I'd like to get my installed apps and the settings back)... Thanks for any help!
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Hydro24:
Hello!

It seems to be an issue with encryption indeed, so you should try to flash a remove_encryption.zip. I have no idea how it happened, but it is maybe because you removed Magisk. You can safely update with Magisk installed, it will be automatically removed and installed again for you.

You should try this :

- format data

- wipe data, system, cache

- flash recommanded xiaomi global rom

- flash latest LOS

- flash gapps

- flash remove_encryption.zip

- flash magisk

- boot to OS

- go back to twrp

- flash /data backup

Tell me how it went :)

Edit : you can access your phone storage booted into TWRP, from your computer (at least I can)
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] videotech:
Will try that, thanks. As to encryption: Is there no way to reliably use LOS with encryption enabled? So that's an important feature imho and when initially installing LOS I therefore also did not format data but only wipe it (because I read somewhere that after you format data, encryption cannot be re-enabled anymore later). And so I had encryption enabled still and it all worked very well - until the OTA update. So is there no way to update without removing encryption first?

And yes, I also see internal storage when I have my phone connected to PC and I'm in TWRP. However, since I wiped data now also my internal storage (sdcard) got garbled, so I only see random file and foldernames and the sdcard gets mounted just read-only, it seems. I guess this is also because of the encryption. And TWRP can't decrypt it anymore now after wiping data because that wiped also encryption settings (and keys) maybe...
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Hydro24:
LOS has encryption enabled by default, as you could see. Encryption should not be a problem with OTA update, what went wrong has to do with Magisk I think. Have you uninstalled magisk without going back to OS?

You shall have formated data after leaving MIUI for the first time, I'm surprised you could even boot in a custom ROM without doing it. Maybe that's the problem. Maybe not.

Format data does not removes encryption forever, encryption can still be activated from the OS in settings, or by default.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Ferr1s:
I just flashed the modified twrp.img via twrp.app and then the gpay db.zip in recovery mode.

tomorrow I will try NFC payment. call you back
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Spectr126:
I also can confirm the problems with NFC, not only related to payments but also to other operations like validating bus tickets. In other cases it works through, like simple NFC cards reading or using Android Beam, so it looks like an HCE problem
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] riyosakura:
For me i dont have problem for android beam and nfc card reading. Even updating my emoney card work flawless with the nfc.

Btw, does systemui crash still occured with the latest build? I have not updated in a while.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] infrag:
new unofficial build in OP
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] pharos23:
I can't get led notifications for text messages in the Los messaging app or Google messages.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Hydro24:
I'll test in the evening ;)
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Ferr1s:
NFC payment with Payback Pay (Germany) didnt work. I flashed the modified TWRP and the gpay db

Gesendet von meinem MI 8 mit Tapatalk
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] ffaka:
I'm having poor 4G quality, i don't have any issue with PE or syberia rom.

I'm on the latest firmware.

Any advice?
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] aramyscampos:
From MIUI.EU beta to Lineage

Hello guys how's going?

I'm currently running MIUI.EU 9.6.13 BETA , but on the last OTA update i got some issues which i was unable to fix, so i will change to another rom.

What would be the correct procedure to install this amazing ROM, considering the version i'm coming from?

I've read on the first page that i would need to install MIUI P based vendor/firmware 9.4.18.

Since i'm running 9.6.13 , is there something to worry about, considering ARB, from 9.6.13 to 9.4.18 ?

Thanks in advance

Aramys
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Hydro24:
There should be no problem if you use latest beta as a base for LOS. You will find detailed instruction for installation if you search the thread ;)
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] hypern0va:
In my case no reboots yet but I updated just yesterday (so not enough time to make a definitive statement) and I've also taken precautions from reboots to happen, like turning off WiFi when not needed (just an intuition from the logs I posted a few days ago, I don't know if it's actually correct or not). This because I noticed that if the soft reboot happens during night and I don't unlock the phone after it, 'cause I'm sleeping, the alarm won't ring at morning.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Spectr126:
Yes, I don't know if I've expressed myself wrong but I also have no problems with Beam or NFC cards/tags reading, I do though with other operations like tickets validation or payments. I've also taken a look at the logs some user posted a while ago in this same thread and mines look exactly the same, with no particular error or warning coming up during the transaction tentative, even if it keeps retrying performing it every ~0.2s without success.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] riyosakura:
Any changelog?

Or the same with official only with added vendor built?
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Hydro24:
I'm sorry to announce that fingerprint still does not work. I did a clean flash (I was on AOSiP), and installed Gapps and Magisk.

I'll stay on this build to help development, even if fingerprint does not work. Please tell me if you need anything [MENTION=1187148]infrag[/MENTION]

Bugs:

- face recognition does not work, a small face icon is shown at the bottom of the lockscreen, but it quickly disappear. I see the IR camera turning red, but switching off with the icon (see attached log)
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Valdrio:
9.6.13 has problems
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] aramyscampos:
Which one do u recommend my friend?

Regards

Aramys
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] nfsmw_gr:
A changelog would be nice, like always.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] infrag:
Here is a permissive build.

Can you test fingerprint and let me know?

https://drive.google.com/open?id=1T-FQQrRwYWk0HcmUvqhUv2x4IurwVtsW
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] nono77240:
I too have some issues related on this thread.

I lose internet from time to time.

I also have face unlock working a few times then stop working.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] hypern0va:
I clean flashed the latest build, btw I've managed to understand the cause of the problem, described in the previous post's edit.

But I've another issue now: messaging apps' push notifications do not work, I receive messages only after I manually open the apps. This is very similar to the problem that usually affects Chinese MIUI roms.

Is it normal having to manually disable battery optimization for all of these? I never did on other devices and everything worked smoothly.

As I previously wrote my phone is a Chinese model, but I've flashed the global beta suggested in the OP before installing this ROM. Is it possible that I'm still on Chinese firmware? Also, during the ROM's flashing process TWRP showed "Xiaomi/dipper/dipper:8.1.0/OPM1.171019.011/V9.5.11.0.

OEACNFA

:user/release-keys" in the "target" entry.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] 3dxtrip:
https://drive.google.com/file/d/1JWZxDR-GldyUwQIP3OM3VQblSAMqoeBi/view

I used logcat reader to get this logcat, don't know if it's complete please tell me if something's wrong
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] infrag:
That's not normal no.

I've got a Chinese model too so it had to be a firmware or carrier problem. I'll need you to run some commands to check... I'll get back to you...
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] sheg0:
Does this rom force encrypt data?

If so, I would flash disable DM-verity and force encrypt zip.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] infrag:
new build added to OP.

Based on newer firmware release by Xiaomi.

Please thank yshalsager in his firmware thread for the firmware provided.

I'll add a proper link to his firmware tomorrow. For now i've got a copy linked I downloaded.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] hypern0va:
Thank you a lot! So, is

1- flash new firmware

2- flash vendor image

3- flash new build

The correct update procedure? Thanks
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] maxniper:
I'm already on MIUI 8.10.12, is it better to flash all like in OP or flash directly New built?

1- flash new firmware

2- flash vendor image

3- flash new build

4- Gapps
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] infrag:
If your on that firmware/vendor anyway then just flash build + gapps.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] maxniper:
Thank you for the help :)
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] ermacwins:
Where did you get 8.10.12 ROM? I'm on the EU 8.10.11 ROM and there are a lot of bugs

Slow boot

Can't disable notch

Notch not perfectly aligned

WhatsApp resets and I have to set up again

Did you have any of these problems?
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] xdamami:
Eu 10.12 available. Pie booting so long it is known. Notch working well. No problem with whatsapp.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] mahmutuslu:
New build dual 4g and dual volte work?
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] manutdsnake:
I can't unlock my phone as soon as it boots, it's always asking for pattern. I flashed everything as op says. Help please? I didn't have such issue with Pixel2ROM
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] ZhenMing:
For step 2:

I'm using this:

fastboot flash vendor vendor.img

However, the error was:

target reported max download size of 536870912 bytes
Invalid sparse file format at header magi

If I continue, the phone will not boot.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] infrag:
Flash it using twrp.

Its not a proper fastboot vendor.IMG. its been converted from the MIUI ROM download.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] infrag:
https://www.google.com.au/amp/s/xda...king/remove-lockscreen-recovery-t3530008/amp/

Try that. Sounds like you've kept your data from pixel ROM and therefore have this problem?
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] infrag:
I don't know. I can't test it.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] TomOkyo:
No Problem so far with Clean Install from Xiaomi.eu 8.10.12 after format Data. Gapps Micro. Thanks to the DEV :)
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] maxniper:
Me too, so far so good, no issues at all.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] takis:
Is the fingeprint sensor the only thing affected by this change?
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Moldeb:
Why is ADB debugging via USB re-enabled on every reboot (LOS official, no root)? I don't want people to mess with my phone should they get hold of it. Therefore I'd like to turn ADB on when I need it but my developer option gets overwritten on reboot. How can I make it persistent?

---------- Post added at 07:10 AM ---------- Previous post was at 07:03 AM ----------

I don't have soft reboots / system ui crashes. Neither with the June 18 build nor earlier ones. LOS official is rock stable on my phone. I have no Magisk/root but use Nova, Blokada, gcam etc.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Hydro24:
It still does not work, and face unlock either. Also I can't change the Bluetooth codec in Developer options to Aptx HD (I could with AOSiP).

EDIT :

- brightness often goes back from 0% to 25%, it seems to happen after a deep sleep
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] infrag:
Heres another test.

Thanks for the useful logs.

https://drive.google.com/open?id=1fXr8qoK_s7sWzdL_nUzUHI4LIWTqYlSa
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Hydro24:
Thank you for the update, but it's still not working :/

Bugs :

- fingerprint

- faceunlock

- some Bluetooth settings in Dev Settings

- brightness going to 25% although previously set to 0%

- notification icons staying in status bar until pulled down

Could you provide a small changelog with each update? So that I know what to test ;)

EDIT : added log
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Valdrio:
9.6.5 until next one is out, hoping it'll be good
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] hypern0va:
Ok I'm at 4 reboots on this build, so the problem's not solved
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] YumeMichi:
Upload /sys/fs/pstore folder. If I remember correctly, the reboot issue will be fixed in Linux 4.9.181 but the latest build is still using 4.9.179
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Schwinni:
With 2019-06-14 I had no System UI crashes in 2 days.

With 2019-06-16 I had 2 crashes in 2 days.

Since 23 hours I'm on 2019-06-18 and had no crash so far.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] khusika:
Kernel problems and it should be fine now with the lineage-16.0-20190619.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] hypern0va:
I'll test 20190619 build like khusika suggested and upload /sys/fs/pstore in case the problem will still be here
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] pat__boy:
Hi, is there a reason why i cannot encrypt my phone ? It just reboot in twrp and after that my phone is no more able to start. Need to factory reset it.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Hydro24:
Your storage is encrypted and somehow can't be decrypted anymore. If you want to get rid of encryption, flash a disable zip. Otherwise you can't restore backups (or have fun with freely flashing stuff)
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] pat__boy:
Thx m8! Where i can find this zip ? I dont think my storage is encrypted... Twrp dont ask my any code for decrypting it. Disable_Dm-Verity_ForceEncrypt_02.04.2019.zip i already flash this after updating my vendor... Is it the good zip to flash or it's another one?
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Hydro24:
It's the good zip. LOS is encrypted by default, so you have to flash it. As far as I can see, you did everything correctly. What exactly have you done before it happened?
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] pat__boy:
This morning i tried to update my phone via to ota updater... The update go without any problem but my phone did not want to boot (i had magisk installed). I tried multiple thing and nothing was working. I reformat data.. System and data partition. I reflash the new firmware. Flash the disable script and reinstall LOS. It started well. I went to the security option and i saw my phone was not encrypted. So i try to encrypt it and my phone didnt want to reboot.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Hydro24:
OTA updater always worked fine for me, I didn't even need uninstall magisk before.

Well, I'm not sure if encryption works well with Magisk installed, you should check it out. Maybe trying to encrypt after disabling forced encryption also is not a good idea.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] pat__boy:
Okay, so if i want LOS encrypted i need to try to format system.. Data. Flashing rom zip.. Gapps zip and magisk. Restart it and it will now be encrypted with ota working? Sry to bother u and thx a lot for your respond!
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] aRnonymous:
[MENTION=1187148]infrag[/MENTION] could flashing another kernel help with the nfc payments, Or is this an LOS issue?
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Hydro24:
You're welcome :)

It should be working, yes. I couldn't find any post about this kind of issue... Sorry I'm not very familiar with encryption, I only see it as an inconvenience.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Moldeb:
Yes. Don't use Disable_Dm-Verity_ForceEncrypt* if you want to encrypt or you end up corrupted. LOS will encrypt automatically provided you formatted data, install as described in post #1 and assign a PIN or password. Works OK here, also with OTA. TWRP also asks for the password before the file manager etc can be used. Encryption is the bare minimum security IMO given the bootloader is unlocked.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] pat__boy:
Yeah it seem to work now :) thx a lot!!!

---------- Post added at 11:07 PM ---------- Previous post was at 10:58 PM ----------

Is there a reason why twrp cannot decrypt my phone ?

EDIT: with the unofficial twrp it work now... So thx to all of u!
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] HB-1:
bump.

Hi infrag. Seems my other posting was lost. The issue with the head phones was fixed. Issue was the headphones itself. WIth original Xiaomi headphones no issues at all. ( I had issues with lowering the volume automaticaly)

Actually I have 2-3 other issues.

1. Android Debugging (ADB) turns itself to "ON" after every reboot. Since this is a security issue, could you be please so kind and have a look? Also another user here mentioned this issue.

2. GPS is almost unusable since some previous nigthtly. I cannot point the specific update when it started. Actually It takes ages to get the position and during navigation the connection to the sats is lost. I can see some sats (but very less) with gpstest or satsat, but they are not used for positioning. For what ever reason. Its in my home. for example. Usually I had best performance there, or even on my way to work. I used it every day for weeks without any issue. The connection was perfect and not lost during navigation. Now I have splits of Kilometers until the connection is build again. Also it was connected before to even more Satelites due to the two gps chips. Now I can see for example 22 Sats, but its connected to 7-12. This was absolutely different before Any chance you can check this? Its very annoying not be able to use GPS at all.

Can anyone confirm? I do not use any Gapps. Just F-Droid and osmand as app for offline navigation.

3. Same for mobile connectivity. At my home its very bad over LTE and same for my work place and other places where it was excellent before. The chance that on all destinations are existing issues with the provider antenas are very rare.

Anyone else affected by this?

Do you have a filter or something I could set for creating logs? Because When I record logs over x hours the log will be very big with a lot of bloat stuff in it.

Kind Regards

HB1
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] Hydro24:
Latest unofficial, Gapps nano. I have no issue with GPS and mobile data.

Use syslog for logs, and upload the zip file which is much smaller.
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] videotech:
This procedure worked. Thanks! So after I did this (in particular, fully formatted /data), my phone booted into the OS again and after restoring the /data backup I also had my apps back.

However: Installing OTA updates continues to fail. So after recovering like above, I installed a new OTA update (this time without uninstalling Magisk before - just pressed the install button of the the OTA updater, no other preparations). Like last time, it booted the phone into recovery and flashed the update successfully. Afterwards the phone reboots into OS, Lineage OS boot animation is shown for a long while, then it reboots back into TWRP. And so I have a TWRP boot loop again now.

And also like last time, when I restore the nandroid backup (boot, system, data) that I did before the OTA update, it also doesn't help. So the phone remains in TWRP bootloop.

So how can I actually update LOS? Having to format /data every time and freshly flashing vendor and system too isn't really a workable approach...
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] pat__boy:
If your device is encrypted... I would try the unofficial twrp. Yesterday i was able to install the 18 june package and update it to 19 without anyproblem with the unofficial twrp. Official twrp have some problem with decryption... Don't know if it can help
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] videotech:
Which TWRP unofficial? So which version and from where?

I'm currently using TWRP 3.3.1-0 official. And I don't have a problem decrypting my data. So in TWRP file manager I can see all the data and also when I connect the phone to my PC while in TWRP I can access the files on the internal storage ok. So it looks like TWRP can decrypt the data. Just after flashing the OTA update with TWRP, phone doesn't boot anymore...
[Xiaomi Mi 8 ROMs, Kernels, Recoveries, & Other Dev] pat__boy:
https://xdaforums.com/mi-8/development/recovery-unofficial-twrp-recovery-t3893823/page20

But if twrp ask you a password and you are able to decrypt it... It's probably not the problem.