yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] JeffLeeXZ2C:
stock bootloader

Hello. Is there still no working twrp for 52.0.a.11.32?

Then I want to rollback to stock bootloader but can't find it. :crying:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nico_dh:
thanks!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
I'm not completly sure whether i understand you correctly but the bootloader is part of stock rom which can be flashed with Newflasher.

So from my point of view you can flash the stock rom again or only the bootloader files. Both installs the standard bootloader which comes from sony.

PS: It would be new to me when there are custom bootloader for sony phones:confused:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nico_dh:
Martin, just another question,

i downloaded your customized 8.0 android rom (from android host....) and inside the boot folder there are several .sin files (they all are 17.7 Mb size).

Which one of the 3 of them should i flash?

1- bootloader_60_X-FLASH-ALL-AE08.sin

2- bootloader_X_BOOT_SDM845_LA1_0_O_60_X-FLASH-ALL-7405.sin

3- bootloader_X_BOOT_SDM845_LA1_0_O_60_X-FLASH-ALL-B6B5.sin

thanks.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
If you want to make your phone unbootable for 9.0 ROMs, please flash them all.

But I don't support it.

I either don't understand why you want to downgrade the stock pie version 118 bootloader from Sony to version 60 oreo
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Hingbong:
is this fixed?

can i update to 52.0.a.11.32 and use twrp as usual?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nico_dh:
Because, when i upgraded to 9 i lost the camera preview. So i followed the downgrade to 8, and then (my fault) i ****ed the boot. So now i'm in android 8.

You say that if i flash android 9 i will have the camera preview? (i tried before following the first page from this post).

thanks.

So i flashed a stock 9 pie downloaded from experifirm, and managed to go into twrp, and then install the camera fix from Martin, now everything seems to work. :)

Thanks!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Sadly the missing security backports into 9.0 of my omnirom build environment preventing this at the moment.

But I am sure I will bring a solution in the future.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MicheleM:
Hi there, I am quite new in this forum and i am a beginner. I have some problems following the steps to install the TWRP in my XZ2 compact (H8324 with latest rom: 52.0.a.11.32).

There is probably an easy fix but I can't figure it myself and I can't find a reference to that problem on this thread.

I managed to unlock the bootloader, flashed vbmeta, and boot into TWRP via fastboot (without flashing it). In TWRP I then open "install recovery ramdisk" and there I get stuck.... I can only see a bunch of encrypted folders and cannot, therefore, have access the internal storage to select the TWRP.IMG file which I previously saved in my phone. Did I miss to do any steps in the process? How do I decrypt the internal storage so that TWRP can read it?

Thank you very much for any answer and for all your interesting contributions!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
Look at changelog from 17.11.2019 of this thread. The twrp for this stock version can't decrypt the internal storage.

So there no way to get access to the internal storage with the stock twrp in combination with the 52.0.a.11.32 firmware atm. Nevertheless sdcard access should still work.

And as stated in the changelog the Installation of stock twrp via recovery ramdisk leads to a stuck atm.

You can only boot the stock twrp and access files which are on the sdcard at the moment.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MicheleM:
Thanks a lot. You are right. I did misinterpret that changelog, indeed.

Do you confirm that I can still install Magisk just by booting into the stock TWRP? In this case I would have to use an external SD card, I guess? The "sdcard" folder of the phone it is also encrypted... it only shows a list of folders having long names of random letters and numbers.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
Magisk patches the boot image which isn't affected from the encryption. So stock twrp should be able to install Magisk (if you place the Magisk zip on a external sd card as you guessed).

Be sure that you use the newest Magisk (i believe atm it should be 20.2).

Versions at 19.x had boot problems with xperia devices.

Or you extract the needed boot image from the stock Firmware and use fastboot to patch it via Magisk and pull it back.

I know there are tools on xda for that.

You need a sdcard which is configured as portable storage; don't use the option 'format as internal storage'. I believe the sdcard is part of the internal memory in your case.

That would be a explanation why the /sdcard partition on your phone is encrypted.

Edit: I just checked my old z3 phone which is encrypted too and have a sdcard from Sandisk. And the external sdcard from sandisk is mounted as 'external_sd'; not 'sdcard'.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] wee2000:
may i know what is the meaning of "(Optional; If you modify the system or need the camerafix.zip)fastboot --disable-verity --disable-verification"?

I am running your AOSP 9.0 R46, bootloader unlocked.

I wanted to install gapps & hopefully, get a camera that works better.

---------- Post added at 08:04 AM ---------- Previous post was at 07:55 AM ----------

when downloading, inside MartinX3/Root/Android_9/Twrp folder, the is only 1 file, 2019-08-10_17-49-19_twrp_sodp_xz2.tar.gz.. Can it work on AOSP? Bacause I saw the filename has 'sodp' in it..
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
That optional command is linked to AVB (Android Verified Boot) which Google introduced in the past.

Basically it's security feature to prevent unauthorized changes at the stock system and it blocks the android boot. To boot android in that case you need the vbmeta with the mentioned commands as far as i know.

Yes. The twrp with sodp in the name is for custom roms which includes the SonyAOSP from MartinX3 which you are running.

PS: It's mayby a little bit off topic and i don't whether it works on SonyAOSP but when your main interest is to get a better camera (as GCAM) or only want a few Gapps you could try microG over Nanodroid.

It's a open source implementation of the Play Services and not so much privacy invasive as the normal Gapps Package. And the GCAM could mayby works, too.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] wee2000:
When i try to boot to fastboot, via adb reboot bootloader, the phone is booted successfully with blue LED. but my Win 10 PC doesn't recognise it. I tried to perform auto update of driver, but windows cant find it. I also installed USB driver from flashtool folder, but the Google driver failed. Has anyone here able to get the driver? Kindly refer screenshot.

Im on Win 10 Home 64-bit, Version	10.0.18362 Build 18362
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] wee2000:
when i use the first command,

fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

i got error

C:\adb\fastboot.exe: unknown option -- disable-verity

---------- Post added at 10:09 AM ---------- Previous post was at 10:04 AM ----------

update:

i got twrp installed. my bad for sending wrong command, was supposed to be

fastboot flash vbmeta vbmeta.img without " --disable-verity --disable-verification"

but when i reboot into system, the phone will stuck at

'your device is corrupt. It cant be trusted. Will power off in 5 secs'

the device is bricked again. May i ask how to revive it?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] spyps:
you need to replace the .inf file of Google driver with developer.sony.com/file/download/fastboot-driver/

and follow this guide to disable driver siginature enforcement,

windowsreport.com/driver-signature-enforcement-windows-10/

Then you can install the fastboot driver and unlock bootloader.

It took me 2 hours to figure this out yesterday. The official unnlock guide on Sony website should be updated since it just tells you to use google driver

I can't post link. Sorry for the mess.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] wee2000:
i downloaded the inf, but it doesnt work. error message 'the system can't find the file specified'
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] wee2000:
Hi, i fixed the error by installing stock ROM, the AOSP 9.0, then boot TWRP - flash TWRP - boot to internal TWRP, flash microG, reboot to system.

The step that bricks my phone is I didn't reboot to TWRP after flashing it.

Now i had already installed microG, but didn't see the playstore.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] spyps:
spyps

I can't see the image you posted, maybe due to my low privilege account. Do you replace the inf file with the one in google usb drive? You may try the google usb drive here: developer.android.com/studio/run/win-usb.html (first link pointing to a zip file), which is recommend by the ofificail unlcok guide ( developer.sony.com/develop/open-devices/get-started/unlock-bootloader/how-to-unlock-bootloader/#tutorial-step-1)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] wee2000:
i downloaded the inf & in device manager, i point it to that inf. Anyway, ill try is soon, thx for the reply.

On a sidenote, do u know how to revive the device if it just boots to twrp but not booting to system? Due to because i performed a factory wipe in twrp.. For now, i'm flashing it to AOSP 9.0 all over again, not sure if there were some quick fixes on it.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nikkdib:
android 10 is out!!! but sony doesn't add gestures... i have no words. we can flash with this version of recovery or we need an update? because i want to flash magisk
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Aghrrrr:
This TWRP is not supported for Android 10. Gets bootloop.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
No, the kernel is not compatible

I need to look, but first download the stock firmware and give a test build to testers.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nhtu1997:
i hope you debut the root and recovery for android 10 soon, Thank you very much
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MicheleM:
Which ADB tools did you use?

Try downloading and using these tools and repeat the operation running the full command (including the disable-.... part).

---------- Post added at 11:05 AM ---------- Previous post was at 10:59 AM ----------

Thanks a lot for all these hints! I will follow your advices. :good:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
I used always the latest from the Google dev site.

Link:

https://developer.android.com/studio/releases/platform-tools
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] PerfectJam:
Hello,

I just upgraded my XZ2C from Android 9 to 10, and I regret it, really really.

Is there any way to downgrade to 9 ? I think I have to unlock bootloader, install custom recovery, and flash a stock XZ2C Android 9 ROM ?

I guess it's possible even on Android 10 ?

Other question, I look into your Androidfilehost [MENTION=6031898]MartinX3[/MENTION], and I guess the good ROM is : H8314_Customized CH_1313-2247_52.0.A.3.84_R2B.tar.gz

I'm just a bit confused by the "Customized" word inside the file name tho :confused:

Thanks for your help !
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] krmaciek:
fastboot.exe: unknown option -- disable-verity

That was my case. You probably copied that command from browser or notepad. It might be converted, unicode, or something. Type the command yourself, or paste full command and then replace every "-". I mean delete and type every hyphen-dash by pressing that key directly within cmd console.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
That's a very old android 9 used as a workaround to fix the camera preview if you didn't used a DRM fix on Oreo before.

I will remove it later.

Please find an older version with xperifirm or with the Sony software Emma.

You don't need to unlock your phone.

But a fullwipe will be needed.

Which bugs did you got in 10.0?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] PerfectJam:
Can I downgrade to Android 9 even if my bootloader isn't unlocked ? I'll gonna check xperifirm then :o

The fingersprint is super slow, some retarded Google apps were installed, and some features disappear like fly mode into the night mode from Xperia Assist. Plus the dark Android theme is useless on LCD screen.

New : I just checked Xperifirm, I don't really understand how it's work, and it seems only latest version are available

New 2 : I think I find the stock ROM, not sure about the source tho. Now the question is, how can I flash it, Flashtool software from Xperia Firmware website works ?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] janolucero:
just tried android 10 and its beautiful! I'm on unlocked bootloader and the camera works just right. Sadly the playstore says my device isn't certified and don't let me download nothing, so i have to rollback to android 9.

Hope there's a workaround coming soon and your great twrp [MENTION=6031898]MartinX3[/MENTION]
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Better try Emma first https://software.sonymobile.com/www/

It is an official sony tool, but it runs only on windows.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] PerfectJam:
Heya

It seems I need an account activaded by a Sony provider...

I get this message : "Your email is verified! Don't forget to contact your Sony Mobile representative in order to enable the account. Please provide the username XXX"

Is there any other way to get an Emma account activaded ?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I just use the download link to download the newest weekly and install it.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] PerfectJam:
When I finish the installation, i got this launcher which ask me to log in... And I can't do anything :

Do you have a solution ? :o
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Oh ****, that is new.

Does this emma version work better?

https://developer.sony.com/develop/open-devices/get-started/flash-tool/download-flash-tool/
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Aghrrrr:
first method worked on me https://www.youtube.com/watch?v=k-xj8LpeT8s
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] PerfectJam:
Well it seems not working :

I plug my XZC2, my computer recognize my phone, but Emma doesn't. And I can't do anything on this software. By the way, on the website there is this message :

The flash tool for Xperia™ is actually called Emma, and today it runs on all Windows computers, with a few exceptions*. This tool is confirmed working for most markets globally**, with a few exceptions*** due to distribution restrictions.

* From Thursday, 6 July 2017 Emma will not function on Windows Vista. ** Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua & Barbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, Bolivia, Bosnia and Herzegovina, Botswana, Brazil, British Virgin Islands, Brunei, Bulgaria, Burkina Faso, Burundi, Cameroon, Cambodia, Canada, Cape Verde, Cayman Islands, Central African Republic, Chad, Chile, Colombia, Comoros, Congo (Democratic Republic of the), Congo (Republic of the), Costa Rica, Cote d’Ivoire, Croatia, Curacao, Cyprus, Czech Republic, Denmark, Djibouti, Dominican Republic, Ecuador, Egypt, El Salvador, Equatorial Guinea, Eritrea, Estonia, Ethiopia, Fiji, Finland, France (including Guadeloupe), French Guiana, Gabon, Georgia, Germany, Ghana, Greece, Grenada, Guatemala, Guinea Bissau, Guyana, Haiti, Honduras, Hong Kong, Hungary, Iceland, India, Indonesia, Iraq, Ireland, Israel, Italy, Jamaica, Japan, Jordan, Kazakhstan, Kenya, Kosovo, Kuwait, Kyrgyzstan, Laos, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macau, Macedonia, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, Martinique, Mauritania, Mauritius, Mexico, Moldova, Mongolia, Monaco, Montenegro, Morocco, Mozambique, Namibia, Nepal, Netherland Antilles, Netherlands (including Bonaire), New Zealand, Nicaragua, Niger, Nigeria, Norway, Oman, Pakistan, Palestine, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Poland, Portugal, Qatar, Reunion, Romania, Russia, Rwanda, Samoa, San Marino, Saudi Arabia, Senegal, Serbia, Sierra Leone, Singapore, Slovakia, Slovenia, Somalia, South Africa, South Korea, South Sudan, Spain, Sri Lanka, St. Kitts & Nevis, St. Lucia, St. Vincent & the Grenadines, Suriname, Swaziland, Sweden, Switzerland, Taiwan, Tajikistan, Tanzania, Thailand, Togo, Tonga, Trinidad Tobago, Tunisia, Turkey, Turkmenistan, Turks & Caicos, UAE, Uganda, Ukraine, United Kingdom, United States, Uruguay, Uzbekistan, Vanuatu, Vatican City, Venezuela, Vietnam, Western Sahara, Yemen, Zambia, Zimbabwe.

*** China, North Korea, Iran, Burma, Cuba, Sudan and Syria.

Is there any other way to downgrade ?

I tried with Flashtool and the build I linked before, it failed.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Or you find somewhere the last PIE firmware for your device to flash with newflasher/flashtool.

But if EMMA doesn't recognize your phone, it should be a driver issue.

Doesn't windows itself recognize the phone in fastboot/adb mode?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] PerfectJam:
I'm retarded, I was plugging the phone when it was switch on. I plugged in while it was shut off while pressing volume down button, and Emma recognized it.

However, my phone is locked (bootloader locked) it seems I need to unlock it to using Emma, it's in contradiction with what you told me :

Anyway, I have to unlock it cause I want to root it, it's not a big issue :D
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Interesting

Using Flashtool / Newflasher doesn't need an unlocked one.

It is weird, that EMMA needs one.

I hope it works for you well enough. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] PerfectJam:
I'm about to unlock the bootloader, I hope I wont brick anything !

Edit : For some reason, my computer doesn't recognize my phone in fastboot mode :o

Even if I follow step by step the Sony tutorial, when I type the "fastboot devices" command in cmd, I get no answer from the phone.

I'll try from another computer maybe
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
That must be the fastboot driver.

In Linux it would work out if the box. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] orapyt:
I think on windows you need to install the driver twice (once when it is booted normally and once when it is in fastboot). You can install it using the device manager.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] dhacke:
Well what exactly stands in the device manager of Windows when you plugged in your phone?

If there doesn't stand SOMC Flash device it's definitly a wrong driver installed.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] PerfectJam:
Fortunately, I have an old PC on Ubuntu, and indeed it worked super easely !

Now I gonna try Emma...

Edit : Aaaaaand it worked ! Thanks to all of you guys ! I'm back on Android 9 (build : 52.0.A.3.84) :D

Edit 2 : And I lost the camera, I mean, I lost the preview, it's black on camera front and back, but the preview work in video mode. But I can take a picture with camera even if the preview is black. Is there a fix ?

Step was :

- unlocking bootloader with my Ubuntu PC, my XZC2 was on Android 10

- Using Emma to downgrade to Android 9 (build : 52.0.A.3.84)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
This was the last build with the DRM change by sony.

You unlocked the device on a newer build (that's good, your camera didn't got lost), but the camera won't work before.

Maybe on oreo with an DRM fix.

Or you find somehow the newest PIE stock rom for your device.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] PerfectJam:
Thanks for answering, so I need to find a build higher than 52.0.A.3.84 and find a way to flash it ?

Emma and XperiFirm only display those version :

Edit : I found this build (52.0.A.11.32) on this website which seem more recent than 52.0.A.3.84. Indeed 52.03.A.11.32 is from November 2019 and 52.0.A.3.84 is from November 2018.

Si I guess I can use flashtool for update 52.0.A.3.84 to 52.0.A.11.32 ?

(Sorry, it's a bit a mess I know, but Sony smartphone is so complicated to root/unlock/flash, I'm used to use HTC and Samsung phone ! haha)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] amakuramio:
Extracting boot img android 10, manually patching it with magisk, then rewrite it should make root work, right?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Yes, the external magisk manager app patching should work.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] ASMstudent:
Can TWRP made for stock restore a backup made by SODP compatible TWRP?

Because it gave me error code 255
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] PerfectJam:
Or maybe I can lock back the bootloader, doing the OTA update one by one (if it's possible) and stopping before updating to Android 10, then unlock the bootloader again ?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
That's not possible.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
It seems that TWRP had a general backup & restore problem, as far as I heard.

But you shouldn't use the same userdata partition between different roms.

Better make a backup with titanium backup or migrate.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] PerfectJam:
Damned !

So can you confirm the build 52.0.A.11.32 is more recent than 52.0.A.3.84 ?

Should I try to install this version ?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Yes, that was the newest 9.0 version.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] PerfectJam:
I don't know what I'm doing badly honestly !

I flashed this ROM : Android 9.0.0 H8324 (build 52.0.A.11.32) with Flashtool and everything look working properly (you can find the log in attachment if you have time of course)

But my XZC2 stay now stuck on the SONY logo when I boot it. I messed up something but what, I don't really now...

EDIT : Ok I'm find ! I update with Emma to the build 52.0.A.8.131 and everything is working ! Thanks for the help ! :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] amakuramio:
But once twrp is released and I flash it, would I need to reset my data using format?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Why should you need it? :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Pandemic:
So far i know not need it u you did a clean install before update to android 10 :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] amakuramio:
I found a xz3 for 90 usd, touch works but glass is cracked, gonna install android 10, then unlock bl, install the DRM module from magisk? Then I should be fine?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Pandemic:
there is no drm for xperia xz2/xz3 for android 10 and without drm keys all works fine.