[GUIDE][Oreo 8.0] Stock Kernel + ROOT + TWRP + DRM Fix | 41.3.A.2.157

Search This thread

Mizaki_Len

Member
Jul 10, 2015
5
1
Sony Xperia Z4
i have a xz dual sim after flashing boot img it turn to 32gb instead of 64gb, ive tried in adb fastboot format userdata and it shows The system cannot find the file specified. (2) error: Cannot generate image for userdata, ive tried to reflash the firmware and do a full wipe it still shows the same error, ive also tried the twrp data wipe but its still the same, any ideas?

sorry: solved it, it went back to 64gb but i still cant use the adb command fastboot format userdata, still gives error cannot generate image userdata but i am fine, if any way to fix that error i would be interested.
 
Last edited:

[email protected]

Senior Member
Mar 6, 2013
77
8
Redmi Note 10
Hi

is this drmfix will work on xz2...now i'm on 9.0 but i plan to downgrade to 8.0 because on pie some functions not work after unlock bootloader.

anyone has any idea please tell me.
 

nkbh505

New member
Mar 25, 2019
1
1
Stock Kernel + ROOT + TWRP + DRM Fix​



Code:
** 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 MOD
** 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.
**
Update July 31, 2018
This thread is marked as discontinued. This means that It won't be updated so don't bother asking and I will not publish any more posts here or contribute to the general discussion. However, I might add files from time to time if necessary.


Requirements
If you haven't unlocked bootloader yet check this guide
Good News ! If you have TA.img backup of your device I highly suggest using this tool to patch stock kernel using your own TA image to have drm working with latest Magisk 16.3. Follow TA_POC METHOD instructions below .

- Kernel (boot.img) + Magisk + DRM fix patch
https://drive.google.com/open?id=1wv-Djz38wT_gywlJZPFPG13dATP90-E8
- Latest TWRP from here


And obviously :
- ADB and FASTBOOT : https://forum.xda-developers.com/showthread.php?t=2317790
- Xperia XZ drivers : https://developer.sonymobile.com/downloads/drivers/xperia-xz/
- FlashTool : http://www.flashtool.net/downloads.php


What are DRM Keys ?


Kernel features
this is pure stock kernel of the mentioned above firmware with
- RIC disabled
- added DRM patch support


Instructions
Before proceed backup all you important data like pictures, files to another device.. !
Make sure you follow all steps carefully with caution .. !



NEW! TA_POC METHOD
(Magisk 15.3+ ONLY / For those who have TA.img backup)
After downloading and extracting this tool and these files just copy them to the tool folder and put yout TA.img (case sensetive) there as well
LZRovMxjTC6rveIN3zby3A.png
9pT8Hgz_S4qAuxMNG1I0SA.png

Open command prompt in rootkernel tool folder
or
Open cmd --> cd "rootkernel tool dir" for ex for my case I extracted to the c: drive to make simple for you
Code:
cd C:\rootkernel_v5.23_Windows_Linux_UNOFFICIAL_2.5_OREO
Then run this code
Code:
rootkernel kernel.elf boot.img
https%3A%2F%2Fforum.xda-developers.com%2Fimg.xda-cdn.com%2F_1sdAp2jGZKm-pusATBscdxZzgQ%3D%2Fhttps%253A%252F%252Fforum.xda-developers.com%252Fimg.xda-cdn.com%252Fwjtns2P3Yg8cqMS-CK9tv_uRR6k%253D%252Fhttps%25253A%25252F%25252Fimage.prntscr.com%25252Fimage%25252Fc1GU6WuvQta71ESUhSfgAA.png
https%3A%2F%2Fforum.xda-developers.com%2Fimg.xda-cdn.com%2FUiQ4v3C6UJYWqdtghhk9GUkIp0U%3D%2Fhttps%253A%252F%252Fforum.xda-developers.com%252Fimg.xda-cdn.com%252Fb_7s8sEst9C8DP4WQ7bFvbZykZY%253D%252Fhttps%25253A%25252F%25252Fimage.prntscr.com%25252Fimage%25252FXY6NIynLQvOXbfOE3ED-dg.png
https%3A%2F%2Fforum.xda-developers.com%2Fimg.xda-cdn.com%2Fv6kOIMfDif-c-qUa9vpWGm6R4R4%3D%2Fhttps%253A%252F%252Fforum.xda-developers.com%252Fimg.xda-cdn.com%252FlkJdDcO6hpTuFxFRd030jC7vJ38%253D%252Fhttps%25253A%25252F%25252Fimage.prntscr.com%25252Fimage%25252FmRd_VgTgT1COLtOovHcAKA.png


TWRP asking for decryption code / Internal Storage showing 32GB only for XZ DUAL
Turn off the phone (from TWRP if you can or hold vol up and power button till the phone vibrates 3 times)
Enter Fastboot and format user data partitions using this code
Code:
fastboot format userdata
If you are getting error try from TWRP recovery > WIPE > Swipe to format data
Now start your phone and set it up the issue should be resolved.
If still storage is not showing correctly
- Do steps 1-2-3 exactly as listed above
- Boot your phone and compelete the setup wizard, go to settigns and check if storage is not 64gb
- If yes turn off the device and enter TWRP and choose WIPE > Swipe to format data
- Boot your phone again and compelete the setup wizard, go to settings and check if storage it should be 64gb by now
- Now go back to TWRP and complete steps 4-5-6

To check drm keys type *#*#7378423#*#* on your phone and go to Service Test > Security
If you have all [Key OK] they are OK! like the pictures I attached below


Extras (Recommended)


Credits @serjar for unofficial rootkernel update
Old DRM restore by @tobias.waldvogel
Magisk by @topjohnwu
SafetyNet Cleaner by @sceryavuz
TWRP by TeamWin

:good::good::good:
 
  • Like
Reactions: rafik23

rafik23

Senior Member
May 3, 2011
214
57
annaba
HI
I loose my drm key when I unlock the bootloader
i have partially backed up
MY Question is : after installing the kernel and drmfix and magisk and relock the bootloader , can it restore drm ?
 

DeeZZ_NuuZZ

Senior Member
May 16, 2012
11,498
4,550
26
Hanover
HI
I loose my drm key when I unlock the bootloader
i have partially backed up
MY Question is : after installing the kernel and drmfix and magisk and relock the bootloader , can it restore drm ?
If you relock bootloader without being on full stock (without magisk and everything else) you might end up bricked. I would never relock with custom stuff installed

Sent from my Google Pixel 3 XL using XDA Labs
 

Yurashina

Member
Apr 17, 2015
14
2
Does the kernel.elf + the filesystem can be used for the .192? if no, how i can get the files?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 54
    Stock Kernel + ROOT + TWRP + DRM Fix​



    Code:
    ** 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 MOD
    ** 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.
    **
    Update July 31, 2018
    This thread is marked as discontinued. This means that It won't be updated so don't bother asking and I will not publish any more posts here or contribute to the general discussion. However, I might add files from time to time if necessary.


    Requirements
    If you haven't unlocked bootloader yet check this guide
    Good News ! If you have TA.img backup of your device I highly suggest using this tool to patch stock kernel using your own TA image to have drm working with latest Magisk 16.3. Follow TA_POC METHOD instructions below .

    - Kernel (boot.img) + Magisk + DRM fix patch
    https://drive.google.com/open?id=1wv-Djz38wT_gywlJZPFPG13dATP90-E8
    - Latest TWRP from here


    And obviously :
    - ADB and FASTBOOT : https://forum.xda-developers.com/showthread.php?t=2317790
    - Xperia XZ drivers : https://developer.sonymobile.com/downloads/drivers/xperia-xz/
    - FlashTool : http://www.flashtool.net/downloads.php


    What are DRM Keys ?
    If you unlocked the bootloader on a Sony Xperia device, you probably know that the potential loss of warranty is not the only disadvantage you have to accept. Another fairly hidden issue is related to various proprietary features such as the X-Reality color mangement, BIONZ image processor and the active noise cancelling techniques. Once you decide to unlock your bootloader, the process also removes a piece of data referred to as the DRM keys. These are tied to various services (such as streaming video and the like) offered by Sony but are also required for the features mentioned above to work properly. Put simply, once the keys are gone, you’ll face issues such as decreased low light camera image quality and the lack of the X-Reality mode.

    Kernel features
    this is pure stock kernel of the mentioned above firmware with
    - RIC disabled
    - added DRM patch support


    Instructions
    Before proceed backup all you important data like pictures, files to another device.. !
    Make sure you follow all steps carefully with caution .. !

    01- Flash Oreo FTF via Flashtool (Full wipe is recommened exclude nothing except TA files if there's any)
    02- When done flashing unplug device ..
    03- Enter fastboot mode and flash TWRP (hold vol up + plug usb)
    Code:
    fastboot flash recovery twrp-3.2.1-0-kagura.img
    then flash kernel
    Code:
    fastboot flash boot boot.img
    04- Unplug and enter TWRP (Hold vol down + power button)
    05- In TWRP Flash drmfix.zip + SafetyNet Cleaning Tools.zip then Magisk v16.3.zip
    06- OPTIONAL Flash ROM Patch to clean system and remove all bloat apps
    07- Reboot and enjoy


    NEW! TA_POC METHOD
    (Magisk 15.3+ ONLY / For those who have TA.img backup)
    After downloading and extracting this tool and these files just copy them to the tool folder and put yout TA.img (case sensetive) there as well
    LZRovMxjTC6rveIN3zby3A.png
    9pT8Hgz_S4qAuxMNG1I0SA.png

    Open command prompt in rootkernel tool folder
    or
    Open cmd --> cd "rootkernel tool dir" for ex for my case I extracted to the c: drive to make simple for you
    Code:
    cd C:\rootkernel_v5.23_Windows_Linux_UNOFFICIAL_2.5_OREO
    Then run this code
    Code:
    rootkernel kernel.elf boot.img
    Say yes (Y) to everything except DRM fix - If you want munjeni's TA PoC option,ensure your TA.img (case sensitive) is located at rootkernel's root folder and say no (N) to DRM fix
    Flash patched kernel:
    1- Flash Oreo ftf (wiping everything, excluding nothing - except *.ta files - if any)
    2- Unplug device and DO NOT turn it on
    3- Fastboot newly created boot.img and TWRP recovery
    4- Unplug device and DO NOT turn it on again
    5- Enter TWRP recovery and flash Magisk 16.3 (16.4 is buggy)
    6- OPTIONAL Flash ROM Patch to clean system and remove all bloat apps
    7- You're done!
    https%3A%2F%2Fforum.xda-developers.com%2Fimg.xda-cdn.com%2F_1sdAp2jGZKm-pusATBscdxZzgQ%3D%2Fhttps%253A%252F%252Fforum.xda-developers.com%252Fimg.xda-cdn.com%252Fwjtns2P3Yg8cqMS-CK9tv_uRR6k%253D%252Fhttps%25253A%25252F%25252Fimage.prntscr.com%25252Fimage%25252Fc1GU6WuvQta71ESUhSfgAA.png
    https%3A%2F%2Fforum.xda-developers.com%2Fimg.xda-cdn.com%2FUiQ4v3C6UJYWqdtghhk9GUkIp0U%3D%2Fhttps%253A%252F%252Fforum.xda-developers.com%252Fimg.xda-cdn.com%252Fb_7s8sEst9C8DP4WQ7bFvbZykZY%253D%252Fhttps%25253A%25252F%25252Fimage.prntscr.com%25252Fimage%25252FXY6NIynLQvOXbfOE3ED-dg.png
    https%3A%2F%2Fforum.xda-developers.com%2Fimg.xda-cdn.com%2Fv6kOIMfDif-c-qUa9vpWGm6R4R4%3D%2Fhttps%253A%252F%252Fforum.xda-developers.com%252Fimg.xda-cdn.com%252FlkJdDcO6hpTuFxFRd030jC7vJ38%253D%252Fhttps%25253A%25252F%25252Fimage.prntscr.com%25252Fimage%25252FmRd_VgTgT1COLtOovHcAKA.png


    TWRP asking for decryption code / Internal Storage showing 32GB only for XZ DUAL
    Turn off the phone (from TWRP if you can or hold vol up and power button till the phone vibrates 3 times)
    Enter Fastboot and format user data partitions using this code
    Code:
    fastboot format userdata
    If you are getting error try from TWRP recovery > WIPE > Swipe to format data
    Now start your phone and set it up the issue should be resolved.
    If still storage is not showing correctly
    - Do steps 1-2-3 exactly as listed above
    - Boot your phone and compelete the setup wizard, go to settigns and check if storage is not 64gb
    - If yes turn off the device and enter TWRP and choose WIPE > Swipe to format data
    - Boot your phone again and compelete the setup wizard, go to settings and check if storage it should be 64gb by now
    - Now go back to TWRP and complete steps 4-5-6

    To check drm keys type *#*#7378423#*#* on your phone and go to Service Test > Security
    If you have all [Key OK] they are OK! like the pictures I attached below


    Extras (Recommended)


    Credits @serjar for unofficial rootkernel update
    Old DRM restore by @tobias.waldvogel
    Magisk by @topjohnwu
    SafetyNet Cleaner by @sceryavuz
    TWRP by TeamWin
    3
    I tried using TA_Poc 3 times with magisk 15.3 and still error in drm function :crying: All keys shown error and sim card not working, my fw is 2.58
    Also in flashtool i tick wipe all in the left upper box , is this right ? And wipe dalvik cache, cache and data before or after install magisk ?

    Sorry for my english :crying:
    Not sure why the OP told you to wipe, all the wipes are not really needed.
    It will either work or not work, if it does not work simply re-fastboot the 'boot' again. (You can also fastboot the original kernal into 'boot' to revert what you did.)
    Also either use TA_Poc or install DRM_fix zip, not both.

    You just need to install the Magisk zip after you fast boot the boot.img into 'boot' and TWRP recovery into 'recovery'.
    Magisk is now 16.0, might want to go directly to that.

    If you are sure TA_Poc really does not work for you, then say "No" to TA_Poc and install the DRM_fix zip file and then install Magisk.

    Here are the filesystem_files and kernel.elf for 41.3.A.2.107 if you need that
    3
    Guide update 27/06/18
    Code:
    - Added latest files from fw 41.3.A.2.149
    - Added mirror
    Enjoy.
    2
    hi Thank You @MKRashka,
    sorry for late reply got banged with the job things :eek:

    here is my phone details :
    actually im bought this from someone online in my country, he said that he never root it, and i never play root and any customize things in android, so im sorry i dont know that the bootloader has been unlocked or not




    all i do just update it via sony experia companion and the problems still exist, btw sorry, ive found an article how to experifirm,

    xperiablog.net about create-your-own-ftf-firmware-files-using-xperifirm-and-flashtool-guide
    sorry i cant post link, but in 2014


    is it good to follow it?
    ill do it tonight
    again thank you for your help

    Your bootloader is closed. With an unlocked bootloader, you're not able to update with xperia companion.

    Dial
    *#*#7378423#*#*


    Go to "service test/ security"

    If the result shows :
    FIDO_KEYS: provisioned
    WIDEVINE: OK [active]
    CKB: OK [active]

    Your TA is worth to back it up.
    You have to downgrade to marshmallow to do that. You'll find a good tutorial if you search for "TA backup"

    If you can't find a marshmallow ftf, I can provide the latest german one.

    Regards
    Rashka
    2
    Thank You, You giving me enlightenment, now i know why my phone sucks,
    all system error
    here is the info


    Okay ill try to find whats going on with this error,
    :good:

    Your phone was unlocked before and the previous owner does not restored TA. Nothing to rescue me backup here.

    So your camera for example should be very grainy.

    Just unlock your bootloader, flash whatever you like and use a kernel with drmfix.
    I'd recommend Existenz v 2 oreo or original stock with custom kernel.