yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
The right bootloader to boot everything. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] FartyParty:
It was v59 with the fw it came with but a new fw version released the other day which I just flashed and it updated the bootloader to v60.

Although only a few countries have gotten it yet so I simply flashed UK one.

Lucky me they updated the bootloader for the XZ2P as well :P.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
17.09.2018
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] FcukBloat:
can someone with UB test them? :angel:

but I don't see download links in OP? :confused:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Third post. :)

I don't know if it will work on the XZ2P.

The easiest way is to wait for Sony to add its device and Plattform Code into the aosp.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nasko_spasko:
fastboot boot recovery-8.0.img

results in battery charging animation.

8.1 doesn't boot at all. I'm on stock 8.0 v51
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
And if you install it?

And is there a log in /tmp/recovery.log ?

Or sdcard/recovery.log ?

Maybe I need to create a new dtbo.img

But I need the kernel source.

Or we need to disable verification with vbmeta.img like mentioned in my aosp thread.

And do you use a h8266, h8296 or h8216 firmware?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nasko_spasko:
OK Update: It seems to work with holding volDown + power keys

Will upload log if any. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Maybe I killed the "boot" mode and there is only a recovery mode now :)

I made it with

make recoveryimage

not with

make bootimage

Buuut the bootimage had only the kernel file in it

The recoveryimage has the kernel, the ramdisk and another file in it.

The new A/B Schema ist difficult :silly:

And I think 8.1 is not compatible with our 8.0 system.image.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nasko_spasko:
Yah! It definitely works when powering the device with volDown. Not booting to android, though. And TWRP is stuck at it's splash screen with no logs in /sdcard. :\ No ADB in TWRP either, so the /tmp/log is lost after reboot.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Thank you for testing :)

That's madness.

Maybe it will work, if my Omni Build environment has the kernel source code to compile it itself.

Providing a prebuild kernel is deprecated.

I wish the AOSP code would be stable enough.

The Stock Firmware has no default recovery, while the AOSP ROM has one already build-in without TWRP.

Maybe you want to play with the AOSP default recovery?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nasko_spasko:
Damn right I'd like to play with it. Time's a valuable thing to have. Maybe I'll test tonight (EEST - UTC+3)

---------- Post added at 01:51 PM ---------- Previous post was at 01:38 PM ----------

And maybe, just maybe, the aosp kernel is stable enough for recovery, I mean touch works, the mount points seems to be ok....
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Ah, maybe I will give it a try this evening.

But there is still no camera support.

https://github.com/sonyxperiadev/kernel/pull/1781
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nasko_spasko:
Stock recovery works and formats /data - no problem. I'll test with TWRP tonight.

Proof: photos.

I still can't believe how fast it boots just 1 and a half sec. 0_o
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Woohoooo :laugh:

Maybe it is fast, because nothing works :silly:

But I think unill November the builds will be stable.

Can you install an "update" like xperifix with it? :)

It could be, that the stock kernel has no support for custom recovery and the next build with the aosp kernel would work.

Weird stuff.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Please retry it with the one from 4/24 :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] boringpie:
When I try adding my credit card it says "This phone can't be used to pay in shops. This may be because it is rooted or altered in some other ways."
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Does magiskhide work on this app?

Sadly I don't own a credit card.

But also don't want to pay with my phone for security reasons.

So I can't test it. :(
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] boringpie:
I have added Google Pay and Play Services to Magisk Hide, but it's still not working.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Maybe this is helpful

https://xdaforums.com/apps/magisk/discussion-google-pay-magisk-discussion-t3906703
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Or this

https://github.com/topjohnwu/Magisk/issues/1240
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] boringpie:
Thanks MartinX3, I saw this two months ago, it worked during March, but strangely it stopped working since April even though I did not update anything.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
And the issue ticket I linked?

They say you need to clean app data and delete stuff somewhere else.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] boringpie:
Yes, I did follow every step and it worked well for about a month. However, since April it stopped working even I turned off auto-update. One weird thing I notice is that Google Pay automatically assigns itself as "Device Administrator" even after I turned it off, and that's when it stops working.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
So it is a cat and mouse game.

Just wait same see how they fix it.

Maybe the new magisk 19.1 helps?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] boringpie:
I just installed 19.1 Magisk and my phone is stuck in a boot loop.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MDLB:
I can confirm the stuck at SONY-Logo bootloops after flashing Magisk 19.1 under official 8.25 india newflash firmware (not under AOSP or OMNI)

Magisk 19.0 is OK
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Creed14:
Hi Martin! Thanks for all the work you do! I've just got my first new (unlockable) phone since the LG G3, and I'm a little lost.

So I've got my bootloader unlocked, and now my camera doesn't show a preview, just a black screen. Still takes pics, though. This seems to be a common glitch (I think a firmware update will f ix it, right? If not, Xpirifix should).

Anyway, I unlocked the bootloader then went to install TWRP from your download link on the first page of this post via fastboot. I followed the instructions to the letter, but when I did fastboot reboot twrp.img (renamed the file properly), first it said something along the lines of "your bootloader is unlocked, please lock it", then rebooted a couple times, then booted into system. No TWRP.

I saw somewhere in this thread that my firmware version has to match the TWRP version. Okay, fair enough. However, I need to be on version 51.1.A.4.265 for Xpirifix to work on my phone (XZ2C). I can't find a download for either the firmware or a compatible version of TWRP. Xpirifirm doesn't have it, Xpiricheck doesn't have it, and I don't believe it's on Sony's website. I'm sure there's a link here on XDA somewhere, but I haven't found it. Same goes for a version of TWRP that'll work with that firmware.

Any chance you can help me out? I totally understand if you can't, but I'd hugely appreciate it! :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Thanks for reporting.

Please open an issue ticket at magisk on github with the issue.

And the contents of the pstore.

Just force close the device in while bootlooping and boot into twrp.

There you need to go into the pstore mount and grab the file(s).

I'll hint the sodp team.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Thank you, you're welcome. :)

Sadly you didn't updated the phone to the newest version before unlocking the bootloader. :(

If you unlocked it on Oreo, the xperifix works.

If you unlocked it on a too early Pie version, it may not work.

Please look at the download link -> android 8 folder for an old firmware version.

And please follow the installation instructions exactly, there is no "fastboot reboot twrp.IMG" :)

And the newest twrp only works with the newest firmware.

At least April. You maybe on a wrong firmware, if you tried "fastboot boot twrp.IMG" without success correctly, or you booted the blue bootloader wrong, like mentioned in the instructions. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] levone1:
Same here. I posted on Magisk discussion thread, and seems like most people are in the same boat. A few have been successful, usually on N and O, but most are failing. Probably best to hold off on Magisk update for now...

---------- Post added at 09:55 AM ---------- Previous post was at 09:53 AM ----------

I discovered while messing with MicroG, that Find My Device app is tied in with Gservices device admin app. Try going to app info > show system > Find My Device, or just check admin app settings, and disable it, and see if any different...
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] samstheman42:
Does anyone know if the latest version of Magisk (v19.1, I WAS on v18 from the .gz provided by [MENTION=6031898]MartinX3[/MENTION]) bricks the xz3? I had everything all setup and running the way that I liked last night and was prompted by Magisk manager to do an update to both the app and Magisk. Naturally, I did, and suddenly my phone is stuck in a boot loop. I CAN successfully get back to fastboot as well as TWRP recovery (if I boot it through fastboot using the "fastboot boot twrp-xz3.img" command).

Any ideas?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Flash again the boot.img and reinstall magisk 18.1.

19.0 seems to work, but 19.1 seems to bootloop.

PS: the magisk uninstaller.zip seems to bootloop my device.

18.1 seems to battery drain my device, too.

19.0 seems to far more battery drain my device.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Creed14:
I'm on Oreo, fortunately! I wanted to be on Oreo for Xposed, and from past experience I know to never update a phone before trying to tinker with it. Hell, I stayed on Kitkat for as long as possible back on my G3!

Are you sure Xpirifix will work with that firmware? Their site says that it only (officially) supports the July 2018 firmware. If it still works though that's great!

I'm pretty sure that I wouldn't have messed up a fastboot command... but it's entirely possible. I'm not on the right firmware for the TWRP though, so it wouldn't have worked anyway.

Thank you SO MUCH for everything you do here! You're the best!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
xperifix 3.2 will work with the newest oreo firmware I uploaded :)

there is also a oreo twrp :)

have fun repairing the camera before you upgrade to pie and thank you :)

https://github.com/MartinX3sAndroidDevelopment/bug_tracker/issues/7

maybe this'll support you :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Creed14:
Yeah, I used the Oreo TWRP - I'm just on an older firmware than it supports. Is that a new thing, that you need your recovery to match your firmware? I don't remember ever having to worry about that on older versions of Android (back when Towelroot, the TWRP app and the Xposed installer app were all you needed)

I'll upgrade to Pie once Xposed supports it! I'll give that black camera fix a shot too, thank you SO MUCH!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] aragorn771:
Magisk 19.1 boot looped my phone and I lost root. In TWRP I re-install stock kernel and 18.1 which brings my phone back but 18.1 doesn't install
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Pandemic:
use the v19.1 magisk uninstaller and reflash v18.1
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] aragorn771:
I can't find anything that say Uninstaller. Where is this?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Now you don't need it either in pie since April.

The splitted dtbo and the missing recovery partition needed some research and development. :)

Pie hasn't black camera too, if you fix the camerazip.zip, but you need to use xperifix in Oreo first and repair the preview there. :)

On a custom ROM the camera works without these hacks, but is still work on progress. :)

And no problems, just ask if you get problems. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
But he already reflashed the entire bootimage :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
If you reinstalled the boot.img you should reboot and install magisk a second time.

I had sometimes this problem too. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] aragorn771:
Didn't work
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Creed14:
Ah, so it's a device specific problem? Gotcha. If I remember correctly the V20 had some sort of similar issue with not having a proper recovery partition.

Is camerafix.zip included with Xpirifix (and it's not necessary for Oreo, right?)? I searched this thread for it and couldn't find a link, but it looked like you said it was bundled with it?

Wait - do all custom ROMs work properly without these hacks, or one special one? I was under the impression that the camera was pretty bad on all available ROMs and there wasn't anything you could do about it.

I'm currently downloading the latest Oreo firmware - I'll let you know if everything goes well! :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Google introduced the change and the xz2 was one of the first using it. :)

the camerafix.zip is just to fix the PIE camera preview, after you initial repaired it with xperifix in oreo, it is bundled with the twrp file.

All custom roms based on sodp (sony open devices project) like the ones on xda, are independent from the stock drivers.

Sony invests money, resources and people to develop device drivers from scratch for aosp.

Nice to hear. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] samstheman42:
I was able to get the phone to boot by using the latest uninstall zip. Then, after the phone booted and I could verify that everything was working, I rebooted back into TWRP and reflashed magisk v18. Working perfectly again now. Thanks!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Creed14:
Dude I'm SO sorry to keep asking for help - but when I try to use NewFlasher to flash the Oreo firmware, it gives me the following error

No usb device with vid:0x0fce pid:0xb00b

I assume this has something to do with the GordonGate drivers that it offers to give you, right? Well, I unzipped the gordongate.7z file into a new folder, opened device manager, and tried to update my phone's fastboot driver to the .inf file in the GordonGate folder (ggsomc.inf, I'm currently using the official Google fastboot drivers and the phone is listed in Device Manager as "Android Bootloader Interface"). It gave me a me an error message saying that there were no compatible drivers in that folder.

What am I missing here?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Umh, sadly I'm a Linux user, not a windows user and can't help you.

Maybe someone else can help you.

You could also install linux mint in a virtual machine and activate usb pass through in it.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
I have Windows 10 and the Newsflasher works by my.

I never used the gordon or the google drivers. And if the google and gordongate drivers only held fastboot it can't work because Newsflasher works via flashmode.

Anyway i recommend you to deinstall the gordongate and google drivers and install the specific sony drivers for the xz2.

Look here:

https://developer.sony.com/develop/drivers/

In my case the xz2 (in flashmode) recognize itself in the device manager as the following:

SOCM Flash Drive

Sony Mobile Communication in the driver tab
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Creed14:
Huh okay, thanks! I'll give that a shot right now. By flash mode you mean fastboot/bootloader, right?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
There is a green flash mode and a blue download mode.

Use the one with the green LED.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] levone1:
Hey, new issue... Tried latest Magisk via Ota update, but not working, so I reverted back to 18.1, and working fine, but now I get the same problem with dm-verity/verification. I can't use the same solution, because the offered zip is the new one, which doesn't work. I tried to uncheck the boxes and install 18.1 zip through modules screen, but install fails, (insufficient partition size)...

Any ideas? Thanks
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] aragorn771:
I have tried a few times. Magisk is not installing. My phone is no longer rooted. I really don't to just redo the whole phone.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Creed14:
Got it now! The gordongate drivers weren't installed, and I was in *fastboot* mode, not flash mode. Didn't know they were different things. In fastboot, it showed up as Sony XZ2 Compact. In flash mode, it just showed up as "Android". THEN I was able to install the gordongate.7z drivers to it, and it showed up as SOCM Flash Drive, just like you said! I was able to flash successfully from there. Thanks!

Got it updated! Thank you!

Now... I can't get TWRP flashed and I have absolutely no idea why. I've got the proper firmware on now. I followed the instructions to the letter, this is what my ADB/fastboot terminal looks like.

I do adb reboot bootloader. Screen goes black and the notification LED goes blue. Screen stays black while in the bootloader (it's supposed to, right?). I fastboot flash the vbmeta and do the rest of that command. Screen and LED don't change, but the terminal says it's successful. Then I fastboot boot twrp. Immediately the screen displays an image saying that the bootloader is unlocked, and to please lock it. Then, after a minute, the Sony logo comes up. Then the screen goes black, the notification LED goes red, and the phone vibrates a couple times. Then after a minute, it successfully boots to system.

You say to enter fastboot via adb, twrp, system. I entered through ADB - am I missing something? You also said

I'm flashing the vbmeta before trying to boot TWRP, so I don't think that's the issue.

---------- Post added at 07:04 PM ---------- Previous post was at 07:01 PM ----------

I'm on H8314, by the way.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] boringpie:
Have you tried installing the older versions (ie. Magisk 17.2 and Magisk Manager 6.0.0)? Once it's done, try installing 18.1 and 7.1.2. This works for me.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] boringpie:
I tried that as well. GPay will work for a few hours after disabling Find My Device and Google Pay in the admin page, but a few hours later the two will add themselves back into admin. That mean all the cards will be removed and I will have to re-add them again.... unfortunately.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Does the magisk uninstaller ZIP from xda help?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
If you flashed the stock Firmware by any flash mode tools, you need to redo the vbmeta tools :)

Also you should install the April stock pie Firmware first and redownload the newest twrp. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Creed14:
By redo the vbmeta tools, you mean fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img?

If I flash to Pie, will I both be able to go back to Oreo and still be able to flash my Xpirifix? I haven't been able to yet, since I haven't been able to get into TWRP. And the new TWRP will stick around once I downgrade to Oreo, right?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Yes

Did you repair the Oreo camera preview?

Then you can upgrade to pie and flash the camerafix.zip

If you mean that the Oreo twrp doesn't work, try an older version :)

It was months ago since I used it, maybe the last version had some troubles.

Twrp is part of the boot.img

You can easily install it again then.

And a downgrade requires a fullwipe.

Have fun :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] aragorn771:
the uninstaller bricked my device. I had to flash the boot.img from fastboot to get the device back. Now I ave to start over to root. Which i will do later.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] levone1:
Can't check Gpay myself, because I'm using MicroG, and function not implemented yet - https://www.google.com/url?sa=t&sou...Vaw00KtfQewVLH0Y2F7H1n7_G&cshid=1556905518212 - so it won't even open, but I do get safetynet pass, and PayPal app and functions working fine, using Magisk hide. You might need to apply hide to some other system apps...
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Klaus N.:
[MENTION=6283426]levone1[/MENTION] and all others who have problems after installing Magisk v19.0 (reverting from v19.1, because the device bootloops after installing it) regarding "keep dm-verity" - there's a solution:

1. Place Magisk v19.0 on your sdcard (int or ext)

2. Shutdown your device

3. Boot into TWRP

4. Enter the terminal in TWRP (advanced options)

5. Input the following command: echo KEEPVERITY=false>>/data/.magisk

6. Flash Magisk-v19.0.zip

7. Reboot

If this procedure doesn't work (maybe an error while flashing Magisk), you have to fastboot flash the stock kernel of the rom (you have to convert it from 'boot_X-FLASH-ALL-B6B5.sin' to 'boot_X-FLASH-ALL-B6B5.img' first ofc), then you have to do the steps from post #3 (Installation of TWRP) again, followed by the 7 steps above.

note:

For step 5., all credits must go [MENTION=4470081]topjohnwu[/MENTION] (Source: https://www.didgeridoohan.com/magisk/MagiskInstallationIssues) :svetius:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] levone1:
Awesome - that did it. I'm not too concerned with updating to v19, since I don't seem to need it at the moment, and I don't see any reason to take a chance on another brick, (especially since TWRP backup function is currently pretty buggy right now, [search for extractfork error]), but I followed instructions by topjohnwu that you linked to use commands in recovery terminal, and flashed 18.1, and good to go..

Thanks again