[F3111][Guide][N][33.3.A.1.115] Root with Working patched DRM fix (without ta backup)

Search This thread

toorroot7

New member
Jan 23, 2018
2
1
Followed your steps using your boot.img and recovery.img only works with version magisk 14.0 not with superSU or any other version of magisk

How to make work with superSU as my most apps depended on supersSU root please help !

XPERIA XA F3111 33.3.A.0.131 UK (single sim)
 
Last edited:
  • Like
Reactions: kolo013

cojocar.andrei

Senior Member
May 29, 2008
469
123
Sony Xperia XA2
Sorry for late reply.
I will try to be clear as much as I can(bad english speaker).
We have tested this workaround to: xperia xa f3111(Mediatek, Nougat) and xperia x perfomance(qualcom, Nougat and 0reo) and it work fine in Nougat and Oreo too. I hope this will work too to the other xperia devices, so we can relate it.
I did not compile kernel from source, I have just extracted it with flashtool kernel.elf and unpacked/repacked it with AIK Linux/Carliv-image-kitchen. I am a Linux user.
For mediatek processor,
In the kernel, unpack it and edit.
1. disable dm-verity
2. edit init.rc
add this red line in on early-init, .
Code:
on early-init
    [COLOR="Red"]restorecon /vendor/lib64/libdrmfix.so
    restorecon /vendor/lib/libdrmfix.so[/COLOR]
    # Set init and its forked children's oom_adj.
    write /proc/1/oom_score_adj -1000
	
    # Disable sysrq from keyboard
    write /proc/sys/kernel/sysrq 0
3. edit init.aee.rc
add this red line in on init
Code:
on init
    export LD_PRELOAD libdirect-coredump.so
    write /proc/self/coredump_filter 39
    setprop ro.aee.enperf off
    [COLOR="Red"]export LD_PRELOAD libdrmfix.so[/COLOR]
4. edit default.prop
change the value of "ro.secure=0" to "ro.secure=1"
7. Open "fstab.mt6755" and copy in new text file the path to your system, it should be in the first line, we will use this later in the drmfix.zip
6. repack your kernel

II. We will do some mod to the drmfix.zip
open with the "open archive manager" the drmfix.zip and edit the updater-script in drmfix/META-INF/com/google/android/
This red line in the updater-script should be the same path to your system found in "fstab.mt6755" file in the boot.img (you've copied in step 5 in kernel)
Code:
ui_print(" ==================================");
mount("ext4", "EMMC", "[COLOR="red"]/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system[/COLOR]", "/system");
ui_print("updating..");
package_extract_dir("system", "/system");
unmount("/system");
ui_print("Done!!!");
save it and update the drmfix.zip

For Qualcom processor
In the kernel, unpack it and edit.
1. disable dm-verity
2. edit init.rc
add this red line in on early-init
Code:
on early-init
    [COLOR="red"]restorecon /vendor/lib64/libdrmfix.so
    restorecon /vendor/lib/libdrmfix.so[/COLOR]
    # Set init and its forked children's oom_adj.
    write /proc/1/oom_score_adj -1000

    # Disable sysrq from keyboard
    write /proc/sys/kernel/sysrq 0
3. edit init.environ.rc
add this red line to the last line.
Code:
    export SYSTEMSERVERCLASSPATH /system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar
    
    [COLOR="red"]export LD_PRELOAD libdrmfix.so[/COLOR]
4. edit default.prop
change the value of "ro.secure=0" to "ro.secure=1"
5. Open "fstab.qcom" and copy in new text file the path to your system, we will use this later in the drmfix.zip
6. repack your kernel, flash it

II. We will do some mod to the drmfix.zip
open with the "open archive manager" the drmfix.zip and edit the updater-script in drmfix/META-INF/com/google/android/
This red line in the updater-script should be the same path to your system found in "fstab.qcom" file in the boot.img (you've copied in step 5 in kernel)
Code:
ui_print(" ==================================");
mount("ext4", "EMMC", "[COLOR="red"]/dev/block/bootdevice/by-name/system[/COLOR]", "/system");
ui_print("updating..");
package_extract_dir("system", "/system");
unmount("/system");
ui_print("Done!!!");
save it and update the drmfix.zip, and flash it.

Avalaible for clarification.

Thanks, can you tell me how to disable dm-verity (is it just the editing the fstab and deleting the parameter for the system that says verify?)

Thanks again!
 

CrashBX

Senior Member
Oct 27, 2010
175
30
Did I miss anything? I did everything what was listed in OP's first post and it just says "unknown error" on the security test.
Using flashtool, I flashed the latest ROM, then using fastboot I flashed boot and recovery. Inside TWRP I flashed the drmfix and (without flashing any kind of SU) I booted into the clean system. Still doesn't work. Does anyone have any advice what to do?
 

BlueTR

Senior Member
May 14, 2013
287
54
Bursa
About the new versions of magisk and drm fix;

Open init.environ.rc and add blue line to it and save.

Code:
# set up the global environment
on init
    [COLOR="Blue"]export LD_PRELOAD libdrmfix.so[/COLOR]
    export ANDROID_BOOTLOGO 1
    export ANDROID_ROOT /system
    export ANDROID_ASSETS /system/app
    export ANDROID_DATA /data
    ...

Now drm fix should work with updated magisk.
 

capusopp

New member
May 15, 2019
2
0
Hi i just fixed my drm using this methode and magisk 14. Now i have working system updates. Should i update to 33.3.a.1.126?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    Hi @pa7taloha,
    Can you share your kernel drm fix changes (github or some other cloud server)? I'm trying to implement some custom changes in the kernel and I could add this as well. Thanks.
    Sorry for late reply.
    I will try to be clear as much as I can(bad english speaker).
    We have tested this workaround to: xperia xa f3111(Mediatek, Nougat) and xperia x perfomance(qualcom, Nougat and 0reo) and it work fine in Nougat and Oreo too. I hope this will work too to the other xperia devices, so we can relate it.
    I did not compile kernel from source, I have just extracted it with flashtool kernel.elf and unpacked/repacked it with AIK Linux/Carliv-image-kitchen. I am a Linux user.
    For mediatek processor,
    In the kernel, unpack it and edit.
    1. disable dm-verity
    2. edit init.rc
    add this red line in on early-init, .
    Code:
    on early-init
        [COLOR="Red"]restorecon /vendor/lib64/libdrmfix.so
        restorecon /vendor/lib/libdrmfix.so[/COLOR]
        # Set init and its forked children's oom_adj.
        write /proc/1/oom_score_adj -1000
    	
        # Disable sysrq from keyboard
        write /proc/sys/kernel/sysrq 0
    3. edit init.aee.rc
    add this red line in on init
    Code:
    on init
        export LD_PRELOAD libdirect-coredump.so
        write /proc/self/coredump_filter 39
        setprop ro.aee.enperf off
        [COLOR="Red"]export LD_PRELOAD libdrmfix.so[/COLOR]
    4. edit default.prop
    change the value of "ro.secure=0" to "ro.secure=1"
    7. Open "fstab.mt6755" and copy in new text file the path to your system, it should be in the first line, we will use this later in the drmfix.zip
    6. repack your kernel

    II. We will do some mod to the drmfix.zip
    open with the "open archive manager" the drmfix.zip and edit the updater-script in drmfix/META-INF/com/google/android/
    This red line in the updater-script should be the same path to your system found in "fstab.mt6755" file in the boot.img (you've copied in step 5 in kernel)
    Code:
    ui_print(" ==================================");
    mount("ext4", "EMMC", "[COLOR="red"]/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system[/COLOR]", "/system");
    ui_print("updating..");
    package_extract_dir("system", "/system");
    unmount("/system");
    ui_print("Done!!!");
    save it and update the drmfix.zip

    For Qualcom processor
    In the kernel, unpack it and edit.
    1. disable dm-verity
    2. edit init.rc
    add this red line in on early-init
    Code:
    on early-init
        [COLOR="red"]restorecon /vendor/lib64/libdrmfix.so
        restorecon /vendor/lib/libdrmfix.so[/COLOR]
        # Set init and its forked children's oom_adj.
        write /proc/1/oom_score_adj -1000
    
        # Disable sysrq from keyboard
        write /proc/sys/kernel/sysrq 0
    3. edit init.environ.rc
    add this red line to the last line.
    Code:
        export SYSTEMSERVERCLASSPATH /system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar
        
        [COLOR="red"]export LD_PRELOAD libdrmfix.so[/COLOR]
    4. edit default.prop
    change the value of "ro.secure=0" to "ro.secure=1"
    5. Open "fstab.qcom" and copy in new text file the path to your system, we will use this later in the drmfix.zip
    6. repack your kernel, flash it

    II. We will do some mod to the drmfix.zip
    open with the "open archive manager" the drmfix.zip and edit the updater-script in drmfix/META-INF/com/google/android/
    This red line in the updater-script should be the same path to your system found in "fstab.qcom" file in the boot.img (you've copied in step 5 in kernel)
    Code:
    ui_print(" ==================================");
    mount("ext4", "EMMC", "[COLOR="red"]/dev/block/bootdevice/by-name/system[/COLOR]", "/system");
    ui_print("updating..");
    package_extract_dir("system", "/system");
    unmount("/system");
    ui_print("Done!!!");
    save it and update the drmfix.zip, and flash it.

    Avalaible for clarification.
    2
    Hi all!
    Happy to share a workaround for root and successful DRM fix.
    If you lose your drm key, that's okay, this fix will restore all function which depends on it (picture quality, super vivid mode, etc.....). There's nothing satisfying than using your phone at its full potential with your own custom:p. Spot the difference;)!!!!

    1. Unlock bootloader
    2. Flash boot.img (Patched to be compatible with the drmfix)
    >>> fastboot flash boot boot.img
    3. Flash recovery.img
    >>> fastboot flash recovery recovery.img
    4. Boot to recovery by holding vol - and power; then swipe to allow modification and Format data (mandatory)
    5. Flash drmfix.zip
    6. Flash Magisk 14.0
    7. Boot to android, you're done!!!

    Type *#*#7378423#*#* then >>Service info>>Configuration or >>Service tests>>Security to check if all your keys are active.
    Screenshot_20171210-003415-picsay.pngScreenshot_20171210-003431-picsay.pngScreenshot_20171210-010036.png

    Download link:
    # For boot.img here!!!
    # For recovery.img here!!!
    # For drmfix This does the trick
    2
    All Magisk zip's from v15.0 and up break the drm fix. I tried up to v14.5 (v14.6 doesn't work either) which is the last version that works with the drm fix.
    2
    Hi @pa7taloha,
    Can you share your kernel drm fix changes (github or some other cloud server)? I'm trying to implement some custom changes in the kernel and I could add this as well. Thanks.
    2
    CAN ANYONE CONFIRM IF THIS METHOD IS WORKING 100% with all updated magisk/other apps BEFORE I MISS/DELETE ANY OF MY FILES?
    thanks
    100% Working i only tried with the files of creator.
    Magisk 14.0

    Xperia XA [Single Sim] 33.3.A.1.115 firmware