DRM and custom kernel - Sony Xperia X Compact Questions & Answers

Hi all,
I have two questions:
1 What data is being stored in the drm-protected partition on the xc? I know that it was (among othets) camera related stuff on the z5c. Do I need to worry about just unlocking the bootloader without doing a tedious backup process (for which there's only good documentation for the z5c anyway)?
Do I need a custom kernel if I want to flash twrp after unlocking my bootloader? Or is update to latest software > unlock bootloader > fastboot flash recovery.img ?
Thanks a lot!

ApplepieFTW said:
1 What data is being stored in the drm-protected partition on the xc? I know that it was (among othets) camera related stuff on the z5c. Do I need to worry about just unlocking the bootloader without doing a tedious backup process (for which there's only good documentation for the z5c anyway)?
Click to expand...
Click to collapse
Only the keys to unlock the functions are stored there. So yeah, without the DRM-patch or DRM-fix there's no denoising on the camera etc. You don't have to backup the keys get full camera functionality back, check the thread from next answer.
ApplepieFTW said:
Do I need a custom kernel if I want to flash twrp after unlocking my bootloader? Or is update to latest software > unlock bootloader > fastboot flash recovery.img ?
Click to expand...
Click to collapse
If you want to go to Nougat (Android 7), check the steps here:
https://forum.xda-developers.com/showpost.php?p=70657390&postcount=60
You can just skip the TA keys flashing part as it's a bit complicated, but I would recommend doing the backup so that you can restore the phone to factory settings in case you need to use the warranty services.
Me personally I'm sticking with Android 6 as I can't imagine using any new phone without XPrivacy.

1. you will loose the same functions x-reality, denoise, all that 'special' sony stuff.
2. you can flash twrp with stock kernel.
you need to be on MM to backup the TA partition (device key) but if you are on MM a backup will take less than 2 mins and all you need is click a icon, you can also use the latest version of flashtool to back it up. but yeah if you upgraded to nougat the downgrade is a bit tedious. :/

realtuxen said:
1. you will loose the same functions x-reality, denoise, all that 'special' sony stuff.
2. you can flash twrp with stock kernel.
you need to be on MM to backup the TA partition (device key) but if you are on MM a backup will take less than 2 mins and all you need is click a icon, you can also use the latest version of flashtool to back it up. but yeah if you upgraded to nougat the downgrade is a bit tedious. :/
Click to expand...
Click to collapse
Alright thanks! It's nice that I don't have to flash the kernel since iirc that's the only way you can actually break things.
I also discovered the easy dirtycow backup, I definitely didn't want to go through the z5c backup process. Let's hope the xc I'm going to buy isn't on 7.x yet

Related

[Knowledge Base] Introduction to the Sony (-Ericsson) Xperia Galaxy

But... why?
Well, many people like and buy the Xperia line of devices currently on the market who previously owned a Samsung, LG or HTC. There are many differences in hardware, but most certainly in how Sony perceives the Android ecosystem and how it differs from the other major brands. This (noob) guide is meant to help people on the path to the Sony side I'm sure it contains lots of info which is even useful for the old timers
Things which differ a LOT from the other brands:
First and foremost: no recovery partition;
Second but not least: no download mode.
Sony has replaced the Android recovery partition with the FOTA kernel, which is meant to aid the device in rolling out OTA updates, which allow kernel updates without the risk of bricking the device. I hear you scream: "But wait, what about the recovery partition announcement by Sony themselves!?", well the answer is simple: that is meant for unlocked bootloader devices ONLY, as a part of their "Open Devices" program.
What is Flashmode, Flashtool and what are these FTF and SIN files I am reading about?
I'm going to quote @Androxyde here (it's a straight copy of his index page), as he is the maintainer of the tool:
Flashtool is a S1 flashing software that works for all Sony phones from X10 to Xperia Z Ultra. They all use the S1 protocol for flashing firmwares.
This program was originally made to flash sin files downloaded by SEUS/SUS or PC Companion.
Based on a command line tool written by @Bin4ry (Andreas Makris), I brought a user interface to sin files flashing.
We worked together to add more features to the tool such as rooting methods implementation or TA backup / restore.
Then I took the lead and got some advice and help from him occasionally on some features like rom cleaner or bootloader unlocking.
From time to time, sin files have been bundled into what is now well known FTF (Flash Tool Firmwares) and more features have been implemented.
But flashing firmwares is still the core of Flashtool (that is updated at least to follow Sony improvements around sin files) and the reason of its name.
Flashtool can also easily unlock the bootloader of the phone using the BLU icon as far as the bootloader of your phone is unlockable
The flashing feature as well as bootloader unlock feature are available whatever the phone is recognized or not by the application. What is only mandatory for flashing is to own the FTF file according to the device you want to flash it on.
Why should I use Flashtool?
Once bootloader unlocked, official sony tools do not work anymore.
Using official sony tools, you can only upgrade. No downgrade possible.
Using flashtool, you can choose what to flash and what not to flash. This said, many rooting scenarios are available implying kernel only downgrade to retrieve a patched rooting exploit and then flash back the right kernel.
You said unlocking bootloader?
This process gives you the opportunity to flash custom roms such as CyanogenMod ROMs.
I invite you to visit the FXP Project that brings CM and AOSP to xperia devices.
Click to expand...
Click to collapse
To complete this explanation, Sony devices know 2 bootloader based flash modes:
Flashmode (This is the S1 flash protocol @Androxyde wrote about)
Fastboot (This is the original, unmodified fastboot mode from Google)
In the past there was the Sony-Ericsson Update Software/Service (SEUS, later named SUS because Ericsson got removed from the name) which could update your device to the latest software or recover it from an inoperable state. PC Companion was less of a tool for updating and more of making backups, installing applications and managing the device storage. Sometime the past 3-4 years Sony merged the 2 programs, so if people on XDA or anywhere on the web talk about using PC Companion to restore their device, they are not wrong, they are simply using the latest version
Sony recently released their own package called 'flash tool' (to add to the confusion of noobs in the community), which deep down is a little easier to use and stripped down version of EMMA, which is a tool we mere mortals will probably never use as EMMA is the flash tool for Sony's repair shops and tech support. It's primary function is to allow owners of an unlocked bootloader device (or, 'open device' as Sony named it) to still use Sony firmwares and update their device, because as soon as you unlock the bootloader, the OTA updates will stop.
Things to remember on the files used by these tools:
An FTF file is basically not more then a ZIP archive containing multiple SIN files, you can open the FTF using 7z/WinZip/WinRar and look inside it.
A SIN file is a disk/partition image, which is encrypted by Sony. S1 (the bootloader) will check this encryption to make sure the image was not tampered with before it accepts it for flashing.
Fastboot flashing will always fail when the device is still in a locked bootloader state. For some models it is even disabled entirely or non-functional until you unlock the bootloader.
I am reading about the TA, what is it, why should I make a backup?
The TA partition (Trim Area) is a signed partition which holds various things which are unique to your device, like the device's IMEI, DRM keys and bootloader settings and configuration options. This partition can not be exchanged between devices, because it really is unique. If you would flash the TA backup from someone else it will cause a hard-brick rendering your device only useful as a paperweight...
When you unlock your bootloader you will lose all the DRM features on your device, this makes it valuable to have a backup of the unmodified version stowed away somewhere safe. You will need root level access to create that backup before unlocking. There is a tool called Backup TA which is widely used to create and restore backups of the TA partition. TWRP in XZDualRecovery can do the same.
When you restore the backup TA partition you made before unlocking the bootloader you will essentially re-lock the bootloader and restores the DRM keys. This process is (as far as we know up to now) undetectable by Sony's support staff, which makes it easy to restore the phone to stock for warranty driven support issues as unlocking your bootloader will void your warranty on the device (it is subject to local law though). That is why, for a lot of owners of a Sony device at least, it is considered to be the "Holy Grail" and is usually the reason for a lot of users to wait for a root exploit to be found before unlocking their bootloader.
Okay, I get it now. I would like to unlock my bootloader, how to proceed?
I'm not here to rewrite everything other people or Sony themselves can write just as well or even better, so I have a link for you:
http://developer.sonymobile.com/unlockbootloader/
Read it, it will teach you just about everything you need to know.
Once your bootloader is unlocked, your device will be much like a Nexus device when it comes to rooting, excluding the recovery partition, so that's why we flash or hotboot a custom kernel with a recovery, by using fastboot. If you are afraid of a terminal and typing commands, you can use a tool like QuickIMG or Flashtool to make your life easier.
Right, now I want root!
Well, if you have an 'open device', this is a lot easier then you think. Just remember that using root exploit kits is unnecessary and in some cases even risky as some packages do funky things or jeopardize your privacy.
Try to find a 'stock based' custom kernel. These are custom kernels built by the community to add features to the kernel but are meant to work with Sony's stock firmwares. I'm the maintainer of XZDualRecovery myself and created the Kernel Builder for the supported devices.
These custom kernels will NOT root your device (unless otherwise stated by the creator), but introduce a recovery to the boot process and with that you will be able to flash SuperSU to root your ROM.
But you just said Sony devices don't have a recovery partition, please... UN-confuse me!!
Yes, I did, and I'm right: there have been bright minds in the community who included a recovery in the boot image (the kernel partition) in the past and that way included a recovery on our Sony devices.
With the current 'open devices' policy from Sony, we now have:
Recovery stored inside the system partition, which is meant for locked bootloader devices (closed devices) because they can not run custom kernels;
Recovery stored in the boot image (for open devices);
Recovery stored on the FOTA partition, but with a trigger from the regular boot image at boot (also for open devices);
Recovery stored on the FOTA partition -renamed to recovery- together with an updated bootloader (for open devices, of course).
Hmm, okay... it's still confusing, but OK. My service menu says I'm rooted, but none of the root apps work properly, what gives?!
If you open the phone dialer app and on the keys see the letters below the digits, you can spell the word SERVICE. Type *#*#SERVICE#*#* and a service menu will pop up. Tap 'Service Info' and then 'Configuration'. Then you will see one of these lines there almost on the bottom of the list:
"Rooting status: unknown": it's probably unlocked, but it was unable to verify that;
"Rooting status: rooted": you have unlocked the bootloader;
"Unlock bootloader allowed: YES/NO": this tells you if the bootloader is (vendor-) locked or not, if it says NO, you're out of luck.
The rooting status there is not telling your system is rooted, it tells you your bootloader is and will allow custom rom/kernel flashing. Don't confuse these two.
I'm not allowed to unlock my bootloader But I still want root, can I?
In some cases you can. It depends on the bugs found in specific firmware versions which allow a root exploit to be developed.
From the 2015 range of Xperia devices Sony started using dm-verity, which causes a bootloop once the system partition is modified. This modification of the system partition will be required to include a SU binary in the system to obtain root, so until a dm-verity defeating option is found, locked bootloader root or recovery will not be possible.
For older models, check the device forums and the cross device development forums to check out the community rootkits available. Usually it will tell you what ROM version it is intended for. Be careful with rootkits/roottools though, some are also found to be introducing malware to your device or sending privacy sensitive data to the creators. Use common sense, if you have no valid use for the root user level, keep it off your phone. If you already have recovery, you can use that to modify or clean your device instead.
I have rooted my phone, but whenever I try to modify something on it it spontaneously reboots or I get a message 'Permission denied" when trying to remount the system partition R/W! Why is that?
Like all manufacturers, Sony tries to make it difficult (or downright impossible) to modify the Android base system they created. Because if you can, anyone or anything which obtains root access can. This is a serious security risk, because if it's malware which puts itself on the system partition and locks up your phone, the only way around this is to wipe your entire device and restore a stock ROM using PC Companion or Flashtool. Of course, they have their own proprietary software to protect as well, but security is the main objective here. The really sensitive bits are stored in the TA partition as I explained earlier.
Sony (-Ericsson) had a service called RIC, which in time moved partially in to a kernel feature. What it does is monitor if system is remounted writeable. This usually is a situation you want to avoid at all costs so RIC will deny you permission, cause a kernel panic OR simply reboots your device to get out of that state.
"Remount-Reboot fix", RICKiller, RICDefeat, and XZDualRecovery all (attempt to) disable this service or stop the kernel from acting on a remount of system.
Hard-bricks, Soft-bricks, bootloops??
They are simple to understand, really:
Hard-brick, TYPICALLY NOT RECOVERABLE: The bootloader stopped functioning, this can be caused by a bad flash/update or by restoring the wrong TA backup.
Soft-Brick, ALWAYS RECOVERABLE: the system partition is corrupted or just simply empty, this causes the device to stall at boot. A soft-brick can also make the screen remain off, because of a bad or missing kernel image.
Bootloops, ALWAYS RECOVERABLE: If the system gets powered up and then reboots during the start. This can be at the kernel splash screen or during the boot animation.
In case of a Soft-brick or Bootloop:
Use the installed recovery (if it still works), PC Companion, QuickIMG or Flashtool to restore your device to working order.
In case of a Hard-brick:
You can never recover from that state without physically opening your device and do some heavy duty engineering (JTagging) on it to flash back the correct bootloader/TA (read that link to see what it would take!). This is way too difficult for 98% of the community, which means that hard-bricking your device is typically the creation of a very expensive paper weight.
Please, be extremely careful when dealing with the TA partition.
*********************************************
I will be updating the above text for sure, if you feel anything is missing, please write a post in this thread with the text you wish to include. I want this to be a community driven guide and I know a lot, but I can't know everything
*********************************************
Extended the text some more to include ideas from:
@Klaos3000
@Yenkazu
Thanks for the suggestions/additions guys! :highfive:
As it concern the recovery, i think you can create a partition with EMMA.
Sent from Greece
kos25k said:
As it concern the recovery, i think you can create a partition with EMMA.
Sent from Greece
Click to expand...
Click to collapse
Please, re-read the first part...
Can I root my iPhone 6 with this guide?
That was a bad joke.
Very useful guide. We should probably educate people around here about what an unlocked bootloader actually means and what it let us do. I'm shocked by the number of people using Kingroot and other risky closed-sourced tools, especially the ones with an unlocked bootloader.
People of earth, if your bootloader is unlocked, it means that your device will be much like a Nexus device when it comes to rooting, sans the recovery partition, so that's why we flash or hotboot a custom kernel with a recovery, by using fastboot. If you're afraid of a terminal and commands, then you can use a tool like QuickIMG. After that, you simply flash SuperSU. That's it!
You can add something about TA Partition and RIC server. :3
Good thread btw
Yenkazu said:
You can add something about TA Partition and RIC server. :3
Good thread btw
Click to expand...
Click to collapse
I'd say, give me a piece of text on the subject for the OP and I'll include it :good:
[NUT] said:
I'd say, give me a piece of text on the subject for the OP and I'll include it :good:
Click to expand...
Click to collapse
RIC, from your thread :3
http://forum.xda-developers.com/xpe...b-definitive-root-remount-reboot-fix-t2317432
But, it's kinda useless if people already use your DualRec, since it's already integrated xD
But more info didn't hurt (?)
TA Partition
http://forum.xda-developers.com/xperia-z/help/ta-partition-t2451186
Not really details, but user should know the impact of unlocking bootloader
Updated the OP to include info on the TA partition and RIC protection. Also included a part of the post by @Klaos3000, because it contained some useful info
Thanks guys :highfive:
Very usefull! :good: But for me 2-3 Weeks to late. I'm still quite new on Z3C and I collect all those info the old style
Without this thread you would need days to catch all dependencies - With this you would need approx. 10 min!
Very helpfull and good to link new user to...
And yes - I came form the Sammy side (of the moon ) and was a bit shocked what sony did with "open source android".
Not because of SystemUI ( I love it...) but because of all this "anti modding" stuff they build in.
Sticky? Sure - must be!
Updated the OP to include info on Hard-bricks, Soft-bricks and bootloops.
Please people, if you have anything to add to the OP, let me know!
As I said, I know a lot, but I can't know everything there is to know about Sony devices...
Good work (...as usual from your side) :good:
Very useful tutorial.
No need to write long explanations to Sony beginners anymore - just add a link from here.
Really Helpful
Brilliant.....Really it deserves place at (Sticky Threads).I think if you add minimum One Custom Kernel(for stock firmware)
of every devices..That would b very helpful to recover from Soft bricks.Then this thread will be an "ALL IN 1" thread.Its my Opinion after all...Brilliant work.
Need a little advice.
Hi,
I have a ZL with Locked bootloader and your ZL-lockeddualrecovery2.8.22 installed
I am on stock 5.0.2 now Rooted thanks to your awesome recovery.
Question is now I have your dual recovery would I be able to simply flash crDroid CM zip Thread Here and others like it or would I still need to unlock the bootloader Edit OP of ROM says it is required
So if I flashed the above would it replace your recovery with the boot.img in the zip
Sorry for the noob questions but I am new to Sony devices and still taking baby steps with this phone
I can unlock the bootloader no problem but I am more concerned about your recovery been replaced.
Thanks in advance :good:
bigrammy said:
Hi,
I have a ZL with Locked bootloader and your ZL-lockeddualrecovery2.8.22 installed
I am on stock 5.0.2 now Rooted thanks to your awesome recovery.
Question is now I have your dual recovery would I be able to simply flash crDroid CM zip Thread Here and others like it or would I still need to unlock the bootloader Edit OP of ROM says it is required
So if I flashed the above would it replace your recovery with the boot.img in the zip
Sorry for the noob questions but I am new to Sony devices and still taking baby steps with this phone
I can unlock the bootloader no problem but I am more concerned about your recovery been replaced.
Thanks in advance :good:
Click to expand...
Click to collapse
As long as your phone is locked, you only can flash stockroms and stock-kernels.
You also have to use recovery for stockrom, because you kernel is "untouchable" and recovery have to put in /data and /system partition and can't be put in kernel.
All other roms/kernels will end in errors while flashing.
If you have unlocked your BL, you can flash any rom and kernel you want, as long as your phone is supporting it.
Yes, by flashing a zip, your kernel will be replaced and in most cases they have a recovery in it.
By flashing a rom from another version or changing from stock-based roms to i.e. CM-roms or Omni and vice versa, you have to unpack the kernel (boot.img) by hand and flash (fastboot) this first, before you flash (after a reboot in recovery) the whole zip.
Otherwise it could end in bootloop.
Because of (i most cases) wiping /system, /data while installation, your stock-recovery will deleted too. This depends of the work of the installer in the zip file.
Btw... before unlocking your phone, backup your TA ( with FlashTool). This TA is unique and you may use it to lock your phone again later.
And... if your phone is unlocked - no fear of losing recovery. You always can flash another one with fastboot again.
Someone correct me, if i was wrong or forgot something.
@bigrammi, you can always try yo repack the CM kernel using my kernel builder, that way you will still have XZDualRecovery but then included in the boot image, so no risk of losing it...
akkufix said:
As long as your phone is locked, you only can flash stockroms and stock-kernels.
You also have to use recovery for stockrom, because you kernel is "untouchable" and recovery have to put in /data and /system partition and can't be put in kernel.
All other roms/kernels will end in errors while flashing.
If you have unlocked your BL, you can flash any rom and kernel you want, as long as your phone is supporting it.
Yes, by flashing a zip, your kernel will be replaced and in most cases they have a recovery in it.
By flashing a rom from another version or changing from stock-based roms to i.e. CM-roms or Omni and vice versa, you have to unpack the kernel (boot.img) by hand and flash (fastboot) this first, before you flash (after a reboot in recovery) the whole zip.
Otherwise it could end in bootloop.
Because of (i most cases) wiping /system, /data while installation, your stock-recovery will deleted too. This depends of the work of the installer in the zip file.
Btw... before unlocking your phone, backup your TA ( with FlashTool). This TA is unique and you may use it to lock your phone again later.
And... if your phone is unlocked - no fear of losing recovery. You always can flash another one with fastboot again.
Someone correct me, if i was wrong or forgot something.
Click to expand...
Click to collapse
Thanks yet again bro :highfive:
Wow these Sony Xperia's take some figuring out :laugh:
I think I have just about got my head around it all now
I have managed to get the TA backed up with TWRP and Flashtool so I should be safe now
I will have to unlock the bootloader just to stop it nagging me to upgrade :laugh:
@Nut Thanks bro I will take a look at your suggestion it's a little more complicated than what I am used to or should I say different.
bigrammy said:
[...]
@Nut Thanks bro I will take a look at your suggestion it's a little more complicated than what I am used to or should I say different.
Click to expand...
Click to collapse
Well, i saw HTC M7 in your signature. If you were able to unlocked, s-off-ed, re-flashed firmware and rooted this beast - you don't need to have any fear about a Sony device.
[NUT] said:
@bigrammymi, you can always try yo repack the CM kernel using my kernel builder, that way you will still have XZDualRecovery but then included in the boot image, so no risk of losing it...
Click to expand...
Click to collapse
Hi @Nut,
I thought I would take your advice and expected to download a tool to unpack everything and pick through the files and start editing init.rc etc etc :silly:
I had no idea this was a fully automated Online tool
I still can't quite believe it you're a genius!! :angel:
A BIG THANKS to All the Xperia dev's helpful community members and especially the tool creators XZDualRecovery, Flashtool, XperiFirm and PRFCreator etc you're all Awesome :highfive:
I fear I will become lazy with such great dev's :laugh:
bigrammy said:
Hi @Nut,
I thought I would take your advice and expected to download a tool to unpack everything and pick through the files and start editing init.rc etc etc :silly:
I had no idea this was a fully automated Online tool
I still can't quite believe it you're a genius!! :angel:
A BIG THANKS to All the Xperia dev's helpful community members and especially the tool creators XZDualRecovery, Flashtool, XperiFirm and PRFCreator etc you're all Awesome :highfive:
I fear I will become lazy with such great dev's :laugh:
Click to expand...
Click to collapse
Thanks, glad to have been of help to you

Help me to twrp/root/xposed/kernel my XC

Hi,
I'll received my XC this week, and I'd like to root it.
I don't want a custom ROM, but just a stock one with xposed and remove some bloatwares.
Here are my needs:
keep DRM
latest stock rom
twrp
untouched system partition
easy OTA
XC Genesis kernel
xposed + module
Do you think it possible to achieve such a configuration?
How-to?
Thanks
EDIT: I'll update this post to make it an HOW-To for futures users with same questions.
Assuming you're unable to unlock your BL the steps are as follows...
Flash back to 198.
Backup your TA.
Unlock your BL
Update to 311
Extract kernel - ftf/sin/elf
Run elf through Rootkernel_v5.23 - (In cmd prompt window - rootkernel kernel.elf boot.img)
Create DK ftf with Rootkernel_v5.23 (In cmd prompt window - flash_dk TA-19022017.img DK.ftf)
Flash new boot.img
Flash TWRP.img
Flash Super User zip
Flash DK.ftf with Flashtool 9.22
...and that should be it.
Latest stock Rom + xposed will not be possible...
mika91 said:
Hi,
I'll received my XC this week, and I'd like to root it.
I don't want a custom ROM, but just a stock one with xposed and remove some bloatwares.
Here are my needs:
keep DRM
latest stock rom
twrp
untouched system partition
easy OTA
XC Genesis kernel
xposed + module
Do you think it possible to achieve such a configuration?
How-to?
Thanks
EDIT: I'll update this post to make it an HOW-To for futures users with same questions.
Click to expand...
Click to collapse
Forget about OTA when rooted...
I though that using xposed leave the system partition untouched, so OTA updates are possible...
mika91 said:
I though that using xposed leave the system partition untouched, so OTA updates are possible...
Click to expand...
Click to collapse
OTA is not possible once bootloader is unlocked. System partition touched or not played no role.
ok.
So if I want root the XC, I have to unlock the bootloader, loose DRM and ota?
How is the camera quality without the drm keys?
Thanks
mika91 said:
ok.
So if I want root the XC, I have to unlock the bootloader, loose DRM and ota?
Click to expand...
Click to collapse
See my post to get a rooted stock with DRM.
mika91 said:
ok.
So if I want root the XC, I have to unlock the bootloader, loose DRM and ota?
How is the camera quality without the drm keys?
Thanks
Click to expand...
Click to collapse
You HAVE to unlock. There is NO root on LOCKED bootloader.
Unlocking bootloader deletes TA partition, containing DRM keys. You should BACKUP your TA partition BEFORE unlocking using DirtyCow Backup tool from Sony Cross Devices forum.
After unlocking, you can either flash kernel that supports DRM patching either by using fake DRM libraries, or your real DRM keys, either flashed in alternative location (see RootKernel tool in Z5 forums, works on almost all modern Xperias) or PoC TA tool from Sony Cross devices, that mounts your TA backup as TA partition, therefore your phone looks as having DRM keys and locked.
XperienceD said:
Assuming you're unable to unlock your BL the steps are as follows...
Flash back to 198.
Backup your TA.
[*]Unlock your BL
[*]Update to 311
[*]Extract kernel - ftf/sin/elf
[*]Run elf through Rootkernel_v5.23 - (In cmd prompt window - rootkernel kernel.elf boot.img)
[*]Create DK ftf with Rootkernel_v5.23 (In cmd prompt window - flash_dk TA-19022017.img DK.ftf)
[*]Flash new boot.img
[*]Flash TWRP.img
[*]Flash Super User zip
[*]Flash DK.ftf with Flashtool 9.22
...and that should be it.
Click to expand...
Click to collapse
Would you mind detailing a bit more those steps, especially the first 2? Im coming from a really old phone so im still a bit lost. (where can i learn about ftf/sin/elf?)
How can we flash back to 198? Flashing doesnt require an unlocked BL, wich to be achieved deletes your TA?
im on a brand new X Compact, 7.0 (34.2.A.0.292), secure patch 01/01/17
managed to get flashtool, adb/fastboot and Universal TA Backup v2 on my pc but no dice on TA backup yet
fredsky2 said:
Would you mind detailing a bit more those steps, especially the first 2? Im coming from a really old phone so im still a bit lost. (where can i learn about ftf/sin/elf?)
Click to expand...
Click to collapse
Sure. You don't really need to learn about those stuff but is handy to know, you'll pick stuff up along the way. They are basically firmware files.
fredsky2 said:
How can we flash back to 198? Flashing doesnt require an unlocked BL, wich to be achieved deletes your TA?
Click to expand...
Click to collapse
Open the flashtool and run Xperifirm (icon with XI) on it, then browse to the XC, then click on F5321 and it will load up the different regions and available firmware. If you click on "check all" it will then show which FW is available to download, Central Europe 5 still shows as 198, so you need to select it on the right of the screen under the picture of the phone, it will then download and it's simply a matter of following the instructions to flash it.
fredsky2 said:
im on a brand new X Compact, 7.0 (34.2.A.0.292), secure patch 01/01/17
managed to get flashtool, adb/fastboot and Universal TA Backup v2 on my pc but no dice on TA backup yet
Click to expand...
Click to collapse
When you get 198 on your phone then you'll be able to back your TA. If you get stuck give us a shout.
XperienceD said:
Sure. You don't really need to learn about those stuff but is handy to know, you'll pick stuff up along the way. They are basically firmware files.
Open the flashtool and run Xperifirm (icon with XI) on it, then browse to the XC, then click on F5321 and it will load up the different regions and available firmware. If you click on "check all" it will then show which FW is available to download, Central Europe 5 still shows as 198, so you need to select it on the right of the screen under the picture of the phone, it will then download and it's simply a matter of following the instructions to flash it.
When you get 198 on your phone then you'll be able to back your TA. If you get stuck give us a shout.
Click to expand...
Click to collapse
Thank you, i was able to successfully backup my TA earlier yesterday. But now im struggling with how to restore it in MM 6.0.1 (34.1.A.1.198).
I've read that i'll need a custom kernel for that (and to get TWRP+supersu+magisk+xposed) but im unsure if i should use Genesis (probably unsuported but the only one that says it'll restore MY TA) or Advanced Stock Kernel from Androplus. Ive read that messing with TA can hardbrick my phone so im trying to be extra careful.
atm im following ondrejvaroscak's quickrecap to make sure everything goes smooth with my TA keys and then i plan to downgrade to 6.0, install Advanced Stock Kernel, supersu 2.79 and magisk and then pray for the best (without reflashing my own DK.ftf?)
fredsky2 said:
Thank you, i was able to successfully backup my TA earlier yesterday. But now im struggling with how to restore it in MM 6.0.1 (34.1.A.1.198).
Click to expand...
Click to collapse
Download Flashtool 9.22.3 and flash your DK.ftf, flashing with a newer version doesn't work, you should then be able to verify it's worked in the service menu.
fredsky2 said:
I've read that i'll need a custom kernel for that (and to get TWRP+supersu+magisk+xposed) but im unsure if i should use Genesis (probably unsuported but the only one that says it'll restore MY TA) or Advanced Stock Kernel from Androplus. Ive read that messing with TA can hardbrick my phone so im trying to be extra careful.
Click to expand...
Click to collapse
You can use the RootKernel tool to modify your own kernel, extract the kernel.sin from the ftf with a zip program, then use the flashtool to extract the kernel.elf, Tools-Sin Editor-Extract Data then run it through the RootKernel tool and flash the boot.img it creates, then flash TWRP separately to the recovery partition which will allow you then to flash SuperSU.
SuperSU and BusyBox are the only options I didn't include when creating my kernel. Others will have to help with the other two things you want as I refuse to use them.
XperienceD said:
Download Flashtool 9.22.3 and flash your DK.ftf, flashing with a newer version doesn't work, you should then be able to verify it's worked in the service menu.
You can use the RootKernel tool to modify your own kernel, extract the kernel.sin from the ftf with a zip program, then use the flashtool to extract the kernel.elf, Tools-Sin Editor-Extract Data then run it through the RootKernel tool and flash the boot.img it creates, then flash TWRP separately to the recovery partition which will allow you then to flash SuperSU.
SuperSU and BusyBox are the only options I didn't include when creating my kernel. Others will have to help with the other two things you want as I refuse to use them.
Click to expand...
Click to collapse
Thanks again. I was worried that the drm-fix from the kernel editing tool could corrupt my TA partition but thankfully i was wrong on that .
Im now at MM 6.0, original DRM keys, TWRP, xposed, rooted with magisk and im almost sure that with busybox. Why do you refuse to use them? Just curious!
Thanks a lot for your help, cheers
fredsky2 said:
Thanks again. I was worried that the drm-fix from the kernel editing tool could corrupt my TA partition but thankfully i was wrong on that .
Click to expand...
Click to collapse
I flashed a kernel I made with the Rootkernel tool without the drm fix but it showed some mumbo jumbo where it should say ok and provisioned, included the drm fix in the next one and it worked fine then.
fredsky2 said:
Im now at MM 6.0, original DRM keys, TWRP, xposed, rooted with magisk and im almost sure that with busybox. Why do you refuse to use them? Just curious!
Thanks a lot for your help, cheers
Click to expand...
Click to collapse
You're welcome. I refuse because I prefer to know how to mod apks directly and I found Xposed to be quite buggy. I can see the benefits, it's just not for me.

Z1C: First Custom-ROM

Hello,
my Sony Xperia Z1 Compact has the standard Android 5.1 version of Sony. Now I want to upgrade to a new Android version.
I need it for everyday-use and it should be relatively stable. The camera is not that important, but it should work. I use especially the browser, so the mobile datas should also work. Otherwise it should be only be stable and the battery should not discharge too fast. Is there any good build for me?
That one looks very interesting: AICP 7.1 ROM amami (I can't link the URL, because I am a new user )
Is it okay for a Custom-ROM beginner? I think I will find some instructions and tutorials how to install it. I just have to know if it is a good choice.
If there are any English mistakes, please correct me. I have to improve my English.
Thank you!
Skylac06 said:
Hello,
my Sony Xperia Z1 Compact has the standard Android 5.1 version of Sony. Now I want to upgrade to a new Android version.
I need it for everyday-use and it should be relatively stable. The camera is not that important, but it should work. I use especially the browser, so the mobile datas should also work. Otherwise it should be only be stable and the battery should not discharge too fast. Is there any good build for me?
That one looks very interesting: AICP 7.1 ROM amami (I can't link the URL, because I am a new user )
Is it okay for a Custom-ROM beginner? I think I will find some instructions and tutorials how to install it. I just have to know if it is a good choice.
If there are any English mistakes, please correct me. I have to improve my English.
Thank you!
Click to expand...
Click to collapse
Anything over LP 5.1 has an unusable camera, with one possible exception: DU Marshmallow rom with custom kernel. Read op of this thread - https://forum.xda-developers.com/sony-xperia-z1-compact/general/z1c-marshmallow-roms-t3372565 Note the addenda at the bottom.
levone1 said:
Anything over LP 5.1 has an unusable camera, with one possible exception: DU Marshmallow rom with custom kernel. Read op of this thread - https://forum.xda-developers.com/sony-xperia-z1-compact/general/z1c-marshmallow-roms-t3372565 Note the addenda at the bottom.
Click to expand...
Click to collapse
Thank you for your fast answer.
Is the camera completely unusable or just "not good"? I do not need the best quality, but it should at least work and you should be able to identify what the picture shows.
However, thank you for the link. I think I will try it. Android 6 is, I hope so, an improvement. Maybe I will then upgrade to Nougat.
There are no other options like Ubuntu Touch or Sailfish, right?
Skylac06 said:
Thank you for your fast answer.
Is the camera completely unusable or just "not good"? I do not need the best quality, but it should at least work and you should be able to identify what the picture shows.
However, thank you for the link. I think I will try it. Android 6 is, I hope so, an improvement. Maybe I will then upgrade to Nougat.
There are no other options like Ubuntu Touch or Sailfish, right?
Click to expand...
Click to collapse
Put a piece of tape over your camera lens, and turn off the lights, and shake the phone back and forth while taking a picture... That's what most of the photos will look like.
No Sailfish, and @munjeni has built Ubuntu touch for Z1c, but I couldn't get the Internet to work, (except for Ubuntu store, which downloads apps fine). - https://mega.nz/#!YEpCHLoS!tRxZpJHUSKL_cZz9wisGZvWl7igYAlYJRjwbcT_s868 Besides that, fxp has built Firefox OS, but probably hard to find at this point, and there are a few MIUI builds out there that are very good. Check here - https://forum.xda-developers.com/showpost.php?p=71329395&postcount=5 and here - https://forum.xda-developers.com/so...lopment/23-2015-miui-v6-5-5-22-d5503-t3116494
Hello again,
I decided to try out some Custom-ROMs.
Now I find many different ways how to root my phone and unlock the bootloader. Which way do you here recommend?
And how difficult is going back to the stock ROM and lock the bootloader againg, if nothing works?
Thank you!
Skylac06 said:
Hello again,
I decided to try out some Custom-ROMs.
Now I find many different ways how to root my phone and unlock the bootloader. Which way do you here recommend?
And how difficult is going back to the stock ROM and lock the bootloader againg, if nothing works?
Thank you!
Click to expand...
Click to collapse
Backup TA - https://forum.xda-developers.com/crossdevice-dev/sony/universal-dirtycow-based-ta-backup-t3514236
Unlock bl - https://developer.sonymobile.com/unlockbootloader/unlock-yourboot-loader
Root and recovery :
Download custom kernel to pc, and extract boot img to ADB directory - https://forum.xda-developers.com/so...rnel-advanced-14-5-0-242-kernel-v1-0-t3096060 and download twrp img to ADB directory - https://www.androidfilehost.com/?fid=457095661767147235 then use fastboot commands to flash boot and recovery. Now you have recovery, and you can either flash SuperSU zip, or flash custom rom.
Restore TA - https://forum.xda-developers.com/crossdevice-dev/sony/poc-real-trim-instead-drm-fix-t3552893 or use Flashtool relock bl option - http://www.flashtool.net/
levone1 said:
Backup TA - https://forum.xda-developers.com/crossdevice-dev/sony/universal-dirtycow-based-ta-backup-t3514236
Unlock bl - https://developer.sonymobile.com/unlockbootloader/unlock-yourboot-loader
Root and recovery :
Download custom kernel to pc, and extract boot img to ADB directory - https://forum.xda-developers.com/so...rnel-advanced-14-5-0-242-kernel-v1-0-t3096060 and download twrp img to ADB directory - https://www.androidfilehost.com/?fid=457095661767147235 then use fastboot commands to flash boot and recovery. Now you have recovery, and you can either flash SuperSU zip, or flash custom rom.
Restore TA - https://forum.xda-developers.com/crossdevice-dev/sony/poc-real-trim-instead-drm-fix-t3552893 or use Flashtool relock bl option - http://www.flashtool.net/
Click to expand...
Click to collapse
One little question: if I unlock my bootloader, my complete internal storage is wiped, right?
But if my bootloader is locked, I can not use the nandroid-backup-function of TWRP, because I can not use the custom kernel to root my phone. (Am I right? )
Currently I only have done your first step - backup the TA.
And of course, thank you again. :fingers-crossed:
Skylac06 said:
One little question: if I unlock my bootloader, my complete internal storage is wiped, right?
But if my bootloader is locked, I can not use the nandroid-backup-function of TWRP, because I can not use the custom kernel to root my phone. (Am I right? )
Currently I only have done your first step - backup the TA.
And of course, thank you again. :fingers-crossed:
Click to expand...
Click to collapse
You can root with locked bl, but your options are: 1) use Kingroot, (and it's generally preferred to not keep Kingroot, so after rooting you can replace Kingroot with SuperSU or wipe everything and flash a new rom with SuperSU), or 2) downgrade to KK and use doomlord rootkit, then flash LP prf.
levone1 said:
You can root with locked bl, but your options are: 1) use Kingroot, (and it's generally preferred to not keep Kingroot, so after rooting you can replace Kingroot with SuperSU or wipe everything and flash a new rom with SuperSU), or 2) downgrade to KK and use doomlord rootkit, then flash LP prf.
Click to expand...
Click to collapse
Okay.
I would like to avoid using Kingroot and downgrade to 4.4 is not even better.
But I found the Sony-Flashtool "Emma" for Windows. It seems to be able to restore completely the Stock-5.1-ROM. So I think I don't need a whole nandroid-backup. Am I right?
So I will unlock my bootloader, flash the custom kernel using TWRP-Tool and have a rooted phone. Then I am able to flash any custom-ROM I want to try out.
Did I misunderstand anything?
Skylac06 said:
Okay.
I would like to avoid using Kingroot and downgrade to 4.4 is not even better.
But I found the Sony-Flashtool "Emma" for Windows. It seems to be able to restore completely the Stock-5.1-ROM. So I think I don't need a whole nandroid-backup. Am I right?
So I will unlock my bootloader, flash the custom kernel using TWRP-Tool and have a rooted phone. Then I am able to flash any custom-ROM I want to try out.
Did I misunderstand anything?
Click to expand...
Click to collapse
True, Emma will restore you to stock. The backup would be if you want to restore the particular state of your phone right now.
Unlock bl, then flash the boot and recovery imgs, and you will be able to get into recovery. You'll want to have whatever rom you want to flash already downloaded on sdcard.
It works.
Now I have the AICP 12.1 7.1.2 Nightly Version.
Only the camera is not good, but better than expected. The aroma-GApps-package does not work, the GUI is hidden under the GUI of TWRP, but you can select your choice. However, after clicking install nothing was installed. After I downloaded and installed the super-GApps-package everything works fine.
If I find some issues, where can I report them? In the officiall AICP-12.1 N 7.1 amami Thread?
And at least a great thank you to levone1. :fingers-crossed:
Skylac06 said:
It works.
Now I have the AICP 12.1 7.1.2 Nightly Version.
Only the camera is not good, but better than expected. The aroma-GApps-package does not work, the GUI is hidden under the GUI of TWRP, but you can select your choice. However, after clicking install nothing was installed. After I downloaded and installed the super-GApps-package everything works fine.
If I find some issues, where can I report them? In the officiall AICP-12.1 N 7.1 amami Thread?
And at least a great thank you to levone1. :fingers-crossed:
Click to expand...
Click to collapse
https://forum.xda-developers.com/so...lopment/rom-aicp-11-0-mm-6-0-1-amami-t3428288
levone1 said:
https://forum.xda-developers.com/so...lopment/rom-aicp-11-0-mm-6-0-1-amami-t3428288
Click to expand...
Click to collapse
That is the thread I meant, but I can not post any URLs.
Best Custom ROM for Z1C
Not to open a new thread, which Custom ROM would you guys recommend to install on my Z1C?
I'm having some issues atm. It keeps restarting; I did a factory reset, it worked well for a while, now the issue is back. However, it does seem to work fine when hooked up to my PC (with the PC Companion active). Before I start shopping for a new phone, I'd like to root it first.
For this purpose, I'd like to know whick custom ROM is the most stable that you would recommend I install. Also, I'd be very helpful if you could direct to a good guide about the entire process.
Thank you in advance, I appreciate it!
levone1 said:
Backup TA - https://forum.xda-developers.com/crossdevice-dev/sony/universal-dirtycow-based-ta-backup-t3514236
Unlock bl - https://developer.sonymobile.com/unlockbootloader/unlock-yourboot-loader
Root and recovery :
Download custom kernel to pc, and extract boot img to ADB directory - https://forum.xda-developers.com/so...rnel-advanced-14-5-0-242-kernel-v1-0-t3096060 and download twrp img to ADB directory - https://www.androidfilehost.com/?fid=457095661767147235 then use fastboot commands to flash boot and recovery. Now you have recovery, and you can either flash SuperSU zip, or flash custom rom.
Restore TA - https://forum.xda-developers.com/crossdevice-dev/sony/poc-real-trim-instead-drm-fix-t3552893 or use Flashtool relock bl option - http://www.flashtool.net/
Click to expand...
Click to collapse
OP's intention is different than mine but this approach looks suit me well. I would like to keep my stock (14.6.A.1.236), so can I flash kernel.sin from Stock Rom via Flashtool after restoring TA and keep root status and recovery or should I use the custom kernel henceforth?
prustr said:
OP's intention is different than mine but this approach looks suit me well. I would like to keep my stock (14.6.A.1.236), so can I flash kernel.sin from Stock Rom via Flashtool after restoring TA and keep root status and recovery or should I use the custom kernel henceforth?
Click to expand...
Click to collapse
I don't think I've ever done it that way, but I don't see why not. As long as you don't wipe your recovery, you should still be good... (if you'd rather use stock kernel for whatever reason).
levone1 said:
I don't think I've ever done it that way, but I don't see why not. As long as you don't wipe your recovery, you should still be good... (if you'd rather use stock kernel for whatever reason).
Click to expand...
Click to collapse
Thanks for the answer. Actually the whole story is, the phone belongs to my wife and she is neither techsavvy nor has patience with electronics, especially when any problem come up. I would like to remove bloatwares and have backup yet keep the phone as Stock as possible. I'm trying to keep my ROM related modifications at minimum. That's been said, I would welcome any correction on this manner as I feel you found returning the stock kernel is pointless.
prustr said:
Thanks for the answer. Actually the whole story is, the phone belongs to my wife and she is neither techsavvy nor has patience with electronics, especially when any problem come up. I would like to remove bloatwares and have backup yet keep the phone as Stock as possible. I'm trying to keep my ROM related modifications at minimum. That's been said, I would welcome any correction on this manner as I feel you found returning the stock kernel is pointless.
Click to expand...
Click to collapse
I wouldn't say pointless, but for the most part, any custom kernel is an improvement. Most of the customizations wouldn't mean anything to someone like that, but I doubt there's any harm or risk in keeping it.

Shopping for Sony X Compact, Just a question.

Hello, my Nexus 5X has bootlooped for the second time and I'm on my second version. Sort of getting sick of this and looking for a new 4.5-5" screen phone. I was looking at the X Compact. My biggest qualifier for what I want in a phone is something that is rootable where I can run Adblock to block ads. I don't really mind about anything else, I just don't want to see ads. I was wondering what the current status is on unlocking bootloader, rooting, and running rooted on the Sony X Compact? Is there any caveats that I should know about before I jump into the phone? (I noticed that the XZ1 Compact if you root it, it sort of breaks the camera).
TL;DR
1. Downgrade to Marshmallow (use xperifirm)
2. Backup TA partition (https://forum.xda-developers.com/crossdevice-dev/sony/universal-dirtycow-based-ta-backup-t3514236)
3. Flash Nougat/Oreo if needed
4. Flash boot img with drm fix or ta_poc (read this https://forum.xda-developers.com/x-compact/how-to/stock-8-0-root-recovery-t3747479)
Same thing happens with x compact. When you unlock bootloader, it wipes TA partition. If TA partition is wiped, it will make camera result bad. Do not unlock bootloader and root yet before backing up TA. TA partition can be backed up using an exploit on Marshmallow. Therefore you need to flash MM stock rom. Then use the tool to backup TA.
If you back up the TA partition, you can flash it back after (will relock the boot loader and wipe data). This is useful if you decide to go fully stock without root. This is also useful if you send your phone to sony for repair.
Two way of fixing camera issue are by using kernel with
1. the drm fix. This by pass drm check. This can be done even if you forgot the TA backup step
2. ta_poc. mount backed up TA partition and link it.

X compact: Do I need to backup DRM ?

Hello
I own a clean X Compact phone and I want to unlock bootloader and root it ( Magisk) before install anything on it. Actually it is on Android 8 v34.4 and I can't backup DRM with indicated tools (backup TA), so do I need to backup DRMs if I don't use Sony services except the camera to take pictures ?
If yes, which tool can do this on Android 8 ?
Thanks
Feedback on this.
After done the android 8 update to the last release from sept 2018, I was able to activate the OEM unlock and run fastboot unlock command.
Installation of TWRP is ok
Magisk cause Unsupported/Unknown image format with the v21 . Investigate to know why
Trying to install DRM-Fix-system_Mode.zip and the phone boot loop on fastboot mode.. I'm looking to a way to uninstall this DRM Fix or flash another file,if someone can help.
Finally install Lineage OS 16 after failed to install stock firmware with flashtool. Added OpenGApps and Magisk (v21) to disable non desired apps ( 95%)
It is better to backup the TA in case you would need to get back to the stock firmware or sell device in factory conditions (on stock ROM).
If you have already unlocked the bootloader without backing up the TA first then there is no way to bring the device back to the completely factory state.
mp107 said:
It is better to backup the TA in case you would need to get back to the stock firmware or sell device in factory conditions (on stock ROM).
If you have already unlocked the bootloader without backing up the TA first then there is no way to bring the device back to the completely factory state.
Click to expand...
Click to collapse
Thanks for your precisions.

Categories

Resources