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

Search This thread
Nov 22, 2018
39
8
Lake Stevens, WA
I can't Get it actually

I have found this post in Chinese in Coolapk: https://www.coolapk.com/feed/7398520
It's a guide for how to enable project treble on device that have no extra partition to use as vendor.
And this post for how to make a vendor image: https://www.coolapk.com/feed/7423991 (also in Chinese)

BTW, can anyone port treble support to Nokia 6 2017?

Tried using it and it will only provide me an install to the CoolAPK app store
 

Reverant

Member
Jan 20, 2017
22
23
404 :(

Even if I install the coolapk store.

Code:
#玩机技巧# #ProjectTreble# 
少图警告#(受虐滑稽)其实是因为我懒得开电脑传截图#(cos滑稽)

之前我发过新建一个vendor分区来实现treble化的方法
https://www.coolapk.com/feed/7398520 
不过那个教程里面有一些错误#(受虐滑稽)
先修正错误,然后继续下一步:
在boot.img的修改过程中,我们并不需要改动init.rc
就是说这一步是不需要的
我们还需要把这几个文件移动到ramdisk之外,分别是 plat* nonplat* sepolicy vndservice_contexts default.prop (其中*是通配符)
然后使用ln -s /system/etc/prop.default default.prop来建立软链接
以及SELinux permissive也不是必要的

修正完毕,重新打包boot.img,下面开始制作vendor镜像

实际上如果有条件的话,从源码直接编译出boot和vendor是最方便的,兼容性也是最好的#(流汗滑稽)

并且我不保证用下面的方法制作的vendor.img是完全可用的#(受虐滑稽)#(受虐滑稽)

第一步:提取文件

打开手机的USB调试,连上电脑
执行这个命令
adb pull /system/vendor vendor
adb shell cat /system/build.prop >> vendor/build.prop
会从手机中提取vendor文件夹和build.prop
使用我昨天更新的generate_vintf提取需要的XML文件:
cd Treble_Any_Device/Tools/generate_vintf
./generate.sh

第二步:复制文件

按照这个格式来:
原文件 -> 复制后的文件

Treble_Any_Device/Tools/generate_vintf/out/manifest.xml -> vendor/manifest.xml
Treble_Any_Device/Tools/generate_vintf/out/compatibility_matrix_device.xml -> /vendor/compatibility_matrix.xml
从boot的ramdisk中提取的nonplat*和vndservice_contexts -> /vendor/etc/selinux/nonplat* 和 vndservice_contexts
从boot的ramdisk中提取的sepolicy -> /vendor/etc/selinux/prebuilt_sepolicy
从boot的ramdisk中提取的default.prop -> vendor/default.prop

第三步
重启手机,进入recovery,挂载vendor
使用adb push vendor/* vendor/ 把文件复制到vendor分区中
也可以使用make_ext4fs来生成img

教程结束#(cos滑稽)
求py @酷安小编 @梨子

补充:tools中新增了能分离kernel和dtb的工具#(受虐滑稽)

教程写的有点乱 请见谅[二哈]
如果教程有错误,也欢迎指出#(受虐滑稽)


this is the text, i don't have the images, sorry, is untranslated to avoid mistakes, good luck
 
  • Like
Reactions: lezsakdomi

DmitryLabutov

New member
Nov 9, 2018
2
0
Moscow
Hi everyone! Can anyone translate this from Chinese? I really want to try porting Treble to unsupported devices, for me it's ASUS TF300T and ZC520KL, both of them already repartitioned and my question is how to move vendor files to the new partition and repack boot to work properly with new /vendor partition.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    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.
    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.
    10
    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
    10
    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????
    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)
    8
    @BakedTator Do you reckon an open-source Treble-compatible alternative could be made?
    We could call it "Bass".
    7
    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