How To Guide Your Average GSI Guide - Samsung Galaxy Tab S8

/*
* 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.
*/
WARNING:
All your data is gone.
You will not be able to use Netflix or any KNOX apps.
What you need to do, or what you will need
You need to unlock your bootloader
TWRP from here https://forum.xda-developers.com/t/...-for-galaxy-tab-s8-series-snapdragon.4455491/
Neutralized vbmeta or empty. It is your choice*
The vendor.img (Vendor can be extracted from thesuper.img. You then use use simg2img then lpunpack to extract it)
Multi-Disabler
* A neutralized vbmeta is preferred over an empty vbmeta, but it is really your choice.
Flash time
Do this in TWRP
Set the block devices to r/w so you can flash images.
# blockdev --setrw /dev/block/dm-0
# blockdev --setrw /dev/block/dm-1
# dd if=<GSI image here> of=/dev/block/dm-0 bs=1m
# dd if=<vendor image here> of=/dev/block/dm-1 bs=1m
If the image is sparsed
Code:
# simg2img <sparsed GSI image here> /dev/block/dm-0
NOTE: If you flashed vendor in this step, DO NOT REBOOT.
Flash Multi-Disabler to disable encryption of internal storage.
If you flashed the vendor.img when flashing GSI, flash Multi-Disabler again.
Thanks to SavXL, Afaneh92.

Can you still use the S pen on an GSI?

If you are happy with it being a generic stylus then yes.
That means, No Samsung Features
There should be a root app that enables those
I'll look for it
As of now just a generic stylus
PS. Using the SPen now at the time of writing

xplanthris said:
If you are happy with it being a generic stylus then yes.
That means, No Samsung Features
There should be a root app that enables those
I'll look for it
As of now just a generic stylus
PS. Using the SPen now at the time of writing
Click to expand...
Click to collapse
Thanks! That's very interesting! I am currently trying to work out if I should buy the S8. I have been using a very comparable tablet, Xiaomi pad 5 pro, in the past several months. I absolutely hate MIUI (Xiaomi OS). Although my Pad 5 is rooted there are so many things you are not allowed to do... So I am on a Pixel Experience Plus GSI, but you can't use the (expensive) Xiaomi pen. On the whole I am still better off with a GSI than MIUI for the sake of my sanity. But I really want to have the digital pen functionality. The Xiaomi pen on any GSI isn't recognised at all. You can't even use it as a capacitive pen. The S pen sounds like more adaptable. I am hoping One UI isn't as restrictive as MIUI, but having the possibility of a GSI would be always helpful.

UmiCat said:
Thanks! That's very interesting! I am currently trying to work out if I should buy the S8. I have been using a very comparable tablet, Xiaomi pad 5 pro, in the past several months. I absolutely hate MIUI (Xiaomi OS). Although my Pad 5 is rooted there are so many things you are not allowed to do... So I am on a Pixel Experience Plus GSI, but you can't use the (expensive) Xiaomi pen. On the whole I am still better off with a GSI than MIUI for the sake of my sanity. But I really want to have the digital pen functionality. The Xiaomi pen on any GSI isn't recognised at all. You can't even use it as a capacitive pen. The S pen sounds like more adaptable. I am hoping One UI isn't as restrictive as MIUI, but having the possibility of a GSI would be always helpful.
Click to expand...
Click to collapse
I was about to buy the Xiaomi Pad 5 Pro, but seeing how it fares to GSI. I am kinda happy I struck with Samsung
Also, there is an app for ful root SPen functionality.

xplanthris said:
I was about to buy the Xiaomi Pad 5 Pro, but seeing how it fares to GSI. I am kinda happy I struck with Samsung
Also, there is an app for ful root SPen functionality.
Click to expand...
Click to collapse
What is GSI is this a stock rom?

HARNATH said:
What is GSI is this a stock rom?
Click to expand...
Click to collapse
Stands for "Generic System Image".

Can anybody confirm a few GSI ROMs work with this tablet? I'm disappointed there is so little development on it, and I want to be sure I can side step all the privacy issues in the stock ROM. Andy Yan's lineageos gsi works well on my SM-T510 TAB A for example.
Also, any pointers to Android 13 ROMs is appreciated.

Currently running the PE 13 Alpha build on my Tab S8 Plus and most things work perfectly fine. The only issues are Bluetooth, stereo audio (only mono at the moment), and brightness (but manually setting the max brightness level in PHH settings to 1.0 seems to fix the issue). The fingerprint scanner also doesn't work yet. AOSP mods also help fix issues like rotation and resizing of UI elements (not necessary but personal preference.)
Seems most issues with Tab s7 series match the tab s8 series as well so I recommend checking out that thread as well for more info.

lampdoors23 said:
Currently running the PE 13 Alpha build on my Tab S8 Plus and most things work perfectly fine. The only issues are Bluetooth, stereo audio (only mono at the moment), and brightness (but manually setting the max brightness level in PHH settings to 1.0 seems to fix the issue). The fingerprint scanner also doesn't work yet. AOSP mods also help fix issues like rotation and resizing of UI elements (not necessary but personal preference.)
Seems most issues with Tab s7 series match the tab s8 series as well so I recommend checking out that thread as well for more info.
Click to expand...
Click to collapse
here's a link to the rom I am currently running. Other GSI roms haven't worked for me so far (android 13).
Releases · ponces/treble_build_pe
Script and patches for building PHH-Treble Pixel Experience - ponces/treble_build_pe
github.com

Any photo, video of this rom how it looks like? What are the benefits of installing? Are faster, better battery? In pixel android 13, they managed to run windows 10 because of virtualization capabilities of Android 13. Is it possible with our tablet and this rom, if anyone tried it?
Thanks,

Hi. I'd like to add to the former questions: is it possible to add a generic ROM to a Samsung Galaxy Tab S8+ bought in China? Does anyone have any insight on this? Has anyone tried it? Thanks.

lampdoors23 said:
Currently running the PE 13 Alpha build on my Tab S8 Plus and most things work perfectly fine. The only issues are Bluetooth, stereo audio (only mono at the moment), and brightness (but manually setting the max brightness level in PHH settings to 1.0 seems to fix the issue). The fingerprint scanner also doesn't work yet. AOSP mods also help fix issues like rotation and resizing of UI elements (not necessary but personal preference.)
Seems most issues with Tab s7 series match the tab s8 series as well so I recommend checking out that thread as well for more info.
Click to expand...
Click to collapse
Does newer PE 13 GSI getting better in terms of Bluetooth audio?

Hi all,
I'm going to buy a TAB S8+ but I'm not sure if and which GSI roms could be ok for it.
I mean, if I well understood, GSI roms should works will all Project Treble devices so every GSI roms should be ok.
Is it correct ?
Many thanks for your reply.
Max

If you need other than original rom, perhaps think twice. There isn't custom rom, also i don't read much for gsi rom.

Hi all,
I would like to try to flash a GSI butI'm not sure to have clearly understood the instruction given....
As I'm doing the first steps into flashing mods and to avoid to do a mess, can someone kindly better explain the flashing above and all stuff ?
Many many thanks !

xplanthris said:
/*
* 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.
*/
WARNING:
All your data is gone.
You will not be able to use Netflix or any KNOX apps.
What you need to do, or what you will need
You need to unlock your bootloader
TWRP from here https://forum.xda-developers.com/t/recovery-unofficial-twrp-for-galaxy-tab-s8-series-snapdragon.4455491/
Click to expand...
Click to collapse
xplanthris said:
Neutralized vbmeta or empty. It is your choice*
Click to expand...
Click to collapse
Could not find a straightforward reference on this piece but it appears to be included in the TWRP instructions as "vbmeta_disabled_R.tar"
xplanthris said:
The vendor.img (Vendor can be extracted from thesuper.img. You then use use simg2img then lpunpack to extract it)
Click to expand...
Click to collapse
This needs to come from the original Samsung ROM image, if I'm not mistaken. galaxyfirmware.com has these, have to make sure you choose the correct model for your tablet.
xplanthris said:
Multi-Disabler
Click to expand...
Click to collapse
There appears to be one included in the TWRP thread as well which goes into the USERDATA slot in Odin. Is it this: https://github.com/ianmacd/multidis...ter/META-INF/com/google/android/update-binary ?
xplanthris said:
* A neutralized vbmeta is preferred over an empty vbmeta, but it is really your choice.
Click to expand...
Click to collapse
Don't really understand what this means, can you point to a good reference?
xplanthris said:
Flash time
Do this in TWRP
Set the block devices to r/w so you can flash images.
# blockdev --setrw /dev/block/dm-0
# blockdev --setrw /dev/block/dm-1
# dd if=<GSI image here> of=/dev/block/dm-0 bs=1m
# dd if=<vendor image here> of=/dev/block/dm-1 bs=1m
Click to expand...
Click to collapse
xplanthris said:
If the image is sparsed
Code:
# simg2img <sparsed GSI image here> /dev/block/dm-0
Click to expand...
Click to collapse
IF it's sparse, it should be a .simg file, right?
xplanthris said:
NOTE: If you flashed vendor in this step, DO NOT REBOOT.
Flash Multi-Disabler to disable encryption of internal storage.
If you flashed the vendor.img when flashing GSI, flash Multi-Disabler again.
Thanks to SavXL, Afaneh92.
Click to expand...
Click to collapse

Apologies for the late response, lost access to the account for a while.
So to sum it up, yes a sparse image has to be a .simg.
A neutralized vbmeta is a vbmeta given to you back from magisk to be flashed. Do not use the one given in the twrp post if you are over android 12 and just have magisk fix it or patch it.
And multidisabler should be written in the terminal in twrp as it is included with twrp.

Jack Droid said:
Hi all,
I would like to try to flash a GSI butI'm not sure to have clearly understood the instruction given....
As I'm doing the first steps into flashing mods and to avoid to do a mess, can someone kindly better explain the flashing above and all stuff ?
Many many thanks !
Click to expand...
Click to collapse
I am going to write a new guide since this one was my first guide I've ever written and it is messy too.

If you still need help, reach me on tg. Https://t.me/xplanthris

Related

[UNOFFICIAL] TWRP for Lenovo Yoga Tab 3 Plus (YTX703F/YTX703L)

It has been bugging me for quite some time that the Lenovo Yoga Tab 3 Plus has a portrait (phone) 10" screen mounted in a landscape body, and TWRP didn't have the necessary code to adjust its graphics rendering so as to compensate for this, so I just decided to patch it myself.
With these unofficial recoveries (officials can be found here and here), you get the following improvements:
Graphics are rendered in the landscape orientation
Compiled from LineageOS 15.1 sources plus LineageTWRP => much easier to maintain
(For development) Pstore/ramoops active, can retrieve the Android kernel's log on reboot or panic
Mouse pointer in the middle of the screen is gone
Factory reset commands from Android are no longer broken
Removed their prompt to install the TWRP app in Android when you try to reboot
Also be aware that flashing unofficial cm14 zips is not supported with these TWRP images!
If any of the items above bug you as well, these TWRP builds may be for you. At the moment they are optional (not required - you may use other TWRP recoveries just as well) if you are a user of LineageOS 15.1 for YTX703F/YTX703L. However, in the future we will be making steps to replace the official TWRP recoveries with these ones over here.
Known issues
None so far.
Downloads
TWRP 3.2.3: [YTX703F (Wifi)] | [YTX703L (LTE)]
Installation instructions
If your device is new to the custom ROM flashing process, you need to unlock its bootloader:
Code:
fastboot oem unlock-go
If you are not fully decided and just want to try out these TWRP images, you can just hot-boot them into RAM, without writing them permanently to flash storage:
Code:
fastboot boot twrp-3.2.3-UNOFFICIAL-YTX703L.img
If you don't like it, it's not persistent (rebooting again will get you the old recovery back)
If you're sold on the new recovery image, here's how to permanently flash it:
Code:
adb reboot bootloader # Do this only if you're not in fastboot mode right now (with the orange Lenovo image)
fastboot flash recovery twrp-3.2.3-UNOFFICIAL-YTX703L.img
fastboot continue # Will boot into Android
Build instructions
Add the following to .repo/local_manifests/roomservice.xml in a lineage-15.1 tree:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="https://github.com/omnirom" name="omnirom" review="gerrit.omnirom.org" revision="android-8.1" />
<project groups="pdk" name="android_bootable_recovery" path="bootable/recovery-twrp" remote="omnirom" />
</manifest>
Run the following:
Code:
$ repo sync bootable/recovery-twrp
$ source build/envsetup.sh
$ repopick -P bootable/recovery-twrp -g https://gerrit.omnirom.org 31454
$ repopick -P bootable/recovery-twrp -g https://gerrit.omnirom.org 31630
$ repopick -P bootable/recovery-twrp -g https://gerrit.omnirom.org 28622
$ lunch lineage_YTX703L-eng
$ WITH_TWRP=true mka recoveryimage
$ adb reboot bootloader
$ fastboot boot out/target/product/YTX703L/recovery.img
vladimiroltean said:
It has been bugging me for quite some time that the Lenovo Yoga Tab 3 Plus has a portrait (phone) 10" screen mounted in a landscape body, and TWRP didn't have the necessary code to adjust its graphics rendering so as to compensate for this, so I just decided to patch it myself.
With these unofficial recoveries (officials can be found here and here), you get the following improvements:
Graphics are rendered in the landscape orientation
Compiled from LineageOS 15.1 sources plus LineageTWRP => much easier to maintain
(For development) Pstore/ramoops active, can retrieve the Android kernel's log on reboot or panic
Mouse pointer in the middle of the screen is gone
Factory reset commands from Android are no longer broken
Removed their prompt to install the TWRP app in Android when you try to reboot
Also be aware that flashing unofficial cm14 zips is not supported with these TWRP images!
If any of the items above bug you as well, these TWRP builds may be for you. At the moment they are optional (not required - you may use other TWRP recoveries just as well) if you are a user of LineageOS 15.1 for YTX703F/YTX703L. However, in the future we will be making steps to replace the official TWRP recoveries with these ones over here.
Known issues
None so far.
Downloads
TWRP 3.2.3: [YTX703F (Wifi)] | [YTX703L (LTE)]
Installation instructions
If your device is new to the custom ROM flashing process, you need to unlock its bootloader:
If you are not fully decided and just want to try out these TWRP images, you can just hot-boot them into RAM, without writing them permanently to flash storage:
If you don't like it, it's not persistent (rebooting again will get you the old recovery back)
If you're sold on the new recovery image, here's how to permanently flash it:
Click to expand...
Click to collapse
Can I also install this new recovery image using the twrp app instead adb?
Or can i try the new Image to execute the Codes directly in the tablet with the terminal emulator App instead connecting to the PC?
tombraga said:
Can I also install this new recovery image using the twrp app instead adb?
Click to expand...
Click to collapse
I've never used that, as I consider it bloatware. If it allows you to flash a local disk image (and not only ones downloaded from twrp.me) into the recovery partition, then I suppose you can. But then again, that'd require giving it root permissions, and I don't think I'd trust it that much just because I'm lazy.
vladimiroltean said:
I've never used that, as I consider it bloatware. If it allows you to flash a local disk image (and not only ones downloaded from twrp.me) into the recovery partition, then I suppose you can. But then again, that'd require giving it root permissions, and I don't think I'd trust it that much just because I'm lazy.
Click to expand...
Click to collapse
Thanks for Information, one more question:
Can i try the new Image to execute the Codes directly in the tablet with the terminal emulator App instead connecting to the PC?
I got some problem right now with my pc and cannot use it with my tablet
tombraga said:
Thanks for Information, one more question:
Can i try the new Image to execute the Codes directly in the tablet with the terminal emulator App instead connecting to the PC?
I got some problem right now with my pc and cannot use it with my tablet
Click to expand...
Click to collapse
You can try to do this:
Code:
su
dd if=/sdcard/Download/twrp-3.2.3-UNOFFICIAL-YTX703L.img of=/dev/block/bootdevice/by-name/recovery
sync
But keep in mind that interactive "su" sessions are kinda broken (tab completion, Ctrl-c and other stuff), this patch fixes that but its's not merged yet. So your mileage might vary. If you just cut and paste the commands (make sure they match your device though!) it should work.
vladimiroltean said:
You can try to do this:
But keep in mind that interactive "su" sessions are kinda broken (tab completion, Ctrl-c and other stuff), this patch fixes that but its's not merged yet. So your mileage might vary. If you just cut and paste the commands (make sure they match your device though!) it should work.
Click to expand...
Click to collapse
Thanks, but this is too hot for, better I wait and fix my pc first, thanks
At least perhaps a stupid question: can i flash your new twrp img directly from my actual official 3.2.0-0 twrp choosing install image and then your img.file?
tombraga said:
Thanks, but this is too hot for, better I wait and fix my pc first, thanks
At least perhaps a stupid question: can i flash your new twrp img directly from my actual official 3.2.0-0 twrp choosing install image and then your img.file?
Click to expand...
Click to collapse
There are countless ways you can do it, but like you said, it's not a good idea to reflash your recovery if you're don't have a plan B if anything goes wrong.
vladimiroltean said:
There are countless ways you can do it, but like you said, it's not a good idea to reflash your recovery if you're don't have a plan B if anything goes wrong.
Click to expand...
Click to collapse
i could fix my laptop now i made it with adb as you teached and explained, worked wityout any problems
I like very much the new TWRP, waiting so long for this landscape mode and without questions to install TWRP app.
Now i uninstall the TWRP app and have a very nice TWRP recovery which is fine for my Lenovo tablet, thank you so much.
Problem: no i cannot uninstall more the TWRP app, even tried with titanium pro, but could not find the system app was the message...
should i freez the twrp app now with titanium pro?
When your twrp will go official???? I hope soon.
---------- Post added at 05:21 PM ---------- Previous post was at 05:06 PM ----------
tombraga said:
i could fix my laptop now i made it with adb as you teached and explained, worked wityout any problems
I like very much the new TWRP, waiting so long for this landscape mode and without questions to install TWRP app.
Now i uninstall the TWRP app and have a very nice TWRP recovery which is fine for my Lenovo tablet, thank you so much.
Problem: no i cannot uninstall more the TWRP app, even tried with titanium pro, but could not find the system app was the message...
should i freez the twrp app now with titanium pro?
When your twrp will go official???? I hope soon.
Click to expand...
Click to collapse
made even a first backup right now with the new TWRP, without any problem and very fast. great!
tombraga said:
Problem: no i cannot uninstall more the TWRP app, even tried with titanium pro, but could not find the system app was the message...
should i freez the twrp app now with titanium pro?
Click to expand...
Click to collapse
If it really bothers you, I would wipe the system partition and install everything else all over again (LineageOS, the exact same Gapps package, etc).
tombraga said:
When your twrp will go official???? I hope soon.
Click to expand...
Click to collapse
Probably not very soon, hence the reason why I decided to release it unofficially for a while. I contacted the TWRP project maintainers and they said they're caught at the moment with other stuff (merging with Android P codebase) and they can't review my display rotation patch until that activity is finished. So we're probably talking about the timeframe when the first official TWRP and LineageOS builds based on Android P are going to get released.
vladimiroltean said:
If it really bothers you, I would wipe the system partition and install everything else all over again (LineageOS, the exact same Gapps package, etc).
Probably not very soon, hence the reason why I decided to release it unofficially for a while. I contacted the TWRP project maintainers and they said they're caught at the moment with other stuff (merging with Android P codebase) and they can't review my display rotation patch until that activity is finished. So we're probably talking about the timeframe when the first official TWRP and LineageOS builds based on Android P are going to get released.
Click to expand...
Click to collapse
It's ok, I can live with it.
I see two things in new version
1) graphical bug inside list of files (overlapping)
2) cannot access NTFS formatted sd-card (while older version working fine)
janforman said:
I see two things in new version
1) graphical bug inside list of files (overlapping)
2) cannot access NTFS formatted sd-card (while older version working fine)
Click to expand...
Click to collapse
1. Screenshot? (I think it's vol-up + power)
2. That might be my oversight on my part. NTFS is indeed not enabled in the kernel because Android uses the ntfs-3g FUSE implementation. I think that's not available in TWRP though.
vladimiroltean said:
1. Screenshot? (I think it's vol-up + power)
2. That might be my oversight on my part. NTFS is indeed not enabled in the kernel because Android uses the ntfs-3g FUSE implementation. I think that's not available in TWRP though.
Click to expand...
Click to collapse
I flashed older TWRP version and NTFS is working well. I'm using it for flashing and backup. In new version sdcard is not mounted and in "mount" option greyed out (i cannot select it).
I had an issue flashing a custom boot animation zip and font zip, they appeared to flash fine in recovery but the boot animation and font was not changed. I flashed the latest official TWRP and these zips flashed and took effect fine. No issues with ROM zip, gapps or magisk though
scoobyjenkins said:
I had an issue flashing a custom boot animation zip and font zip, they appeared to flash fine in recovery but the boot animation and font was not changed. I flashed the latest official TWRP and these zips flashed and took effect fine. No issues with ROM zip, gapps or magisk though
Click to expand...
Click to collapse
Can you give a link to the boot animation and font you flashed.
I know you are the graphics expert around here so will be nice if you can point us to some compatible boot animations for our device.
I really don't want to sound unappreciative but the Lineage 'stock' boot animation seriously needs a facelift
Finefeather said:
Can you give a link to the boot animation and font you flashed.
I know you are the graphics expert around here so will be nice if you can point us to some compatible boot animations for our device.
I really don't want to sound unappreciative but the Lineage 'stock' boot animation seriously needs a facelift
Click to expand...
Click to collapse
The animation is nothing to do with Lineage, but if you like Raphael of TMNT, feel free to try this: https://drive.google.com/open?id=0B260dxr9nvchTG0xR2pYelhuNHc
I have noticed that with an animation that fills more of the screen than the lineage logo, there seems to be a black overlay taking up about a 3rd of the screen at the right, which obscures my animation a little but only for a couple of seconds.
As I say, I can flash this with official TWRP but it doesn't seem to take with this one
This version of TWRP is unfortunately not compatible with GApps+Aroma. (The standard version works fine.)
Rueddi_ger said:
@vladimiroltean
How do I compile this TWRP? I found the twrp.mk in our devicetree/recovery directory. I pasted all flags to the end of BoardConfigCommon and the BoarConfig of the F/L version. It compiles well, but doesn't recognize those flags, I think. When I boot the img The touchscreen is completely inverted and is weird. Apart from that it isn't in landscape mode, but in portrait ( even thought the flags include TW_THEME := landscape_hdpi) Can you give me an idea where the problem is?
You can find my device tree here: Github
Click to expand...
Click to collapse
Added instructions in the top post.
Rueddi_ger said:
Actually I forgot to mention that I do not want to build TWRP exactly, but OrangeFox (which is based on TWRP). The problem is I cannot use the lineageOS tree, I think, because OrangeFox requires to be initialized with the minimal Omni manifest (see here: https://gitlab.com/OrangeFox/Manifest ). Do you have an idea what I can do?
Click to expand...
Click to collapse
What have you tried to do and what were the errors you were faced with?
Rueddi_ger said:
Apart from that it didn't seem to recognize any TWRP flags as the theme is not landscape, although I put those flags like everywhere
Click to expand...
Click to collapse
Hate to break it to you, but rotating the recovery framebuffer is an operation that is quite a bit more involved than setting "TW_THEME := landscape" (assuming that's what you were trying to say).
Did you even bother to look at the patches linked in the top post? What about this one:
Code:
From 2a8821faf98f8c26a88e9bbe8a8a6d31015b938b Mon Sep 17 00:00:00 2001
From: Vladimir Oltean <[email protected]>
Date: Tue, 3 Jul 2018 00:04:03 +0300
Subject: [PATCH] TW_HWROTATION: add flag to handle hardware-rotated display
panels
* The existence of TW_HWROTATION that implements this feature at the
level of calls to libpixelflinger API closely mirrors the existence of
ro.sf.hwrotation for surfaceflinger in LineageOS.
* A brute-force approach was previously attempted via the
BOARD_HAS_FLIPPED_SCREEN makefile flag. That code iterated over the
active display surface in a double-buffered setup, and performed a
"smart" memcpy from the UI drawing surface (gr_draw) onto the display
surface. The problem was that, without heavy loop optimizations, that
code could have never scaled for 90 and 270 degree rotation.
I tried and you could literally see the for loop with the naked eye
while the display surface was updating.
* That code is now gone, but support for BOARD_HAS_FLIPPED_SCREEN := true
is still there (now means TW_HWROTATION := 180).
* This patch relies on the assumption that it is impossibly difficult
and non-portable to rotate whole framebuffer display surfaces, in a
way that is not dependent upon the graphics backend (adf, fbdev, drm,
overlay etc). Therefore, it identifies the rendering primitives that
the TWRP graphics stack exposes to the GUI application above, and
implements hwrotation inside each of those calls instead:
- gr_line(), gr_fill() - 2D geometric shapes (lines, rectangles)
- gr_blit() - graphical image resources
- gr_ttf_textExWH() - font rendering
- gr_fb_width(), gr_fb_height() - framebuffer resolution
* The gist is to keep the backend and framebuffer (dimensions, row size
etc) unchanged (because making changes there is asking for trouble),
but present an altogether different reality to the calling API,
according to the compile-time constant TW_HWROTATION.
* All (x, y) API coordinates and shapes are transformed before being
actually rendered as (x_disp, y_disp) display coordinates.
* With TW_HWROTATION := 90 or 270 you can turn a landscape device into
a portrait one, because the GUI is fooled by the reversed dimensions
reported by gr_fb_width() and gr_fb_height() and renders the UI as
for a different device.
* For blit and text rendering operations, figuring out the transformed
coordinates in display space is not enough, as the surfaces that are
to be rendered have to be rotated themselves. This is handled by
allocating an intermediary rotated surface on each rendering
operation (not ideal), so the code with the intermediary surface
is compiled out for the TW_HWROTATION := 0 case.
* This is still not as bad as rotating the whole framebuffer though, and
on a msm8976 device the performance hit is not even noticeable (for
software rendering).
* Currently there is no attempt to make a connection between the
TW_HWROTATION and the { RECOVERY_TOUCHSCREEN_SWAP_XY,
RECOVERY_TOUCHSCREEN_FLIP_X, RECOVERY_TOUCHSCREEN_FLIP_Y } settings.
Change-Id: Ic8966ad5360c8a499649fdb16e242286640fd992
Signed-off-by: Vladimir Oltean <[email protected]>

[ROM][UNOFFICIAL][8.1.0][TB-X704F] LineageOS 15.1 for Lenovo Tab4 10 Plus

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Code:
/*
* I'm not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed (like it did for me...).
* Please do some research if you have any concerns about features included in the products you find here 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.
* Your warranty will be void if you tamper with any part of your device / software.
* Same statement for XDA.
*/
LineageOS is a free, community built, aftermarket firmware distribution of Android 8.1 (Oreo), 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. Linked below is a package that has come from another Android project that restore the Google parts. 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 out Gerrit Code Review.
What works:
Wifi
Bluetooth
Audio
LED
USB
RIL
Encryption
Fingerprint
Camera (partly)
Broken
Camera (autofocus & hdr)
Hall sensor
Selinux Enforcing
Source code:
device: https://github.com/yener90/android_device_lenovo_TBX704
kernel: https://github.com/yener90/android_kernel_lenovo_msm8953
vendor: https://github.com/yener90/android_vendor_lenovo_TBX704
Important
If you are using this ROM first time, wipe data. Wipe data completely. I mean the option where you need to enter "yes". Use this option and then flash the rom.
This ROM only works with the TWRP I added.
If you want to use GAPPS, flash it directly after flashing ROM. Don't let the ROM boot. Otherwise your device will not get certification, so you will not have Google Access.
Instructions (thx @matshias, just changed few lines to get ROM flashing working)
Put your ROM (and GApps) onto your sdcard (sdcard must be exfat or fat32, NTFS not supported)
Install fastboot and adb on your PC, e.g. from here
Enable developer options and in there select to unlock your bootloader by enabling OEM unlock and enable USB debugging
Connect your PC to your tablet and run
Code:
adb reboot bootloader
using adb on command line. The tablet will reboot into bootloader mode where you will only see the Lenovo logo. Now you use
Code:
fastboot oem unlock-go
to unlock. This will factory reset your device
Don't setup, cause you will need to format your tablet later again. Shutdown tablet. Hold volume up and power button to start to bootloader
Then run
Code:
fastboot flash recovery twrp-3.2.3-0-<your-filename>.img
to flash TWRP
Select with volume buttons "Recovery Mode" and press power button
Select to write to system, otherwise you can't flash ROM
Backup at least system and boot partitions to your sdcard cause you will wipe data in next step. Choose "System Image" for the system partition backup.
Format data using this tutorial
Flash ROM
Optionally flash SuperSU or Magisk in TWRP which should install system less. Keep OEM unlock enabled if you flash or modify anything
Restart
Download
2019-04-08
• changes to fingerprint
• changes to sdcard (careful those who are using sd card as internal)
• security updates: 2019-04-05
• updated TB-X704L fix file for fingerprint support
ROM
TB-X704L fix
TWRP
Older downloads
2019-04-05
• partly fixed camera (autofocus & hdr dont work), use Open Camera
• some debugging features disabled, should improve performance
ROM
2019-03-30
• fixed fingerprint
• first attemps fixing camera (will take longer than expected...)
ROM
2019-03-27
• intital release
ROM
Optional downloads
Dolby Digital Plus (use the TWRP one)
GAPPS (use 8.1 arm64; I suggest using pico variant)
Thanks
@highwaystar_ru (he gave me the important hint, also used his sources and his thread )
@LumenReaper (for his work with CM14.1, where I took big part of his device tree :fingers-crossed
@Flowah123 for the TB-X704L files :fingers-crossed:
Donations
For donations you can click here
Thanks to @rorzer, @Preyer11, @Tschumi, @MrMagic, @max_work & 5 x anonymous
Please don't support Lenovo and buy their tablets
Code:
[I]Updates vary depending on the model where our tablets receive Android and security updates after the introduction.
We announced Tab 4 10 Plus in February 2017 and since then it has received seven OTA updates.
However, this model has reached the end of its update cycle and will not receive any more updates in the future.
- Lenovo (2018-05-11)[/I]
Just seven updates and not even one major upgrade, please don't support them.
Reporting bugs
Please tell what mods you are using and what tablet variant (TB-X704F or L or ABCDEFGH..)
If your tablet doesnt start:
go to TWRP. use file manager, go to sys/fs/pstore, copy the files and upload it here.
if your tablet starts and bug appears later:
go to TWRP. use file manager, go to sys/fs/pstore, copy the files
start your tablet normal, let the bug appear, enter adb root
use adb logcat and adb shell dmesg, copy the content to a text file and upload here
XDA:DevDB Information
[ROM][UNOFFICIAL][8.1.0][TB-X704F] LineageOS 15.1 for Lenovo Tab4 10 Plus, ROM for the Lenovo Thinkpad Tablet
Contributors
yener90
ROM OS Version: 8.x Oreo
Version Information
Status: Testing
Created 2019-03-27
Last Updated 2019-05-13
The system itself runs very well. Also TWRP is very nice in landscape.
Maybe some notes after a short test phase, because your post is not so detailed yet.
Works:
- Encryption (forceencrypt is enabled)
- Clearly better audio quality than in Lineage 14.1 (Yener has already made me aware of my mistake)
- Significantly newer kernel (3.18.115 instead of 3.18.31)
Broken:
- Hall sensor
- selinux (for completeness only)
All in all very good rom. Thank you Yener!
Great work guys! I am waiting for the fingerprint to get fixed and then installing asap.
ROM loaded and running with no problems so far so thanks to @yener90, also thanks to @LumenReaper for starting the whole ball rolling. one thing I noticed is after doing Format data and wiping system, data and the caches i'm re-encrypted, it's not a major problem though, when i do another update in the future i'll format data again and see if encryption goes away
---------- Post added at 04:38 PM ---------- Previous post was at 04:38 PM ----------
ROM loaded and running with no problems so far so thanks to @yener90, also thanks to @LumenReaper for starting the whole ball rolling. one thing I noticed is after doing Format data and wiping system, data and the caches i'm re-encrypted, it's not a major problem though, when i do another update in the future i'll format data again and see if encryption goes away
peterCR56 said:
ROM loaded and running with no problems so far so thanks to @yener90, also thanks to @LumenReaper for starting the whole ball rolling. one thing I noticed is after doing Format data and wiping system, data and the caches i'm re-encrypted, it's not a major problem though, when i do another update in the future i'll format data again and see if encryption goes away
Click to expand...
Click to collapse
This rom has force encrypt enabled, so it will not go away
LumenReaper said:
This rom has force encrypt enabled, so it will not go away
Click to expand...
Click to collapse
good to know, i thought i missed something
:victory: finally
Thank you for doing this!!!
Thank you for working on this device!!! I thought the Tab 4 10 Plus I imported for Korea was never going to see another update after I read the news awhile back. I took the plunge and installed TWRP and rooted my device tonight. I can't wait to get Oreo or even Pie installed on my tablet in the future!
First off, very well done @yener90 and @LumenReaper, thank you.
Am I correct in thinking that if I flash this to my TB-X704V it should work except for the SIM functions ?
Also are Gapps included?
TIA
Sparkrite said:
First off, very well done @yener90 and @LumenReaper, thank you.
Am I correct in thinking that if I flash this to my TB-X704V it should work except for the SIM functions ?
Also are Gapps included?
Click to expand...
Click to collapse
I'm not sure, if X704V works. Try to boot from the recovery, I uploaded, from your pc.
For this switch to bootloader mode and enter fastboot boot twrp.img
If you get on your screen an error like: no dtb found, than your device requires special fix.
Don't try it out then.
yener90 said:
I'm not sure, if X704V works. Try to boot from the recovery, I uploaded, from your pc.
For this switch to bootloader mode and enter fastboot boot twrp.img
If you get on your screen an error like: no dtb found, than your device requires special fix.
Don't try it out then.
Click to expand...
Click to collapse
Cheers, for fast reply.
I'll certainly try that out later today and let you know.
EDIT:
Just tried it and booted to your TWRP just fine, nice landscape view BTW.
All appears OK, but while it "saw" the ext SD I couldn't explore it but I could the explore the internal SD.
Just one thing, when I went to exit by rebooting to system, it crashed and just hung there.
Sparkrite said:
Cheers, for fast reply.
I'll certainly try that out later today and let you know.
EDIT:
Just tried it and booted to your TWRP just fine, nice landscape view BTW.
All appears OK, but while it "saw" the ext SD I couldn't explore it but I could the explore the internal SD.
Just one thing, when I went to exit by rebooting to system, it crashed and just hung there.
Click to expand...
Click to collapse
Thats normal. Install twrp and boot to recovery. There it will never freeze.
Try it out. Before you do copy your system files to your pc. Maybe for your device some files are required.
Just one more thing, as I said, does the ROM have Gapps already installed?
TIA
Sparkrite said:
Just one more thing, as I said, does the ROM have Gapps already installed?
TIA
Click to expand...
Click to collapse
Nope
UPDATE
Download
2019-03-30
• fixed fingerprint
• first attemps fixing camera (will take longer than expected...)
ROM Download
I'm thinking on buying this tablet, but I've heard that the 5ghz wifi has some dropouts. Have anyone test it out with this rom with iperf? (Wifi Speed Test app for example)
Also I'm interested to know what issues have been found with the fingerprint. (1 minute before the dev solved it)
MiSSigNNo said:
I'm thinking on buying this tablet, but I've heard that the 5ghz wifi has some dropouts. Have anyone test it out with this rom with iperf? (Wifi Speed Test app for example)
Also I'm interested to know what issues have been found with the fingerprint.
Click to expand...
Click to collapse
Don't buy it please.
Don't support Lenovo. That ******* dont care about their customers.
I just developed that rom, to show that ****** that its not hard to build an Oreo ROM for this nice tablet.
yener90 said:
Don't buy it please.
Don't support Lenovo. That ******* dont care about their customers.
I just developed that rom, to show that ****** that its not hard to build an Oreo ROM for this nice tablet.
Click to expand...
Click to collapse
What would you recommend instead?
I come from a CHUWI Hipad that was a complete disaster: really hard to even create a TWRP
I've been looking for other alternatives and essentially we have:
Huawei and Kirin: 0% development with closed Kirin processors
Samsung/LG/Asus/Xiaomi: The cheapest with 3Gb goes for over $250 (there aren't many brands with cheap tablets in fact)
Chuwi, Teclast, ... all are **** brands with Mediatek processors that are even worse than Kirin for dev purposes.
So essentially for under $200 with 3Gb+ RAM there is only one Snapdragon tablet called Lenovo Tab4 10 Plus
But the only issue I've found so far reading reviews are the dropouts with 5Ghz WIFI AC band.
MiSSigNNo said:
What would you recommend instead?
I come from a CHUWI Hipad that was a complete disaster: really hard to even create a TWRP
I've been looking for other alternatives and essentially we have:
Huawei and Kirin: 0% development with closed Kirin processors
Samsung: The cheapest with 3Gb goes for over $250
Chuwi, Teclast, ... all are **** brands with Mediatek processors that are even worse than Kirin for dev purposes.
So essentially for under $200 with 3Gb+ RAM there is only one Snapdragon tablet called Lenobo Tab4 10 Plus
But the only issue I've found so far reading reviews are the dropouts with 5Ghz WIFI AC band.
Click to expand...
Click to collapse
Hehehe I also had a Chuwi Tablet and was a disaster . 5GHz was solved with latest update.
Xiaomi Mi Pad 4 Plus sounds nice for me. Xiaomi also has a much better support. It came out after my Lenovo Tablet. If that would be available than, I would buy Xiaomi.
Thanks for this. Great job.
Can we have R/W system? AdAway freezes when trying to overwrite system hosts file. Basically I would be happy with your first release supporting hosts file linked to other path either even without fingerprint or camera support.
yener90 said:
Hehehe I also had a Chuwi Tablet and was a disaster . 5GHz was solved with latest update.
Xiaomi Mi Pad 4 Plus sounds nice for me. Xiaomi also has a much better support. It came out after my Lenovo Tablet. If that would be available than, I would buy Xiaomi.
Click to expand...
Click to collapse
Yeah, I like Xiaomi Mi Pad 4 Plus, the problem is that the cheapest in my country is for $400, if I buy in Aliexpress it goes for nearly $300... and I found this tablet for just $180 (half the price!) in Amazon
I understand that most brand OS support is **** (including Samsung), and I definitely have a Xiaomi Pocophone F1 because they have a really great support not only in ROM dev, but good prices for replacements (screens and all that).
But If they have solved the 5Ghz issue, then I believe that we should even try in the future to go for official Lineage 16 as they did on the oldie Yoga Tab 3 Plus

[GUIDE] Re-locking the bootloader on the OnePlus 6t with a self-signed build of LOS

What is this tutorial?
This tutorial will:
Creating an unofficial build of LineageOS 17.1 suitable for using to re-lock the bootloader on a OnePlus 6/6t
Take you through the process of re-locking your bootloader after installing the above
This tutorial will NOT:
Remove *all* warning messages during boot (the yellow "Custom OS" message will be present though the orange "Unlocked bootloader" message will not)
Allow you to use official builds of LineageOS 17.1 on your device with a re-locked bootloader (more details near the end of the tutorial)
This tutorial will assume you are working on an Ubuntu 18.04 installation, if you are using Windows or another Linux distro, the commands may be different.
Supported devices:
Current both the OnePlus 6 (enchilada) and 6t (fajita) have been tested, but newer phones should work as well.
For simplicities sake, all further references will only be to the 6t (fajita).
Pre-requisites:
a mid level knowledge of terminal commands and features
a supported phone
a PC with enough CPU/RAM to build LineageOS 17.1 (recommended 8 cores, 24g of RAM)
a working USB cable
fastboot/adb installed and functional
LineageOS 17.1 source code downloaded
at least one successful build of LineageOS
at least one successful signing of your build with your own keys
Misc. notes:
the basics of building/signing of LineageOS is outside the scope of this tutorial, refer to the LineageOS Wiki for details on how to complete these tasks
you'll be modifying some code in LineageOS, so if you are not comfortable using basic editing utilities as well as patch, do not proceed any further
the path to your LineageOS source code is going to be assumed to be ~/android/lineageos, if it is somewhere else, substitute the correct path in the tutorial
the path to your private certificate files is going to be assumed to be ~/android-certs, if it is somewhere else, substitute the correct path in the tutorial
*** WARNING ****
This process may brick your device. Do not proceed unless you are comfortable taking this risk.
*** WARNING ****
This process will delete all data on your phone! Do not proceed unless you have backed up your data!
*** WARNING ****
Make sure you have read through this entire process at least once before attempting, if you are uncomfortable with any steps include in this guide, do not continue.
And now on with the show!
Step 1: Basic setup
You need a few places to store things, so create some working directories:
Code:
mkdir ~/android/fajita
mkdir ~/android/fajita/oos
mkdir ~/android/fajita/images
mkdir ~/android/fajita/images_raw
mkdir ~/android/fajita/patches
mkdir ~/android/fajita/pkmd
You also need to add "~/android/lineageos/out/host/linux-x86/bin" to your shell's profile path. Make sure to close and restart your session afterwards otherwise the signing will fail later on with a "file not found" error message .
Step 2: Download the latest OxygenOS from OnePlus
Go to https://www.oneplus.com/support/softwareupgrade and download the latest OOS update, store it in ~/android/fajita/oos
Step 3: Extract the vendor.img from OOS
Run the following commands to extract the vendor.img from OOS:
Code:
cd ~/android/fajita/oos
unzip [oos file name you downloaded] payload.bin
cd ../images_raw
python ~/android/lineageos/lineage/scripts/update-payload-extractor/extract.py --partitions vendor --output_dir . ../oos/payload.bin
You should now have a ~1g file named vendor.img in the images_raw directory.
Step 4: Update fajita's BoardConfig.mk
You will need to add a few parameters to the end of ~/android/lineageos/device/oneplus/fajita/BoardConfig.mk, they are:
Code:
BOARD_PREBUILT_VENDORIMAGE := /home/<userid>/android/fajita/images_raw/vendor.img
AB_OTA_PARTITIONS += vendor
BOARD_AVB_ALGORITHM := SHA256_RSA2048
BOARD_AVB_KEY_PATH := /home/<userid>/.android-certs/releasekey.key
Note you cannot use "~"" in the path names above to signify your home directory, so give the full absolute path to make sure the files are found.
Step 5: Update sdm845-common's BoardConfigCommon.mk (optional)
LineageOS by default disables Android Verified Boot's partition verification, but you can enable it now as all the required parts will be in place. However, you may not want to if you intend to make other changes to the system/boot/vendor partitions (like Magisk, etc.) after you have re-locked the bootloader.
To enable partition verification do the following:
Code:
cd ~/android/lineageos/devices/sdm845-common
sed -i 's/^BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flag 2/#BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flag 2/' BoardConfigCommon.mk
Step 6: Patch the AOSP/LineageOS releasetools
Two releasetools included with LineageOS need to be patched as they otherwise will not properly process a pre-built vendor.img.
The required patches can be found here:
https://raw.githubusercontent.com/W.../source/add_img_to_target_files.py-17.1.patch
https://raw.githubusercontent.com/W...r/source/sign_target_files_apks.py-17.1.patch
Download both and store in ~/android/fajita/patches.
Now apply them with the following commands:
Code:
cd ~/android/lineageos/build/tools/releasetools
patch add_image_to_target_files.py ~/android/fajita/patches/add_image_to_target_files.py-17.1.patch
patch sign_target_files_apks.py ~/android/fajita/patches/sign_target_files_apks.py-17.1.patch
Step 7: Build LineageOS
You are now ready to build:
Code:
cd ~/android/lineageos
source build/envsetup.sh
croot
breakfast fajita
mka target-files-package otatools
Step 8: Prepare vendor.img
As part of the build process above, your raw vendor.img will been copied to the $OUT directory and a new hashtree (what AVB uses to verify the image) will have been added to it.
You need to use this new version in the signing process but due to how the build system works, this is not done by default.
So, let's put it where it is needed:
Code:
cp $OUT/obj/PACKAGING/target_files_intermediates/lineage_fajita-target_files-eng.*/IMAGES/vendor.img ~/android/fajita/images
Step 9: Sign the APKs
You are now ready to sign the apks with sign_target_files_apks:
Code:
./build/tools/releasetools/sign_target_files_apks -o -d ~/.android-certs --prebuilts_path ~/android/fajita/images $OUT/obj/PACKAGING/target_files_intermediates/*-target_files-*.zip signed-target_files.zip
Note the new "--prebuilts_path" option, which points to where your new vendor.img file is located.
Step 10: Build the OTA
Now it is time to complete the OTA package:
Code:
./build/tools/releasetools/ota_from_target_files -k ~/.android-certs/releasekey --block signed-target_files.zip lineage-17.1-[date]-UNOFFICIAL-fajita-signed.zip
Note, replace [date] with today's date in YYYYMMDD format.
Step 11: Create pkmd.bin for your phone
Before you can lock your phone, you have to tell it what your public key is so it knows it can trust your build.
To do this you need to create a pkmd.bin file:
Code:
~/android/lineageos/external/avb/avbtool extract_public_key --key ~/.android-certs/releasekey.key --output ~/android/fajita/pkmd/pkmd.bin
Step 12: Flashing your LineageOS build
It's time to flash your build to your phone. The following steps assume you have already unlocked your phone and have flashed an official version of LineageOS to it. You don't need to have flashed LineageOS yet, you could use TWRP through "fastboot boot" if you prefer.
Reboot your phone in to recovery mode
In LineageOS Recovery select "Apply update"
From your PC, run:
Code:
adb sideload ~/android/lineageos/lineage-17.1-[date]-UNOFFICIAL-fajita-signed.zip
When the sideload is complete, reboot in to LineageOS. Make sure everything looks good with your build.
You may also need to format your data partition at this time depending on what you had installed on your phone previously.
Step 13: Flashing your signing key
Now it's time to add your signing key to the Android Verified Boot process. To do so, do the following:
Reboot your phone in to fastboot mode
From your PC, run:
Code:
fastboot flash avb_custom_key ~/android/fajita/pkmd/pkmd.bin
fastboot reboot bootloader
fastboot oem lock
On your phone, confirm you want to re-lock and it will reboot
Your phone will then factory reset and then reboot in to LineageOS.
Which of course means you have to go through the first time setup wizard, so do so now.
Step 14: Disable OEM unlock
Congratulations! Your boot loader is now locked, but you can still unlock it again using fastboot, so it's time to disable that as well.
Unlock you phone and go to Settings->About phone
Scroll to the bottom and find "Build number"
Tap on it you enable the developer options
Go to Settings->System->Advanced->Developer options
Disable the "OEM unlocking" slider
Reboot
Step 15: Profit!
Other things
The above will build a standard USERDEBUG version of LineageOS, however this will still allow LineageOS Recovery to sideload non-signed files. If you have implemented step 5 above, then this protects your system/vendor/boot/dtbo partitions, but none of the others. Likewise USERDEBUG builds will allow for rolling back to a previous version. To increase security and disallow both of these scenarios you may want to build a USER version of LineageOS to install. However this brings in other issues, such as flashing newer firmware from OnePlus so make sure you understand the implications of both choices. For more details on build types, see https://source.android.com/setup/develop/new-device#build-variants.
In the above example the releasekey from your LineageOS install has been used to sign AVB, but AVB supports other key strengths up to SHA512_RSA8192. You could create a key just for signing AVB that used different options than the default keys generated to sign LineageOS.
If you want to remove you signing key from your phone, you can do it by running "fastboot erase avb_custom_key".
The changes you made to the make files and releasetools may conflict with future updates that you pull from LineageOS through repo sync, if you have to reset the files to get repo sync to complete successfully, you'll have to reapply the changes afterwards.
So why can't I do this with official LineageOS builds?
For Android Verified Boot (AVB) to work, it must have the hash values for each of the system/vendor/boot/dtbo partitions stored in vbmeta. Official LineageOS builds do not include the vendor.img in them (for fajita at least, other phones may), instead simply using the existing partition on the phone.
That means that there is no vendor.img information in vbmeta for the official builds, which means AVB will fail to verify it during boot and give the red corruption message and halt the boot process after you have re-locked the bootloader.
And since you cannot add to vbmeta without the LineageOS private key, which only the LineageOS signing server has, you cannot add it.
This means you must do a full build with new signing keys to make it work.
Theoretically you could pick apart a LineageOS release, rehash the system/vendor/boot/dtbo and then recreate vbmeta and the payload.bin file, but that brings a host of other issues. For example, since such a "build" would look like a full LinageOS release, if you ever accidentally let the updater run it would brick (soft) that slot and you'd have swap back to your other slot to boot again. In an extreme case, if you managed to corrupt the second slot somehow you'd have to wipe your entire and recover from the brick with one of the available tools to do so.
Ok, what messages do I see during the boot process then?
During a boot you will of course see the standard OnePlus power up screen, followed by the yellow "custom os" message an then the stardard LineageOS boot animation.
For more details on AVB boot messages, see https://source.android.com/security/verifiedboot/boot-flow
So what do those two patches to the release tools do?
AOSP/LineageOS's add_image_to_target_files.py detects if a vendor.img file already exists, and if so, simply includes it in the build process. The patch adds one extra step, so that AVB is being enabled for the build, it will replace the existing hashtree on vendor.img using the same salt and other options as will be used on system/boot/dtbo. This ensure that when vbmeta is generated, it has the right information from vendor.img.
The script is called from the make system as part of the "mka target-files-package otatools" and the appropriate parameters from the make system, like "BOARD_PREBUILT_VENDORIMAGE", are used to create arguments to the script to build the standard image files as well as include the prebuilt vendor.img.
This script is used both during the initial build as well as the signing process, but this change is only targeted at the build time implementation. During signing, the script uses whatever hashtrees are in place and does not regenerate them.
AOSP/LineageOS's sign_target_files_apks.py is responsible for signing the APKs that have been built as part of "mka target-files-package otatools", unfortunately it is not part of the "make" system, so settings like "BOARD_PREBUILT_VENDORIMAGE" do not impact the script. This means that sign_target_files_apks.py does not have any knowledge that it should be including a pre-built vendor.img, even though it is in the $OUT directory waiting to be used.
The patch adds a new parameter to the script (--prebuilts_path), so that during the signing process, any image files found in the provided path, will be included in the process. So make sure that only vendor.img is in the provided directory. This is a directory instead of a single file as future uses may be to include things like firmware, other partition types, etc. in to the signing process.
Thank you's
Obviously to all of the members of the LineageOS team!
LuK1337 for supporting fajita
optimumpro for the OnePlus 5/5t re-locking guide (https://forum.xda-developers.com/oneplus-5/how-to/guide-relock-bootloader-custom-rom-t3849299) which inspired this one
Quark.23 for helping with the process and testing on enchilada
Nice , Will this enable widewine L1?
jsidney96 said:
Nice , Will this enable widewine L1?
Click to expand...
Click to collapse
I don't believe there is a connection between the two.
WhitbyGreg said:
I don't believe there is a connection between the two.
Click to expand...
Click to collapse
If you unlock bootloader on phones supporting L1 they drop to L3. I know some Oneplus phones (op6 etc.) did not support L1 even on stock.
cowgaR said:
If you unlock bootloader on phones supporting L1 they drop to L3. I know some Oneplus phones (op6 etc.) did not support L1 even on stock.
Click to expand...
Click to collapse
Yeah.. It brings it to L1
Great writeup @WhitbyGreg
As Android security gets tighter and tighter, hoping one day all ROMs would support AVB by default..
---------- Post added at 06:16 PM ---------- Previous post was at 05:48 PM ----------
Curious question here,
WhitbyGreg said:
*** will build a standard USERDEBUG version of LineageOS, however this will still allow LineageOS Recovery to sideload non-signed files. If you have implemented step 5 above, then this protects your system/vendor/boot/dtbo partitions, but none of the others. Likewise USERDEBUG builds will allow for rolling back to a previous version. To increase security and disallow both of these scenarios you may want to build a USER version of LineageOS to install. However this brings in other issues, such as flashing newer firmware from OnePlus so make sure you understand the implications of both choices***
Click to expand...
Click to collapse
After a launch of any phone, how drastic are such firmware updates to bother about? In other words, Unless we're in stock ROM is it mandatory to update phone firmware?
arvindgr said:
Yeah.. It brings it to L1
Click to expand...
Click to collapse
Good to know.
arvindgr said:
Great writeup @WhitbyGreg
As Android security gets tighter and tighter, hoping one day all ROMs would support AVB by default..
Click to expand...
Click to collapse
That would be nice but more importantly, more phones need to support re-locking.
arvindgr said:
Curious question here,
After a launch of any phone, how drastic are such firmware updates to bother about? In other words, Unless we're in stock ROM is it mandatory to update phone firmware?
Click to expand...
Click to collapse
Reasonably important, after all, if you never get firmware updates you'll have outdated security patching for the firmware. Some official LOS builds require newer versions of the firmware as they are released and won't install without it.
This guide was very helpful to me when re-locking my Oneplus 7T and enabling hash/hashtree verification. A dude on telegram had actually sent me the link and I only briefly skimmed over. Ironically when looking for patches to fix my issues after attempting to include pre-built vendor/odm and failing I cross referenced and ended up back here.
Here's where I originally found them:
https://review.lineageos.org/c/LineageOS/android_build/+/278015
https://review.aosip.dev/c/AOSIP/platform_build/+/13385
I myself have made some more patches to ensure every possible pre-built image gets signed on my builds. After some experimentation I have found it possible to have Magisk with hash verification enabled
https://github.com/Geofferey/omni_android_build/commits/geofferey/android-10
There is also a fix to ensure appropriate args get passed when regenerating hashtree for pre-built vendor.
Geofferey said:
This guide was very helpful to me when re-locking my Oneplus 7T and enabling hash/hashtree verification.
Click to expand...
Click to collapse
So you can confirm you have relocked the bootloader on the 7T with AVB enabled?
Geofferey said:
A dude on telegram had actually sent me the link and I only briefly skimmed over. Ironically when looking for patches to fix my issues after attempting to include pre-built vendor/odm and failing I cross referenced and ended up back here.
Here's where I originally found them:
https://review.lineageos.org/c/LineageOS/android_build/+/278015
https://review.aosip.dev/c/AOSIP/platform_build/+/13385
Click to expand...
Click to collapse
Yes, those are my patches that I've submitted to LOS, I also have two other patches submitted to allow for other prebuilt images (aka firmware images) to be included in the build process.
Geofferey said:
I myself have made some more patches to ensure every possible pre-built image gets signed on my builds. After some experimentation I have found it possible to have Magisk with hash verification enabled
https://github.com/Geofferey/omni_android_build/commits/geofferey/android-10
There is also a fix to ensure appropriate args get passed when regenerating hashtree for pre-built vendor.
Click to expand...
Click to collapse
I'll take a look and see if I need to update any of my submissions, thanks.
I will have to update those commits with you as author. I messed that up and set person who picked yours as author. I am sorry. BTW thank you for those patches they were a lifesaver and inspired me.
Yes, I can confirm re-lock with AVB enabled on 7T works and also with hash verification. If I flash an image not signed by the build process with hash verification enabled I go red. Currently I am working on getting magisk directly integrated with build instead of using prebuilt patched imgs that cause builds to not pass CTS.
Geofferey said:
Currently I am working on getting magisk directly integrated with build instead of using prebuilt patched imgs that cause builds to not pass CTS.
Click to expand...
Click to collapse
Why do you want to put Magisk if you went to all the trouble of having avb with a locked bootloader? Isn't rooting defeating the purpose of avb?
quark23 said:
Why do you want to put Magisk if you went to all the trouble of having avb with a locked bootloader? Isn't rooting defeating the purpose of avb?
Click to expand...
Click to collapse
No, it does not defeat the purpose... Hashtree verification will still happen since root can be included in the build as opposed to flashing after the fact. In a way it's actually even more advised. The way I think, having root may lead to a means of being exploited but true AVB closes the door to any persistent rootkits that may try to modify partitions at block level. If ANYTHING modifies the verified partitions phone will refuse to boot and I will be protected. Doing exactly what AVB is supposed to do, verify the phone is in it's intended state. I also think of phone as a computer, you have root access on Linux, Windows and even Mac for Christ sake, why shouldn't it be the same for phones? The ONLY reason we don't by default is so manufacturers and carriers can stay in control. I've been rooting and modifying phones for years without AVB and yet to have a known breech of my data besides the Google apps constantly collecting on me. This just adds another level of security that I used to sacrifice in order to have root access.
Here is my PoC to include Magisk in builds so dm-verity can be kept enabled. Just two commits. If someone could make this better that would be really cool.
https://github.com/Geofferey/omni_android_build/commit/d60958780e6b26d7cb0cec5939b82df3df74a68f
https://github.com/Geofferey/android_vendor_magisk
I have rooted for testing and you don't gen any warning. The way avb works on my phone is it discards any modification after reboot. With no warning at boot time. If you get hacked, you can have persistent hacks with root. Make a modification from twrp with avb enabled and see for yourself.
You break the Android security model by rooting the phone. If you need certain things you can include them at build time, such as a custom hosts file.
Also, what can you do with root that does not alter the hashtree?
The power you mention is of no real use yet you expose yourself by having it. Sure, you can go by without any issues. The problem is if you happen to get hacked, the attacker has full control over your phone. You won't br able to get rid of it by rebooting.
Also I see no way for google to collect data in this setup, with or without root. Afwall has an equivalent in android 10 (that mobile data & wifi setting) and inter process comms are the real issue if you are worried about rogue apps. Afwall leaks dns requests like crazy anyway.
I say you are better off letting root go and include what you need at build time. I see that as better spent effort than trying to add root.
quark23 said:
I have rooted for testing and you don't gen any warning. The way avb works on my phone is it discards any modification after reboot. With no warning at boot time. If you get hacked, you can have persistent hacks with root. Make a modification from twrp with avb enabled and see for yourself.
Click to expand...
Click to collapse
So you built your ROM from source with root included, had TWRP go through signing and was able to modify system and other partitions without receiving a device corrupt message? I highly doubt AVB is even implemented appropriately if you were able to do so. If it is implemented it sounds like the old version, tho I remember if I violated FS too much it wouldn't be able to fix and failed to boot. Having a locked bootloader because AVB is enabled does not mean dm-verity is enabled. Also, it should be nearly impossible to just write things like files to /system or w.e. if you are on a device that ships with 10.
quark23 said:
You break the Android security model by rooting the phone. If you need certain things you can include them at build time, such as a custom hosts file.
Click to expand...
Click to collapse
I know it does, but I am not doing such small things as modifying a host file. The kinds of things I include in my personal ROMs require such a high level of access to the point where I can not write SE polices that will allow me to pass CTS and spit out user builds without serious modifications to the build env.
quark23 said:
Also, what can you do with root that does not alter the hashtree?
The power you mention is of no real use yet you expose yourself by having it. Sure, you can go by without any issues. The problem is if you happen to get hacked, the attacker has full control over your phone. You won't b able to get rid of it by rebooting.
Click to expand...
Click to collapse
The act of flashing Magisk is what breaks AVB, if you include it in the ROM at build time like I am doing then it doesn't need to be flashed. It makes modifications to the system by binding data from the wipeable data partition to /system/. If something utilizes that to install a backdoor or tunnel it goes bye-bye when I wipe. If something utilizes it to flash anything or modify system device no boot.
quark23 said:
Also I see no way for google to collect data in this setup, with or without root. Afwall has an equivalent in android 10 (that mobile data & wifi setting) and inter process comms are the real issue if you are worried about rogue apps. Afwall leaks dns requests like crazy anyway.
Click to expand...
Click to collapse
You're kidding right? Android solely exist as a mean for Google to collect data. That was the whole idea behind Android. Buy & develop an OS that any manufacturer can put on their device, let them certify for Google Play Services and collect the data that powers their ad platform. They certainly didn't opensource their baby for free. If you allow ports 80 and 443 out with inbound related allowed, that's all they need.
quark23 said:
I say you are better off letting root go and include what you need at build time. I see that as better spent effort than trying to add root.
Click to expand...
Click to collapse
I'd just rather the manufactures and Google would implement a root solution that plays nice with Androids security instead of making us resort to violating it. It's funny to me that we find it acceptable for these fools to maintain control of something you purchased with your hard earned dollars because they think we are too stupid to have it. Like I stated root and admin privileges are fully available to us on nearly any PC but phones for some reason are an exception.
_________________________________________________
I could rant and debate about this forever... Fact of matter is, you don't have to disable every Android security feature to have root.
I didn't build with magisk, I just flashed after building.
But you can try and modify anything on /system or /vendor from twrp, without magisk, without locking the bootloader, and see what happens. Avb discards the modification, but doesn't warn you. Curious of your findings regarding this. If you then flash magisk, you ofc break the hashtree and avb and the mods remain persistent.
I understand that you are building with magisk included in the hashtree. What I am wondering is what exactly are you wanting root for? What are you doing with root that does not break the hashtree?
Regarding the data collection, you lost me. What exactly is being collected on a LOS userbuild without google services? Got any dns logs or mitm wireshark packets to show? What service exactly is collecting what kind of data? Google's dns servers can be replaced before building, Greg has some scripts for that. Captive portal can also be replaced or turned off. Apart from that, and any apps you add yourself, what kind of data is being collected as I want to check it out myself. I've monitored my phone and it's pretty silent. Whatever goes out is from additional apps I use. But I don't see anything from LOS. Really curious about this.
Regarding your last point I think it's something akin to risking shooting yourself in the foot by having root by default. I understand (somewhat) the security model and I find it smart to not have it by default. Also Android uses selinux more than your standard linux distro does. There are some differences in the security models between android and pc linux distro.
I'm really hapoy that AOSP exists. Also pretty happy with the LOS project. My problem is with the outdated blobs. Maybe I'll get a Pixel at some point and give GrapheneOS a go. Seems like a really nice project.
Managed to get hardened malloc + Vanadium on LOS atm and I'm liking the browser. Overall I think AOSP is a great project. Not a fan of google's privacy policy but they do make great stuff.
quark23 said:
I understand that you are building with Magisk included in the hashtree. What I am wondering is what exactly are you wanting root for? What are you doing with root that does not break the hashtree?
Click to expand...
Click to collapse
Ah, there lies the real question. I am including in my personal builds a Debian Linux chroot that gets extracted to /data/ so I can run Linux services, etc. I have customized the chroot with Openvpn so that it connects to my server and essentially allows me back into device wherever it may lay. Basically I am adding in the stuff of nightmares that all this security is supposed to prevent. That is why I want dm-verity, because I know I am leaving my self partially open by doing so. I have a decent understanding of dm-verity and have confirmed that it does and will protect me against the scenarios I imagine. BTW it operates completely differently in locked state vs. unlocked.
quark23 said:
Regarding the data collection, you lost me. What exactly is being collected on a LOS userbuild without google services?
Click to expand...
Click to collapse
Well, if you're the type of person who doesn't require Google Play Services, nothing of course. I was merely stating that Google had open sourced Android in hopes that manufacturers would adopt the OS and qualify their devices for Google PS so that it could be used as a data collection platform. You won't easily see all the information Google collects in a Wireshark log because it is encrypted of course. LOS better be silent as hell without it or I'd contact that dev with a strongly worded message lmfao.
quark23 said:
Regarding your last point I think it's something akin to risking shooting yourself in the foot by having root by default. I understand (somewhat) the security model and I find it smart to not have it by default. Also Android uses selinux more than your standard linux distro does. There are some differences in the security models between android and pc linux distro.
Click to expand...
Click to collapse
Oh I DO NOT think it should just be enabled by default. If I had my way it would be enabled in dev ops requiring authentication and protected via a different password than the one you use to unlock the device once setup. You'd also require those "root" privileges to OEM unlock once enabled. While those features were enabled you'd be warned on boot as well but without locking you out of apps etc because that kind of sensitive data should be handled by TEE and TZ. In a real Linux operating system that hasn't been fundamentally raped to offer a false sense of security in the name of protecting carriers and manufactures you can modify SE linux policies etc, not while live but without compiling from source. A lot of us forget most these security features exist more to protect their interest and attempt to hide what's going on behind the scenes. I've actually heard of some pretty shady stories where manufacturers in China place ad-tappers that run in background on devices running GooglePS to be sold in US, so it definitely doesn't protect you if the person building your phone is shade.
quark23 said:
I'm really hapy that AOSP exists. Also pretty happy with the LOS project. My problem is with the outdated blobs. Maybe I'll get a Pixel at some point and give GrapheneOS a go. Seems like a really nice project.
Managed to get hardened malloc + Vanadium on LOS atm and I'm liking the browser. Overall I think AOSP is a great project. Not a fan of google's privacy policy but they do make great stuff.
Click to expand...
Click to collapse
Me too mate. . AOSP has taught me a lot about development and coding in general. Sadly outdated blobs are a usually a by-product of using pre-builts from manufacturers that don't update as often. Pixel would be way to go if that's a concern. I honestly just think a lot of the security is abused to suit their needs. I am just trying to turn it around to work for me where it can.
If you repo sync you should run the vendor files script as there's a couple of new files added. The Muppets github has been updated with them as well. If you don't your build will fail at first power on.
A quick question, forgive me if this is obvious: am I correct in assuming that one the above has been completed and the device is using a locally-built copy of Lineage OS, that I cannot take advantage of OTA updates? I just want to know what I'm getting in to before wiping my phone multiple times.
Thanks in advance, this thread is massively helpful.
nictabor said:
A quick question, forgive me if this is obvious: am I correct in assuming that one the above has been completed and the device is using a locally-built copy of Lineage OS, that I cannot take advantage of OTA updates? I just want to know what I'm getting in to before wiping my phone multiple times.
Thanks in advance, this thread is massively helpful.
Click to expand...
Click to collapse
Correct, though if you setup your own update server you can still use the inbuilt updater app if you want.
I just happened across this thread searching for a proper way to generate the custom avb key. I thought i had found it at one time on aosp documentation but i lost/forgot where it was.
Anyways, I have a quick q about this. Would I be correct in assuming that if i wanted gapps to be available in my build, I would need to include it during build time and not be able to flash it as per the typical methods?
I am pretty sure I won't be able to but wanted to ask here for you guys' experiences.
Also, @WhitbyGreg you should be able to i believe. just setup the url properly and host it somewhere with direct download links. (This also requires setup of json for the updater to monitor for updates)
klabit87 said:
Would I be correct in assuming that if i wanted gapps to be available in my build, I would need to include it during build time and not be able to flash it as per the typical methods?
Click to expand...
Click to collapse
Correct (at least as far as I know), once the bootloader is relocked any modification of the system partition (like adding the play services) would trigger an AVB failure.

General Flashing GSI on Edge S/20 Pro (Magisk enabled)

First of all, thanks to ilia3367 for his Pure Edition ROM which contains some very useful stuffs for flashing and booting GSI.
Code:
/*
* 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 the GSI
* 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.
*/
What you need
1. Unlocked bootloader
Follow this guide to unlock bootloader. In overall, the unlock process is not as difficult compared to other brands, provided your device is eligible to unlock.
WARNING: The following steps assume you have already unlocked your bootloader. If you haven't unlocked your bootloader yet, or your device isn't eligible, DO NOT PROCEED.
2. fastboot
The process utilizes fastboot exclusively, so make sure you have fastboot installed.
3. A Magisk patched boot.img.
You can either patch it yourself using Magisk Manager, or use boot_magisk.img from Pure Edition ROM.
Although you should be able to use GSI without Magisk, you'll probably need to patch vbmeta (or vbmeta_system) so the stock kernel won't refuse to boot the GSI in this case. This guide does not cover non-Magisk scenario for now, as I'm not entirely sure. With Magisk, patching vbmeta is not needed.
4. A backup of factory images in case something goes wrong.
The factory image (both S and 20 Pro) can be found in the Pure Edition ROM thread as well.
Steps to flash GSI
1. Enter fastboot
Hold down both POWER and VOL- to enter fastboot mode.
Or you can use the following adb command to do so.
Code:
adb reboot bootloader
2. Enter fastbootd
Enter the following command to enter fastbootd, where you can actually access the system partitions, as this phone uses Dynamic Paritions.
Code:
fastboot reboot fastboot
WARNING: The following steps will actually modify your system partitions and may leave your phone unbootable. Make sure you have backed up everything before proceeding.
3. Flash Magisk patched boot.img
Assume you have the Magisk patched boot.img as boot_magisk.img, enter the following command.
Code:
fastboot flash boot boot_magisk.img
Note that you can also flash boot.img directly from fastboot, before entering fastbootd.
4. Remove the product partition
The phone's system partition is very small (about 1GB), but has a very big product partition (about 2.7GB). You'll get an error if you try to flash the GSI right away, as the super partition does not have enough room to resize the system partition to hold the GSI image if it's too large.
As the product partition is not useful for GSIs, it can be safely removed. Enter the following commands.
Code:
fastboot erase product
fastboot resize-logical-partition product_a 0x0
This will erase the stuffs in the product partition and set its size to zero, so the system partition would be able to claim its space when resizing.
You can always use the following command to check bootloader variables.
Code:
fastboot getvar all
In this case, check if the product_a partition has indeed been resized to zero. If yes, you can proceed.
Code:
(bootloader) partition-size:product_a:0x0
5. Flashing the GSI
Enter the following commands.
Code:
fastboot erase system
fastboot flash system gsi.img
Note that the erase command is optional. Replace gsi.img with the actual GSI image file of your choice.
6. Wipe userdata if needed
You don't need to wipe userdata if you are dirty flashing newer build of a same GSI over the existing one.
In case you need to do so (such as flashing a different GSI, or factory reset), enter the following commands.
WARNING: These commands will erase everything in the internal storage, not just app data! Make sure you have everything in the internal storage backed up before doing this. You may try this unofficial TWRP for this device if you want to perform factory reset while keeping your files, as well as creating a nandroid backup.
Code:
fastboot erase userdata
fastboot erase metadata
7. Reboot
Enter the following command to reboot.
Code:
fastboot reboot
If nothing goes wrong and the GSI doesn't have any major issue that might prevent it from successfully booting, you should be able to boot the GSI and further configure it yourself.
I'm still experimenting with GSI so I'm not sure which feature works and which doesn't.
The GSI I'm currently testing is DotOS. Different GSIs may produce different results but should be mostly similar.
For now it seems the following stuffs are working fine:
- Wi-Fi
- Bluetooth (Audio is problematic, other parts appear to work fine)
- 5G (Data)
- NFC
- Camera
- Display color settings (such as Boosted, Saturated)
- Fingerprint Sensor (Turned out it works!)
- Encryption (GSI can work with untouched vendor, which enforces encryption)
- 120/144 fps (On GSI it defaults to 120 fps, which can be changed in Phh-Treble settings)
The following stuffs are problematic:
- MTP (I recommend using ADB as it's a hit-or-miss on Linux. On some environments it works, on other environments it doesn't)
- Bluetooth Audio (Need to enable "alternate audio policy" and also "Force disable A2DP offload" for headsets to work correctly)
The following stuffs are not working:
- VoLTE (While you can enable "Force the password of 4G Calling setting" in Phh Treble Settings -> IMS features" then toggle it off then on upon system startup to make it active, it does not work correctly!)
Here are some functionalities that I won't be able to test as I'm not actually using them.
- SafetyNet related (I use microG now)
- USB Type-C Audio (I mainly use bluetooth headsets if needed for all except gaming)
- SIM2 (I'm confident it'll work as both SIM slot's IMEIs are correctly detected)
- Carrier-specific issues (Need someone using Verizon or other GSI-problematic carriers to test this)
Currently I've tested that the most recent DotOS, OctaviOS GSIs are working.
Keep in mind that not all GSIs can boot. You'll need to look for another build if the one you flashed doesn't boot correctly (which seems to be SELinux related).
For now, most of the functionalities work on GSI using a Magisk patched stock kernel and untouched vendor. The kernel source for RRA31 build (Global) is currently in the process of being released.
UPDATE (11/3/2021): The source code is now available.
but i've still have a question for the step 5
this mobile is a/b slot but you didn't use fastbootd mode is that work?
ZhenYuSAMA said:
but i've still have a question for the step 5
this mobile is a/b slot but you didn't use fastbootd mode is that work?
Click to expand...
Click to collapse
Step 2 is switching to fastbootd. The rest of the commands are done in fastbootd mode.
fastbootd uses the same syntax as fastboot.
This phone uses dynamic partitions, but is also A/B. Usually you would be on slot A if it's a new phone, but be sure to pay attention to active slot if the phone has taken OTA updates before.
I don't know if there are already OTA updates out, though this phone is still relatively new.
LSS4181 said:
Step 2 is switching to fastbootd. The rest of the commands are done in fastbootd mode.
fastbootd uses the same syntax as fastboot.
This phone uses dynamic partitions, but is also A/B. Usually you would be on slot A if it's a new phone, but be sure to pay attention to active slot if the phone has taken OTA updates before.
I don't know if there are already OTA updates out, though this phone is still relatively new.
Click to expand...
Click to collapse
whoa, now i see much thx
I tried DotOS 5.2 since i don't have volte on my area, and it was usable, only thing that annoyed me a little is CPU being capped at 2500MHz. Do you know how to have the same frecuency config as with the stock ROM?. With stock i noticed everytime i open a benchmark app the CPU stays at max frecuency on all cores even if it's not running the actual benchmark.
I don't have much knowledge with tweaking system code since the phone i had before had every ROM in every flavor already optimized (k20 pro) and with this one i'm getting a little bit bored to be honest so i wanted to do something myself but i couldn't get around those frecuency issues. Tried with Franco Kernel Manager and EX, the frecuecies applied but after around 1 minute everything went back to default.
Also, did you try the stock camera app?
Thanks.
rodrimax10 said:
I tried DotOS 5.2 since i don't have volte on my area, and it was usable, only thing that annoyed me a little is CPU being capped at 2500MHz. Do you know how to have the same frecuency config as with the stock ROM?. With stock i noticed everytime i open a benchmark app the CPU stays at max frecuency on all cores even if it's not running the actual benchmark.
I don't have much knowledge with tweaking system code since the phone i had before had every ROM in every flavor already optimized (k20 pro) and with this one i'm getting a little bit bored to be honest so i wanted to do something myself but i couldn't get around those frecuency issues. Tried with Franco Kernel Manager and EX, the frecuecies applied but after around 1 minute everything went back to default.
Also, did you try the stock camera app?
Thanks.
Click to expand...
Click to collapse
VoLTE doesn't work with GSIs yet. I tried forcing the toggle out. It does register, but calls do not function at all (hangs). I've reported the issue to phh, but I'm yet to make any progress. One thing I know is that IMS is in `/system_ext`, and that is not used by GSI.
As for CPU cap, I haven't really tried using kernel managers on the device yet (I prefer using SmartPack). My experience with SmartPack on other devices is similar, that any changes to frequencies would be reverted to default after a while.
It seems the system (or maybe just stock kernel) nowadays don't allow you to freely change CPU/GPU frequencies anymore, and your experience with Franco and EX further proved it. As for benchmark apps capping CPU frequency... I suspect the phone has some cheating mechanisms similar to some other ones in the past.
Don't know about stock camera app. For custom ROMs/GSIs my favorite is Open Camera, which is installed via NanoDroid to replace the stock ones.
Plus, with stock ROM, the system partition doesn't really have many stuffs. Other stuffs were placed in `/system_ext` and `/product`, and it appears that GSIs use neither of those. It's possible that the libraries of some essential features reside in `/system_ext` and therefore would not be available for GSIs (like IMS).
This procedure could be used to A12?
vinaaa said:
This procedure could be used to A12?
Click to expand...
Click to collapse
Yes but from my experience apart from the bugs mencioned above, in A12 fingerprint and magisk don't work and bluetooth doesn't either even with the workaround. Once i found these bugs i went back to stock so i didn't test it more than 15 minutes, it probably has a lot more to be found
LSS4181 said:
VoLTE doesn't work with GSIs yet. I tried forcing the toggle out. It does register, but calls do not function at all (hangs). I've reported the issue to phh, but I'm yet to make any progress. One thing I know is that IMS is in `/system_ext`, and that is not used by GSI.
As for CPU cap, I haven't really tried using kernel managers on the device yet (I prefer using SmartPack). My experience with SmartPack on other devices is similar, that any changes to frequencies would be reverted to default after a while.
It seems the system (or maybe just stock kernel) nowadays don't allow you to freely change CPU/GPU frequencies anymore, and your experience with Franco and EX further proved it. As for benchmark apps capping CPU frequency... I suspect the phone has some cheating mechanisms similar to some other ones in the past.
Don't know about stock camera app. For custom ROMs/GSIs my favorite is Open Camera, which is installed via NanoDroid to replace the stock ones.
Plus, with stock ROM, the system partition doesn't really have many stuffs. Other stuffs were placed in `/system_ext` and `/product`, and it appears that GSIs use neither of those. It's possible that the libraries of some essential features reside in `/system_ext` and therefore would not be available for GSIs (like IMS).
Click to expand...
Click to collapse
Thank you for the reply
I don't know if this is of any relevance but after disabling system tracing on developer options on stock A11, the CPU is not capped when opening benchmark apps anymore
I didn't like the DotOS. Yes, it has an interesting interface, interesting graphical solutions. But many additional settings and functions don't work.
ilia3367 said:
I didn't like the DotOS. Yes, it has an interesting interface, interesting graphical solutions. But many additional settings and functions don't work.
Click to expand...
Click to collapse
GSIs aren't 100% bug-free from my own experiences. Sometimes regressions or plain oversights can happen with certain versions. A long time ago with older devices I even had times when Bluetooth didn't work on a certain GSI because the maintainer forgot to include Bluetooth related libraries (as the logcat errors implied the files were absent).
A recent example would be that custom fonts used to work with an earlier build of OctaviOS (July) but broken with the latest (September). Either the maintainer somehow forgot to actually include the fonts this time, or there were regressions/bugs in the OS itself causing the feature to break.
Plus, it seems substratum is still alive and active, yet I'm quite a n00b when it comes to adding additional features to system with it (preferrably on top of plain AOSP). Back then I mainly used it for custom themes I bought, and when custom ROMs started including built-in theming and the features I need, substratum is pretty much dead to me and I haven't touched it for years since then.
PS: There is an ongoing bug with DotOS for this device, since 5.1, that keyboard layout button would not show up when using 3-button navbar (which is my favorite). The button correctly shows when using gestures or 2-button navbar. I reported the issues several times in the group but I got very limited response (probably because few users are using it thus affected)... so the issue persists with the recently released DotOS 5.2 GSI.

How To Guide Battery Charge Limit on custom ROM

If you are on custom ROM like LineageOS and want to limit battery charge to e.g. 80%, I can show you how it works on the Asus Zenfone 8. [Tested with LineageOS18.1]
What you need is:
Device with root access -> Use Magisk, some hints can be found here.
Then install Battery Charge Limit (BCL). There is also Advanced Charging Controller but I found it to be less reliable, with random crashes and restarts. Just stick to BCL, it is minimalist and stable.
Next, you need to set a custom control file. Go to BCL settings, check to use a custom / configurable control data, then configure the control data with this:
Path: /sys/class/asuslib/charger_limit_en
Enable value: 0
Disable value: 1
(Note that the 0 and 1 is reversed compared to default, that's on purpose!)
If it doesn't work, there might already be a cap in place, you might need to play around with /sys/class/asuslib/charger_limit_cap and set to so something lower. (e.g. with adb shell)
Hope that helps, I didn't find this anywhere on the internet, but searched through the available control files on my phone until I found this one working.
Hi Mario,
I own a Zenfone 8 (ASUS_I006D) and installed LineageOS 19.1 with the build from 27.05.2022.
It is rooted with Magisk and I tried to setup the battery charging limit using the app "Battery Charge Limit".
Unfortunately, it is not working with your guide.
I think, the problem is that on my phone the file you mentioned is missing:
/sys/class/asuslib/charger_limit_en
I checked the directory with Total Commander and there is only one file:
set_virtualthermal
Do you have any idea, what I'm missing here?
Is the carger_limit_en file supposed to be delivered with LOS?
Thanks
This was an unwanted double post.
Nbg1983 said:
Do you have any idea, what I'm missing here?
Is the carger_limit_en file supposed to be delivered with LOS?
Click to expand...
Click to collapse
I tested this while still using LOS18.1. I'm still skeptical about LOS19, still a lot of people report instabilities or crashes.
Might have something to do with the newer LOS version, but also with the firmware. LOS19 has newer firmware for the chipset. This means that config files could have been reworked, moved to a different place. You could look around a bit in sys/class if this file was moved to somewhere.
Could also be a bug in LOS19 that it doesn't parse all the configs correctly.
It looks like that the LOS 19.1 kernel does not provide the necessary files.
I installed the Kernel vom Kirisakura and then the following file exists
/sys/class/asuslib/charger_limit_en
Also, it looks like BCL is working now with your suggested settings.
Unfortunately, the kernel from Kirisakura is not fully compatible with LOS 19.1.
At least, fingerprint reader is not working, anymore. I hope, he'll release a LOS 19.1 compatible custom kernel.
That's indeed interesting, thanks for sharing the info.
The custom kernel replaces boot.img, vendor_boot.img and dtbo.img which they extracted from the stock ROM + optimizations. I doubt that the config files comes from the optimizations, so I guess there is a bug in LOS boot.img, vendor_boot.img or dtbo.img, and it is repaired by patching the stock images here.
Or question: Do you maybe use LineageOS with MicroG? Just asking because in this case, it would explain the issue since MicroG has a bug in the build pipeline so that some firmware images are missing.
I didn't use MicroG.
Its also interesting, that LOS 18.1 seems to have the necessary files for BCL.
I guess, that the files should be included in vendor_boot.img.
Unfortunately, replacing the custom vendor_boot.img with the original one leads to a boot loop.
So I either have to wait and hope for a LOS 19.1 update with included charger files, or I have to downgrade to 18.1?
Perhaps there was an update on this? Where should one submit a ticket for LineageOS? As an issue?

Categories

Resources