[Sony Xperia XA Guides, News, & Discussion] pa7taloha:
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, .

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

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)

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

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.

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)

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.