yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] a-dead-trousers:
Sadly fastboot is quite different than adb.

In the case of adb there is a running application (adb daemon) that's communicating with your computer. It's part of the OS and can be rplaced/updated.

Fastboot on the other hand is running in a low-level hardware environment and cannot be (easily) replaced/updated.

"Hearing" sound while the phone is connected to the PC often happens when there is some sort of stray electric current or a short circuit.

To rule out a problem with your PC I would suggest you try it on another one (preferably with linux to even rule out windows as culprit)
[Miscellaneous Android Development] a-dead-trousers:
Or try the official drivers: https://dl.google.com/android/repository/platform-tools-latest-windows.zip
[Miscellaneous Android Development] Logiciel-XDA:
Thanks so far. I had already installed the official drivers, as you can see in the prompts screen prints (version r30.0.5).

Is a Linux installation in a virtual machine (Virtual Box) promising or would the underlying Windows OS continue to cause possible problems with Fastboot? Is a direct linux installation mandatory?

How could Fastboot be updated even if it is more difficult? I think somehow Fastboot is ticking around.

I would like to try my Windows laptop first instead of the desktop. Installing Linux natively would only be the very last variant because of the considerable additional effort.
[Miscellaneous Android Development] a-dead-trousers:
Sorry I've overlooked that.

Windows would need to provide the drivers so it would still interfere. I don't know of any VM that supports native USB passthrough but I could be wrong. So a linux installation would be mandatory for now.

That would require a serial interface (COM) or an unsoldering of the chip to flash it with an EPROM burner.

Honestly I'm more concerned (or should I say in hopes) about the windows inbetween. The only other option would be a problem with the phone itself (see previous answer) and to get this through Unihertz support you would need to confess that you tried to tinker with the internals while the phone itself is operating just fine. If I were Unihertz I would say "Sorry, no replacement for you".

Don't you have a friend or colleague with a linux machine you could ask for help? Or you could buy a RasberryPi or a similar device. Those are not so expensive and on the plus side you could use them afterwards for many other things like a home streaming server.
[Miscellaneous Android Development] uzalu:
I followed the instructions exactly, but now the phone loops on the unihertz boot screen with the unlocked warning. It won't even turn off. No button combination does anything, except that volume up + power makes it reboot faster.

On Linux, using the latest android tools.

Is there any way to at least stop it from constantly booting? Is it possible to get it into fastboot any other way?

EDIT: For anyone else who has this problem, the manufacturer provides drivers and tools to re-flash the entire phone to stock. All the relevant links are here. This didn't work on my Windows machine, but it worked using Linux.

My phone has now been flashed back to stock, most stuff restored using Google's backup, but I guess I won't try this TWRP again, and stick to the LineageOS recovery instead.
[Miscellaneous Android Development] a-dead-trousers:
Hi.

Sorry to hear that. This TWRP release was intended for those who had problems with the LineageOS recovery (stuck on green line on reboot and so on). I have an Atom XL so I cannot test it with 100% certainty but as the two devices are quite similar I myself had no problems with this exact TWRP on my own device.

If you stuck in a recovery "bootloop" you could try to press vol-down to boot into the bootloader (not fastboot). But the menu is in chineese.

For the TWRP release for the Atom XL I got this reply:

https://xdaforums.com/t/recovery-10...tom-xl-alpha-2021-01-15.4218695/post-84402809

Maybe this will help you.

In the meantime I'm planning to build a release without accessing the "/data" partition. Since it is encrypted and I wasn't able to find the correct setting for unencryption yet it doesn't make any sense to have it anyway. Also when tinkering with the encryption settings I wasn't able to boot into recovery too. So I believe this is the source of most of the problems.

Until then, stay tuned.

Cheers.

ADT
[Miscellaneous Android Development] a-dead-trousers:
Also, I made a more up-to-date tutorial with the latest versions (drivers & tool) for flashing the stock rom:

https://github.com/ADeadTrousers/an...tom_XL/blob/master/docs/HOW-TO-FLASH-STOCK.md

If your device is stuck in a "bootloop" that is no problem at all because on every restart there is a 2 - 3 sec. time frame for the flashing to start.
[Miscellaneous Android Development] a-dead-trousers:
Now Atom L and Atom XL are supported as well as both regional variants EEA (european union) and TEE (non-european union)
[Miscellaneous Android Development] a-dead-trousers:
I just updated my Lineage releases but I've to postpone their TWRP counterparts.

Why, you ask? Well I had a major breakthrough on the decryption front. I'm now able to decrypt /data completely. But as always, with great power comes great responsibility ... or in this case great destruction.

Well it's true I was able to decrypt /data in TWRP but right after that LOS wasn't able to do the same anymore. Somehow running a full decrypt (by providing your pattern/password) on TWRP "destroys" all the information needed by LOS to decrypt. After that only TWRP is able to decrypt. Maybe that's a "security" feature of trustkernel ... I don't know yet.

Anyway, I had to completely reset my phone (even lost some data cause google drive couldn't load my backups).

Therefore I'm not going to release any updates until I figured out how to prevent this catastrophe for good.
[Miscellaneous Android Development] a-dead-trousers:
I was able to fix the issue with decryption and locking yourself out from your ROM:

Decryption of /data in TWRP messes up password recognition on LOS · Issue #4 · ADeadTrousers/twrp_device_Unihertz_Atom_LXL

Right after providing my pattern in TWRP /data got decrypted but also LOS wasn't able to decrypt any more. My pattern always gets rejected. As far as I can tell /mnt/vendor/persists/t6 gets changed...

github.com

So now it's save enough for me to post an update.

But be warned:

The problem could still resurface so backup your data beforehand. It's better to be save than sorry.
[Miscellaneous Android Development] a-dead-trousers:
I've been wasting so much time now in trying to get MTP working from within TWRP only to find out that under Windows it works just fine. :mad:

So it's only a problem under Linux (either only on Ubuntu/Debian or general I don't know)

I need to get some fresh air now or I'll go ape ****.
[Miscellaneous Android Development] Bonfire:
Hi! I've just bought Atom L and want to do some mods... Your how-to manual is awesome, thanks for that!

I'm just at the beginning on my way to flash LineageOS, but I can't get TWRP to work.

All of your TWRP versions are crashing on my device (european L, fresh new, no data), attaching adb log. I'm not sure where exactly the problem is...

ofc I've flashed vbmetas. The older lineageos TWRP image from peterCxy not just crashes, but also reboots phone, so i have no log....

I'm thinking about trying to build my own TWRP image when I'll have free time (but did this last time many years ago), but maybe it is just some small bit to tweak to make it work on my device? TIA!

edit: cannot attach log, dont know why...: https://mega.nz/file/JEAWwZgD#0EtOnG2_DNOry40D3PL6rGsJw7HUCcnKTBNYtu3bOj0
[Miscellaneous Android Development] a-dead-trousers:
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 357 (recovery), pid 357 (recovery)

This looks like a null-pointer exception (0x0) within TWRP main process (recovery).

And it's trying to do it 6 times and then gives up.

Can you try to provide a kernel dump?

adb shell dmesg > dmesg.log

or maybe even download the TRWP log?

adb pull /tmp/recovery.log
[Miscellaneous Android Development] Bonfire:
Thx for fast reply! Here are dmesg and recovery logs:

319.1 KB file on MEGA

mega.nz

9.7 KB file on MEGA

mega.nz

Now it looks its crashing when composing gui, and its not giving up, it is in loop, not only 6 times :)
[Miscellaneous Android Development] a-dead-trousers:
Recovery is rebooting on 'Checking resolution...'

And according to dmesg the init script keeps repeating in the end.

You said you did everything on a 'fresh new, no data'? How did you do that?

At least you'd need to activate oem-unlock from within the rom and that would 'initialize' data.
[Miscellaneous Android Development] Bonfire:
It is brand new phone, never switched on wifi or sim. I got it today, just unboxed it, and started with enabling developer tools, adb enabled, oem unlocked and then fastboot flashing unlock, vbmetas and TWRP flash.

I don't know, maybe I will connect it to wifi and try to update to newest stock firmware, then try again.

I'm just little concerned about this section, which is telling me I have debug build kernel. but maybe it is OK, original system works OK.

[ 0.000000] -(0)[0:swapper]**********************************************************
[ 0.000000] -(0)[0:swapper]** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **
[ 0.000000] -(0)[0:swapper]** **
[ 0.000000] -(0)[0:swapper]** trace_printk() being used. Allocating extra memory. **
[ 0.000000] -(0)[0:swapper]** **
[ 0.000000] -(0)[0:swapper]** This means that this is a DEBUG kernel and it is **
[ 0.000000] -(0)[0:swapper]** unsafe for production use. **
[Miscellaneous Android Development] a-dead-trousers:
That's my TWRP. I built it in "eng" mode which enables debug output.
[Miscellaneous Android Development] Bonfire:
Ah, so it makes more sense to me now. OTA SW update didn't help, obviously.

Anyway, I've digged into source, found that problem is probably in TWRP's pages.cpp,

probably in LoadDetails function.

After LOGINFO("Checking resolution...\n"); it is crashing, no more logs after this one.

There are only some pixels,offset calculations, which should be OK, but I've found that it is trying to read attribute "noscaling" from resolution tag, which is missing in twres/splash.xml.

Seems strange to me, if there is some error in xml parsing, it will be problem in every device, not only mine.

I've tried to modify splash.xml (set noscaling="1" or noscaling="0", just to be sure), but my repacking utility is probably not working good, so next time I will try to build twrp recovery from scratch.... but now I'm so busy at work :/
[Miscellaneous Android Development] a-dead-trousers:
hmmm... now that you mentioned it:

I had a problem right in the beginning that kept crashing TWRP. It had something to do with setting a theme (TW_THEME := portrait_hdpi) and a device resolution (DEVICE_RESOLUTION := 640x1136) at the same time. Because of the much smaller screensize of the Atom series the scaling of the theme which was build for bigger screens (hence the hdpi) had to be reduced but that kept crashing the recovery if both settings were present. Therefore I removed the theme selection and kept the device resolution. But since then I've build it countless times without problems and even now I use a more recent version so I can pretty much rule out a change in twrp sources.

I've looked into splash.xml and I don't think the "noscaling" is a problemh here. It's not there because the default splashscreen is in fact scalable. So in my book it's just for checking if everything is in order. The actual problem should come afterwards.
[Miscellaneous Android Development] a-dead-trousers:
I've had just the time to test TWRP Atom L TEE myself... and it keeps rebooting.

Argh... what did I do wrong this time?

EDIT:

Both TWRP for the Atom XL (TEE & EEA) seem to work. Only the ones for Atom L keep crashing.

Rebuilding didn't help and even replacing the modified kernel (for touchscreen) with the original didn't help.

EDIT2:

The Atom L EEA from 2021-02-18 works while the next one crashes. That's back when I started to combine the device trees. So my guess is, that there is a (small?) difference between Atom L and XL (besides the DMR) I wasn't aware of. *ooofff*

EDIT3:

Removing/Deactivating everything encryption related I was able to boot into recovery again. Maybe I'm not able to boot into Atom L recovery because I'm on Atom XL encrypted userdata. But why is it crashing and also why doesn't it work on a Atom L encrypted userdata (see @Bonfire)?
[Miscellaneous Android Development] a-dead-trousers:
Conclusion:

I'm not able to boot into TWRP for the Atom L (regardless of the region) on my Atom XL. My guess is that's because I have Atom XL encrypted userdata and that is incompatible with Atom L encryption.

Deactivating encryption in "BoardConfigCommon.mk" and removing the vendor blobs I was able to boot into TWRP for the Atom L.

So I'd need someone else (best would be someone who is willing to do own builds) to check this hypothesis on an Atom L while trying to boot in TWRP with any of the two Atom XL regional versions. My assumption is that it's also crashing right after the splash screen.

If this is not the case best I can do for now is to provide my Atom L builds without encryption support.
[Miscellaneous Android Development] Bonfire:
Hi, sorry I've been very busy last week.

So, I am open to do experiments on my Atom L, well its just lying there, I'm not even planning to use it with original sw, so I can help to get this issue resolved.

Last time I've even used (and modded) smartphone was around 2016, so i need some time to dive into that. I've now synced repo, it took about 4 days on my slow internet connection :LOL:

Now I was planning to find the exact line where it is crashing, but if you have better idea, I'm in.
[Miscellaneous Android Development] Bonfire:
So, I've tried to flash your builds:

- XL TEE (04-15, 05-11)

- XL EEA (01-14, 02-18, 05-11)

stuck, reboot in about 30s, no adb

- L EEA (01-15, 02-18, 05-11)

- L TEE (04-15, 05-11)

stuck, adb works, logs are the same as I've sent before..
[Miscellaneous Android Development] a-dead-trousers:
Try to "wipe" userdata prior to run TWRP.

e.g. by flashing the two partitions /persist and /userdata using spflash.
[Miscellaneous Android Development] Bonfire:
Strange things. Wiping didn't help, I've tried many recovery images, no success.

Finally, I've saved some time and successfully built recovery at home (now just L EEA), and now it is not rebooting at least :)

When rebooted into recovery from CLI, it shows TWRP splash, but it is not reacting on touch/keys.

logcat shows repeating

06-09 05:32:46.450 323 323 W ServiceManagement: Waited one second for android.hardware.keymaster@4.0::IKeymasterDevice/default
06-09 05:32:46.451 323 323 I ServiceManagement: getService: Trying again for android.hardware.keymaster@4.0::IKeymasterDevice/default...

so I think now it should be encryption related problem, as you wrote before.

When booted into recovery by pressing Volume - button, it boots into "old CWM recovery-looking menu as I know from years ago" - simple list, moving in menu by volume buttons works, confirming with power button, but - that menu is in chinese :)

Today or tomorrow I will get some time again for playing with phone, I will try to build and try recovery images also for XLs and TEE region, and also I will play with that encryption.
[Miscellaneous Android Development] a-dead-trousers:
Because the only device I have to test things is also my daily driver I was very limited on what I'm able to tinker with. So I just bought me another one to be able to try all of my builds myself. Even the "odd" combination of Stock Rom + TWRP.

And yes, this really looks like a problem with the encryption. Most errors I encountered were related to either the wrong "baseline" (hash-values) inside "/mnt/vendor/persists", the services not running properly or the services not registering properly.

The first one I could only correct by wiping and setting up the Rom portion again. Hence my first suggestion and "easiest" to come by.

The second you should be able to test by using "adb shell" and trying to execute the three services "teed", "vendor.gatekeeper-1-0" and "vendor.keymaster-4-0-trustkernel" (see "/vendor/etc/init") manually. If one of them raises an error it needs to be fixed.

The third one you could detect the same way, execpt you need to check logcat for the "registering" of the services and maybe some errors.

As you mentioned that you wiped "/userdata" and "/persist" it should be either two or three.
[Miscellaneous Android Development] Bonfire:
What the... :LOL: I've tried to spflash completely stock ROM and start from the scratch, with my recovery.... did the same steps, and it is crashing again even with my recovery, which was booting about minutes ago. I am probably doing something wrong.

Also - I forget one thing - i was wiping cache and userdata, cannot find /persist? (not in my scatter file)
[Miscellaneous Android Development] a-dead-trousers:
That's what I'm currently trying to figure out myself. Therefore I ordered a second phone. My best guess is, after checking the logfiles and it working after completly deactivating decryption, that it has something to do with the keystore and the encrypted data.

On /persist some additional information (called baseline) is stored and if it gets "currupted" or wiped you are not able to decrypt data anymore. So my guess was that this will be reset on spflash because otherwise the encryption won't work. But then again on a flash with an empty /userdata no encryption is present therefore /persist can be overwritten without any problems so no need to include it in a ROM package. Just simply do a clear on a factory reset.
[Miscellaneous Android Development] Bonfire:
I've found something!

spflash stock ROM from 2020-11-03 = every recovery crashing, also my newly built

after OTA update to latest version (2021-04-19) = my recovery boots up (twrp splash, still the encrypt.problem), but your recovery images still crashing

wipe cache+userdata = still the same.
[Miscellaneous Android Development] a-dead-trousers:
The reason my TWRP is crashing is probably because I haven't included the latest vendor blobs yet (the update was just released 2 days ago on Google drive).

The reason your TWRP is not fully working is probably because there is something missing. They included a new service (see /vendor/etc/init/trustkernel.rc) which is missing in my device tree.

I've planned an updated release for TWRP as soon as the LOS security update is out to have a compatible ROM and don't have the time for a intermediate release.

Also I need to figure out the best sequence for doing this update without the risk of loosing (encrypted) data.
[Miscellaneous Android Development] Bonfire:
So, I've built it without encryption and it works :)

so now L EEA on my L EEA works, XL EEA build (w/o encrypt.) is rebooting before splash.

Next time I can test executing that services on previous build, but first I need to get some info about that.
[Miscellaneous Android Development] a-dead-trousers:
I just did a new release including the latest vendor update from 2021-05-18.

You need to upgrade your rom to a compatible release before you can use this TWRP release.

If you don't do that TWRP won't boot (green line on top of screen and then freezes).

If you use my Lineage OS rom you can use this guide for upgrading.

If you use the stock rom you can use this guide for upgrading. You only need to make sure to deselect `userdata`, `vbmeta`, vbmeta_system`, `vbmeta_vendor` and change `recovery` to the one from this thread.
[Miscellaneous Android Development] Bonfire:
Thanks, I've now my TWRP build which is working with your latest LineageOS build, haven't tested your new TWRP build yet, no time now.

Last week I was playing with builds and was testing that services, it's slow but im getting into that.

btw, your how-tos on github are great :)

but I've found that when preparing twrp build, the lunch command is missing build type suffix? i've used lunch omni_XXXXXX-eng now, without that it haven't prompted anything, just failed.
[Miscellaneous Android Development] a-dead-trousers:
You are totally right. I'll correct it in time.
[Miscellaneous Android Development] WeAreGod:
Okay so I initially installed EEA TWRP & LOS on my Atom XL. However it was supposed to be TEE...

So I followed the steps to install TWRP TEE version, even tried updating it using the TEE image.

Sucessfully flashed the TEE image onto the device but now when I try to boot into recovery, it gets stuck on this screen

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

But it stays stuck for many minutes completely unresponsive and then eventually just loads LOS..
[Miscellaneous Android Development] a-dead-trousers:
You need to use SPFlash to also change the bootloader portion.

Just follow my guide on github.

To be a little bit faster in the end replace ...

"recovery" with the TEE TWRP recovery,

"vbmeta_vendor" and "vbmeta_system" with the TEE vbmeta from github,

"super" with the latest for TEE from my install guide ("Partitions cannot be resized").

By doing that you can go directly to installing LOS next.
[Miscellaneous Android Development] WeAreGod:
Okay now I am confused.. in your guide "How to Install TWRP" it doesn't mention SPFlash and I don't remember using it to do the EEA install. Somewhat of a newbie here but I'm trying to learn. I'm just having trouble finding the guides you mentioned in this comment.
[Miscellaneous Android Development] a-dead-trousers:
Oh, sorry. Here they are.

android_device_Unihertz_Atom_LXL/docs at master · ADeadTrousers/android_device_Unihertz_Atom_LXL

Common device tree for the Unihertz Atom L and XL - ADeadTrousers/android_device_Unihertz_Atom_LXL

github.com
[Miscellaneous Android Development] WeAreGod:
When following tutorial to use SP Flash Stock, it only links to EEA Stock ROMs. I'm just following that guide because it's the only one that mentions SP Flash like you said to use but honestly I'm quite confused as to how flashing the stock rom will fix it from getting stuck when trying to boot into TWRP recovery.
[Miscellaneous Android Development] a-dead-trousers:
Like I said: It's the bootloader causing this. It needs to be the one compatible with the kernel (used by LOS and TWRP). So in order to change between the various devices and variants you need to change the entire ROM portion including bootloader and modem.

Ok, the google drive link is a little bit misleading. I'll have to correct it. Nevertheless on the top of the page you should find a navigation bar (Software_Firmware > Atom_XL > EuropeanUnion_EEA). Simply click on "Atom_XL" and then select "None_EEA".
[Miscellaneous Android Development] WeAreGod:
Okay I'm beginning to understand... So the None_EEA is actually the TEE that I'm trying to switch to? Btw, thank you for taking the time to explain this and especially composing & publishing all these amazing guides! Amazing & important work. Infinite gratitude
[Miscellaneous Android Development] WeAreGod:
MTK file ransomware??
[Miscellaneous Android Development] a-dead-trousers:
Not that I'm aware of. Maybe a false positive because it contains low-level driver components.

If you want be safe test it inside a VM first.
[Miscellaneous Android Development] WeAreGod:
I'm thinking of just keeping the phone EEA... I'm just making more mistakes as I try to switch... I would like to get TWRP recovery back on. Can I do this without using SP Flash because that's what I'm getting stuck on
[Miscellaneous Android Development] WeAreGod:
Actually nevermind. Got SP_Flash to work! Flashed the stock TEE... Now....
[Miscellaneous Android Development] WeAreGod:
Now trying to install TWRP. Device not appearing during fastboot. When I send flashing unlock, PC gets stuck waiting for any device...
[Miscellaneous Android Development] WeAreGod:
Nevermind. Unlock successful
[Miscellaneous Android Development] WeAreGod:
Lineage OS Installed! WOO ! Now to install Magisk and unlock Superuser... Thank you!