yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] a-dead-trousers:
As for SPFlash Tool and the MKT-USB-Drivers they could be a little tricky to install and handle, so here a quick guide:

MTK-USB-Drivers https://mtkusballdriver.com/

SP Flash Tool https://spflashtools.com/category/windows

After unpacking the MTK-USB zip file you get an "Installer" file which essentially just unpacks anothers round of installers. Interessting is just the one in "Driver_Auto_Installer_.1632". Execute the installer inside and everything should work just fine.

The SP Flash Tool only needs to be unpacked.

Next up start "flash_tool.exe".

You might notice that the latest version looks quite different to the one depicted in the flashing guide from Unihertz. Even more it's much easier to handle. Just choose your scatter file, select "Firmware Upgrade" from the dropdown menu and hit "Download". Gone is all the calibration bull****.

Now it waits for the device to flash. So POWER DOWN your phone and connect it with the USB cable to the PC. As soon as you turn on your phone the flashing should start.

As for the vbmeta-files it's my fault to not have included them in the TWRP builds. I will fix this briefly. Sorry. For now just use those from the first post.

Essentially there is only one "vbmeta.img" though and it needs to be flashed on all three of the partitions (vbmeta, vbmeat_system and vbmeta_vendor).

@Treeoctopus

Your problem of not being able to boot into stock ROM could be a problem with AVB. I think stock Rom requires the original vbemta.img and verification enabled. So this step might need to be left out from the flashing procedure if you just want to have a custom recovery installed and still use the stock ROM.

Therefore I want you to do a reflash of the whole Stock ROM and then just install TWRP or Lineage Recovery (whichever you prefer) without flashing the vbmeta files. if that works I'll update the installation docs accordingly.
[Miscellaneous Android Development] landsome:
So if I understand correctly the only problem is rooting/Magisk? Does LineageOS install properly? (Is this the Android you tried?) Does it work properly?
[Miscellaneous Android Development] Treeoctopus:
Hi there - it's getting to almost midnight here so apologies if I drop off the convo - thanks for such speedy replies.

@landsome * Never tried installing Lineage OS, just the recovery which loaded fine. Have used it on other devices but in the absence of having even given the stock Android a try figured thought just rooting it would be fine.

@a-dead-trousers : no problem with the vbmeta files, honestly I was kind of playing with fire and expected I'd have to figure out the SP Flasher anyways.

Before the (win10) laptop battery died I did try flashing TWRP directly first thing with "

fastboot flash recovery recovery.img"

and got an error saying something about "locked" ...

I'm about to have to call it for the night, might tomorrow try just patching the boot.img from the official firmware with Magisk directly.
[Miscellaneous Android Development] a-dead-trousers:
You forgot the `OEM unlocking` step.
[Miscellaneous Android Development] Treeoctopus:
Morning a-dead-trousers,

Thanks again for chiming in.

So I'm still getting it stuck, and my best read is that Magisk is the problem.

0) Reflashed with unihertz flash tool

1) unlockedthe bootloader (the mediatek sp flash tool didnt relock it, but the unihertz one did

2) used magisk to patch a boot image, then flashed it as per the instructions on magisk github -> resulting in a bootloop where it loads up to a unihertz logo and "orange state: your device has ben unlocked and cant be trusted, rebooting in five seconds... then goes dark for about ten seconds and returns to the same screen (never shows the fastboot as before). Seems to want to keep restarting, and couldnt get buttons to get into TWRP recovert

Crud.

3) reflashed - a bit trickier this time to get the right timing but it worked once I finally got it to turn off and stay off..

4) check for unlocked bootloader and activated usb debugging

5) fastboot flash recovery recovery.img ( As per suggestion flashed the recent TWRP directly without doing any vbmeta).... - same result with orange state bootloop.

Next effort flashing lineage recovery without vbmeta triplet.

6) reflash

7) adb reboot bootloader

8) fastboot flash recovery recovery.img (lineage one)

9) fastboot reboot (shows orange state warning...then goes to....android!

10) adb reboot recovery

11) shows what I think is stock recovery - green droid on back with red warning triangle sign and text "no command".

12) tried powering down, not sure what happened but got to a stock recovery: orange and blue text.

13)selected reboot to see if Android is still working...yep

14) adb reboot recovery.. "no command" graphic... had to tinker with buttons but it seems power and down got to the text menu

15) trying adb sideload magisk now -- adb devices gives "unauthorised

"

16) phone stuck on black text "supported API 3. Now Send the package you want to apply to the device with "Adb sideload <filename>"

17) power down by holding button for about ten seconds

18) Going to try the above without fastboot reboot which has already been mentioned in posts as overwriting recovery

19) adb reboot recovery

20) fastboot flash recovery recovery.img

21) fastboot reboot recovery -> goes to lineage recovery!

22) lineage recovert apply update; apply from adb

23) adb sideload Magisk-v21.4.zip , ignore sig verification

24) Phone displays magisk 21.4 install text

25) lineage recovery power down

26) turn on phone...hope for the best

27) stuck on "orange state/black loop"....drat

28) reflashing

Well, this is turning into a bit of a puzzle. Maybe I misread @GameHunter1 post and he rooted it by installing Lineage OS....so that's the next go ...
[Miscellaneous Android Development] Treeoctopus:
Hello all, just wanted to post this worklog with my failed attempts to get lineage OS installed - I've tried both the original post 20200828 and the dirtylimericks build with a variety of approaches for recoveries:::

A) Trying to install peters 20200828 linege build from original post

1) reflashed

2) check bootloader unlock and activate usb debuggin

3) adb to bootloader, flash 3 vbmeta files, flash TWRP, fasboot reboot recovery to TWRP

4) sideload lineage 20200828 peter , sideload magisk, sideload gapps (nano said not enough space)

5) reload to green line, back to recovery, cant load android

6) reflash

B) now trying the same but using lineage recovery

1) As above but using the XL lineage recovery from XL thread instead of the recent TWRP alpha

2) upon sideloading lineage 20200828 version it says "for XL only" upon lineage recovery sideload "E error 7 in/sideload/package.zip

3) reflash

C) now trying materials from dirtylimericks builds as posted on github/dropbox: the vbmeta files, the recovery files, and the .zip of lineage

1) everything seems to go right upon flashing from adb, but upon "fastboot reboot recovery" it shows green line, then reboots to android.

2) trying "adb reboot recovery" leads to stock recovery, so it never took hold or got overwritten

3) So similar failure to @Bray90820.

D) Trying dirtylimericks build of Lineage viaTWRP

1) Flashing recent TWRP alpha build - loads fine via fastboot reboot recovery.

2) sideloading lineage-17.1-20201109-UNOFFICIAL-Atom_L.zip seems to start transfer nicely, no errors reported

3) sideload magisk - seems to work fine

4) sideload gapps pico- seems to be working fine

5) reloads to green line problem on splash screen ... so here we are again.

I

@dirtylimerick, @GameHunter1, @a-dead-trousers, @ PeterCxy - it seems like you all have managed to get it up and running but somehow I can't recreate an equivalent path....I think I've tried every combination available that I can put together from this thread.

At this stage I'm going to play around with the phone on stock rom unrooted and stop trying to get a daily driver up and running.

Happy to try any new combination of the pieces there that you can think of or test out new builds for you. Thanks again!

Lineage or Stock is fine, I just want the thing rooted so I can load up app backups and avoid ads.

Thanks again and hope all these horribly typed worklogs help someone down the line.
[Miscellaneous Android Development] landsome:
Thanks for the effort in writing all of this up!

One question though: am I right in understanding that you were in some cases able to boot into LOS - just not rooted with Magisk?
[Miscellaneous Android Development] Treeoctopus:
Sure thing, it's saved me an endless bit of repetition - I got a sony xz2 compact finally rooted after maybe 300 lines of worklog....

Nope, have not managed to get Lineage to run at all. Of all the pieces (recovery, Lineage OS, Magisk,), the only things that have had any visible successes are LineageRecovery and TWRP.

At the moment this phone is pretty much available duty for alpha testing with the developers who are putting builds together....at the very least I'm pretty confident I can reflash it again and again - haven't hard-bricked it yet!
[Miscellaneous Android Development] uzalu:
Hey, thanks for publishing this build! I will probably install it on my device soon, but I'm hoping you can inform me on a few things first.

Any amount of information on these topics is appreciated, thank you all in advance.

EDIT: I've now installed LineageOS, it works well.

Important note for installation: I could only boot into the LineageOS recovery after flashing a particular stock image. You'll need to flash this one, in my experience, before attempting to install LineageOS recovery.

1. I've noticed that the torch/flashlight can't be turned on via the quick settings area on the Atom L while the camera is in use. The torch does still work as the camera flash, and OpenCamera can set it on consistently too. Is the torch being handed off completely to the camera app whenever the camera is on? Is this problem present on your build? It sounds minor, but this disables a very useful functionality for me. I need to be able to use the torch reliably when a specific 3rd-party app is using the camera. EDIT: sadly still the case on LineageOS. I wonder if there's any way to fix this.

2. I found the part of the settings on the default Atom L OS which lets you change the PTT button to send intents or a keycode, which I can then pick up in Tasker to do some custom functions. I currently have it configured to turn on the flashlight immediately on pressing the key, then turn it off when the key is released, unless it was held for >500ms in which case it acts as a toggle and the light stays on until next pressed. Would your build allow for this functionality too, or is the LineageOS search button setting more limited than that?

EDIT: Best I can do currently is to toggle the torch on PTT button release, using tasker. Not ideal but it works.

3. I've noticed that pressing the home button on the Atom L often doesn't do anything in the android system the first time it's pressed since turning the screen on (though it still vibrates and lights up the red dot buttons as if it has been pressed). Has anyone else come across this? If so, is this problem also present in your LineageOS build?

EDIT: This may have been due to using a custom assist app. LineageOS provides the same functionality without needing the custom assist app, so I'm not using one. I haven't noticed this problem so far.

4. Can you think of any reason why installing the apt-x and apt-x HD drivers wouldn't work on this device? I tested it on my old Z5 Compact, and it worked, but the two devices have very different hardware, so I'm not certain it would work here. EDIT: Works fine.

5. Does installing the LineageOS recovery make it impossible to boot into the stock OS? If not, would it be possible to have root via Magisk working with the stock Atom L OS? EDIT: Found the answer to this one here.

6. Can the stock OS be backed up and restored reliably via adb, the LineageOS recovery, or some other means? EDIT: Nope, but the stock OS can be reinstalled, and a standard google backup restored. Details for the stock OS install here.

Thanks

-uzalu
[Miscellaneous Android Development] it_unihertz_when_i_pee:
I have an Atom L, and between this thread and some bits/tips from the XL guide thread, I've gotten as far as a reliably-working TWRP.

However, after TWRP-flashing the "lineage-17.1-Atom_L-20200828-peter-signed.zip", (either via adb sideload or from an SD card), the phone just boots back into TWRP.

Have I missed a step?
[Miscellaneous Android Development] it_unihertz_when_i_pee:
@uzalu your post finally got me unstuck after a week of wheel-spinning.

Once I stock flashed with the older stock ROM in their post, the instructions in the OP worked as intended.

For anyone else banging their head on this, try starting from the older stock ROM instead.
[Miscellaneous Android Development] a-dead-trousers:
That's... unfortunate...

So the only available version of this ROM works only with the older vendor partition (it's the only part that is not being replaced by the LOS build). That means something in the kernel or some other files copied from system partition got changed so drastically that it's preventing a successful boot. Most notable change though is the security update in the kernel.
[Miscellaneous Android Development] a-dead-trousers:
I think I could probably manage to do an updated build for Atom L with the things I learned from the Atom XL but I cannot do any support cause I don't own that device to do extensive testing.

If anyone is willing to take it over from there I can set up a repository on github including the bits and pieces I *think* are needed for the Atom L.
[Miscellaneous Android Development] uzalu:
It seems like mobile hotspot isn't available in this build, or does the phone itself lack that feature?
[Miscellaneous Android Development] a-dead-trousers:
Nope, it just needs to be activated in the device tree before building. Did that for the Atom XL and it works fine.
[Miscellaneous Android Development] uzalu:
-accidentally posted something twice, but it seems I can't delete this myself-
[Miscellaneous Android Development] uzalu:
understood, any chance that could be done for the Atom L? Not sure if OP is still active.
[Miscellaneous Android Development] a-dead-trousers:
He's active and is working on sailfish right now. Like he said here in the beginning of this thread he's only doing this device as a side project and won't put much effort into it. I tried to contact him about the decryption in TWRP but he didn't react so I assume he doesn't want to be bothered and I'm not going to do so any further. IMHO it is open now for somone else to take over. Like I did with the fork for the Atom XL.

It would be possible for me to set up a new repo and share my work for the Atom XL with the Atom L. I'm already researching the possibilities "common"-device trees offer to prevent too much duplication. BUT I would need someone to help me with testing the releases for the Atom L cause I don't own that device and maybe even helping out maintaining the device tree(s).

If someone is interessted please feel free to contact me.

OR

If someone is kind enough to donate me an Atom L ... JK ;)
[Miscellaneous Android Development] it_unihertz_when_i_pee:
If I can flash the rom without losing all my user data (aka having to set up dozens of apps again), I'm 100% willing to guinea pig that work. It is my daily driver, so I don't want to lose my data, but I don't mind the downtime of "flash this, see if it works, flash the old one if it doesn't"

Truthfully, if you would be willing to maintain this regularly, I'd consider it. Even doubling my cost comes in well below what flagship phones cost, and finding a unit with good specs and without a titanic screen is tough enough. Strong Lineage support would frost that cake up real nice.
[Miscellaneous Android Development] a-dead-trousers:
I think I'm past this "loosing all settings" stuff. Right after I managed to get the gapps integration to work I didn't need to reset my phone ever since ;)

Just for the initial setup I would recommend a full wipe.

For the "flash this to see if it works" I could use my own device, right after I manage the decryption to work in TWRP so I'm able to bckup, but that is another story. Because the devices are nearly identical simply flashing the other rom should show any imediate problems right away.

No, I would need someone for a more "longterm" testing. Maybe even commitment to investigate on problems by oneself. Best would be someon willing to tinker with the rom. In short terms another developer ;)

Thanks for the offer, I appreciate that, but if I take it, I would feel obligated to "work" and that would dimish the "fun" doing all this stuff.

As soon as I'm "emotionally" ready to start this project, I'll let you know to help me testing.
[Miscellaneous Android Development] Treeoctopus:
Hiya Unihertz Atom L owners,

Just wanted to followup on all those notes from trying to root this phone...

it was all for naught, because on day 6 or 7 of daily driving the non-rooted Atom L, and enjoying it immensely..... the screen decided to totally give up.

It spontaneously self-bricked overnight!

Can't even get the screen to turn on - it seems to flicker a bit. Can't get the LEDs or anythning to respond at all.

Never seen this happen after tinkering and tampering with 10 android over the years; I'm not going to invest any more energy in this phone after having this experience.

I hope this doesn't happen to anyone else....
[Miscellaneous Android Development] landsome:
What a fantastically informative post! Thanks!

A few short comments:

Same problem with bluetooth here. Yet for some reason, it got markedly better in time - without any ROM change (I fiddled a lot with BT settings but eventually reverted to defaults, and it's mysteriously so much better now).

Same problem with the torch. I have found no solution.

For the battery % indicator I use AccuBattery (it's a standard app for me anyways), whose indicator is quite legible.

As to display size (i.e., not font size), I hate it that it does not get any larger. I find it much too small for my taste - that would be the main attraction point of LOS for me.

Vibration motor is horrible. I asked Unihertz (on their public forum) about possible tweaks weeks ago. No answer.

Weight is excessive as well for me. 50 grams less would have been perfect (and probably achievable with a somewhat less stocky case).

I also have a number of older small phones lying around. The Pixel 3, which I used for one year, is too large - but has the perfect vibration motor. The Cubot Kingkong Mini is perfect shape- and weight-wise, but a bit too underpowered with its entry-level MTK A22. The Sony XZ2c is pretty great (after one year of usage, the battery is unfortunately quite depressed at below 80%) - but my XZ1c beats it on most dimensions (except for camera and corners). Out of all of these, I find the latter to be very close to the perfect compact smartphone, though I would have loved a more rounded design, better camera processing and a slightly smaller screen (4.3", perhaps).
[Miscellaneous Android Development] landsome:
Thanks, once again very informative.

Fortunately my XZ1c has a weak vibration motor. How do I know this? I have a second, spare Sony and my wife has an XZ1c as well - and the motor is much stronger on both (on a par with what I have seen in other XZ1cs). Not sure whether this is due to a different hw piece or a slightly damaged part, but I am super-happy with it.

This being said, I have rooted both my XZ1cs (and the XZ2c) and installed custom ROMs. Unlocking the phones no longer damages your DRM keys, killing your camera etc. I think Sony changed the policy one year or so ago. So I am running LineageOS 17.1 on my daily XZ1c (stock camera works, amazingly) and LineageOS 18.1 on the spare phone (no stock cam, but even better battery life). They're both stable and fluid and essentially saved the phones, the usability boost - so to speak - is substantial. There are other custom ROMs available and they work well too.

The KKMs (I own the first one, but they share the SOC) are unfortunately really weak somehow (my old OG Moto G gives me the same or slightly better experience with a custom AOSP 7.1). I run AOSP 18.1 on the KKM - and sometimes LOS - and it's decent (as well as surprising how well the Treble runs on it without any custom tweaks). But I still cannot commit due to all too frequent lags, present in the stock ROM as well, which also has pretty poor battery life.

I will try the Atom L tweaks, thanks a lot.
[Miscellaneous Android Development] landsome:
PS I noticed that BT cuts out during heavy wifi traffic on the 2.4ghz frequency (which they share). Switching to 5ghz solves it momentarily.
[Miscellaneous Android Development] dhchris:
Hello there,

is it possible to root the atom L without LineageOS?

I wanna buy this phone the next days but root is very important for me.

Kind regards,

Chris
[Miscellaneous Android Development] a-dead-trousers:
You'd need to unlock it to get into the bootloader for flashing the patched boot.img (e.g. by Magisk). That's all.

Or you'd need to replace the boot.img in the official stock rom update and flash it using the SPFlash tool.

But on every stock ROM update (not that there are many to expect; I'm crestfallen looking at you unihertz) you'd need to redo that. Using SPFlash you will loose your data. Using bootloader your phone will be "unlocked" and considered not allowed by many security apps.

This is not to discourage you, but to let you know what to expect.
[Miscellaneous Android Development] Dayongdo:
Hello. I know that this thread is about lineageos 17.1, but here is only place where i can quedtion about it.

Does Atom L Stock rom has backdoor or spyware ETC?

I just got phone this morning, to make it sure before first use.

If the answer is yes, I must swipe to lineage.

Thanks.
[Miscellaneous Android Development] a-dead-trousers:
Pfuuuh... That's a good question. I don't really know. It's a phone from china though. Maybe there are some (govermental) backdoors but on the other hand most of the preinstalled apps are from Google/AOSP. Only the "specials" seem a little bit suspecious to me. Especially the IR App showed it's true colors with the last update. It contains a lot of baidu/alibaba (chinees google/social monitoring) stuff now.

For me I'm more concerned on being "up-to-date" than being watched by gov/corp. That's why I'm maintaining my own LineageOS and TWRP ports for the XL and the L (currently untested).
[Miscellaneous Android Development] Dayongdo:
Interesting.

Maybe I can help testing LineageOS.

Because I'd little disappointed about white balance on StockRom :D
[Miscellaneous Android Development] GameHunter1:
Last time few people asked me to describe rooting of my Atom L step by step. Here it is. The method is very similar to what is described in the top, but here a recovery for "Atom XL" is used instead of recovery for "Atom L" that didn't work when I've tried it. Now is it possible that last version of TWRP works, but I didn't try it.

1. Standard steps to provide control of the phone via adb: unlock bootloader, install adb anf fastboot on the computer, enable USB debugging, connect the phone to the computer, ensure that adb sees the phone.

2. Run `adb reboot bootloader` to put your device in bootloader mode

3. Run `fastboot flash --disable-verification --disable-verity vbmeta vbmeta.img`

4. Run `fastboot flash --disable-verification --disable-verity vbmeta_system vbmeta_system.img`

5. Run `fastboot flash --disable-verification --disable-verity vbmeta_vendor vbmeta_vendor.img`

6. Run `fastboot flash recovery "Recovery XL.img"` (this is a recovery of Atom XL)

7. Run `fastboot reboot`, after thet press volume+ button to enter recovery

8. Choose Apply Update, then Apply Update from ADB.

5. Run `adb sideload Magisk-v20.4.zip` from your PC

6. Wait for the process to finish. The recovery might prompt something about verification failure, just ignore it and continue anyway.

8. Reboot into system and enjoy.
[Miscellaneous Android Development] landsome:
Thanks a lot. No changes on the custom rom front, am I right?