yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] wee2000:
Thx for the input, am looking at the page right away.

in the download website https://downloads.nanolx.org/NanoDroid/Stable/, i saw patcher & few nanodroid packages. some bigger filesize without microG in its filename.

Do i use NanoDroid-microG-22.5.1.20200102.zip or NanoDroid-22.5.1.20200102.zip?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
Doesn't really matter. microG and Play Store is included in both packages. With the full package you don't need to download the patcher seperately; it is included there.

I always used the package with microG in the name because i only needed microG and not more. I'm not completly sure whether the Play Store will be installed by default. It could be that you need to edit the setup file.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] wee2000:
hi, device bricked again(keeps restart at Sony) after installing patcher for NanoDroid-22.5.1.20200102.zip. it has error message 'patcher only works for de-odexed'. Befor this, i did tried to install Gapps in TWRP, but after install, when i reboot into system, there were no gapps seen. I'm starting to flash back to stock & try all over again. Really don't know when is the right time to install those gapps/microG.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] wee2000:
i tried to use google gapps instead, thinking it would be more compatible, but still cant install it. may i know what have i done wrong?

1- flashed full stock ftf

2- then flashed aosp without flashing userdata.

3- I booted up aosp once, then adb reboot bootloader

4- after reboot I flashed userdata img

5- without rebooting the device, I typed fastboot boot twrp.img

6- after it booted up I flashed TWRP permanently through TWRP.

7- rebooted to recovery from TWRP and it booted up

8-flashed open_gapps-arm64-9.0-nano-20200103, then i wipe dalvik

8- reboot to system

phone rebooted into system, but no gapps found
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
You could try to deodex the rom manually using the tool TOAD.

Then the patcher could work.

Or you change to MartinX3's Omnirom. It has Signature Spoofing Support out of the box so you can install Nanodroid directly.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] wee2000:
1-dloaded omnirom

2- then flashed omnirom without flashing userdata.

3- I booted up to system once then adb reboot bootloader

4- after reboot I flashed userdata.img

5- without rebooting the device, I typed fastboot boot twrp.img

6- after it booted up I flashed TWRP permanently through TWRP.

7- rebooted to recovery from TWRP and it booted up

8- flashed NanoDroid-microG-22.5.1.20200102, reboot to system

9- phone keeps rebooting into twrp

It wont boot to system.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
Did you flash OmniRom directly over SonyAOSP? If yes it could be the problem.

To be honest your flashing procedure regarding userdata.img sounds a little bit strange to me. Give me some time. I will test the newest Nanodroid on my XZ2 Dual and post the steps in the OmniROM thread when it works.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] wee2000:
i did flashed omnirom directly over AOSP, now i'm trying to start all over again from scratch, from stock rom.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
I've done a little testing. Look at the OmniROM thread.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
We definitely need a guy who post the gcam app for our phone to get good pictures. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] ELgaboEl11:
Xz2

I guy but for install aosp Rom in my xz2 i Need the twrp? Or only bootloader unlook and i flash in fastboot and stop? Please help
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nasko_spasko:
[MENTION=6031898]MartinX3[/MENTION] I'm sharing my archive with the h8216 build. The dual sim build version can't start the radio on my device. Hope u don't mind posting the link here. Feel free to share the file. :) There's a handy flash-all shell script I use for convenience.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Flash everything in fastboot.

The userdata.sin, too.

It will factory reset your phone, but that will be needed, to avoid crashes and bugs, etc.

You can backup your apps with Titanium Backup and your Accounts/WiFi Passwords, etc with the Google Account. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Oh ****, I hoped it would simply show an unusable second sim card slot on single sim devices. :(

I can't remove/edit the poll to ask the people for which device I should deliver dual and single sim versions. :)

Or I don't find the option.

Thank you for providing the single sim version for the XZ2. :)

I will upload it on the same Mega account, so we have one place. :)

Edit:

I modified your installation script to make it usable on custom linux systems. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Added the XZ2C Single Sim Version, too.

I won't backup older ROMs, after I uploaded a new version.

I have only limited space and more space costs a monthly fee.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] hary232:
https://www.xda-developers.com/google-camera-port-hub/

This might be a good start :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Thank you for your help, but there is already a page like this somewhere else. :)

But we need guys which knows something about C low-level device development. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] hary232:
Do you mean this?

https://xdaforums.com/xperia-xz2/themes/mod-gcam-generic-porting-t3825597
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Yes, he tried to use the OnePlus 6 GCam Port on the XZ2.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] alexandroid5:
[MENTION=6031898]MartinX3[/MENTION] i'm willing to maintain AOSP for XZ2 (H266) for you if you want. I'll run Linux in a virtual machine and make monthly builds. Not a pro on linux but i know my way around. I just need to make sure camera still works after unlocking bootloader with Sony tool?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Thank you :)

But I run Linux natively. :silly:

I don't want to waste your computer performance, specially with a virtual machine.

Building the XZ2 single Sim on the same machine would be needed too, to use the build cache.

A better solution would be to write a travisCI script.

It is for free for open source projects.

They are also allowing free caching for open source projects since 2016.

I think they getting enough money from private users, like GitHub.

I am happy, that they support OpenSource, too. :)

The main problem would be the online storage space to keep previously monthly builds of the ROM. :)

About the camera problem:

You will loose your camera on unlocking the bootloader, but you can use XperiFix to restore your camera.

At the moment, you will need to downgrade to OREO, use XperiFix, take a camera photo and upgrade to PIE to be able to use your camera in PIE.

It's a workaround.

We still need a working DRMFix for PIE to get our noise reduction back. The XperiFix developer is working on it.

At the moment, we get the same camera quality like on the AOSP build (after the camera bugs got fixed).

To raise the camera quality on stockrom = We need XperiFix for PIE.

To raise the camera quality on AOSP = We need a GCam port for the XZ2.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] alexandroid5:
i tried to install linux natively but i couldn't figure out what setting on my mobo was preventing me from installing it :silly:

i run it in virtual machine and its smooth, i have i7-7700K 16GB of ram and GTX1080

Does camera preview work on AOSP? or is it black without the DRM fix? i'm already on Pie. i dont want sony software anymore, i want AOSP or custom rom like Lineage OS

i currently have 100GB on google drive (about 80GB free)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Fs00:
So this piece of news is not true? I've recently bought a new XZ2C shipped with Android Pie, and if I didn't misunderstand the article I linked, camera should still work after the unlocking procedure.:confused:

And how could I downgrade to Oreo? Is there a guide somewhere? I thought it wasn't possible.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
The XZ2 is different.

And that the author named the XZ3, too, which can't be unlocked, shows me, that he simply listed every device, without testing each.

There were people in this XZ2 forum asking for help for their not working PIE camera. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Maybe fastboot or secure boot. :)

I use an second hand ThinkPad T460P I shot incredible cheap on eBay in an auction, because nobody other tried to buy it. :silly:

I7-6700HQ with 32GB RAM and a GTX 940MX.

I still feel like a lucky bastard, because it helps me much in my I formation studies at the University. :victory:

I want AOSP, too.

But we still need to install the monthly stock firmware Updates, because it patches the bootloader, baseband (mobile network drivers), and the partition layout.

:)

I am working on letting https://travis-ci.org build AOSP for free for me, because it's a open source project.

But the gdrive space is amazing. :)

Would you like to mirror the builds the travis-ci builds online? :)

To raise the camera quality on stockrom = We need XperiFix for PIE.

To raise the camera quality on AOSP = We need a GCam port for the XZ2.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Fs00:
[MENTION=6031898]MartinX3[/MENTION] So saying that the "XZ2 is different" implies that unlocking the bootloader may not break camera on XZ2C with Pie?

And what about downgrading? Can you post a link where I can find some useful information?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
In the download link, I uploaded the latest OREO firmware for the XZ2C. :)

You first need to downgrade, then install xperifix (vendor & a/b mode, without installing twrp in xperifix, only magisk).

Then booting into OREO, taking a picture with the camera.

Then upgrading to PIE.

You will loose the noise reduction, but the camera preview still works.

The same quality like on AOSP without a GCam port.

Since the TAMA devices (XZ2 devices) you won't get green pictures, only the camera preview and the noise reduction are stopping working.

But the camera preview continues to work on PIE, if you used a DRMfix on Oreo, before upgrading.

The camera preview continues to work on OREO, too, if you used the DRMfix for one picture and removing it after it.

It is weird, but the TAMA devices are a new generation.

I am on PIE (need to test TWRP with it and get the encryption to work) and can take pictures with my camera. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] alexandroid5:
i checked those settings, it was giving me some USB error on ubuntu installation. I ended up giving up and running ubuntu in virtual machine. It's running great and i already started setting up build environment following Sony's AOSP build guide.

Are you running AOSP? or do you know how well it runs? i don't take many pictures with my phone so i kind of just want to flash AOSP already.

I'm currently looking into Travis-ci, you can have that website build for you so you don't need your own computer to build?

Couldn't we use the gcam port from any other phone that has the snapdragon 845 and is running AOSP rom?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
It is smooth according to my testers :)

And the bugs are tracked in the bug tracker. :)

Yes, it is a continuous integration service. :)

I will look into it too and create a repo this Monday, if I am fast enough :silly:

And the Travis should copy the compiled files to my mega.nz cloud storage via the mega.nz API.

But I need to look into it, too.

And the build cache b to be cached.

That's easier than getting the twro encryption to work, in my opinion. :silly::silly::silly:

You could try that, but I heard the xz2 got a special camera chip. :silly:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Goodtwo:
First of all thank you a lot for your work and engagement MartinX3 :D

I was successful installing TWRP and Magisk so far. Now I want to install AOSP on top of it.

I have a question concerning the AOSP ROM. The files in your step by step usage explanation are all there, but one. the oem file is not there. Do I have to get it somewhere else or dont I need it?

Besides that a general question, what are the benefits of AOSP actually?? With my old smartphones I removed every trace of Google services even the Google gms, play services, Framework, webview etc. F-Droid + for some apps Yalp Store, gives you a totally normal smartphone experience without the need of Google. Will I be able to achieve it with your AOSP ROM now or in the future?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Thank you very much :)

The OEM file is in the universal folder. :)

The AOSP supports the complete Camera API 2

It will get longer updates than the stock firmware

It will be faster, lighter, more battery saving, than stock.

The open bugs are in the bug tracker. :)

The TWRP is not compatible, because it needs to get the AOSP kernel.

Treble splitted the kernel and the dtbo in different partitions.

I don't know why, because they need to match or a boot won't be successful.

Sadly Sony removed the function in the bootloader to load a dtbo integrated in the bootimage.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
That's my first try on building AOSP via travisCI.

https://github.com/MartinX3/android_device_sony_tama_aosp_build_service

Deploying is not implemented at the moment, because I want to try the building first.

I included the single and dual sim variants of the XZ2/XZ2C/XZ3.

The XZ2P is not supported by the Sony AOSP because of its custom camera.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Fs00:
Thanks for the thorough explanation! So you can downgrade without unlocking the bootloader, or did I misunderstand something?

However, I have the single SIM model of the XZ2C, do you know any places where I can find stock ROMs?

Sorry for my dumb questions, but it's my first time with an Xperia and I want to be sure before doing anything potentially phone-breaking. :o
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
You're welcome. :)

You can downgrade and upgrade and install every sony signed stock firmware on your locked device. :)

You could wait for the December update, it should fix the bootloader unlocking. :)

Downloading stock firmwares = Xperifirm (search on XDA) & Xpericheck.com

Downloading custom stock firmwares by XDA users = look into the ROM section of your device. :)

And please inform yourself about XperiFix :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] azaz2010:
Hello, I must to downgrade to Oréo before flashing?

Everithing work on the XZ2c?

Is the first time for me that I'm not sure to flash my phone
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] FcukBloat:
seems so if you don't use camera;)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Wait for the december stock update, then you will be able to unlock the bootloader.

And please follow the exact installation steps.

And please follow the bugtracker linked on the first page.

XZ2C is TAMA APOLLO.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] alexandroid5:
i was able to unlock bootloader on pie on my xzz2 h266 but lost camera preview :silly:

i should be getting a replacement device within the next 2 days lol. i was never able to get the camera to work on AOSP? is that a bug? or was it cause by unlocking bootloader in Pie?

either way i just realized if you break camera preview, it completely breaks snapchat due to the fact that snap developers are lazy and use a screen capture of your camera instead of the actual camera. Any other camera app works just with the same black preview issue.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Shani Ace:
I just landed here - after I realised that the XZ2 compact would fit into a Boxwave keyboard case (for the iPhone 6) that I have - and was surprised to see that there's only one ROM available so far (but hey, at least it's an AOSP one ?).

Is that because the device is still relatively new or is there just not that much dev support for it?

Anyway, glad to see someone is making a ROM for it, hopefully the December update will be out by the time I got my hands on a XZ2 compact. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
:silly:

On AOSP the camera works after the bugs from the bugtracker got fixed.

On stock rom you need to use xperfix on an Oreo ROM , shoot a picture and upgrade to PIE. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
[MENTION=6031898]MartinX3[/MENTION]

Hi have a few questions before i probably buy my xz2.

1. I read some posts ago that your aosp isn't compatible with your rom. So am i right that i can install it only via fastboot? And is there any possible solution for this in the future? I'm asking because the most custom roms will be installed via twrp and i don't to buy this device when that incompatibilty holds the custom rom development (i'm thinking particulary at the time when sony doesn't support the xz2 anymore.

2. Can i install Magisk via your twrp or must this be done via the patching over the Magisk Manager?

3. How can i update the rom when you release a update? Just take the build and run again the commands which you mentioned in the first post?

4. Unfortunately i don't have any experience with a/b devices because my z3 is too old to have this feature. So my question is whether i must care of anything when i would flash your rom.

And you mentioned in the twrp thread that you suggest to update the stock system for partition etc. when there is a new update from sony.

When i understand it right i would have two systems when i would use your Rom (once aosp rom on for example slot a and stock system from sony on slot b).

So can you explain/inform me how i should handle this two systems regarding update. I don't want to break the stock system or aosp rom when there is a update from sony.

Sry for my long post and please be patient when some of the answers already answered.

I just want clarify that mentioned points because the phone isn't so cheap.

Thanks in advance for the answer.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
1. AOSP = ROM

I would need to create a TWRP for the AOSP ROM, too.

Btw. I think I only need to replace the kernel with the one from this ROM.

Because we don't have a seperate recovery partition and the DTBO got splitted from the kernel in its own partition.

That's trebles fault and every device starting with OREO has this problem.

But I think it is Sony's fault, that the removed the support in the bootloader loading a Kernel/DTBO hybrid like in the past.

But maybe this got deprecated by Google and they only removed this deprecated function. (Seems likely, treble looks like it)

But that won't stop custom rom development.

You can build a custom rom with TWRP buildin. So no extra installation would be needed.

I don't know if this is possible with AOSP but it is possible with LineageOS and OmniROM.

Maybe someone show me a way to use the terminal stock recovery to install the TWRP installer zip file.

Maybe I only need to fix a little thing in it.

So I don't need to create a stockkernel installer zip and an TWRP.img file.

2. Of course both ways working.

3. Yes. If you want you could switch the slots via fastboot before upgrading.

4. Nothing special for you, only for us (providers & developers), the rom will be simply installed on your device. :)

You should do it on every device since you can use custom roms on your device.

It updates your modem, your baseband, your mobile network drivers.

Thanks to treble you could of course install the sony system on Slot B and this AOSP ROM on Slot A.

But you need to boot the sony rom one time to update the BASEBAND (Mobile Network drivers).

This means, you need to backup your userdata and wipe them first.

After sony does not update your phone anymore, you don't need do this procedure anymore.

And Sony AOSP will get longer suppported than the Stock firmware.

You will get a new kernel and a new Android OS.

As example, the XZ Premium has only a 4.4 kernel in the stockfirmware, but got a 4.9 kernel in the sony AOSP.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
First thanks for your detailled answer.

Will i get a error message when i unlocked the bootloader and boot the stock system? And i guess which system will be booting depends on the selected slot, right?

And when i want to update your rom or the sony rom it isn't neccessary to manuall change the slot. Did i unterstand that right? I want to be sure that i don't break one of the roms when i update one.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Of course the system will tell you at boot time, that you unlocked your bootloader.

You will need to update the slot via fastboot one time in a month to upgrade and boot the sony stock rom. :)

And clearing the userdata.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
Via the stock rom factory option?

And to remain the data (dependless from stock or aosp rom) i could use Titanium Backup, right?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Or Fastboot, or recovery.

And yes, of course. Google Backup and Titanium Backup.

I use both.

TB for the Apps and Google Backup for the Accounts
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Why you should install stock updates.

https://github.com/sonyxperiadev/bug_tracker/issues/258#issuecomment-444383909
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Sadly it is not possible to use a free CI system, to build the AOSP images in the cloud.

As example TravisCI gives me 30GB space, but I need about 250GB.

Because the wonderfull repo tool / git wants to download every previous git repo branch.

But building it on my Laptop is no problem.

Btw. it is more efficient to build the SMD845 devices from sony on the same computer, because of the shared build cache.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Haldi4803:
While I've made about 3-4 OTA's on this phone I've never once unpacked the OTA.zip.

On HTC you get a firmware.zip which can be flashed in Stock recovery to update Firmware only.

How does that work on Sony?

Would it be possible to update firmware separately while keeping AOSP as ROM with Userdata intact?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Feel free to open an Issue in the bugtracker to ask jerpelea.

It would be interesting to know. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] twistedddx:
Newflasher could flash firmware packages.

Just don't flash system or userdata etc.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] hary232:
Did you try repo sync -c ? It won't make it 30GB i guess. but i expect some reduction..
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] laoli0913:
Find an interesting problem. Does akari support 1080 120hz?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Thank you, but sadly this command gets ignored.

It still downloads every branch. :silly:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I don't like to find problems, even the interesting ones. :silly:

But I like to find solutions :p

As far as I know the display of the XZ2 supports 120hz, but it never got activated.

And please don't ask me how to activate it. :silly:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
Hey a little new question: When i unlock the bootloader the ota update function will break right?

For that case i want to know with which tool (probably newsflasher but i want to be sure) i can flash newer firmware versions and where do i get the Firmwares of the xz2.

Thanks in advance.