yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] rhayy:
@multiwirth At the moment, once you unlock the bootloader, assume you can not restore the keys.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] multiwirth:
i guess that´s why i backed them up before the unlock
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] rhayy:
If you plan to go back to stock, there is no way today to provision the phone with the keys.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] kdolum:
You can if you root your back-to-stock phone. If you didn't want to do that, you could downgrade, get root as before, and install the keys that way.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] zpunout:
Don't know if this is already mentioned here, but I'll post this in case someone is searching for a particular error code in a search engine:

When it comes to the step about unlocking the bootloader with fastboot oem unlock 0x(your unique code from the sony website)

My terminal threw the error code:

FAILED (Write to device failed (Cannot send after transport endpoint shutdown))
fastboot: error: Command failed

So I plugged the phone into a USB hub and tried again which worked.

I have similar fastboot communications problems with a Pixel2 XL which shares the same Snapdragon 835 SoC as the XZ1c and I need my USB hub for that as well.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Tim700_0:
Hello to all you developers and Sony XZ 1 Compact users.

I bought a used device because the screen of my original one is broken.

Bit I am trying to get the intact XZ 1 Compact G8441 working first before trying to get the screen off in one piece.

So I downgraded it from Android 9 back to 47.1.A.8.49_CE1 following all the instructions in this thread, backed up and extracted my TA partition and unlocked the bootloader.

All went well but after adb pushing my saved TA-locked.img back onto the phone the cam still shoots green pictures or crashes.

The routing status is displayed as "UNKNOWN" and the security configurations as "Test" in the service info / configuration menu.

The Service Tests / Security menu shows "None".

So something went wrong with restoring the TA partition or re-implementing the TA-locked.img?

Several attemps lead to the same outcome.

Do you have any tips for me? I am not sure if I should invest more time into trying to get DRM functionality back when planning to update fo Android 12 custom roms anyway?

Thank you in advance for your help!

Tim.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Dfis:
Hello

I really need to relock my Sony Xperia XZ1 Compact (G8441) after unlocking it...

Can anyone share DRM backup for this model/guide on how to relock it back again?

** Already downgraded to stock ROM by EMMA

Thanks!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
1) We had this conversation over in another thread. I don't know why yo don't believe me. You cannot relock the XZ1c. Asking somewhere else won't change that - it's been discussed many times before.

2) Getting someone else's DRM (trim area) backup is a bad idea. Not only will it _not_ relock your phone, it has the potential to brick it, because it has some phone-specific information. I do not advise trying.

Why do you "need" to relock your phone?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Dfis:
I do believe you! Just trying my luck in other threads, maybe someone knows something :)

To use Google Wallet, activate VoLTE/WiFi Calling, remove the unlock bootloader message in each restart....
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
It's not a "luck" thing. No one's done it. If you don't believe me, then do some searching to find more information.

Here are at least 5 links that turned up on a trivial search. They all corroborate my claim.

https://www.reddit.com/r/SonyXperia/comments/aoicfe

https://xdaforums.com/t/xz1-relock-bootloader-without-drm-key.3845759/

https://xdaforums.com/t/impossible-to-re-lock-bootloader.4293457/

https://xdaforums.com/t/how-can-i-relock-my-bootloader.3742589/

https://xdaforums.com/t/relocking-bootloader.4111305/

For your other thoughts:

- You can't remove the unlocked bootloader message. It's from the bootloader, and you can't relock.

- You shouldn't need a locked bootloader for VoLTE/Wifi calling, plenty of people have it without.

- I don't know enough about Google Wallet checks. I'm 95% sure it should be possible. If you don't have a rooted rom, it may just work. If you do, you could install one of the various root-hide and/or safetynet fix tools, and get past it that way. I don't use it myself, but I'm fairly certain other folks have tried and succeeded. It's also not an XZ1C specific thing.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] CookieCream:
Question for the XZ Premium:

HOW do I flash this Firmware? NewFlasher gives me just a bunch of errors. And I don't know but can I use Flashtool for this? I'm really desperate... (Since I don't even know what color the LED has to be (blue/green or another?) Can someone create a step-by-step tutorial? Please?

I figured out, that the LED needs to be green, to be in Flash mode and you can acess it by holding volume down

What if it just stands on 89772 events counts (for example) and more than 21 overwrites?

Is that a bad sign? Because i just thought it either crashed or didn't responded anymore. (and no, it wasn't green) Now it works but it took 17 attempts but i can't unlock my Bootloader (even unlocking is allowed)

EDIT: Everything works fine!

Do I have to do the process sometime again? (If i downgrade or flash a custom ROM)?

Istill don't know about downgrading, but anyways, here are my DRM (TA-locked/TA-unlocked) KEYS (maybe they'll help you)

Phone i have is : G8141; BLACK

in case you want to update/downgrade you need to flash the same files (in the folder) as you flashed for renoroot.

*reset userdata as well*

all of your games/system+data+internal storage/&folders will/and need to be reseted/deleted and configured new. xposed + some other stuff MAY BRICK YOUR PHONE
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] FP__96:
In need of some help. Stuck at step 5, whenever I enter the command lines it keeps saying: "/system/bin/sh: ./renoroot: can't execute: Is a directory"
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
Sounds like it's a directory.

Try

cd renoroot

and then running

./renoroot

again.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] FP__96:
Still doesn't work, now its not giving me permission...Unless I've done it wrong?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
You were in the wrong directory. You're going to have to run `chmod 755 reno*` again as well.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] FP__96:
It now says no file or directory exists?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
Every time you open the shell, you have to do all of the commands.

So you still have to start with `cd /data/local/tmp/renoroot`

If you've rebooted since, you might also have to `adb push` the files again.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] FP__96:
So i've rebooted the phone, re-trying from step 4 and now this shows up

I don't know if its got something to do with where I unzipped renoroot but I've placed them directly into the Minimal ADB installation folder.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
I think a lot of your problems would be solved if you increased your base level of understanding on what these commands are doing, and why your errors are happening.

It seems like for whatever reason you have a `renoroot` directory inside your /data/local/tmp folder. Since this is /data/local/tmp, and not /tmp, it's persisiting across reboots.

So you can't just push the files there, as a folder/file don't match. You could either push everything into the renoroot subfolder, and adjust accordingly, or you could remove the folder, and then proceed.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
it seems my xz1c died last week

I was watching a movie on it, it did not complain about low battery, then went asleep, the phone was totally dead in the morning:

it would not power on at all, no reaction, not charging led when put on charger

when left on charger for half a day, got sony logo hanging (still without charging led), tried forced reset, black screen, again on charger for some hour, hanging sony logo for the second time without charging led, forced reset, totally dead since then, can be on charger all day and night, nothing happens, not even the hanging sony logo

connecting to PC via usb does not do anything, in any mode (vol+ or vol- or no key) would not get anything enumerated on usb in my linux logs, the LED would not light in any color

just tried to replace the battery today - the new battery had 3.9V before putting it in, measured the old battery when removed, it got 4.29V, strange

it is unfortunate I do not have a backup of the stuff on internal flash :-(

anybody has any idea what could get wrong there?

or how to possibly fix it?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Aqq123:
I can relate to that. My XZ Premium died last week. I wasn't even doing anything at the time, just going through the settings of some app. The screen went black and the device started overheating noticeably on the back. I force-powered it off and it wouldn't turn back on. I thought the battery was the culprit and replaced it. With a new battery it works again but the screen is dead (no output or backlight but interestingly the digitizer works).

Still, in my case the LED lights up and I was able to get my data out via TWRP without looking at the screen. I then wiped it and reflashed it to stock (since I had a password set, which prevented booting into system without being able to see the screen), and now it works headlessly with scrcpy. I ordered a new screen (for sentimental reasons I guess, as it stopped making sense economically at this point) and will replace it when it arrives sometime next week.

Your case is more serious, and it seems you've already tried everything practical. You could try disconnecting all the non-essential peripherals from the system board since maybe the issue is with one of these. Apart from the battery (which is new, so can be assumed good) you only need a button to power it on and a way to connect via USB.

Is it possible the button board is faulty and it just doesn't register anything when pressed? I replaced mine before but this was due to the faulty fingerprint sensor, the rest of it was working fine, it's just all a single part on the XZ Premium. This wouldn't explain no LED for charging though.

One more thing to possibly check: on the XZ Premium at least there are some stickers for thermal conductivity. They're made of graphite, which is also electrically conductive. On my device at least, it seems these have started peeling off and falling apart. It's a long shot but maybe there is graphite dust somewhere causing a short circuit?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] multiwirth:
Hello there again,

I still have the ta-locked.img on my laptop and flashed lineage 19.1 onto my xz1 compact.

After i got the TA backup, i updated to last sony firmware and then unlocked and flashed lineage onto my phone, without restoring it.

Is it possible to restore it on my current firmware or do i have to downgrade first?

And the most important: will it actually make any differences on lineage at all? I´m using open camera for the most time.

I heard lineage emulates these drm keys anyways, but that was for an older sony device, no idea if it´s still the case on xz1 compact.

If there were no benefits, i´d just leave it as it is since i don´t plan on using sony OEM roms.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
Anybody, can you please share me TA partition of your SO-02K (or the fake G8441 which is in fact SO-02K)?

I am on the verge of enabling LTE band 20 on my SO-02K, but I need to compare several TA partitions of that model in order to identify ta units that are device specific vs that are identical within the SO-02K model range.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] norabitox:
Is this it?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
@norabitox yes, thank you

if anybody else can post TA from another SO-02K, I would still appreciate that too, as the more I have to compare, the better the analysis can be...
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] norabitox:
TA.img of another broken SO-02K
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] multiwirth:
Hey everyone,

I´d like to know if it was possible to use this to get a root shell on a non sony device.

I have a htc one m9 which runs android 7 and the security patch is from february 2017, so the vulnerability should be present.

Unfortunately htcdev.com no longer works and it´s impossible to unlock the bootloader right now.

There are ways to unlock it anyways BUT i need temp root to do so.

I tried to run renoroot on my m9 yesterday and it actually did something.

But after it still got nothing after 30 mins, i decided to give up.

Today i tried different things but nothing was working for me.

So i thought i should give it a try again but now it says "htc one m9 target not supported"

Had a look inside the renoroot file but it basically connects to something hosted on github, didn´t understand how it all works so far.

Maybe someone can point me to the right direction?

Thanks in advance.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
Unfortunately, this can not help you. The exploit is custom to both the ROM version and the device, as it relies on some timing details.

If you're still on Android 7, then there are probably other temporary root exploits available that would be more appropriate. I remember a "dirty cow" exploit (https://dirtycow.ninja/) that might be worth looking into, since it was only patched after Android 7, but it might depend on your particular security update/version.

Good luck!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] ce1eron:
UART ports for many devices have been added!

https://developer.sony.com/ja/develop/open-devices/guides/access-uart-ports

added devices:

Xperia XZ2

XperiaXZ2 Compact

Xperia XZ3

Xperia1

Xperia5

Xperia1 II

Xperia5 II

Xperia10 II

Xperia1 III

Xperia5 III

Xperia10 III
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] linkthis:
Hello fellow forum members,

I recently discovered that the download link for G8142-47.1.A.3.254_RU.rar has expired. I was wondering if any of you could kindly share an updated link or perhaps send the file directly to me? I would greatly appreciate your assistance.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] ecksdeeay:
I have that (I think) somewhere if you would give me a short while to find it for you.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] linkthis:
Thank you, but someone already sent it to me
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tybalt941:
I would be very grateful if someone could share the G8441_47.1.A.2.324_CE1.rar file for XZ1 Compact!

edit: I checked again and a mirror was available this time :)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] telescriptum:
Where can I find this attached PDF?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] munted:
Hi telescriptum,

Not sure what happened to the old attachments, I didn't remove them so maybe they expired???

I can't find "v3" of the guide that I wrote, just "v2" but they're pretty similar. I think j4nn asked me to make a change (see below) and that's the only difference. Please note I wrote this guide 5 years ago when I was going through the process and I haven't touched these tools at all since. Also if the method(s) has changed since then it won't be reflected in the attached guide. What I wrote worked for me at the time but obviously I accept no responsibility if you have any issues (or if you come across any dead links!!) Good luck.

@munted, your guide looks good, except the part with /oem/sh - that is misleading, please remove it.

That post with /oem/sh was just a hint for a way to develop a persistent root backdoor.

But the "important question" at the end of the post is _really_ important and without solving that it is not very useful...

It might also help to convert the guide to .pdf instead of a .doc file...

I may add a link into the first post if you like.

Thanks.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] telescriptum:
Thank you very much! This is really helpful to get me started. :)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Zayeah:
Hi all, I have just received a second hand XZ1 Compact on 47.2.A.11.228.

I am completely new to this world of ROMs, flashing etc. I am therefore a little uneasy about the process, and I want to make sure I get everything right first time, don't do anything wrong, and e.g. don't break the phone.

It seems the first thing I need to do, in order to be able to backup the TA partition, is to downgrade the firmware. I have checked the thread, as suggested, linked in the initial post in this thread but I cannot find any information about downgrading the firmware (I am not even sure what I am supposed to be checking that thread for).

I am not sure how to downgrade the firmware so that I can backup the TA partition so if I could have some guidance with that that would be much appreciated.

Thank you!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Zayeah:
I have tried to find out how to downgrade the firmware from the latest in order to backup, but I have not been successful. XperiFirm only has the latest firmware for XZ1 Compact as far as I could see. Any help/guidance much appreciated!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] zpunout:
There are links to the required firmware versions in the original post under the heading "supported targets". On a side note, read the instructions slowly because it is important to not make a mistake when flashing oem firmware. Make sure you have plenty of spare time without distractions.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] hschabel:
Hi,

thank you very much for this post.

I have a Sony XPERIA XZ premium (G8141 - maple) with LOS20 ROM.

I cannot understand that such a basic function is excluded from the kernel.

I tried to include the 3 above posted kernel modules but I am not able to get adp shell with su running.

Is there a possibility to compile or get a compiled kernel module for LOS20 with working LAN(USB)?

Are the above posted files suitable for lineage operating system 20 / android 13 or are they not working with this ROM?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] ardaxad:
Hi, looking to downgrade firmware to attempt ta backup - device is on build 47.2.A.11.228-R7C - Are the instructions in the original post complete? Anything to be aware of that might not be mentioned? Which supported target would you recommend...

47.1.A.2.324_CE1 or 47.1.A.8.49_CE1 ?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] zpunout:
The exploit, TA backup and restore instructions were complete and in my case was successful for my G8441 model. Pay attention to your exact phone model before commencing. Take photos of your "About phone" details.

Document each step you take so it will be easier to solve any potential issues, especially if you need to ask for help on the forum.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] ninjy:
Hi

I'm having hard time flashing with dm-verity enabled.

I enter:

stop recovery
export KEEPVERITY=true
recovery &
twrp install /sdcard0/Magisk-v26.4.zip
twrp install /sdcard0/kernel-G8441-47.2.A.11.228-hideunlock.zip

TWRP is restarting and it start flashing Magisk

Then when I press enter again to install the kernel, it is still logging:

Checking device...
lilac

Checking Android version...
9

Installing...
disabling dm-verity according to original kernel
dm-verity disabled!

Dont understand where I'm wrong here.

I booting on twrp-3.7.0_9-0-lilac via fastload.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] rez78:
I've not backuped drm keys. There's a way to obtain that keys? Did anyone can share for me? Thanks
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
Keys are unique per device. If you've already unlocked your bootloader, there is no way to recover them.

If you phone is not unlocked, then you can back them up using the instructions in this thread.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] hschabel:
I have Lineage OS 20 on my xperia xz premium.

I just installed magisk and the xz1-usbnet-modules.zip file.

Magisk is starting the modules according to its protocol.

Via adb I get the following responses.

Usbethernet is not working. When manually executing insmod over ADB, Exec format errors show up.

I have Sony XPERIA XZ Premium G8141. Is this different from XZ?

Maybe I needs to be compiled for G8141 maple? Can I download it somewhere?

L64:~$ adb shell

maple: $ su -c insmod usbnet.ko
insmod: failed to load usbnet.ko: Exec format error
maple: $ su -c insmod asix.ko
insmod: failed to load asix.ko: Exec format error
1|maple: $ su -c insmod ax88179_178a.ko
insmod: failed to load ax88179_178a.ko: Exec format error

maple:/ $ ifconig
/system/bin/sh: ifconig: inaccessible or not found
127|maple:/ $ ifconfig
lo Link encap:UNSPEC
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope: Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:0 TX bytes:0

dummy0 Link encap:UNSPEC
inet6 addr: fe80::a0f9:97ff:fed4:45c6/64 Scope: Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:560

rmnet_ipa0 Link encap:UNSPEC
UP RUNNING MTU:2000 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
@hschabel you need the usbnet modules compiled specifically for the kernel used with your los20.

Your best bet would be to ask the rom maintainer if he could enable those modules in his build.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] hschabel:
Hi j4nn,

ok. I see.

I think I understood. I try to find out, if I can find the right person at lineage. ..

Thank you very much for your reply.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] d3dm:
First of all, nice work so far.

As you've seen (and expected) you can not overwrite kernel code, however you can overwrite kernel data.

There are several paths to go about this a nice one I found was following blackhat[.]com/docs/us-17/thursday/us-17-Shen-Defeating-Samsung-KNOX-With-Zero-Privilege-wp.pdf Di Shen's (cant post URL's) method.

The downside to this is that most phones can be bricked if selinux is down for more then several seconds.

There are more exotic ways that includes vDSOs to overwrite a process memory.

I do not own a XZ device so I can't do much help there, but I will be working on an S7.

Let me know if you'd like to collaborate further and bounce ideas.