yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
20.05.2022
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] cartman14:
Hi all,

First of all, MartinX3 - Thank you for all your efforts!

Hope somebody can help me resolve my problem. I hope this is the right forum, if not please let me know.

I used to compile Android for XZ3 myself with some small modifications to aosp. This used to work fine for Android10 and Android11. Now I'm trying to get Android 12.0 or 12.1 to work. Compiling and flashing to my devices goes well. Android boots as well and I can adb shell into the device. The problem which is very consistent is that the screen remains blank after the bootloader.

I tried this - and the problem is consistent with

Android 12.0 - self compiled, no modifications and OEM Android_11_4.14_v9a

Android 12.0 - self compiled, no modifications and OEM Android_12_4.19_v1c

Android 12.1 - self compiled, no modifications and OEM Android_11_4.14_v9a

Android 12.1 - self compiled, no modifications and OEM Android_11_4.14_v9a

MartinX3's latest ROM downloaded from Google Drive with both OEM's

ReFlashing Android 11 back on the same device works as a charm.

The dmesg shows (with some interval)

[ 2353.913171] init: Control message: Could not find 'aidl/SurfaceFlinger' for ctl.interface_start from pid: 494 (/system/bin/serviceman

ager)

[ 2354.661513] init: Control message: Could not find 'android.hardware.graphics.composer@2.1::IComposer/default' for ctl.interface_start

from pid: 495 (/system/bin/hwservicemanager)

[ 2354.746388] init: Control message: Could not find 'aidl/SurfaceFlinger' for ctl.interface_start from pid: 494 (/system/bin/serviceman

ager)

[ 2354.917621] init: Control message: Could not find 'aidl/SurfaceFlinger' for ctl.interface_start from pid: 494 (/system/bin/serviceman

ager)

[ 2355.667754] init: Control message: Could not find 'android.hardware.graphics.composer@2.1::IComposer/default' for ctl.interface_start

from pid: 495 (/system/bin/hwservicemanager)

[ 2355.752737] init: Control message: Could not find 'aidl/SurfaceFlinger' for ctl.interface_start from pid: 494 (/system/bin/serviceman

ager)

[ 2355.926994] init: Control message: Could not find 'aidl/SurfaceFlinger' for ctl.interface_start from pid: 494 (/system/bin/serviceman

ager)

I have several XZ3-devices (yeah. ... i know, all broken screens though) and tried MartinX3's ROM on a second device with exactly the same result. For flashing I flash both a and b.

I'm quite stuck at this because I hoped the ROM of MartinX3 would work because he patched it, but unfortunatelly it gives me the same problem. I'm afraid I'm the only one with this problem so I suppose I'm doing something wrong.

Any advice is very much welcome! A logcat -b all is attached.

BTW: exporting the logcat from the device I noticed something wrong - maybe related?

akatsuki:/ # logcat -b all > /sdcard/logcat.txt

/system/bin/sh: can't create /sdcard/logcat.txt: No such file or directory

1|akatsuki:/ # ls -l /sdcard

lrw-r--r-- 1 root root 21 2022-05-19 23:15 /sdcard -> /storage/self/primary

akatsuki:/ # ls -l /storage/self/

total 0
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Thank you for the report.

If you did no modification, please report the bug in the issue tracker. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] cartman14:
Thank you, I submitted the bug. Hope this gives some more insights, maybe a fix and a contribution to others.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
The june release will be with a new OEM.img.

So new improvements of the hardware drivers.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] shswe70:
Hi all!

Any progress on this ROM?

And are there any other more or less fully working Android 12 firmware for Sony XZ3 H9436?

BR Stefan ..

---
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] bob1791:
Hi, I have the same error... Did you solve it ?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] cartman14:
Is this one somewhere to be found on the internet yet?

https://developer.sony.com/develop/open-devices/downloads/software-binaries still offers OEM from february 12_4.19_v1c.

Compiling branch android-12.1.0_r7 still give me the same problem mentioned above - no display.

I'm hoping new OEM drivers will make a difference - I doubt this as scrcpy does not function as well which makes me think it's not driver related. But it's worth a try.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Did you create an issue ticket?

And it's not released yet.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] bob1791:
Hello guys, I tried to install this ROM on my xz2c but when I run the command to flash the system image I got this error:

Sending sparse 'system_b' 2/2 (493072 KB) FAILED (remote: 'Error: Last flash failed : Volume Full')

Anyone know what this happens and how to solve ?

Thanks

Edit:

In the case above I was on the slot B, but the same happens using the slot A.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Did you flash and boot the newest stock firmware on both slots?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
13.06.2022

PS: Still uploading
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] bob1791:
I flashed the firmware and made the ota firmware upgrade to the laterst version. Then I rebooted into bootloader and run all commands but it occurred the same error...

Sending sparse 'system_a' 1/2 (774868 KB) OKAY [ 19.009s]
Writing 'system_a' OKAY [ 0.000s]
Sending sparse 'system_a' 2/2 (493080 KB) FAILED (remote: 'Error: Last flash failed : Volume Full')
fastboot: error: Command failed
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
With the new update as well?

But it shouldn't happen.

I never saw this problem except on your phone and probably only another one if I remember correctly.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] bob1791:
Yes... I'm on 52.1.B.0.266 (japanese rom) maybe the error depends on that ?

If yes, i'm wondering if resizing the system partition with TWRP or flashing it through the recovery it works... Anybody has never tried ?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
That could be the reason.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
20.06.2022
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
23.07.2022
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] bluep:
Hi all,

I installed on XZ2 compact and boots fine even with oem_v3a. But touch is not working. I didn't see any solution yet... Logcat is attached! Thanks in advance for any help!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
There is nothing attached.

And please open an GitHub issue ticket in the sodp bug tracker repo
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] bluep:
Just recognized that the upload didn't work. I will open a ticket!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] bluep:
Issue Ticket with file attached can be found here:

Touch not working on XZ2 compact on AOSP12.1 · Issue #782 · sonyxperiadev/bug_tracker

Platform: Tama Device: Apollo Kernel version: 4.19 Android version: 12.1 Software binaries version: SW_binaries_for_Xperia_Android_12_4.19_v3a_tama and SW_binaries_for_Xperia_Android_12_4.19_v2a_ta...

github.com
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Trace.Oneil:
Hi @MartinX3 is this rom stable yet? Also,i am sure you have tried LineageOS 19.1 on your XZ2 already. Which in your opinion is the better Android 12 rom at this stage to use. Your AOSP rom or LineageOS 19.1
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Who is martinx?

Please look in the issue tracker.

I use LOS on my only device due to lack of time.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Trace.Oneil:
Not sure why that happened. I even made sure i had the correct username,but thank you. So its best to stay on LOS 19.1 for now.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
06.08.2022

https://xdaforums.com/t/sodp-rom-aosp-xz2-xz2c-xz3-sonyaosp-13.4489393/
[Lenovo P11] MateUserHHTT:
This is a continuation of a previous thread which diverted from it's original topic (see here @CryptMan @MrCrayon). Making the tablet work with Android 11 again was done successfully by flashing persist.img but the widewine l3 status didn't change even after re-locking the bootloader und the stock ROW firmware.

Stuff I/we know:

Flashing a different persist.img can apparently cause the level to drop to L3 (see here)

In my case it presumably was caused by unlocking but not fixed by relocking the bootloader.

Another user got L3 on the J716F model but without unlocking the bootloader. Commenters suggest using the QCN file from a l1 certified tablet (see here)

I flashed persist.img from the latest 62X firmware and upgraded via OTA to 63X (not hosted yet) (see here)

I once selected "erase all before download" (attempt to fix bootloop, stupid for sure!) which probably wiped important parts of my QCN file.

The QCN file seems to hold the devices fingerprint.

L1 can be achieved using Magisk and certain module(s) but I haven't tried this since that's not for everyone.

Stuff I don't know:

does the loss of SN, MAC, BT, PN cause widewine L3 or do you have already recovered it as described by another thread? (see here)

Does L1 work if downgrade to 62X - the ROM I extracted the persist.img from and don't do the OTA?

L1 can be achieved using Magisk which might be a lot easier. Is this solution "stable" and can't be broken by Google snapping their fingers?

is it possible to have widewine L1 but safetynet not passing (regarding Magisk)?

Note: the category is neither question nor development, but dev seems a better fit as this will drive less people here who confuse this as a howtoguide and don't have anything to contribute.

The thread will be changed to a howtoguide once we found a solution.
[Lenovo P11] CryptMan:
Yeah, I also did this. And then my SN, PN, MAC etc. where gone. Also the device certification!

I'm very sure that this option in QFIL causes damage to QCN and (!) wipe some important data(partition).

I have compared some partitions from J606F (working, L1) with my J706F (damaged QCN, L3) and I found a partition named "secdata" which is empty on the J706F.

I made a copy of this from the 606 and it looks like this partition stores certificates (SSL/TLS).

Then I tried to write this to the 706, but this results in soft-brick. The 706 only boots to 9008 mode. And it stays there even if I delete the secdata partition again, very strange.
[Lenovo P11] MateUserHHTT:
Damn, that's bad. In Germany we have a saying that translates to "No Backup, no pity" but I wouldn't think about backing up empty partitions either. :p Did you erase it or format it afterwards? Maybe you could create an empty image of fitting size with dd filled with zeros? Also: did you check that the secdata partition actually existed on the J706F? If so, was it empty or could it be that you had no read permissions? And was the file size of the image you flashed fitting? I think it doesn't matter because fastboot doesn't overwrite other partitions (has a failsafe) but I'm not sure of that.

I have access to a J706L (model with sim-slot) but I can only access it in a "reading" way (tablet of a friend...).

I put it into FFBM but it didn't show up in QFIL at the same machine I used for my J706F. I'll check the drivers and attempt again. I guess that's our best bet on restoring L1 without rooting it.
[Lenovo P11] russy23:
My j716f has screwed up serial and widevine is L3..I deleted all in qfil..the Chinese guys didn't sort it out..maybe restoring serial number will restore widevine..
[Lenovo P11] MrCrayon:
Since I have two working J706F I'm probably in the best position to check this.

I can also do some other checking but I'll have to wait the weekend.
[Lenovo P11] MrCrayon:
{Mod edit: Quoted post deleted}

I just skimmed it quickly but it looks like that's only to restore L1 in Netflix when you still have L1 in the device, is that right?

The problem here is for those people that lost L1 in the device (not only Netflix)
[Lenovo P11] f1tm0t:
No, it was L3 before, checked by DRM info app.
[Lenovo P11] CryptMan:
{Mod edit: Quoted post deleted}

If I understand this correct, then changed just to "GB" instead of there real region, logged in in Google and then the device was L1 again?!

That sounds a bit too simple, but yeah I could try that.

May on weekend, for now I have seen all the install, configuration and import/export data options a but too often ...

That would be great if you can compare the partitions, thank you.

One other thing, I found was a file called "factory rescue zip" for the P11, sadly not for free download but free for an different Lenovo device.

So I downloaded that one to have look inside. And in that Zip file I found a file called "sec.dat". Which looks differend, but hey it's from different device.

If that "factory rescue zip" for the P11 also contains this "sec.dat", may this could be another route to go?
[Lenovo P11] MateUserHHTT:
What was the cause of L1 loss?

In my and CryptMan's case it's most likely due to the fact we checked "erase all before download" in QFIL.
[Lenovo P11] f1tm0t:
Just now I flashed clean ZUI with GB region and I have L1

View attachment 5533509
[Lenovo P11] f1tm0t:
I never checked "erase all before download". L3 and "device not certified by Google" came after unlocking bootloader in my cases (rich expirience)
[Lenovo P11] MrCrayon:
Sadly losing L1 when you unlock bootloader is normal.

Relocking bootloader should bring back L1 unless something else has been erased/changed.
[Lenovo P11] MateUserHHTT:
Then the way you restored your L1 will most likely not help us. But thank you anyways. :-)
[Lenovo P11] MrCrayon:
@CryptMan

I tried Partition Manager but it's giving me Sahara error, can't read packet header.

It's probably because I'm using VirtualBox on Linux but before I try in a Windows machine I wanted to clarify something.

When I clcik on Partition Manager it asks me to verify if the correct firehose file is selected (or something like that), do I need to select prog_firehose_ddr.elf from the current ROM installed in the device or any ROM is OK?

I never had a 63x ota, what's the full version?

P.S.

I noticed prog_firehose_ddr is slightly differente between last global and CN, so I guess current ROM would be better :unsure:
[Lenovo P11] CryptMan:
@MrCrayon

I have always used the latest version of prog_firehose_ddr from the latest firmware ZIP.

As far as I understand this concept, firehose will be loaded to the SoC and must "only" match to it because it is executed there. After successfully loading/running firehose on the SoC the whole communication between PC and SoC/Flash uses Qualcomm sahara protocol to transfer data.

I have a Z3X box, and was successfull in using the firehose from the firmware ZIP. Official Z3X does NOT support the P11, but firehose/sahara is generic communication with Qualcomm devices so it was possible to read partitions with this tool too.

Running QFIL in VMware (or some other virtual machine) is always a very bad idea. I was never successful while doing this.

Best way is to always connect the device directly.
[Lenovo P11] CryptMan:
@MrCrayon

Oh, one more very very important thing!

Be very very careful when using the partition manager!

Do NEVER click on "erase" or "load" there is no "Are you sure what you are doing?" the tool just to the job!

Using "Read" is no problem.

To get to this dialog, you have to right click on the partition you want to work with and select the first option "manage partition data".
[Lenovo P11] MateUserHHTT:
Build number: TB-J706F_630185_220128_ROW

Kernel ver.: 4.14.190-perf+

Android ver.: 11.

This version came with WeChat and GG (some chinese app) preinstalled. Including a "Tablet Center" with options like "protect your devices from accidetnal damage", "ADP One" or "Depot Support". Usually each points results in "No Internet connection" (which ain't true) or some other error message.

The title at the top-left corner says "Tablet Center{Test Only}" so I kinda feel like I received an update I wasn't supposed to receive :D
[Lenovo P11] MrCrayon:
Good news for Linux users I used https://github.com/bkerler/edl and it worked perfectly.

To print partitions I used:

edl printgpt --memory=ufs

and to back them up I used:

(--skip did not work so make sure you have 130GB of free space and 50 minutes)

edl rl dump_folder --memory=ufs --genxml --skip=super,userdata

I was not expecting it but secdata is the same :D

fpinfo.bin contains selected region, SN and PN.

Anything else I can check?
[Lenovo P11] CryptMan:
@MrCrayon

Cool. Thank you very much.

I have flashed your file to my J706F, the good news is ... it still boots up (unlike my try with the secdata from J606, which resultet in soft-brick).

The bad news is ... it does not change anything for Widevine 😟.

May you could post your QCN but with overwritte SN and 2nd part of all MAC adresses?

Or can I send you mine to compare if some options my missing?

Best regards
[Lenovo P11] CryptMan:
Hi, I have digged a bit more, thats what I found, not much ...

When I start SafetyNet Helper Sample, this is what I get in logcat. Looks bit strange (Vendor & MajorVersion).

And there seems to be a "keystore" involved, My fist guess was that this could be the partition "keystore", but this is empty on my J606F, so don't think it's there. Also "keymaster" isn't it.

Somebody any idea?

815-995/? E/QC-time-services: Daemon: Time-services: Waiting to acceptconnection
650-650/? E/KeyMasterHalDevice: Attest key send cmd failed
650-650/? E/KeyMasterHalDevice: ret: 0
650-650/? E/KeyMasterHalDevice: resp->status: -10003
1253-11317/? E/keystore: Keymaster reported error: -10003
NOTE: This is an error in the vendor specific error range.
Refer to the vendor of the implementation for details.
Implementation name: Keymaster HAL: 4
Vendor name: QTI
MajorVersion:

Then digged for "widevine_security_level", and found this in "com.lenovo.system" app:

Looks like this straight from a systemcall(?) "MediaDrm". May we can use this for reference if L1 is present?

package com.lenovo.system;

import android.media.MediaDrm;
import android.media.UnsupportedSchemeException;
import android.os.SystemProperties;
import android.util.Log;
import java.util.HashMap;
import java.util.UUID;

public class SystemInfo {
public static final String PROP_WIDEVINE_LEVEL = "sys.lenovo.widevine_security_level";

public static final String TAG = "SystemInfo";

public static final String WIDEVINE_SECURITY_LEVEL = "widevine_security_level";

private static final UUID WIDEVINE_UUID = new UUID(-1301668207276963122L, -6645017420763422227L);

private static HashMap<String, String> sProps = new HashMap<>();

public static String getWidevineSecurityLevel() {
String str1 = sProps.get("widevine_security_level");
String str2 = str1;
if (str1 == null)
str2 = "";
return str2;
}

private static void initWidevineSecurityLevel() {
try {
MediaDrm mediaDrm = new MediaDrm();
this(WIDEVINE_UUID);
String str = mediaDrm.getPropertyString("securityLevel");
StringBuilder stringBuilder = new StringBuilder();
this();
stringBuilder.append("widevine security level is '");
stringBuilder.append(str);
stringBuilder.append("'.");
Log.v("SystemInfo", stringBuilder.toString());
SystemProperties.set("sys.lenovo.widevine_security_level", str);
sProps.put("widevine_security_level", str);
} catch (UnsupportedSchemeException unsupportedSchemeException) {
Log.v("SystemInfo", "init widevine info error!", (Throwable)unsupportedSchemeException);
}
}

public static void systemReady() {
(new Thread(new Runnable() {
public void run() {
SystemInfo.initWidevineSecurityLevel();
}
})).start();
}
}

As last finding I have a partition called "uefivarstore" which is empty on my J706F, which I think is wrong.

But I have no idea what this partition is good for.

Best regards
[Lenovo P11] f1tm0t:
It's not right. If you choose the right prog_firehose, everything will be fine. I flashed with Partition Manager a super image taken from a TWRP backup and renamed to super.img and booted successfully afterwards.
[Lenovo P11] MrCrayon:
I am sorry but I don't feel confident enough that's the only data I should remove.

I think I can compare it with the one provided in stock ROM and see if I can find anything interesting.

Comparing QCN file directly is going to be too noisy I'll probably try to compare single NV items.

Is keymaster empty or you know it's irrelevant? Mine is not empty and it's the same in both tablets.

$ adb shell getprop | grep widevine
[sys.lenovo.widevine_security_level]: [L1]

we should try to understand where this value is set

That partition is not empty for me, it's different between the two tablets but not very much.

I don't know what's the partition for either, I was never able to find a guide that explains all android partitions in detail.

It was just a warning for me since the only thing I wanted to do was to backup partitions.
[Lenovo P11] CryptMan:
No problem. If okay I had send you mine. :)

Well I'm not 100% sure, because I can only compare between my working J606F and my not working J706F I can only tell that "keymaster" is also empty on J696F.

If you say that yours holds the same data, I would be happy to try what's happening when this partition is flahed to my broken device. If you like, please post your keymaster, thank you.
[Lenovo P11] MrCrayon:
Your QCN is missing NV Item 572 that is the same for both of my tablets.

I cannot do a backup with nv_reader_and_writer because it does not work in virtual machines.

This is the content if you think you can restore it with this info

NV item: 572 [NV_RF_NV_LOADED_DATE_I], index 0

NV_RF_NV_LOADED_DATE_I 0: e5 e4 b4 5e 00 00 00 00 00 00 00 00 00 00 00 00

NV_RF_NV_LOADED_DATE_I 1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

NV_RF_NV_LOADED_DATE_I 2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

NV_RF_NV_LOADED_DATE_I 3: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

NV_RF_NV_LOADED_DATE_I 4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

NV_RF_NV_LOADED_DATE_I 5: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

NV_RF_NV_LOADED_DATE_I 6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

NV_RF_NV_LOADED_DATE_I 7: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

There are some other differences but I need some time to check, at first glance nothing that looks promising.

keymaster_a and keymaster_b are the same between tablets but they are different with eachother, probably they changed with updates.

My active slot is a.

(bootloader) current-slot:a
[Lenovo P11] CryptMan:
Okay, I have written "NV Item 572, RF" ... if any body need it I have attched it "NV-items_reader_writer" format.

Sadly I can't see any differences. Still L3 and GPS not working.

Relating to key

master

... I think we mixed up to things. Partition keymaster_a|b is populated with "km4.mbn" and filled on my tablet.

But there is an other, empty partition, called "key

store

". That one is empty on my working J606F and my broken J706F. If yours is also, I think we can ignore them.

First time I saw them I mixed up too. 😁

If we can not find any other differences, maybe the needed information is stored inside the QSEE (TEE aka TPM on PC's). Should that be the case, well I don't know, but if then playing with the partitions will never work.

QSEE = Qualcomm Secure Execution Environment

TEE = Trusted Execution Environment