yashsingh1/xdaforums huggingface dataset:
[Sony Xperia X Compact Guides, News, & Discussion] tuten1000:
Sorry for not responding earlier. I was out.

There are two versions of the genesis kernel. One has a built in DRM patch, which doesn't require your TA data, but I couldn't get it to work with the FIDO_KEYS. The second version does NOT include the DRM patch. That's where ta_proc comes in. It uses your TA data and makes it available to any kernel. I just happen to like the genesis kernel, but the TA stuff should work with stock kernel as well.

I think you have to follow the instructions from "Put rom 34.2.A.0.311 on the phone:" forward. I haven't tried it, so be ready for some bumps.

Yes, phh is for root. Busybox is for mounting /system read-write. If you want adb or on-device terminal access with system read-writable, busybox is needed. I'm sure other tools are fine too.

.198 is the stock rom my phone (and I think the original release) came with. It has the bug that can be exploited and backup your TA. For the final rom, you can use whatever you like. I used 34.2.A.0.311 for my region.
[Sony Xperia X Compact Guides, News, & Discussion] NinjaFlood:
[MENTION=8177474]tuten1000[/MENTION]

Hi! Were you able to tingle patch the framework in order to enable signature spoofing ?

I would love to user MicroG in my XC too

https://github.com/ale5000-git/tingle/
[Sony Xperia X Compact Guides, News, & Discussion] tuten1000:
I didn't use tingle. I just replaced the google apk (/system/priv-app/GmsCore/GmsCore.apk) with the microg apk.
[Sony Xperia X Compact Guides, News, & Discussion] kirko62:
I'm thinking of buying an X Compact. Just to clarify, after successfully performing all the above steps, I should end up with a phone that is both rooted and has access to Sony's DRM features (e.g. improved camera and PS4 Remote Play)?
[Sony Xperia X Compact Guides, News, & Discussion] tuten1000:
That's correct. Just don't remove some of the Sony/Google stuff you care about.
[Sony Xperia X Compact Guides, News, & Discussion] trewelu:
If I want to use stock kernel, I just need to extract boot.img from official sony ftf and use that one instead?

After creating the modified boot.img, can I just use this?

fastboot flash boot modified-boot.img
fastboot flash recovery twrp.img

and flash the supersu/superuser from twrp?

What to do if there is a security update? Can I just update within the phone, recreate boot img from the new ftf and flash it again?

How about major android update, can we still update from within the phone?
[Sony Xperia X Compact Guides, News, & Discussion] Spockman89:
hello everyone, so just to be sure: backup ta - unlock bootloader - flash kernel - flash twrp - flash supersu. is it ok? if i want the stock kernel is the same? or i must to flash this one? and if i want revert back is it possible relock the bootloader for guarranty? thanks in advance
[Sony Xperia X Compact Guides, News, & Discussion] mhemart:
trewelu,

For me, I had troubles with rezipping the XC Genesis kernel. It gave me an unflashable ZIP using TWRP (even with 7-zip) : bootloops, TWRP stopped working... The big stress ! So I just flashed the new_boot.img using the fastboot command you proposed (and then TWRP and SuperSU). What is nice with the TA.img included XC Genesis patched kernel is that you won't have the unlocked message at boot anymore, you recover your DRM and if there is any trouble, you will be able to use Xperia Companion for recovering your phone as an untouched one.

So to answer your question, I think yes, you can use the stock boot.img.

And I don't recommand to use OTA for updating. It's better to use flashtool : you will prevent an unwanted update of the kernel.

If I say something wrong please correct me !!! :)
[Sony Xperia X Compact Guides, News, & Discussion] NinjaFlood:
I'm on 34.2.A.2.69

I'm failing to backup my DRM keys with the Dirty Cow exploit script. I'm a Linux user.

Do I need to downgrade the firmware? How?

Any help would be appreciated.
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
You do yes, see if there's and old FW in XperiFirm or browse the threads here for an ftf.
[Sony Xperia X Compact Guides, News, & Discussion] tuten1000:
I agree with mhemart that it should work. Please confirm if you try it.

Updating from within the phone would overwrite all the changes, so I wouldn't recommend it. Backup your phone and redo the steps. It doesn't take long once you've done it a few times :o
[Sony Xperia X Compact Guides, News, & Discussion] tuten1000:
In addition to downgrading, there is at least one report that dirty cow doesn't work on linux.

See Magissia's post earlier in this thread (https://xdaforums.com/showpost.php?p=71877283&postcount=3)
[Sony Xperia X Compact Guides, News, & Discussion] tuten1000:
In order:

1. Backup TA

2. Unlock phone

3. Flash new rom

4. Flash twrp

5. Flash kernel. There is at least one report from mhemart that you can flash the modified kernel then twrp.

6. Flash superuser, install busybox and superuser apk

I don't know of anyone who has managed to relock their X compact.
[Sony Xperia X Compact Guides, News, & Discussion] mhemart:
Is there a particular reason you suggest to unlock before updating to the latest rom. What I did is to backup my ta/drm then update using ota because I'm always scared the first time I need to root a phone and then I unlocked and flashed all the different images.

I will precise that twrp was already installed when I flashed the modified kernel but twrp didn't work because I was using an old version not compatible with nougat.
[Sony Xperia X Compact Guides, News, & Discussion] tuten1000:
No real reason. I guess I just like to take control as quickly as possible. All the interesting stuff needs an unlocked bootloader, so there is no point if the device can't be unlocked for some reason.
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
I'm pretty sure I did when I first tinkered with mine as I got rid of the annoying "can't be trusted" boot message, got it now though as I am unlocked but if the phone no longer tells you about the trust issue you would assume you've relocked it.
[Sony Xperia X Compact Guides, News, & Discussion] cmstlist:
Hey, I just ordered a refurbished Xperia X Compact. Sadly nobody sells the XXC in Canada with a usable Sony warranty, and Sony Canada will not service US warranties, and Sony USA will not service in Canada... so refurb ended up being my only option. At least it comes with a 90 day guarantee.

So anyway I have no idea what firmware version it will come with. What is the highest that still supports backing up the TA partition?

EDIT: Also the use of superuser.zip from superuser.phh.me - is this just the author's choice vs SuperSU, Magisk etc? Or is there a specific reason this one works really well with Xperia?
[Sony Xperia X Compact Guides, News, & Discussion] itandy:
You can also downgrade to MM to run DirtyCow to backup TA if your phone comes with N.

As for SU, all of them work fine. But if you plan to go for systemless, for reason unknown, the latest Tobias repack tool didn't work for me. I had to use version 5.0 which supports SuperSU only. And if you need to hide SU, then Magisk is your choice.
[Sony Xperia X Compact Guides, News, & Discussion] cmstlist:
Good to know thanks. I was thinking systemless because of Netflix.
[Sony Xperia X Compact Guides, News, & Discussion] trewelu:
I can confirm it works in linux. Dirty Cow use timing attack, so it kind of random. It need to happen at correct time for it to work
[Sony Xperia X Compact Guides, News, & Discussion] cmstlist:
Device arrived, and came with 34.1.A.1.198. I successfully backed up the TA partition with dirtycow.

I'm in no rush to root though. Is there anything else in the root guide that would be impossible if I let it take the OTA right now up to the latest Nougat?
[Sony Xperia X Compact Guides, News, & Discussion] cmstlist:
LOL damn I didn't realize Goog is now enforcing that "your device has been unlocked and can't be trusted" screen. Wish there were a way to not so obviously advertise it to a would-be thief or onlooker.
[Sony Xperia X Compact Guides, News, & Discussion] trewelu:
Theoretically, Sony has your phone IMEI when you unlock bootloader. They can always check that list as well. (You may say that you request the code without unlocking it, but it will raise their suspicion regardless)

There is a way for mediatek device, but I haven't found one for x compact (or any SD xperia). At least that message go away if you copy back the TA partition and restore it to stock.
[Sony Xperia X Compact Guides, News, & Discussion] cmstlist:
So I'm currently on 34.2.A.2.69. I installed the custom kernel, substituting Magisk for Superuser. Seems to work so far, although Magisk Hide is still not making Netflix visible in Play Store. Oh well.

But here's a strange thing. The phone then downloaded me an OTA update and says it's to 34.2.A.0.273. That doesn't make any sense - it's older than what I already have. Any idea why this might be happening?
[Sony Xperia X Compact Guides, News, & Discussion] trewelu:
I had the same problem (FE heroes instead of netflix). Someone mentioning the need to wipe playstore data and wait for a while (the status is cached?).

I could use ps remote play though.
[Sony Xperia X Compact Guides, News, & Discussion] cmstlist:
I went with the APK Netflix provides directly to people who can't see it on Play Store anymore due to OS version. It's nearly the same version as the last one my Nexus 5 could see before it dropped out of Play Store. Seems to still be willing to do downloads.
[Sony Xperia X Compact Guides, News, & Discussion] cmstlist:
Spoke too soon. A few hours after the Play Store wipe, Netflix returned. :)
[Sony Xperia X Compact Guides, News, & Discussion] cmstlist:
So I just wanted to bump this again - why would it offer me an OTA to a version several months older than what is already installed??
[Sony Xperia X Compact Guides, News, & Discussion] Jility:
Just received my X Compact. Do I really need to backup TA keys?

My phone came with Android 7.0 and the backupTa does not work on Nougat it says.

If I really need it please point me to a downgrade guide since I didnt find any.

Thanks!!
[Sony Xperia X Compact Guides, News, & Discussion] vodkasolution:
Here's the same, no TA backup because of Nougat, and I am now stuck in a bootloop. I only can enter TWRP, any suggestion? Thanks!
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
It's not essential.

To downgrade simply flash an older firmware.

Reflash the firmware using the flashtool.
[Sony Xperia X Compact Guides, News, & Discussion] efaustus9:
This guide is excellent, very detailed, very helpful, I just have a couple questions

I am on the step using Xperifirm to download the service exchange unit - 34.1.A.1.198 firmware. I downloaded it through the xperifirm software and it completed but I cant find where xperifirm put the firmware file, what is the default directory the software downloads to? Also this step mentions for posterity to download the latest rom for your region. Where do I find the original factory marshmallow rom for my USA region?

Thanks in advance
[Sony Xperia X Compact Guides, News, & Discussion] vodkasolution:
Thanks for the hint :)

I now have my XC working again, with Nougat and unlocked bootloader; to gain root do I have to flash Marshmallow, backup the TA and go on with the first post guide?
[Sony Xperia X Compact Guides, News, & Discussion] Foxleone:
Hey guys, how can I unroot now? without flash stock rom and lost all data.

I change some apps with root but I need unroot the celphone for the apps with block in root

Thanks and sorry for my english
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
If you've unlocked already you've lost your TA so might as well simply root Nougat.
[Sony Xperia X Compact Guides, News, & Discussion] efaustus9:
I made it through the guide to the point where I flashed the Kernel and SU then rebooted. I waited for 30 minutes on the sony splash screen before I rebooted the phone into recovery. I attempted to reflash the kernel but it failed notifying me the partition could not be mounted. I reflashed the ftf using flashtools and I was able to get out of the boot loop, however every time I try to flash the kernel in recovery I get stuck in a boot loop. Looking over the XC Genesis Kernel thread it says the kernel is for stock Sony 34.2.A.0.xxx ROMS (Nougat 7.0). I wonder if this is the source of my problem. This guide recommends MM, and I intend to stay on MM (until xposed framework works nougat)

Many thanks
[Sony Xperia X Compact Guides, News, & Discussion] vodkasolution:
Thanks again, but I'm missing something:

I have to flash MM (Xperifirm does not show it, I need the Italian version I suppose or can I go with the European?)

install supersu via twrp

then how can I upgrade to Nougat keeping the root?
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
Sorry, edited my initial post to say Nougat. If your BL is already unlocked then simply flash SU and you're done. 34.1.A.1.198 is MM and Xperifirm does have it, select "check all" top right and you'll see it.
[Sony Xperia X Compact Guides, News, & Discussion] Foxleone:
How can I unroot the phone? help please :( is even possible without flash stock rom?
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
unroot
[Sony Xperia X Compact Guides, News, & Discussion] Foxleone:
Already search, SuperSU unroot option not working maybe because I'm using Superuser

And the most guides only say "flash stock rom"
[Sony Xperia X Compact Guides, News, & Discussion] vodkasolution:
I'm losing my focus :/

I used flashtool and xperifim to flash fw 34.2.a.2.69 Nougat to my bootloader unlocked X Compact, then I flashed TWRP

I put SuperSu in the SD card and installed via TWRP but I got an error at the very beginning of the operation:

[IMG="screenshot"]http://i.imgur.com/2sPmp8X.jpg[/IMG]

it says:

file decryption failed

can't decrypt with password

you should format Data

updating partition details...done

can't mount archive

can't mount system

SELinux support not there

can't mount sytem

I tried formatting Data from TWRP but nothing changed

So SuperSU is not installed and the device not rooted.

Do I have to flash 34.1.A.1.198, then again TWRP and finally SuperSU?
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
Flash Nougat, then flash the kernel and TWRP from the zip - 69_twrp_su

fastboot flash boot 34.2.A.2.69.img

fastboot flash recovery TWRP-3.0.2-3-F5321-rec.img

Don't boot yet.

Fastboot format userdata

Fastboot format cache

Reboot, flash SuperSU.
[Sony Xperia X Compact Guides, News, & Discussion] vodkasolution:
Thanks again

THIS is the perfect guide to easily root a X Compact.

I want to buy you a beer (or a coffee if you don't drink), tell me how
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
No problem, sorry for the initial confusion about typing MM instead of Nougat. The thanks is enough btw. :)
[Sony Xperia X Compact Guides, News, & Discussion] ypnos42:
I got a new Xperia X Compact which unfortunately already had Nougat installed (34.2.A.XXX). In this case BackupTA does not work (as clearly stated). You first have to downgrade the firmware.

1. Use XperiFirm (can also be launched from Flashtool) to download the "service exchange unit" 34.1.A.1.198 Firmware.

2. Use Flashtool to bundle the firmware. The Branding / Version strings don't matter.

3. Use Flashtool to flash the firmware. Make sure to check all wipes or you will run into a bootloop!

More details about these steps can also be found in the latter part of the guide where a new stock firmware is flashed.
[Sony Xperia X Compact Guides, News, & Discussion] Hego555:
After using fastboot to flash the new kernel, I enter recovery but it is unable to mount anything. It doesn't see the internal storage, and instead it says 0MB. any ideas?
[Sony Xperia X Compact Guides, News, & Discussion] Kianush:
So I have a problem with using ta_poc

I dont know where to copy my boot.img and ta-f5321.img because it says copy in the folder which has .exe file and there are 2 folders that have that!

anyway I copied them in both folders and ran DOUBLECLICKME.bat and chose both files but nothing happens and gives me this error:

'ta_poc' is not recognized as an internal or external command,

operable program or batch file.

Press any key to continue . . .

what's the problem?!

sometimes it makes a file named ta.img but the size is exactly the same as my ta-f5321.img backup so I know that it isnt a kernel!

please help me
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
There is only 1 ta_poc.exe file! Download the rar, extract it, put your imgs in the folder with the DOUBLECLICKMEFIRST file, run it and follow the instructions, simple.
[Sony Xperia X Compact Guides, News, & Discussion] Kianush:
I told you what error it gives me, does it need adb or anithing like that?! because command promp give an error not understanding the commands

also the only thing it makes is a ta.img file with 2 mb size! my kernel is 17 mb! is it ok?!?!?!
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
You mentioned about two folders containing exe files when they should only be in the main folder so thought something might be conflicting. Or have you mistook this "open DOUBLECLICKME.bat with text editor and change kernel name!" and edited the file? It shouldn't need adb.
[Sony Xperia X Compact Guides, News, & Discussion] Kianush:
Which line should I change when opening that with text editor?

I said I put boot.img which is 17mb and Ta-F5321.img which is 2mb and after the process it makes a file named ta.img and its 2mb!

I dont seem to understand what is causing problem here.
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
You don't change anything that was my point, I don't understand the problem here either. If you want to zip up both and PM them both to me I'll do it for you.
[Sony Xperia X Compact Guides, News, & Discussion] Kianush:
well thanks you very much man I think I found the problem

it was with the extravtion of ta_poc.zip in the first place, now it worked and made 2 files, new_boot.img which is 200kb more than my boot.img and a ta.img which has no difference in size with the old on. Im gonna try them to see if they work

-------------------------

assuming that they would work, in future if I want to flash new rom and kernel should I unlock my bootloader again or it is unlocked and just shows as locked?!
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
I thought something didn't seem right. Are you all up and running now?

Once you unlock you'll stay unlocked until you relock but you will still have the message at boot about being unlocked even using this fix, and currently there is no way round it.
[Sony Xperia X Compact Guides, News, & Discussion] Kianush:
YEAH, Its up n running very well, thanks to you.

google must have put a hard time on that one makin sure it wont be removed!
[Sony Xperia X Compact Guides, News, & Discussion] stevuna:
Sorry for the noob question, I've flashed superuser.zip through recovery. Root checker says I'm rooted. I can't write to system but only copy files from system to external for example. Titanium backup works well though. How can i enable write to system? I'm on nougat x compact unlocked bootloader stock kernel. Thanks in advance.

---------- Post added at 06:47 PM ---------- Previous post was at 06:40 PM ----------

When you say ''reboot'', does it mean reboot to recovery and then flash supersu zip? In this way the phone will it be rooted and the recovery won't show ''insert password'' when i enter it? thanks for the answer and the guide.

Regards.
[Sony Xperia X Compact Guides, News, & Discussion] SXUsr:
Yes and yes.
[Sony Xperia X Compact Guides, News, & Discussion] recurvered89:
Thanks for this my x compact is in the mail and i'm trying to read up all I can about rooting so I can hop right in. I know you have to use MM in order to get your drm key but are you able to upgrade to 7.0 after? or is there a way to update to 7.0 after you do all these steps and still keep root?
[Sony Xperia X Compact Guides, News, & Discussion] TheCrap:
You are right. I forgot to mention that you need the MM Version for the key image and for nothing else. With the updated guide you will end with an x compact running the newest stock 7.1.1 Rom which was released a few days ago(one day started to root and had to start over again *grml*)
[Sony Xperia X Compact Guides, News, & Discussion] recurvered89:
lol damn that sucks, having to start over again. One more dumb question, following your guide we would be flashing an international version of the firmware correct? so the fingerprint sensor should be enabled right?
[Sony Xperia X Compact Guides, News, & Discussion] TheCrap:
I have not tried it but i should work. I will try when i come home

EDIT: Fingerprint works
[Sony Xperia X Compact Guides, News, & Discussion] recurvered89:
Just wanted to say thanks, I used this guide yesterday to root my xperia x compact. Only mistake I made was when I flashed the rom I didn't apply the patch to flashtools which caused it to error and I accidently rebooted and I got the error "System not installed plug into computer" or something along those lines. I just patched flashtools and did it again and everything worked fine.

Thanks again
[Sony Xperia X Compact Guides, News, & Discussion] recurvered89:
Two more quick questions hopefully you or someone on this thread could answer for me.

I'm having a problem with my wifi on certain networks, not sure what the issue is yet trying to figure it out but some people have suggested doing a factory reset, what happens to the firmware/dk/root all that stuff when I do a reset or should I avoid one of those at all costs?

Lets say they come out with a new firmware update for the compact, do you know what the process would be to update? do I just flash the new firmware or do I have to do this process over again with the new firmware img?

Thanks
[Sony Xperia X Compact Guides, News, & Discussion] TheCrap:
Factory reset should just reset the phone, delete all apps and setting etc but root should still exist. But i'm not 100% sure

For the update i can just talk for my Oneplus 3. When there is an OTA i start it, it fails because unlocked bootloader is not supported by OTA. Oneplus offers me a full update, i flash it using TWRP, install the newest SuperSU, (install custom kernel if you want), uninstall the bloatware(again) and everything is fine. All setting should stay
[Sony Xperia X Compact Guides, News, & Discussion] vodkasolution:
I just received the notification about official Sony update to 34.3.A.0.206. What if I install the update?

Do I have to root again the phone?
[Sony Xperia X Compact Guides, News, & Discussion] SebS23:
[MENTION=8410083]TheCrap[/MENTION]

Thank you, worked perfectly for me!

You just got one little typo, it should be kernel.elf instead of kernel.efi. ;)

Is it possible to lock the bootloader again, and keep root?

Because I used the original kernal and original rom.
[Sony Xperia X Compact Guides, News, & Discussion] piruzinho:
Wanted to thank everyone in this thread and especially OP [MENTION=8177474]tuten1000[/MENTION] for the concise instructions, worked perfectly. My modifications/suggestions:

1. I am in the US and used the "Customized UK" firmware as written by [MENTION=6305524]drrobo[/MENTION] in this thread instead of "34.2.A.0.311" and worked perfectly and that way I got latest Nougat and fingerprint opening;

2. 'Fastboot devices' was not working for me with the updated Sony developer Google USB Driver on Windows 10, i had to disable secure driver signing, restart and then manually update the "Fastboot Driver' from the Device Manager with the correct path;

3. Superuser was outdated so had to replace it with something more recent.
[Sony Xperia X Compact Guides, News, & Discussion] 8oldemar:
After the second boot in the recovery, a password request is issued. Recovery begins to glitch. What to do?
[Sony Xperia X Compact Guides, News, & Discussion] supermassiveblack:
Does root works on Nougat 7.1.1?

Unfortunately i had the automatic update enabled and my phone has already updated to 7.1.1 :( :(