yashsingh1/xdaforums huggingface dataset:
[General Questions and Answers] malfuncion:
I'll give you a super loose explanation- in my case of running Cherish, it is essentially a similar experience to vanilla Android 13 with some added tweaks for the UI and customizing. Additionally, running a custom super image basically removes all vendor junk and unnecessary apps. Up to you, but for me I wanted Android 13 (this device runs 11 out of the box) and didn't necessarily care about root. I can now add on what I want without all the unnecessary vendor (US.CELL/S.TALK) garbage. It may take care of whatever issue you are running in to as well.

In my Mega link above I have the Cherish build I am running. So far I haven't seen any issues, but this device also isn't my 'daily driver'. I'm using this solely as a project for me to learn how the newer version of Android operate and resurrect an old hobby. If you do decide to run the Cherish super, take a backup of your existing one first and the userdata partition (keep from having to set it all up again if you revert). Load the new super and perform another factory reset. Worst case its not for you and you reload your backups.
[General Questions and Answers] 971shep:
In a USCellular, network unlocked, TCL A30 (Android 11), I followed the steps using mtk gui. Unlocked boot loader, deleted userdata, metadata and md_udc. Sourcing vbmeta.bin and 01_Magisk_patch_boot.bin respectively, write partitons vbmeta.bin and boot.bin.

Without relocking the bootloader, I disconnected usb and powered up. I had the red state warning that bootlooped. Under the warning it stated I needed to disable bootloader verification.

Eventually, button presses got me to the recovery screen where I powered off, connected brom mode mtk gui and locked the bootloader. It still produced the red state warning which bootlooped until button presses enabled me to power off..

Again connected mtk gui/brom and restored the backup and locked the bootloader prior to disconnecting. This restored the device.

Questions: Should I have locked the bootloader after flashing vbmeta.bin and 01_Magisk... -> boot.bin and prior to disconnecting usb?

Try patching my own boot.bin? I've seen posts about disabling dm_verity
[General Questions and Answers] malfuncion:
Do not relock the bootloader, however redstate sounds like you possibly didn't flash the smaller vbmeta file. If you reflashed the one you backed up, that one won't work. From what I found that file is the "dm-verity" type check for this device and you have to wipe it out with the smaller vbmeta.bin (either I uploaded or that resides in the mtkclient folder). It may also be that your bootloader unlock didn't go as planned. When you went to recovery did it prompt you to press the powerbutton as the device was "untrusted"?
[General Questions and Answers] 971shep:
My recovery options were the same as the screenshot in the first post - No prompt regarding "untrusted"

As far as a dm_verity file, my mtkclient TCLA30_dump

boot.bin lk2.bin otp.bin spmfw.bin
boot_para.bin lk.bin para.bin sspm_1.bin
cache.bin logo.bin persist.bin sspm_2.bin
dtbo.bin logs preloader_bangkok_uscc.bin super.bin
efuse.bin md1img.bin proinfo.bin swversion.bin
expdb.bin md_udc.bin protect1.bin tee1.bin
flashinfo.bin metadata.bin protect2.bin tee2.bin
frp.bin nvcfg.bin recovery.bin userdata.bin
gpt_backup.bin nvdata.bin scp1.bin vbmeta.bin
gpt.bin nvram.bin scp2.bin vbmeta_system.bin
gz1.bin oembin.bin sec1.bin vbmeta_vendor.bin
gz2.bin oempersist.bin seccfg.bin vendor_boot.bin

I'm wondering if either boot_para.bin, vbmeta_{vendor,system}.bin or preloader_bangkok_uscc.bin function as dm_verity files?

Edit: Started poking around with ghex and found 2 things of note:

vendor_boot.bin is empty - all 00 00 00 ..

My phone had been unlocked by USCellular.

vbmeta_vendor.bin may have the verification keys:

A snipet of the code:

com.android.build.vendor.fingerprint TCL/5102L/Bangkok_USCC:11/RP1A.200720.011/vFQ6A:user/release-keys
[General Questions and Answers] malfuncion:
There may be some confusion. Bootloader unlock is not the same as sim unlocking. Bootloader is controlled through the use of the MTKClient.

First wipe the partitions as you did before:

mtk e metadata,userdata,md_udc

Then use mtk to unlock the bootloader:

mtk da seccfg unlock

In the GUI it is on this tab:

Here is what you get by flashing the emtpy vbmeta, being unlocked and trying to boot to recovery:

You want to flash the file included in the MTKClient:

https://github.com/bkerler/mtkclient/raw/main/vbmeta.img.empty

You can download the above, save it as vbmeta.bin and flash.I also did the extra and just flashed it on all vbmeta entries.
[General Questions and Answers] 971shep:
I thought dm_verity had to do with bootloader verification although I'm not sure how to bypass.

https://source.android.com/docs/security/features/verifiedboot/dm-verity

I unlocked the bootloader in mtkclient

before

deleting the partitions. I'll give it another run.
[General Questions and Answers] malfuncion:
dm-verity corruption · Issue #102 · bkerler/mtkclient

i want unlock bootloader my qin f21 pro device and i do everything as the guide but my device has corrupt.Can you help me resolve this issue?

github.com

See the above. It is all to do with proper vbmeta, the empty one, and the right magisk version. Flash all vbmeta slots with empty vbmeta and use original boot image just to test and see if you can start. If working with it unlocked go ahead and do a custom boot img.

Side note I've been working on building a kernel. I built the tool chain last night and plan to try to do the kernel this evening. A lot has changed since last time I did all this...
[General Questions and Answers] 971shep:
Success:)

Orange State magisk installed. Want to clarify the following:

Removing Magisk with the generic icon is not just removing the icon but the entire app?

Edit: Remove entire app, not just the icon from the home page.

02_magisk* is mtkclient "write partition" tab set to boot.bin?

Edit: use the write partition tab - not the flash tools tab.

Your guide lpmake command references an Andy Yan's 18.1 build (Android 11) which ran. Your mega.nz has a vanilla Lineage 18.1 as a "no-issues" rom. For some of Phh rom's there are mediatek options that need to be enabled in treble settings.

Realme C2 (mediatek P22) w/ Phh GSI

I'd like to work toward a debloated phone running degoogled, open source apps (Bromite, Bromite system webview, K-9 Mail etc). Would you recommend a Vanilla version and sideloading the apps or use an *.img with the apps built in? An example is Phh floss apps:

Phh android 12.1 releases

Last question.; Treble check indicated my TCL A30 was vndk compatible. Is there a reason not to try a vndklite image?

Edit: The vndklite image is working well.
[General Questions and Answers] 971shep:
Thanks to heavy lifting by @malfuncion , I can report a successful Android 12.1 arm64 a/b vanilla, vndklite install from Phh release 416.

I chose this image because Phh had reported a number of Mediatek fixes/patches earlier this year and I'm not sure they ware backported to Android 11. The older webview shell cannot be uninstalled but I was able to use bromite, after sideloading it, for my default system webview..

Wireless, sim, brightness, audio work and I was able to browse to f-droid.org. Using systemwebview v95, download requests showed packets on router but nothing showed up in the Downloads folder. Will try adb sideloading work-around and report back. adb install * worked great for Bromite, Bromite system webview and f-droid. I installed the rest of the applications from f-droid.

I don't have cloud storage but will provide my linsuper.img via email. Private message me w/ your address.
[General Questions and Answers] 971shep:
I am having some minor issues with the Phh Android 12.1 GSI. F-droid worked and I was able to install my usual applications but the included File Manager would not copy to other folders Specifically, a black wallpaper that I GIMP'd to mimic GrapheneOS. and emailed went to Downloads OK but would not copy over to Images. I was able to copy it over with another File Manager but Home Screen wallpaper would browse to the *jpg but would not set.

Another example is Geometric Weather provides a nice widget and the available Geometric Weather widgets were not listed. Edit: I worked around this by sideloading Geometric Weather.

I tried changingthe ROM's Quickstep launcher to something else but still could not change the wallpaper.

A sideloaded Launcher<3 functions well.

This is my first custom ROM and I'm wondering if I have a permissions issue or something else?
[General Questions and Answers] 971shep:
I'm trying to reproduce my previous GSI and keep ending up with a dm-verity error.

Can you clarify the last steps?

"-load the attached oempersists_clean.bin ...." is actually attached as clean_oempersists.bin. If I was to write it, where would I write it: to oempersist.bin?

"-load factory boot image, otherwise...." I'm taking "factory" to mean the stock boot.bin from the factory dump but I'm wondering if this is giving me the dm_verity error? What you linked to said:

Should we also write back the stock vbmeta, vbmeta_system and vbmeta_vendor?

Another issue appears to be a Magisk change on the second reboot, alpha give 2 options: direct install (recommended) and patch bootloader. I do not recall this on my earlier attempts I chose direct install - maybe I should have patched the bootloader..

Lastly, my inclination is to lock the bootloader after all the mtkclient operations. My understanding is that this is not possible - even with the small vbmeta overwrites.
[General Questions and Answers] malfuncion:
Nice write up. I'm adding more files to my mega soon. I've got working crDroid and xdroid installs. I've successfully wiped 3 A30s now and am working to find the smoothest running rom. So far xdroid is pretty good. Everything is functional and snappy. I also need to reload my 4th a30 (yes I'm collecting them). It was the first of all these and is still stock with just root. 2 are for my kids, one is mine to mess with and the 4th is for automation. They're just so cheap where I am; can pick them up for $15-$25 new.

I've also tried compiling the kernel a few times, but the 509 source has a compilation error with some unknown drivers. I haven't dug too much further in to it though. This is my last week until vacation and hopefully I can spend some time on this thing soon.
[General Questions and Answers] 971shep:
My kernel building experience is limited to x86_64 on Crux Linux.

Android's tendency to "script" the builds and environment may be convenient, but I find it difficult to learn anything by executing a script. Ideally, go through a step at a time. My sense of the basic steps I need to implement. Comments and corrections appreciated.

1. Get latest stable source - I tend to trust upstream Google more than TCL/Alcaltel.

2. Patch if necessary

3. Configure and develop security hashes

4. Export environment

5. Build

6. Test image

7. Redo vbmeta hashes.
[General Questions and Answers] 971shep:
GPL'd source for TCL5102 just released

The [tgz] link at the end of the commit line is AOSP 4.19-stable source:

https://android.googlesource.com/kernel/common/+/refs/heads/android-4.19-stable

My approach will be

Setup my Arch Linux build box for android kernel compilation

Build a generic aarch64 gki using Google's config file

Import TCL config build into Google kernel tree and see what does not configure

Resolve missing configuration - hopefully by staying in Google source tree.

Be mindful of propriatary drivers and firmware. Will choose open source drivers and firmware over propritary drivers if possible
[General Questions and Answers] malfuncion:
I have a booting kernel compiled. The touchscreen driver issue in the defconfig was a misnamed folder in the driver path. Looks like TCL renamed a folder to "_bak" that was causing some issues. There are a few other items that I'm working through, but nothing that stops compiling- just warnings. Some misc notes- the debug kernels don't have working wifi, I also found that the the TF and OM_NA variants are identical in their defconfigs outside naming.

I am now working on looking in to some tweaks, overclocking, patches and other misc interesting items for this kernel.

How is your build coming along?

Side note, I organized my mega folder that makes a little more sense and clearer navigation. I've uploaded some newer rom images and some of the compiled kernels on there as well. The boot images (kernels) aren't worth anything other than POC at the moment. That hopefully will change soon..
[General Questions and Answers] 971shep:
"How is my build coming along?"

I'm still learning. One of the challenges is that AOSP is implementing new build systems: Kleaf

https://source.android.com/docs/setup/build/building-kernels

Right now I'm working through trying the older

BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh

for android12/kernel_5.10

My sense is that BUILD_CONFIG sets ARCH=arm64 and the compiler and builds a local .config file.

$ cat build.config.mtk.aarch64.gcc
ARCH=arm64
CROSS_COMPILE=aarch64-linux-gnu-
CC=gcc
# DEFCONFIG=defconfig
KERNEL_DIR=kernel-4.19
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gcc/linux-x86/aarch64/aarch64-linux-gnu-6.3.1/bin

I've installed Arch aarch64-linux-gnu-gcc package and would like to build my own "build.config.mtk.aarch64.gcc in the asop Android12-5.10 source tree.

My build.config.mtk.aarch64.gcc

$ cat build.config.mtk.aarch64.gcc
ARCH=arm64
CROSS_COMPILE=aarch64-linux-gnu-
CC=gcc
# DEFCONFIG=defconfig
KERNEL_DIR=kernel-5.10

I hope to use the Arch Linux compiler - I should not need the *_PREBUILTS_* stanza?

It looks like the bangkok_NA_OM-defconfig will need some editing.

/tcl5102_kernel_source/kernel-4.19/arch/arm64/configs/bangkok_NA_OM_defconfig

cat bangkok_NA_OM_defconfig | grep SND

CONFIG_SND_HRTIMER=y
CONFIG_SND_DYNAMIC_MINORS=y
# CONFIG_SND_SUPPORT_OLD_API is not set
# CONFIG_SND_VERBOSE_PROCFS is not set
# CONFIG_SND_DRIVERS is not set
CONFIG_SND_USB_AUDIO=y
CONFIG_SND_SOC=y
CONFIG_MTK_SND_SOC_CODEC="mt6357"
CONFIG_SND_SOC_MTK_BTCVSD=y
CONFIG_MTK_SND_SOC_NEW_ARCH=y
#CONFIG_SND_SOC_RT5509=y
#CONFIG_SND_SMARTPA_AW881XX=y
CONFIG_SND_SOC_MT6357_ACCDET=y

In the 5.10 tree:

ls aosp_5.10/sound/soc/mediatek
common Kconfig Makefile mt2701 mt6797 mt8173 mt8183

ls aosp_5.10/sound/soc/mediatek/mt6797
Makefile mt6797-afe-pcm.c mt6797-interconnection.h
mt6797-afe-clk.c mt6797-dai-adda.c mt6797-mt6351.c
mt6797-afe-clk.h mt6797-dai-hostless.c mt6797-reg.h
mt6797-afe-common.h mt6797-dai-pcm.

vs the tcl 4.19 tree

ls tcl5102_kernel_source/kernel-4.19/sound/soc/mediatek

audio_dsp codec common_int Makefile mt6765 mt6797
aw87519 common Kconfig mt2701 mt6779 mt8173

It looks like the new 5.10 defconfig for the SND_SOC drivers should just need:

CONFIG_SND_SOC=y
CONFIG_SND_SOC_MT6797

Guessing that mt6797-mt6351.c probes/sets the specific chipset

https://android.googlesource.com/kernel/common/+/7472eb8d7dd12b6b9b1a4f4527719cc9c7f5965f

This is going to be a time consuming task but it would essentially allow me to keep the TCL A30 running on the latest AOSP stable code. I'm hoping that I can find a defconfig for a Mediatek P22 Helio device that is running Kernel 5.10.

Update.: Using Android12_5.10 kernel source and make ARCH-amd64 menuconfig, I stepped through the configuration of bangkok_NA_OM_defconfig[ and came up with a .config file. Next step is to see if I can get it to build.

Update: Have a 5.10 Image.gz file. Need to package and test.
[General Questions and Answers] 971shep:
mkbootimg does not have a man page and I'm not having getting many search hits on how to incorporate my Kernel 5.10 "Image" file into a boot.bin. I was also wondering if I could avoid overwriting boot.bin and sideload the image to the SDcard and boot it to test? Any url links to guides appreciated.

I'm hopeful that most of Mediatek's drivers have been incorporated into the newer kernel but I'm not optimistic.

On another front, Andy Yan and Phh have pooled their resources and are providing Vanilla Android 13 builds.

I've installed android_13.0.0_r14 ci-20221219/system-td-arm64-ab-vanilla.img.xz and it actually runs better than the Phh Android 12.1 than I initially tried. Phh's builds are sourced by many other projects

https://github.com/TrebleDroid/treble_experimentations/releases
[General Questions and Answers] malfuncion:
I have been using a toold called mktool. I've attached it here for you to use. Basically, this tar contains the bins necessary. Extract, create 3 folders in the extracted folder: input, output, extracted. Place the working "stock" boot image in to input. Open the tool, use extract. It'll create 2 files in the extracted folder. delete the kernel image, replace with yours. Use the Mktool to zip it back up and it'll create an output img file. From here, use the python script avbtool.py to resign the new image and make its the 32mb:

python avbtool.py add_hash_footer --image new-image.img --partition_size 33554432 --partition_name boot

Now flash the image file (32mb) in the boot slot of mtkclient.
[General Questions and Answers] 971shep:
Thanks for the guidance. My tools are builtin my Arch Linux install. The package list:

https://archlinux.org/packages/community/x86_64/android-tools/

Running the commands brought up helpful error messages and I was able to build a boot.bin with the cmdline stanza. My offsets were different though and the result did not boot.

Although it would be nice to have a recent kernel, I'm OK with running the original kernel. or the mega OEM kernel you have on your site.- does it run OK?

Higher priorities are

figure out how to re-lock the bootloader. I'm thinking it involves generating crypto hashes/keys for the various partitions and putting the keys into various vbeta files.

Using TD/treble_experimentations source and build my own gsi with updated bromite webview and a different launcher. - a launcher without a google search bar in an otherwise degoogled phone.
[General Questions and Answers] 971shep:
Quick Update:

Link of documentation to regenerate crypto hashes to relock bootloader:

https://www.digi.com/resources/docu...id-trustfence_t_secure-boot-generate-avb-keys

https://www.hovatek.com/forum/thread-32664.html

Question is whether to stay with bangkok/US Cellular public keys or use Hovatek public key.

Also updated my super.bin to the latest TrebleDroid image that has some security fixes:

https://github.com/TrebleDroid/treble_experimentations/releases/latest

Only one minor issue: the Simple Launcher, home screen clock weather widget gesture navigation is sensitive. a gesture overshoot brings up the resize/remove popup.

Update: After disabling USB debugging, the widget popup seems resolved. Probably a good idea to routinely disable usb debugging, from a security standpoint.

In summary:

phone - Works

messaging - Works

sim (T-mobile MVNO) - Works

camera - Works

Volte - Works Follow this post to enable

GNSS via Organic Maps - Works

Headphone jack - Works after enabling Alternative jack in Phh settings and rebooting.

Apk install best done via "adb install". and apk updates w/ "adb install -r"

For my limited needs, the phone matches the function of my Pixel 6A w/ GrapheneOS.
[General Questions and Answers] malfuncion:
I also recently updated some files. I grabbed the latest version of Lineage and Evolution ROM. I ended up on the Evolution one, but both have the JAN 2023 security updates in them.

Did you ever have any luck with upgrading the kernel version?

How about relocking the BL? Any luck with that process? I looked through the guide, but not sure where to get a .PAC file? I don't see any vbmeta-sign.img files in my dump either.
[General Questions and Answers] lavilafic:
I'm having a problem getting into bootrom mode, only be able to get kamakiri2 when i remove the battery. I download the mtkclient_liveCD and started from that.

TLC A509DL (Tracfone locked) - vL8T Compilation (Non January Update)
[General Questions and Answers] 971shep:
Some other things in life are taking precedence. I am looking at getting a similar device: TCL 30z. It has a slightly larger screen, more recent Mediatek Helio P22 cpu and Android 12. Be interesting to see what kernel it runs and if possibly the dump could be flashed on to the A30.

Edit: Found https://specdevice.com/showspec.php?id=5d94-878f-0033-c5870033c587

Still Kernel 4.19 but release is 4.19.127+ -> 4.19.188+. I was hoping that Mediatek devices drivers would be added to Mainstream linux making kernel upgrades easy. They have moved the compilier from gcc -> clang.
[General Questions and Answers] 971shep:
The live cd was built June 28, 2022 but that being said it worked for me with a USCellular that was unlocked by USCellular. My process was:

1. Tap build to become a developer

2. Enable USB debugging

3. with phone powered off, start mtk_gui (or mtk) with usb cable connected. While mtk/mtk_gui is looking for the phone, power up the A30 - mine always connected in brom mode. If yours does not, consider unlocking the sim.

@malfuncion unlocked his sim using the process documented at the bottom of this post.

My experience with Tracfone was horrible, they would not transfer my 12 month plan to the gsm capable A30 that I owned and I was not about to buy a new phone. When I bought the plan, they supported gsm devices. I lost about $100 in prepaid service. Every review I've seen and Better Business Rankings puts them in the gutter. One reviewer said he gave them 1 star because zero was not an option.

In the U.S., carriers are obligated to unlock the sim after you meet the contract obligations. For USCellular that was 3 months.. Tracfone lost my verification data when Verizon bought them and offshored support to a Philippine call center. I suspect if you call support about unlocking the phone, if you fullfilled the contract,, they will not "verify" you and will not unlock it.

For those interested in getting a cheap TCL to root and install a GSI, In the end it would have been cheaper to buy the factory unlocked version.
[General Questions and Answers] ultrasuper:
Got an A509DL TCL A3 (Tracfone branded) currently un-rooted running fine on a Verizon MVNO, with working WiFi Calling and Visual VM.

Would like to root it, but don't want to screw it up, so--

I've got a brand new one on the way (same model, TF variant) and want to know the current state of rooting this phone; Is TWRP working?

Has anyone done a specific step-by-step write up yet?

If not, Can someone guide me on how I should proceed when I receive this "virgin" A509DL late next week. I would remove the included SIM before ever powering it up and keep it removed throughout I assume would be the safest to prevent any auto-updating.

TIA
[General Questions and Answers] r1pp3d2:
If the security patch is after Nov 21 it can't be rooted. I don't think there is a TWRP. Use mtkclient to try and unlock bootloader and dump/write boot.img.
[General Questions and Answers] ultrasuper:
Nov 21 of 2021? Or 2022 you mean?
[General Questions and Answers] r1pp3d2:
November of 2021
[General Questions and Answers] ultrasuper:
Oof.

Ok that rules out the un-rooted one that I currently have working normally as it did do one update before I stopped it (it's at April of 2022.)

I'll update here when the new one comes in the mail as I won't let it go online at all.

I'm not optimistic though as Nov 2021 is a while ago now and it's coming from TF basically...
[General Questions and Answers] 971shep:
mtkclient works around the security patch. My sense is that TCL is utilizing the same chipset and incrementing the android version: TCL A3/Android 10 -> TCL A30/Android 11 -> TCL 30z/Android 12.

It would be interesting to see if dumps from later versions could be flashed over older versions using mtkclient.
[General Questions and Answers] ultrasuper:
So you're saying I *should still* be able to successfully root the phone with the April 2022 patch?
[General Questions and Answers] 971shep:
Yes, I think so. Mine had all factory updates to December 2022 and I was able to root it.
[General Questions and Answers] r1pp3d2:
for real? i tried on a newer one and it would not jump to BROM.