yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] nameless354:
Atom L EEA stock a11
[Miscellaneous Android Development] a-dead-trousers:
Thanks!

Your symbol-file made me realize that there are in fact TWO functions of the name 'tpd_i2c_probe' which suggests that there are also two different touchpad drivers included in the kernel.

Therefore I did an update on the kernel modifications for BOTH drivers on all recovery variants.

Could those of you who had problems with the touchpad in the recovery please test if it is now fixed. My phone did work which is only a limited indicator for that matter.
[Miscellaneous Android Development] ljonkat:
You rock! Confirmed that the new TWRP release v20221005-alpha fixes the touchpad issue. Great work, thank you! And also thanks to @nameless354 for providing the info.

Ljonkat
[Miscellaneous Android Development] nameless354:
@ljonkat, What do you think of the rom, better than the stock?
[Miscellaneous Android Development] ljonkat:
Hey @nameless354, so far I am really happy with the rom, everything works (except I don't know how to assign a function to the red button on the left side). However, I was specifically looking for a smaller smartphone that can run a recent version of LOS, which means I did not spend much time with the stock rom. And since I am coming from a Nokia feature phone, I have not much to compare it to.

For background:

I wanted to keep Google and Apple at an arm's length and get as close as possible to a true GNU/Linux phone. Looked into Pinephone (great project, will certainly keep an eye on it; but it's not daily driver material yet), checked out Purism's Librem (very nice, but just too expensive for me), and almost pulled the trigger on a used Sony XA2 to install Jolla's Sailfish OS (but uncertain support of VoLTE under Sailfish for the XA2 means you can't use it with US carriers), and then finally landed on the Atom L with LOS + F-Droid.

Ljonkat
[Miscellaneous Android Development] a-dead-trousers:
Try my app "HardwareKeyMapper" which I included in my A11 roms.

It's the "Unknown Key" (Key Code 249 in the settings)

The app lets you assign different actions to the various keys of the phone.
[Miscellaneous Android Development] ljonkat:
I guess I should've looked around some more before... Thank you for pointing it out, @a-dead-trousers, works perfectly!

Ljonkat
[Miscellaneous Android Development] a-dead-trousers:
I just uploaded a new release which includes a workaround for the bluetooth issue alongside the latest security updates.

This is just for being able to use bluetooth for the time being. I'm still trying to get it actually fixed.
[Miscellaneous Android Development] clewis.it:
Hello. I just got my Atom XL, and I've got to say, I'm a bit disappointed. I'm happy to have the DMR tier 2 support, but the power output is low (measuring analog on 446mhz). I'm getting 1.2w at high power. The audio from the walkie talkie is also muffled and distorted, even on my Bluetooth headset. Is this typical for the Atom XL? It's currently all stock.
[Miscellaneous Android Development] wombatch:
Hello, I have recently installed the latest version of this ROM and so far all seems very good I am however a little limited on testing since I am trying to get microg into the ROM, to do this I would like to get one of the patching options to work. So simple question, has anyone successfully got microg installed on this ROM, so far all the patching options I have tried have failed usually because of the mount structure (as far as I can tell) with the exception of patching with magisk which just resulted in a boot loop ending in recovery.
[Miscellaneous Android Development] a-dead-trousers:
What patching options are we talking about here?
[Miscellaneous Android Development] wombatch:
Well i tried Tingle, that seems to fail with because the file mount of /system does not work, it seems that maybe /system here is mounted as /system_root (sorry i often get a bit lost in Android mounts)!

I tried Nanodroid, as an installation under Magisk it gave me the boot loop (the lineage boot line ran for a long time and eventually drops into TWRP)

I tried NanoDroid from TWRP that again fails because it can't find the files to patch.

Sorry not to include lots of logs and messages here I thought I would start with a quick question to see if it had been done. There is an entry in the microg wiki saying it can't be done above android 10 , yet the patching systems above imply they will work.

I could of course take the device tree and TRY (i've never done it before) to build my own patched rom based on your work, however early days so maybe there are working options out there that I just haven't found yet!
[Miscellaneous Android Development] a-dead-trousers:
Yeah, that's TWRPs mount point.

So according to this

https://github.com/microg/GmsCore/wiki/Prerequisites

One would only need signature spoofing to be able to use microG, am I right?
[Miscellaneous Android Development] wombatch:
Yes. There are a few things to install, some as system apps but the challenge is the signature spoofing
[Miscellaneous Android Development] wombatch:
Hello, sorry I am probably doing something very stupid but i am trying to follow your build process, I get as far as building unpack_bootimg and the build fails saying it is unable to find a dex jar path for several mediatek modules.

I copy the errors below, do you have any idea what I might have done wrong?

out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp

internal error: failed to find a dex jar path for module 'mediatek-common', note that some jars may be filtered out by module constraints

internal error: failed to find a dex jar path for module 'mediatek-framework', note that some jars may be filtered out by module constraints

internal error: failed to find a dex jar path for module 'mediatek-ims-base', note that some jars may be filtered out by module constraints

internal error: failed to find a dex jar path for module 'mediatek-ims-common', note that some jars may be filtered out by module constraints

internal error: failed to find a dex jar path for module 'mediatek-telecom-common', note that some jars may be filtered out by module constraints

internal error: failed to find a dex jar path for module 'mediatek-telephony-base', note that some jars may be filtered out by module constraints

internal error: failed to find a dex jar path for module 'mediatek-telephony-common', note that some jars may be filtered out by module constraints

23:49:33 soong bootstrap failed with: exit status 1
[Miscellaneous Android Development] a-dead-trousers:
F**K!

I think I've made a "recursive" error in my build guide:

In order to unpack you need to setup the build environment but to do that you need the files you want to extract in the first place.

hmm...

BUT, You are in luck:

You don't need "boot.img", "recovery.img" or "unpack_bootimg" for the build process. This is only needed If you want to start with your own device tree for extracting the kernel and the commandline.

Maybe I should make this more clear in my guide.

All you need is the second half: "imjtool", "super.img", "system.img", "vendor.img" and "product.img".

Also as "imjtool" is able to extract "boot.img" and "recovery.img" too I should consider to drop the "unpack_bootimg" altogether.
[Miscellaneous Android Development] ]ZZZ[:
Hello. First of all I would like to thank a-dead-trousers for his work and motivation!

I suppose that have the same issues as wombatch - signatures spoofing at this LOS 18.1 unofficial ROM. As far as I understand, according this https://github.com/microg/GmsCore/wiki/Signature-Spoofing, there is no such builtin feature at LOS. But for official ROMs, microG maintainers provides it. After clean install your LOS 18.1 and microG from f-droid repo, I see error at logcat, when I try to run some payment app:

W GooglePlayServicesUtil: xxx.app-name requires Google Play services, but their signature is invalid.

I've tried to solve it via LSposed modules (fakeGapps, Core patch and app specific patches), but no luck, app just crashing. Also, I've tried to built spoof services according this https://xdaforums.com/t/signature-spoofing-on-unsuported-android-11-r-roms.4214143. Spoof checker says - OK, but my app crashes again(.
[Miscellaneous Android Development] wombatch:
Thanks for this, a bit of a delay I've been a bit occupied elsewhere, anyhow this has moved me on a bit (to my next stumbling block).

I'm probably going to have a couple of things here, firstly I was trying to to get the vendor blobs from a mount of a stock img file, there are many failures but the first is

Extracting 368 files in ./android/lineage/device/Unihertz/Atom_L_EEA/../../../device/Unihertz/Atom_L/../../../device/Unihertz/Atom_LXL/proprietary-files.txt from ./unihertz/extracted:

- bin/AudioSetParam

- bin/batterywarning

- bin/boot_logo_updater

- bin/camerapostalgo

- bin/connsyslogger

- bin/dpci

!! bin/dpci: file not found in source

there are in total around 80 items listed as missing.

In an attempts to get around this i this I used the script

android/lineage/device/Unihertz/Atom_L_EEA/extract-files.sh

to get the files from my rooted lineage phone. With this there were only 22 files flagged as missing so I copied them from the mounted images above.

At thus point I was hoping i was in a state to be able to run a build :-o

Sadly not yet :-(

It is not very far into the build when I get

vendor/mediatek/libfmcust/custom.cpp:43:10: fatal error: '../../../packages/apps/FMRadio/jni/fmr/fmr.h' file not found

I can't find it either but then doing a find on my local filesystem wasn't likely to help, i tried a repo resync but the failure is still the same. I am sure I must have made lots of mistakes but I really don't know where to start looking and how.

I imagine this header file should have come from the sync of the repository, is is possible that I've made a big mess of that? How would I force it to start again or check to see what errors the sync had?
[Miscellaneous Android Development] a-dead-trousers:
That could be a problem with file permissions. Simply check the missing files and either grant access to them or the containing folder to yourself (chown ... ).

Same here. Although the permissions are granted from the mtp moint point of view. You'd need to uese "su" in that case but I don't know where in the script you'd need to change that. I did only use the stock rom for the extraction and never the phone.

You'd NEED to run the script to get the files properly installed in the resulting rom. The script will not only copy the files but also write the build rules needed.

It's part of the package "LineageOS/android_packages_apps_FMRadio". Which I totally forget to remove the "remove" from the build docs. My bad.

Just remove this line from your roomservice.xml:

<remove-project name="LineageOS/android_packages_apps_FMRadio"/>
[Miscellaneous Android Development] wombatch:
Thanks very much, I scrubbed what I had and restarted. This time all the modules were found in the extraction (I think probably i was using the wrong stock rom file (I had a few as a result of the tinkering))

Anyway that all seems to go ok I changed the roomservice.xml resynced the repository and then tried the build again..

This time it fails here..

[ 0% 272/105357] build out/target/product/Atom_L_EEA/gen/ETC/apns-conf.xml_intermediates/apns-conf.xml

FAILED: out/target/product/Atom_L_EEA/gen/ETC/apns-conf.xml_intermediates/apns-conf.xml

/bin/bash -c "(rm -f out/target/product/Atom_L_EEA/gen/ETC/apns-conf.xml_intermediates/apns-conf.xml ) && (python vendor/lineage/tools/custom_apns.py out/target/product/Atom_L_EEA/gen/ETC/apns-conf.xml_intermediates/apns-conf.xml device/sample/etc/apns-f

ll-conf.xml device/Unihertz/Atom_LXL/etc/apns-conf-keep.xml device/Unihertz/Atom_LXL/etc/apns-conf.xml device/Unihertz/Atom_LXL/etc/apns-conf-additional.xml )"

Traceback (most recent call last):

File "vendor/lineage/tools/custom_apns.py", line 62, in <module>

main(sys.argv)

File "vendor/lineage/tools/custom_apns.py", line 30, in main

raise ValueError("Wrong number of arguments %s" % len(argv))

ValueError: Wrong number of arguments 6

23:40:29 ninja failed with: exit status 1

Clearly this is tring to build Lineage APN values into the system but I have no idea why it should be going wrong unless somehow I am building for the wrong sort of Atom? Sorry to be such a pain.
[Miscellaneous Android Development] wombatch:
I have to admit I am totally lost in the build process :-( I commented out the following lines in device/Unihertz/Atom_LXL/BoardConfigCommon.mk

# We need this for apns-conf to include more settings

#CUSTOM_APNS_FILE := device/sample/etc/apns-full-conf.xml \

# $(DEVICE_COMMON_PATH)/etc/apns-conf-keep.xml \

# $(DEVICE_COMMON_PATH)/etc/apns-conf.xml \

# $(DEVICE_COMMON_PATH)/etc/apns-conf-additional.xml

In order to get this build to run further and then maybe fix the apn issue later somehow.

I was feeling quite optimistic until I had a failure with this Address SANitizer section

/bin/bash -c "(ASAN_OPTIONS=detect_leaks=0 out/host/linux-x86/bin/checkpolicy -M -c 30 -o out/target/product/Atom_L_EEA/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp out/target/product/Atom_L_EEA/obj/ETC/sepolicy.recovery_intermediates

/sepolicy.recovery.conf ) && (out/host/linux-x86/bin/sepolicy-analyze out/target/product/Atom_L_EEA/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp permissive > out/target/product/Atom_L_EEA/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains ) && (if [ \"userdebug\" = \"user\" -a -s out/target/product/Atom_L_EEA/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains ]; then echo \"==========\" 1>&2; echo \"ERROR: permissive domains not allowed i

n user builds\" 1>&2; echo \"List of invalid domains:\" 1>&2; cat out/target/product/Atom_L_EEA/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains 1>&2; exit 1; fi ) && (mv out/target

/product/Atom_L_EEA/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp out/target/product/Atom_L_EEA/obj/ETC/sepolicy.recovery_intermediates/sepolicy )"

libsepol.report_failure: neverallow on line 82 of device/Unihertz/Atom_LXL/sepolicy/private/zz_neverallow.te (or line 64741 of policy.conf) violated by allow llkd em_app:process { ptrace };

libsepol.report_failure: neverallow on line 74 of device/Unihertz/Atom_LXL/sepolicy/private/zz_neverallow.te (or line 64733 of policy.conf) violated by allow llkd capability_app:process { ptrace };

libsepol.report_failure: neverallow on line 68 of device/Unihertz/Atom_LXL/sepolicy/private/zz_neverallow.te (or line 64727 of policy.conf) violated by allow llkd apmsrv_app:process { ptrace };

Can anyone give me any pointers as to where and what I can look at?
[Miscellaneous Android Development] wombatch:
I am sure I must have done something silly here, all my issues seem to come from the Atom_LXL files?

I am clearly missing (screwed up) something basic because there is no way that vendor/lineage/tools/custom_apns.py can run with more than 3 arguments and yet here in the BoardConfigCommon we see 4 arguments?

Similarly these selinux issues seem? (although i didn't try yet) to come from device/Unihertz/Atom_LXL/sepolicy/private/zz_neverallow.te

My roomservice.xml looks like this

<?xml version="1.0" encoding="UTF-8"?>

<manifest>

<project name="ADeadTrousers/android_device_Unihertz_Atom_LXL" path="device/Unihertz/Atom_LXL" remote="github" revision="master" />

<project name="ADeadTrousers/android_vendor_mediatek_libfmcust" path="vendor/mediatek/libfmcust" remote="github" revision="master" />

<!-- For the Atom L model add -->

<project name="ADeadTrousers/android_device_Unihertz_Atom_L" path="device/Unihertz/Atom_L" remote="github" revision="master" />

<!-- For the Atom L region eea add -->

<project name="ADeadTrousers/android_device_Unihertz_Atom_L_EEA" path="device/Unihertz/Atom_L_EEA" remote="github" revision="master" />

</manifest>

Is that correct or have i misunderstood what should be there?
[Miscellaneous Android Development] a-dead-trousers:
I've already updated my build docs because of your feedback. Thank you.

You forgot to apply the patches which include my extension for custom_apns.py

Maybe there were some changes on the last LOS update. Haven't tried to built it yet. If you are sure this is the only problem you can leave out the zz_neverallow.te altogether by simply deleting it. It's just some policies I've ported over from the stock rom. As they are only targeting things to "never allow" it's quite save to not have it all along.
[Miscellaneous Android Development] wombatch:
Haha, I am not SURE of anything, this is the first time I have ever tried to build a ROM and the first time I have ever tried to build anything as large as this.

Maybe I am blind (I am quite old ;-) ) but I cant see where the patches including custom_apns.py are mentioned/referenced in the build instructions, could you give me a clue (I assumed any changes would come with the repo sync)?

Just for your reference (no idea if it is useful to you), I removed zz_neverallow.te and still have the APNS commented out, but with that the build fails at

68% 69192/101441] target C++: libfmjni <= packages/apps/FMRadio/jni/fmr/fmr_core.cpp

perhaps this is linked to the removal of the line

<remove-project name="LineageOS/android_packages_apps_FMRadio"/>

from roomservice.xml ?

Thanks so much for your help and feedback :)
[Miscellaneous Android Development] a-dead-trousers:
You're totally right! I also forgot that in my build doc too. So I just updated it. (see the mentioning of apply.sh)

I think this is also related to the missing patches as I had to remove some (unnecessary?) errors from the build script of FMradio. If this still persists after applying the patches please share the full error log.

No, thank you, as you're pretty much the first one to "testdrive" my build doc and pointing out the errors.
[Miscellaneous Android Development] wombatch:
I retried with your patch apply script. i still had to remove the device/Unihertz/Atom_LXL/sepolicy/private/zz_neverallow.te file but the build is going much better now.

Sadly it still stops but this time around 87% through with what appears to be a java run time error. I'll have to dig a bit and see what i find.

Small comment about your apply script, I am building without GAPPS and the script exits rather untidily with

applying vendor_opengapps_build to vendor/opengapps/build

./device/Unihertz/Atom_LXL/patch/apply.sh: line 24: cd: /mnt/store/android/lineage/vendor/opengapps/build: No such file or directory

Not a big deal but maybe there could be a check in there to see if GAPPS has been taken from the repository before trying to patch it , I was going to change it ( but as you can see I have bigger problems) :-)
[Miscellaneous Android Development] a-dead-trousers:
Maybe you've not the correct java version set up.

See here for the requirements https://source.android.com/docs/setup/start/requirements

Yeah. I also get this error on my "regular" builds. But because it is the last patch to be applied ("vendor" luckily comming very late in the alphabet) it's no big problem. Only If there ever be a "W...", "X...", "Y..." or "Z..." patch it would not work anymore.

Maybe the "exit 1" on the "cd" could be replaced with a test and warning messege. I simply copied from another repo without much thinking.
[Miscellaneous Android Development] wombatch:
Thanks I cant see anything wrong with the java setup, maybe the disk space was a bit light but i now have 168G free before i run the brunch command (hopefully that's ok).

As far as I can see it is always using the java from the repository

Environment Variables:

JAVA_HOME=/mnt/store/android/lineage/prebuilts/jdk/jdk11/linux-x86

PATH=/mnt/store/android/lineage/prebuilts/build-tools/path/linux-x86:/mnt/store/android/lineage/out/.path

SHELL=/bin/bash

# A fatal error has been detected by the Java Runtime Environment:

#

# SIGSEGV (0xb) at pc=0x00007f1f3eb3a6bd, pid=2198, tid=2210

#

# JRE version: OpenJDK Runtime Environment (11.0.4) (build 11.0.4+0-5935077)

# Java VM: OpenJDK 64-Bit Server VM (11.0.4+0-5935077, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)

# Problematic frame:

# V [libjvm.so+0x5066bd] RegionNode::is_unreachable_region(PhaseGVN*) const+0x23d

--------------- S Y S T E M ---------------

OS:DISTRIB_ID=Ubuntu

DISTRIB_RELEASE=20.04

DISTRIB_CODENAME=focal

DISTRIB_DESCRIPTION="Ubuntu 20.04.5 LTS"

uname:Linux 5.15.0-56-generic #62~20.04.1-Ubuntu SMP Tue Nov 22 21:24:20 UTC 2022 x86_64

libc:glibc 2.31 NPTL 2.31

rlimit: STACK 8192k, CORE 0k, NPROC 256489, NOFILE 1024, AS infinity, DATA infinity, FSIZE infinity

load average:13.77 4.52 2.97

/proc/meminfo:

MemTotal: 65788664 kB

MemFree: 20602952 kB

MemAvailable: 55851524 kB

Buffers: 2484600 kB

I saw something about libc being somehow mismatched or there being multiples, I am not sure about this but am trying to check. I have to go away for a couple of days now and Christmas is getting perilously close so it may be that I don't get much time to look at this again for a while.
[Miscellaneous Android Development] clewis.it:
Hi @a-dead-trousers. I have a few questions. I hope you can provide some answers.

1. Is the vbmeta.img file that you supply the same as the stock image, or is it modified? If it is modified, what are the modifications?

2. I have tried to install generic system image (GSI) files on my device (non-eu atom xl). On the android 10 version of vendor and kernel, it can install and boot, but on the android 11 version, GSI's will not boot. Any ideas why they can't boot? It just reboots to recovery after a few seconds.

3. Since the a11 version of TWRP doesn't support encryption, I decided to try disabling forced encryption. This was successful, but had the side effect of breaking WiFi, Sim cards, and the fingerprint sensor. They all worked again after re-enabling encryption on the data partition (which of course means I can't make backups of data). Any ideas how I can resolve this?

Any answers or even hints will be appreciated. Feel free to pm me if you don't want to discuss this publicly.
[Miscellaneous Android Development] a-dead-trousers:
No, it's the result of the LOS build process. Currently it's only used as a dummy to deactivate AVB. Maybe later it'll become relevant when trying to get AVB working (yellow state)

AFAIK the GSI images are trying to switch selinux to "permissive" in order to circumvent the need to supply special policies for the individual vendor partitions of the various devices. With the latest rom Unihertz removed this option (or rather followed Google's recommendation to not have this "debug" option in user builds) in the kernel. Every try to use "setenforce 0" is terminated with an error and setting "androidboot.selinux=permissive" in the kernel command line results in a bootloop.

In my attempts to get TWRP decryption to work (I think) I was able to patch the kernel in a way to have it in a continuous "permissive" state. Although I don't recommend this at all I can provide you with a guide to patch the v4.14 kernel.

Just wait a little bit longer. I'm still trying to get TWRP decryption to work. Currently I identified a bunch of files which prevent the recovery from booting. On the other hand these files are essential for the decryption. Everyone I was asking told me that could only be happening because of file dependencies which are not met. Although I'm still not convinced that this is the underlying problem I'm currently trying to built a working prototype which includes the files in a non-readable form and have them transformed during the boot process.

See my answers above. I don't see this as "rocket science" and therefore no secrecy is required ;)
[Miscellaneous Android Development] clewis.it:
Thanks for all that info. Good stuff.

I will look into the gsi issue a bit more before asking for your instructions, but that seems like a reasonable explanation.

Looking forward to your next TWRP release. Thanks again for all your hard work.