yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I am also using the H8296 HongKong device, because of the 6GB ram, but I installed the H8266 German firmware on it. :)

[MENTION=9286795]spirit-eh[/MENTION] got the same error, but I don't know his device.

PS:

I am still downloading the minimal platform_manifest_twrp_omni on 8.0 branch, before I can compile it again.

Many stuff to download and I got only 5Mbit internet on my vacation. :silly:

Edit:

A notable difference between the XZ2 image and the XA2 image is the kernel size

XZ2 kernel 15.3 MB

XA2 kernel 46 MB

Maybe he compiled the AOSP one from github.

Edit2:

I assume hardly, that I need to wait for the XZ2 to be added to the Sony open source programm.

So I can use the AOSP 8.1 kernel, instead of this hacked thing delivered in the Sony open source downloads in their site.

The XA2 twrp maintainer did the same.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Pandemic:
An older version of twrp does not work on xz2 (H8216) ? [MENTION=6031898]MartinX3[/MENTION]
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
TWRP 3.1 introduced support for A/B-Devices.

TWRP 3.2.0 introduced the Android 8.x compatibility and 3.2.1 and 3.2.2 included important fixes.

I wouldn't try an older version.

I also need to compile TWRP from source with my collected config files to work with the XZ2.

(TWRP need to compiled for every device on its own).

Now I try to compile it with OMNI 8.0 instead of 8.1, because it is a hacky 8.0 kernel, which I need to use.

(Sony's Android 8.1 AOSP 4.9 kernel is not finished.)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
01.08.2018
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Pandemic:
Also for H8216 bro ?

Btw see pm :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I'm looking forward, that we will get your cam back in September. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] yanke928:
I'm struggling with my dtbo.img build. Somehow it fails, and I don't know why, most probably with tools.

Here it says:

DTB combiner:

Input directory: 'out/arch/arm64/boot/'

Output file: 'dtbo.img'

Searching subdir: out/arch/arm64/boot/dts/ ...

Searching subdir: out/arch/arm64/boot/dts/xilinx/ ...

Searching subdir: out/arch/arm64/boot/dts/amd/ ...

Searching subdir: out/arch/arm64/boot/dts/socionext/ ...

Searching subdir: out/arch/arm64/boot/dts/nvidia/ ...

Searching subdir: out/arch/arm64/boot/dts/arm/ ...

Searching subdir: out/arch/arm64/boot/dts/hisilicon/ ...

Searching subdir: out/arch/arm64/boot/dts/exynos/ ...

Searching subdir: out/arch/arm64/boot/dts/apm/ ...

Searching subdir: out/arch/arm64/boot/dts/qcom/ ...

Found file: msm8996-mtp.dtb ...

Version:1

... skip, incorrect 'qcom,msm-id = <' format

skip, failed to scan for 'qcom,msm-id = <' tag

Found file: sdm845-v2.dtb ...

Version:1

... skip, incorrect 'qcom,msm-id = <' format

skip, failed to scan for 'qcom,msm-id = <' tag

Found file: apq8096-db820c.dtb ...

Version:1

... skip, incorrect 'qcom,msm-id = <' format

skip, failed to scan for 'qcom,msm-id = <' tag

Found file: sdm845-v2.1.dtb ...

Version:1

... skip, incorrect 'qcom,msm-id = <' format

skip, failed to scan for 'qcom,msm-id = <' tag

Found file: msm8916-mtp.dtb ...

Version:1

... skip, incorrect 'qcom,msm-id = <' format

skip, failed to scan for 'qcom,msm-id = <' tag

Found file: sdm845.dtb ...

Version:1

... skip, incorrect 'qcom,msm-id = <' format

skip, failed to scan for 'qcom,msm-id = <' tag

Found file: apq8016-sbc.dtb ...

Version:1

... skip, incorrect 'qcom,msm-id = <' format

skip, failed to scan for 'qcom,msm-id = <' tag

Searching subdir: out/arch/arm64/boot/dts/cavium/ ...

Searching subdir: out/arch/arm64/boot/dts/broadcom/ ...

Searching subdir: out/arch/arm64/boot/dts/marvell/ ...

Searching subdir: out/arch/arm64/boot/dts/amlogic/ ...

Searching subdir: out/arch/arm64/boot/dts/mediatek/ ...

Searching subdir: out/arch/arm64/boot/dts/somc/ ...

Found file: sdm845-tama-akari_generic.dtb ...

Version:1

... skip, incorrect 'qcom,msm-id = <' format

skip, failed to scan for 'qcom,msm-id = <' tag

Found file: sdm845-v2.1-tama-akari_generic.dtb ...

Version:1

... skip, incorrect 'qcom,msm-id = <' format

skip, failed to scan for 'qcom,msm-id = <' tag

Found file: sdm845-v2-tama-akari_generic.dtb ...

Version:1

... skip, incorrect 'qcom,msm-id = <' format

skip, failed to scan for 'qcom,msm-id = <' tag

Searching subdir: out/arch/arm64/boot/dts/sprd/ ...

Searching subdir: out/arch/arm64/boot/dts/al/ ...

Searching subdir: out/arch/arm64/boot/dts/renesas/ ...

Searching subdir: out/arch/arm64/boot/dts/zte/ ...

Searching subdir: out/arch/arm64/boot/dts/freescale/ ...

Searching subdir: out/arch/arm64/boot/dts/altera/ ...

Searching subdir: out/arch/arm64/boot/dts/rockchip/ ...

Searching subdir: out/arch/arm64/boot/dts/lg/ ...

=> Found 0 unique DTB(s)

And it generated dtbo.img with 32bytes.

Any suggestions?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
So I open again the 51.1.A.11.26/kernel/msm-4.9/README_Xperia

Not I begin with Step 2 (did Step 1 in the past)

Workingdir is 51.1.A.11.26/kernel/msm-4.9.

mkbootimg \
--kernel out/arch/arm64/boot/Image.gz-dtb \
--os_version "8.0.0" --os_patch_level "2018-08-01" \
--cmdline "androidboot.hardware=qcom video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=2048 androidboot.configfs=true androidboot.usbcontroller=a600000.dwc3 zram.backend=z3fold msm_drm.dsi_display0=dsi_panel_cmd_display:config0 buildvariant=userdebug" \
--base 0x00000000 \
--kernel_offset 0x00008000 \
--tags_offset 0x00000100 \
--pagesize 4096 \
-o boot.img

A 15mb boot.img got created.

Now Step 3

mkdtimg create dtbo.img --page_size=4096 `find out/arch/arm64/boot/dts -name "*.dtbo"`

This is weird. There is no dtbo file.

But I made Step 1 and 2 in this working dir.

So I execute Step 1 again.

Same result, there are no dtbo files.....

It is so much easier to build the **** with an AOSP build environment. :silly:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] yanke928:
Yes, it seemed *.dtbo file is missing, maybe something is wrong with my export path.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I don't think so.

I've got the same problem with the 32 bytes dtbo.img, while building it with AOSP works.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nasko_spasko:
You can flash android p but it won't boot.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Inclusive the new bootloader?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Yotoprules:
Really? I plan on buying this phone in September, if the camera can be fixed then I don't see a better phone to get right now (its 320 GBP for a used XZ2, 340 for a great condition refurbished one)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
With fixed, I mean the DRM fix will be installable with twrp.

I don't know the picture quality.

But I did hear from XZ Premium owners, that the picture quality won't be a mess.

The XZ2 has a better cam.

So it sounds good in theory.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] VeixES:
slightly offtopic. maybe someone who has rooted can tell me. i want to enable usb diag mode with my rooted xz2(to do some qualcomm modem stuff).

On older sony-s "setprop persist.usb.eng 1" did the trick but not anymore. casually checked some init files but did not find the usb diag section. does the kernel need to be compiled with that usb diag support?

Or do i need to do something with SELinux?

Edit: setprop sys.usb.config diag,serial_cdev,rmnet,adb seems to be working.

PS. Is there an eaasy way to get rid of the "There is internal problem with your device...." popup on startup?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] DeafSymphony:
Guys im a complete noob please help me lol

I finally got to unlock bootloader on my xz premium but now im stuck and im not sure what to do. I was planning on using storms software but the website is down... and the thread for doing it manually since to dont have one of the necessary files anymore. So what's the next step for me? Please guide me, I want to get familiar with all the terms and basically become a nerd on this. If someone could give me a step by step guide of what to do im situation for my phone i would appreciate it a lot. It has the latest software update from august 1 apparently

Thanks
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
You should ask it in the XZP forum :)

Unfortunately I can't find another downloadable DRM fix, too.

Seems that [MENTION=8363210]sToRm//[/MENTION] provides the only working drm, which site is down.

Someone wrote, that he doesn't need the DRM fix on the XZ Premium, if he use the Sony AOSP as firmware.

Can you confirm this?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] sToRm//:
Yepp... The website is down for maintenance by the provider. It will be back within 48 hours. Then everything works again like always.

Cheers! :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] FcukBloat:
hi [MENTION=6031898]MartinX3[/MENTION] sir you monitor progresses in GitHub right? do you see any activity from jerpelea or other Sony Devs in commits you linked earlier? tx!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Sometimes I think they do nothing.

But they don't only work on GitHub at Sony.

Also we don't see their background device testing.

I need to calm down, too and wait for the September update for our devices.

Or I will get crazy, too.

I am not 100% sure, if we will get the bootloader update in September.

The stock development is 0% transparent, while the AOSP development is 90% transparent.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] xFirefly93:
A few questions because this thread seems to be the only active development topic in here at the moment..

1) Is the camera affected after unlocking the bootloader (because of the removal of DRM-keys) in any way?

2) If no at the question above, is there any root solutions released either officially or unofficially for XZ2?

3) Any custom kernels for stock (based) ROMS on the way? Is it anything I maybe can help out with, if I can get my hands on a second hand XZ2, regarding this "matter"?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] FcukBloat:
yeah the problem is that when you feel close the waiting is so much stressing..! :p let's wait and see what happens with next update so :fingers-crossed:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
1) https://xdaforums.com/showpost.php?p=77390088&postcount=180 :silly:

2) https://xdaforums.com/showpost.php?p=77370771&postcount=124 :silly:

3)

https://xdaforums.com/project-treble/trebleenabled-device-development :silly:

My AOSP build :silly:

But without the bootloader pach (v60 or higher is needed) nothing will boot except the stock boot.img.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] 695235079:
hi,brother,thanks for your wrok.

I am from China and i use h8296.

First,I flash the stock rom by newflasher,and enter fastboot model,than I flash the twrp with stockkernel into boot partition.

I boot from it,and i get it,but i can not touch.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
You are able to boot my twrp build with the stock kernel, but [MENTION=4620038]yanke928[/MENTION] was not?

Which firmware version are you using and which twrp filename?

Can you get a log with

adb pull /tmp/recover.log

?

Does

adb shell

Gives you a remote terminal on your device?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Like flashing the firmware with newflasher v13, with userdata.sin ?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] masoxik_cz:
I did this. I think.

with Emma utility - not worked, newflash v13 utility - not worked. I tried Oreo, Pie, DE version, CE version, US version.

I am ****ed up.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
You flashed the firmware with newflasher v13 without removing the userdata.sin?

(Making a factory reset)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] masoxik_cz:
I have download H8266_Customized CE1_1313-3193_52.0.A.3.27_R2B and I can't find this file. Only userdata_X-FLASH-CUST-B6B5.sin

I tried remove it. but without positive result.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I mean, did you flash the firmware without removing this file?

So it makes a clean factory reset of your phone so it deletes every app and setting.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] sToRm//:
There were some users reporting that after flashing the firmware with flashtool, the modifications in the system didn't work. They also had problems with some Android functionalities. So they used newflasher to flash the firmware again. But the problem was still there. Then they did a reset in Android live system and (I really don't know why) it fixed all problems. So maybe while flashing the firmware with the tools, there is something missed what the reset functionality in Android can do. Maybe it's worth a try.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] masoxik_cz:
Without and with it too.

---------- Post added at 06:53 PM ---------- Previous post was at 06:47 PM ----------

I tried factory reset from phone menu. not worked.

Did you mean this?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] twistedddx:
You have GSM signal to be able to make emergency call.

Sounds like IMEI is blocked or your carrier is on a band your phone no longer wants to support.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Quarzkopf:
Xperia XZ2 Compact H8324 Bootloop

Hi, I have a problem :)

I own an Xperia XZ2 compact. H8324

My bootloader is unlocked.

As 1. "[FASTBOOT] fastboot flash boot twrp.img"

writing to boot_b all right

2. [FASTBOOT] fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

Works as well.

3. Reboot into RECOVERY / TWRP (Power + VOL DOWN)

Works perfectly too

4. [TWRP] flash stockkernel-installer.zip

[TWRP] flash twrp-installer.zip

Reboot into RECOVERY / TWRP

[TWRP] flash Magisk

Until then everything works without any error message

5. Reboot into SYSTEM

Unfortunately does not work. :)

No matter if I choose boot a or boot b in the TWRP.

The Sony logo appears and roof tries to restart the system immediately and goes into a bootloop.

Could it be that the kernel might not fit?

I have tried it with the following Rome.

H8324_51.1.A.4.265_DE

H8324_51.1.A.11.51_R14A_Hong Kong

I'll try it again with the Rome provided by you

H8324_Customized CE1_1313-3194_51.1.A.11.51

But what could go wrong there you have an idea that could take me further?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] masoxik_cz:
Maybe, but why? I will check it with operator.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] whiteduck89:
[MENTION=9565762]Quarzkopf[/MENTION] that's the exact same problem I had a few pages back, and was able to solve eventually. You're flashing Oreo, just as I was.

When using Newflasher, DO NOT delete the *.ta files like the Xperiblog recommends. The *.ta files in Newflasher enable the correct boot partition to be flashed (easiest way to explain it), and will NOT destroy your phone. When I flashed those *.ta files from MartinX3's CE1, I was able to do everything properly, boot into Oreo, and flash DRMfix :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Quarzkopf:
Thanks, I finally made it.

Build 51.1.A.11.51 + TWRP 3.2.3.0 + DRM fix by Xperifix = Root

Only the camera does not really want. She gives me a dark screen in the viewfinder. When triggered, but it makes a picture.

I will try to downgrade to 51.1.A.4.265 because it should work there.

Only works there the stockkernel xz2c-installer not more. Can someone tell me where to get a kernel.img for the rom?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
You need the rom I uploaded.

Please repeat all the steps until you get your black camera preview.

The last Xperifix by [MENTION=8363210]sToRm//[/MENTION] has a bug.

You need to put the permission.zip in the mask app as module.

It is described in a post in the thread.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Quarzkopf:
AOSP or Stock Rom ?

In cannot find permissive.zip in Git Hub or in this Thread ?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] FcukBloat:
Search better my friend...

https://www.google.com.pe/url?sa=i&...aw13BmnsDNZFqgB8w1gnPppM&ust=1543197332591266

---------- Post added at 02:57 AM ---------- Previous post was at 02:56 AM ----------

get v1.2
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Quarzkopf:
After 12 hours I made it work. Many thanks to all of you and I will now make me a guide for such stupid people like me to write. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
:victory:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] masoxik_cz:
Sorry, I dont understand how to install permission script. with twrp ? I dont uderstand screenshot from your post. it looks instaled as some application to Phone OS. where I can get this app?

By the way My carrier take hands off from problem with signal :( . They are not blocking IMEI. I hope DRMfix will solve it :/

---------- Post added at 12:10 PM ---------- Previous post was at 12:00 PM ----------

Please which version of Magisk you installed with XperiFix? 16.7 Or 17.1
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
17.1 you need to use.

And the official magisk app.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] masoxik_cz:
Not worked for me, Camera still have black screen. I dnot know how to do complete Root:

What I did:

1. flash with emma utility firmware version 51.1.A.11.51 US

2. [FASTBOOT] fastboot flash boot /android8/XZ2/2018-10-11_16_20+2_00/twrp-3.2.3-0-xz2.img with Platform Tools ver r28.0.1 windows

3. [FASTBOOT] fastboot --disable-verity --disable-verification flash vbmeta /android8/XZ2/2018-10-11_16_20+2_00/vbmeta-xz2.img with Platform Tools ver r28.0.1 windows

4. Reboot into RECOVERY/TWRP (Power + VOL DOWN) - TWRP wants some password - I give CANCEL

5. [TWRP] flash stockkernel-xz2-installer.zip from direcotry /android8/XZ2/2018-10-11_16_20+2_00/

6. [TWRP] flash twrp-3.2.3-0-xz2-xz2c-xz2p-installer.zip from /android8/Universal/2018-10-10_20_01+2_00/

7. Reboot into RECOVERY/TWRP + connect to PC via USB - TWRP still wants some password - I give CANCEL

8. flash Magisk-v17.1.zip from /android8/Universal/2018-10-10_20_01+2_00/ with XperFix 3.1 As vendor partition

9. Reboot into SYSTEM

10. install Magisk MagiskManager-v6.0.1.apk downloaded from https://******************/

11. run Magisk Manager go to Modules and install magisk-permissive-script_v1.2.zip module downloaded from https://xdaforums.com/apps/magisk/module-magisk-selinux-permissive-script-t3577549/

12. restart.

Camera still not worked. what I did wrong?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] old.splatterhand:
If you can boot into Android and you have root, check the xperifix.zip what files in which folder should be flashed and look with a root explorer if this files are flashed into correct folder of your android OS.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Maybe the SELINUX context of [MENTION=9578686]masoxik_cz[/MENTION] is still not permissive.

Maybe it is enforced. [MENTION=8363210]sToRm//[/MENTION] ?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] masoxik_cz:
I check selinux status with 'root checker' from app store and it shows selinux in permissive mode. :/
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
[MENTION=8363210]sToRm//[/MENTION] is needed

Or another owner of your device. :)

Be sure running OREO.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] old.splatterhand:
Or please check if the files are flashed correctly into the right folder.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] masoxik_cz:
I installed root explorer, but I dont know what I looking for. and where. xperfix.zip i cant find.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
[MENTION=3142060]old.splatterhand[/MENTION]

We shouldn't advice people to extract this.

If pirating of the xperifix starts, [MENTION=8363210]sToRm//[/MENTION] will stopp development immediately.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] old.splatterhand:
You don't need to extract, nor do i want people to go for steeling others work.

But for me in my case, the files were not flashed, so i think this could be a possible way to find out whats going on.

You also could send the name of the files he could look for in pm ;)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Yes, of course.

Someone who uses Oreo should do this. :P
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] whiteduck89:
[MENTION=6031898]MartinX3[/MENTION] I'm on Oreo with DRM fix. What do you need?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Thank you for your fast response. :)

[MENTION=9578686]masoxik_cz[/MENTION] has a problem activating the drmfix.

Maybe he missed some steps in the installation procedure. :confused:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] masoxik_cz:
All my steps I described here: https://xdaforums.com/showpost.php?p=78255016&postcount=2000

I dont know how verify if the drmfix installed corectly. Becuase my camera have black screen.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] whiteduck89:
Hey [MENTION=9578686]masoxik_cz[/MENTION], some things i picked up from your post.

8. flash Magisk-v17.1.zip from /android8/Universal/2018-10-10_20_01+2_00/ with XperFix 3.1 As vendor partition

This is the incorrect process. You have to do this

1. All the vbmeta stuff

2. Boot into TWRP, flash stock kernel zip, flash TWRP zip

3. Reboot into TWRP, flash Magisk

4. Reboot into SYSTEM

5. Run the DRMfix, following the instructions exactly. Select /vendor/ partition, and A/B device.

6. Let it do its thing

7. Reboot into System, install the Permissive.zip in Magisk.

From what I can tell, you went straight from Magisk to Xperifix without booting to system first. And you may not have ticked A/B device in Xperifix.

Give it a go, and report back :)

EDIT - A question for you. What is emma? I couldn't get any of this working with Sony Flashtool, I HAD to use Newflasher. There could be some problem with emma, whatever it is.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] masoxik_cz:
Emma is flashtool from sony.

I dont understand:

4. Reboot into SYSTEM

5. Run the DRMfix, following the instructions exactly. Select /vendor/ partition, and A/B device.

If I boot to system then I cannot fix drm via Xperifix. the Xperifix wants boot the phone to fastboot first. after that it wants reboot to recovery mode to twrp, connect over USB and then run fix.

Emma is flashtool from sony.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I heard about problems with Emma, which got solved with newflasher v13
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] whiteduck89:
[MENTION=9578686]masoxik_cz[/MENTION]

Ok, so you need to follow the instructions in the post exactly. And use Newflasher, not EMMA. I've cleaned up the instructions for you.

3. Reboot into TWRP, flash Magisk

4. Reboot into SYSTEM, allow first boot to complete.

5. Run Xperifix on your computer

5a. Power down phone, hold the UP button, and connect to USB (fastboot)

5b. Follow Xperifix prompts. No TWRP image, and make sure unticked. Select the Magisk zip you flashed originally. Select /vendor/ partition. Tick A/B device.

5c. Flash, and reboot to RECOVERY when requested.

5d. Reboot into System when complete.

6. Install Permissive module in Magisk.

7. Launch module, and set to Permissive. (may not be necessary, depending on which module you use)

8. Reboot phone (may not be necessary)

Step 4 is mandatory. It sounds like you're going straight from flashing Magisk, to Fastboot to start DRM fix. Is that correct? Are you skipping the system reboot?

Trying to help but I followed the instructions exactly and didn't have any issue. Maybe EMMA has something to do with this as well.