[Xperia Z5 Android Development] serajr:
DRM Fix Workaround and Sony RIC disabler for Nougat - System Mode!

Tool still can not fully handle Nougat's kernel, even after my changes. That's why I didn't share it yet!

With that kernel we're able to disable dm-verity

ONLY

, which leads us to create a fully working DRM fix workaround (system mode):

1. Download attached flashable zip (DRM fix libs are inside it)

2. Run rootkernel tool with Nougat's stock kernel.elf, and choose Y for dm-verity ONLY! <<

MANDATORY to avoid bootloop

- dm-verity is enabled. Disable? (Say yes if you modify /system) [Y/n] [B][COLOR="Blue"]Y[/COLOR][/B]

3. When tool asks you for - Install busybox?, do nothing yet, and...

4. Enter \ramdisk folder and edit init.target.rc@0750 file (with notepad++)

5. Add the blue lines exactly as shown below (between "on early-init" and "on fs" sections):

[B]on early-init[/B]
mkdir /firmware 0771 system system
mkdir /bt_firmware 0771 system system
symlink /data/tombstones /tombstones
mkdir /dsp 0771 media media

[B][COLOR="Blue"]on post-fs
export LD_PRELOAD libdrmfix.so[/COLOR][/B]

[B]on fs[/B]
wait /dev/block/bootdevice

5.1 - If "on post-fs" section already exists, add :libdrmfix.so at the final of the line underneath it:

[B]on post-fs[/B]
export LD_PRELOAD libNimsWrap.so[B][COLOR="Red"]:libdrmfix.so[/COLOR][/B]

6. Save the file and exit \ramdisk folder

7. Back to the rootkernel's screen and choose N for busybox (boot.img will be created)

8. Open downloaded file with 7Zip and drag'n'drop your newly created boot.img file into its content screen (root)

8.1. rootkernel_Nougat_boot_and_drmfix_flashable.zip contents will be:

META_INF
system
[B]boot.img[/B]

9. Close 7Zip

10. Enter TWRP recovery (fota kernel recovery) and flash the zip

11. Done!

Sony RIC, TWRP recovery (internal), DRM fix (internal) and busybox WILL NOT WORK AND THEY MUST BE SKIPPED by choosing N.

TRY IT OUT AT YOUR OWN RISK

Disabling Sony RIC (

do this before performing step 7 above

):

1. Enter \ramdisk folder and edit init.sony-platform.rc@0750 file (with notepad++)

2. Insert the blue line and add the red # mark,

exactly as shown below

(look for "on boot" section):

[B]on boot[/B]
# Setting to use rndis_qc driver
exec u:r:usb_device_mode:s0 -- /system/bin/sh /init.usbmode.platform.sh "set_rndis_qc"

# SONY: for Bluesleep
chown bluetooth net_bt /proc/bluetooth/sleep/lpm
chown bluetooth net_bt /proc/bluetooth/sleep/btwrite
chmod 0660 /proc/bluetooth/sleep/lpm
chmod 0660 /proc/bluetooth/sleep/btwrite

# SONY: Enable Sony RIC
mount securityfs securityfs /sys/kernel/security nosuid nodev noexec
[B][COLOR="Blue"]write /sys/kernel/security/sony_ric/enable 0[/COLOR][/B]
[B][COLOR="Red"]#[/COLOR][/B] chmod 0640 /sys/kernel/security/sony_ric/enable

# SONY: Enable wakeup irq module
write /sys/devices/platform/wakeup_debug.0/enable 1

3. Save the file and exit \ramdisk folder

4. Done > Proceed now to step 7 above

For development purposes only! You don't need to do that!! - If you wanna dare and play with file_contexts.bin as a plain text file,

do this before performing step 7 above

:

1. Download attached bin2txt.zip and unpack it

2. Copy original file_contexts.bin@0644 binary from rootkernel's /ramdisk folder to the bin2txt's /ramdisk folder

3. Run bin2txt (windows) or ./bin2txt.sh (linux)

4. Move converted file_contexts.bin@0644 (now as a plain text file) from bin2txt's /ramdisk folder back to the rootkernel's /ramdisk folder (replacing original file)

6. Done > Proceed now to step 7 above

In the tests I did with my XP everything was ok! Device did boot up as it should!!

If device get stuck at sony logo, something went wrong. Create a new boot.img without this!!