yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
Er spricht deutsch, welch ein Glück. :good: Habe ich denn nach der ganzen Prozedur (oder nach Flashen der CE-Version) eigentlich noch die Chance, dass Sicherheitsupdates durch Sony oder gar die Android 9 Version über die "offiziellen Kanäle" in mein Smartphone kommen? Oder müsste ich selbst für Updates sorgen (wie auch immer)?

By the way, Do I have any chance after this whole procedure (or after flashing the CE-version) that security updates or even Android 9 will be delivered to my smartphone through "official channels" by Sony? Or would I have to take care for updates myself (somehow)?

EDIT: Just tried to download and flash the UK-Version through flashtool, but after this there seems no new version being installed on the phone. Flashtool lists the old version as installed on the phone after reconnect. With the newflasher I also had no luck. There I get the following error when trying to flash the CE-Version of the firmware: No usb device with vid:0x0fce pid:0xb00b !

The included Driver is not beeing recognized by the properly installed Android bootloader interface-Driver. :( And when I start the phone with VOL-DOWN + PWR Buttons pressed newflasher shows error message: ERROR: Error CreateFile! failed with error code 5 as follows: Zugriff verweigert :eek:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Orphee:
No issue with DRM ?

How to flash a specific fw ? Newflasher ?

Thank you
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
A little update to my issue: I finally managed to flash the version from androidfilehost (H8216_Customized+CE1_1316-0773_51.1.A.11.51_R1A) - there was a conflict between access from newflasher and the sony flashtool ("Emma"). So as Emma was closed newflasher could do the work. After that I had to flash twrp.img and vbmeta.img again. Then the ZIP-files stockkernel-installer and twrp-installer. Then reboot to recovery, and... worked! :victory: Then magisk.zip and another reboot to recovery (only to be sure) - success. And then the exciting moment - reboot system. Took a little while, but - worked! :victory:

Thank you very much for your help.

Can you say anything about (security-) updates from sony after install of TWRP, after install of the new firmware version with newflasher and root-setup? (I was planning to set up root access, too)

EDIT: Unfortunately I had to find out that the camera isn't working. I only get a black screen from the rear and the front camera. But when I switch to video, I can see the camera picture. :confused:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] laoli0913:
Just use drmfix
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
Hi, thank you for this hint. I tried to find a drmfix for XZ2 oreo firmware, also tried to find an answer studying many pages of this long thread, but the only one I could find seems to be for pie: https://xdaforums.com/xperia-xz2/themes/pie-camera-fix-android-pie-fw-52-0-3-126-t3878653 Do I have to use this one also for oreo, or do I have to use xperifix or do you mean an completely other one?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
You will.

In Android 8 we got Xperifix.

But it's still not available in Android 9 :)

By the way, if you unlocked your phone after .126 firmware on PIE camera should continue to work (without noise reduction)

Yes, newflasher.

You can flash any firmware region, but China and USA may not work. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
OREO needs xperifix :)

Phones unlocked since firmware .126 on pie doesn't need a fix, but noise reduction is deactivated.

Phones unlocked before .126 need the liked camera fix :)

And of course only the latest pie firmware has every security fix :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
Thank you for these informations. I also read that there will be the magisk permissive module needed later on. What exactly does that mean? Do I bypass every security feature of android with this module, so that using the phone under normal circumstances makes no sence anymore? (https://xdaforums.com/apps/magisk/module-magisk-selinux-permissive-script-t3577549) If so, is there any other possibility to get the camera to work without using this magisk module after xperifix (even if that means to use Android 9 firmware version)?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] serajr:
There is. Take a look at the posts #1754 and #1767 of this thread.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
I am sorry, but I have another issue... I cannot perform a backup with TWRP. It reports "Prozess createtarfork() endete mit Fehler: 255". After downloading the file /tmp/recovery.log and investigating the particular entry I found out, that it had something to do with the /data/data dictionary.

I:Error adding file '/data/data' to '/sdcard1/TWRP/BACKUPS/QV701EZE1B/2019-01-13--13-23-03_511A1151/data.ext4.win000'
Fehler beim Erstellen der Sicherung.
I:ERROR tarList for thread ID 0
Fehler beim Erstellen der Sicherung.
I:InfoManager saving '/sdcard1/TWRP/BACKUPS/QV701EZE1B/2019-01-13--13-23-03_511A1151/data.info'
Prozess createTarFork() endete mit FEHLER: 255
Sicherung fehlgeschlagen, bereinige Sicherungs-Verzeichnis

Looking into that folder through TWRP showed many encrypted folders. So I thought it could have something to do with the device encryption. That encryption seems to be activated by default, and cannot be deactivated as far as I know. Is my assumption right, and if so, what can I do to make a full backup through TWRP? :eek:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] shoey63:
I'll reply to share my experience.

- I bought xperifix by [MENTION=8363210]sToRm//[/MENTION], downgraded to oreo with Newflasher and applied it plus permissive magisk module. Camera worked with no issues.

- Upgraded to Pie .126 to find camera broken.

- Replaced Vendor files as per this thread https://xdaforums.com/xperia-xz2/themes/pie-camera-fix-android-pie-fw-52-0-3-126-t3878653

- Camera works again. No drm fix, no magisk module and as far as I can tell, noise cancellation working.

Note. Some users who previously used a hacked "Chinese" drm fix have reported noise cancellation no longer works.

The choice is yours......
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Decryption support takes it time :)

The needed code is still in the testing stage and not merged with the mainline TWRP. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
Thank you for your answer.

I opened a shell in system and entered your commands:

su
mount -orw,remount /vendor
magiskpolicy --load /vendor/etc/selinux/precompiled_sepolicy --save /vendor/etc/selinux/precompiled_sepolicy "allow init domain process { noatsecure }" "allow init secd process { noatsecure }"
mount -oro,remount /vendor

After this I rebooted, and the booting process hangs at Sony logo now.

EDIT: Should this work before or after using XperiFix? Or should XPeriFix not used at all after executing these commands?

---------- Post added at 03:58 PM ---------- Previous post was at 03:06 PM ----------

This was my fault, I must apologize. I did not recognize that the passwort query that is displayed when TWRP starts

IS

the decryption of the data that has been encrypted when applying a PIN for lock screen. So after entering this, TWRP works fine again and peforms a full backup without problems! :good:

The only issue that remains is the one with the camera, as I have some doubts about that Magisk module for permissive setting. Unfortunately the commands posted by serajr did not work for me. Is there no other possibility to get the camera to work again? I don't know which issues I will face with if I was "upgrading" to Android 9 (however to do that except from just flashing the Android 9 firmware)...
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] serajr:
After the fix, and try to proceed with magisk permissive module still installed (up and running), be sure camera is working, too. And before you reboot the phone, uninstall the permissive module.

Also check 3rd post's

"Installation Hint"

.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
Ok, thank you. I will try it. Do these commands fix the cause for the camera issue, or is it just more as integrating the module to Magisk itself? If it is more like an integration to Magisk, this would not solve the problem of app rights, that also persists if module is installed, would it?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] serajr:
Drmfix uses a variable (LD_PRELOAD) which do need some selinux rules to work, and these rules are marked as "denied" by default. The permissive magisk module ends up allowing any new selinux hack to be made (and other stuff, too).

The command lines in my post will inject into the pre-compiled selinux only the two rules needed to allow drmfix working.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
Ok, thank you for this explanation. This makes definitely sence. Do I have to switch back from progressive mode in the module before I remove it from Magisk (wondering how I should do that, but I read, this would be possible)?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] serajr:
You're welcome!

No, you don't. Uninstall it in magisk manager only (changes will take affect on next boot).
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
Sorry, but after reboot it hangs again at Sony logo. Last time I repeated the whole flashing process in order to get the system (and recovery) to work again. Do you have any suggestions?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] serajr:
3rd post "Installation Hint" (vbmeta.img)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
I executed the following command with fastboot now:

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

Then tried to reboot system - same again. It stops at Sony logo.

---------- Post added at 06:19 PM ---------- Previous post was at 05:27 PM ----------

Thanks for your feedback to this. Can you say how you upgraded to pie .126? If you just flash the firmware with newflasher your modifications are gone, too, no?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] douzdouz:
Touch screen not working in recovery

hi,

thanks a lot for your effort, unfortunately it did not work for me.

I have following device:

XZ3 H9436 dual

I successfully flashed twrp.img and vbmeta.img from 2018-12-10_23.11+2.00_52.0.A.3.126, however touch screen refused to work in recovery mode. Neither it worked with original firmware H9436_Customized DACHBLX_1316-6961_52.0.A.3.126_R10B nor with H9436_Customized+CE1_1316-3759_52.0.A.3.84_R9B (provided in your downloads). Now I am stuck.

Any help is appreciated.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
Restore only possible without PIN?

So, after flashing the firmware again with newflasher and performing all the steps to install TWRP and Magisk, I found out, that I cannot restore backups as soon as I set up a PIN for lock screen. I suppose this triggers the data encryption and somehow something about the encryption can't either be backed up or restored. However, after setting up a PIN and restoring any backup, the phone hangs at Sony Logo. Also flashing twrp.img again does not help... has anyone any suggestions or ideas about that? With so many problems, I am now slowly desperate... :(

EDIT: In my understanding the data in the encrypted part /data/data should be backed up normaly as soon as the correct PIN was entered at TWRP startup and the data can be read. So a restore of such data in an unlocked /data/data area (with also the correct PIN), should be possible and lead to a running system afterwards. But this seem not be the case?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
The PIE encryption is not compatible with the OREO encryption :)

At the moment the TWRP doesn't even support our device specific PIE encryption.

If you made this backup with TWRP OREO just grab the latest OREO firmware I uploaded behind the download link in the first post and restore the backup in TWRP. :D

I recommend Titanium Backup for backups. :)

After that you can just install the latest .126 PIE firmware with newflasher, but don't forget to remove the userdata.sin or it will wipe your phone.

But I strong recommend a phone wipe for the PIE upgrade.

(I wipe my phone between every monthly update, and it solved bugs at my site. and the touch got better too. :victory: )

PS: Permissive Mode is only needed with Xperifix and will be automatically activated with the PIE release of it.

It is not needed on the basic PIE camera fix. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I need the informations described in the FAQ on page 1 of this thread, so i can finally activate the touch support. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] douzdouz:
Sorry for being stupid, but how do I get those infos? a) I am not rooted (cannot "su" or "cat panel_id") b) dialing *#*#SERVICE#*#* produces nothing
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Oh :(

You can install the Magisk Manager App.

It can patch a boot.img file, which you can flash via fastboot flash boot boot.img

You get this boot.img by downloading the latest firmware (.126 ?) via xperifirm from XDA.

Then you use UnSin from XDA to unzip this file. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
I made my backups when the latest OREO firmware from your androidpit upload was already flashed. I have a XZ2 here I just bought, so everything has just been installed, and I was flashing your firmware and TWRP from your upload sereval times yesterday. So I made the backup with OREO firmware + TWRP from your post and also made the restore wir OREO firmware + TWRP from your post, but as soon as a PIN is set up the restore leads to a frozen system on my XZ2 at Sony Logo. But shouldn't this work as long as I unlock the encrypted data when enetering the PIN on TWRP startup? I am really confused by the fact that the restore leads to a frozen system...

I also have Titanium Backup (not installed yet, because of continous firmware flashing), but I would like to be able to perform a full backup, this is why I would like to use TWRP.

Next question for me would be: Can I just "flash over" the PIE firmware from your post with newflasher after removing the userdata.sin in order to make a real upgrade from OREO to PIE? Would this help me in any way to solve the backup-restore-issue I have?

To your last sentence: Does this mean, if you would use XperiFix on a PIE firmware, then permissive mode would be automatically activated by XperiFix without Magisk + Magisk module installed? But I understand it like this, that we don't need XperiFix at all when having the camera issue on PIE.

Thanks again for all your support you are doing.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] shoey63:
Pie wipes drm fix, but there is no drm fix for pie anyway. However camera preview works on pie .126 if the following conditions are met :-

1. You unlocked on oreo and applied drm fix from xperifix.

2. You got camera preview working by installing magisk permissive module and took some photos.

3. You then upgraded to Pie with Newflasher and flashed the zip from [MENTION=2902434]Pandemic[/MENTION]s thread . It contains some files from pie .84 which makes the preview work, even though there is no drm fix in place.

You could also flash Existenze rom which also contains the files.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Can you boot in TWRP and will the OREO TWRP ask you for a PIN Code to decrypt your restored Oreo Userdata?

It's the first time I hear about this bug and Oreo with TWRP was used for 2 months. :(

Yes, that's the upgrade path.

And the userdata is compatible.

But taking a backup in PIe is impossible at the moment.

XperiFix adds some libraries to your phone, which only get loaded, if SELinux is set to permissive.

Xperifix will set it to permissive with the next version standalone.

(We need a new xperifix, which works with pie)

To get the camera on PIE back with a phone unlocked on OREO, you only need the camera fix or existenze ROM and of course the vbmeta parameters mentioned in the twrp installation manual.

But for camera noise reduction, we still need a working drmfix.

Thank you, you're welcome. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] douzdouz:
ok, I rooted it with patched boot.img

H9436:/ # cat /sys/devices/dsi_panel_driver/panel_id
5

Firmware installed (with Newflash):

H9436_Customized DACHBLX_1316-6961_52.0.A.3.126_R10B

TWRP:

2018-12-10_23.11+2.00_52.0.A.3.126

Kernel:

4.9.112-perf+

Recovery touch - noop
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
Yes, I can boot in TWRP and TWRP asks me immediately for a password/PIN if I have set up a PIN in system before for the lock screen. If in system there is "unlock by swipe" configured, then TWRP does not ask for password/PIN. As long as I do no set up a PIN in system, backup and restore works fine with TWRP. But as soon as PIN is configured in system, after entering that PIN in TWRP and performing a restore of a backup (that has also been made with PIN configured) this leads to a stop at Sony Logo. I investigated that yesterday with a step-by-step backup/restore while performing some steps in the system. As soon as the system hangs at sony logo, it's all over. I cannot get it back running without flashing everthing again from the beginning (TWRP + Firmware and so on), no matter what I try...

I will test this in the evening again as follows: I will install / flash TWRP + OREO firmware again, so that it is a fresh install. Then I will set up a PIN in system and then make a backup and a restore immediately after the backup. I will report, if this leads to a stop at Sony Logo, too.

So you mean performing a backup with TWRP is not possible with PIE at all? If so, this would not be an option for me. I would stay at OREO in this case. Would it possible at all to get the camera on PIE back, without having it unlocked on an OREO before (so without an upgrade from an "XperiFix-OREO" to PIE)?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Thx, will reupload the twrp with this fix to test :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Maybe this will help you :)

https://www.howtogeek.com/240657/how-to-fix-pin-errors-after-restoring-from-twrp-android-backups/

I recommend this way if unlocked on Oreo :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Orphee:
Hello [MENTION=6031898]MartinX3[/MENTION] thank you for your help.

My phone is now upgraded to .126 (France/French) with XperiFirm and NewFlasher, I just unlocked the bootloader, and the camera is still working.

I'm about to flash TWRP in a few hours... any recommendations ?

Thank you
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
You will need the camera fix with .126 and newer firmwares :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Orphee:
So TWRP breaks the camera on .126 ok, thank you
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
TWRP is only a ramdisk.

It's not used during the normal system using.

It should not break anything in the normal system.

http://www.ibm.com/developerworks/library/l-initrd/index.html
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Orphee:
Actually, currently the phone is unlocked on .126 and camera preview seems to work fine.

I did not flash TWRP and every stuff yet, I guess when all theses steps will be done camera will be broken and I'll have to flash the fix from Pandemic...

Thank you
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
The camerafix would break your cam.

You don't need it, since you unlocked with .126.

Just install twrp and magisk.

And if you want, install Existenze 3.0.

Existenze 2.0 includes the camera fix and would break you cam too.

But it breaks not forever, only until you install the vendor.sin again.

You're welcome

PS:

I don't know if it works with the Chinese firmware.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Orphee:
I don't know what Existenze is for?

My firmware is French but i guess the PS is not only for me.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Oh, I thought it because of your profile picture.

(Yes, I know animes are primarily from Japan :silly: )

That's good.

Only USA and China may not be compatible.

Existenze is a (nice) stock room extension.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Orphee:
In the phone SDcard I only see hardly named folders... Do I have to use an external SDCard ?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Yes.

Or use adb sideload.

Decryption is not supported at the moment.

Our encryption is too new. It will take some time until the decryption code arrives in the mainline code branch.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Orphee:
It worked, thank you very much for your help !
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
You're welcome :highfive:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Orphee:
edit : doublon
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
That description from your link on howtogeek was very interesting and good to know for the future, but as the system did not ask me for any PIN anyway, this did not help in this case.

However, I made a fresh clean install of firmware OREO and TWRP + Magisk - all from your post on androidfilehost. I started the system at first, set up a PIN, and then back to TWRP and made a backup. I restored it immediately. And I could not believe it - the system started as if nothing had happend. After that, I repeated the steps backup/restore several times, every time after changing some things in the system, installing updates, installing Magisk permissive module and so on. In every try I could start the system again after restore. This was not possible yesterday. I really don't know what was going on yesterday, but today it worked. The only thing that did not work, were the instructions from [MENTION=3989065]serajr[/MENTION]:

su
mount -orw,remount /vendor
magiskpolicy --load /vendor/etc/selinux/precompiled_sepolicy --save /vendor/etc/selinux/precompiled_sepolicy "allow init domain process { noatsecure }" "allow init secd process { noatsecure }"
mount -oro,remount /vendor

After these, I got stuck at sony logo at startup. But - in contrast to yesterday - I could "repair" this simply by restoring a backup I took before that step. I have really absolutely no idea, why this did not work yesterday. :confused: - Do you?

However, as the instructions from [MENTION=3989065]serajr[/MENTION] did not work for me (do you know why? I would prefer these) I had to keep the Magisk permissive module in order for the camera to work. But as soon as this module is installed, there is a notification displayed "WarrantytimeService" every time the system starts, which can't be removed. Also there is no reaction when I select it on the notification bar. I can't even prevent the service from displaying it, even when I remove the permission for it. Is there any possibility to remove that notification?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I never used serajirs instructions. :eek:

I simply downloaded this repo as permissive.zip and installed it as magisk module in the magisk manager app. :)

https://github.com/Jman420/magisk_selinux_manager

Good that it works now :highfive:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Harry500:
Yes, that is the module I am using, too. But do you have any idea about that notification I mentioned? Did you see it before / any idea how to remove it permanently?

Thanks again for your support and your good work!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
The last time I used Oreo was in October.

But I can't remember this message.

Weird.

I am happy to hear that, thank you. :cowboy:

According to this thread, they simply disabled the application. :eek:

https://www.google.com/amp/s/xdafor...tytimeservice-notification-wont-t3704983/amp/