[EXPERIMENTAL] [AOSP] Phh-Treble for Tissot [8.0] [PORT]

Status
Not open for further replies.
Search This thread

mahesh2040

Senior Member
Jan 8, 2014
204
49
Xiaomi Poco F1
If Google was able to do it, why can't Xiaomi too? 1st Gen Pixel devices have treble support, even if they had Nougat out of the box. I think Xiaomi is too lazy to implement it.
Google already know ahead of android evolution so they probably implant things already in phones like they already have kept one partition for gen 1 so that if treble come out they can support it. But that's how Google policy and there concern towards there customer, while Xiaomi have some different policies, you may notice they never release kernel source code sooner ( they want people to adapt MIUI , Not custom roms, plus the kernel source they release is messy and they don't even bother to rectify it ).. they will release it when they are about to launch new handset so that they can empty there stock of that phone asap. Also they do support for older handset in terms of software updates but the catch is they won't give big update of major android release , they want you to throw old handset and buy new one for new features.. like I have Redmi note 3 they gave miui 9 but not nougat , it's still mm.. basically they are hiding the true face by giving long term support with update but only for MIUI they don't want custom ROM and it's development they want only miui
 

methuselah

Senior Member
Aug 25, 2011
3,992
2,173
Google already know ahead of android evolution so they probably implant things already in phones like they already have kept one partition for gen 1 so that if treble come out they can support it. But that's how Google policy and there concern towards there customer, while Xiaomi have some different policies, you may notice they never release kernel source code sooner ( they want people to adapt MIUI , Not custom roms, plus the kernel source they release is messy and they don't even bother to rectify it ).. they will release it when they are about to launch new handset so that they can empty there stock of that phone asap. Also they do support for older handset in terms of software updates but the catch is they won't give big update of major android release , they want you to throw old handset and buy new one for new features.. like I have Redmi note 3 they gave miui 9 but not nougat , it's still mm.. basically they are hiding the true face by giving long term support with update but only for MIUI they don't want custom ROM and it's development they want only miui
True. That's why Chinese companies except one plus are worst. They never respect gpl. Franco jumped into the fight it's only when they released the source. Now the thing is whether you should buy them or not ... Xiaomi is always worst when it comes to developer support. Sony on other hand do good things
 
  • Like
Reactions: mahesh2040

gougous3

Senior Member
Jan 11, 2013
339
98
Google already know ahead of android evolution so they probably implant things already in phones like they already have kept one partition for gen 1 so that if treble come out they can support it. But that's how Google policy and there concern towards there customer, while Xiaomi have some different policies, you may notice they never release kernel source code sooner ( they want people to adapt MIUI , Not custom roms, plus the kernel source they release is messy and they don't even bother to rectify it ).. they will release it when they are about to launch new handset so that they can empty there stock of that phone asap. Also they do support for older handset in terms of software updates but the catch is they won't give big update of major android release , they want you to throw old handset and buy new one for new features.. like I have Redmi note 3 they gave miui 9 but not nougat , it's still mm.. basically they are hiding the true face by giving long term support with update but only for MIUI they don't want custom ROM and it's development they want only miui
That is indeed very right as shown here

We really need someone to help repartition system_b as vendor
 
Last edited:
This could be possible

Let me be clear first, I am not an expert on this, but i read and search.

According to this thread of XDA News
Someone ported Project Treble support for Xiaomi Redmi 4.

This developer claims that Xiaomi already use a partition named "cust" of almost 840MB for their customization HALS (not sure if proper word) and the same developer reused this partition as /vendor to use vendor HALS as it is completely unused space for AOSP roms.
Project-Treble-Xiaomi-Redmi-Note-4-1-576x1024.jpg


And more importantly Redmi 4 do not have a-b partitioning for seamless updates claimed by Android where Mi A1 have it!!
Considering this we may not have to request Xiaomi to re-partition,

For other device manufacture many developers claim that it can be done and very easy to achieve by just splitting the space of system partition,
Untitled.png

This needed to be done only once in order to add minimum 5 Years of project treble support will be added to the device (considering Linux kernel is built for this time span of support)

Where some devices have too much unused space like OnePlus 5T, They can also use this space as /vendor partition
Capture2.png
 

CosmicDan

Senior Member
Jun 19, 2009
5,906
7,746
37
Sydney
Xiaomi Poco X3 Pro
Good to see this thread.

Sad to see that the GitHub branch has been deleted. Wat?

As I talked ranted about in my post here, what I think needs to be done is to do-away with Seamless A/B system and replace system_b with vendor. EDIT: Actually, with the knowledge I found, we could have system_a, system_b, vendor_a and vendor_b too, but the Seamless A/B is probably pointless for the custom ROM's we'll surely need to even use Treble anyway.

Here is my quick initial research on that matter.

From what I can see, the partition map is "soft" in this device - meaning it's defined by GPT binary files rather than embedded in the bootloader. So in theory we can try and edit this without risk of hard-brick.

We have the following files in full official fastboot ROM:

gpt_backup0.bin
gpt_both0.bin
gpt_main0.bin
partition.xml

Then I found this article, which mentions these files:

GUIDE -->> How To Create Partition.xml [GPT]

According to this guide, gpt_main0.bin is what's flashed to "partition" via Fastboot. This is also what appears in the flash_factory script in official fastboot ROM.

I think we can build a new gpt_main0.bin from partition.xml, patch0.xml and rawprogram0.xml but I'm really not sure. This is where I'm up to.

EDIT: It seems we can factory-flash the partition map in XML directly if we use Qualcomm QFIL tool (via MBN loader), which is part of QPST, but I am not sure if it will cause issues if we modify XML partition map since the gpt bin files will not match the XML. Also I don't know if QPST talk is allowed on XDA, it is probably some internal Qualcomm tool that's only for their partners...?

EDIT2: Best avoid the QPST and factory flash stuff, that can brick and wipe IMEI. I think all we need to do is edit the partition table via parted, and then the partition table data is actually stored in the "partition" partition, which can then be dumped to a new gpt_both0.bin. Will try this out.
 
Last edited:

methuselah

Senior Member
Aug 25, 2011
3,992
2,173
Good to see this thread.

Sad to see that the GitHub branch has been deleted. Wat?

As I talked ranted about in my post here, what I think needs to be done is to do-away with Seamless A/B system and replace system_b with vendor. EDIT: Actually, with the knowledge I found, we could have system_a, system_b, vendor_a and vendor_b too, but the Seamless A/B is probably pointless for the custom ROM's we'll surely need to even use Treble anyway.

Here is my quick initial research on that matter.

From what I can see, the partition map is "soft" in this device - meaning it's defined by GPT binary files rather than embedded in the bootloader. So in theory we can try and edit this without risk of hard-brick.

We have the following files in full official fastboot ROM:

gpt_backup0.bin
gpt_both0.bin
gpt_main0.bin
partition.xml

Then I found this article, which mentions these files:

GUIDE -->> How To Create Partition.xml [GPT]

According to this guide, gpt_main0.bin is what's flashed to "partition" via Fastboot. This is also what appears in the flash_factory script in official fastboot ROM.

I think we can build a new gpt_main0.bin from partition.xml, patch0.xml and rawprogram0.xml but I'm really not sure. This is where I'm up to.

EDIT: It seems we can factory-flash the partition map in XML directly if we use Qualcomm QFIL tool (via MBN loader), which is part of QPST, but I am not sure if it will cause issues if we modify XML partition map since the gpt bin files will not match the XML. Also I don't know if QPST talk is allowed on XDA, it is probably some internal Qualcomm tool that's only for their partners...?

EDIT2: Best avoid the QPST and factory flash stuff, that can brick and wipe IMEI. I think all we need to do is edit the partition table via parted, and then the partition table data is actually stored in the "partition" partition, which can then be dumped to a new gpt_both0.bin. Will try this out.
Whenever I see a post from you it's always there with so much information!.... Hope to see the something cool stuff at the end of the road
 
  • Like
Reactions: CosmicDan

CosmicDan

Senior Member
Jun 19, 2009
5,906
7,746
37
Sydney
Xiaomi Poco X3 Pro
So the GPT information is stored at the beginning of the eMMC block device, which I dumped, but for some reason is quite a bit different to the GPT bin that's included in official fastboot firmware packs.

I'd like some more data before I continue experimenting with my daily device :D I can't find a working "decoder" or "decompiler" for GPT binary yet either, all the existing scripts/tools I found error-out.

If a volunteer or two could share their GPT info dumps too (along with if you remember the last official stock firmware you flashed in fastboot; either Nougat or Oreo) I would appreciate it.

Run something like this via shell / command prompt...

Code:
adb shell dd if=/dev/block/mmcblk0 of=/tmp/gpt.bin bs=8 count=4352
adb pull /tmp/gpt.bin
...and share the gpt.bin file here (probably have to ZIP it for XDA to accept it).

Thanks!
 

CosmicDan

Senior Member
Jun 19, 2009
5,906
7,746
37
Sydney
Xiaomi Poco X3 Pro
Sorry for triple post, but anyway...

Bricked my device, then broken the screen when trying to access test-point (deep flash cable didn't work). Will be a while before I can get a replacement screen :(

Managed to recover from brick at least. Well, I think so... when I boot to recovery I get "USB Device Not Recognized" which is scary.

But I'll get a new screen anyway and resume whenever that is.

Back to my garbage Redmi Note 4 MTK until then...
 

methuselah

Senior Member
Aug 25, 2011
3,992
2,173
Sorry for triple post, but anyway...

Bricked my device, then broken the screen when trying to access test-point (deep flash cable didn't work). Will be a while before I can get a replacement screen :(

Managed to recover from brick at least. Well, I think so... when I boot to recovery I get "USB Device Not Recognized" which is scary.

But I'll get a new screen anyway and resume whenever that is.

Back to my garbage Redmi Note 4 MTK until then...

ohhh so sorry to hear that. I hope you will have your device working normally. :(
 
  • Like
Reactions: CosmicDan

alkesh95

Senior Member
Mar 22, 2012
1,232
228
Mumbai
Tried reading with a decoder only readable output i could see was modem_b. So i think it's the correct file.
Rename it back to gpt.bin from gpt.zip
 

Attachments

  • gpt.zip
    34 KB · Views: 3
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    EDIT:
    We have now achieved proper Treble implementation. We no longer need this method of trying to port a GSI to our device. This thread is now absolute. Please refer to newer threads to get Treble support on your Tissot devices.

    UPDATE:
    This ROM is currently not booting. So use this thread only to provide useful logs.
    Interested developers can help me to try to port Treble :) :
    https://github.com/ghpranav/android_device_xiaomi_tissot/tree/Trebelizer
    https://github.com/ghpranav/proprietary_vendor_xiaomi/tree/lineage-15.0/

    Code:
    /*
     * Your warranty is now void.
     *
     * We are 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 us for messing up your device, we will laugh at you.
     *
     */

    WARNING: You'll most probably loose ALL your data, and might break your phone, because our phone doesn't support Treble officially. Please use with extreme caution, because this hasn't been tested yet!

    The goal of this ROM is to provide full Treble-compatible hardware support, and nothing else.
    This means that hardware which DON'T have Treble API won't be supported, like Essential's external camera.
    No feature will be added. This will ease forward porting to new Android versions, which is the very goal of Project Treble :)

    My hope is that other ROM developers will use this ROM as a basis to construct more advanced ROM.
    Devices will be marked as supported, unless known otherwise.

    I have tried to port a Treble based rom to our Mi A1 device based on my knowledge of Treble. If this works properly, then we might be able to use almost any Project Treble rom on our device.

    How to flash:
    - First, you MUST be running on stock Android 8.0 ROM (OPR1.170623.026.7.12.29)
    - Obviously, unlock your bootloader
    - Download the zip file, & extract it.
    - Flash the system.img to the correct active slot [A/B]
    - Do a Factory reset
    - Reboot

    Downloads:
    V1:
    https://www.androidfilehost.com/?fid=962157660013069216


    Changelog:
    v1: (02/01/2018)
    - Initial port based on Phh-Treble v7 (inc. gapps & su).

    SuperSU and Magisk screws with SELinux policy. DO NOT USE SuperSU OR Magisk WITH THIS ROM.

    XDA:DevDB Information
    Phh-Treble Tissot, ROM for the Xiaomi Mi A1

    Contributors
    ghpranav, phhusson
    Source Code: https://github.com/ghpranav/android_device_xiaomi_tissot/tree/Trebelizer

    ROM OS Version: 8.x Oreo
    ROM Firmware Required: OPR1.170623.026.7.12.29
    Based On: AOSP

    Version Information
    Status: Testing
    Current Beta Version: V1
    Beta Release Date: 2018-01-02

    Created 2018-01-02
    Last Updated 2018-08-31
    15
    Useful logs?
    Our device does not support treble
    This ROM will never boot,I bet it doesn't even include any device related HAL.
    Do you even know what treble is?

    I know what Treble is. I tried to port ROM, instead of porting Treble support. But I failed. So now I'll wait for Xiaomi to release kernel source, so that I can try to create a separate vendor image partition, & try to implement HALs, so that we can actually port Treble itself. And yes, Treble support can be ported, for instance Mi5 devs are working on it, & it'll be released soon...
    13
    Good to see this thread.

    Sad to see that the GitHub branch has been deleted. Wat?

    As I talked ranted about in my post here, what I think needs to be done is to do-away with Seamless A/B system and replace system_b with vendor. EDIT: Actually, with the knowledge I found, we could have system_a, system_b, vendor_a and vendor_b too, but the Seamless A/B is probably pointless for the custom ROM's we'll surely need to even use Treble anyway.

    Here is my quick initial research on that matter.

    From what I can see, the partition map is "soft" in this device - meaning it's defined by GPT binary files rather than embedded in the bootloader. So in theory we can try and edit this without risk of hard-brick.

    We have the following files in full official fastboot ROM:

    gpt_backup0.bin
    gpt_both0.bin
    gpt_main0.bin
    partition.xml

    Then I found this article, which mentions these files:

    GUIDE -->> How To Create Partition.xml [GPT]

    According to this guide, gpt_main0.bin is what's flashed to "partition" via Fastboot. This is also what appears in the flash_factory script in official fastboot ROM.

    I think we can build a new gpt_main0.bin from partition.xml, patch0.xml and rawprogram0.xml but I'm really not sure. This is where I'm up to.

    EDIT: It seems we can factory-flash the partition map in XML directly if we use Qualcomm QFIL tool (via MBN loader), which is part of QPST, but I am not sure if it will cause issues if we modify XML partition map since the gpt bin files will not match the XML. Also I don't know if QPST talk is allowed on XDA, it is probably some internal Qualcomm tool that's only for their partners...?

    EDIT2: Best avoid the QPST and factory flash stuff, that can brick and wipe IMEI. I think all we need to do is edit the partition table via parted, and then the partition table data is actually stored in the "partition" partition, which can then be dumped to a new gpt_both0.bin. Will try this out.
    10
    This could be possible

    Let me be clear first, I am not an expert on this, but i read and search.

    According to this thread of XDA News
    Someone ported Project Treble support for Xiaomi Redmi 4.

    This developer claims that Xiaomi already use a partition named "cust" of almost 840MB for their customization HALS (not sure if proper word) and the same developer reused this partition as /vendor to use vendor HALS as it is completely unused space for AOSP roms.
    Project-Treble-Xiaomi-Redmi-Note-4-1-576x1024.jpg


    And more importantly Redmi 4 do not have a-b partitioning for seamless updates claimed by Android where Mi A1 have it!!
    Considering this we may not have to request Xiaomi to re-partition,

    For other device manufacture many developers claim that it can be done and very easy to achieve by just splitting the space of system partition,
    Untitled.png

    This needed to be done only once in order to add minimum 5 Years of project treble support will be added to the device (considering Linux kernel is built for this time span of support)

    Where some devices have too much unused space like OnePlus 5T, They can also use this space as /vendor partition
    Capture2.png
    6
    So the GPT information is stored at the beginning of the eMMC block device, which I dumped, but for some reason is quite a bit different to the GPT bin that's included in official fastboot firmware packs.

    I'd like some more data before I continue experimenting with my daily device :D I can't find a working "decoder" or "decompiler" for GPT binary yet either, all the existing scripts/tools I found error-out.

    If a volunteer or two could share their GPT info dumps too (along with if you remember the last official stock firmware you flashed in fastboot; either Nougat or Oreo) I would appreciate it.

    Run something like this via shell / command prompt...

    Code:
    adb shell dd if=/dev/block/mmcblk0 of=/tmp/gpt.bin bs=8 count=4352
    adb pull /tmp/gpt.bin
    ...and share the gpt.bin file here (probably have to ZIP it for XDA to accept it).

    Thanks!