FORUMS
Remove All Ads from XDA

[MOD] Boot Bridge for Sony ELF

2,161 posts
Thanks Meter: 12,646
 
By AdrianDC, Recognized Developer on 25th November 2016, 12:45 PM
Post Reply Email Thread


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 if you have any concerns about features included in this ROM
 * before flashing it! YOU are choosing to make these modifications, and if
 * you point the finger at me for messing up your device, I will laugh at you.
 */


About the project
Boot Bridge for Sony ELF is born out of an idea to create support
of systemless tools like SuperSU on the Sony ELF bootimages.

The structure being different from regular Android boot partitions,
these tools never worked to edit the content of the boot image
present on devices like the Xperia SP, T, TX, V, ...

Boot Bridge for Sony ELF allows you to choose the systemless zip
by simply replacing the file install/install.zip with the one to flash.

Warning: BootBridge for Sony ELF is meant to be used on custom ROMs.
For stock ROMs, you'd need to patch the ROM (bootimage securities) first.
Please refer to the currently supported devices list in the second post.

When you flash the Boot Bridge zip, a fake regular bootimage is created
with the contents of the original ELF partition, mapped in the fstab,
then the install.zip is automatically flashed as if you did yourself,
and finally the ELF partition is updated accordingly.

Boot Bridge for Sony ELF also supports being used with MultiROM secondary ROMs.

The project is an extension of the libbootimg originally created by Tasssadar,
that I then reworked to add Sony ELF boot support for Xperia MultiROM.


Downloads (Unlocked Bootloader only)
BootBridge-SonyELF.zip : https://github.com/AdrianDC/android_...ge-SonyELF.zip

Preview of the installation


OPTION 1) How to root with phhSuperUser by phhusson
In order to get root access on AOSP based ROMs (7.1.1 included),
you need to download the phhSuperUser project by phhusson.
superuser.zip : http://forum.xda-developers.com/andr...ruser-t3216394
  • Rename the downloaded zip to install.zip
  • Open the Boot Bridge zip with a zip manager
  • Replace the file install/install.zip with the new one
  • Flash the new Boot Bridge zip in the TWRP recovery
  • Reboot to Android
  • Install the phh's SuperUser application

OPTION 2) How to root with SuperSU by Chainfire
In order to get root access on AOSP based ROMs (2.78 SR5 or newer for 7.1.x),
you need to download the SuperSU project by Chainfire.
SuperSU zip (Latest version) : http://forum.xda-developers.com/apps/supersu
  • Rename the downloaded zip to install.zip
  • Open the Boot Bridge zip with a zip manager
  • Replace the file install/install.zip with the new one
  • Flash the new Boot Bridge zip in the TWRP recovery
  • Reboot to Android

OPTION 3) How to use with Magisk by topjohnwu
Magisk (Latest version) : https://forum.xda-developers.com/app...mless-t3473445
  • Rename the downloaded zip to install.zip
  • Open the Boot Bridge zip with a zip manager
  • Replace the file install/install.zip with the new one
  • Flash the new Boot Bridge zip in the TWRP recovery
  • Reboot to Android



Source code
Project sources - https://github.com/AdrianDC/android_boot_bridge (branch master)
libbootimg sources - https://github.com/AdrianDC/multirom_libbootimg (branch master)
MultiROM sources - https://github.com/AdrianDC/multirom_core (branch master)

Boot Bridge for Sony ELF created also thanks to :
- Tasssadar for the original libbootimg / MultiROM sources
- The XperiaMultiROM team for our evolution of MultiROM
- Chainfire for the flashable OUTFD export and boot detection
- Everyone involved in testing it

XDA:DevDB Information
Android Boot Bridge for Sony ELF, Tool/Utility for the OEM Cross Device Development

Contributors
Adrian DC

Version Information
Status: No Longer Updated

Created 2016-11-25
Last Updated 2019-08-06
The Following 78 Users Say Thank You to AdrianDC For This Useful Post: [ View ]
 
 
25th November 2016, 12:45 PM |#2  
AdrianDC's Avatar
OP Recognized Developer
Flag Île-de-France
Thanks Meter: 12,646
 
More
Reserved
Changelog
Code:
Boot Bridge for Sony ELF - 26/12/2018
======================================
* Resolve compatibility with Magisk v17+ due to an
  internal evolution of its boot partitions detection

Boot Bridge for Sony ELF - 28/05/2017
======================================
* Use android_boot as potential bridge to fix SuperSU

Boot Bridge for Sony ELF - 20/12/2016
======================================
* Fix the 32/64 bits dual support

Boot Bridge for Sony ELF - 18/12/2016
======================================
* Added support for Sony Stock ELF (64 bits) bootimages
* libbootimg changes from my recent updates

Boot Bridge for Sony ELF - 29/11/2016
======================================
* Fix the boot partition detection with symlinks
* Restore phhSuperuser support

Boot Bridge for Sony ELF - 27/11/2016
======================================
* Add support for newer Sony ELF partitions
* Allows to root Stock Sony ROMs on the Xperia Z2
* Updated in collaboration with Alexander Diewald

Boot Bridge for Sony ELF - 25/11/2016
======================================
* Initial public release on XDA

Devices confirmed
Code:
Sony Xperia SP (Huashan): phhSuperSU, SuperSU
Sony Xperia T/TX/V (Mint, Hayabusa, Tsubasa): phhSuperSU, SuperSU
Sony Xperia Z2 (Sirius): SuperSU on Stock ROMs
Sony Xperia X Performance (Dora): Stock ROM patching
...
The Following 41 Users Say Thank You to AdrianDC For This Useful Post: [ View ]
25th November 2016, 01:55 PM |#3  
DREAMVERSE's Avatar
Member
Flag Samarinda
Thanks Meter: 16
 
More
It's great news! thanks a lot, will try it soon.
The Following User Says Thank You to DREAMVERSE For This Useful Post: [ View ] Gift DREAMVERSE Ad-Free
26th November 2016, 12:32 AM |#4  
Senior Member
Flag Montreal
Thanks Meter: 5,637
 
Donate to Me
More
hi @Adrian DC,

Thanks for your mail that pointing me on this thread.
As you now I'm maintaining a ROM for Xperia S and your project can be a good fit for it

For now I have a built-in support of root but no solution for those who wants SuperSU.

I'm generating the boot.img for Xperia S with the commandline :

python $(MKELF) -o [email protected] $(PRODUCT_OUT)/[email protected]$(BOARD_KERNEL_ADDR) $(PRODUCT_OUT)/[email protected]$(BOARD_RAMDISK_ADDR),ramdisk $(RPMBIN)@$(BOARD_RPM_ADDR),rpm

With parameters below :
# boot image
BOARD_KERNEL_ADDR := 0x40208000
BOARD_RAMDISK_ADDR := 0x41500000
BOARD_RPM_ADDR := 0x20000

Is your project compatible with the way I'm generating boot.img for Xperia S ?

If yes, I will test it with SuperSU (sepolicy for SuperSU systemless is already supported on the ROM).

Thanks for your feedback and work on that topic
The Following 2 Users Say Thank You to mickybart For This Useful Post: [ View ] Gift mickybart Ad-Free
26th November 2016, 01:08 AM |#5  
AdrianDC's Avatar
OP Recognized Developer
Flag Île-de-France
Thanks Meter: 12,646
 
More
Quote:
Originally Posted by mickybart

Thanks for your mail that pointing me on this thread.

No problem.

Normally the full port of Sony ELF partitions I made inside libbootimg for MultiROM
is compatible with all bootimages structures from these series of Sony devices.

I invite you to have your ROM's boot.img flashed into boot directly,
then flash my Boot Bridge as it is, even without a rooting zip, like in my screenshot,
and let it run to see the bridge creation then restore perform.

If anything goes wrong and the bootimage is not readable,
the process will stop and nothing will be done.

In the very worst case, the rebuilt boot image doesn't start
and you simply fastboot the image you came from.

Also recently I worked with Diewi (Alexander) to extend ELF support
to the newer version of Sony's last ELF devices, the 8974 (Z2) boot
that had ELF Stock images but also support for Android normal ones.
Once fully tested and confirmed, the update will be done on this project too.

On a side note, about root, SuperSU works fine on my devices on 6.0 & less,
for 7.1 the installation is fine too but the root features failed (with sepolicies totally fixed),
this is apparently common / randomly affecting some devices,
Chainfire is aware of it, so do not be surprised if that happens on yours,
and give phhSuperUser a go too as it is the fully working method on my AOSP 7.1 now.

Bye !
The Following 11 Users Say Thank You to AdrianDC For This Useful Post: [ View ]
26th November 2016, 04:50 AM |#6  
Scarecrow.'s Avatar
Senior Member
Thanks Meter: 39
 
More
Amazing! Worked like a charm..no issues at all..thanks a [email protected] Adrian DC
The Following User Says Thank You to Scarecrow. For This Useful Post: [ View ] Gift Scarecrow. Ad-Free
27th November 2016, 04:24 PM |#7  
AdrianDC's Avatar
OP Recognized Developer
Flag Île-de-France
Thanks Meter: 12,646
 
More
Boot Bridge updated to support newer Sony ELF devices,
including the Stock Sony ROMs, allowing an easy SuperSU root process.
The Following 8 Users Say Thank You to AdrianDC For This Useful Post: [ View ]
28th November 2016, 02:48 PM |#8  
Miggystar's Avatar
Senior Member
Flag Caracas
Thanks Meter: 49
 
More
Hi Adrian, Sorry if is a noob question but im facing ERROR: 7 after instaling the BootBridge-SonyELF.zip, i've already replace the install.zip, it says in TWRP ------> Found bootimg @ /dev/block/platform/msm_sdcc.1/by-name/kernel ----> assert failed: run_program(''/tmp/boot_bridge/flash_zip.sh'', ''/tmp/boot_ brdge'', ''install.zip'') == 0 .... what i'm doing wrong? .. Im on AOSP 25/11 . Thanks for your time
28th November 2016, 04:12 PM |#9  
MichaBit's Avatar
Senior Member
Thanks Meter: 110
 
More
Quote:
Originally Posted by Miggystar

Hi Adrian, Sorry if is a noob question but im facing ERROR: 7 after instaling the BootBridge-SonyELF.zip, i've already replace the install.zip, it says in TWRP ------> Found bootimg @ /dev/block/platform/msm_sdcc.1/by-name/kernel ----> assert failed: run_program(''/tmp/boot_bridge/flash_zip.sh'', ''/tmp/boot_ brdge'', ''install.zip'') == 0 .... what i'm doing wrong? .. Im on AOSP 25/11 . Thanks for your time

I've got the same error, did everything exactly according to instructions.
Where could the error be?
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2016-11-28-16-40-50.png
Views:	1504
Size:	97.4 KB
ID:	3951487  
29th November 2016, 12:50 AM |#10  
AdrianDC's Avatar
OP Recognized Developer
Flag Île-de-France
Thanks Meter: 12,646
 
More
Quote:
Originally Posted by MichaBit

I've got the same error, did everything exactly according to instructions.
Where could the error be?

Thanks for reporting the issue.
It was introduced with the new update to support Z2 devices, and affected only phhSuperuser.

The issue is now fully fixed, please download the new version and try again.
The Following 5 Users Say Thank You to AdrianDC For This Useful Post: [ View ]
29th November 2016, 02:14 AM |#11  
MichaBit's Avatar
Senior Member
Thanks Meter: 110
 
More
Quote:
Originally Posted by Adrian DC

Thanks for reporting the issue.
It was introduced with the new update to support Z2 devices, and affected only phhSuperuser.

The issue is now fully fixed, please download the new version and try again.

Installation completed!
#root successfully
Many thanks and greetings Adrian
The Following User Says Thank You to MichaBit For This Useful Post: [ View ] Gift MichaBit Ad-Free
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes