yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ1 Compact Questions & Answers] mad0701:
First of all: big thx for your hard and continuously work in the past and hopefully in the future (Kernel)

If I'm at home (only a half WE) I can try to make compare Pic from my phone (TA saved / Secd / TWRP) and from the phone of my wife (full Stock) only difference is: the phone from my wife is one hardware version higher..... I've no idea what is the change between the 2 phones.
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
[MENTION=7055162]mad0701[/MENTION], it would be great to make some comparisons. I do not know any details about hw revisions.

In any case it would be very interesting to compare pie camera of "lost drm" vs "restored TA"/"still locked" phone - to see if sony stopped with limiting/disabling camera functionality of recent xperia phones with pie.
[Sony Xperia XZ1 Compact Questions & Answers] jlespiritu:
I never back up any key

I used the unlocked kernel but my suntory blobs having an error. Please help
[Sony Xperia XZ1 Compact Questions & Answers] itexspert:
BootLooped Xperia XZ2,i have this problem,i tried flashing my phone with this flasher and process works fine,i download current build with Xperia tool,then i put Newflasher files into the folder created by the xperia tool,i run newflasher it seems to work just fine,no errors that i can find,but still i turn on my phone... it gets to Xperia logo... and it just continuosly loops... crashing and rebooting and so on....

All drivers were installed a while back when i used Other flashing tool,and like i said there is no error that i can see,flashing by itself seems to be working fine.

This problem started today my Google Play was continuosly crashing my phone warned me so i then rebooted my phone just as a precaution...then this whole dance started where phone turns on,gets to Xperia or SONY logo and just restarts... its basically a vibrating device now... it keeps vibrating when it reboots and it happens all the time...

Anyone has this strange issue?

Do i need to delete something,or wipe something i mean i do all this flashing without my SD card inserted or my SIM inserted and still device crashes...

Any ideas?
[Sony Xperia XZ1 Compact Questions & Answers] wasdroger:
May I suggest that you start a new topic for your problem? Your problem will get proper attention that way, here hardly anyone will notice it unless they are specifically looking into or interested in progress on the ta key thing.

Good luck and all the best for you ánd your xz2!
[Sony Xperia XZ1 Compact Questions & Answers] mad0701:
Try to hold Power and Volume up (or down) during start and hold for ~ 1Min , so that the phone make a full wipe. I've had a similar Effekt on the XPZ a long time ago after flashing. Error was goes after a full wipe
[Sony Xperia XZ1 Compact Questions & Answers] Alefello:
Hello everybody

I've 2 xz1c.

First one I unlocked using the renosploit way and then upgraded to G8441_47.1.A.16.20 ftf (downloaded ftom xperiasite.pl) using flashtool and everything went great and I still have blobs ok and fido provisioned.

Second one I tried this new exploit to gain temp root directly on G8441_47.1.A.16.20 flashed via flashtool and backup DRM keys before unlocking and restore after, but now I checked and blobs are in error and fido are not provisioned. Unfortunately I felt confident in backing up and restoring DRM keys and in upgrading via flashtool as I did it with the first xz1c and everything went great so I didn't take a screenshot of the security page before unlocking :crying:.

Anyway I didn't understand from this thread how blobs and fido keys interact with the phone and how can I be affected if i don't have them provisioned, and how to "fix" them so the firmware could think to be ok even if i messed up something.

Thank you

EDIT:

I checked the /persist/data/keymaster64 folder of both xz1cs and I found both have all the content. So what's wrong? What's different? I thought the folder of the "broken" xz1c was empty due to the post of pbarrette.

[IMG="left is the "broken" xz1, right is the "good" xz1"]https://ibb.co/fnP9zt7[/IMG]

free http file hosting

Thank you
[Sony Xperia XZ1 Compact Questions & Answers] yacloo:
according to tweet Google gonna use safetynet with key attestation to verify device status

https://twitter.com/topjohnwu/status/1237656703929180160
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
[MENTION=712400]Alefello[/MENTION], are you using a kernel hiding bootloader unlock status? Without that you would get errors in security screen even with locked TA restored. You need both, TA with restored device master key _and_ kernel patched to hide bootloader unlock status. I am not sure about the fido key, but the android attest key is independent (and useless after unlock anyway).
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
So the day has come?

The thing is that in case of unlocked sony xperia phones that had working android attest key, it had been used already for some time - see my post here from 22nd May 2019:
[Sony Xperia XZ1 Compact Questions & Answers] yacloo:
Probably but also reported as previous keymaster versions got some issues with key attestation

best guess is keymaster 4 and up gonna mandatory for safetynet key attestation check

Or they gonna release for entire keymaster versions than we doomed :lol
[Sony Xperia XZ1 Compact Questions & Answers] 7alvoo:
Does newflasher v.20 or Androxyde Flashtool v0.9.25 handle the keymaster in (xz1 c)?

Is it possible to flash another customized stock rom or downgrade (pie > oreo) without losing fido / attest / android key?

As shown in the service menu, keymaster evaluates each boot. If the fota boot is started by the ota updater, it is captured as a legitimate intervention.

For the manual flash we initiated, what is the correct protocol that the keymaster accepts?

Or do I misunderstand and persist.sin skip solves any key loss problem?

I know I'm asking in the wrong place, after all, you didn't create the programs, but you have serious experience.

Thanks for your reply and for this much info!
[Sony Xperia XZ1 Compact Questions & Answers] Blu-eyes:
As far I know yes, skipping the persist.sin flashing, allow to not lose the attest key, and the XZ1 not implement any rollback protection so you must be able to go back and forth from oreo <--> pie. When you downgrade you must flash also userdata.sin(factory reset), and we changing customization you must flash cust-reset.ta

From my experience FIDO key connot be lost with the use of newflasher, but the android attest key will be lost, if you flash persist.sin (I done this before that this was discovered)
[Sony Xperia XZ1 Compact Questions & Answers] 7alvoo:
j4nn ! Google will hopefully evaluate the solutions generously, sony's laziness can lead to key revocation.

https://www.xda-developers.com/safetynet-hardware-attestation-hide-root-magisk/
[Sony Xperia XZ1 Compact Questions & Answers] Blu-eyes:
Why sony laziness should lead to key revocation? as far I know, no release private key have been leaked from sony, and nobody, achieved publlically,code execution in TEE. So until these day, I'm pretty sure that no key well be revoked.
[Sony Xperia XZ1 Compact Questions & Answers] 7alvoo:
By opening bl, the old keys should be destroyed irretrievably. Should. "but the music still plays"
[Sony Xperia XZ1 Compact Questions & Answers] Blu-eyes:
Probably we are talking about two different type of keys, the ones lost by bootloader unlocking are the DRM ones, used by the widewine Trustlet, the key talking in that article are the sony cryptographic key(used by the keymaster trustlet, that handle all security related stuf),also used to build up a chain-of-trust.

Even with the unlock, the cryptographic key must be present, otherwise the devices is a good paper holder, in fact without cryptographic key, anything from Hardware-backed Keystore can't work, also the fingerprint sensor will not work.

When you unlock also restoring the TA backup, you recovery you drm key, but you will fail the safety net check (unless you destroy the attestation key info here). because, when you unlock, something is done with trustzone, that save the new state, and for this reason we need the hidingKernel, to spoof the TrustZone response ( Here the j4nn patch) and force secd and ric to thing that is still-locked
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
just wondering if we could bypass hardware backed attestation by proxying all the attestation related TEE requests from an unlocked phone to a still locked one? effectively getting locked state signed by use of TEE from different (locked) phone, but having the right challenge from the unlocked one?
[Sony Xperia XZ1 Compact Questions & Answers] Meloferz:
Hi [MENTION=4418980]j4nn[/MENTION], take a look to this https://xdaforums.com/xperia-1/help/xperia-1-drm-keys-locking-bootloader-t4079715

I also wondering if the same happens with Xperia 10, and new phones like Xperia 10 II and Xperia 1 II.
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
[MENTION=5853845]Meloferz[/MENTION], interesting - I am wondering if sony still uses the device key in TA 66667 unit and if it gets erased with the first unlock or not.
[Sony Xperia XZ1 Compact Questions & Answers] Blu-eyes:
I think this will not work, probably the key will checked also against Imei/ other device specific thing
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
[MENTION=7543898]Blu-eyes[/MENTION], but we would not try to extract/use a key from different device, we would use the whole attestation api on a still locked device B just to process a challenge from device A. The signed response from B would probably contain a B's id, but can google check that it does not belong to A?

Or should they just check the validity of certificates and there contained still locked state?
[Sony Xperia XZ1 Compact Questions & Answers] Blu-eyes:
Assuming that you're right what's the point? if I need a still locked devices to pass attestation on the unlocked one, I wold use directly the locked one. I'm missing something?
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
[MENTION=7543898]Blu-eyes[/MENTION], well I agree it would not be that great even if it worked.

But still, if it worked, one may run a single still locked phone with network access and use it remotely for attestation of all the other phones which could pass hw backed attestation this way while being unlocked.

Not sure if there could be any other way when google starts to require hw backed attestation.
[Sony Xperia XZ1 Compact Questions & Answers] akheljava:
I have same problem, i just stupid to flash presist.sin an my XZ1 boobloader still locked ...

and now my atteskey are NOT PROVISIONED...

this thred says, [SOLVED], did i miss something to solve my problem, cause i cant found any solve to bring bang atteskey status
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
[MENTION=6431598]akheljava[/MENTION], the thread started with question how can the attest key get lost without even unlocking bootloader.

It has been found that it gets lost with flashing of persit.sin.

As the content of persist partition is unique to each phone, bound to serial/imei/whatever phone id, you can never get it back.

At the same time there was developed a howto for checking if the key works or not with a patched auditor app.

So the thread is marked solved, as the original question is answered.

You can fake restore of the attest key, so that it would be provisioned in the security screen, but the key would not work, so hardware backed key attestation as recently gets checked from google servers for safety net pass will never work with lost (or faked) attest key.
[Sony Xperia XZ1 Compact Questions & Answers] akheljava:
hmmm, then i lost may atteskey forever now :crying:

if my phone has bootloader unlock allowed : yes, i will not cry cause i can make it for fun with try LOS16 nor Android 10...

but its cant be unlock... make it useless cause i cant even fake the status with magisk or something rooting way

maybe better i sell this phone, :rolleyes:

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

@j4nn

maybe u can share your trick rooting pie as your post hire https://j4nn.github.io/

i just think, to make my phone as experiment for rooting as its cannot be unlock
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
[MENTION=6431598]akheljava[/MENTION], you are getting it wrong - if you did not loose attest key but you would unlock bootloader, it would be even worse - the attest key would just always tell google servers that your phone is unlocked, no matter what you would do with magisk or anything else.

With bootloader unlock disabled, you still can flash the latest oreo firmware and use the CVE-2019-2215 based exploit temp root with possibility to even start magisk from it.
[Sony Xperia XZ1 Compact Questions & Answers] Blu-eyes:
I can tell you that without attest key, X-Reality and camera work fine on oreo (Personally tested(I lost my attest key the day after i bought the phone, before that the persist.sin thing was discovered)). The only thing that i can tell you is that when flashed partial firmware(mixed bootloader and android version without wiping ) the camera was not working on oreo, but a full restore with sony conmpanion restored all.
[Sony Xperia XZ1 Compact Questions & Answers] Blu-eyes:
I talked about oreo, because when i made all these try was the only on e

available, from then I have updated to Pie and all work fawlwess,(as far i know the attest key is usefull only if google enforce yo all devices to use hardware backed keystore to pass safety net, the camera and xreality are tied to the DRM key, the service menu what tell about this?)

When you have used new flasher what file you've skipped?
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
[MENTION=10505395]oneaminra[/MENTION], if camera is not working on a still locked bootloader, it is caused by incorrect bootloader version - you cannot use pie bootloader with oreo firmware (or vice versa). It will boot, but drm stuff will not work.
[Sony Xperia XZ1 Compact Questions & Answers] munjeni:
Is attest keys inside /mnt/vendor/persist/wv folder?? And does it get lost forever when we flash persist partition?
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
[MENTION=4120742]munjeni[/MENTION], I do not know, but would guess that "wv" stands for widevine.

The attest key does get lost forever when persist partition is flashed, it is device specific.

It seems that even if persist partition had been backed up, it does not work to restore it - but not 100% sure about it, this need to be carefully tested.
[Sony Xperia XZ1 Compact Questions & Answers] MarkMRL:
I also lost my attest keys but I did follow the guides and backed up everything as instructed. I blame newflasher, when I downgraded the security tab test showed "none". Then I flashed back the most recent firmware with Xperia Companion and everything was ok. So I downgraded again and backed up the partition even though it showed "none" under security (and camera was busted, locked up when trying to take a photo), took a backup as instructed, unlocked, rooted again and restored the backup, and guess what, it still showed "none" and camera didn't work. So I tried flashing with flashtool instead of newflasher and now it showed the usual info under security, but everything was unprovisioned even though I restored the backup. I don't really give a damn about it but why the hell does everyone recommends newflasher when it is annoying to use (deleting files in 2020, seriously?) and creates this issue? I'm pretty sure it's better to use flashtool and exclude the .ta files from there.

Anyway if anyone has any clue on how to tell if my backup is even valid and how to try and flash it again I would appreciate it.
[Sony Xperia XZ1 Compact Questions & Answers] Blu-eyes:
I this Appened you need to blame only you self, Probably when you downgraded you left out the Bootloader folder, so there where a mismatch that caused a the "none" security screen.

Probaly here you made a mistake, if you read the guide, you should know that flashing the persist.sin cause the loss of the attest Key. So when you used flashtool(and Flashed all Including bootloader and persist) you lost it.

Because newflasher if used corrently do only what you told it to do, if you told to not flash,bootloader for example, it will not flash it and the the sony software cause this weird issue.

Newflasher is Opensource, grab it and add whatever interface you want

If you're happy with flashtool use it, but then not blame newflasher because flashtool flashed persist.sin

For the response just look at the post before yours, where were writen that there isn't a known way to restore attest key
[Sony Xperia XZ1 Compact Questions & Answers] MarkMRL:
I am 100% sure I followed the guide to the letter. I did not flash the persist file, ever. Anyway, I have the backup, but it doesn't work. Do you think there could be a way to fix it, just for fun? Other than that, is there a drmfix kernel for the latest pie firmware 47.2.A.11.228? I can't seem to find one.
[Sony Xperia XZ1 Compact Questions & Answers] Blu-eyes:
The only known way to lose attestation key is by flashing the persist partion, if you didn't do that, xperia companion did.

Restoring the persist partition doesn't work, it you restored the TA, you need the j4nn patched kernel to enable all drm features
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
As Blu-eyes said already, if you did not flash persist partition, your android attest key should work.

But if you already unlocked your phone, the working attest key does not provide any benefit - it will only confirm to google server that your phone has been unlocked no matter what stuff you try to use to hide that.

You can test if your attest key still works with the patched Auditor app available in this thread.

Mentioning you have the backup - do you mean TA backup or also persist partition backup?

So far there is nobody who could confirm that restoring persist partition would bring working attest key back, but if you have the backup, you can try.

But again as explained above, there is no benefit if your bootloader had been unlocked.
[Sony Xperia XZ1 Compact Questions & Answers] MarkMRL:
Wait, wasn't the backup intended to preserve the drm features after unlocking? Maybe I'm misunderstanding something here.

Anyway, the security screen shows that Android Attest Key is provisioned, but SOMC Attest Key is not provisioned. Reflashing the backup using the adb command from root shell doesn't change this at all. From what I can tell, everything works except the video enhancement thing. After flashing j4nn's kernel, that also works now. So yeah I don't really care that much, it was just some mild curiosity.

By the way, it appears that with j4nn's kernel, Xperia Companion doesn't complain about the device being unlocked anymore. Does this mean that repairing with Xperia Companion will work if I mess something up? Asking here so I don't have to bump another thread. Thanks in advance :)

Actually scratch that, I'm so dumb. Apparently since my Android Attest Keys are still provisioned, I assume the backup worked. I thought it was supposed to keep everything to provisioned.
[Sony Xperia XZ1 Compact Questions & Answers] j4nn:
[MENTION=4156070]MarkMRL[/MENTION], yes, TA backup preserves the device key which in consequence preserves drm keys.

Android attest key does not get lost by unlock at all.

It is not stored in TA partition but in 'persist' partition.

So you may try to backup persist, but it has not been confirmed yet, that it would be possible to restore it getting it functional again.

Security screen is useless, you can have attest key provisioned there, while it does not work at all, just by creating few empty files in persist partition.

If you want to check if attest key works, you can use the patched auditor app available here in this thread, as already mentioned.

Sure that having locked TA restored with kernel patched to hide bootloader unlock everything works.

We should consider ourselves lucky with this state as that is not the case with xz2* and newer phones.

I have no idea about companion - if it thinks phone is locked, it may be like that, but only in android runtime mode. If it reboots the phone to flash mode, it can easily see the phone is unlocked. But I do not use that software, so I have really no idea how it works or what it does.

Concerning backup - it does not have anything with the attest key in my opinion.

The attest key is used most likely only with google safety net to cryptographically verify using TEE that the phone is still locked. Due to use of asymmetric cryptography and trusted environment execution this cannot be faked or modified and google always can verify the true state, if the key works.
[Sony Xperia XZ1 Compact Questions & Answers] lee.wp14:
In sort, whoever gets to this thread and gets to this last page and you are flashing your xperia right now stuck at persist.sin prompt,

ANSWER NO [n] TO SKIP FLASH PERSIST.SIN

DO NOT FLASH PERSIST.SIN, DELETE IT NEXT TIME BEFORE START NEWFLASHER

Answer YES [y] only if you know what you are doing. Basically you don't know.

You want reason? Sure, here's why:

1. There's something inside called attest key that is unrecoverable, at least for Xperia XZ1 family devices

2. Attest key is unique per device

3. It can't be mocked like some xperia's drm key

4. When Google someday decided to fked up you users and enforce hardware attestation for safetynet, you are done for good, your device is "Not Certified" in play store and your device appears tampered

5. Why? Without hardware attestation, you are using software attestation which is something Magisk is using right now. When Magisk is done for good one day, so should your device.

6. Again why? Because without attest key, your phone can't use TEE anymore so hardware attestation does not work on your phone anymore.

Want to know how to check if your key is gone for good? Here's how:

1. Open dialer. Dial *#*#7378423#*#*

2. Go to Service Test > Security

3. If you see anything not provisioned, good luck.

What if I lost the key?

If you lost it, don't panic, your device can pass safetynet if Google still allow software attestation, hopefully it still does.

Other than safetynet, it shouldn't affect anything else.

You should be grateful that it does not render the device unusable instead of just losing a key. Take note and be more careful next time.

Which device is affected?

After looking around, it seems to me that only Xperia XZ1 family devices are affected. For some reasons Sony places the key inside persist.sin in XZ1 family devices.

I don't own so many Xperia devices, in fact the XZ1 i'm flashing is my dad's, so check it out on your own.

I can't understand why not a single person can give such a simple, obvious warning to users.

Spoiler content hidden.
[Sony Xperia XZ1 Compact Questions & Answers] muphetz:
@j4nn i lost my imei,baseband unknown,,no wifi addres because flash persist partition with newflasher,,my fault not read carefully,, im unlock bootloader now,,i have ta backup from qunclocktool,,but stiil dont work,,is there no such persist.bak so we can replace the persist with attest key inside?
[Sony Xperia XZ1 Compact Questions & Answers] Blu-eyes:
Flashing persist.sin cause only to lose attest key, it's not related to imei etc,so maybe you can try flashing a full firmware (skipping the right files), to have a consistent firmware
[Sony Xperia XZ1 Compact Questions & Answers] muphetz:
I tried oreo,pie,Q with newflasher,emma,no ones bring back my imei and baseband still didnt shown,, tried flash all ta. with newflasher result still same,,no work,,
[Sony Xperia XZ1 Compact Questions & Answers] Blu-eyes:
I thinked that was a simple partition mismatch, given that flashing persist doesn't break modem/imei (By experience), Can you explaing how/when you lost your imei, after using qunlock?