rumplestilzken / gargoyle_lineageos20

LineageOS 20 TrebleDroid releases for Unihertz devices
49 stars 0 forks source link

Boot loop after flashing Unihertz Titan EEA #45

Open lietu opened 5 months ago

lietu commented 5 months ago

Got myself a Unihertz Titan to try LineageOS on a device with hardware keyboard. It was already running Android 10 so I performed the following steps:

Then I executed the following commands

adb reboot bootloader
fastboot flashing unlock
fastboot erase system 
fastboot erase cache
fastboot erase userdata
fastboot flash system lineage-20.0-20230529-UNOFFICIAL-gargoyle_bgN.img
fastboot reboot

flash took a while but it kept saying OKAY for various parts:

Sending sparse 'system' 1/22 (131060 KB)           OKAY [  3.540s]
Writing 'system'                                   OKAY [  1.168s]
Sending sparse 'system' 2/22 (131048 KB)           OKAY [  3.542s]
Writing 'system'                                   OKAY [  1.131s]
Sending sparse 'system' 3/22 (131064 KB)           OKAY [  3.548s]
Writing 'system'                                   OKAY [  1.142s]
Sending sparse 'system' 4/22 (131056 KB)           OKAY [  3.547s]
Writing 'system'                                   OKAY [  1.087s]
Sending sparse 'system' 5/22 (131068 KB)           OKAY [  3.550s]
Writing 'system'                                   OKAY [  1.072s]
Sending sparse 'system' 6/22 (131036 KB)           OKAY [  3.552s]
Writing 'system'                                   OKAY [  1.239s]
Sending sparse 'system' 7/22 (131068 KB)           OKAY [  3.558s]
Writing 'system'                                   OKAY [  1.063s]
Sending sparse 'system' 8/22 (131060 KB)           OKAY [  3.560s]
Writing 'system'                                   OKAY [  1.118s]
Sending sparse 'system' 9/22 (131068 KB)           OKAY [  3.558s]
Writing 'system'                                   OKAY [  1.071s]
Sending sparse 'system' 10/22 (131056 KB)          OKAY [  3.556s]
Writing 'system'                                   OKAY [  1.140s]
Sending sparse 'system' 11/22 (131064 KB)          OKAY [  3.558s]
Writing 'system'                                   OKAY [  1.089s]
Sending sparse 'system' 12/22 (131052 KB)          OKAY [  3.562s]
Writing 'system'                                   OKAY [  1.147s]
Sending sparse 'system' 13/22 (131060 KB)          OKAY [  3.556s]
Writing 'system'                                   OKAY [  1.111s]
Sending sparse 'system' 14/22 (131064 KB)          OKAY [  3.553s]
Writing 'system'                                   OKAY [  1.087s]
Sending sparse 'system' 15/22 (131064 KB)          OKAY [  3.559s]
Writing 'system'                                   OKAY [  1.087s]
Sending sparse 'system' 16/22 (131032 KB)          OKAY [  3.560s]
Writing 'system'                                   OKAY [  1.277s]
Sending sparse 'system' 17/22 (131052 KB)          OKAY [  3.552s]
Writing 'system'                                   OKAY [  1.139s]
Sending sparse 'system' 18/22 (131060 KB)          OKAY [  3.549s]
Writing 'system'                                   OKAY [  1.107s]
Sending sparse 'system' 19/22 (131064 KB)          OKAY [  3.555s]
Writing 'system'                                   OKAY [  1.088s]
Sending sparse 'system' 20/22 (131060 KB)          OKAY [  3.571s]
Writing 'system'                                   OKAY [  1.137s]
Sending sparse 'system' 21/22 (117844 KB)          OKAY [  3.208s]
Writing 'system'                                   OKAY [  1.294s]
Sending sparse 'system' 22/22 (43932 KB)           OKAY [  1.207s]
Writing 'system'                                   OKAY [  0.418s]
Finished. Total time: 102.307s

Now I'm just stuck on an infinite boot loop. When it powers on there's the Unihertz logo, "Powered by android" logo, and very shortly later a very small notice appears saying

Orange State
Your device has been unlocked and can't be trusted
Your device will boot in 5 seconds

This screen stays for about 20 seconds, then the screen will turn off for about 5 seconds, and then it reapperas.

I tried pressing volume up, volume down, the programmable key on the left edge, power button, and the keys on the top row of the keyboard, in various combinations, both tapping them repeatedly, and holding for extended periods of time.

Rather unsurprisingly both adb and fastboot do not seem to recognize the device while it is in this state. On https://github.com/SolidHal/Unihertz-Titan-lineageos-microg/blob/master/README.md it says

recovery : power cycle and hold volume up. If you just get the broken droid, press or hold volume up some more, or possibly power + volume up.

Does not seem to work, but it also does say

note: unfortunately if you end up bootlooping for some reason, recovery is likely also inaccessible

and

Finally, this key combo is pretty finicky

Would appreciate ideas on what could be done to 1) Power off the device (my current plan is to just wait for the battery to run out) 2) Boot to fastboot again 3) Properly install LineageOS

TiTi65 commented 5 months ago

Hello, I've briked my phone 3x this weekend, trying to install it :). first, you need to unbrick it. you'll need sp flash tool, and the firmware (non OTA version), and you'll be fastly able to recover the phone. After, you'll be able to try again.

regarding the install, I'm sure that the readme of install take more command than this...

lietu commented 5 months ago

Right, thanks for the hint with the SP Flash Tool, the software is very poor quality in general and impossible to figure out on its own, and nothing made it seem likely that the software would even work if I can't power it off or properly boot, but some online guide for the exact actions to do at https://romprovider.com/unihertz-titan-firmware-support/ combined with where-ever I got the original images downloaded from seems to have done the trick to restore the device to apparently stock operation.

regarding the install, I'm sure that the readme of install take more command than this...

This is not helpful at all. Firstly, I don't think you're reading the same guide as I am, I was reading https://github.com/rumplestilzken/gargoyle_lineageos20/releases/tag/v1.2 .. secondly vaguely hinting at "more commands" is unhelpful in general. Thirdly the guide itself is pretty poorly written, so it's not exactly clear what are you ACTUALLY supposed to do based on it, and it is clear that actually following the guide does not result in a successful flashing.

So e.g.

image

This to me looks like it's got something to do with either Android 9->10 upgrade, or rooting the device which apparently is what magisk is used for. There is not image provided, or any link for where to get it, and the steps above this do not in any way indicate you should be in fastboot mode right now, and my device was not on Android 9, so it does not seem related to installing the image in any way.

Then it has stuff for other device, before it says

image

... and what I wrote was:

adb reboot bootloader
fastboot flashing unlock
fastboot erase system 
fastboot erase cache
fastboot erase userdata
fastboot flash system lineage-20.0-20230529-UNOFFICIAL-gargoyle_bgN.img
fastboot reboot

.. I added the missing "flashing unlock" command, because as said, following the provided guide does not actually work. Otherwise there are no additional commands related to flashing the Titan in the README that I can tell.

After these things it has something about upgrading, which is not related as I've not even booted to it the first time, followed by various other notes etc. that are not related to the flashing itself.

So if you @TiTi65 think somewhere here is something I've missed that needs to be done for the flashing to work, please actually say what you think it is that I'm not doing.

lietu commented 5 months ago

I tried the updated version https://github.com/rumplestilzken/gargoyle_lineageos20/releases/tag/v1.4 and following the guide to make the Magisk -patched boot image, same end result as previously. Clearly that was not the missing magic sauce.

TiTi65 commented 5 months ago

I've used this: https://github.com/rumplestilzken/gargoyle_lineageos20/releases/tag/v1.4 I've briked at first time because Magisk 21.4 made an incomplete boot.img (looks like some info (vendor ?) where missing) -> bootloop. SPFlash to re install the phone to stock, Android 9. Re upgrade to Android 10. tryed to flash a found boot.img patched -> bootloop... Retry from the begining with Magisk v27, and it was ok.

I've done something like: adb reboot bootloader fastboot flash boot fastboot reboot

adb reboot bootloader fastboot erase system fastboot erase cache fastboot erase userdata fastboot flash system (I use the google one, for Titan, as I have the Titan) fastboot reboot

and it works (I've followed the rest of the post after). I have an old Titan, with eMMC, not sure if this have an impact, but the other product are a little different (slim or pocket). I'm not sure the initial release of Android 10 I came from at the first trial, but at the successfull one, I was on 2021-02-04-16.

Regarding SP Flash, it's the only way I know to restore it back, there is a ton of tutorial over internet. The only thing I've found unclear, is that release OTA don't work for full restore... I'm in europe, I used this for initial repair:2020081015_g61v71c2k_dfl_eea

amorawski commented 4 months ago

Hey, similar issue here, Titan OG.

1. Use Mediathek SP Flash Tool v5.2152.00 to reset device to Android 9:
  1.1. Download package: 2020081015_g61v71c2k_dfl_eea
  1.2. In the SP Flash Tool go to "Download", pick scatter-loading file from the package. Hit download.
  1.3. Restart device with power button.
2. Enable developer mode, enable debugging.
3. Update to Android 10:
  3.1. adb reboot recovery
  3.2. pick in recovery: apply update from adb
  3.3. adb sideload 2021020416_g61v71c2k_dfl_eea-ota.zip
  3.4. pick in recovery: restart device
4. adb install Magisk-v27.0.apk
5. adb push 2021020416_g61v71c2k_dfl_eea-ota/boot.img /sdcard/Download
6. Open Magisk, install, patch file, selected uploaded boot.img
7. adb pull /sdcard/Download/magisk_patched-<random name>.img
8. adb reboot bootloader
9. fastboot flash boot magisk_patched-<random name>.img
10. fastboot reboot
11. Launch Magisk, it will reboot.

--- everything is fine till now ---

12. adb reboot bootloader
13. fastboot erase system
14. fastboot erase cache
15. fastboot erase userdata
16. fastboot flash system gargoyle_bgN.img (v1.4, gargoyle_bgN-vndklite.img is causing error: FAILED (remote: 'sparse image size span overflow.'))
17. fastboot reboot

--- Bootloop. No profit :( ---
lietu commented 4 months ago

So I managed to get mine working just the other day and I've been thinking of writing the steps more clearly, but on a high level this worked on Titan UFS EEA

Get (I did not yet verify that these are the exact files I used but I believe these are them)

All the preparations

  1. SP Flash Tool reset to Android 10
  2. Enable developer mode, enable debugging, enable file access
  3. Upload Magisk-v25.2.apk and boot.img
  4. Install Magisk, apply to boot.img with the vbmeta option enabled
  5. Download magisk_patched_25200_xxxxx.img
  6. adb reboot fastboot
  7. fastboot flash boot magisk_patched-25200_xxxxx.img
  8. fastboot reboot
  9. Launch Magisk, allow it to finalize, reboot
  10. Extract gargoyle_bgN.img.xz

And then

adb reboot bootloader
fastboot erase system
fastboot erase cache
fastboot erase userdata
fastboot flash system gargoyle_bgN.img
fastboot reboot

So specifically for you @amorawski sounds like you also tried Magisk v27 like I did and that's your problem - switch to v25.2 and make sure you check the vbmeta setting.

lietu commented 4 months ago

And as a note, people tell me rooting is a mandatory step, even though it is definitely not something I'm interested in, and the install guide just says something like "notes on rooting", indicating it is not very important.

amorawski commented 4 months ago

That was it, my steps do work with Magisk v25.2 and vbmeta setting checked. @lietu I owe you a beer.