[KERNEL][XZ] WorldKernel Oreo - Sony Xperia XZ ROMs, Kernels, Recoveries, & Other

Here is a kernel pretty much stock built through the sources
Build kernel from clean sources
Add features ramdisk:
*Patched from Rootkernel V5.23 (UNOFFICIAL 2) Thank's to serajr
then: disabled encryption, dm_verity...
Removed all dependencies dm_verity
Disable boot verification
Decreased swappiness from 100 to 60
Removed Sony RIC and all dependencies
Add features Zimage:
Build with aarch64-linux-android-4.9
Enable toggle for CRC (stock Y, changed to N disabled for default)
Removed dm_verity
Disabled ecryptfs
Note that not all resource requests will be granted, this is a custom kernel built for my private use
But I'll be ready to the experience you have with some other kernel and/or feature that will bring improvements
* Required Bootloader Unlocked!
* Do not forget to back up your DRM keys!
* Installation:
Downloads:
WorldKernel_v1
WorldKernel_v2
-Flash via fastboot:
Code:
fastboot flash boot worldkernel_v2.img
* Root:
Recommended Magisk_v14-5
* Please, do not mirror!
* Github
* ChangeLog:
v1:
Initial build from sources 41.3.A.2.24
v2:
Removed Sony RIC and all dependencies
Enjoy!

Awesome.does this support dual version?
BTW are DRM functions all working?

josephnero said:
Awesome.does this support dual version?
BTW are DRM functions all working?
Click to expand...
Click to collapse
Build from single (and ramdisk)
DRM patched from Rootkernel V5.23 (UNOFFICIAL 2)

thanks for the answer.
PS:I flashed it on dual sim.I only have one sim so I don't know if second slot works but DRM patch isn't working.

josephnero said:
thanks for the answer.
PS:I flashed it on dual sim.I only have one sim so I don't know if second slot works but DRM patch isn't working.
Click to expand...
Click to collapse
did you backup DRM?
followed the instructions of the post?
you flash DK.ftf?

Gustavo RD78 said:
did you backup DRM?
followed the instructions of the post?
you flash DK.ftf?
Click to expand...
Click to collapse
Hmmm.no. I missed the part that I should flash DK.ftf is it in the first post?

josephnero said:
Hmmm.no. I missed the part that I should flash DK.ftf is it in the first post?
Click to expand...
Click to collapse
check:
https://forum.xda-developers.com/xp...oot-automatic-repack-stock-kernel-dm-t3301605
Code:
If you managed to backup for TA partition before then you can reactivate your original device key as follows:
Code:
flash_dk <ta backup image> DK.ftf
Flashing this file with flashtool will write your device key to an alternative unit, from where the drmfix library will pick it up.
This is a one-time task. It will survive a complete reset of the phone or Android system upgrade. The device key has a length of just 16 bytes, so it is correct that the resulting DK.ftf has a size of only aprox. 500 bytes.
note: latest flashtool not flash DK.ftf
So
use Xflasher:
https://forum.xda-developers.com/crossdevice-dev/sony/dev-xflasher-command-line-flasher-t2986634
rename DK.ftf to DK.zip, unpack DK.ta and follow the instructions in the thread

Ok thanks.

Gustavo RD78 said:
check:
https://forum.xda-developers.com/xp...oot-automatic-repack-stock-kernel-dm-t3301605
Code:
If you managed to backup for TA partition before then you can reactivate your original device key as follows:
Code:
flash_dk <ta backup image> DK.ftf
Flashing this file with flashtool will write your device key to an alternative unit, from where the drmfix library will pick it up.
This is a one-time task. It will survive a complete reset of the phone or Android system upgrade. The device key has a length of just 16 bytes, so it is correct that the resulting DK.ftf has a size of only aprox. 500 bytes.
note: latest flashtool not flash DK.ftf
So
use Xflasher:
https://forum.xda-developers.com/crossdevice-dev/sony/dev-xflasher-command-line-flasher-t2986634
rename DK.ftf to DK.zip, unpack DK.ta and follow the instructions in the thread
Click to expand...
Click to collapse
Thanks for your work .. so with this kernel we can restore our backed up TA.img and have root ?
If yes please someone post detailed instructions with needed tools

korom42 said:
Thanks for your work .. so with this kernel we can restore our backed up TA.img and have root ?
If yes please someone post detailed instructions with needed tools
Click to expand...
Click to collapse
No, You cannot run a custom kernel once you restore your TA. restoring your TA relocks the bootloader. The method mentions 'spoofs' the DRM keys to restore DRM functionality but it does not restore the trim area.

korom42 said:
Thanks for your work .. so with this kernel we can restore our backed up TA.img and have root ?
If yes please someone post detailed instructions with needed tools
Click to expand...
Click to collapse
gregbradley said:
No, You cannot run a custom kernel once you restore your TA. restoring your TA relocks the bootloader. The method mentions 'spoofs' the DRM keys to restore DRM functionality but it does not restore the trim area.
Click to expand...
Click to collapse
As quoted by @gregbradley...
Flash Magisk as quoted in the post will get root

Gustavo RD78 said:
check:
https://forum.xda-developers.com/xp...oot-automatic-repack-stock-kernel-dm-t3301605
Code:
If you managed to backup for TA partition before then you can reactivate your original device key as follows:
Code:
flash_dk <ta backup image> DK.ftf
Flashing this file with flashtool will write your device key to an alternative unit, from where the drmfix library will pick it up.
This is a one-time task. It will survive a complete reset of the phone or Android system upgrade. The device key has a length of just 16 bytes, so it is correct that the resulting DK.ftf has a size of only aprox. 500 bytes.
note: latest flashtool not flash DK.ftf
So
use Xflasher:
https://forum.xda-developers.com/crossdevice-dev/sony/dev-xflasher-command-line-flasher-t2986634
rename DK.ftf to DK.zip, unpack DK.ta and follow the instructions in the thread
Click to expand...
Click to collapse
Hi,
1 time task only, does it mean we have no need to reflash again, even we upgrade your kernel, or flash another ROM/kernel in the future, and still keeping the drmfix?

wc_how said:
Hi,
1 time task only, does it mean we have no need to reflash again, even we upgrade your kernel, or flash another ROM/kernel in the future, and still keeping the drmfix?
Click to expand...
Click to collapse
Since you have already restored DRM using the posted method:
after flashing this kernel you only need to flash Magisk to get root and you do not need to flash DK.ftf again for DRM

Gustavo RD78 said:
Since you have already restored DRM using the posted method:
after flashing this kernel you only need to flash Magisk to get root and you do not need to flash DK.ftf again for DRM
Click to expand...
Click to collapse
I can't get what's "DK.ft" are you referring to rhe firmware from flashtool /XperiaFirm
By the way I got into a bootloop by flashing this kernel on my XZ Dual (F8332)

korom42 said:
I can't get what's "DK.ft" are you referring to rhe firmware from flashtool /XperiaFirm
By the way I got into a bootloop by flashing this kernel on my XZ Dual (F8332)
Click to expand...
Click to collapse
Check this for create DK.ftf, make a thorough reading
https://forum.xda-developers.com/xperia-z5/development/root-automatic-repack-stock-kernel-dm-t3301605

everything working perfectly. thanks
edit. i realised i had some problems relative to your kernel with a couple apps. with one metaposta.app i cant open pdf files and with inbox i had some lag. I flash my own kernel stock with dm verity disable sony ric and now works . cheers

DRMfix will be broken if I use Magisk v15?

Yes, broke. Use posted in thread insted

Gustavo RD78 said:
Here is a kernel pretty much stock built through the sources
Build kernel from clean sources
Add features ramdisk:
*Patched from Rootkernel V5.23 (UNOFFICIAL 2) Thank's to serajr
then: disabled encryption, dm_verity...
Removed all dependencies dm_verity
Disable boot verification
Decreased swappiness from 100 to 60
Removed Sony RIC and all dependencies
Add features Zimage:
Build with aarch64-linux-android-4.9
Enable toggle for CRC (stock Y, changed to N disabled for default)
Removed dm_verity
Disabled ecryptfs
Note that not all resource requests will be granted, this is a custom kernel built for my private use
But I'll be ready to the experience you have with some other kernel and/or feature that will bring improvements
* Required Bootloader Unlocked!
* Do not forget to back up your DRM keys!
* Installation:
Downloads:
WorldKernel_v1
WorldKernel_v2
-Flash via fastboot:
* Root:
Recommended Magisk_v14-5
* Please, do not mirror!
* Github
* ChangeLog:
v1:
Initial build from sources 41.3.A.2.24
v2:
Removed Sony RIC and all dependencies
Enjoy!
Click to expand...
Click to collapse
Can this be used in this version?

Related

[RECOVERY][TWRP&CWM][Updated: 6-Feb-2013]Stock Kernel on Official Jellybean

Note: This has been deprecated in favour of LK for Xperia T
This kernel image is based on stock using the FreeXperia ramdisk method of loading stock and recovery. It also includes the new FOTA partition trick by Dees_Troy for easy updates in the future to TWRP.
Dees_Troy and I worked on figuring out the reason recovery binaries would not load on the stock kernel without patches, fixed this up in bionic, and rebuilt recovery linked against the fixed bionic.
F.A.Q
Q. The title says TWRP and CWM but when I boot recovery I only see TWRP. How do I get CWM?
A. TWRP is the default recovery, if you want CWM you should download the CWM update.zip in the second post and flash it with twrp.
Technical Info​
In 3.4 Qualcomm have changed the fb_var_screeninfo struct slightly. They have added an extra field called colorspace which increases the size of the stuct by __u32. When a binary linked against bionic tries to pass a struct the size of the old fb_var_screeninfo to kernelspace the application breaks as the kernel is expecting more data than it was given.
The patch to fix this in kernel solves the problem by removing one of the reserved fields, bringing the struct back to the same size it was prior to the new field being added. While this keeps compatibility with older recovery binaries, it does introduce the problem of needing a custom kernel to run recovery. Sony have not yet released source for 9.1.A.0.489 which means the kernel cannot be rebuilt without issues such as WiFi not working. The patch that Dees_Troy applied to the build system was to add the new colorspace field into the header for bionic which means the new recovery binary can run on an unmodified stock Sony kernel.
Flashing​
Boot device in fastboot mode:
Code:
adb reboot bootloader
Flash image with fastboot:
Code:
fastboot flash boot mint489stock.img
Source for TWRP available from here.​
Updates:
1. Updated image in first post to fix bug where creating a backup would fail and crash twrp.
2. Updated first post to show CWM in title and answer questions about how to get CWM.
Flashable zips:
In the first post it is mentioned about using the FOTAKernel trick by Dees_Troy to offer easy updates. The 2 zips attached to this post are examples of the ease of use.
flashCWM.zip - This will flash CWM to the FOTAKernel and replace TWRP as your recovery.
flashTWRP.zip - This will flash TWRP to the FOTAKernel and replace TWRP that is built into the image that was flashed to your device by fastboot, or to replace CWM with TWRP again if you used the flashCWM.zip
This also makes updates easier as you do not need to replace the kernel image you currently have flashed to your device.
Re: [RECOVERY][TWRP]Stock Kernel on Official Jellybean
Many thanks, can you just clear up one thing please, does Wi-Fi work on this image?
Sent from my LT30p xda premium app.
How do I customise the signature on xda premium app?
gregbradley said:
Many thanks, can you just clear up one thing please, does Wi-Fi work on this image?
Sent from my LT30p xda premium app.
How do I customise the signature on xda premium app?
Click to expand...
Click to collapse
Yes, wifi does work because it is just the stock kernel with TWRP added. I am running it right now with no problems.
I thought so, but I just wanted to make it obvious to all users as it was not 100% clear from the OP. I didnt have time to flash myself and check as I was just abbout to leave for work, now I am at work I will also flash it....
lilstevie said:
This kernel image is based on stock using the FreeXperia ramdisk method of loading stock and recovery. It also includes the new FOTA partition trick by Dees_Troy for easy updates in the future to TWRP.
Dees_Troy and I worked on figuring out the reason recovery binaries would not load on the stock kernel without patches, fixed this up in bionic, and rebuilt recovery linked against the fixed bionic.
Technical Info​
In 3.4 Qualcomm have changed the fb_var_screeninfo struct slightly. They have added an extra field called colorspace which increases the size of the stuct by __u32. When a binary linked against bionic tries to pass a struct the size of the old fb_var_screeninfo to kernelspace the application breaks as the kernel is expecting more data than it was given.
The patch to fix this in kernel solves the problem by removing one of the reserved fields, bringing the struct back to the same size it was prior to the new field being added. While this keeps compatibility with older recovery binaries, it does introduce the problem of needing a custom kernel to run recovery. Sony have not yet released source for 9.1.A.0.489 which means the kernel cannot be rebuilt without issues such as WiFi not working. The patch that Dees_Troy applied to the build system was to add the new colorspace field into the header for bionic which means the new recovery binary can run on an unmodified stock Sony kernel.
Flashing​
Boot device in fastboot mode:
Code:
adb reboot bootloader
Flash image with fastboot:
Code:
fastboot flash boot mint489stock.img
Source for TWRP available from here.​
Click to expand...
Click to collapse
Such a good news!I will port it to TX JellyBean firmware if you don' mind
gregbradley said:
I thought so, but I just wanted to make it obvious to all users as it was not 100% clear from the OP. I didnt have time to flash myself and check as I was just abbout to leave for work, now I am at work I will also flash it....
Click to expand...
Click to collapse
only for unlocked bl, correct?
hi,
i wanted to create with this version a backup, but it doesn't work.
it was just created the folder system,
the other folders such as data and boot not.
the created folder system, that was created after backup, is empty.
the 'backup' also takes only a few seconds, then the 'backup' is done.
what have i done?
installed the .img with instructions above.
boot xt into recovery, push backup, select system, data & boot, choose destination folder and start backup.
where is my failure?
hkjr said:
only for unlocked bl, correct?
Click to expand...
Click to collapse
Yes
MysticEnforcer said:
hi,
i wanted to create with this version a backup, but it doesn't work.
it was just created the folder system,
the other folders such as data and boot not.
the created folder system, that was created after backup, is empty.
the 'backup' also takes only a few seconds, then the 'backup' is done.
what have i done?
installed the .img with instructions above.
boot xt into recovery, push backup, select system, data & boot, choose destination folder and start backup.
where is my failure?
Click to expand...
Click to collapse
Same here....seems backup is not working
MysticEnforcer said:
the 'backup' also takes only a few seconds, then the 'backup' is done.
Click to expand...
Click to collapse
Updated first post with a fixed image.
Thank you very much, this is the best message of day.
Just flashed new image
Doing a backup and it seems to work...will update in few minutes when it is finished
EDIT:
It works
Backup complete in 385 seconds
FYI,
both times on rebooting system from recovery I initially got the grey triangle, both times it was only for 10-15 seconds before the phone rebooted...
Testing it now ....
Edit:
[Backup completed in 461 seconds] External SD card with compression on. No Grey triangle for me.
[Restore completed in 192 seconds] Restored backup without any problems. No grey triangle on second reboot either.
Seems to work great for me.
(only clock seems to be incorrect. 7 hours and 16 minutes behind)
Edit 2: thirth boot up seems to get stuck on grey triangle for about 15 seconds
Edit 3: Seems only the first time reboot after using the recovery the grey triangle is there. Rebooted the phone 4 times and only got the triangle 1 time.
Updated first and second post
USB storage does not work at all both on TWRP and CWM
tested 2nd version, works fine for me & no grey triangle :good:
romcio47 said:
USB storage does not work at all both on TWRP and CWM
Click to expand...
Click to collapse
Noticed that to
romcio47 said:
USB storage does not work at all both on TWRP and CWM
Click to expand...
Click to collapse
This appears to be more of a technical limitation.
The internal storage space is formatted ext4, so only linux would be able to mount that by default so it doesn't offer that.
With the MicroSD the issue seems to be a little more complex and may possibly need a custom kernel.
lilstevie said:
This appears to be more of a technical limitation.
The internal storage space is formatted ext4, so only linux would be able to mount that by default so it doesn't offer that.
With the MicroSD the issue seems to be a little more complex and may possibly need a custom kernel.
Click to expand...
Click to collapse
Thanks for the reply I guess we just have to wait for the kernel sources to be published
Besides another issue - in CWM wiping dalvik-cache does not work.
romcio47 said:
Besides another issue - in CWM wiping dalvik-cache does not work.
Click to expand...
Click to collapse
I can't reproduce this, if I wipe dalvik-cache in CWM it removes /data/dalvik-cache as it should.

[ROM][5.0 Lollipop] AOSP build

Welcome to Lollipop
Clean install with custom recovery (TWRP) (recommended)
Download the following files:
aosp_mako-ota-eng.5.0.zip or aosp_mako-ota-eng-preroot.5.0.zip (if you want to have root*) (mirrors, thanks to dorqus)
* In case you have already downloaded aosp_mako-ota-eng.5.0.zip you can also flash aosp_mako-boot-root.5.0.zip to prepare for root
optional: BETA-SuperSU-v2.19.zip
defcon-L-gapps-v2.zip
Recommended: Backup your apps:
Code:
adb backup -apk -obb -all -system
Recommend: Backup your internal storage (see FAQ below for the reason). Either copy all files in Explorer or use adb:
Code:
adb pull /sdcard/
Boot to recovery
Recommend: Factory reset. Warning: All your apps and app data will be deleted! Make sure you have a backup!
Recommend: Format/wipe internal storage (see FAQ below for the reason). Warning: All your files will be deleted! Make sure you have a backup!
Format/wipe system
Unmount system
Install aosp_mako-ota-eng.5.0.zip (or aosp_mako-ota-eng-preroot.5.0.zip)
Install gapps-lp-20141105-signed.zip
Optional: Install BETA-SuperSU-v2.19.zip
Reboot
Have a break and don't panic! The first boot can take 5 to 10 minutes
Optional: Recover from backup:
Code:
adb restore backup.ab
Optional: Copy your files back to internal storage
Clean install with fastboot
You won't have GApps this way ...
WARNING: If you flash userdata.img, all your data will be gone! Even the files on internal storage!
Download the images
boot.img or boot-root.img (prepared for root, you still have to install SuperSU somehow...)
system.img
Optionalrecovery.img
Optional, should be empty: cache.img
Optional, should be empty: userdata.img
Boot to bootloader
Flash
Code:
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash userdata userdata.img
fastboot flash system system.img
FAQ
Oh no, all my files are lost!!!
or
Why should I wipe internal storage?
5.0 uses a much stricter SELinux policy than most 4.4 ROMs do. Normally the first boot should migrate all the things (and it did for me, but only the first time). If not, you are no longer able to see your internal storage (aka SD card). E.g. Camera says: Please enter an SD card. To fix that problem you have to either wipe the internal storage and let Android recreate the file structure. (You can before still access the /sdcard in TWRP for a backup with adb). Or you can fix the SELinux context with the following command (in recovery):
Code:
adb shell
IFS="
"
for i in `find /data/media`; do chcon u:object_r:media_rw_data_file:s0 "$i"; done
Is this the official update from Google?
No, this is an AOSP build from the latest Lollipop sources.
Do I need to be on stock 4.4.4 before flashing?
No, but you should consider doing a factory reset otherwise.
Can I do a dirty upgrade?
Yes, you can. But you might spend a lot of time in fixing F/Cs...
Can this ROM be rooted?
Yes, just flash aosp_mako-ota-eng-preroot.5.0.zip (or aosp_mako-boot-root.5.0.zip) and BETA-SuperSU-v2.19.zip
Known issues
General:
No access to internal storage, even not with adb or as root. Seems like SELinux is misconfigured. See FAQ for solution
Due to incomplete GApps:
WLAN/mobile based location isn't working
No face unlock (libs missing) works with new gapps
calendar sync provider missing works with new gapps
How to build
This ROM is build with the original Google sources:
Code:
repo init -u https://android.googlesource.com/platform/manifest -b android-5.0.0_r2
See https://source.android.com/source/building.html for build instructions.
Binary blobs are taken from https://developers.google.com/android/nexus/blobs-preview.
The kernel is the default precompiled kernel provided by Google (can be found in device/lge/mako-kernel/kernel).
To prepare for root, you have to remove the seclabel line from system/core/rootdir/init.rc:
Code:
service flash_recovery /system/bin/install-recovery.sh
class main
seclabel u:r:install_recovery:s0
oneshot
C-o-M said:
Welcome to Lollipop
Download: https://drive.google.com/file/d/0B10l7w-7w3boRzlmT1pxSFF5YlU/view?usp=sharing
We don't have 5.0 gapps yet, so I flashed pa-gapps-modular-mini-4.4.4-20140930 (after removing the version check in updater-script). Works great so far.
I'm running a dirty upgrade from 4.4.4, no issues so far. Just format /system, flash ota.zip and gapps, wipe cache and enjoy.
Click to expand...
Click to collapse
I guess this requires me to be running stock 4.4.4 before flashing.
Could you post the system.img , userdata.img , cache.img , boot.img and recovery.img so I could flash it via fastboot.
Thanks
Amazing work!!
can you upload modified pa gapps??
or any instruction to modify it?
Good job!
trasteando...
is this from google ?
richardyusan said:
is this from google ?
Click to expand...
Click to collapse
all ROM's are from Google's base dude
maybe what you really mean is from stock L image?
is this rooted guys?
Is this official aosp build and can I clean flash?
Please explain how to root tris ROM?!
C-o-M said:
Welcome to Lollipop
Download: https://drive.google.com/file/d/0B10l7w-7w3boRzlmT1pxSFF5YlU/view?usp=sharing
We don't have 5.0 gapps yet, so I flashed pa-gapps-modular-mini-4.4.4-20140930 (after removing the version check in updater-script). Works great so far.
I'm running a dirty upgrade from 4.4.4, no issues so far. Just format /system, flash ota.zip and gapps, wipe cache and enjoy.
Click to expand...
Click to collapse
dirty flash from stock 4.4.4 ?
also can you provide a link to working gapps
great job , waiting issues from other
groovepeppy said:
all ROM's are from Google's base dude
maybe what you really mean is from stock L image?
Click to expand...
Click to collapse
lol you don't say
we know every android build is from google
is this official from google or not?
richardyusan said:
lol you don't say
we know every android build is from google
is this official from google or not?
Click to expand...
Click to collapse
It's in the topic dude.
AOSP not OTA
Bladyle said:
It's in the topic dude.
AOSP not OTA
Click to expand...
Click to collapse
What he means is this proper aosp fully working 100% and has latest kernel and everything?
SRun said:
What he means is this proper aosp fully working 100% and has latest kernel and everything?
Click to expand...
Click to collapse
it will be 100% working when we have OTA or after some time with AOSP when developers fix all the missing binaries, libraries, bugs and etc.
SRun said:
What he means is this proper aosp fully working 100% and has latest kernel and everything?
Click to expand...
Click to collapse
i think we should install the rom and experience
Bugs? Root? Smooth? Please post bugs and stuff
I'm returning to stock 4.4.4 as I type this, and then I will do a clean flash of this 5.0 AOSP build and see how I go. Shall report back here upon completion.
richardyusan said:
lol you don't say
we know every android build is from google
is this official from google or not?
Click to expand...
Click to collapse
understood "sam"
that's why i wrote "maybe what you really mean is from stock L image?"
how to i disable the version check to install gapps?
anyway to get the official launcher? the one in this rom looks like 4.4 stock

[ROOT][Kernel][TWRP] repack of the stock kernel with dm-verity and SONY RIC off

Changelog:
V5.23 Fix for Android 6 (Freeze on boot logo)
Installation of kcal kernel module for supported kernels. Get the app from https://forum.xda-developers.com/android/software-hacking/dev-kcal-advanced-color-control-t3032080
V5.22 Bug in the vendor overlay creation. Existing directories (like /vendor/bin) have not been replicated correctly
V5.21 Fix issue when running on Linux (some CR/LF)
Patch libsepol in bootimg for backwards compatibility with Android 6
V5.20 Support for superuser as an alternative to SuperSU (https://github.com/phhusson/Superuser)
Fix for the missing internal storage link in TWRP
V5.11 Support for Android 7.0
Fix in the overlay layout which could prevent some libraries from loading and cause battery drain
V5.1 Support for Android 7.0
Updated bootimg to deal with Android 7.0 policies
New tool inside bootimg for adding new contexts to binary file contexts
New system overlay layout due to a more restrictive linker in Android 7
V5.0 New system overlay method using the /vendor directory. As this directory is also in the library search path even libraries can be easily replaced without modifying the system partition
System-less SuperSU integration improved (Version 2.76 or higher recommended)
System-less xposed integration (using the standard distribution)
Support for 32.A.0.253
V4.51 Fix for awk script for Linux kernel version detection when running on Linux
V4.5 Fixed adb and mtp file access in TWRP for 32.2.A.0.224
V4.42 Added support for Z2 (Sirius) and TWRP fstab fix for leo and aries (thanks to waleedsq81)
V4.41 Fixed issue with Y/N choice on non-english Windows. Added support for Z3 (leo)
V4.4 Support for Z3+/Z4, Tablet Z2, Tablet Z3 and Tablet Z4 added (Z4 still has an issue with TWRP, but DRM fix works)
SuperSU integration reworked in order to need less SELinux exceptions and to be more secure
All tasks can now be individually selected. Therefore there is no separate DRM only script required
V4.31 Renabled Z5P (satsuki) and Z5C (suzuran) for TWRP and drmfix
V4.3 Support for older Lollipop added
Script execution for Linux fixed
V4.24 Fix for for a bug in SuperSU integration in V4.23
V4.23 Fix for repacking 3rd party kernel (Some permissions were on custom directories were lost)
V4.22 Bugfix for readta (flash_dk reported unit not)
V4.21 Fix for the Linux binary of bootimg
V4.2 Updated TWRP to 3.0.2
V4.1
Fix for WideWine (if you have your device key) Thanks a lot to goofnorf101 for testing
unpackinitfs and makeinitfs in my bootimg tool now maintain date/time of files correctly
Automatic SuperSU installation
V4.0
Fix for older kernels (Lollipop)
Binary for Linux (The older version had the ARM version packaged)
Device is not stored in the kernel image anymore
TWRP updated to version 3.0.1
FAQ - Please read
Is is possible to have root with locked bootloader?
Short answer: no
Long answer: The locked bootloader only boots unmodified kernel packages signed by Sony. The stock kernel only mounts unmodified /system partitions (dm-veritiy) -> No modification without unlocking
So any change to the kernel (like this script) or system partition requires unlocked bootloader
What is dm-verity?
A hash checksum on all blocks of a filesystem in order to verify the integrity
What is Sony RIC?
A protection to avoid mounting the root filesystem or system read/write
What happens if I unlock my bootloader
The device key (TA unit 0x1046b) will be wiped, which deactives everything DRM related. In addition a full wipe of your phone will be perfomed.
So extract your TA partition before with this great tool http://forum.xda-developers.com/crossdevice-dev/sony/iovyroot-temp-root-tool-t3349597 from zxz0O0
If you already unlocked the bootloader before, then at least the credentials will be restored, which will reactivate stuff like x-reality and camera de-noise
Why do I need to flash my device key?
Without your device only some functions can be reactivated, like x-reality. Other functions like widevine do not work with out your device key.
How do I enter TWRP recovery?
Restart your phone and press the volume key up as soon as the LED switches to yellow
I want to use a custom kernel with the DRM fix
Just say "N" to all other options. Nevertheless be prepared for problems if the custom kernel does not match your Android version.
What should I do if there is an update to this script?
First check if you really need to run this update by checking the changelog. E.g. if it says binary for Linux fixed and you are using Windows then probably you don't care. If you did not change your Android version then all you have to do is to update the kernel package with fastboot flash boot. If you do not use the automatic SuperSU integration then you have to reinstall SuperSU in TWRP.
This tool repacks an existing kernel package (usually the stock kernel) in order to make it rootable and adds TWRP recovery as well. Version 4 has been succesfully tested with LP and MM.
In particular it adresses the following issues:
DM-Verity: Android is now using dm-verity to verfy the integrity of the system partition. Until you switch it off your phone won't boot after modifying /system
SONY RIC: RIC is blocking the write access to the system partition
DRM Keys: After unlocking the bootloader your device key is wiped, which deactivates some functionaliy. E.g. x-reality, denoise in camera aso.
Recompiling the kernel is not required as only the init ramdisk needs to be modified. You can run these scripts either in Windows or Linux.
Thanks to the excellent work of zxz0O0 you can now backup the TA partition before unlocking the bootloader with this tool http://forum.xda-developers.com/crossdevice-dev/sony/iovyroot-temp-root-tool-t3349597
If you managed to backup your TA partition before you unlocked the bootloader then this version will fully reactivate your keys as well. (many thanks to addicted1900 for helping me with the testing)
As there has been some confusion I would like to point out one more time that you cannot run any kernel package which is not signed by Sony without unlocking the bootloader. So this works only with unlocked bootloader.
As it seems that it is not clear to everyone I also want to mention that <...> is a placeholder. E.g. <extracted kernel> means that you should replace it with then name of your extracted kernel, which could be kernel.elf
There was a report that having SuperSU in the system partition installed may lead to a bootloop. Therfore you shoud first install the bootimage created by this script and then install SuperSU afterwards, as it will then use the system-less strategy.
In order to use these scripts you need the kernel boot image of your current version. There two different ways to obtain it:
Method1:
If you have a .ftf image then open it with zip application (7Zip, WinZip, Windows Compressed Folder) and extract kernel.sin. Afterwards use Flashtool -> Tools -> SIN Editor to extract the kernel. You should end up with the boot image with extension .elf.
Method2:
Run your favourite recovery and connect via
Code:
adb -d shell
Now run
Code:
find /dev -name boot
dd if=<output of the find command before> of=/sdcard/kernel.img
Once you have the kernel image you are ready to use the script.
The newest version support superuser as an alternative to SuperSU. This is available open source and can be verified. In order to integrated you need the current superuser.zip from http://superuser.phh.me/superuser.zip and to be install the app afterwards from Google Play (look for superuser phh) or build it yourself from github.
To integrate the kernel part just place superuser.zip in the rootkernel directory.
You can also still use SuperSU, although it is causing a huge battery draining on my Z5 with Android 7.0 If you place SuperSU in the same directory (SuperSU*.zip, case sensitive) then it will be also installed automatically . It did all the tests with 2.76, but newer versions should work as well. Please be aware that you can not update SuperSU within the application. For a newer SuperSU version you need to rerun the script.
If you want to integrate xposed as well just place the distribution for you device and Android version in the same directory. (e.g. xposed-v86-sdk23-arm64.zip). Only support with Android 6.0 (sdk 23) and higher.
xPosed for Android 7.0+ is still not available.
Code:
rootkernel <extracted kernel> boot.img
You are prompted for several choices:
Sony RIC is enabled. Disable?
I prefer not to disable it in order to keep my phone more secure. Unfortunately there are a lot of bad guys in this world and SELinux and RIC still can save us if someone discovers a new kernel exploit.
Sony RIC basically prevents mounting the /system partition for write. You can still modify it in recovery of of course, but if you require write access to /system without entering recovery then you need to disable it.
Install TWRP recovery? Here you should say yes unless you are trying to patch a non-stock kernel, which comes already with a recovery
Install busybox? For security reasons I prefer not to install. In recovery you have it anyway. This choice is only available if you chose install TWRP
Found SuperSU-v....zip. Install? Integrates SuperSU. For this option to show up you have to place the SuperSU package into the same directory with the name SuperSU*.zip (case sensitive)
Found superuser.zip. Install? Integrates superuser. For this option to show up you have to place superuser.zip into the same directory (case sensitive)
# Make su permissive (Permits any action as su)? This only appears if you install superuser. Permissive means you can anything as root, without it is restricted mainly to file operations (sufficient for e.g. Titanium Backup)
Found xposed-v....zip. Install? Integrates xposed system-less. For this option to show up you have to place the xposed for your device and Android version into the same directory. (e.g. xposed-v86-sdk23-arm64.zip)
Install DRM fix? Installs the DRM fix. First it tries to use the device key which you flashed with flash_dk. If it does not exist it uses an alternative method which cannot fix everything (e.g. Widevine will not work, but X-reality, Camera denoise etc. will work)
Now put your phone into fastboot mode (Volume Up + connect USB) and then run:
To test it without actually flashing it:
Code:
fastboot boot boot.img
For flashing it:
Code:
fastboot flash boot boot.img
If you managed to backup for TA partition before then you can reactivate your original device key as follows:
Code:
flash_dk <ta backup image> DK.ftf
Flashing this file with flashtool will write your device key to an alternative unit, from where the drmfix library will pick it up.
This is a one-time task. It will survive a complete reset of the phone or Android system upgrade. The device key has a length of just 16 bytes, so it is correct that the resulting DK.ftf has a size of only aprox. 500 bytes.
If you like my work you can buy me a coffee
Some background information:
There are two main tools involved (for both Android and Windows)
- busybox
Probably everyone knows it
- bootimg
A multicall binary with several tools for unpacking and packing the boot image as well as adapting the SELinux policy. Part of the code is written by me from scratch, some other parts are cherry picked from other projects. I will also provide the source for it. As Windows doesn't have softlinks I modified the tools for unpacking and packing the init ramdisk to write text files with __lnk__ at the end instead.
Would be great if someone shared E6653 stock .200 kernel boot.img or flashable zip so we can try this out
Funkmasterchilla said:
Would be great if someone shared E6653 stock .200 kernel boot.img or flashable zip so we can try this out
Click to expand...
Click to collapse
Do you want the kernel.sin of stock . 200?
lordriguez said:
Do you want the kernel.sin of stock . 200?
Click to expand...
Click to collapse
I am downloading the whole firmware again from xperifirm. Thank you mate !
Edit: Working great! I'll stick to stock kernel now since Androplus' consumes more battery while asleep !
Edit2: I successfully flashed recoveries in command window from my PC but can't access TWRP at boot though, no LED flashing.
Edit3: Ok that's cuz there's no recovery boot script obviously, my bad. That's above my pay grade, if somebody is kind enough to create a stock. 200 with recoveries it'd be much appreciated PM me if so
Edit!: I flashed monx new stock based kernel
Thank you Tobias !
tobias.waldvogel said:
Hi everyone,
as most of you know, even after unlocking the bootloader there are a few more requirements before you can modify the system partition, i.e. install SuperSU, xposed etc.
- Android is now using dm-verity to verfy the integrity of the system partition. Until you switch it off your phone won't boot after modifying /system
- SONY RIC is blocking the write access to the system partition
The good news is, that it is not required to recompile the kernel. It is sufficent to modify the init scripts inside the init ram disk. So you can just stick to the stock kernel.
I created a package which precisely does this job for you. Just run it from TRWP after installing a new Android version
With this you don't have to wait anymore until someone creates the right kernel package for your phone
PS: It leaves a copy of the new boot image in the internal sdcard if you want to save it somewhere. (boot.img) It can be flashed with fastboot if required.
Click to expand...
Click to collapse
Hmm... I don't understand what this zip file do with phone.... Can you explain more primitive for me?!
Is that for recover stock kernel with stock drm keys?! I understand correct?!
zavpasha said:
Hmm... I don't understand what this zip file do with phone.... Can you explain more primitive for me?!
Is that for recover stock kernel with stock drm keys?! I understand correct?!
Click to expand...
Click to collapse
Before you can start to install thing like SuperSU and xposed you have to change the kernel, otherwise your phone won't boot anymore. In the past you had to wait for someone to come up with a compatible kernel for your phone, now this package just converts your existing kernel.
Regarding the DRM please install the package from the DRM restore thread.
Funkmasterchilla said:
I am downloading the whole firmware again from xperifirm. Thank you mate !
Edit: Working great! I'll stick to stock kernel now since Androplus' consumes more battery while asleep !
Edit2: I successfully flashed recoveries in command window from my PC but can't access TWRP at boot though, no LED flashing.
Edit3: Ok that's cuz there's no recovery boot script obviously, my bad. That's above my pay grade, if somebody is kind enough to create a stock. 200 with recoveries it'd be much appreciated PM me if so
Edit!: I flashed monx new stock based kernel
Thank you Tobias !
Click to expand...
Click to collapse
Thanks for the feedback. Future versions of this package will add TRWP as well. I am currently working on it.
tobias.waldvogel said:
Thanks for the feedback. Future versions of this package will add TRWP as well. I am currently working on it.
Click to expand...
Click to collapse
As promised the new package with TWRP is out
tobias.waldvogel said:
As promised the new package with TWRP is out
Click to expand...
Click to collapse
Great work thanks ,
How would I go about disabling the vibration for recovery?
Sent from my E6653 using Tapatalk
Well, the script which checks if recovery should be started is bin/init inside the zip. If you don't like the vibrate then just remove the line and run the package again
Gesendet von meinem E6683 mit Tapatalk
huh, so it is possible to have 2 recoveries at the same time? (and why would anyone want 2 recoveries? )
Three Recoveries are als possible
CWM, Phils Touch & TWRP
Sent from my E6653 @ XDA Portal
Sorry for being noob.
I miss my Oneplus one where things were so easy.
After unlocking BL what do i do with this zip.
Is it going to Root my phone and Install TWRP?
Thanks for help.
I flash the v2 and i got bootloop. 4 time red LED and the phone reboot and all over again. What's the problem?
Hi Tobias,
can you please build a v2 for the z5 compact too?
thx
stiffmeister
FakeSmile said:
I flash the v2 and i got bootloop. 4 time red LED and the phone reboot and all over again. What's the problem?
Click to expand...
Click to collapse
On which model did you use it and with which firmware version?
If you used flashtool before then you can just flash the kernel one more time (i.e. deselect everything else).
stiffmeister75 said:
Hi Tobias,
can you please build a v2 for the z5 compact too?
thx
stiffmeister
Click to expand...
Click to collapse
This should work on Z5 compact with stock kernel as well, without any change.
In case of any issues you can flash the kernel again via flashtool
If it did not work you can pass me the generated boot.img from your interal sdcard for further analysis
hi tobias,
i didn't try the v2, because i thought, that the twrp recovery wouldn't be compatible.
but when you say it's ok, than i'll try it
br
stiffmeister
stiffmeister75 said:
hi tobias,
i didn't try the v2, because i thought, that the twrp recovery wouldn't be compatible.
but when you say it's ok, than i'll try it
br
stiffmeister
Click to expand...
Click to collapse
I flashed zombie kernel without making backup of stock kernel, can you share it with me so I can try this method (I doubt it will work on zombie)
ps : I have .200 fw
tobias.waldvogel said:
On which model did you use it and with which firmware version?
If you used flashtool before then you can just flash the kernel one more time (i.e. deselect everything else).
Click to expand...
Click to collapse
E6653 on .200 firmware

[KERNEL][Z2] Advanced stock kernel Marshmallow 6.0.1 - 09/aug/2016

Stock zImage
Add features:
busybox auto-injection (/system/xbin)
init.d support - automatically creates init.d in (/system/etc)
twrp-sony-recovery-boot-script based (Thanks @nilezon /jackfagner github script)
TWRP recovery 3.0.2-0 Modified (vol up or down when Violet LED)
Removed SuperSU in TWRP recovery to root because this method will not work
Systemless root support
SElinux permissive
RIC disabled
Debugging enabled by default
Disable debugging notification icon in the status bar
Kernel insecure (ro.secure=0)
Fix swappiness (100 to 60) - as 3.4 kernel source - Improved memory management (23.5.A.1.291 not modified yet)
* Required Bootloader Unlocked!
* Installation:
Downloads:
Advanced_Stock_Kernel_Z2_MM_6.0.1_23.5.A.0.570
Advanced_Stock_Kernel_Z2_MM_6.0.1_23.5.A.1.291
-Flash via recovery or unpack and flash boot.img via fastboot
Code:
fastboot flash boot boot.img
* Root:
-Flash a Systemless SU: SuperSU-v2.76
Note:
- The first boot may take some time, and give the impression that you are in a bootloop. Just wait and it will boot up normally eventually.
* Restore DRM:
-Flash Restore DRM - SONY DRM FUNCTION RESTORATION FOR UB DEVICE
* Please, do not mirror!
Also give a special thank you to @shoey63 in which helped make this possible
Enjoy and press the Thanks button if you like! :good:
.
I'm gonna try it tonight when i plan to swap to MM
thx you.bro.
Gustavo RD78 said:
-Flash Restore DRM - SONY DRM FUNCTION RESTORATION FOR UB DEVICE
.
Click to expand...
Click to collapse
has anybody tried if this actually still works on MM?
Gustavo RD78 said:
Add features:
twrp-sony-recovery-boot-script based (Thanks @nilezon /jackfagner github script)
TWRP recovery 3.0.0-0 Modified (vol up or down when Violet LED)
Removed SuperSU in TWRP recovery to root because this method will not work
Systemless root support
SElinux permissive
RIC disabled
Debugging enabled by default
Disable debugging notification icon in the status bar
Kernel insecure (ro.secure=0)
Fix swappiness (100 to 60) - as 3.4 kernel source - Improved memory management
* Required Bootloader Unlocked!
* Installation:
Download:
Advanced_Stock_Kernel_Z2_MM_Beta_23.5.A.0.486_twrp _3.0.0-0
-Flash via recovery or unpack and flash boot.img via fastboot
Click to expand...
Click to collapse
:good: Thank you, it works for Z2
Works perfectly, thangs
Sent from my D6503 using Tapatalk
Will this give me recovery access without wiping everything on my phone? I have MM beta right now without recovery
edzilla said:
Will this give me recovery access without wiping everything on my phone? I have MM beta right now without recovery
Click to expand...
Click to collapse
Yes he will go
Please add Qc- 2.0 HACK in your Kernel )
pseudoheld said:
has anybody tried if this actually still works on MM?
Click to expand...
Click to collapse
Yes. I installed it . it works
Gustavo RD78 said:
Stock zImage
Add features:
twrp-sony-recovery-boot-script based (Thanks @nilezon /jackfagner github script)
TWRP recovery 3.0.0-0 Modified (vol up or down when Violet LED)
Removed SuperSU in TWRP recovery to root because this method will not work
Systemless root support
SElinux permissive
RIC disabled
Debugging enabled by default
Disable debugging notification icon in the status bar
Kernel insecure (ro.secure=0)
Fix swappiness (100 to 60) - as 3.4 kernel source - Improved memory management
* Required Bootloader Unlocked!
* Installation:
Download:
Advanced_Stock_Kernel_Z2_MM_Beta_23.5.A.0.486_twrp _3.0.0-0
-Flash via recovery or unpack and flash boot.img via fastboot
Code:
fastboot flash boot boot.img
* Root:
-Flash a Systemless SU: BETA-SuperSU-v2.68-20160228150503.zip
Note:
- The first boot may take some time, and give the impression that you are in a bootloop. Just wait and it will boot up normally eventually.
* Restore DRM:
-Flash Restore DRM - SONY DRM FUNCTION RESTORATION FOR UB DEVICE
* Please, do not mirror!
Also give a special thank you to @shoey63 in which helped make this possible
Enjoy and press the Thanks button if you like! :good:
.
Click to expand...
Click to collapse
Great. Thanks. Is this kernel with Kexec Hardboot Support for multirom Secondary too ?
Thanks (Pressed). Its work perfectly on Z2 MM. Great Man!!!
can anyone help?
everytime i download the systemless root SuperSU zip ,and i test it with winrar it says : ! C:\Users\xx\Desktop\mm\BETA-SuperSU-v2.68-20160228150503.zip: The file "common\file_contexts_image" header is corrupt
Thank you, you're a great man! Everything works well ....
WORKING FLAWLESSLY
You're epic...good job
v2 - busybox auto-injection (/system/xbin)
v2 - init.d support - automatically creates init.d in (/system/etc)
Note: when installing v2 flash again SuperSU
It works like charm.
Thanks @Gustavo RD78 for your great work ??
akshay2shah said:
Hey I m not able to flash this kernal.
I have unlocked bootloader.
I m on mm 6.0.1.
I don't have root.
Help me please.
Sent from my D6503 using XDA-Developers mobile app
Click to expand...
Click to collapse
unpack .zip and flash boot.img via fastboot
Code:
fastboot flash boot boot.img
Gustavo RD78 said:
unpack .zip and flash boot.img via fastboot
Code:
fastboot flash boot boot.img
Click to expand...
Click to collapse
Deleted.
akshay2shah said:
I did this already !!
I shows 'failed'
What to do now ?
Sent from my D6503 using XDA-Developers mobile app
Click to expand...
Click to collapse
both versions 1 and 2 you face this problem?
He tried to FlashTool?

[TWRP] 3.3.1 Aroma/Busybox compatible (ultra-low brightness)

Aroma compatible twrp (recovery.img) : https://androidfilehost.com/?fid=6006931924117889478
(tested on latest April Xperia Pie : 47.2.A.10.45)
BASIC guidance :
Be sure to read NewFlasher thread carefully first (Widevine L3 instead of L1 for locked bootloader).
0) recovery download
1) fastboot mode blueLight :$ fastboot flash recovery 270recovery9omni8-1FBEkeymaster3-twrp3_3_1.img
2) reboot STRAIGHT to twrp and always backup /boot only before Magisk-ified (needed with /system only in case of complete re-initialization or format, and for Treble roms)
3) flash magisk (min 17.3)
4) boot Pie (SafetyNet and Playstore certified should be ok with latest Magisk app after few mn)
Note: don't force remove bloatware: just disable them, so they won't reappear after future ota.
Once done, with your original /boot backup ( plus complete/full Magiskified backup), you can switch, without format /data, to my (xz1 enhanced) aosp Treble /system image: https://forum.xda-developers.com/pr...arm64aosp-9-0-0r21-microg-ufofficial-t3878115 , and restore back SonyXperia later with your full backup.
Future upgrade(ota):
-XperiFirm new firmware download + move away fotaKernel..sin & userdata..sin & simlock.ta + newflasher(with greenLight!)
-reboot STRAIGHT to recovery (and backup /boot only, before Magisk-ified)
-flash latest Magisk (min 17.3)
-boot Pie (SafetyNet and Playstore certified should be ok with latest Magisk app after few mn)
Optionally:
(-install Magisk Screen recorder or Snapdragon gallery, or aospEmail-SnapExchange free of analytics... )
-For better battery use KernelAdiutor with [conservative]highCpu & [ondemand]lowCpu (Adaway...)
Note: with or without su/hack, NightLight dim brightness is actually broken (wip)
Supplement:
This edition includes latest Aroma File Manager and TA partition backup: saves copies in sdcard/TWRP/ of TA, modemst1&2, boot.img plus some /vendor files like the identification build.prop ( default.prop fstab.qcom gps.conf uevent.rc). Every backup proceeds a copy of previous sdcard/TWRP/ TA.bin modemst1&2.bin and Id. build.prop in sdcard/TWRP/BACKUPS/.
Recovery simplified source : https://gitlab.com/oF2pks/twrppoplardevice/tree/aromaBusybox_Omni-8_1 (47.1.A.12.270)
with : TW_TARGET_USES_QCOM_BSP := false & Busybox v1.22.1
kernel : https://github.com/cryptomilk/android_kernel_sony_msm8998
prim-origin : https://github.com/cryptomilk/android_device_sony_yoshino/blob/lineage-15.1/twrp.mk
Thank you, working fine. How i change ui color? Flash the attached zips?
snake218 said:
Thank you, working fine. How i change ui color? Flash the attached zips?
Click to expand...
Click to collapse
No, just re-create (sdcard)/TWRP/theme/ui.zip exactly, and then launch Advanced§ReloadTheme from twrp recovery . Since I didn't include languages/*xml in them, you can only select Settings§Language without my uploaded themes (ui.zip) first. (Advanced§AromaFM & backupTA lines are also missing in regular uiBlueClassic.zip xml).
They are many twrp themes on xda, just be sure to use 3.3.0 ui.zip compatible edition.
Thanks for the new TWRP with Encryption. Device SOV36
Thank you for this fine version of twrp.
I am getting this error when making a full backup (ticked all partitions)
"error backing up system image, cleaning up folder"
I am running stock 47.2.A. 10.45 and j4nn kernel. Ric is off (i can write in system) and twrp are flashed.
i press "cancel" when asking for a password.
Normally the twrp just backup everything without any issues, so i must do something wrong??
Kind regards torben5247
Some themes for this ?
kojak1989 said:
Some themes for this ?
Click to expand...
Click to collapse
You can also use these themes for the 3.3.xx twrp
https://forums.oneplus.com/threads/custom-themes-for-twrp.849931/
Or if you search with Google, you can use all the 3.2.3 theme
theflanker said:
You can also use these themes for the 3.3.xx twrp
https://forums.oneplus.com/threads/custom-themes-for-twrp.849931/
Or if you search with Google, you can use all the 3.2.3 theme
Click to expand...
Click to collapse
but I do not know who will be good so that's why I'm asking
kojak1989 said:
but I do not know who will be good so that's why I'm asking
Click to expand...
Click to collapse
Why do you think it's a risk? If it doesn't work, it doesn't fit the theme and I use it!
@oF2pks
Hi, your newest version have original theme from TWRP or that from your previous version ?
Why can't I install any other ROM with this recovery?
Getting some invalid zip error.

Categories

Resources