[GSI][13] LineageOS 20 TrebleDroid-based

Search This thread

AndyYan

Recognized Contributor
Jan 30, 2012
4,585
4,058
Beijing
@AndyYan Your gsi & phh's trebledroid, are the only ones that are able to load my device overlay from phhusson's vendor mate. None of the other A13 GSIs able to. Any reason for this ?
And trebledroid throws unsupported magisk version, but none of the other GSIs have that issue. That's strange too.
Nothing weird about these.
The former is because I fixed and integrated the overlay matching patch ahead of notifying PHH, then PHH pushed it to TD and made a CI, and it hasn't trickled down to other ROMs just yet. Kinda proving point 3 in #2.
The latter is pure PHH/TD doesn't have /sbin-related patches necessary for Magisk, but it's half Magisk's fault (intentionally neglecting GSI usecases).
 
  • Like
Reactions: MPK99

MPK99

Senior Member
Nothing weird about these.
The former is because I fixed and integrated the overlay matching patch ahead of notifying PHH, then PHH pushed it to TD and made a CI, and it hasn't trickled down to other ROMs just yet. Kinda proving point 3 in #2.
The latter is pure PHH/TD doesn't have /sbin-related patches necessary for Magisk, but it's half Magisk's fault (intentionally neglecting GSI usecases).
Nice. Which means one more monthly update iteration is enough for all GSIs to get overlay matching patch right?
 
  • Like
Reactions: Azhero

pommefrite8

Member
Dec 10, 2014
12
1
Hello,

Firstly thank for your work, it's amazing.

Do you know why when we run with "lunch lineage_gsi_arm64_vN-user" during the compilation we get the error below.
Because it security issue, no ?

FAILED:
In file included from system/libvintf/Android.mk:18:
system/sepolicy/Android.mk:85: error: SELINUX_IGNORE_NEVERALLOWS := true cannot be used in user builds.

Thanks :)
 

K-BOX2022

Senior Member
Dec 31, 2021
162
23
Smart Watches
Samsung Galaxy Tab S2
Hey. He has a problem with Lemfo T. On this Lineage os terribly stutters audio, animations are very muddy, terribly everything goes slow. I tried turning off animations but it didn't do anything. I need to catch some tweaks or something else to make it usable?
 

prazola

Senior Member
Jun 24, 2013
109
19
Xiaomi Mi 4C
Hi, is this quick settings behavior expected?

1669974368051.png


It happens in both Los 19.1 and 20.
I would like to reduce the tiles per row to 3 or 2, as 4 is quite busy and unreadable.

Phone: Umidigi S5pro

EDIT:
Problem solved using Debloat app to mask out vendor apps.
 
Last edited:

bentalebnordine

Senior Member
Mar 2, 2013
88
21
The best root strategy for gsi roms is to install a bvn or bgn rom then patch the boot image with magisk, it's better than a built-in phh su because phh su do not allow r/w system
And also installing bvs with patched boot would cause interference between pph su and magisk su
 

ildar_prophet

Senior Member
Apr 20, 2011
291
45
johan-notes.blogspot.com
because phh su do not allow r/w system
Nonsense! With Phh SU I easily modify /sysytem: install /system/etc/hosts with AdAway blocking , install MicroG with unofficial installer.
It just may be narrow in free space. But that's fixed with lptool (carefully).
then patch the boot image with magisk
You may not know but that's not successful with all the phones. Your mileage may vary.
 

AnonVendetta

Senior Member
Apr 29, 2016
1,391
514
The best root strategy for gsi roms is to install a bvn or bgn rom then patch the boot image with magisk, it's better than a built-in phh su because phh su do not allow r/w system
And also installing bvs with patched boot would cause interference between pph su and magisk su
I think that part of what you're saying can't be right. My boot.img is patched with Magisk Delta. However, if I install a gsi that has phh su, the Magisk always get overridden by the phh su. Presumably they're both trying to use /system/bin/su as the su binary, obviously both can't coexist at the same time. So phh su takes precedence. However, if I delete the phh su files (from TWRP), Magisk is able to work.

And if I manually create /sbin and add sbin to the path statement in /init.environ.rc, Magisk overrides phh su, but grumbles that it exists. This is because /sbin has priority over /system/bin in the path order, so /sbin/su is found first.
 

AndyYan

Recognized Contributor
Jan 30, 2012
4,585
4,058
Beijing
I think that part of what you're saying can't be right. My boot.img is patched with Magisk Delta. However, if I install a gsi that has phh su, the Magisk always get overridden by the phh su. Presumably they're both trying to use /system/bin/su as the su binary, obviously both can't coexist at the same time. So phh su takes precedence. However, if I delete the phh su files (from TWRP), Magisk is able to work.

And if I manually create /sbin and add sbin to the path statement in /init.environ.rc, Magisk overrides phh su, but grumbles that it exists. This is because /sbin has priority over /system/bin in the path order, so /sbin/su is found first.
This here.

Many non-AOSP PHH-based GSIs incl. mine already have this /sbin patch, therefore Magisk kinda works on *S. The existence of PHH-SU can still fail detections though, and that's where secure or *N is really needed.
Can it be dirty updated? How can it be done?
Thanks!
Just flash an update like you would the original, nothing else.
 
  • Like
Reactions: ykom

AnonVendetta

Senior Member
Apr 29, 2016
1,391
514
This here.

Many non-AOSP PHH-based GSIs incl. mine already have this /sbin patch, therefore Magisk kinda works on *S. The existence of PHH-SU can still fail detections though, and that's where secure or *N is really needed.

Just flash an update like you would the original, nothing else.
I've noticed some peculiar behavior when Securizing on non-secure GSIs (tried on a few already):

If I install the phh su app (on a gsi that already has the binaries but lacks the app), securizing causes the ROM to softbrick. And not even a factory reset will allow it to boot again.

If i leave Magisk in /system/bin (by not creating sbin and adding to path), securize appears to work but silently fails (the phh-securize.sh file is still present after reboot, securize is supposed to delete it). I suspect Magisk "locks" the directory and reverts changes.

If I create sbin and add it to the path, Magisk migrates to sbin and securize succeeds. It reboots normally without softbricking.

On an unrelated note, I've tried your TrebleDroid (non-light) on my Galaxy Tab S7+ and a Galaxy Note 20 Ultra, it fails to boot on either device. It's strange, since phh's Android 13 appears to be based on your sources, but boots fine. I wanted to check on the exfat thing again, but can't since boot fails.
 

ykom

Senior Member
Nov 19, 2011
107
18
"Just flash an update like you would the original, nothing else."

Thanks Andy,

My phone has no twrp and I have to use ADB. When updating OS19 to OS20, I have to ease the system and personal data, so it was a clean installation. I'm not sure that OS20 can be updated without easing the system and data.
 

AndyYan

Recognized Contributor
Jan 30, 2012
4,585
4,058
Beijing
On an unrelated note, I've tried your TrebleDroid (non-light) on my Galaxy Tab S7+ and a Galaxy Note 20 Ultra, it fails to boot on either device. It's strange, since phh's Android 13 appears to be based on your sources, but boots fine. I wanted to check on the exfat thing again, but can't since boot fails.
I wonder if that's because I now integrally securize *N - I've had one report of that not booting on some other device. Did you try *N or *S?
 

AnonVendetta

Senior Member
Apr 29, 2016
1,391
514
I wonder if that's because I now integrally securize *N - I've had one report of that not booting on some other device. Did you try *N or *S?
I can't remember. It's been over a week. The only thing I can remember for sure is that it was a vndklite 11-11 build, because I refuse to try gsis that don't have that "flavor" available.

About the pre-securized gsi thing, they do boot for me. I've tried Pixel Experience (secure during build time) and secure phh Android 12 gsis. No issues with any of them.
 

V0latyle

Forum Moderator
Staff member
I wonder if that's because I now integrally securize *N - I've had one report of that not booting on some other device. Did you try *N or *S?
Can confirm on my T290. All *N builds bootloop - they get to the splash screen, in some cases the setup screen, but eventually crash and reboot. No idea why.

Only the *S flavors work for me, but since I'm a Magisk user, I was hoping to just patch the unrooted builds.

I've noticed this is true with your older builds, too - 18.1 and 19.1, only the S variants are stable.

Any plans to do a *gS flavor for 20.0?
 

AndyYan

Recognized Contributor
Jan 30, 2012
4,585
4,058
Beijing
Any plans to do a *gS flavor for 20.0?
I only just killed that... I hate excessive variants that are almost identical.
I'll see if making "secure" a toggle (instead of forcing it) works. In PHH AOSP, the SU app and binaries are universally preloaded, and Securize was a one-way trip. Now that it's only some props to be reset, I reckon it might work as a toggle. OR, I might as well grab one of the broken devices and see just which "secured" prop is breaking it. Either would push back the next release further though.
I've noticed this is true with your older builds, too - 18.1 and 19.1, only the S variants are stable.
Only the most recent 19.1 update has *N, and 18.1 never had it. What they've had all along is VNDKLite "secure" builds. Please confirm if you meant that instead?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    Updated all variants with January security patches and in sync with TD 20230104. [Insert obligatory backup-and-test warning here]

    During my CoV downtime, A13 QPR1 happened and TD-based had a lot of changes as well, which accumulated to this month and I had to update more patches than expected (way more than "Light" - lower maintenance is why I made that in the first place). I might've made oopsies along the way, so I don't feel quite confident about this batch, and you should exercise extra caution.

    Some users have reported that securize bootloops their device, and the current "integrally securize" approach means they can't boot up even once. This month I've changed it yet again to "securize on-demand", which is similar to how you securize on PHH/TD-based (a toggle in Treble Settings), but reversible and doesn't require SU.
    For new users who are unsure about whether securize might bootloop your device, please turn on USB Debugging and Rooted Debugging below it, and if/when you do hit a bootloop on the next boot, you'll have a rooted ADB shell available to you, from where you can toggle off manually:
    Code:
    adb root
    adb shell setprop persist.sys.phh.securize false
    adb reboot
    For users who are already on a gN build, be sure to toggle it on and reboot right after you update!

    Properly fixed exfat for Samsung/Sony, tested on the one Sammy I still own.
    2
    Hello, I would like to take this opportunity to thank you. I have repaired a Huawei P10 from a completely destroyed condition with cheap spare parts. I was a little disappointed at first, because the several system images ran poorly or not at all. At last I had installed Lineage OS 19. This stuttered and there were WLAN aborts. Now I have installed the Lineage OS 20 image and it runs flawlessly. The performance is good and there are no problems. I hope such projects will continue forever to give old devices a second life instead of throwing them away.

    EDIT:
    Huawei P10 still WIFI Disconnects after 2 Minutes turning screen off. Checked the logs and found this issue reported 3 years ago:

    Working workaround:
    Activate adb debugging as root in dev options and start adb as root on your pc:
    $ abd root
    $ adb shell
    $ echo 1 > /proc/sys/net/ipv6/conf/wlan0/disable_ipv6

    Then WIFI stays connected after you turn the screen off.

    EDIT 2:
    The workaround i mentioned is just temporary. It works till you reconnect to the WiFi or reboot. Disabling Ipv6 on your router makes it work but then some services might not work for you which rely on IPv6.

    Since its TrebleDroid based i tried to install the TrebleDroid Android 13 GSI. In the TrebleDroid GSI the bug is also present. Its not a specific LineageOS problem.
    1
    any idea about this?

    01-06 11:51:09.392 952 1078 W AidlConversion: legacy2aidl_audio_channel_mask_t_AudioChannelLayout: no AudioChannelLayout found for legacy input / voice audio_channel_mask_t value 0x3
    01-06 11:51:09.392 952 1078 E AidlConversion: legacy2aidl_audio_channel_mask_t_bits_AudioChannelLayout_layout: legacy input audio_channel_mask_t 0x3 contains unrecognized bits 0x3
    01-06 11:51:09.393 1238 1558 W AudioManager: updateAudioPortCache: listAudioPorts failed

    audio seems to be fine though, but it is being spammed thousands of times (on aosp gsi as well...)
    1
    Can I dirty flash LOS 20 on LOS 19?
    The Lineage website has instructions for specific models but not sure if they would be applicable to this GSI.
    I would clean install but have a read of this example (for Oneplus 7t but probably the same for other devices) https://wiki.lineageos.org/devices/hotdogb/upgrade
    You may need to upgrade firmware first.
    Do a thorough search on XDA &/or the web first.
    1
    (deleted)
    EDIT:
    Huawei P10 still WIFI Disconnects after 2 Minutes turning screen off. Checked the logs and found this issue reported 3 years ago:

    Working workaround:
    Activate adb debugging as root in dev options and start adb as root on your pc:
    $ abd root
    $ adb shell
    $ echo 1 > /proc/sys/net/ipv6/conf/wlan0/disable_ipv6

    Then WIFI stays connected after you turn the screen off.

    EDIT 2:
    The workaround i mentioned is just temporary. It works till you reconnect to the WiFi or reboot. Disabling Ipv6 on your router makes it work but then some services might not work for you which rely on IPv6.

    Since its TrebleDroid based i tried to install the TrebleDroid Android 13 GSI. In the TrebleDroid GSI the bug is also present. Its not a specific LineageOS problem.
    Isn't this caused by wifi suspend optimizations?

    Try
    settings put global wifi_suspend_optimizations_enabled 0, and switch wifi off and on.
  • 13
    640px-Lineage_OS_Logo.png

    LineageOS is a free, community built, aftermarket firmware distribution of Android, 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 Gerrit Code Review.

    MUST-READ BACKGROUND - Android 13 and the two approaches:
    As some of you already know, due to various reasons, @phhusson , who kickstarted the GSI trend and committed to it over the years, is backing out from future development
    - there won't be any AOSP 13+ builds or patches directly from him. He did most of the heavylifting for fixing bugs and implementing features, and selflessly supported more than his AOSP GSIs and more than devices he own. For the situation of GSIs today, we owe him a big thank-you.
    Earlier, inspired by @PeterCxy , I took the "light" approach, which starts over from AOSP's generic gsi_* target and adds the minimum amount of fixes needed for my own devices, intentionally leaving many legacy devices behind. For more details about it, visit its own thread.
    Meanwhile, a number of existing builders incl. myself have formed the TrebleDroid organization, with PHH himself helping us in technical issues. TD will forward-port PHH's final patches (v415) onto Android 13 and attempt to fix new issues. This is still a new and ongoing process, but if done right, will have compatibility and feature-completion on par with past PHH-based GSIs. This thread contains LOS builds based on TrebleDroid's collective work, which supposedly suits legacy devices, Samsung, etc. better than "light".

    Disclaimer:
    No flashing instructions will be offered. If you're here in this forum, you should know what you're doing.
    No guarantees that everything would work. This is a GSI, bugs are bound to happen.

    MUST-READ - reporting bugs:
    If you want to report a bug, then you MUST try reproducing on an AOSP reference build of around the same date from TrebleDroid, and ONLY proceed to report here when it's specific to this GSI. This filters out bugs common to all TD-based GSIs, which you should still let me know, but it might not be mine to fix. I might silently ignore your report if you skip this.

    Download:
    https://sourceforge.net/projects/andyyan-gsi/files/
    Scroll down for the naming rules of variants.
    Compressed as .xz archives - extract first.

    Stuff on GitHub (builders-only):
    Most things should be self-explanatory. Not the cleanest code, but should help if you need some clues.
    Thanks to:
    • The LineageOS team
    • @phhusson - shaped the treble community, and still takes care of TrebleDroid at a higher level
    • @PeterCxy - coded critical fixes such as sysbta
    • The TrebleDroid builders
    • ...and more
    Donate?
    https://paypal.me/AndyCGYan
    5
    Updated all variants with January security patches and in sync with TD 20230104. [Insert obligatory backup-and-test warning here]

    During my CoV downtime, A13 QPR1 happened and TD-based had a lot of changes as well, which accumulated to this month and I had to update more patches than expected (way more than "Light" - lower maintenance is why I made that in the first place). I might've made oopsies along the way, so I don't feel quite confident about this batch, and you should exercise extra caution.

    Some users have reported that securize bootloops their device, and the current "integrally securize" approach means they can't boot up even once. This month I've changed it yet again to "securize on-demand", which is similar to how you securize on PHH/TD-based (a toggle in Treble Settings), but reversible and doesn't require SU.
    For new users who are unsure about whether securize might bootloop your device, please turn on USB Debugging and Rooted Debugging below it, and if/when you do hit a bootloop on the next boot, you'll have a rooted ADB shell available to you, from where you can toggle off manually:
    Code:
    adb root
    adb shell setprop persist.sys.phh.securize false
    adb reboot
    For users who are already on a gN build, be sure to toggle it on and reboot right after you update!

    Properly fixed exfat for Samsung/Sony, tested on the one Sammy I still own.
    4
    Are you vaccinated? boosted?
    Does it matter? Is it any of your business? Let's keep discussions like this off XDA. Thanks
    3
    Notes:
    • I now have a rather taxing day job, and can't devote nearly as much time/effort into this as I did as a student, or even a year ago.
    • I now daily-drive "light", so I can't test TD-based builds as extensively as before. For the same reason, I likely won't build/upload any TD-based "personal" build either.
    • While most >=A13 GSIs out there are going to be TD-based, some perform better than others - some devs have their own patches that haven't been merged into TD yet. I myself will stay close to TD's raw patchset as much as possible, without picking patches from others left and right. If you find another GSI working better, don't just complain - try to narrow down which ones, and the intersection of them might be an unmerged patch that, if approved, would be merged into TD and benefit all.
    • GAPPS builds are offered as-is without guarantees. As a Chinese I can't/won't help with GAPPS/SN issues - please help each other out.
    • ADB is intentionally insecure, even on first boot (turned on by default and no authentication needed). GSIs are more fragile compared to device-specific custom ROMs, both on first boot (no-boot issues) and on subsequent boots (after tuning certain Treble settings), and I insist that no-auth ADB is a must-have for debugging and general fail-safe.
    • Signature spoofing (MicroG) is supported, but only for priv-apps. This is a security consideration from PHH.
    • On *S variants, install PHH-SU and you'll get basic root for apps, good for devices that don't play well with Magisk or when you don't need modules.
    • Refer to this post for explanation/workaround of an MediaTek-specific kernel bug that causes no internet.
    3
    i downloaded as a gsi dsu sideload , and works , just wifi cant get internet even if it conects ,is there a work around to solve that? im in poco x3 gt
    Notes:
    • [...]
    • Refer to this post for explanation/workaround of an MediaTek-specific kernel bug that causes no internet.