yashsingh1/xdaforums huggingface dataset:
[Redmi Note 9 Pro (International Model) General and] twistyplain:
There's a thread for that with detailed instructions
[Redmi Note 9 Pro (International Model) General and] Luciano333:
Hi.

I hope you can help me too. Didn't want to open a new thread so I'll try here first.

I want Xiaomi phone and messenger apps back. The phone (note 9 pro 6/128) was bought in EU and is used here and it came with miui global 11 and is now updraged to miui global 12 but it has google phone and messenger on it.

Please help.

Thank you.
[Redmi Note 9 Pro (International Model) General and] Luciano333:
Miui 11 global on my old phone Note 5 has xiaomi dialer, but when I bought Note 9 pro it had miui 11 global, but with google dialer. The more I read the less I understand. And nothing makes sense anymore.
[Redmi Note 9 Pro (International Model) General and] fobtob387:
MIUI Contacts and dialer 12.2.2.2 APK Download by Xiaomi Inc - APKMirror
[Redmi Note 9 Pro (International Model) General and] shtresatu:
I've installed this .apk but it keeps crashing! On miui 12.0.2. Any idea why? Also, when I'm in a conversation , on google dialer, I can't switch from phone to speaker or bluetooth, because after I switch I can't hear anything
[Miscellaneous Android Development] a-dead-trousers:
View attachment 5161975

* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.

This is a LineageOS 19.1 ROM for the Helios P60 based Atom L (Atom_L) and Atom XL (Atom_XL), two rugged Android phones released by Unihertz in July 2020.

This ROM supports both devices as well as both regional variants!

You need to make sure which device and variant you need!

LineageOS is a free, community built, aftermarket firmware distribution of Android 10.0 (Q), which is designed to increase performance and reliability over stock Android for your device.

LineageOS is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. LineageOS does still include various hardware-specific code, which is also slowly being open-sourced anyway.

All the source code for LineageOS is available in the LineageOS Github repo. And if you would like to contribute to LineageOS, please visit our Gerrit Code Review. You can also view the changelog for a full list of changes & features.

Working (but not as one would expect)

VoLTE has some issus with SELinux in enforcing mode

DMR needs "USB audio routing" deactivated in the developer settings

Bluetooth audio channel is set to use the fallback instead of A2DP

Not Working

LiveDisplay is not working (and probably never will)

Fingerprint scanner (still investigating the reason)

You tell me

Releases

Atom L EEA (european union)

Atom XL EEA (european union)

Atom L TEE (non-european union)

Atom XL TEE (non-european union)

How to install

How to update

How to upgrade

Links

TWRP

Common device tree

Device tree Atom L (model)

Device tree Atom XL (model)

Device tree Atom L EEA (european union)

Device tree Atom XL EEA (european union)

Device tree Atom L TEE (non-european union)

Device tree Atom XL TEE (non-european union)

Bug reporting

Spoiler content hidden.

Help from other developers is certainly welcome. Currently only myself is working on this ROM.

Credit and Thanks

LineageOS team

@PeterCxy for starting the work on the Atom L

Enjoy! (y)

XDA:DevDB Information

LineageOS 19.1 for Unihertz Atom L and XL, ROM for the Android General

Contributors

a-dead-trousers

Source Code: https://github.com/ADeadTrousers/android_device_Unihertz_Atom_LXL

ROM OS Version: Android 12

ROM Kernel: Linux 4.x

Based On: LineageOS

Version Information

Status: Alpha

Created 2020-10-02

Last Updated 2024-07-18
[Miscellaneous Android Development] SepticFuddy:
Thanks for taking this up. I look forward to future developments. I'm not yet ready to try it in its current state since my XL is my daily driver and music player, but if the radio information is something I can grab for you without too much trouble, I'm willing to try. I'll need clear instructions though, as I'm not deeply familiar with Android development. I managed to root the old Atom and install Magisk, etc. after a day's effort, at least, so I'm not entirely incompetent :silly:
[Miscellaneous Android Development] a-dead-trousers:
That's great news that I'm not alone on this :p

I understand that you don't want to give it a try yet.

There are quite some issues still present: https://github.com/ADeadTrousers/android_device_Unihertz_Atom_XL/issues

But maybe you could help me figure out at least one of them:

The phone is also my daily driver so I don't have the patients to go back and forth between Stock and Lineage multiple times, just to find out that I'm still missing some bits and pieces.

So I need someone with Stock to look up some information, so I can integrate it into Lineage.

Just for clarification because I never really used it and switched to Lineage right away: "Intercom" is in fact the app used for the amateur radio, or is it not?

If it is indeed then I need to know what service is running on port 9980 in Stock.

See also https://github.com/ADeadTrousers/android_device_Unihertz_Atom_XL/issues/1

wkr ADT
[Miscellaneous Android Development] SepticFuddy:
"Intercom" is indeed the radio app. There's another stock app called "Toolbox" which is also handy, since it has levels, protractors, heart rate monitor, underwater camera, and a bunch of other things. May be worthwhile to try to port that over as well.

Check GitHub, I tried getting that info on 9980 but ran into a hitch.
[Miscellaneous Android Development] a-dead-trousers:
Thanks. I already did and also replied there.

During my research of the downloadable stock rom I found various mentions of the built-in sensors. The problem is that these informations are spread out quite heavily all over the rom: one init here, one sepolicy there, some so-drivers in another place. I will look into this a little bit late but it could take me some time to figure everything out. Currently I want to fix the problems that trouble me the most: gapps integration, intercom, the audio jack not working and doing a signed user build.

The last one actually broke my current build (boot loop) and I had to revert to a previous state so I need to figure out what I did wrong.
[Miscellaneous Android Development] tapa_t:
Hello, a-dead-trousers,

I am not really into LineageOS but I came across this thread while searching for a stock ROM.

Did you extract the stock ROM from your own device? If so, how?

I tried to readback using SP Flash Tool v5.2036, but only get an error saying "memory is HW_STORAGE_UFS, not HW_STORAGE_EMMC". I made an empty scatter using Wwr MTK tool v2.51, but only choices are either EMMC or NAND and there is no UFS option.

Or, did you download the stock ROM from somewhere? If so, where?

I found couple links online and downloaded one so far, but the downloaded scatter indicates that the memory is of the type HW_STORAGE_EMMC, which SP Flash Tool told me my device is not. So, I am not certain of the authenticity of the downloaded file.

My AXL is still on the stock ROM, obviously, and I can help you with what you questions.

Can you help me with backing up my stock ROM or show me a link to a known authentic stock?
[Miscellaneous Android Development] tapa_t:
Another question to anyone who might know:

Does Atom XL lose any functionality by unlocking bootloader?

Like those licensed image-enhancing engines on Sony Xperia devices?

I have been trying to root the device by flashing a magisk_patched boot image using SP Flash Tool.

It flashes OK but goes into boot loop every time.

None of the MTK devices I played with in the past required unlocking bootloader for flashing anything (magisk boot, twrp) as long as using SP tool and I was hoping that's the case again.

I don't mind unlocking at all if I am not losing anything, but I thought I check with other users first.

Thanks in advance for any info!
[Miscellaneous Android Development] a-dead-trousers:
This is the official download link for Unihertz stock roms:

https://drive.google.com/drive/folders/0By1nhWOmuw2KdDhTUlFOZHpXQjg?sort=13&direction=a
[Miscellaneous Android Development] a-dead-trousers:
I'm not sure, but I think you will definitely loose SafetyNet credibility amongst other security related checks (banking apps and so on).

The SPFlash flashing should work though. Unless the "new" super partition layout is not supported by magisk or there is a problem with the checksums and avb. Best to ask the developers of magisk. They should know the pitfalls.
[Miscellaneous Android Development] a-dead-trousers:
It seems that they are currently working on the avb (dm-verity) problem:

https://github.com/topjohnwu/Magisk/commit/d0b6318b90dc8f1c315b1a2a0eda03d1f9e38027
[Miscellaneous Android Development] tapa_t:
Thank you for the info.

I unlocked the bootloader, but flashing the magisk boot either by SP tool or by fastboot still gives a boot loop, which can easily be fixed by flashing back the stock boot.

Both unlocking and relocking bootloader "factory data resets" the device (that's what the device says in the process).

I don't find any loss in functionality by unlocking, but the process is probably still unnecessary if using SP tool.

I head over to the magisk support thread to see if there's anything to solve it.

Thanks again!
[Miscellaneous Android Development] a-dead-trousers:
The "toolbox" I found in the rom is an internal service and part of LineageOS itself. So I tried to find an "apk" with that name but had no luck either. There are several possible candidates but to figure out the right one I need the package name (e.g. com.agold. ...).
[Miscellaneous Android Development] SepticFuddy:
Opening up the app starts com.agui.toolbox. Since it feels like a shorcut launcher, I tried starting some of the functions inside it to see if I could catch any other app names in the log, but nothing came up. So I think it's all contained within Toolbox, despite that one or two of the functions is broken for me.

EDIT: In the same vein, there are a few other baked-in apps, should you choose to port them over. Some may be standard in Android 10 and/or covered by LineageOS, I wouldn't know-

com.tiqiaa.remote - ZazaRemote, for the IR emitter

com.agui.newsos - SOS app

com.agui.studentmodel - "Student Mode"

com.agui.nfc - NFC Emulator

com.mediatek.notebook - Notebook app... for notes

com.mediatek.cellbroadcastreceiver - Emergency Alert app

com.android.soundrecorder - Sound Recorder

com.android.fmradio - FM Radio

com.google.android.apps.wellbeing - Digital Wellbeing
[Miscellaneous Android Development] a-dead-trousers:
I can't find com.agui.toolbox. I decompiled every apk on "system" and "vendor" but none of them has this package name. I'm at my wits end.

com.tiqiaa.remote is on "vendor" but doesn't get automatically installed. Without "su" I get a permission denied, so that's maybe the reason why. Need to figure out a way to get past this. I always wanted a universial remote.

com.agui.newsos could be handy, will look into it.

com.agui.studentmodel what's that for?

com.agui.nfc could be handy, will look into it.

com.mediatek.notebook This looks like a copy of google notes to get the AOSP "sign of approval". I prefer to use the original not a cloned version with potential security issues. Sorry no inclusion.

com.mediatek.cellbroadcastreceiver honestly, the cell broadcasts I received with my old phone where quite useless, but maybe that's dependent of your carrier. So that's a big maybe.

com.android.soundrecorder this is the AOSP version, lineage brings it's own built-in. So no need for a inclusion from stock.

com.android.fmradio should be the AOSP version, found no source but a fairly recent apk on apkmirrors. A Maybe for inclusion.

com.google.android.apps.wellbeing that's part of gapps. So no need for a inclusion from stock.

Generally:

com.agui. looks like to be an local chinese manufacturer of addon chips (thermal, barometric, nfc and stuff)

com.mediateki. is of course the manufacturer of the board. They are using AOSP mostly but some things they need to "clone" when legally necessary (like the trump-us-ban on technology)

com.android. is AOSP, so mostly open source.

com.google.android. is Google itself, so mostly closed source or "rebranded" open source. (like "Firefox" is a trademark and can't be changed, but the sourcecode is available for everyone to use and alter you re not allowed to name it "Firefox" though)
[Miscellaneous Android Development] a-dead-trousers:
Found it! Some of the apps were on "product".
[Miscellaneous Android Development] SepticFuddy:
That's about what I figured. Nice job on finding it.

I personally couldn't care less about WEAS alerts, but they are legally mandated in the US... not that I care about that either. People who want storm warnings, kidnapping alerts, and/or Presidential alerts :rolleyes: would.

Student Mode appears to be a restricted mode for the device. So it's PIN locked, has an application whitelist/scheduler, network disabler and site restrictions. Useful for parental controls I suppose, but probably not high on the priority list for a LOS device.
[Miscellaneous Android Development] magnetosphere:
Hey OP, I have the XL with the stock ROM. Don't need a lot of handholding with app or firmware extraction, but I'm very interested in fixing the few broken items on LOS. The stock ROM is on the March 2020 security update (way too old) and has a bunch of bloatware and unremovable old apps, not to mention possible spyware. The manufacturer's lack of support or security updates is inexcusable, obviously, but this phone is frankly a miracle and I can't find anything that comes close to competing, so I'm down to help bring it up on LOS.

The radio is the primary peripheral I care about preserving. IR blaster and VoLTE are also important. As I understand it, the radio is essentially a 400-480MHz SDR wired directly to the main USB2 (or USB3?) bus. What do you need to proceed?
[Miscellaneous Android Development] a-dead-trousers:
hi [MENTION=11248957]magnetosphere[/MENTION].

Currently I'm struggeling with configuring LineageOS to best cooperate with the stock vendor partition. In my opinion Unihertz (or Mediatek) did a very poor job in seperating system and vendor which is essential for project treble (main focus of Android 10 and 11) to work. Many parts that are clearly vendor specific (extmodule for intercom, various logging tools) should have been put into the vendor partition from the start. Therefore there are quite a few problems with SELinux which forces you to separate. Of course if you know the bits and pieces you could manipulate it but it's not my intention to heavily change LineageOS's internals.

I'm more or less a bloody beginner in Android development (it feels more like configuring than programming to me) and my only source of information right now are other device trees and how they solved the various problems. So I need to do many things on a trial and error basis.

So, yeah I appreciate every help I can get, but I cannot give many advices on how to do things. Essentially in the current state I would need someone who knows his or her way around in a device tree and can give me good advices on how best to do things.

One little bit on the the security situation:

The vendor patch lavel cannot be raised for now because it is essentialy the version of the kernel, which is currently at 4.14.141. To change this we would need the source code of the kernel and the modifications done by Mediatek which are essentially closed source (you need to pay to get them).
[Miscellaneous Android Development] a-dead-trousers:
A little update on my progress:

I tried to reverse engineer the whole stock system.img into the lineage system.img to rule out any missing system libraries, binaries or sepolicies but that resulted in various bootloops and bootcrashes.

Now I'm waiting for the latest stock rom to be released on Google Drive because in the release notes unihertz mentioned that they cleand out not used libraries. Maybe that will reduce my modification footprint and helps me figuring out what is REALLY missing and what is just bloatware that's not needed.

If that's not working I'm fearing that I also need to rebuild the vendor.img but that's a last resort.

The problem here is (I think) that the vendor.img needs some tinkering and additions to work with lineage which also has some parts (libraries, apps, binaries) that normally would go in there.
[Miscellaneous Android Development] sparkst:
Do you have any advice on how to flash after a botched boot partition flash? When I try to boot into bootloader/fastboot/recovery by holding power and volume up, it just reboots endlessly.
[Miscellaneous Android Development] magnetosphere:
Finally this thread is back on the forums. I will have to look around the SELinux parameters for the default OS.
[Miscellaneous Android Development] a-dead-trousers:
Yes.

Hmm... Does it "flicker" before rebooting?

My best guess is that TWRP simply crashes and forces a reboot. From the top of my head the reason for that kind of behaviour can only be the encryption or trustkernel. I started my work with a non-functional encryption. After that I already had a working system so I probably never really tested the stock rom scenario with encryption activated.

To finally get encryption to work on recovery and not messing up the system I needed to do a copy of the encryption keys to a temp location. Trustkernel under TWRP uses this temp location for booting up. Maybe this isn't the right thing to do while there are no keys present to copy OR the data partition is already encrypted, trustkernel detects that the keys are invalid and therefore refuses to work as a security measure.

If it is the later you can try to flash "userdata" either the same way as you did with recovery or using SPFlash (only select the "userdata" partition). As Image you could use the one provided in the stock rom.

If it is the former you should be able to boot with a TWRP release where the encryption isn't setup the way it is now (for the L TEE that means v20210415). After you have installed LOS the encryption should be properly setup and you should be able to flash the latest TWRP release from within TWRP.

Please try the "userdata" flash first and if that's not working try the older release. If it's just an encryption problem I can solve this quite easily by extending the installation section. If it's the other thing I need to do a deeper investigation to find the cause (meaning I once more need to start testing installation procedure from a genuine stock rom :()
[Miscellaneous Android Development] Arnd_Bueter:
thanks

i flashed super and than it worked

now first steps with LOS
[Miscellaneous Android Development] it_unihertz_when_i_pee:
No, no flicker. Just a long wait on the boot screen until reboot.

I got into fastboot with the device as-is (was) and flashed userdata and recovery back to back. No change in behavior trying to boot to recovery.

I flashed this recovery as well, with the device as-is (was) with no change in behavior.

--

With your info in hand, I wanted to try each suggestion with a fresh setup, rather than as-was, starting from the stock ROM (2021-05) in the green state.

Attempt #1: Booted up, enable debugging and OEM unlocking, adb to get to bootloader, flashing unlock, reboot, enable debugging again, adb to get back to bootloader, vbmeta flashing (all okay), flash v20210415 TWRP, fastboot reboot, then green line of death when trying to boot to recovery. Holding the power button for N seconds reboots properly into the system.

Re-flashed to stock green state again.

Attempt #2: Booted up, enable debugging and OEM unlocking, adb to get to bootloader, flashing unlock, reboot, enable debugging again, adb to get back to bootloader, vbmeta flashing (all okay), flash userdata from stock rom (same version I used for stock reset), flash v20210810 TWRP, fastboot reboot, and then we're back to bootlooping until I release the volume up key.

So, I'm still where I was. Is my unit a unicorn? Defective?
[Miscellaneous Android Development] a-dead-trousers:
You can do all this all in one step without having to reboot. Sorry, if my instructions weren't clear on that.

Maybe this is also causing your problem:

The reboot into stock rom initializes the encryption once more. While the stock rom for the TEE is simply named "Atom L" I had to add the suffix "TEE". The reason for that is my "Atom L" repo contains the shared parts for "EEA" and "TEE" so maintaining the various flavours is a little bit easier to handle. When I started with that I wasn't running into any troubles so I kept that. Only later when trying to setup encryption I stumbled on some problem related to the "version"-String. As soon as I used a higher version on the recovery (2099-12-31 for example) it locked me out of system for good because it silently "upgraded" the encryption keys. Maybe this also includes the device name (I wouldn't be suprised).

If that's the solution I will update my installation instructions acordingly.
[Miscellaneous Android Development] it_unihertz_when_i_pee:
Starting fresh from 202105 ROM, and doing all of the fastboot flashing in one go, I got the same result as before. Won't get past boot splash until I let go of the volume button.
[Miscellaneous Android Development] a-dead-trousers:
Honestly, I'm out of ideas.

Maybe, just a last resort, you could try to use the EEA region instead of TEE (stock rom + twrp + los).

Has anyone else had these kind of problems with my TEE release? Or asking the opposite, has anyone successfully installed one of the TEE releases?
[Miscellaneous Android Development] it_unihertz_when_i_pee:
Well, the EEA stock + TWRP got me to be able to get into TWRP, so that's a step! Maybe Scamazon sent me a Euro model?!

However when I try to perform the wipe, I get "Could not mount /data and unable to find crypto footer" followed by a series of "unable to mount..." for various subdirs under /data. Then, some "unable to mount..." messages for other directories that say permission denied.

I get the same result whether I choose to "keep the system read only" or "allow modifications" when first getting into TWRP.
[Miscellaneous Android Development] a-dead-trousers:
Nope, the phones are identical. The difference is the software. I was able to switch between Atom L/XL and TEE/EEA with my original Atom XL EEA witout problems. As far as I know there is an additional warning about too loud volumes while using headphones amongst other things that differ in the EEA release.

That's because after the fastboot reset there is no /data. You need to install LOS next to setup everything else.

EDIT:

So EEA works fine while TEE has "issues". I'll need to test this in detail. Maybe I can find something. At least you can use your phone now.
[Miscellaneous Android Development] it_unihertz_when_i_pee:
Progress.

Got into TWRP, tried flashing Lineage EEA zip, got the "update_dynamic_partitions" error, flashed the resized super image, and then tried the lineage zip a second time, with the following error.

Patching system image unconditionally...
E1001: Failed to update system image.
Updater process ended with ERROR: 7
Error installing zip file lineage...EAA-signed.zip

Though this isn't the same error as before (no partitions errors reported), I tried flashing the super a second time, but no change.

I feel like I'm *so* close here.