yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ2 Questions & Answers] boringpie:
I followed the video by burning the sim card off and stick it onto the SD Card, but once inserted, sim 2 is disabled. Right now I need to put on a sticky tape on my SD card just so I can use sim 2. (https://www.youtube.com/watch?v=N3euuZqoETU)

Then I later found this post about how to enable sim2 while the Sd card is inserted (https://xdaforums.com/xperia-x/how-to/how-to-enable-dual-sim-memory-card-t3664408).

Anyway, I will just follow the thread now to see what happens.
[Sony Xperia XZ2 Questions & Answers] xarinatan:
Has anyone actually tried to compile the kernel and rom yet? I managed to get pretty far in the build process for both, I just need a few more dependencies, although I'm sure that's one of the primary reasons they're not listed yet, though perhaps these dependencies could be extracted from the AOSP dumps or something? I have basically no experience with compiling android roms specifically, but I do have experience developing/compiling stuff and embedded devices and firmwares etc, as well as building arch/gentoo/linux from scratch and what not, so I figured it shouldn't be too big a step up.

The dependencies for compiling the ROM:

And this is where I got stuck with the kernel: https://pastebin.com/260rtEX7

there's still road to be covered I guess, but what specifically I don't know, so I asked here for another update, the Alin guy from the open devices forum seems pretty friendly but a bit busy, last update was a month ago where he said it was added to the experimental build guide and we would be able to build it soon. Link here https://talk.sonymobile.com/t5/Andr...ices-program/m-p/1337158/highlight/false#M368
[Sony Xperia XZ2 Questions & Answers] MartinX3:
Please wait.

After the bootloader patch got released I will upload a new version of TWRP and AOSP.

https://xdaforums.com/xperia-xz2/development/recovery-twrp-3-2-2-0-touch-recovery-t3821597

:)
[Sony Xperia XZ2 Questions & Answers] mirhl:
[MENTION=9065466]jamuir[/MENTION] had reported using build-kernel.sh script managed to produce a bootable image.

But I guess it makes more sense to just wait a couple of days
[Sony Xperia XZ2 Questions & Answers] MartinX3:
https://github.com/sonyxperiadev/bug_tracker/issues/156

And they told him to stop hacking around the bootloader, because it may brick devices forever.

The new bootloader will boot the stuff without any hacking.

As example I will compile the AOSP again, like I did in the TWRP thread the last time, you install it and it will boot without any problems.

So it will boot my TWRP image without any problems and I can fix bugs by getting a log.

I hope the new image will somewhere in this month.

Last month the update came in the middle of the second week of the month.

This week is the second, too.
[Sony Xperia XZ2 Questions & Answers] nreuge:
Soon XZ2 can escape from its cage... :fingers-crossed:
[Sony Xperia XZ2 Questions & Answers] FcukBloat:
hope so an soon! :fingers-crossed:
[Sony Xperia XZ2 Questions & Answers] smiley.raver:
Could this be used to temp root??

https://android.stackexchange.com/q...comm-embms-keeps-popping-up-every-few-minutes
[Sony Xperia XZ2 Questions & Answers] MartinX3:
https://xdaforums.com/xperia-xz2/de...-3-2-2-0-touch-recovery-t3821597/post77757740
[Sony Xperia XZ2 Questions & Answers] Pandemic:
Still not fully work !! We hope we get stable twrp soon -__-
[Sony Xperia XZ2 Questions & Answers] MD5003:
I have downloaded latest Firmware as on the phone using Xperifirm, but can not find mentioned kernel_X-FLASH-ALL-B6B5.sin file.

Which file is the mentioned Kernel file?
[Sony Xperia XZ2 Questions & Answers] MartinX3:
It was named boot** on older firmwares

In the newest it should be named kernel

Or it is the other way around.
[Sony Xperia XZ2 Questions & Answers] apaxtc:
boot_X-FLASH-ALL-B6B5.sin ---- name

64.0 MB (67,112,448 bytes) ------size
[Sony Xperia XZ2 Questions & Answers] MD5003:
Thanks guys, I was able to unSin the img and patch it using magisk manager. The patched img was way smaller than the original non-patched one.

Flashing it using fastboot ended in a bootloop.

I was able to resolve the bootloop using the original non-patched img in fastboot.

Any suggestions how to magisk patch the img properly?
[Sony Xperia XZ2 Questions & Answers] MartinX3:
Using the vbmeta parameter from my twrp thread

Only the installation via twrp patches the security mechanism
[Sony Xperia XZ2 Questions & Answers] MD5003:
So fastboot-installing the vbmeta from your thread first, then the patched boot.img from magisk works?

Or is it required to have TWRP installed?
[Sony Xperia XZ2 Questions & Answers] MartinX3:
Just install twrp and flash magisk in it and you're done.

No vbmeta stuff needed anymore.
[Sony Xperia XZ2 Questions & Answers] aaflan88:
Unlocking succeded but there is no way back to relock
[Sony Xperia XZ2 Questions & Answers] serajr:
Root should be relatively easy to achieve, as long as the bootloader is unlocked (we don't even need twrp)!

Well, at least in 2018 "midrangers" (great devices imo) like XA2/Ultra, unlocking the BL does not f*** up camera anymore (no more green pics, etc...). Maybe damn sony still punishes flagship devices owners!! You know...

Regarding system bloatware, I have already created a script to uninstall most of them. Script does work on devices with locked BL. I intend releasing it soon ( [MENTION=4898998]Klaus N.[/MENTION] is the official tester ;) ).
[Sony Xperia XZ2 Questions & Answers] stipi69:
If anything on my rooted Z5 camera was a disapointment, i dont know if it was so before root or just because unlocking bl... (i fool flashed it first thing i got it :) not even tried it first...

So if this is a tradeoff i will keep it locked for now, allthough i support all root apps that i use - i buy them from respect to work given into development and i have many of them and am eager to install them on XZ2, but will not if camera is screwed if sony has moved on i will unlock it gladly i am 50:50 now :)

HAHA, JUST KIDING.... JUST GIVE ME A DAMN ROOT AND I FLASH IT ASAP AND REPORT :D :D
[Sony Xperia XZ2 Questions & Answers] serajr:
Hehe cool... like I said before, you need to first unlock bl from your device, otherwise we will not even be able to try (pm me if you're interested in trying)!!
[Sony Xperia XZ2 Questions & Answers] Sony92:
Has anyone unlocked his xz2 and selected another device at the unlock page?
[Sony Xperia XZ2 Questions & Answers] stipi69:
can it allready be unlocked via flashtool? is there a flashtool version requirement for 2018 models, do they even contain xz2 drivers?
[Sony Xperia XZ2 Questions & Answers] serajr:
Yes, it can (as per sony official unlock page instructions). Fastboot drives included.

No, Androdyxe already stated Flashtool has been already updated to work on all 2018 devices, but not yet released!

Flashtool fastboot drivers (...flashtool\drivers\Flashtool-drivers.exe - choose Flashmode and Fastboot drivers only) may also work, if properly installed!
[Sony Xperia XZ2 Questions & Answers] stipi69:
i just installed flashtool 0-9-24-4 and when i conect it in fastboot or flashmode it recognezed both and installed it, seems that i am ready, need to make backups, and download propper firmware just in case.

but on unlock site there isnt even xz2 model to choose :) will have to wait

https://developer.sony.com/develop/open-devices/get-started/unlock-bootloader/
[Sony Xperia XZ2 Questions & Answers] serajr:
Please, take a look at post #17, just a page back ;)
[Sony Xperia XZ2 Questions & Answers] stipi69:
oh one stupid question maybe:

first time using dual sim version of phone *#06# is showing two imei numbers, which one for unlocking bootloader?
[Sony Xperia XZ2 Questions & Answers] serajr:
Not sure about that, but maybe any of them (never used dual sim too).
[Sony Xperia XZ2 Questions & Answers] Sony92:
I looked at the service menu today. according to the menu, I can unlock my bootloader. but it is not listed in the list on the unlock page yet
[Sony Xperia XZ2 Questions & Answers] stipi69:
Choosing XZ1 may do the trick for you!

Serajr says so, i am still to do that, but didnt make it today
[Sony Xperia XZ2 Questions & Answers] Sony92:
not that then lock the device or exclude one from the unlock
[Sony Xperia XZ2 Questions & Answers] FartyParty:
Again, pick the previous device. You don't need to wait.

The device has been unlockable from day one.

Just pick XZ Premium and be done with it
[Sony Xperia XZ2 Questions & Answers] FcukBloat:
nice! i was waiting for doing one until i could root the phone :p

so you mean yours should be run via adb i think? tia!
[Sony Xperia XZ2 Questions & Answers] serajr:
Exactly! Gonna send you a pm regarding this!
[Sony Xperia XZ2 Questions & Answers] Sony92:
smartphone is not detected ik off fastboot under adb devices. when it is already on
[Sony Xperia XZ2 Questions & Answers] Sony92:
Can you actually install the recovery from twrp afterwards?

---------- Post added at 08:32 PM ---------- Previous post was at 07:55 PM ----------

What a twrp recovery can you take there
[Sony Xperia XZ2 Questions & Answers] SilverGamer_YT:
what is happening when you unlock the bootloader in the sony xperia xz i have unlocked xzp
[Sony Xperia XZ2 Questions & Answers] Sony92:
What kind of recovery can I take now
[Sony Xperia XZ2 Questions & Answers] serajr:
There is no twrp for xz2 yet! But root may be possible without recovery!

Btw, did you succeed in unlocking the bootloader?
[Sony Xperia XZ2 Questions & Answers] Sony92:
have taken the xz premium. everything went. But how can I get Magisk with root on it? I would like to flash Viper4Android. Can someone tell me how I do that without recovery. or whether that goes over adb or fastboot? if so, what are the commands?
[Sony Xperia XZ2 Questions & Answers] stipi69:
I guess you could try without flash via adb with command: ( fastboot mode )

Commands goes if you ofen command prompt in folder containing image otherwise you need to add path to files

fastboot boot boot.img

Or actualy flash it with:

fastboot flash boot boot.img

But developers like serajr must make a image for your phone if you kindly ask....

Me mayself would need image for dual sim variant so if annyone has some stuff to try, then please give a link.

Now i am learning about magisk, maybe this can help you, i will try it out eventualy

https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
[Sony Xperia XZ2 Questions & Answers] Sony92:
where should I take my boot img? Unfortunately, I am not so experienced as far as flashing fastboot is concerned. I needed a step-by-step guide on how to get root with magisk. I have a dual sim variant. can one try to take the recovery (twrp) from the xz Premium?
[Sony Xperia XZ2 Questions & Answers] FcukBloat:
did something bad happen to the camera when you unlocked the bootloader? bad pictures, less quality etc.. or everything is exactly like before? you have xz2 or xz2c? tia
[Sony Xperia XZ2 Questions & Answers] stipi69:
me to my friend, dual sim :D

I am planing to switch to magisk even if i suported supersu from chainfire till now, but in magisk i am new so i learn as i go... and i think it does not impact system partition so it should in teory be better...

i did not do anything from writen in this post on my xz2 but it worked on my old z5 but i plan too, i am downloading ftf from xperi firm, i have to learn howto dump image from tft still (anny sugestions welcome :)

1. you should have unlocked bootloader i guess (correct me if i am wrong)

2. developer otions and unknown sources enabled

3. So as far i have figured it out, you should bring this image dump (which should be extracted from ftf file... i am downloading it now via xperi firm) to phone and then run magisk manager to patch this very image

4. magisk then stores patched image to your phone internal storage

5. you should copy pached image from phone to PC folder from where you will run minimal adb or adb??

6. you connect phone in fastboot, open folder with pached image on pc (prefer to store it in your minimal adb folder which you downloaded first) keep pressing shift, right click and open command prompt and write:

a- for testing if it goes: fastboot boot boot patched_boot.img

This should not do any harm

b- for actual flashing fastboot flash boot patched_boot.img

Boot and fingers crossed

Ofcourse you should have drivers for fastboot installed

Please report if you have succes dumping image fro tft, i will try it too and if i have lock i send you image file link :D GOOD LUCK!!!

Magisk:

https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

Xperi Firm:

https://xdaforums.com/crossdevice-dev/sony/pc-xperifirm-xperia-firmware-downloader-t2834142/

Minimal ADB:

https://androidmtk.com/download-minimal-adb-and-fastboot-tool
[Sony Xperia XZ2 Questions & Answers] Sony92:
So I have an xz2. my bootloader is open. At the moment the camera is not .... I noticed until now. But I think if you have dan root on it, then this works.

---------- Post added at 10:24 AM ---------- Previous post was at 10:20 AM ----------

Thank you my friend. I will try it later. I hope for questions, I can contact you.

---------- Post added at 10:35 AM ---------- Previous post was at 10:24 AM ----------

whether one can use also the twrp of the Xz premium?
[Sony Xperia XZ2 Questions & Answers] FcukBloat:
thanks but i don't understand what you write..

the camera is not what? not working?
[Sony Xperia XZ2 Questions & Answers] stipi69:
For twrp i think it does not goe like so... it has to be for xz2
[Sony Xperia XZ2 Questions & Answers] Sony92:
the camera will stay black if you have an open bootloader, but if you have root on it, it will probably work again
[Sony Xperia XZ2 Questions & Answers] FcukBloat:
thanks for the answer! this is very bad news.. so can't unlock and get root here :((((
[Sony Xperia XZ2 Questions & Answers] stipi69:
Holly s.... ? I hope more experienced developers are working on that, have you tried relock bootloader?

Hope someone soon posts link to image dump
[Sony Xperia XZ2 Questions & Answers] Sony92:
I suspect, if you rooted the smartphone, then the camera goes
[Sony Xperia XZ2 Questions & Answers] stipi69:
Could be, really dont know man...

Maybe [MENTION=1336906]chinmoy[/MENTION] could throw some light on this mater, he is a camera expert afterall but dont know if he owns xz2

[MENTION=3989065]serajr[/MENTION] is there some ftf to download? I cant find a usefull link, i downloaded rom via xperi firm but cant find kernel.sin. to dump image ?

Sony keeps punishing heavy users again and again, why? I dont know
[Sony Xperia XZ2 Questions & Answers] nreuge:
I don't think that it was intended by Sony. The same issue had occured years ago on an old flagship and Sony had readily released an updated kernel to solve it (anyway, there is absolutely no justification of making the camera completely unusable by unlocking BL)

Therefore, Sony MUST BE warned of this issue.

At least, it proves one thing for sure: XZ2 Bionz engine is still DRM protected.
[Sony Xperia XZ2 Questions & Answers] serajr:
[MENTION=8058158]Sony92[/MENTION] [MENTION=9099265]Karimano24[/MENTION]

Probably we will never know... sad indeed!

Sony firmwares are free for public download with XperiFirm.

And for flashing them, Newflasher.

Reganding kernel and magisk (root), magisk doesn't work propely with original sony kernel format (sin / elf), so it's best to convert stock kernel to aosp img format first.

Kernel file is found in folder you downloaded with XperiFirm, something like this: kernel_X-FLASH-ALL-B6B5.sin. You can easily convert sony sin format to aosp img format using UnSin, so just do that! By doing so, you will get kernel_X-FLASH-ALL-B6B5.img.

Magisk kernel patching: Take converted kernel_X-FLASH-ALL-B6B5.img and rename it to boot.img (optional, to make things easier only), and push boot.img to the device's internal memory or sdcard.

Download and Install latest Magisk Manager app > Open Magisk Manager > Install > Install (again) > Patch Boot Image File > Pick the boot.img and let magisk do the patching job.

Now take patched_boot.img (located at .../MagiskManager/patched_boot.img) produced by magisk and copy/move it to your computer.

Flash patched_boot.img with this fastboot command:

fastboot flash boot [B][COLOR="Red"]patched_boot.img[/COLOR][/B]

If process above ends up in bootloop, you need to flash stock kernel again (read this under Edit 2).
[Sony Xperia XZ2 Questions & Answers] stipi69:
[MENTION=8058158]Sony92[/MENTION] this should be helpful ? [MENTION=3989065]serajr[/MENTION] that is great manual, i tried with flashtool to extract thos very. Sin file but unsuccessful... Sony92 follow this guide and you should be fine, serajr knows what he is talking about, in later hours i will try this manual too and if you are not able to achieve all that i will try to send you patched image.
[Sony Xperia XZ2 Questions & Answers] Sony92:
I have successfully root privileges with Magisk by patching the boot.img.

---------- Post added at 07:56 PM ---------- Previous post was at 07:38 PM ----------

Can you develop a drm fix for the xz2?
[Sony Xperia XZ2 Questions & Answers] stipi69:
Nice, what about camera? ?
[Sony Xperia XZ2 Questions & Answers] janjan:
Camera is not working after unlocking the bootloader right?

I am going to download the kernel source to build a kernel for XZ2. Will probably patch it to get it work with latest magisk+add Camera fix. No need to patch the dtbo when you are on stock.
[Sony Xperia XZ2 Questions & Answers] Sony92:
I have to ask again, my english is not so good. you want to develop a kernel. Can you please inform me, if you have a fix regarding the drm?

I have the last magisk version on it. Does this fix a camera, or do I need the extra?
[Sony Xperia XZ2 Questions & Answers] janjan:
Yes I will build a kernel/boot.img for XZ2. What happen with camera after unlocking your bootloader? Does the camera work? Or it is broken?

I will do my best to get it work.. if it is not working anymore. I have to find a way for flashing a patch. Since there is no TWRP for XZ2 yet.

Actually you need to flash my kernel + a patch to get the camera back. I will let you know when the kernel is ready.
[Sony Xperia XZ2 Questions & Answers] Sony92:
the camera stays black. the video function I think, but only bad. has jerked and hung.

Are there any more functions that are not possible anymore due to the missing drm keys? at the z5, I think I have read that the noise reduction from the headphone connection was no longer. but there is no such belief in xz2. But are there other functions that are no longer available due to the missing drm keys? and if so, can you restore them all?
[Sony Xperia XZ2 Questions & Answers] tonev:
You can enable OEM unlocking in settings that way you can easily root your phone
[Sony Xperia XZ2 Questions & Answers] janjan:
After a lot of work and fixing..I successfully build a kernel + dtbo for XZ2.

Now I have to find a way for flashing a patch to get the camera back (DRM fixer patch). Since you have already installed magisk it means you can actually need to push the patchs files to your device and the apply with the correct permission. Some other zips (module) can be installed through magisk settings. I will write a short instructions how to flash the kernel + dtbo and then how to apply the DRM fixer patch to get your Camera function back.
[Sony Xperia XZ2 Questions & Answers] Sony92:
great. more functions of the smartphone are not actually lost? because I do not know exactly which functions are all gone by the lost drm keys? Do you put that online?
[Sony Xperia XZ2 Questions & Answers] janjan:
As much as I know/experience only the camera fuction gone( the Camera output is greensh or black picture) This also happen with XZ1, XZ1 Compact, XZ premium and some other models.
[Sony Xperia XZ2 Questions & Answers] Sony92:
Can you please give me another note when you put the file online? Have a second question, do you think that the sound quality of the XZ2 is much worse than with a smartphone, what has the jack installed?

---------- Post added at 12:41 PM ---------- Previous post was at 12:07 PM ----------

Can you please give me another note when you put the file online? Have a second question, do you think that the sound quality of the XZ2 is much worse than with a smartphone, what has the jack installed?
[Sony Xperia XZ2 Questions & Answers] mirhl:
This?

Widevine L1 very very likely.

Also, at least back in my Xperia S days, I remember bravia engine (x-reality now iirc?) used to depend on drm keys too.

EDIT: screen mirroring breakage also probably being a consequence of this

EDIT2: others allegations are "download music info", noise cancellation and other advanced audio features.
[Sony Xperia XZ2 Questions & Answers] serajr:
Great news bro! Congrats!!

Does secd still need to be patched with each new firmware releasing?
[Sony Xperia XZ2 Questions & Answers] Sony92:
are there any news about the release?
[Sony Xperia XZ2 Questions & Answers] janjan:
I don't know yet. We will see after a new firmware release.

---------- Post added at 11:35 PM ---------- Previous post was at 11:33 PM ----------

I will try to make a boot.img and write a short instructions later or tomorrow. Have be busy all the day.
[Sony Xperia XZ2 Questions & Answers] serajr:
Thank you! :good:
[Sony Xperia XZ2 Questions & Answers] MartinX3:
Dear developers,

Are there any news belonging your hard work? :)

I hope this. Work will be the source of a stable lineage OS Rom.

And I also hope that sony will add every xz2 variant to its open source program. :D
[Sony Xperia XZ2 Questions & Answers] Nidhal AKA the king:
I personally don't see any needs for unlocking your bootloader, unless you have a convincing reason(s)
[Sony Xperia XZ2 Questions & Answers] MartinX3:
The reason is to develop/install a custom rom.

You could already use the treble android images. But at the moment, there is no drm fix.
[Sony Xperia XZ2 Questions & Answers] niaboc79:
When the drm fix will be done, I'll be able to build my eXistenZ rom :cool:
[Sony Xperia XZ2 Questions & Answers] istux:
LOL... I'm not the least bit surprised that the camera can't work anymore!

Thank you Sony :D
[Sony Xperia XZ2 Questions & Answers] nreuge:
Not the less convincing reason!! :D

This is not acceptable!!

UB disable the Bionz engine since it is DRM protected, but the camera app should still work!!
[Sony Xperia XZ2 Questions & Answers] nasko_spasko:
Sources available!
[Sony Xperia XZ2 Questions & Answers] janjan:
Time to build custom recovery ;) crossing finger
[Sony Xperia XZ2 Questions & Answers] MartinX3:
Hope the H8296 will be added soon, too.

(6GB Asia Dual Sim Edition).
[Sony Xperia XZ2 Questions & Answers] nasko_spasko:
Sure it is! That's what I'm doing tonight, too.

ROMs will wait, though... No vendor image released from Sony, yet.
[Sony Xperia XZ2 Questions & Answers] janjan:
Kernel + dtbo are done (stock dtbo should work too)..Now need some info about following to start working with twrp. For now...

- fstab (block or partitions)

If someone are going to share, it will speed up the process.

I will upload the boot.img if anyone wanna test.
[Sony Xperia XZ2 Questions & Answers] Sony92:
​

I like to test both. twrp recovery and the kernel.
[Sony Xperia XZ2 Questions & Answers] nasko_spasko:
There's a very good TWRP porting thread, here on XDA. I'm sure you'll find it easy enough. You don't need much in order to make it work, we have BoardConfig.mk in the device tree on GH.

Edit: Here it is: Thread
[Sony Xperia XZ2 Questions & Answers] nreuge:
And what about the DRM patch? Difficult??
[Sony Xperia XZ2 Questions & Answers] mirhl:
According to sToRm//, yes it should.

But who knows how drm is handled on Tama boards.
[Sony Xperia XZ2 Questions & Answers] janjan:
Have already a solution for that..hopefully..But we need a custom recovery first. Seems Sony just release another source for XZ2.
[Sony Xperia XZ2 Questions & Answers] MartinX3:
Which source do you mean?

The github repo didn't got updated since 3 days.