[PARTITION][TREBLE] Project Treble for Samsung Galaxy S7 [SM-G930F][15.02.2019] - Samsung Galaxy S7 (Exynos) ROMs, Kernels, Recoveri

- T R E B L E Y -
Android Partition Treblerizer
A tool able to seamlessly create / remove the vendor partition from within TWRP​
INTRODUCTION
The creation of a tool able to create and remove the supplier partition from TWRP, so a computer was not required. So I created this flaming TWRP ZIP which can create and remove the vendor partition from the userdata system or partitions without a computer and without deleting the files in the mother partition in the recommended configuration.
Trebley, finally, also expands on our much loved Galaxy S7, bringing with it Project Treble on the much loved device.
The tool will try to resize the mother partition without deleting it, either during the creation and removal of the supplier partition. However, this can only be done when the mother partition is ext4, only when the supplier partition is at the end of the mother partition and when the mother partition is not encrypted. The recommended configuration is the one that is obtained by selecting the first option in each option: subdividing 512 MB from the end of the system partition. A reboot is required after applying the patch to the partition table because the kernel needs to reload it before doing anything else.
REQUIREMENTS
Due to the use of a key detection binary, it is compatible only with ARM and ARM64 devices running TWRP. So far I have tested it in the Samsung Galaxy S7 but It should work in any compatible device. I made it this way so other legacy devices could transition to Treble ROMs + GSI, and Android Pie. Please let me know about other devices using this tool!!!!!
INSTALLATION
WARNING, THIS SOFTWARE COULD WIPE ALL THE DATA IN YOUR DEVICE, INCLUDING THE INTERNAL STORAGE.
IT REQUIRES TWRP CUSTOM RECOVERY IN AN UNLOCKED DEVICE, OTHERWISE YOUR DEVICE COULD BE BRICKED AND IF YOU FOLLOW MY STEPS BELOW, YOU WILL LOSE YOUR WARRANTY, KNOX WILL DISPLAY 0x1! I'M NOT RESPONSIBLE FOR ANY DAMAGED DEVICE!.
!!! Whatever you do, it is at your own risk !!!
Either for creating or removing a vendor partition, follow these steps:
1. Download the TWRP ZIP tool to your External SD card.
2. Boot to TWRP recovery, under Install, flash the ZIP file as any other ROM or MOD file to execute the tool.
3. Reboot to recovery again to ensure the changes are applied properly.
4. In some cases you will need to format the mother partition after adding or removing the vendor partition next to it.
CREATE A VENDOR PARTITION:
So far these are the available options:
Mother partition selection: system / userdata
Split position: Splitting from the end / start of the mother partition.
Vendor partition size: 512 / 915 MB
REMOVE THE VENDOR PARTITION:
Should a Vendor module already exists, Trebley offers to remove it, returning to a Non-Treble partition table. It will return the space to the mother partition, system or userdata. So, older non Treble ROMs could be flashed after the mandatory reboot.
DOWNLOAD
Trebley_APT_v1.0_ARM_20190215-signed.zip
SOURCES
All rights reserved to the project: Party and its creator(@Oki).
CAUTION
Currently, we recommend the use of Trebley, exclusively to developers, as until now there has been no development of material related to the project treble, this project lays the foundations creating the partition vendor, for the support treble.
CREDITS
@someone755 for the keycheck binary
@Zackptg5 for the V4A install script that inspired my version.
@Oki for the base script.
XDA:DevDB Information
[PARTITION][TREBLE] Project Treble for Samsung Galaxy S7 [SM-G930F][15.02.2019], Tool/Utility for the Samsung Galaxy S7
Contributors
DarioRetr
Source Code: https://forum.xda-developers.com/axon-7/development/tool-party-v0-1-vendor-partition-t3831517
Version Information
Status: Alpha
Current Stable Version: V1.0
Stable Release Date: 2019-02-26
Current Beta Version: V0.5
Beta Release Date: 2019-02-15
Created 2019-02-19
Last Updated 2019-02-19

Thanks for that, maybe there are already some of the Roms that have worked or been tested?

You have no idea how long i have been waiting for this, thx so much! I understand that its alpha, but just wanted to report that it gives me error 2 after i select all of the options. If you need logs, tell me which ones and i can get them.
Just to be clear this will let me flash gsi's? Sorry, im not 100% sure how treble works. Thanks again!

Jack_Rickwood said:
You have no idea how long i have been waiting for this, thx so much! I understand that its alpha, but just wanted to report that it gives me error 2 after i select all of the options. If you need logs, tell me which ones and i can get them.
Just to be clear this will let me flash gsi's? Sorry, im not 100% sure how treble works. Thanks again!
Click to expand...
Click to collapse
Are you a developer? If not, do not flash this; this will not give you Treble. It will give your phone the foundation only.
---------- Post added at 05:05 AM ---------- Previous post was at 05:04 AM ----------
Glad to see Treble making its way to S7.

If understood correctly this will only generate a separeted vendor partition right? Before people could start flashing a treble rom it's needed to generate the files in expected treble structure to fill this partition.

flitzjoy said:
If understood correctly this will only generate a separeted vendor partition right? Before people could start flashing a treble rom it's needed to generate the files in expected treble structure to fill this partition.
Click to expand...
Click to collapse
Yes. I hope all that review the post reads the warning in red font.

Related

[MOD][15-NOV-2016] MultiROM 33 + TWRP_3.0.2-6_MultiROM_Edition_2016-11-15 [TestBuild]

{
"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"
}
You use this tool at your own risk!!
I have tried to put as many safeguards as I can,
but I cannot be held accountable for any soft-bricks, hard-bricks, loss of data and/or information,
or anything else going wrong.​
Introduction
MultiROM is one-of-a-kind multi-boot mod for HTC 10. It can boot any Android ROM as well as other systems like Ubuntu Touch, Plasma Active, Bohdi Linux or WebOS port. Besides booting from device's internal memory, MultiROM can boot from USB drive connected to the device via OTG cable. The main part of MultiROM is a boot manager, which appears every time your device starts and lets you choose ROM to boot. You can see how it looks on the left image below and in gallery. ROMs are installed and managed via modified TWRP recovery. You can use standard ZIP files to install secondary Android ROMs, daily prebuilt image files to install Ubuntu Touch and MultiROM even has its own installer system, which can be used to ship other Linux-based systems.
Features:
* Multiboot any number of Android ROMs
* Restore nandroid backup as secondary ROM
* Use for example Ubuntu Touch or Desktop alongside with Android, without the need of device formatting
* Boot from USB drive attached via OTG cable
​
Warning!
It _is_ dangerous. This whole thing is basically one giant hack - none of these systems are made with multibooting in mind. It is messing with boot sector and data partition. It is no longer messing with data partition or boot sector (actually the no-kexec workaround is messing with your boot sector), but it is possible that something goes wrong and you will have to flash factory images again.
Make backups. Always.​
Now seriously: HTC 10 Warnings!
Beware of Dragons, Goblins, Gremlins and lingering primary_boot.img(RIP)
Due to lack of kexec-hardboot kernel support, I am messing with your boot partition!​
Since we lack kernels with kexec-hardboot patch, I'm using a workaround to bypass that restriction, and although tested successfully on the HTC One M7, M8, M9, and HTC 10, as well as several other devices I'm not involved with, things can still go wrong, since I'm directly flashing your boot partition.
I have yet to see any negative effect of that, and version 4 of the no-kexec workaround is much more robust, you should still be aware that I'm "temp-flashing" your real boot partition.
If you are in doubt, either ask, or avoid it completely; MultiROM has always been a huge hack to begin with, and this is even more of a hack.
Always have a backup ready. Possibly even RUU! ... I have not had to, I have also not encountered any loss whatsoever, but better be safe!
Current problems on the HTC 10
* OTG is untested and unsupported at the moment
* exFAT partitions are not supported currently
^^ those haven't worked for quite a while, so it's not really HTC 10 specific
Encrypted devices: Your secondary ROMs do not know your device is encrypted, do not (again: do not) try to encrypt your device while booted into a secondary ROM.​
Secure boot (ie require Password/Pattern/PIN on boot): Thanks to @Captain_Throwback who found out, that under certain circumstances (yet to be determined), your primary (possibly secondary as well) may loose the ability unlock your LockScreen using your Password/Pattern/PIN.
The same thing has been observed in TWRP restores, and although your password is correct and does decrypt your device, it breaks at the lockscreen for some reason.
I recommend you disable Password/Pattern/PIN on boot until / IF the issue is resolved, but in case you do find yourself in that situation, please go ahead and follow the instruction posted in the TWRP thread:
10. After I restored my Data backup and boot back to Android, I'm entering the correct PIN/password, but it's telling me the password is wrong. What happened, and how do I fix it?
It appears that sometimes after restoring a backup of Data where security was enabled (such as a PIN or password lock), the device does not recognize the correct password. There are two ways to avoid this issue:
Disable security in Android before making a backup of data.
After restoring Data, while still in TWRP, use the TWRP File Manager to navigate to /data/system and delete all the locksettings.* files (such as locksettings.db, etc). When you reboot, the password will be gone.
​
Please bear in mind, that some ROMs (particularly Sense based ROMs), will take a long time to boot up, well above 10minutes, so patience!​
Installation
Not supported at this time: 1. Via MultiROM Manager app
This is the easiest way to install everything MultiROM needs. Install the app and select MultiROM and recovery on the Install/Update card. If the Status card says Kernel: doesn't have kexec-hardboot patch! in red letters, you have to install also patched kernel - either select one on the Install/Update card or get some 3rd-party kernel here on XDA. You are chosing kernel for your primary ROM, not any of your (future) secondary ROMs, so select the version accordingly.
Press "Install" on the Install/Update card to start the installation.
​
2. Manual installation
MultiROM has 3 parts (well, it should, but in this case it only has 2) you need to install:
Modified recovery (TWRP_3.x.x-x_multirom_pme_YYYYDDMM-pp.img) - download the IMG file from second post and use
TWRP itself to flash newer TWRP to recovery partition:
TWRP->Install-> select Images -> TWRP_3.x.x-x_multirom_pme_YYYYDDMM-pp.img -> to Recovery -> Reboot to Recovery
.
or
.
"fastboot flash recovery TWRP_3.x.x-x_multirom_pme_YYYYDDMM-pp.img"
(in download mode, for example)
Code:
C:ADBADB_10>adb reboot download
C:ADBADB_10>fastboot devices
FAxxxxxxxxxx fastboot
C:ADBADB_10>fastboot flash recovery TWRP_3.0.2-6_multirom_pme_20160917-02.img
target reported max download size of 800000000 bytes
sending 'recovery' (25700 KB)...
OKAY [ 2.001s]
writing 'recovery'...
(bootloader) HOSD CL#761759
(bootloader) [email protected]
(bootloader) [email protected]%
(bootloader) Update partition OK
(bootloader) [email protected]
OKAY [ 2.872s]
finished. total time: 4.878s
C:ADBADB_10>fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.004s]
finished. total time: 0.005s
MultiROM (multirom-YYYYMMDD-vXXd-UNOFFICIAL-pme.zip) - download the ZIP file from second post and flash it in the MultiROM Recovery.
.
.
Patched kernel - You can use either one of the stock ones in second post or third-party kernels which include the patch, you can see list in the second post. Download the ZIP file and flash it in recovery.
We don't have a patched kernel, so I'm using a workaround.
You current rom will not be erased by the installation.
Download links are in the third post.​
Adding ROMs
1. Android
Go to recovery, enter the MultiROM section of TWRP (by clicking the icon in to top right corner) -> Add ROM. Select the ROM's zip file and confirm. As for the space, clean installation of stock 4.2 after first boot (with dalvik cache generated and connected to google account) takes 676mb of space.​
2. Ubuntu Touch this is NOT SUPPORTED
Use the MultiROM Manager app to install Ubuntu Touch.
Ubuntu Touch is in development - MultiROM will have to be updated to keep up with future changes in Ubuntu, so there's a good chance this method stops working after a while and I'll have to fix it.
Using USB drive
During installation, recovery lets you select install location. Plug in the USB drive, wait a while and press "refresh" so that it shows partitions on the USB drive. You just select the location (extX, NTFS and FAT32 partitions are supported) and proceed with the installation.
If you wanna use other than default FAT32 partition, just format it in PC. If you don't know how/don't know where to find out how, you probably should not try installing MultiROM.
If you are installing to NTFS or FAT32 partition, recovery asks you to set image size for all the partitions - this cannot be easilly changed afterward, so choose carefully. FAT32 is limited to maximum of 4095MB per image - it is limitation of the filesystem, I can do nothing about that.
Installation to USB drives takes a bit longer, because the flash drive is (usually) slower and it needs to create the images, so installation of Ubuntu to 4Gb image on my pretty fast USB drive takes about 20 minutes.
Enumerating USB drive can take a while in MultiROM menu, so when you press the "USB" button in MultiROM, wait a while (max. 30-45s) until it searches the USB drive. It does it by itself, no need to press something, just wait.​
Updating/changing ROMs
1. Primary ROM (Internal)
Flash ROM's ZIP file as usual, do factory reset if needed (it won't erase secondary ROMs)
Go to the MultiROM section of TWRP (by clicking the icon in to top right corner) and do Inject curr. boot sector.
2. Secondary Android ROMs
If you want to change the ROM, delete it and add new one. To update ROM, follow these steps:
Go to the MultiROM section of TWRP (by clicking the icon in to top right corner) -> List ROMs and select the ROM you want to update.
Select "Flash ZIP" and flash ROM's ZIP file.
In some cases, you might need to flash patched kernel - get corresponding patched kernel version from second post and flash it to the secondary ROM sama way you flashed ROM's ZIP file.
Explanation of recovery menus
Main menu
- Add ROM - add ROM to boot
- List ROMs - list installed ROMs and manage them
- Inject boot.img file - When you download for example kernel, which is distrubuted as whole boot.img (eg. franco kernel), you have to use this option on it, otherwise you would lose MultiROM.
- Inject curr. boot sector - Use this option if MultiROM does not show up on boot, for example after kernel installation.
- Settings - well, settings.
Manage ROM
- Rename, delete - I believe these are obvious
- Flash ZIP (only Android ROMs) - flash ZIP to the ROM, for example gapps
- Add/replace boot.img - replaces boot.img used by this ROM, this is more like developer option.
- Re-patch init - this is available only for ubuntu. Use it when ubuntu cannot find root partition, ie. after apt-get upgrade which changed the init script.​
Screenshots
Special Thanks
@Tasssadar: Original author of MultiROM.
@Captain_Throwback: For testing, giving me a hard time, and warning you guys about the secure boot (ie require Password/Pattern/PIN on boot) issue.
zhuowei: For the fake properties idea.
Source code
MultiROM - https://github.com/Tasssadar/multirom (branch master)
Modified TWRP - https://github.com/Tasssadar/Team-Win-Recovery-Project (branch master)
Device files - ....
Everything is here:
https://github.com/multirom-htc
https://github.com/nkk71​
XDA:DevDB Information
MultiROM, Tool/Utility for the HTC 10
Contributors
nkk71
Version Information
Status: Stable
Current Stable Version: 33testbuild
Stable Release Date: 2016-11-15
Created 2016-09-18
Last Updated 2016-11-15
FAQ and other notes
HTC 10 - Peculiarities / Bugs
There are no kexec-hardboot kernels for the HTC 10, so you need to have the no-kexec-workaround enabled. Please refer to post 4 for details.
.
A few notes about enabled adb in MultiROM boot menu: having adb enabled in MultiROM boot menu (TWRP->MultiROM->Settings->Enable ADB) may interfere with the ROMs "connection" (MTP, etc), possibly even prevent the ROM from booting (rarely, but I've seen it happen). Since this option is usually only used for debugging, I recommend to keep this option disabled.
.
Secure boot (ie require Password/Pattern/PIN on boot): Thanks to Captain_Throwback who found out, that under certain circumstances (yet to be determined), your primary (possibly secondary as well) may loose the ability unlock your LockScreen using your Password/Pattern/PIN.
The same thing has been observed in TWRP restores, and although your password is correct and does decrypt your device, it breaks at the lockscreen for some reason.
I recommend you disable Password/Pattern/PIN on boot until / IF the issue is resolved, but in case you do find yourself in that situation, please go ahead and follow the instruction posted in the TWRP thread:
10. After I restored my Data backup and boot back to Android, I'm entering the correct PIN/password, but it's telling me the password is wrong. What happened, and how do I fix it?
It appears that sometimes after restoring a backup of Data where security was enabled (such as a PIN or password lock), the device does not recognize the correct password. There are two ways to avoid this issue:
Disable security in Android before making a backup of data.
After restoring Data, while still in TWRP, use the TWRP File Manager to navigate to /data/system and delete all the locksettings.* files (such as locksettings.db, etc). When you reboot, the password will be gone.
​
Something not working, or you need help debugging
Please provide the following information:
a detailed explanation of the problem
.
the recovery.log (found in /tmp/recovery.log or by copying it to the sdcard and then copying it to PC)
.
the logs from /sdcard/multirom-klogs (zip those up, before uploading). that option needs to be enabled in TWRP->MultiROM->Settings
.
the link to the thread and name of file (+ which version) you are having problems with
.
due to the large size of some of these ROMs, I may not have time to download and test them, so please also upload the updater-script (found in ROM.ZIP under /META-INF/com/google/android/)
Supported File Systems for secondary ROMs
Currently only the following partitions can boot secondary ROMs:
Internal Storage
.
An external sdcard, properly partitioned with an ext4 partition (see below)
Partitioning your External SD Card
Warning: You will loose all information on your external sdcard!!
There is no way of retrieving that information, so copy everything to your PC before proceeding!!
In order to make a decent assessment of the size of your ext4 partition, below is a small table of some of the ROMs I've installed to my ext4 partition:
Code:
[U][B]2.5G BeanStalk-6.20-20160905-pm[/B][/U]
1.1G BeanStalk-6.20-20160905-pm/data
1.3G BeanStalk-6.20-20160905-pm/system
[U][B]1.4G cm-13.0-20160915-UNOFFICIA[/B][/U]
396M cm-13.0-20160915-UNOFFICIA/data
960M cm-13.0-20160915-UNOFFICIA/system
[U][B]3.8G ice-2.1.1_PERFUME_UHL_M60_[/B][/U]
1.7G ice-2.1.1_PERFUME_UHL_M60_/data
2.0G ice-2.1.1_PERFUME_UHL_M60_/system
[B][U]4.0G Viper10_3.1.0[/U][/B]
1.8G Viper10_3.1.0/data
2.1G Viper10_3.1.0/system
Please bear in mind, those installs have none or very few extra downloaded apps, which would also be using the data partition; if you need a reference for comparison, you can select Backup in TWRP, which will show you the size of your current /data partition (this excludes "Internal Storage")... mine is about 8GB !
FYI: I'm using a 200GB sdcard, and have it setup with a 30GB ext4 partition... but that's just me
Step 1: Partitioning
TWRP Main Menu
-> Advanced
-> Partition SD Card
-> selected Micro SDCard
Set the EXT Size to the size of your choice
Set Swap Size to zero
Set File System to ext4
-> swipe to proceed with repartitioning
go back to the main menu.
Example Screenshots:
TWRP Main Screen
Select Advanced
Select Partition SD Card, Micro SDCard is selected, press OK
Set the EXT Size to the size of your choice
Set Swap Size to zero
Set File System to ext4
then swipe to begin
Partitioning complete
Step 2 (optional, but recommended): Changing the first partition to exFAT
The repartitioning in step 1, has formatted your card with two partitions, the first one (used by ROMs as external storage) being FAT32 formatted. Since FAT32 has certain limitations, in particular the 4GB file size limit, it's recommended to reformat it as exFAT.
TWRP
-> Wipe
-> Advanced Wipe
-> select external_sd or Micro SDCard (whichever is shown in the menu)
-> Repair or Change File System
-> Change File System
-> select exFAT
-> swipe to reformat the first partition to exFAT
Example Screenshots:
Wipe Menu, select Advanced Wipe
Advanced Wipe Menu:
select external_sd or Micro SDCard (whichever is shown in the menu)
and click Repair or Change File System
Select Change File System
Select exFAT
Swipe to reformat to exFAT
Formatting complete
​
Device encryption
Since v32, MultiROM supports encryption on this device (it has to be added for each device separately). It works only with Android-based secondary ROMs and the secondary ROMs don't know the device is encrypted, so they would allow you to encrypt the device again - do not do that. If you're using password, pin or pattern for the encryption, MultiROM will ask you for the password on boot. If you're booting the primary ROM, then Android will ask you for the password _again_ - unfortunately, there is no way for me to pass the "unencrypted" status to Android. If you're booting secondary ROM, MultiROM will ask you for the password again after the reboot - that's because I have to unencrypt the /data partition after the ROM's kernel is loaded.
I could omit the second password prompt when booting secondary ROM by temporarily saving the password somewhere, but that's obviously unsafe. So is using encryption with unlocked device though, so I might add this later.​About security
In order to make multi-booting possible, MultiROM has to sacrifice some security measures. Firstly, on secondary Android ROMs, /system is not mounted read-only. While there are other things preventing malicious software from messing with /system, this might potentialy make it easier for such software to attack that system.​
What do the ROMs share?
All ROMs are separate, except /sdcard, which is shared between all Android ROMs.​
How many ROMs can I have?/Where are the ROMs stored?
You can have as many ROMs as you can fit in your /sdcard. All the ROMs are stored in /sdcard/multirom/roms or on an USB drive. This folder is unaccessible in Android, to prevent mediascanner from scanning it. You can either in recovery, or obtain root and go to /data/media/0/multirom/roms.​
The menu with all the ROMs won't show up during boot, how to fix it?
Either re-flash the MultiROM zip or go to recovery, Advanced -> MultiROM -> Inject curr. boot sector.
The reason for this is that something rewrote your boot.img, which happens for example when you flash a kernel. MultiROM's boot menu is part of the boot image, so it has to be added into it again.​
My secondary ROM(s) no longer boot up, after I flashed a new primary ROM / Kernel / boot.img, and the MultiROM menu (as mentioned above) no longer appears
Please issue a restorecon on the particular ROM:
TWRP -> MultiROM -> select ROM in question -> Run Restorecon
Technical explanation
Usually most init.rc scripts will run a restorecon_recursive on /data and /mnt(also cache, but that's not too important for us)
Code:
restorecon_recursive /data
restorecon_recursive /mnt
this will supposedly restore file contexts (permissions if you prefer the older term) on all your data partitions, it will however break all your secondary ROMs as their system partition actually lives there, but the "permissions" have been overwritten to make it look like just normal data.
This is also why so many Android 7 (Nougat) MultiROM people (in other threads) are having so much trouble, as the file_contexts format has changed, and that hasn't been updated for the new format yet.​
Downloads
Current Test Builds
All Current Test Builds can be found on androidfilehost under MultiROM TEST BUILDS
You should be using these, not the ones mentioned below!
Definition of Test Builds: These are stable builds which I have and am using (and testing). They contain the most up to date fixes as mentioned in the changelog under <tba>.
The main reason I'm calling them "Test Builds", is because they have not gone through extensive testing as what I would usually do for a "release version". I think most people would call them release versions, but I tend to be more conservative.
.
The second reason, they get uploaded to AFH instead of directly here, is two fold:
I'm maintaining the M7, M8, M9 and HTC 10 MultiROM versions, and uploading to AFH is easier and faster for me.
Updating the actual threads and posts, is too time consuming every time I want to push an update.
1. Main downloads
Modified recovery (based on TWRP): TWRP_3.0.2-6_multirom_pme_20160920-04.img
MultiROM Main ZIP: multirom-20160920-v33b-UNOFFICIAL-pme.zip
Not supported at this time MultiROM Manager Android app: Google Play or link to APK
AndroidFileHost (mirror & old versions): https://www.androidfilehost.com/?w=files&flid=114470
​
2. third-party kernels with kexec-hardboot patch
None exist at the moment, hence the use of the workaround.​
3. Uninstaller
MultiROM uninstaller: multirom_uninstaller
Flash this ZIP file to remove MultiROM from your device. It will erase all secondary ROMs. If you don't want MultiROM menus in recovery, re-flash [RECOVERY][pme] TWRP touch recovery, but it is not needed - those menus don't do anything if MultiROM is not installed.​
Changelog
MultiROM Managar App:
Code:
2016-11-11 MultiROM Manager App[-debug] version
=====================
* Add support for external storage
(allows listing, manipulating, and booting secondary ROMs on external storage)
* Highlight currently running ROM first
(also disallow deletion of it)
* Show ROMs in order of location (Current, then Internal, etc.)
* Allow duplicate ROM names if on separate partition
* Fix Widget
* Support for HTC 10 (pme)
* Support for HTC One M9 (hima)
* Support for HTC One M8
* Support for HTC One M7 (m7univ)
MultiROM:
Code:
2017-10-27 MultiROM v33
=====================
* New 'System Partition Mode' ROMs ([URL="https://github.com/nkk71/multirom/commit/dfb1a294ab55374b80bb6f14c2422850610c986d"]technical details[/URL])
* Android 8.0 compatibility
* Fix sdcardfs gid derivation ([URL="https://github.com/nkk71/multirom/commit/e0b749567f4ad976a5aabcdbd944f44f9c68b399"]technical details[/URL])
* vold_decrypt (Decryption on the HTC One M9 and HTC 10)
* trampoline511 (aka trampolineMk2)
* New default icons for Android ROMs when not set in app
* Code fixes and cleanups
2016-11-15 MultiROM v33
=====================
* Preliminary support for Android 7 (Nougat)
* Add support functions for MultiROM Manager App
(allows listing, manipulating, and booting secondary ROMs on external storage)
* Update no-kexec to version 4.1
+ changes to second boot detection
+ no-kexec versioning to allow auto-updating when needed
+ code cleanup
* Reboot to recovery on failed data partition mount
(avoids potentially being stuck in bootloop)
* Add reboot to recovery button on decryption screen when in second boot
* Code fixes
MultiROM v33b
=====================
* Fix [possible] boot img truncation when used in daisy-
chaining [older] systemless SuperSU, [B][U]and[/U][/B] rebooting
directly from AROMA Installer (info to follow later)
* Fixed mr_init_devices for certain devices (better fix will follow)
* Fix the auto-boot issue to properly fall back to primary
when secondary is deleted
MultiROM v33a
=====================
* Initial port for the HTC 10 (pme)
* Updated no-kexec to version 4
* autoboot: "Use last booted ROM" now works with external ROMs
previous changelogs are in M7/M8/M9 threads
i'll consolidate at some point hopefully
Recoveries:
Code:
2017-10-27
=====================
* Fully merged with official TWRP 7.1 branch
* New 'System Partition Mode' ROMs ([URL="https://github.com/nkk71/multirom/commit/dfb1a294ab55374b80bb6f14c2422850610c986d"]technical details[/URL])
* Android 8.0 compatibility
* Auto detect possible use of legacy props
* vold_decrypt (HTC decryption on the M9 and 10)
* Install from backup using a System_Image
* libbootimg: Updated to support AnyKernel2
* Fixes for some boot.img patchers
* Block mount/unmount of secondary partitions
* Use own loop devices to avoid conflicts with other installers
* Code fixes and cleanups
2016-11-15 (33e)
=====================
* Fix restorecon for secondary ROMs
* Rebased on android-7.0 branch
* Preliminary support for Android 7 (Nougat)
* Fix no-kexec restore primary_boot.img on devices
with PIN/Pattern/Password encryption
* Fix flashing of certain gapps zip's which are
missing the updater-script file
[STRIKE]* Add warning on failed injection[/STRIKE]
* Minor code cleanup
2016-09-20 (33b)
=====================
* Fix some installer scripts using certain mount/unmount commands
* Wake up screen before starting flash (fixes AROMA installer issues)
* Changed fstab so external ext4 won't get wiped with a factory reset
2016-09-17 (33a)
=====================
* initial port for the HTC 10 (pme)
* Based on TWRP 3.0.2 android-6.0 tree & branch
* Includes official TWRP commits up to Aug 23, 2016
previous changelogs are in M7/M8/M9 threads
i'll consolidate at some point hopefully
No-kexec workaround (version 4)
As of this version you need to manually enable the no-kexec workaround.
Actually, depending on the developer, (s)he may have already enabled it. Nonetheless, you can still choose to override the settings:
Go to TWRP -> MultiROM -> Settings
and enable the No-KEXEC workaround option
once you do you'll also have the option for ADVanced settings, please see below for a detailed description, though in most cases the default should suffice.​
Explanation of the no-kexec workaround advanced options
(the Info page is supposed to provide the same information as here, but I haven't added that yet)
1- Use no-kexec only when needed
This should be the default for most users, the other options are more intended for advanced uses (kernel debugging, and such).
If MultiROM detects a kexec-hardboot enabled kernel in primary slot, it will use the standard kexec method to boot the secondary. If on the other hand it does not detect that the kernel supports kexec-hardboot then it will use the workaround.​
2- ... but also ask for confirmation before booting
Same as option 1 above, but in addition you will be presented with a confirmation message, if the workaround is about to be used:
3- Ask whether to kexec or use no-kexec on booting
If the kernel in primary slot does support kexec-hardboot'ing then you will be presented with a choice of which method to use
If the kernel does not support kexec-hardboot then you'll be informed as in option 2 above​
4- Always force using no-kexec workaround
Forces the no-kexec workaround to be used, even if the kernel in primary slot has kexec-hardboot support​
Options 2 and 3, always present the user with a GUI confirmation, whereas option 1 and 4 will act as instructed without prompting the user.​
Visual feedback provided by the Booting... card
Regular kexec-hardboot boot
Booting using no-kexec-workaround
​
How does all this work, etc
The workaround:
MultiROM TWRP recovery works, and is able to flash ROMs to secondary
MultiROM in essence works (in particular, able to change the mount points during bootup)
what does not work is being able to use the secondary ROM's kernel (due to the lack of kexec-hardboot kernel and tools)
So how do we deal with booting any ROM if we can't use the proper kernel for the ROM?
Easy :
Upon selection of the ROM during MultiROM boot menu, we do the following:
"flash" secondary boot.img to primary partition slot
initiate a full reboot (secondary boot.img is in primary slot)
let the ROM auto-boot up on second boot
The good part:
It works.
.
Every secondary ROM has a boot.img file we can easily access to use the workaround; when you flash a ROM in MultiROM TWRP, not only are the "virtual" system, data, and cache partitions created, but also the boot.img.
The secondary ROMs' boot.img will be found /data/media/0/multirom/<name of rom>/boot.img or if it's on your external ext4 in the appropriate rom folder
We use that file and flash it to primary real boot partition and then upon second boot, the correct boot.img is in place for the correct ROM.
The bad part:
Unlike secondary ROMs, the primary ROM does not have a boot.img file... since it is the primary ROM, the boot.img should always be in the real boot partition, since MultiROM expects the primary kernel to have kexec-hardboot capability, but it does not, so I just go ahead and mess with your primary boot partition.
Since we have no "boot.img" file for the primary, my workaround makes a backup of the boot partition and names it primary_boot.img
In version 4 of the workaround, this backup is created and used only when booting a secondary ROM. When a secondary ROM is selected it's boot.img is flashed to primary slot, upon booting into the secondary ROM, the primary_boot.img is restored.
Long story short: the difference between kexec and no-kexec-workaround
Usual kexec-hardboot MultiROM
Select secondary ROM
MultiROM detects a boot.img
MultiROM reads the secondary boot.img into memory
MultiROM initiates a kexec second boot but into the secondary boot.img from above
MultiROM continues
No-kexec-workaround MultiROM
Select secondary ROM
MultiROM detects a boot.img
MultiROM flashes the secondary boot.img into the primary boot partition
MultiROM initiates a normal second boot but with the secondary boot.img in the real boot partition
MultiROM restores the primary_boot.img and continues as usual
so the difference is in point 3... whereas normal kexec'ing loads the secondary boot.img into memory and goes from there, the workaround, actually flashes it to the real primary boot partition... and continues normally from there
Devices using the no-kexec-workaround successfully
MultiROM threads for:
HTC One M7
HTC One M8
HTC One M9
.
Moto G 2015 by GtrCraft
Moto X Play by GtrCraft
OnePlus One (starting here) by KINGbabasula
OnePlus 3 by martinusbe
OnePlus X by martinusbe
Sony Xperia Z5 by Myself5
Sony Xperia L by STRYDER~007
Sony Xperia SP by Adrian DC
Xiaomi Redmi 2 by premaca
Wileyfox Swift by @beroid
.
(possibly Samsung Note 4, unsure if that was continued or not)
Others; unofficial builds? (if you are, kindly let me know, and I'll add you to the list)
reserved for @Captain_Throwback
Oops
files are in the download section, the posts need some editing, bug gonna be a bit busy tomorrow
so enjoy
Ok,ok,you will say that im noob,but i flashed both files,flash the RR ROM,but the multirom menu doesnt show and it boots me directly to primary rom
azZA_09 said:
Ok,ok,you will say that im noob,but i flashed both files,flash the RR ROM,but the multirom menu doesnt show and it boots me directly to primary rom
Click to expand...
Click to collapse
That's not a "bug report"
Please provide detailed information, and logs... BTW, I didnt add the advanced kernel logging feature "by mistake", it's so you can get "easier" logs... but if those exist, then you still need to pull a kmsg
Code:
adb pull /sys/fs/pstore/console-ramoops
No boot menu, normally means that trampoline (if it's in the above log), wasnt able to mount data... or it's not even there
nkk71 said:
That's not a "bug report"
Please provide detailed information, and logs... BTW, I didnt add the advanced kernel logging feature "by mistake", it's so you can get "easier" logs... but if those exist, then you still need to pull a kmsg
Code:
adb pull /sys/fs/pstore/console-ramoops
No boot menu, normally means that trampoline (if it's in the above log), wasnt able to mount data... or it's not even there
Click to expand...
Click to collapse
Sorry dude,Im at work atm and I think too slow ). I will provide logs tomorrow,but maybe somebosy can provide them since then. Once again,great job and im sure you will fix every problem
azZA_09 said:
Sorry dude,Im at work atm and I think too slow ). I will provide logs tomorrow,but maybe somebosy can provide them since then. Once again,great job and im sure you will fix every problem
Click to expand...
Click to collapse
open a terminal emulator on your phone, and
Code:
cat /sys/fs/pstore/console-ramoops | grep tramp
then you'll see if trampoline is even in there
nkk71 said:
open a terminal emulator on your phone, and
Code:
cat /sys/fs/pstore/console-ramoops | grep tramp
then you'll see if trampoline is even in there
Click to expand...
Click to collapse
It shows only the # after that
Download links are not working.
azZA_09 said:
It shows only the # after that
Click to expand...
Click to collapse
then probably the log is way after trampoline & multirom, so you need to enable "kernel logging"... I didnt add that by mistake
http://forum.xda-developers.com/devdb/project/?id=17079#downloads
Tab isn't showing up for me, but that link should work.
jsaxon2 said:
Download links are not working.
Click to expand...
Click to collapse
They're supposed to be here
If you can't access them, I've uploaded them to AFH as well
Got it installed and booted up cm13 as secondary. Working good so far. Thanks for this. I'm back on Viper running from primary.
jsaxon2 said:
Got it installed and booted up cm13 as secondary. Working good so far. Thanks for this. I'm back on Viper running from primary.
Click to expand...
Click to collapse
hmm is that a complaint? ... sounds rather positive, so i'm unsure. i usually only hear complaints
Well, if it's not, thanks for reporting back :good:
I currently have an old version of Viper10 as primary / daily
and as secondaries:
ice-2.1.1_PERFUME_UHL_M60_SENSE80GP_HTC_Europe_1.90.401.3
BeanStalk-6.20-20160905-pme
cm-13.0-20160915-UNOFFICIAL-pme
and some other weird stuff
nkk71 said:
hmm is that a complaint? ... sounds rather positive, so i'm unsure. i usually only hear complaints
Well, if it's not, thanks for reporting back :good:
I currently have an old version of Viper10 as primary / daily
and as secondaries:
ice-2.1.1_PERFUME_UHL_M60_SENSE80GP_HTC_Europe_1.90.401.3
cm-13.0-20160915-UNOFFICIAL-pme
and some other weird stuff
Click to expand...
Click to collapse
Lol, not a complaint, it's a compliment. You have done excellent work. Just wanted to report that it is working. I'm too tired to mess with it anymore, but awesome that I can test CM builds and get right back to my daily driver.
Job well done.
jsaxon2 said:
Lol, not a complaint, it's a compliment. You have done excellent work. Just wanted to report that it is working. I'm too tired to mess with it anymore, but awesome that I can test CM builds and get right back to my daily driver.
Job well done.
Click to expand...
Click to collapse
Thank you, I do enjoy positive feedback, Hope you enjoy it
as well as comments, thoughts and ideas.
@ all, If something is wrong, please be as descriptive as possible... please no "it doesn't work" posts.

[REPARTITION] Nexus 5 Repartition [HAMMERHEAD] [16GB/32GB] [UA TWRP]

Nexus 5 Repartition​
No one is responsible for your actions except yourself. Everything written further may potentially brick your device, although risk is reduced to minimum.
This repartition package offers 1.5G /system; a /vendor partition and it is fully backward compatible with any ROM (including stock system.img).
Known-issues
HTML:
- If repartition pack says that device isn't correct,
than, if partition table wasn't modified before,
congrats! your device has different memory chip
that those I worked with. No worry, PM me and
I'll add support for it.
DO THE BACKUPs. Repartition will erase all your data
USB connection to PC is MANDATORY else you will not have opportunity to push ROM to your device
Installation
HTML:
# Before processing further we highly recommend you backup persist using terminal and dd comand and EFS
# Or you might lose your IMEI/WIFI + BT mac addresses
# This mod is backwards compatible with any ROM so we highly recommend NOT to reverse it if repartition went well.
# You should use ONLY recovery from this thread since other don't support all benefits of this mod.
# When installing ROM just after you flashed zip and before installing GAPPs you MUST make a resize in TWRP since all roms are build for ~1G system.
# To restore stock layout use same zip and steps as for repartition.
1. Boot into recovery (You need to allow system partition modification to be able resize /system in recovery).
2. Backup your data & Move your files from flash to your PC.
3. Flash repartition pack zip.
4. Do the actions asked by repartition pack (go to Terminal in ordinary recovery and input word that pack will tell you. Everything else will be done automatically).
5. Phone will reboot into recovery.
6. Install TWRP from below (it is build with support of new partitions layout and sizes. It can be differed from official TWRP by next format 3.x.x-1 UA).
7. Format everything. (mount errors will not affect formatting!)
- In TWRP: Wipe > Format data
- Type yes
- Once this completes go to: Wipe > Advanced Wipe
- Tick all the boxes and wipe. There should be no further mount errors.
8. Install ROM which you like.
9. Enjoy better flash partition layout.
If something gone wrong - we recommend you NOT to do anything by yourself. Write here for help, else you may do only worse.
Downloads:
Repartitioning package: GitHub
Credits:
Special thanks to
- Unlegacy-Android team;
- Sudokamikaze;
- surfrock66 for his gide for Nexus 5;
As usual, feedback is appreciated
XDA:DevDB Information
Nexus 5 Repartition, Tool/Utility for the Google Nexus 5
Contributors
Clamor
Source Code: https://github.com/clamor95/android_device_unlegacy_recovery
Version Information
Status: Stable
Created 2018-09-19
Last Updated 2019-01-18
Common issues and F. A. Q.
Repartition pack should be safe for most devices. Common mistakes, issues and their solution will be published here.
1. You shouldn't flash any internal parts of repartition pack (*.sh files) only flash whole zip using TWRP. You may use my scripts for personal use or projects but authorship should to be kept.
2. If something isn't mounting after repartition try to format partitions that don't mount using Wipe -> Advanced Wipe in TWPR. Ideally you should format in that way all partitions in Advanced Wipe menu (see 5-th step of installation guide).
3. To be sure that repartition went well I enclose loging zip. Flash it after repartition (when device reboots into TWRP). It won't modify anything only generates a partition.log in root of internal storage and outputs your current partition layout to screen. You shoud check if your layout is same as those fragments I provide under spoiler (file systems doesn't matter). If there are any differences you have to discribe what you did and enclose partition.log to your post.
HAMMERHEAD STOCK
Code:
25 192937984B 1266679807B 1073741824B system
26 1266679808B 1298137087B 31457280B crypto
27 1298137088B 2032140287B 734003200B cache
HAMMERHEAD MODIFIED
Code:
25 192937984B 1803551231B 1610613248B system
26 1803551232B 2065695231B 262144000B vendor
27 2065695232B 2097152511B 31457280B crypto
28 2097152512B 2306867711B 209715200B cache
4. Flashable resize zip for ROMs that support addon.d (automatic resize when dirty flashing updates).
5. To backup persist partition you need PC with installed adb. Boot your hammerhead in TWRP and plug to PC. Than use next commands.
Code:
adb root
adb shell
dd if=/dev/block/mmcblk0p16 of=/sdcard/persist.img
Than copy .img file from root of internal storage to your PC. Although, script doesn't affect that area, backup of this partition may help in case of any problems with mac address etc.
Thank you for this zip!!! It works fine but I used nano package gapps for the face unlock but still does not work on LOS 15.1. Any suggestions
Vendor partition means support for treble.... Right?
---------- Post added at 04:11 AM ---------- Previous post was at 03:44 AM ----------
After flashing a ROM the system partition resizes back to 1009mb...
Can this be fixed?
@sinkoo1979 try bigger gapps, alse, it may be Lineage problem.
@getrooted0019 you didn't read Installation part carefully, did you? You need to use resize option in TWRP to restore original size after flashing ROMs since they are build for 1G /system partition.
getting a message in twrp "this is not a nexus 5" and won't let me switch back to stock.
@sinkoo1979 send me your partition table in bytes
Clamor said:
@sinkoo1979 send me your partition table in bytes
Click to expand...
Click to collapse
Data and vendor partitions in my nexus 5 are 0mb and not present. System showing about 1028mb while cache is on 29mb.
Thank you for your help but can't change the cache storage back to stock. Can't access the internal storage in TWRP. I think I corrupted my partitions on the nexus 5. Nexus 5 boots into TWRP but can't access nothing. Tried to flash different rom with OTG but bootloops. Can't flash stock because the cache partition is too small.
@sinkoo1979 just stop. I'd ask you to create a telegram account and PM it to me here. I'll help you, just don't do anything
Clamor said:
@sinkoo1979 just stop. I'd ask you to create a telegram account and PM it to me here. I'll help you, just don't do anything
Click to expand...
Click to collapse
Thank you for your help
This is fixable! I was a noob and didn't resize my system partition after flashing rom. Flashed the hh repartition to go back to stock in the ua twrp and got a bunch of errors. Then flashed stock recovery and tried again. This is not a Nexus 5 popped up. The backup file is inside the flashable zip. I just used adb shell and parted to execute the commands listed in backup and viola my Nexus 5 is back. So those freaking out that they messed up their phone...don't worry it's fixable just listen to Clamor. Anyone can pm me too if you need help.
@typow102 if repartition pack says "It is not Nexus 5" than you shouldn't continue without asking here. Using scripts from pack on them own is dangerous as well. Currently I don't know how many types of MMC installed in our Nexus 5 and "It is not Nexus 5" on repartition or on returning to stock may indicate a new type MMC chip like it was with Nexus 7 (2013)
Clamor said:
@typow102 if repartition pack says "It is not Nexus 5" than you shouldn't continue without asking here. Using scripts from pack on them own is dangerous as well. Currently I don't know how many types of MMC installed in our Nexus 5 and "It is not Nexus 5" on repartition or on returning to stock may indicate a new type MMC chip like it was with Nexus 7 (2013)
Click to expand...
Click to collapse
That's the thing though It worked perfectly the first time I flashed it. No errors. Luckily I have had quite a bit of experience with terminal and parted so I felt confident in what I was doing. Can I help you in any way with this? There very well maybe a different mmc chip we don't know about yet.
@typow102 feel free to help if you are certain you can.
For those who downloaded repartition pack before this message is published, please redownload pack since previous version might have a problems with repartition. If repartition was already made, don't worry everything should be fine. Just use up-to-date pack.
Do I need to resize the partition in twrp every time after flashing any ROM and then flash gapps package?
@bagajohny yeah, till devs decide to support it officially.
When I install the ROM (crDroid 4.6) after change the partitions, when I go to TWRP, Wipe > Advanced Wipe, selecting system and pushing over Repair or Change File System button and then over Resize File System, this message was shown:
Repairing system before resizing.
Repairing system using e2fsck...
Done.
Resizing...
/sbin/resize2fs /dev/block/mmcblk0p25 process ended with ERROR: 1
Unable to resize system.
So no resizing is made.
@froilson resize once more, if fails, change mounting state of system and try once more
@Clamor with this can we have treble support ?

[PARTITION][TREBLE] Project Treble for Xiaomi Mi Note 2 [SCORPIO][15.02.2019]

- T R E B L E Y -
Android Partition Treblerizer
A tool able to seamlessly create / remove the vendor partition from within TWRP​
INTRODUCTION
The creation of a tool able to create and remove the supplier partition from TWRP, so a computer was not required. So I created this flaming TWRP ZIP which can create and remove the vendor partition from the userdata system or partitions without a computer and without deleting the files in the mother partition in the recommended configuration.
In this way, our device can also have a treble just like a phone that came out of the factory with the vendor partition without touching the cust partition.
The tool will try to resize the mother partition without deleting it, either during the creation and removal of the supplier partition. However, this can only be done when the mother partition is ext4, only when the supplier partition is at the end of the mother partition and when the mother partition is not encrypted. The recommended configuration is the one that is obtained by selecting the first option in each option: subdividing 512 MB from the end of the system partition. A reboot is required after applying the patch to the partition table because the kernel needs to reload it before doing anything else.
REQUIREMENTS
Due to the use of a key detection binary, it is compatible only with ARM and ARM64 devices running TWRP. So far I have tested it in the Xiaomi Mi Note 2 but It should work in any compatible device. I made it this way so other legacy devices could transition to Treble ROMs + GSI, and Android Pie. Please let me know about other devices using this tool!!!!!
INSTALLATION
WARNING, THIS SOFTWARE COULD WIPE ALL THE DATA IN YOUR DEVICE, INCLUDING THE INTERNAL STORAGE.
IT REQUIRES TWRP CUSTOM RECOVERY IN AN UNLOCKED DEVICE, OTHERWISE YOUR DEVICE COULD BE BRICKED.
!!! Whatever you do, it is at your own risk !!!
Either for creating or removing a vendor partition,, follow these steps:
A. Download Trebley_APT, Trebley_treble, Trebley_twrp.
1. Put Trebley_APT, Trebley_treble, Trebley_twrp to your External SD card.
2. Go to Install and flash the Trebley_APT ZIP file as any other ROM or MOD file to execute the tool.
3. Reboot to recovery again to ensure the changes are applied properly.
4. In some cases you will need to format the mother partition after adding or removing the vendor partition next to it.
5. Go to Install and select "Flash Image".
6. Flash the Trebley_twrp IMG file to recovery partition and reboot to recovery.
7. Wipe cache, dalvik-cache, system, vendor and data
8. Flash a Generic System Image in system partition (arm64, A only).
9. Reboot, and done.
CREATE A VENDOR PARTITION:
So far these are the available options:
Mother partition selection: system / userdata
Split position: Splitting from the end / start of the mother partition.
Vendor partition size: 512 / 915 MB
REMOVE THE VENDOR PARTITION:
Should a Vendor module already exists, Trebley offers to remove it, returning to a Non-Treble partition table. It will return the space to the mother partition, system or userdata. So, older non Treble ROMs could be flashed after the mandatory reboot.
DOWNLOAD
Trebley_APT_v1.0_ARM_20190215-signed.zip
Trebley_treble_scorpio-20190215-0521-signed.zip
Trebley-twrp-3.2.3-0-scorpio-custom.img
SOURCES
All rights reserved to the project: Party and its creator @Oki).
CREDITS
@someone755 for the keycheck binary
@Zackptg5 for the V4A install script that inspired my version.
@Oki for the base script.
@Psy_Man for the kernel and for supporting.
Trebley updated V1.0, is now affordable for all users, and above all is stable.
DarioRetr said:
I would be grateful if developers like @Psy_Man will update their project, making it compatible with the project treble with the vendor partition.
Click to expand...
Click to collapse
Nice work! I recently hunted down the original source of the keycheck binary and built it for x86/64 (and rebuilt it for arm/64) here: https://github.com/Zackptg5/keycheck
Here's compiled ones to save you some time: https://github.com/Zackptg5/Unity-Addons/tree/master/Volume-Key-Selector
The screenshots will be added soon!
Zackptg5 said:
Nice work! I recently hunted down the original source of the keycheck binary and built it for x86/64 (and rebuilt it for arm/64) here: https://github.com/Zackptg5/keycheck
Here's compiled ones to save you some time: https://github.com/Zackptg5/Unity-Addons/tree/master/Volume-Key-Selector
Click to expand...
Click to collapse
Thanks for the advice, I will evaluate if I will put in the next Trebley update, however, have you tried Trebley?
DarioRetr said:
Thanks for the advice, I will evaluate if I will put in the next Trebley update, however, have you tried Trebley?
Click to expand...
Click to collapse
No, my current devices are already treble compatible
Please post and open the thread in the designated Project Treble section.
Thank you for helping us keeping the forums organized.
Thread Closed
Funk Wizard
Forum Moderator

T-Virus - Infect your Nokia 8 with Project Treble (2019-07-02)

Code:
#include <std_disclaimer.h>
/*
* 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 about modifying your android system before flashing this!
* 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. Hard. A lot.
*/
(if you expected the Resident Evil references to stop, you just got gnomed)
What is this?
T-Virus (for treble-virus) is a tool that takes a stock Nokia 8 firmware and "infects" it with various parts from the Nokia 8 Sirocco firmware, generating a firmware bundle that is compilant with Project Treble and that can be flashed to a Nokia 8 using NOST.
Firmware Sources
The base of T-Virus is the stock Nokia 8 firmware image (5150 / April Security patch at the time of writing). When being run, the build script takes those files and replaces the partition table with the one from Nokia 8 Sirocco. This required for creating a vendor partition that the stock Nokia 8 does not have. The vendor image is taken from the Sirocco firmware as well. During the build, the vendor image is mounted as rw, and various files are copied over from the stock Nokia 8 system image, or get patched to properly support the minor hardware differences between the two phones. Those actions are defined through very basic scripts inside of the vendor folder in the repository.
The boot image is a modified version of my umbrella kernel, which has support for early mounting vendor. It also includes a TWRP build with full support for Project Treble.
SELinux Hell
Because Android does some very weird stuff with SELinux contexts, you cannot launch a service file when it has an unknown context. We have to fix that by force-setting the SELinux context manually, but due to how SELinux works, this is only possible on a Linux system without SELinux. This means, that you cannot build this on a distribution with SELinux (Fedora in my case). I fixed the problem by building the images in a Ubuntu VM.
How to build?
First you have to download the latest firmware image from https://tmsp.io/fs/xda/nb1/firmware, and the exdupe tool from https://www.quicklz.com/exdupe
Extract the firmware into a folder and then clone the repository, like this:
Code:
$ mkdir firmware
$ ./exdupe -R ~/Downloads/NB1-5150-0-00WW-B03.qlz firmware/
$ git clone https://github.com/resident-nokia/t-virus
$ cd t-virus
The build script has two options you have to set: a version and the path to the extracted firmware. This means you have to run it like this:
Code:
$ ./build.sh --version v0.1 --firmware ../firmware
Leave it running and when it asks you, enter your sudo password. This is required to mount the Android ext4 partitions and edit the files that are only accessable by the (Android) root user, and retain their permissions.
When the script has finished the flashable firmware image will be inside of the out folder. You can optionally package this as a .qlz file again using exdupe.
What works?
It boots
Data decryption in recovery
Flashing GSIs / OpenGApps in recovery
WiFi
Mobile Data
Bluetooth
Sound
Vibration
Calling
Hardware buttons
Fingerprint
Camera
GPS
NFC
SDCard
Multi SIM
4k Video
What doesn't work, or isn't tested
Haptic feedback for Hardware buttons
Bluetooth headphones don't get registered properly
Nokia OZO audio support is missing
Fingerprint sensor is reported as being on the back of the phone
There might be issues with USB transfer under Windows
VoLTE (untested)
How to install?
WARNING: This might not be useable as a daily driver. Continue only if you are able to troubleshoot things if neccessary (bootloops, bricking the phone, causing the alarm app to declare nuclear war)
You can download the latest release from the releases page on the repository. It is a .qlz firmware, so you will have to flash it through NOST. You will need a completely unlocked bootloader. When flashing, make sure to select the "Erase Userdata" option, not doing this will most certainly bootloop the phone.
After the installation completed, your phone will reboot into phh's AOSP GSI. If you want to use a different GSI (you most likely will), follow these steps:
Download your favorite GSI
Unpack every form of compression, so you end up with a .img file
Boot into recovery
Copy the .img to the internal storage of your phone, or to your SDCard
Select "Install" -> "Install .img", select the image file you copied and flash it to your system partition
Then install OpenGApps or any other modifications you like.
Wipe /data to allow the new system image to boot properly and then reboot
To update to a newer version without having to erase userdata, download the zipped vendor image from the release page, and flash the image inside in TWRP.
If you want to go back to stock, simply download the 5150-revert firmware and flash it with NOST, with the "Erase Userdata" option enabled. It will revert all changes T-Virus made to your phone. Firmwares from https://tmsp.io/fs/xda/nb1 will not work.
Links?
Repository: https://github.com/resident-nokia/t-virus
Download: https://github.com/resident-nokia/t-virus/releases
Reverting to stock: https://github.com/resident-nokia/t-virus/releases/tag/5150-revert
What if I have a bug?
Upload a proper bugreport. This means logcat and dmesg. If you don't know how to get them, google it. Also, describe the issue and provide steps to replicate it. Everything else will be ignored.
I don't daily drive this phone anymore. I am doing this just because it is an interesting technical challenge. I don't have as much motivation to fix bugs than someone who daily drives it.
I want to say thank you!
I usually don't do this, but since this involved a lot of work on my side, I would be grateful if you would want to say thank you by buying me a coffee (or two): https://paypal.me/thmsp
Ok. After the flashing we have a phone "infected" by the Project Treble. But what it gives to end-user? What is profit of this?
kosmatyj said:
Ok. After the flashing we have a phone "infected" by the Project Treble. But what it gives to end-user? What is profit of this?
Click to expand...
Click to collapse
The ability to install GSIs (Generic System Images). Basically everything from here: https://forum.xda-developers.com/project-treble/trebleenabled-device-development
Oh! Sounds pretty good! Thanks. Will think about it. Really expands posiibilities and needs to be tested.
---------- Post added at 10:54 ---------- Previous post was at 10:29 ----------
Q: Should Ihave an Android Pie be installed first or it can be flashed over ony ROM version (I currently have Nougat ROM installerd on my Nokia 8)?
kosmatyj said:
Q: Should Ihave an Android Pie be installed first or it can be flashed over ony ROM version (I currently have Nougat ROM installerd on my Nokia 8)?
Click to expand...
Click to collapse
It could work, since it is a modified firmware for reflashing, but just to be sure, update to Pie through OTA. That's what this has been tested with and you won't update your bootloader in the process which eliminates some possible incompatibilities.
What is password for t-virus-20190703.qlz? Should I flash the TV-20190703-vendor.zip before or t-virus-20190703.qlz is all I need?
kosmatyj said:
What is password for t-virus-20190703.qlz? Should I flash the TV-20190703-vendor.zip before or t-virus-20190703.qlz is all I need?
Click to expand...
Click to collapse
It's all in the instructions. There is no password on the qlz file. You can't extract it, you have to flash it using NOST. The zip is for updating from previous versions and not for the initial installation.
Oh, I understood. No need to unpack, just download and flash over NOST, right? Thanks ones more. It is new for me, that`s why I have so much questions.
kosmatyj said:
Oh, I understood. No need to unpack, just download and flash over NOST, right? Thanks ones more. It is new for me, that`s why I have so much questions.
Click to expand...
Click to collapse
Yes. Just follow the instructions in NOST and select the T-Virus .qlz when it asks you to. Also, make sure you select the "Erase Userdata" option in the drop down menu that appears after selecting the .qlz.
Thank you for this - hope you enjoy the couple of coffee's
Amazing work. Can the current Android Q GSI be used?
comatrices said:
Amazing work. Can the current Android Q GSI be used?
Click to expand...
Click to collapse
When I tried it it didn't boot. Your mileage may vary, but you probably have to wait until the source code for Q has been published and people can build real phh GSIs from it.
Hello! Author, don`t you planning to build the same but for Android 8.1? Your work is great anyway but would be just amazing to have an Oreo in this appearance. Thank you.
kosmatyj said:
Hello! Author, don`t you planning to build the same but for Android 8.1? Your work is great anyway but would be just amazing to have an Oreo in this appearance. Thank you.
Click to expand...
Click to collapse
Just flash an Oreo GSI? I know you can run Pie GSIs on Oreos vendor, so it should work fine the other way around.
Nah! Didn`t work. After "android" logo it drops into download mode. AOSP 32 (last version of A 8.1 GSI).
kosmatyj said:
Nah! Didn`t work. After "android" logo it drops into download mode. AOSP 32 (last version of A 8.1 GSI).
Click to expand...
Click to collapse
I am not exactly sure if I understand you correctly, but Nokia 8 is not an A-only device, it is an AB device. You need to flash the AB image of AOSP, not the A one.
Right, I did exactly like you said. system-arm64-ab-vanilla-nosu - image that I flashed couple minutes ago. Downloaded from here: https://github.com/phhusson/treble_experimentations/releases/tag/v32
I`m sorry about my English. I`m Russian.
kosmatyj said:
Right, I did exactly like you said. system-arm64-ab-vanilla-nosu - image that I flashed couple minutes ago. Downloaded from here: https://github.com/phhusson/treble_experimentations/releases/tag/v32
I`m sorry about my English. I`m Russian.
Click to expand...
Click to collapse
Ok, then it probably doesn't work the other way around (Oreo with Pie vendor). An Oreo-based T-Virus is unlikely to happen though, because Siroccos Oreo vendor has some problems (calls not going through properly), and I dont want to maintain two versions of it because, as said in the OP, I don't use my Nokia 8 anymore. It seems like Pie is all you can get with this for now, sorry.
Hi all. Just to make it clear. The procedure for the Nokia 8 is:
1. Unlock Bootloader
2. Do "critical unlock" (fastboot flashing unlock_critical)
3. Flash "t-virus-20190703.qlz" with NOST?
Did i miss something? Whats with Security Enabled Linux?
just4me12 said:
Hi all. Just to make it clear. The procedure for the Nokia 8 is:
1. Unlock Bootloader
2. Do "critical unlock" (fastboot flashing unlock_critical)
3. Flash "t-virus-20190703.qlz" with NOST?
Did i missed something? Whats with Security Enabled Linux?
Click to expand...
Click to collapse
That's right. Don't forget to add "erase data" option while flashing t virus with NOST otherwise you'll end up in a bootloop.

[RECOVERY][UNOFFICIAL] TWRP HH for Nexus 5 (hammerhead) [DISCONTINUED]

TWRP HH for Nexus 5​
About:
TWRP is an open source, community project. TWRP development is done by roughly 4 people at this point. We also have a large support community with many people who are willing to answer questions and help people with their devices either through our IRC channel or on forums like xda-developers.
Team Win was originally formed to work on porting WiMAX to CM7 for the HTC EVO 4G. After our work on the EVO 4G we wanted to work on a project that would work on more devices than just the EVO 4G and we settled on working on a recovery. Today TWRP is the leading custom recovery for Android phones.
A custom recovery is used for installing custom software on your device. This custom software can include smaller modifications like rooting your device or even replacing the firmware of the device with a completely custom "ROM" like OmniROM
Click to expand...
Click to collapse
Disclaimer:
Code:
#include <std_disclaimer.h>
/*
* 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 RECOVERY
* 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.
*
*/
You can find the source code for TWRP on GitHub. If you would like to contribute to TWRP, please visit Gerrit Code Review.
Features:
HH.S version with stock partitions map. S means stock.
HH.R version with repartition support. R means repartition.
Working decryption on custom roms. Tested on LOS 16.0, LOS 17.1, LOS 18.1, but should work on all Androids since Nougat.
exFAT and NTFS support (read and write) for USB OTG
Requirements:
You need to have an unlocked bootloader to install and use TWRP!
Known bugs:
Everything looks good so far
Downloads:
https://sourceforge.net/projects/hammerhead-twrp/files/beta/
Credits:
TeamWin
@Clamor
@steadfasterX
And all the contributors out there in the community
Contributors:
@z3DD3r
Source Code:
Device tree: https://github.com/z3DD3r/twrp_android_device_lge_hammerhead
Version Information:
Satus: Stable
TWRP version: 3.7.0_9
HH Project versions: HH.S.17 and HH.R.17
Created: 2020-02-08
Last Updated: 2022-02-06
Repartition (HH.R versions)
ALWAYS DO THE BACKUPS!!!
No one is responsible for your actions!
Repartition may potentially brick your device, although risk is reduced to minimum.​
Features:
Increases /system partition to ~1444Mb
Decreases /cache partition to ~255Mb
Doesn't provide /vendor partition
Doesn't touch /data partition
Requirements:
Not modified partitions by any other solutions
How to increase /system partition and change partitions map:
- Flash the HH.R version of TWRP and launch it
- Open terminal (TWRP -> Advanced -> Terminal)
- Type hh_repart -m
- Wait until your phone reboots
- Install your rom
How to revert back to stock /system size and stock partitions map:
- Launch HH.R version of TWRP
- Open terminal (TWRP -> Advanced -> Terminal)
- Type hh_repart -r
- Wait until your phone reboots
- Flash official TWRP or HH.S version of TWRP! Don't ignore this step!
- Install your rom
How to dump partitions map:
- Launch HH.R version of TWRP
- Open terminal (TWRP -> Advanced -> Terminal)
- Type hh_repart -d
- Wait until process finishes
- Look at /sdcard/partitions.log file
reserved
reserved
Some technical notes about the decryption and Android Q support.
Right now the only possible way to decrypt data on our devices is to use system's vold. This logic was added to TWRP some time ago but one required change wasn't in the tree. This change is here: https://gerrit.twrp.me/c/android_bootable_recovery/+/1919. Without this patch system's vold will fail on hammerhead. I don't know why but services in the sbin can't handle decryption. Also using the system's vold means that ROM should be installed to decrypt data. Without installed ROM decryption is not possible!
About SAR and Android Q. Work on SAR support in TWRP is still in progress but some patches are already available on gerrit. These patches are required to properly detect SAR and mount partitions. Also since Android Q one more service should be run before trying to decrypt data. This service is apexd. Android Q runs apexd on early-init stage to provide required runtime libraries. U can see how it launched at https://android.googlesource.com/pl...fs/tags/android-10.0.0_r29/rootdir/init.rc#37. Only after that step all other services like qseecomd, hwservicemanager, servicemanager and keymaster can be run from system or vendor.
The last point is prebuilt vdc. Prebuilt vdc_pie which is shipped with TWRP fails to run because of linker error. I don't remember exactly what was the error but i guess that something is removed in libc. To fix that problem i've built vcd_ten binary with Android Q sources and placed it into device tree for hammerhead as a temporary solution. The source code of that binary is identical to vdc_pie which located at https://github.com/TeamWin/android_...b/android-9.0/crypto/vold_decrypt/vdc_pie.cpp
This is just a quick notes about what was done.
Patched bootable_recovery is located at https://github.com/z3DD3r/twrp_android_bootable_recovery/tree/android-9.0
Device tree for Q located at https://github.com/z3DD3r/twrp_android_device_lge_hammerhead/tree/q-sar
I hope this will be helpful for TWRP Team!
PS: Changes i've made should be improved. Don't treat them as production ready and/or stable!
FYI @Dees_Troy
Hi, thank you very much for this solution.
hh_repart -d - worked but I couldn't read the log file before rebooting, maybe it's obvious
hh_repart -m - worked without any issues
I have also successfully flashed Lineage 17.1 from your other thread, gapps and Magisk.
New versions are up (HH.S.3 and HH.R.3)
Added exFAT and NTFS support (read and write) for USB OTG
Kernel image is compressed with XZ LZMA2 compression algorithm (smaller size of the recovery image)
New versions are up (HH.S.4 and HH.R.4)
Fixed mounting issues of the system partition
Fixed device overheating while in recovery
I highly suggest everyone update to this version!
I have a question, certainly not in any way a complaint.
I have been running HH4 for a few days. Last night I made a TWRP backup of my LineageOS 17.1, which I installed on 20th without Gapps to see how it works without Google - quite well, in fact, with the help of APK Updater.
This morning I stupidly applied the 22nd update with Gapps - I was on autopilot and forgot that this device had no Google.
No problem, I thought, I'll just restore last night's backup. So I did a total wipe and format ("yes"), but no backup will restore. I just get the LOS line-&-circle animation for ages. I've tried earlier backups, and even standard unmodified TWRP, all with the same result. No backup will restore.
It's not a big deal - I can start with a totally new installation - but I'd like to know if anyone has taken a backup and successfully restored it. Or am I just lucky...? If I can't restore, then it sort of defeats the point of TWRP, no?
Edit: Seriously, 85 people have downloaded HH4. Has not a single one of you tried a restore of a backup?
Edit: Tumbleweed...
Edit: Do I take it that nobody has tried to restore a backup? If you haven't, and my experience is normal, then we're risking a two-hour fresh install in case of update problems rather than a two-minute restore.
dahawthorne said:
I have a question, certainly not in any way a complaint.
I have been running HH4 for a few days. Last night I made a TWRP backup of my LineageOS 17.1, which I installed on 20th without Gapps to see how it works without Google - quite well, in fact, with the help of APK Updater.
This morning I stupidly applied the 22nd update with Gapps - I was on autopilot and forgot that this device had no Google.
No problem, I thought, I'll just restore last night's backup. So I did a total wipe and format ("yes"), but no backup will restore. I just get the LOS line-&-circle animation for ages. I've tried earlier backups, and even standard unmodified TWRP, all with the same result. No backup will restore.
It's not a big deal - I can start with a totally new installation - but I'd like to know if anyone has taken a backup and successfully restored it. Or am I just lucky...? If I can't restore, then it sort of defeats the point of TWRP, no?
Edit: Seriously, 85 people have downloaded HH4. Has not a single one of you tried a restore of a backup?
Edit: Tumbleweed...
Edit: Do I take it that nobody has tried to restore a backup? If you haven't, and my experience is normal, then we're risking a two-hour fresh install in case of update problems rather than a two-minute restore.
Click to expand...
Click to collapse
Have u tried to restore backup of other ROMS? I guess it is not TWRP's problem...
dahawthorne said:
I have a question, certainly not in any way a complaint.
I have been running HH4 for a few days. Last night I made a TWRP backup of my LineageOS 17.1, which I installed on 20th without Gapps to see how it works without Google - quite well, in fact, with the help of APK Updater.
This morning I stupidly applied the 22nd update with Gapps - I was on autopilot and forgot that this device had no Google.
No problem, I thought, I'll just restore last night's backup. So I did a total wipe and format ("yes"), but no backup will restore. I just get the LOS line-&-circle animation for ages. I've tried earlier backups, and even standard unmodified TWRP, all with the same result. No backup will restore.
It's not a big deal - I can start with a totally new installation - but I'd like to know if anyone has taken a backup and successfully restored it. Or am I just lucky...? If I can't restore, then it sort of defeats the point of TWRP, no?
Edit: Seriously, 85 people have downloaded HH4. Has not a single one of you tried a restore of a backup?
Edit: Tumbleweed...
Edit: Do I take it that nobody has tried to restore a backup? If you haven't, and my experience is normal, then we're risking a two-hour fresh install in case of update problems rather than a two-minute restore.
Click to expand...
Click to collapse
With TWRP 3.3.1-HH.R.4 nanroid backup and restore in LOS 14.1 with encyption = ok
With TWRP 3.3.1-HH.R.4 nanroid backup and restore in LOS 17.1 with encyption = ok
sant514 said:
With TWRP 3.3.1-HH.R.4 nanroid backup and restore in LOS 14.1 with encyption = ok
With TWRP 3.3.1-HH.R.4 nanroid backup and restore in LOS 17.1 with encyption = ok
Click to expand...
Click to collapse
Can u tell me which build of LOS 17.1 have u used for these tests?
Los 17.1 28-02-2020
sant514 said:
Los 17.1 28-02-2020
Click to expand...
Click to collapse
Thanks! U just confirmed that LOS 17.1 could not be restored due to selinux denials. Some days ago i've updated sepolicies and now everything works.
@dahawthorne, FYI
Excellent news - thank you.
And also a relief to find that I wasn't just being an idiot...
I see "E:Unable to decrypt FBE device" when flashing in TWRP.
Should I just disregard this message?
smsmasters said:
I see "E:Unable to decrypt FBE device" when flashing in TWRP.
Should I just disregard this message?
Click to expand...
Click to collapse
Just ignore it.
Our device doesn't support FBE (file based encryption). So this error doesn't affect our device at all.
Since I was the one to mention my problem with restoring a TWRP image, I think I should report that, as z3DD3r stated above, TWRP HH 4 does indeed work fine in making and restoring backups. I took a backup yesterday and restored it this morning; no wipe, just a straight recovery, and it all went through in less than two minutes.
Thanks for all your work, z3DD3r. It's great to have bleeding-edge software on such an old device.
Hello @z3DD3r , I've been working on a ship for the last couple of months, so missed some things.
I'm using the first original twrp-3.3.1-HH-hammerhead version you shared in the telegram group, but now I found this thread with newer versions.
Just wanted to double check if it's okay to update straight from that original HH version (ALREADY REPARTED) to the lates HH.R.4 without any problems.
z3DD3r said:
How to revert back to stock /system size and stock partitions map:
- Launch HH.R version of TWRP
- Open terminal (TWRP -> Advanced -> Terminal)
- Type hh_repart -r
- Wait until your phone reboots
- Flash official TWRP or HH.S version of TWRP! Don't ignore this step!
Click to expand...
Click to collapse
And just out of curiosity, cause I'm not planning on reverting to stock partitions. Why is it so important to flash official or HH.S version after reverting?
What is the difference between stock and HH.S.4 then?
Thanks for putting your time and efforts in to keeping this device alive!
TomiLynch said:
Hello @z3DD3r , I've been working on a ship for the last couple of months, so missed some things.
I'm using the first original twrp-3.3.1-HH-hammerhead version you shared in the telegram group, but now I found this thread with newer versions.
Just wanted to double check if it's okay to update straight from that original HH version (ALREADY REPARTED) to the lates HH.R.4 without any problems.
Click to expand...
Click to collapse
twrp-3.3.1-HH-hammerhead and TWRP HH.R uses the same script for repartition. So, yes, it is okay to flash HH.R over the twrp-3.3.1-HH-hammerhead.
TomiLynch said:
And just out of curiosity, cause I'm not planning on reverting to stock partitions. Why is it so important to flash official or HH.S version after reverting?
What is the difference between stock and HH.S.4 then?
Thanks for putting your time and efforts in to keeping this device alive!
Click to expand...
Click to collapse
Because TWRP includes size of system partition. This size should match the size of system partition on device. Otherwise bad things can happen...

Categories

Resources