Treble conspiracy!!! (knowledge sharing) [08/09/2018] - Lenovo ZUK Z2 (Plus) Guides, News, & Discussion

(18-08-2018)
Recently we've been hearing a lot of theories about
1) miss titled treble ROMs.
2) vendor partition vs vendor interfaces.
3) security risks of having a separate vendor partition.
Can knowledgeable persons share your honest views and help me and many other newbies understand this!????
Some useful stuff which would help this topic:
(19-08-2018)
1) we can enable treble without a separate vendor partition.
Source: https://www.xda-developers.com/asus-zenfone-4-android-oreo-project-treble/
(08-09-18)
2)On non-treble roms, vendor libs are located at /system/vendor/. System partition is available to system apps only. There is a special platform signature that is generated during the build, so that only apps signed with it have access to system partition. There is no such thing for a separate vendor partition. Especially on our Zuk, they just renamed factory partition to vendor and moved all vendor libs (the ones responsible for camera, gps, wifi, etc) from system/vendor to /vendor. Vendor is not protected by Android signature. It is wide open for read/write/execution, otherwise hardware won't work. Android provides for VNDK, which addresses this security issues, but in our zuk, it is broken (you get warnings during the build that vndk is broken). So, right know, any treble rom for our Zuk has vendor partition open and any app (not just system), can grab a vendor lib and have access to hardware. In addition, any app can write to that partition without any root rights.
(info from optimumpro)

Bharath A said:
Recently we've been hearing a lot of theories about
1) miss titled treble ROMs.
2) vendor partition vs vendor interfaces.
3) security risks of having a separate vendor partition.
Can knowledgeable persons share your honest views and help me and many other newbies understand this!????
Click to expand...
Click to collapse
Ok

How would it be a security risk by just moving vendor folder to separate partition????

Read google's documentation fully, else you will end up with half knowledge like optimum and just make unwanted threads on xda leading to unwanted things.
https://source.android.com/devices/architecture/
And you yourself find the answer to the questions u have
---------- Post added at 11:22 AM ---------- Previous post was at 11:22 AM ----------
dvssvar said:
How would it be a security risk by just moving vendor folder to separate partition????
Click to expand...
Click to collapse
There isnt one. Else google aint fool to promote treble lol

Hello,
I am not a dev so even after reading benefits of treble, I may not be able to understand the whole point. As an average user, what I understand is that, treble is the way forward, and for Android P, all ROMs and their devs are switching to Treble.
Thinking about why I have stayed away from non treble ROMs ever since introduction of treble. I can clearly see the performance advantage a non treble ROM in general has over a Treble. But Pie is out, and so is the first Pie based ROM for Z2 Plus. Surprisingly it is a non treble.
I am like WHAT?
If Devs don't need Treble for Pie and device is running better (in general) with non Treble, as an general user, what is there for me with Treble. I am left wondering with that thought !!
Sorry for being Dumb here. Bit frustrated to with myself as misunderstood the Treble as way forward and kept my self away from non Treble ROMs.
Thanks.

amog787 said:
Read google's documentation fully, else you will end up with half knowledge like optimum and just make unwanted threads on xda leading to unwanted things.
https://source.android.com/devices/architecture/
And you yourself find the answer to the questions u have
---------- Post added at 11:22 AM ---------- Previous post was at 11:22 AM ----------
There isnt one. Else google aint fool to promote treble lol
Click to expand...
Click to collapse
Meaning that very less changes needed in trees for treble ROMs? Like does it mean that Oreo trees can boot P?
Sent from my ZUK Z2 Plus using XDA Labs

If you want treble and security perfect , go and get a pixel mobile and have fun flashing all gsi images XD

dvssvar said:
How would it be a security risk by just moving vendor folder to separate partition????
Click to expand...
Click to collapse
Because libs in a separate vendor partition, the way it is done in so called treble roms for our Zuk, are open to third party apps, which can take over the phone by hijacking those libs. Vendor libs in /system/vendor/, on the other hand, are fully protected.
amog787 said:
Read google's documentation fully, else you will end up with half knowledge like optimum and just make unwanted threads on xda leading to unwanted things.
https://source.android.com/devices/architecture/
And you yourself find the answer to the questions u have
---------- Post added at 11:22 AM ---------- Previous post was at 11:22 AM ----------
There isnt one. Else google aint fool to promote treble lol
Click to expand...
Click to collapse
You are confusing a separate Vendor partition, which has nothing to do with treble, and Vendor intarface - HIDL, which IS treble.
I have nothing against real treble, and Google certainly ain't fool, and by the way, they don't require a separate vendor partition, just a proper implementation of HIDL. Also, Google provides additional protection - VNDK, which again, doesn't properly function on our Z2.
So, as a result, no custom rom (for our zuk) that calls itself treble, is any more treble, than any non treble custom rom. The only difference is that such 'treble' roms have a separate vendor partition with fully hackable libs.

Treble is nothing but just vendor partition which contains mostly all device specific files so with the seperate vendor image and partition it will get easy for users and developers to provide updates
Users can wipe their system partition (which contains ROM specific stuff like framework,apps,etc) so with treble users can enjoy different system images without need of flashing whole new ROMs.
It is specifically made for ease of OEM when manufacturer makes new update if update only contain system specific improvements they can only give users only system image rather than full build.
The issue without treble is that device specific files and system specific files are stored at different location rather than at separate place treble makes it easy with differentiating device specific files and system specific files.
And it is ofc secure vendor partition have their vendor sepolicy to take care of security.
Apps with root access can create problem if purposely made for hacking

info from optimumpro
"On non-treble roms, vendor libs are located at /system/vendor/. System partition is available to system apps only. There is a special platform signature that generated during the build, so that only apps signed with it have access to system partition. There is no such thing for a separate vendor partition. Especially on our Zuk, they just renamed factory partition to vendor and moved all vendor libs (the ones responsible for camera, gps, wifi, etc) from system/vendor to /vendor. Vendor is not protected by Android signature. It is wide open for read/write/execution, otherwise hardware won't work. Android provides for VNDK, which addresses this security issues, but in our zuk, it is broken (you get warnings during the build that vndk is broken). So, right know, any treble rom for our Zuk has vendor partition open and any app (not just system), can grab a vendor lib and have access to hardware. In addition, any app can write to that partition without any root rights."

optimumpro said:
So, as a result, no custom rom (for our zuk) that calls itself treble, is any more treble, than any non treble custom rom. The only difference is that such 'treble' roms have a separate vendor partition with fully hackable libs.
Click to expand...
Click to collapse
But it enables the ability to use GSI images, doesn't it? At least it's more "treble" than non-treble ROMs at that

pipyakas said:
But it enables the ability to use GSI images, doesn't it? At least it's more "treble" than non-treble ROMs at that
Click to expand...
Click to collapse
Yes, but GSI is vanilla android. So, if you use GSI, you'll be stuck with that. No major custom rom does GSI. They build the regular way. And by the way, there is a number of regularly built vanilla android P available for our zuk, so there is no need for GSI.
Also, even with HIDL interface, one has to be careful, as hidl libs are by definition general ones (or taken from another device), as opposed to OEM made specifically for your device. And when you convert everything to HIDL with those non-device specific blobs, you get performance impairment that many users complain about on treble roms.
Edit: Again, I am not against treble, but it has to be properly done: example - I have switched to Oneplus 5, and in their August firmware update (which so far they have been doing monthly), they have switched to treble with a separate vendor partition. That means that in addition to separate vendor, they also have a working VNDK + all hidl libs specifically made for Oneplus 5. So, custom rom devs can take and use those latest blobs, and have no performance degradation in their builds.

optimumpro said:
Yes, but GSI is vanilla android. So, if you use GSI, you'll be stuck with that. No major custom rom does GSI. They build the regular way. And by the way, there is a number of regularly built vanilla android P available for our zuk, so there is no need for GSI.
Also, even with HIDL interface, one has to be careful, as hidl libs are by definition general ones (or taken from another device), as opposed to OEM made specifically for your device. And when you convert everything to HIDL with those non-device specific blobs, you get performance impairment that many users complain about on treble roms.
Edit: Again, I am not against treble, but it has to be properly done: example - I have switched to Oneplus 5, and in their August firmware update (which so far they have been doing monthly), they have switched to treble with a separate vendor partition. That means that in addition to separate vendor, they also have a working VNDK + all hidl libs specifically made for Oneplus 5. So, custom rom devs can take and use those latest blobs, and have no performance degradation in their builds.
Click to expand...
Click to collapse
Thanks for the info
Is it like only OEM's could implement VNDK, or can it be done by any dev.
Is it same for all phones which doesn't have treble implemented by OEM's??

chimpu10 said:
Thanks for the info
Is it like only OEM's could implement VNDK, or can it be done by any dev.
Is it same for all phones which doesn't have treble implemented by OEM's??
Click to expand...
Click to collapse
If OEM does it, then it's for sure good. Otherwise, I don't know. You really have to build to see, if there are no warning messages about VNDK, then you should be OK. See, you can't set vendor partition to non-executable straight, because hardware won't work. So, it has to be open, but requests must go through VNDK (which has restrictions).

Oh well ... I think some of you enjoys the moderator`s presence more than anything .. anyway, off topic posts removed and you guys knows who you are , I`m not going to say it again, keep it civil and constructive here on XDA
thanks for understanding
Dan - forum moderator

In any custom rom, if the Google play store shows that "Device is certified" then is that particular rom has support of "VNDK Security" ?

Isaacjohn said:
In any custom rom, if the Google play store shows that "Device is certified" then is that particular rom has support of "VNDK Security" ?
Click to expand...
Click to collapse
Are you talking about play protect!!!?????
If yes, it checks for harmful apps, regularly check behavior of apps... And as of my knowledge it has nothing to do with 'VNDK Security'

Isaacjohn said:
In any custom rom, if the Google play store shows that "Device is certified" then is that particular rom has support of "VNDK Security" ?
Click to expand...
Click to collapse
LoL
Damn dude

Related

[GUIDE] [Future] [news and build Oreo] Oreo Go Older Oreo Device and or Trebel Dev

Update News Flash Galaxy note 4 running Oreo 8.1
3-29-18
OMG. I said it here first. 32 bit processors CAN be ported to Oreo. Maybe not trebel yet. Smug emoticon
In just a few days , not even I thought it was possible.
Running Oreo via lineageOS 15.1 with root on my Samsung Galaxy Note 4.
The dev who devotes time to compiling builds @ripee has had his daily downloads of 14.1 for the note 4 has more than doubled. Currently running about 250 users testing builds. SMOKIN.....
Here is the OP
https://forum.xda-developers.com/no...0-unofficial-lineage-15-1-rom-t3760969/page92
Update 2-28-18
OpenGapps 8.1 is released for both arm and arm 64.
That means Oreo can be compiled it 32 bit.
Researching Oreo and Oreo go compiler instructions.
Mebbe I can compile AOSP for my older Note 4 .. So cool
https://forum.xda-developers.com/android/apps-games/arm-unofficial-opengapps-builds-android-t3743495
Updated 1-20-18
Newest musings on top. Oreo Go is currently being modded into an older Sony phone. Awesome
So since I posted this OP...my musings have been correct in these posts.
This came out on XDA, check out the links in it.
https://www.xda-developers.com/android-go-old-android-8-1-oreo/
Android Oreo and android in general is getting closer to Linux . Mainly for the same reasons
I have been installing different distributions of Linux on an older laptop.
1. To learn installing hard to find drivers
2. Learning Linux architecture and commands
3. Learning to build Linux kernel for my device
http:// www.kernel.org
4. Learning to build lineageos14 in general
With these guides
https://forum.xda-developers.com/note-4/general/guide-build-lineageos-14-1-trltexx-t3567885
Thanks @_mone and @ripee
https://forum.xda-developers.com/chef-central/android/how-to-build-lineageos-14-1-t3551484
Thanks @FSadino
5. Actually compiling lineageOS-14 for my two devices I have access to
Galaxy note 4 Verizon thanks to @ripee for his contribution by building daily's at
https://forum.xda-developers.com/note-4/snapdragon-dev/rom-lineageos-14-1-t3536401
And my galaxy tab S2 sm-t710
Thanks to @Bonuzz for getting the camera, mic GPS and Bluetooth working, and posting sources
https://forum.xda-developers.com/tab-s2/development/t710-t715-lineage-14-1-t3713097
Thanks to @Ather for getting Samsung to release their Kernel sources and building a android 7 rom
https://forum.xda-developers.com/tab-s2/development/kernel-poseidonkernel-v1-0-permissive-t3588069
https://forum.xda-developers.com/tab-s2/development/rom-poseidonrom-v1-0-deodexedrooted-t3590228
6. Thinking and musing about things
Symlinks, multi boot, and partitions. ( Treble )
In Linux, I have another partition with downloaded files on another drive
When the kernel boots, the directory tree just sees /data even though it's a separate drive
This is because of a symbolic link that mounts the partition as a folder. This prevents me, from deleting that data with permissions
So the Trebel rules tell the vendor to make a separate partition in the drive but the kernel gets a symbolic link to it, and the user (Google) cannot over write the partition with the critical info..when the ROM gets flashed? correct ?
The bootloader has boot path a, or boot path b.
The user files are in protected memory
So with Linux, when I updated my kernel,
The grub bootloader tells me I can use kernel 4.1.x or 4.2.x when I boot
The kernel loads the drivers
And then looks at the symbolic links to mount the drives.
This is somewhere in the /etc files or somewhere
So Trebel has to be a set of decision trees based on symbic links to hardware
Where all the hardware drivers are independent of the kernel
More musings later. Must build....
**************
Dec 2017 sometime
Thanks to all for viewing my first OP.
I'm just learning about building ROMs, and look forward to this thread to spitball ideas and see what sticks.
If I don't know something its because I am correcting my ignorance.
This won't be an actually development thread, just trying to understand hardware from 30 years of not being in the tech field.
Eventually I will tire or wear out of driving truck, and work with my passion again.
I am a follow the steps kind of mind, so I am learning how the world of Android / Linux works.
If I understand the Trebel development correctly...
https://www.xda-developers.com/goog...ze-android-so-oems-can-update-devices-faster/
IF we can modify the older device drivers to be Trebel compliant, then once they work, then they always should work. And any Trebel ROM can work on Any Trebel Device withOUT compiling over and over.
This should result in an explosion of custom ROMs .
So I am suggesting a repository of drivers per device that are compliant for older devices.
How do we do that?
So here is the Google announcement of Trebel
https://android-developers.googleblog.com/2017/05/here-comes-treble-modular-base-for.html?m=1
Here is the developer preview of ”O”
https://developer.android.com/preview/download.html
It details how to install it on your Trebel Device.
Wow. Just Wow.
OH MY GOODNESS. I would love this on my lg g3, oneplus one, and moto e2. WOW.
TotalNoobTrucker said:
If I understand the Trebel development correctly...
https://www.xda-developers.com/goog...ze-android-so-oems-can-update-devices-faster/
IF we can modify the older device drivers to be Trebel compliant, then once they work, then they always should work. And any Trebel ROM can work on Any Trebel Device withOUT compiling over and over.
This should result in an explosion of custom ROMs .
So I am suggesting a repository of drivers per device that are compliant for older devices.
How do we do that?
Click to expand...
Click to collapse
How do you wanna to do that ?
Vendor files are NOT open-source so you cannot make them treble enabled sadly.
Haxk20 said:
How do you wanna to do that ?
Vendor files are NOT open-source so you cannot make them treble enabled sadly.
Click to expand...
Click to collapse
So far all it looks like ROM dev is trial and error with people posting guides on repeatable success... (Community)
I haven't built a ROM, ( haven't built a compiler computer yet) plus I drive truck 70 hrs a week..
but have read
https://forum.xda-developers.com/chef-central/android/guide-android-rom-development-t2814763/
And
https://forum.xda-developers.com/android/software/how-to-port-samsung-rom-to-samsung-t3481114/
So what's different in the building process? With Trebel?
Google dev page lists an additional partition for drivers called VENDOR
A file called manifest.xml
And a A/B partition.
So assuming I am building a Lineage OS ROM 14.x
In that compile process, everything is compiled in the ROM
Kernel, Lineage front end, AOSP programs etc.
So somewhere in the compiler process the drivers to my N910V are pulled in from somewhere? Github¿?
If they are not open source, they were pulled from system image via ADB or Android image kitchen and uploaded to where?
So i guess we need a guide on how to build Trebel for non Trebel devices. The folks on the other Trebel thread are doing it on newer devices and getting some exciting results.
There is only a couple of Lineage 15.x builds going, but once someone has the Process down to build a Trebel on non / close to Trebel hardware,
It should be repeatable for ANY Oreo and up compiled ROM.
I may not be able to build yet, but since Trebel is the new path, I want to gather Trebel success and Process here. Maybe make a guide..
In conclusion, the drivers may not be open source, but the code is out there somewhere.
Sent from my Lineage OS 14 Samsung Verizon Note 4 from @ripee
My other device is a Samsung T710 running Posiedon 1.0 . Thanks for a stable rooted tablet @Ather
Sent from my Samsung SM-N910V using XDA Labs
TotalNoobTrucker said:
So far all it looks like ROM dev is trial and error with people posting guides on repeatable success... (Community)
I haven't built a ROM, ( haven't built a compiler computer yet) plus I drive truck 70 hrs a week..
but have read
https://forum.xda-developers.com/chef-central/android/guide-android-rom-development-t2814763/
And
https://forum.xda-developers.com/android/software/how-to-port-samsung-rom-to-samsung-t3481114/
So what's different in the building process? With Trebel?
Google dev page lists an additional partition for drivers called VENDOR
A file called manifest.xml
And a A/B partition.
So assuming I am building a Lineage OS ROM 14.x
In that compile process, everything is compiled in the ROM
Kernel, Lineage front end, AOSP programs etc.
So somewhere in the compiler process the drivers to my N910V are pulled in from somewhere? Github¿?
If they are not open source, they were pulled from system image via ADB or Android image kitchen and uploaded to where?
So i guess we need a guide on how to build Trebel for non Trebel devices. The folks on the other Trebel thread are doing it on newer devices and getting some exciting results.
There is only a couple of Lineage 15.x builds going, but once someone has the Process down to build a Trebel on non / close to Trebel hardware,
It should be repeatable for ANY Oreo and up compiled ROM.
I may not be able to build yet, but since Trebel is the new path, I want to gather Trebel success and Process here. Maybe make a guide..
In conclusion, the drivers may not be open source, but the code is out there somewhere.
Sent from my Lineage OS 14 Samsung Verizon Note 4 from @ripee
My other device is a Samsung T710 running Posiedon 1.0 . Thanks
Click to expand...
Click to collapse
The OEM needs to add support for treble there is no treble for non-treble devices.
Treble works like so:
Vendor files are stored in separate partition (Those files are edited to work with treble)
Then android just takes those files from there and work.
The vendor files are not in system.img but in /vendors (the partition is mounted here)
Only a few devices have vendor files open source there is possible to make the device treble supported but 99% of devices have vendor files closed and so its not possible for some dev here to make the device supported.
Also A/B is new partition layout:
You have your system on A but once update is available its downloaded onto B and then it just switch them (Don't read about that much so I canbe wrong here).
Also I have build ROM for xperia P and if I wanted to build 8.0.0 I cannot use treble sadly that would have made my job lot easier.
Hmm.
Haxk20 said:
The OEM needs to add support for treble there is no treble for non-treble devices.
Treble works like so:
Vendor files are stored in separate partition (Those files are edited to work with treble)
Then android just takes those files from there and work.
The vendor files are not in system.img but in /vendors (the partition is mounted here)
Only a few devices have vendor files open source there is possible to make the device treble supported but 99% of devices have vendor files closed and so its not possible for some dev here to make the device supported.
Also A/B is new partition layout:
You have your system on A but once update is available its downloaded onto B and then it just switch them (Don't read about that much so I canbe wrong here).
Also I have build ROM for xperia P and if I wanted to build 8.0.0 I cannot use treble sadly that would have made my job lot easier.
Click to expand...
Click to collapse
So where are the Xperia P files you imported into your 8.0 biuld¿ Can't you put them in the vendor folder and see if it boots¿ I presume you have to make a manifest.xml file so the ROM can see the files
Sent from my Samsung SM-N910V using XDA Labs
TotalNoobTrucker said:
So where are the Xperia P files you imported into your 8.0 biuld¿ Can't you put them in the vendor folder and see if it boots¿ I presume you have to make a manifest.xml file so the ROM can see the files
Click to expand...
Click to collapse
I haven't done 8.0.0 build yet cause the device got only CM-12.1 and now trying to port 8.0.0 and no putting the files there will not work:
1. Old devices don't have that partition and evenif I reformat it and add it and edited fstab to see it.
2. The files NEEDS TO BE EDITED TO WORK WITH TREBLE. If it was that easy to make partition put there the files and tadaaa treble device then every old device could get 8.0.0 to run but well I don't see threads about it. It's not that easy you NEED THE SOURCES TO MAKE IT TREBLE ENABLED.
Haxk20 said:
I haven't done 8.0.0 build yet cause the device got only CM-12.1 and now trying to port 8.0.0 and no putting the files there will not work:
1. Old devices don't have that partition and evenif I reformat it and add it and edited fstab to see it.
2. The files NEEDS TO BE EDITED TO WORK WITH TREBLE. If it was that easy to make partition put there the files and tadaaa treble device then every old device could get 8.0.0 to run but well I don't see threads about it. It's not that easy you NEED THE SOURCES TO MAKE IT TREBLE ENABLED.
Click to expand...
Click to collapse
Sadly, I think android 8.1 trebel is 64 bit. My note 4 is a 32bit arm71
So I dunno how it could run on my note 4. However the nexus 6 is the same cpu hardware as the note 4
However the nexus 6p is the 8core with 2 other core chipset, which is 64 bit and supported by 8.1 Trebel
So me thinks the older devices are not able to run trebel
Sent from my Samsung SM-N910V using XDA Labs
TotalNoobTrucker said:
Sadly, I think android 8.1 trebel is 64 bit. My note 4 is a 32bit arm71
So I dunno how it could run on my note 4. However the nexus 6 is the same cpu hardware as the note 4
However the nexus 6p is the 8core with 2 other core chipset, which is 64 bit and supported by 8.1 Trebel
So me thinks the older devices are not able to run trebel
Click to expand...
Click to collapse
Yeah that's another problem even if there was a way to edit vendor files treble is 64bit only
If I undertand it correctly, there's another layer between the HAL and the android framework, the HIDL, which decribes the interface of the HAL.
Shouldn't we theorically be able to edit that?
The good news is my sm-t710 is a exynos5433 chipset which supports 64bit. So maybe I will get to play with 8.n someday
android1111 said:
If I undertand it correctly, there's another layer between the HAL and the android framework, the HIDL, which decribes the interface of the HAL.
Shouldn't we theorically be able to edit that?
Click to expand...
Click to collapse
I think so. If you look at the other forum, it seems they're editing only a couple files. The manifest.xml describes what files are the drivers and where to look for them. This is a crucial file, as the drivers are in a separate partition from the system/data partition now. Download one and read it .it's a very simple exchange script
TotalNoobTrucker said:
I think so. If you look at the other forum, it seems they're editing only a couple files. The manifest.xml describes what files are the drivers and where to look for them. This is a crucial file, as the drivers are in a separate partition from the system/data partition now. Download one and read it .it's a very simple exchange script
Click to expand...
Click to collapse
As I said above you NEED the vendor file sources then create /vendor partition to add the vendor files there.
Without sources you can't make Treble running.
So if you ever want to play with 8.0 on your phone you should start porting right now.
---------- Post added at 10:42 PM ---------- Previous post was at 10:41 PM ----------
TotalNoobTrucker said:
I think so. If you look at the other forum, it seems they're editing only a couple files. The manifest.xml describes what files are the drivers and where to look for them. This is a crucial file, as the drivers are in a separate partition from the system/data partition now. Download one and read it .it's a very simple exchange script
Click to expand...
Click to collapse
I mean porting as the "hard way" = modifying device tree to work with new sources and patching the sources.
Haxk20 said:
As I said above you NEED the vendor file sources then create /vendor partition to add the vendor files there.
Without sources you can't make Treble running.
So if you ever want to play with 8.0 on your phone you should start porting right now.
---------- Post added at 10:42 PM ---------- Previous post was at 10:41 PM ----------
I mean porting as the "hard way" = modifying device tree to work with new sources and patching the sources.
Click to expand...
Click to collapse
I get that to begin the process for non Trebel, that's the idea.
Move all the vendor libraries to the vendor file, and run them through the Google process to make them compliant.
I would have to find a piece of hardware that has the same SoC just to begin.
No wonder the note 4 stalled at 6.0.1, verizion want going to rewrite the code. Just to get to 7. They would rather sell note 8's
Sent from my Samsung SM-N910V using XDA Labs
See scenario 2 on
source android com devices architecture hidl-cpp
We need to code o adapt a passthrough HIDL
It's not a matter of editing a file
TotalNoobTrucker said:
I think so. If you look at the other forum, it seems they're editing only a couple files. The manifest.xml describes what files are the drivers and where to look for them. This is a crucial file, as the drivers are in a separate partition from the system/data partition now. Download one and read it .it's a very simple exchange script
Click to expand...
Click to collapse
It's not a matter of editing a file to tell Android and the kernel where to look for drivers. We are not "editing" manifest.xml, it is generated during the build process. The whole structure and system calls of the drivers is changed to make them suitable for treble. And that is done by the SoC vendor whomever they may be. You can build Oreo to work on older devices by using your existing drivers, but not by using treble, you have to use your existing kernel, and write your own "hooks" into your existing drivers (better be familiar with hex code), and do a LOT of modifications to the Android code. Treble is not intended as a way for older devices to get custom ROMs, as their pre Oreo kernels and drives are not capable.
A N00b's explanation of Project Treble
Okay so I've seen a lot of confusion about how Project Treble does and does not work, so I'm going to provide a small explanation, simplified to a fault, but it'll do:
In ye olden days (Nougat and back), the Android OS was very tightly integrated with the drivers of the system. This made custom firmware very difficult to port (relatively speaking). Certain drivers were more difficult to make workable and as a result you'd have work in progress ROMs that didn't have WI-FI or cameras working, etc. It really was a pain in the butt.
Project Treble changes all of that. What it does is separate the operating system from the drivers, making porting much easier for devices that support it. The problem is that in order to enable this it would require almost a complete rebuild of these drivers, which would in turn require access to the source code and a LOT of work (hence why companies like OnePlus are releasing devices with Nougat so they don't have to use Treble, which is required on all devices that start with Oreo).
In short, COULD Treble be ported to older devices? Yes; Google and Essential have proven that. Is it feasible? Unless you've got some friends at Samsung/HTC/Xiaomi/insert-other-company-here willing to leak source code, no not really. The only device that I could possibly see getting a Treble port is the HTC HD2, simply because that phone is basically the technological equivalent of a cockroach, and I think they may have actually reverse engineered their drivers to get them to work on so many operating systems. I know I've probably made some mistakes in my explanation, but it's my best way if simplifying how this works so that people don't come along, see Treble and expect an Oreo ROM for their Fire Phone or something
2390 said:
Okay so I've seen a lot of confusion about how Project Treble does and does not work, so I'm going to provide a small explanation, simplified to a fault, but it'll do:
In ye olden days (Nougat and back), the Android OS was very tightly integrated with the drivers of the system. This made custom firmware very difficult to port (relatively speaking). Certain drivers were more difficult to make workable and as a result you'd have work in progress ROMs that didn't have WI-FI or cameras working, etc. It really was a pain in the butt.
Project Treble changes all of that. What it does is separate the operating system from the drivers, making porting much easier for devices that support it. The problem is that in order to enable this it would require almost a complete rebuild of these drivers, which would in turn require access to the source code and a LOT of work (hence why companies like OnePlus are releasing devices with Nougat so they don't have to use Treble, which is required on all devices that start with Oreo).
In short, COULD Treble be ported to older devices? Yes; Google and Essential have proven that. Is it feasible? Unless you've got some friends at Samsung/HTC/Xiaomi/insert-other-company-here willing to leak source code, no not really. The only device that I could possibly see getting a Treble port is the HTC HD2, simply because that phone is basically the technological equivalent of a cockroach, and I think they may have actually reverse engineered their drivers to get them to work on so many operating systems. I know I've probably made some mistakes in my explanation, but it's my best way if simplifying how this works so that people don't come along, see Treble and expect an Oreo ROM for their Fire Phone or something
Click to expand...
Click to collapse
So who do we know at Samsung/HTC/Xiaomi ?
Haha.
Or better yet who do we ask there? Do they have only internal development? Customer service? How do some Devs get source code? When a company releases a developers version ( thankfully someone had a way to flash a dev version 5.1.1 of my verizion note 4 so it could get a ROM.. ), does the developers edition phone come with the support and access of developers?
The reason I ask. Is I used to have MSDN access when I worked at [email protected]#$0ft . just asking again. What's the path to be a developer from a builder like Samsung?
Good luck with that
TotalNoobTrucker said:
So who do we know at Samsung/HTC/Xiaomi ?
Haha.
Or better yet who do we ask there? Do they have only internal development? Customer service? How do some Devs get source code? When a company releases a developers version ( thankfully someone had a way to flash a dev version 5.1.1 of my verizion note 4 so it could get a ROM.. ), does the developers edition phone come with the support and access of developers?
The reason I ask. Is I used to have MSDN access when I worked at [email protected]#$0ft . just asking again. What's the path to be a developer from a builder like Samsung?
Click to expand...
Click to collapse
You're going to have better luck getting blood out of a rock than that. Even when they have "developer" editions of phones they don't give you access to their code, that just means it's totally unlocked for you to f*** up or flash ROMs to. The phone manufacturers get the drivers for the SoC from the manufacturer of the chip, and except in binary form that never leaves and stays in house. Only way you're going to get that is by knowing someone who works at Qualcomm, Samsung, etc. who is willing to risk being fired, sued, thrown in jail, or all of the above for stealing the source code and leaking it to you. When a phone manufacturer releases "source code" if you examine it you will find that those closed source drivers are not included, you can build it but a lot of things won't work. (Besides the fact that it is always outdated code).

[Discuss] OnePlus and Nokia won't be project Treble certified!

In this Article by Mishaal Rahman , we can understand why OnePlus and Nokia doesn't have treble support to their devices.
I open this thread to discuss about your opinions about how danger can be to create vendor partition outside system partition.
Tell us your opinion and how we can do it safely!
/vendor
FSadino said:
In this Article by Mishaal Rahman , we can understand why OnePlus and Nokia doesn't have treble support to their devices.
I open this thread to discuss about your opinions about how danger can be to create vendor partition outside system partition.
Tell us your opinion and how we can do it safely!
Click to expand...
Click to collapse
That partition is not accessible by the user or anyone else unless the phone is rooted, and it's no more dangerous than having the drivers and libraries in the system partition, OnePlus, as nothing more than a rebranded oppo, as well as Nokia, just don't want to put in the effort, Google has made it perfectly clear that treble is not optional, it is mandatory for devices shipping with Oreo and later, Nokia and OnePlus can do what they want with existing phones, but even they have no real choice that to support treble, unless of course that want to be stuck on phones shipping with nougat and maybe upgrading to Oreo, both of them will see the Android world passing them by and their implementations of Android will become more and more fragmented. Each to their own I suppose
Repartitioning a phone carries a certain risk, especially if it is done via OTA Update, but there are ways to do it and make it relatively safe...if you are willing to put in the work. I think that's the main point.
To me, it's much more interesting to see right now, how OEMs actually use Treble. They no longer have the excuses they used to, so someone like Sony should now be able to provide the Update to Android 8.1 within Days instead of Months...but will they actually do it?
The reasoning behind OnePlus deliberately not using Oreo on the 5T and not preplanning the extra partition...well, that tells it's own story. Not really that unexpected. Nokia though...I would have expected more from them, since they started with big promises about Stock Android and fast Updates, but so far very little has materialised...
I really think people are blowing this up far more then it needs to be. In the Google article it stated that even after the treble code is sent, the oems will still have to make their changes. So as far as I can see this will only matter to oems.
I expect to see many devices with day one 8.0 updates for a while.
Well, like I said, this will be the benchmark for Updates in the future. Since a new OS version can now boot on a phone without any big changes to the UI, Drivers or Apps, it SHOULD be far quicker. How much quicker will be interesting to see. Custom ROMs already show how fast the process can be...so... interesting times!
CommanderROR said:
Well, like I said, this will be the benchmark for Updates in the future. Since a new OS version can now boot on a phone without any big changes to the UI, Drivers or Apps, it SHOULD be far quicker. How much quicker will be interesting to see. Custom ROMs already show how fast the process can be...so... interesting times!
Click to expand...
Click to collapse
Yeah if you don't want any of the main features from the oem. Like Samsung cameras on aosp. Things like that.
As for faster updates. I doubt it. As now the oems will, have to do twice the work. Instead of adding their code to the stock frameworks. Now they will have to make completely new framework files to over write the default. Downloads will be a lot bigger now as well.
Hmm... that's not the way I understand Treble!
From what I've read, the OEM can basically exchange the OS Version without really touching much of their OEM UI...
The fact that Custom Roms are limited is mostly due to the fact, that devs don't have access to the OEM Sources, so they can only compile AOSP versions of Android...
CommanderROR said:
Hmm... that's not the way I understand Treble!
From what I've read, the OEM can basically exchange the OS Version without really touching much of their OEM UI...
The fact that Custom Roms are limited is mostly due to the fact, that devs don't have access to the OEM Sources, so they can only compile AOSP versions of Android...
Click to expand...
Click to collapse
And see that is why XDA articles are crap. The way OEMS roms have worked for years is that they replace and/or recode all of googles files. Now they will have to make even more. To over write them.
That is what you will get. Either AOSP or OEM. The aosp will not have access to the OEM code. Nor will OEM push their code to aosp for google to make things work right. This comes from the fact that OEMS dont write the drivers and code for alot of the hardware. They get that from others.
Just checked, my us997 LG G6 has a symlink for 'vendor', it points to 'system/vendor'... so no separate partition on the G6 either... I was hoping! alas.
Not unexpected...the G6 launched way before Treble was announced and hasn't been Updated to Oreo yet...
They should build a tool and require a wired connection to a pc to repartition and fallback just in case.
FWIW, I made patches to AOSP to be able to have a vendor partition WITHOUT needing to repartition, here:
https://github.com/phhusson/treble_experimentations/tree/master/no-vendor
The way it works, is it tells the kernel to look at the "system" partition, as if it was an hard-drive, to look for partition table, and then use partitions inside this fake hard-drive
Clever. Sell that idea to Oneplus and Nokia please...?
CommanderROR said:
Clever. Sell that idea to Oneplus and Nokia please...
Click to expand...
Click to collapse
I might be a good coder, but definitely not a good seller
phhusson said:
FWIW, I made patches to AOSP to be able to have a vendor partition WITHOUT needing to repartition, here:
https://github.com/phhusson/treble_experimentations/tree/master/no-vendor
The way it works, is it tells the kernel to look at the "system" partition, as if it was an hard-drive, to look for partition table, and then use partitions inside this fake hard-drive
Click to expand...
Click to collapse
Did you already tried this? I mean, I'm not developer and I can't understand the pros/cons about your patch but is extremely interesting!
@franciscofranco @eng.stk @Sultanxda @flar2 can you guys share your opinion about this? Thanks in advance
FSadino said:
Did you already tried this? I mean, I'm not developer and I can't understand the pros/cons about your patch but is extremely interesting!
Click to expand...
Click to collapse
Yup, actually my main testing device for my Treble ROM is a device using this.
Pros:
- doesn't need to repartition
- Easy to integrate
Cons are only for community rom devs:
- /system and /vendor are in read-only, even if dm-verity is disabled, the only way
- some TWRP change is required
- fastboot flashing will require to launch a s cript to merge system.img and vendor.img and flash both at the same time
Frankly, I'd guess OEMs had better to repartition. If you don't move partitions, only split system into system/vendor, and write the script with error-checking in mind, I really can't see how you would brick your device.
But this patch makes it possible to answer to OEMs saying they can't because of missing vendor partition
It will be interesting to see what happens, if a Device with strong XDA Community support like the OnePlus lineup can be "Trebleized" by the community and then supported more easily without help from the OEM that made it.
Following up here, very curious about where this is going.
Not a developer, but willing to test, my device is OP3T.
In light of a dev getting Treble support on the Redmi Note 4X, is it possible to get it on our devices too? I'm willing to test.
phhusson said:
FWIW, I made patches to AOSP to be able to have a vendor partition WITHOUT needing to repartition, here:
https://github.com/phhusson/treble_experimentations/tree/master/no-vendor
The way it works, is it tells the kernel to look at the "system" partition, as if it was an hard-drive, to look for partition table, and then use partitions inside this fake hard-drive
Click to expand...
Click to collapse
Does the Zenfone 4 use your patch actually? (didn't checked if sources are available yet)
I read a while back that first devices (or just one device?) is now project treble ready without vendor partition, not knowing you might have anything to do with it...
For reference:
https://www.androidpolice.com/2017/11/26/phones-updated-support-project-treble-continuously-updated/
Sent from my OnePlus 3T using XDA Labs

[Discussion]Will Project Treble help porting Android ROMs?

Will Project Treble make porting rom easy, like a one-day job?
Could we port roms between different hardware platforms on devices have Treble support?
For example, can we flash the system.img of Honor 9 into an Essential Phone PH-1 and boot EMUI 8.0 on it, or boot Essential's system image on Honor devices?That's not possible before Treble.
The short answer: no. System images from Huawei/Honor phones reference a ton of vendor-specific stuff that isn't available on other phones.
MishaalRahman said:
The short answer: no. System images from Huawei/Honor phones reference a ton of vendor-specific stuff that isn't available on other phones.
Click to expand...
Click to collapse
In fact the EMUI camera port is partly working on a xiaomi device,even rhe camera is related to a vendor.xxx.so file that is vendor-specific .The phone even don*t support treble.So I wonder if the vendor stuffs could also be ported.
Hi.
I will turn arround the question.
Will we be able to use the same ROM file (it can be LineageOS) on 2 different devices ?
The hardware specific applications can be installed like now we do it with weather service or root service for LOS or open gapps .
Tomek0000 said:
Will we be able to use the same ROM file (it can be LineageOS) on 2 different devices ?
Click to expand...
Click to collapse
Yes, of course, it already works, check other threads

[Research][Dev] Can Project Treble be ported?

Hi all,
I am searching and wondering for any guides/ experience/ instructions about:
Can Project Treble be ported to a device where the support is not introduced by the official vendor?
What would be required to do so? I wonder if it would be possible to use the information provided from a released kernel source in combination with some re-partitioning (?), but these are just guesstimates.
So can anyone share some insight please? I think the possibilities such a project could introduce for custom rom developments would be even much more noticeable than right now. But that's just my 2 cents.
Looking forward to hear your thoughts and productive input.
P.S.: Please keep it friendly and productive as I know this is a topic with high chances for very different point of views and that is a good thing as long as everyone is not judging, polite and fine with co-existing opinions.
---
Update: 9th May 2018
I found an interesting lead for enabling treble on devices which current partition layout would not allow it otherwise:
https://github.com/Lanchon/REPIT
Given my understanding of project treble, I would say no. This is due to the fact that you would have to have the individual drivers and their own partitions. So I believe you would have to have those drivers and the partitioning set up from the vendor in order to do it. Then again, this is xda...someone may figure out a way to do all this and make some magic!
@BakedTator Do you reckon an open-source Treble-compatible alternative could be made?
We could call it "Bass".
majamee said:
Hi all,
I am searching and wondering for any guides/ experience/ instructions about:
Can Project Treble be ported to a device where the support is not introduced by the official vendor?
What would be required to do so? I wonder if it would be possible to use the information provided from a released kernel source in combination with some re-partitioning (?), but these are just guesstimates.
So can anyone share some insight please? I think the possibilities such a project could introduce for custom rom developments would be even much more noticeable than right now. But that's just my 2 cents.
Looking forward to hear your thoughts and productive input.
P.S.: Please keep it friendly and productive as I know this is a topic with high chances for very different point of views and that is a good thing as long as everyone is not judging, polite and fine with co-existing opinions.
Click to expand...
Click to collapse
I'd say it's possible.
There are some good tentatives on the way on some devices, and it seem to have nicely progressed.
It is still not able to boot GSI, but I'm quite confident.
FWIW, this has basically nothing to do with kernel sources, and not with partitioning either.
phhusson said:
I'd say it's possible.
There are some good tentatives on the way on some devices, and it seem to have nicely progressed.
It is still not able to boot GSI, but I'm quite confident.
FWIW, this has basically nothing to do with kernel sources, and not with partitioning either.
Click to expand...
Click to collapse
Thank you for the info, especially for the FWIW part. Nevertheless, could you please be so nice to share what you know what is neccessary instead? I'm not finding any good leads/ information sources about this topic so far. Would be appreciated
zoomer296 said:
@BakedTator Do you reckon an open-source Treble-compatible alternative could be made?
We could call it "Bass".
Click to expand...
Click to collapse
You heard the man...he says it's possible...I would listen to him over me any day! Lol. Would be nice to see it happen...make more rooms reach more devices
mi5devs are porting Treble to Xiaomi MSM8996 devices (Mi5, Mi5S, mi5S plus, Mi Mix, Mi Note 2)
https://review.lineageos.org/#/q/topic:xiaomi8996-treblize-all-the-things
Nice... the avalanche is starting
Codeworkx is working on bringing treble to Oneplus 5/5T.
https://review.lineageos.org/#/c/205186/
Yes: https://forum.xda-developers.com/re...other-development/rom-lineageos-15-0-t3690465
Another device with Treble ported, Redmi 3S (Land)... @TeamMex has brought in initial Treble support to Redmi 3S just like it was done on Redmi Note 4, using Cust as the Vendor partition... Hope He has great success in it...
Source: https://plus.google.com/u/0/+klozzjesus/posts/5REcrMxfq67
Correct me if I'm wrong. To use Treble device must have /vendor partition right? So if device have this partition by default it will be easier to implement it?
Sent from my Nexus 5X using XDA Labs
Banan PL said:
Correct me if I'm wrong. To use Treble device must have /vendor partition right? So if device have this partition by default it will be easier to implement it?
Click to expand...
Click to collapse
Yes, but devices that have extra AOSP unused partitions, such as the Xiaomi /cust and Motorola /oem can have those partitions mounted as /vendor for treble ports. I'm guessing what's most important is that the partition has enough space for all the vendor blobs
I'm wondering about why they can make their devices (like xiaomi redmi 4 .Etc) adapt to treble.
The vendor code is close-source isn't it? So they write the code completely by them selves????
KuwaLee said:
I'm wondering about why they can make their devices (like xiaomi redmi 4 .Etc) adapt to treble.
The vendor code is close-source isn't it? So they write the code completely by them selves????
Click to expand...
Click to collapse
No. There were HALs before Treble, they just connect the old HALs to binderized HALs, Google even wrote several such converters.
(That's a big simplification, they still had to do a lot of work for that, that's not easy)
phhusson said:
No. There were HALs before Treble, they just connect the old HALs to binderized HALs, Google even wrote several such converters.
(That's a big simplification, they still had to do a lot of work for that, that's not easy)
Click to expand...
Click to collapse
I didn't thought it was possible without rewriting the blobs...are you willing to share some more details/resources to help other people do the same with other terminals?
For example, the whole Xperia X line has an oem partition which can be used as vendor (in the aosp version is used to store the blobs, and they also have some HALs binderized https://github.com/sonyxperiadev/device-sony-common/blob/master/manifest.xml)...but there is still something missing for full treble support.
Thank you
@phhusson when we get Android P dev preview images can we extract/make something to get them work on every treble device or do devs need sources released?
stunned said:
@phhusson when we get Android P dev preview images can we extract/make something to get them work on every treble device or do devs need sources released?
Click to expand...
Click to collapse
Hard to say. I'd say we'll need the sources.
That means that unsupported MTK devices that are still stuck on 6.0 would be able to use treble?
Then if kernel source are necessary for treble would it be possible for devices using MTK Helio Cpus to be finally updated to 8.1 as Kernel Sources are only available for a couple devices using Helio X SOCs?
For instance Helio X20 source are available from Vernee that helped developers building a semi-stable 7.1 ROM for LeEco X62x devices while the Redmi Note 4 MTK is stuck on AOSP 6.0
I think there is a way. We need to explain how Treble Works (I think anybody know's but casual users)
Devices with Treble Support had a /vendor partition with vendor, kernel and all things needed to boot, Before treble all these things will be on /system partition. Now what we can do ?
We can:
- add /vendor partition by adb
What developers need to know to port Treble sucessfully
- Developers need to know how to mount all drivers to be visible for android in /vendor partition

What is this treble i'm seeing all over the XDA forums?

Hey everyone I just wanted to ask what this trebel label means, my lack of understanding and research tells me its kinda like OTA but for a more secure way to push updates to devices? being someone who has been using my device fine, am just a bit wonderous wondering what this Trebel means for my favorite ROM, Recovery and Kernel
dalebaxter01 said:
Hey everyone I just wanted to ask what this trebel label means, my lack of understanding and research tells me its kinda like OTA but for a more secure way to push updates to devices? being someone who has been using my device fine, am just a bit wonderous wondering what this Trebel means for my favorite ROM, Recovery and Kernel
Click to expand...
Click to collapse
for the moment, forget about it
it's very green and brings more troubles than solutions or any gain in particular. We will see how things develop with time.
You can read more about treble in here
https://www.xda-developers.com/how-project-treble-revolutionizes-custom-roms-android-oreo/
bornlivedie said:
for the moment, forget about it
it's very green and brings more troubles than solutions or any gain in particular. We will see how things develop with time.
You can read more about treble in here
https://www.xda-developers.com/how-project-treble-revolutionizes-custom-roms-android-oreo/
Click to expand...
Click to collapse
Reading the article I'm still a bit confused by what all this would mean for the end user, I really enjoy AEX since I moved from RR and it seems like this is the "latest and greatest" type of situation, yeah okay launches are tough but when everything smoothed out what would this treble allow us all to do?
dalebaxter01 said:
Reading the article I'm still a bit confused by what all this would mean for the end user, I really enjoy AEX since I moved from RR and it seems like this is the "latest and greatest" type of situation, yeah okay launches are tough but when everything smoothed out what would this treble allow us all to do?
Click to expand...
Click to collapse
In reality, it means little to the end user. It could theoretically mean that ROMS require less development time, since all roms in theory are based on a single image.
You can kinda of see this with Google's OEM Partners. At Google I/O they listed a number of partner OEMs that were the first to use treble and for the most part they have released upgrades quicker and more reliably then there non-treble counter parts. This also can be extended to the modding community and in general means that porting roms and developing them on a new phone should be easier.
This is all part of a bigger push by Google to gain uniformity across devices. They started requiring security updates in there SLA's and now are pushing treble.
Trebles's All the benifits goes to vendor and stock rom users Rights. As we are Custom Rom users what are the benefits we getting from Treble Projects?
https://www.androidpolice.com/2018/05/13/project-treble-impact-android-custom-rom-community/
alwynjoshy said:
Trebles's All the benifits goes to vendor and stock rom users Rights. As we are Custom Rom users what are the benefits we getting from Treble Projects?
Click to expand...
Click to collapse
In the future you will be able to flash the custom treble image specific for your hardware, and then a GSI (Generic System Image) of your choice: RR, AEX, DU, Tesla, etc... that will be generic and able to be flashed in any hardware. That means that GSI development teams will be able to maintain their roms and apply the security fixes without the need to create custom rom versions for each hardware. So, finally we will have real OTA updates for custom ROMs. We all hope LineageOS 16 to have more or less this philosophy too. Well see it in September.
So, benefits for the user:
More ROMs to choose for your device (actually all of them!!!)
More frequent upgrades from custom GSI teams.
Oki said:
In the future you will be able to flash the custom treble image specific for your hardware, and then a GSI (Generic System Image) of your choice: RR, AEX, DU, Tesla, etc... that will be generic and able to be flashed in any hardware. That means that GSI development teams will be able to maintain their roms and apply the security fixes without the need to create custom rom versions for each hardware. So, finally we will have real OTA updates for custom ROMs. We all hope LineageOS 16 to have more or less this philosophy too. Well see it in September.
So, benefits for the user:
More ROMs to choose for your device (actually all of them!!!)
More frequent upgrades from custom GSI teams.
Click to expand...
Click to collapse
thanks you well explained ?️.
I have question, If we flashed treble once, are we able to flash any treble based rom, for example any devices treble roms
alwynjoshy said:
thanks you well explained ?️.
I have question, If we flashed treble once, are we able to flash any treble based rom, for example any devices treble roms
Click to expand...
Click to collapse
Once you have the Treble framework in place and have then flashed a device specific vendor image you can from that point on flash any GSI ROM. The thing to note is that so far NFound's Treble ROMs have included vendor image files in them which makes them device specific, you need to check for and remove any vendor image files from Treble ROMs created for other devices if you wish to try the ROM on a device other than what it was made for.
alwynjoshy said:
thanks you well explained ?️.
I have question, If we flashed treble once, are we able to flash any treble based rom, for example any devices treble roms
Click to expand...
Click to collapse
A treble rom is hardware specific, so you cant flash a treble rom designed for a different device. Only GSIs are compatible with multiple devices, and it is this way since the hardware dependant part is only in the treble rom.
Right now there are not fully treble roms available for the Axon7. The currently available roms labeled as treble are delivered and work as a usual full rom. The treble and system parts are still mixed up in those roms. It will take some time until we could enjoy a fully wotking treble rom in the Axon7.

Categories

Resources