[KERNEL][MOD] Sony Stock Patcher for Xperia X Performance

Search This thread

orkanamn

Member
Feb 21, 2014
14
7
Uppsala
Are these zips for the specific build numbers? I'm on .374 and get a bootloop when flashing v4.

Edit: okay, if I understand it correctly .361 are similar or the same so I'm gonna try v3.
Edit2: nah still bootloop. I think it might be the boot.img from AndroPlusKernel v19 that I have on my phone, if that makes any difference, guessing it does. Had a bit of a hassle rooting because I was following the guide for MM without realizing it and got the files mixed up trying to find a working boot.img. :p it's getting late and I will try again later.

Also, will I break the mod if I flash a custom kernel?

Final edit: it probably was the wrong boot.img (not stock) that I was using at first. Don't know why the stock-boot didn't work, too much dirty flashing perhaps. Had to re-flash the system anyway because I broke root and now everything seems fine.
 
Last edited:

serajr

Recognized Developer / Recognized Themer
Apr 21, 2011
5,060
18,678
São Paulo - SP
Thank you!!

@AdrianDC thanks for twrp 3.1.0 build, It does work flawlessly (as always) :good:

But I'd like to know (if possible ofc) why decryption fails if the recovery image is embedded into kernel's ramdisk (boot.img), see screenshot.
Do I need to change something in the kernel's ramdisk to make decryption work? Is that possible btw?

Thanks in advance mate!!
 

Attachments

  • Screenshot_1970-10-05-04-02-51.png
    Screenshot_1970-10-05-04-02-51.png
    61.1 KB · Views: 215
  • Like
Reactions: AdrianDC

AdrianDC

Recognized Developer
Dec 22, 2009
2,206
12,968
Île-de-France
adriandc.github.io
@AdrianDC thanks for twrp 3.1.0 build, It does work flawlessly (as always) :good:

But I'd like to know (if possible ofc) why decryption fails if the recovery image is embedded into kernel's ramdisk (boot.img), see screenshot.
Do I need to change something in the kernel's ramdisk to make decryption work? Is that possible btw?

Thanks !

PMing about the ramdisk.
 

25agosto

Senior Member
Oct 6, 2012
64
5
Varese
Work Well in X Performance with 39.2.A.0.417 + Unlocked bootloader.
Root Successfully with flashable SuperSU
 

pavlinux

Member
May 12, 2015
16
2
Moscow
F8131:/ # mount -o remount,rw /
mount: 'rootfs'->'/': No such device
F8131:/ # mount -o remount,rw /system
mount: '/dev/block/bootdevice/by-name/system'->'/system': Device or resource busy
 

pavlinux

Member
May 12, 2015
16
2
Moscow
fw.: F8131_RU_1302-6562_41.2.A.7.8_R2D_Customized
# uname -a
Linux localhost 3.18.31-perf-gbb73414 #1 SMP PREEMPT Thu Jun 8 23:12:08 CEST 2017 armv8l GNU/Linux
 

chukkyi

Member
Jul 1, 2010
19
1
How long does the boot normally take? Seem to be stuck on SONY screen. XP 8131, Unlocked bootloader, Stock 7.0, 39.2.A.0.442 build. Flashed patcher n_v8.7.8 zip, then SU-v.279-SR3, in TWRP 3.1.1.
Please help.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    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
    Sony Stock Patcher is a minimal and easy transition from Sony's Stock ROM
    (flashed directly from an FTF for example) to a modifiable ROM that can be modded as you like.

    Built out of my evolutions of libbootimg for MultiROM to support Sony ELF bootimages,
    a custom modified kernel based on Sony's copyleft with a minimal set of needed custom changes,
    and an automated installation process to patch completely a Stock ROM,
    this will allow you to use the Stock ROMs as you wish to.


    Relevant features of Sony Stock Patcher

    • Using my Sony ELF 64bits port to libbootimg, Stock boot partition is automatically converted
    • Modified copyleft Stock kernel to support alterations and remove limitations
    • Patches the ramdisk to disable automatically Sony RIC security
    • Patches the fstab automatically for verity
    • Injects my init_sony project used on Sony custom ROM projects
    • Supports making the ROM usable as secondary MultiROM

    List of changes made to the kernel

    • Disable Selinux trap security (allows to boot with stock ramdisk sepolicies)
    • Disable Device-Mapper verity (needed for example to patch system partitions)
    • Disable kernel modules forced validation (avoids failures on modules signature)
    • Disable coresight (unneeeded and irrelevant, just to avoid unsupported error logs)
    • Disable Sony RIC security (needed to use a recovery and alter /system, /data, ...)
    • Inline kernel modules compilation (to avoid kernel installation fragmentation)
    • Clearpad touchscreen updates for MultiROM UI
    • Minor kernel updates

    Installation

    • Needed: Device has to be with an Unlocked Bootloader
    • Use Stock ROM or flash a clean FTF ROM from Nougat or Marshmallow
    • Needs a working TWRP flashed into the FOTA partition (fastboot flash recovery...)
      > Fully working TWRP builds : https://mega.nz/#F!DtsERIzb!OFINTFpTQ6CF85alkcIpgA
    • Boot to TWRP (Power and Volume -)
    • Flash the relevant sony_stock_xperformance_patcher: n for 7.x or m for 6.0
    • (Optional) Flash SuperSU by Chainfire if you want to have root access
    • Reboot to Android

    Reasons to use this project ?

    • Unlocked Bootloader customizations allowed on Stock
    • Converts the bootimage to support systemless tools
    • Ability to root with tools like SuperSU
    • Retains the original Sony bootimage files
    • Minimal needed changes, no additional kernel mods

    Downloads (Unlocked Bootloader only)


    Source code
    Kernel sources - https://github.com/AdrianDC/kernel-sony-copyleft (branch 41.2.A.7.xxx)
    libbootimg sources - https://github.com/AdrianDC/multirom_libbootimg (branch master)
    init_sony sources - https://github.com/AdrianDC/device-sony-common-init (branch master)
    MultiROM sources - https://github.com/AdrianDC/multirom_core (branch master)
    TWRP sources - https://github.com/AdrianDC/twrp_development_sony/commits/device_sony_dora (branch device_sony_dora)


    Sony Stock Patcher for Xperia X Performance created also thanks to :
    - Sony for their original copyleft kernel sources
    - Tasssadar for the original libbootimg / MultiROM sources
    - The XperiaMultiROM team for our evolution of MultiROM
    - Everyone involved in testing it​


    XDA:DevDB Information
    Sony Stock Patcher for Xperia X Performance, Kernel for the Sony Xperia X Performance

    Contributors
    Adrian DC
    Source Code: https://github.com/AdrianDC/kernel-sony-copyleft

    Kernel Special Features:

    Version Information
    Status: No Longer Updated

    Created 2016-12-29
    Last Updated 2020-08-15
    6
    Reserved

    Changelog
    Code:
    Sony Stock Patcher for X Performance - 23/10/2019
    =================================================
    * Update release to resolve 3.18 ramoops (o_v7.2.157)
    > See commit 71d1aa14bdae1f38a56be10468556d43f108478a
    
    Sony Stock Patcher for X Performance - 08/09/2018
    =================================================
    * Upgrade to Oreo 8.0.0 41.3.A.2.149/157 (o_v6.2.157)
    
    Sony Stock Patcher for X Performance - 19/05/2018
    =================================================
    * Upgrade to Oreo 8.0.0 41.3.A.2.128 (o_v5.2.128)
    
    Sony Stock Patcher for X Performance - 24/03/2018
    =================================================
    * Upgrade to Oreo 8.0.0 41.3.A.2.99 (o_v4.2.99)
    
    Sony Stock Patcher for X Performance - 12/03/2018
    =================================================
    * Upgrade to Oreo 8.0.0 41.3.A.2.75 (o_v3.2.75)
    
    Sony Stock Patcher for X Performance - 25/12/2017
    =================================================
    * Upgrade to Oreo 8.0.0 41.3.A.2.24 (o_v2.2.24)
    
    Sony Stock Patcher for X Performance - 17/12/2017
    =================================================
    * Upgrade to Oreo 8.0.0 41.3.A.0.401 (o_v1.0.401)
    
    Sony Stock Patcher for X Performance - 26/11/2017
    =================================================
    * Upgrade to Nougat 7.1.1 41.2.A.7.76 (n_v12.7.76)
    
    Sony Stock Patcher for X Performance - 25/09/2017
    =================================================
    * Upgrade to Nougat 7.1.1 41.2.A.7.65 (n_v11.7.65)
    
    Sony Stock Patcher for X Performance - 19/08/2017
    =================================================
    * Upgrade to Nougat 7.1.1 41.2.A.7.53 (n_v10.7.53)
    
    Sony Stock Patcher for X Performance - 16/07/2017
    =================================================
    * Upgrade to Nougat 7.1.1 41.2.A.7.35 (n_v9.7.35)
    
    Sony Stock Patcher for X Performance - 08/06/2017
    =================================================
    * Upgrade to Nougat 7.1.1 41.2.A.7.8 (n_v8.7.8)
    
    Sony Stock Patcher for X Performance - 21/05/2017
    =================================================
    * Upgrade to Nougat 7.1.1 41.2.A.2.223 (n_v7.223)
    
    Sony Stock Patcher for X Performance - 26/04/2017
    =================================================
    * Upgrade to Nougat 7.1.1 41.2.A.2.199 (n_v6.199)
    
    Sony Stock Patcher for X Performance - 16/03/2017
    =================================================
    * Upgrade to Nougat 7.0 39.2.A.0.442 (n_v5.442)
    
    Sony Stock Patcher for X Performance - 04/02/2017
    =================================================
    * Upgrade to Nougat 7.0 39.2.A.0.417 (n_v4.417)
    
    Sony Stock Patcher for X Performance - 13/01/2017
    =================================================
    * Minor fix for enforcing SELinux (n_v3.361, m_v3.297)
    
    Sony Stock Patcher for X Performance - 08/01/2017
    =================================================
    * Remove permissive for Stock 7.0 (n_v2.361, 39.2.A.0.361)
    * Remove permissive for Stock 6.0, to fix WiFi (m_v2.297, 35.0.A.1.297)
    
    Sony Stock Patcher for X Performance - 29/12/2016
    =================================================
    * Initial release for Stock 7.0 (n_v1, 39.2.A.0.361)
    * Initial release for Stock 6.0 (m_v1, 35.0.A.1.297)
    5
    No, I didn't! It is somewhere at v2. Weird!!
    And now I did it this way:
    - Flashed modified stock kernel (tobias.waldvogel's tool: dm-verity, ric, drmfix, and busybox) - Reboot >> Enforcing
    - Flashed latest SuperSU - Reboot >> Enforcing
    - Flashed modified Sony Stock Patcher v2 (sony_stock_patcher.sh: removed dm-verity and ric related lines) - Reboot >> Permissive

    Minor update v3, removed a remaining kernel commit that allowed to override the enforcing/permissive status,
    in some situations it can cause the permissive status even if not wished, you might be fine now.
    Works fine on mine (Enforcing, running 7.0 from my MicroSD & no issue so far).

    v2 removed as it almost identical to v3 with this minor removal.
    4
    @Adrian DC Congrats buddy!!
    This is absolutely amazing. Confirmed that it is working on my XP with stock MM firmware (35.0.A.1.297).

    Thanks, glad it works fine for you too


    But I have a question regarding whole process, is Permissive mandatory (# Inject the permissive cmdline)?
    Edit.: It looks like it is, but Permissive does break device's wifi connectivity (and maybe other things)!! Is there a way to set Permissive only if we choose to boot up into recovery?

    Nice catch, I had forgotten I had an issue 2 months ago on M with WiFi not working entirely,
    and it's not an issue that can be found on Nougat so left it aside for the time.

    It is indeed related to permissive, and with the recent changes I made for the Nougat support,
    permissive is actually totally useless, therefore I made a new release for both M / N with updated kernel & no permissive changes.

    Tested both situations with Stock M and Stock N, all works fine.
    4
    New release for the new Sony 41.2.A.7.53 firmware, Android 7.1.1.