TeamWin / android_device_leeco_zl1

7 stars 6 forks source link

Can't upgrade encrypted device with TWRP / LineageOS #1

Open yurtesen opened 5 years ago

yurtesen commented 5 years ago

Device codename: zl1 TWRP version: 3.3.1

WHAT STEPS WILL REPRODUCE THE PROBLEM?

1- Install TWRP 2- Install LineageOS 16 and addonsu 16 and opengapps pico arm64 android 9.0 3- Encrypt phone with 4x4 pattern 4- Upgrade LineageOS using OTA

WHAT IS THE EXPECTED RESULT?

1- System boots into TWRP 2- Asks encryption pattern. (as update is in /data/lineageos_updates) 3- LineageOS is upgraded 4- Reboot 5- Ask decryption pattern then boot into OS.

WHAT HAPPENS INSTEAD?

1- System boots into TWRP 2- LineageOS is upgraded without asking encryption pattern! 3- Reboot 3- Asks decryption pattern. Then tries to go into OS but gets stuck forever at boot animation. If I reboot into recovery and clean cache/dalvik cache and reboot. It tries to boot for a while but it reboots into recovery.

ADDITIONAL INFORMATION

Recovery log from upgrade operation: /tmp/recovery.log: https://paste.omnirom.org/view/1564f2a5 dmesg: https://paste.omnirom.org/view/9a9cae23

yurtesen commented 5 years ago

I am thinking that the issue is that the LineageOS puts update file into /data/lineageos_updates so how can TWRP apply the update without asking the encryption pattern???

CaptainThrowback commented 5 years ago

Decryption isn't needed to apply an OTA. However, if you have other addons installed, these will not be able to install while data is encrypted, which may lead to an unbootable system. There are already several issues related to this open (See: https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1478 and https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1459), and there's a patch on Gerrit that allows decryption prior to processing of the OTA file to help circumvent this issue. If you can build a TWRP with that patch included and see if it fixes the issue (and then post feedback on the patch), that would be helpful for getting it merged.

https://gerrit.omnirom.org/c/android_bootable_recovery/+/34338

yurtesen commented 5 years ago

@CaptainThrowback I did not know that it does not need decryption and assumed it would as the update file is larger than the /cache partition and I could not imagine how it could apply it otherwise...

If somebody builds TWRP for zl1 with the patch, I can test it. I am not able to build it myself right now.

Thanks!

CaptainThrowback commented 5 years ago

For your edification, here's the patch that enabled installing OTAs without first decrypting /data: https://github.com/omnirom/android_bootable_recovery/commit/72638b6437822300fefd77569d98fbad3dad5c28

timeneverdie commented 5 years ago

I once meet this problem while using LineagesOS's OTA(an updater apk built in the OS) and only reboot TWRP automatically over and over again, cannot enter system. System and TWRP are both dead. I remember the OS version is 0724 nightly.

Now I change to the latest TWRP 3.3.1-2(older one is 3.3.1-0), and I flash the all new system zip(still the LineageOS, 0726 nightly), I find I can get into system but still sticking at the recovery boot loop. System is alive, TWRP is dead. But I am not sure if I update the OS, what will happen.

See my reported issue: https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1492

yurtesen commented 5 years ago

@timeneverdie There is no newer TWRP for zl1. Also this is a problem only if the encryption is enabled. https://dl.twrp.me/zl1/

Obviously this is a known issue as @CaptainThrowback explained. Mine sounds similar to issue https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1478