[Q] DRM restore for UB with Sony ROM? - Xperia Z3 Q&A, Help & Troubleshooting

This hasn't really been answered, or I couldn't find it
1) Can I unlock the bootloader and then restore the TA partition and keep the DRM functions working on the original ROM?
2) Is the TA partition erased once on unlocking or is it erased on every boot with unlocked bootloader?
I want to unlock the bootloader, install a custom kernel (to be able to boot into recovery) and then restore the TA partition, thus keeping DRM working.
Thanks

Zviratko said:
This hasn't really been answered, or I couldn't find it
1) Can I unlock the bootloader and then restore the TA partition and keep the DRM functions working on the original ROM?
2) Is the TA partition erased once on unlocking or is it erased on every boot with unlocked bootloader?
I want to unlock the bootloader, install a custom kernel (to be able to boot into recovery) and then restore the TA partition, thus keeping DRM working.
Thanks
Click to expand...
Click to collapse
It's answered...
If you check how to lock bootloader again, or relock if you want you'll see you can't have both.
You are unlocking bootloader to flash custom kernel, if you relock it, you have to flash stock kernel again...
Z3 powered by Tapatalk

I know I can relock and restore the TA partition.
What I don't know is if I can keep it unlocked and restore the TA partition, or if it will keep erasing itself, and this is what I need answered
Basically it boils down to:
Is the TA partition erased when unlocking, or is it kept erased when unlocked?

Zviratko said:
I know I can relock and restore the TA partition.
What I don't know is if I can keep it unlocked and restore the TA partition, or if it will keep erasing itself, and this is what I need answered
Basically it boils down to:
Is the TA partition erased when unlocking, or is it kept erased when unlocked?
Click to expand...
Click to collapse
I'm not sure which way it is working, but I guess if you try to restore TA on unlocked bootloader it will either fail or you end up with a hardbrick.
Afaik it gets erased when the BL gets unlocked and you can't restore it with an unlocked bootloader (don't know why, may be protected?).
If this would be possible what would the point of DRM's be if you could restore them easily after unlocking?

So nobody has tried that before? Why hardbrick? It's not like I will be restoring a TA dump from a different phone - the worst that can happen is that it won't boot and I will have to relock/unlock to erase it again, no?
We're not supposed to "backup" the DRM partition anyway, but we can because we have root without unlocking, so I don't think keeping it unlocked and restoring is unimaginable...

Don't you think if it would be possible or easy somebody would've at least tried it? But that's not the fact (at least what I know). For most devs this would be an unnecessary hard work as the only way to utilize the DRM keys is on a stock ROM and therefore unlocked bootloader would solely be useful for custom stock based kernel.
For now I think the needed work isn't in relation to its use. The DRM functions can mostly be utilized without the keys and the lost functions are not that important for most users, so where's the point?
Zviratko said:
I want to unlock the bootloader, install a custom kernel (to be able to boot into recovery) and then restore the TA partition, thus keeping DRM working.
Thanks
Click to expand...
Click to collapse
You know that you can boot into recovery without a custom kernel, don't you?

I can't speak for others but I am personally quite happy with the stock ROM, but I want and need root (Titanium backup, call recording and some security software). Right now all that is working on Lollipop, but recovery isn't, and I am not comfortable not having that safety net.
The only way to have a working recovery is a custom kernel, that means losing DRM keys, and that means some parts of ROM will lose functionality - whether that functionality is important or not is a good question that I can't answer as I haven't really dug into that, but I'd prefer to simply keep it after unlocking.
I don't understand why it should not work, and if I were Sony I'd probably just erase the DRM partition when unlocking and then forget about it - who says it can't be restored after that? Maybe it really is that simple and nobody tried?
I have heard nothing definitive here, so maybe I will be the first to try.

Omario-242 said:
You know that you can boot into recovery without a custom kernel, don't you?
Click to expand...
Click to collapse
On Lollipop I can't. Or maybe I can with fastboot boot...? Can you clarify?

Zviratko said:
On Lollipop I can't. Or maybe I can with fastboot boot...? Can you clarify?
Click to expand...
Click to collapse
Did forget about Lollipop and its recovery problem. I'm sorry.
But for the other thing: it isn't possible to restore the TA partition after unlocking. That's it. There's no way so far that we can do this and I guess it won't be possible in future.
Whether it is too much work or not possible at all, there's no need in discussing this any further as it is way easier for devs to get the recovery on lollipop working instead of the TA partition on an unlocked bootloader.
EDIT: A quick google search brought up this: "Restoring the TA (Trim Area) partition on a device like the Z2 [same goes for Z3] relocks your bootloader and restores your specific DRM keys with all it's functions."
So that's what happens if you restore the TA on UB. No brick (if you have stock kernel/ROM) but no UB anymore.

Omario-242 said:
Did forget about Lollipop and its recovery problem. I'm sorry.
Click to expand...
Click to collapse
No problem, I just though I've missed something
Omario-242 said:
But for the other thing: it isn't possible to restore the TA partition after unlocking. That's it. There's no way so far that we can do this and I guess it won't be possible in future.
Click to expand...
Click to collapse
Are you talking about getting back completely to stock and relocking, or about restoring TA on unlocked bootloader? I am confused. AFAIK there's a procedure for flashing the full FTF _and_ restoring DRM, there just isn't one for keeping it unlocked.
To be honest I'm still not convinced - restoring the TA should be quite simple with root (just a simple dd...), and I don't understand why it shouldn't just work - IMO the worst that can happen is a soft brick until it is erased again (which can be done by relocking and unlocking, or from recovery). I'm hoping someone will chime in with a definitive answer.
Omario-242 said:
Whether it is too much work or not possible at all, there's no need in discussing this any further as it is way easier for devs to get the recovery on lollipop working instead of the TA partition on an unlocked bootloader.
Click to expand...
Click to collapse
Unfortunately, it looks like we won't be getting recovery on Lollipop anytime soon - Sony did their homework and circumventing SELinux might not be that easy. I expected a working recovery within a day of LP release, but it's been quite a while longer and no progress in sight. The options are not good - you either lose DRM or don't have recovery. I think that having an unlocked bootloader _and_ a working DRM should be the ultimate goal for all, as it allows free switching between ROMs and easy rooting of Sony Lollipop ROMs (without downgrading/rooting/upgrading and hoping for the best - it's not really a foolproof thing right now).

Zviratko said:
I can't speak for others but I am personally quite happy with the stock ROM, but I want and need root (Titanium backup, call recording and some security software). Right now all that is working on Lollipop, but recovery isn't, and I am not comfortable not having that safety net.
The only way to have a working recovery is a custom kernel, that means losing DRM keys, and that means some parts of ROM will lose functionality - whether that functionality is important or not is a good question that I can't answer as I haven't really dug into that, but I'd prefer to simply keep it after unlocking.
I don't understand why it should not work, and if I were Sony I'd probably just erase the DRM partition when unlocking and then forget about it - who says it can't be restored after that? Maybe it really is that simple and nobody tried?
I have heard nothing definitive here, so maybe I will be the first to try.
Click to expand...
Click to collapse
Sounds like good idea.. Why nobody tried before? Simply because they get it for granted that unlocked with DRM is not possible... Someone has to be the first. I am no bootloader expert but my understanding resorting TA partition will relock bootloader so boring custom kernel will not be possible... But it's my only guess..
Sent from my D6603 using XDA Free mobile app

As I said if you have an unlocked bootloader (with whatever ROM/kernel) and you restore the TA partition your bootloader gets locked automatically. The devs definitely would've thought about getting the DRM keys to work on UB if this would be easy. If you have some Dev skills please go on and try it yourself, if not please stop discussing a topic you don't have enough knowledge about.

Omario-242 said:
As I said if you have an unlocked bootloader (with whatever ROM/kernel) and you restore the TA partition your bootloader gets locked automatically. The devs definitely would've thought about getting the DRM keys to work on UB if this would be easy. If you have some Dev skills please go on and try it yourself, if not please stop discussing a topic you don't have enough knowledge about.
Click to expand...
Click to collapse
Thanks, I think I understand now. I didn't realize that the locked/unlocked state was part of the TA partition. (Seems like a pretty odd place to store that info, though).
I still believe there is a way to do it - pointing the TA partition in the system to either a loopback device or a different partition with TA contents should fool the system into using the DRM keys on it while keeping the bootloader unlocked (unless of course the hardware looks at the partition directly, which I doubt).
No, I am not a dev, and it's unlikely I will attempt it at this point.
P.S. I don't appreciate a STFU attitude - this is a Q&A section, and I am fairly confident this has not been discussed or at least I couldn't find it. If you have a link that explains how exactly TA partition contents work then please post it. I don't feel stupid for asking questions I can't find answers to.

Omario-242 said:
As I said if you have an unlocked bootloader (with whatever ROM/kernel) and you restore the TA partition your bootloader gets locked automatically. The devs definitely would've thought about getting the DRM keys to work on UB if this would be easy. If you have some Dev skills please go on and try it yourself, if not please stop discussing a topic you don't have enough knowledge about.
Click to expand...
Click to collapse
Please refrain from telling people what they should or should not discuss. Everyone is free to open the thread he wants to discuss and it is your free decision to participate or not. You comment is rude and shows pretty nosey attitude.
Sent from my D6603 using XDA Free mobile app

ondrejvaroscak said:
Please refrain from telling people what they should or should not discuss. Everyone is free to open the thread he wants to discuss and it is your free decision to participate or not. You comment is rude and shows pretty nosey attitude.
Sent from my D6603 using XDA Free mobile app
Click to expand...
Click to collapse
Zviratko said:
Thanks, I think I understand now. I didn't realize that the locked/unlocked state was part of the TA partition. (Seems like a pretty odd place to store that info, though).
I still believe there is a way to do it - pointing the TA partition in the system to either a loopback device or a different partition with TA contents should fool the system into using the DRM keys on it while keeping the bootloader unlocked (unless of course the hardware looks at the partition directly, which I doubt).
No, I am not a dev, and it's unlikely I will attempt it at this point.
P.S. I don't appreciate a STFU attitude - this is a Q&A section, and I am fairly confident this has not been discussed or at least I couldn't find it. If you have a link that explains how exactly TA partition contents work then please post it. I don't feel stupid for asking questions I can't find answers to.
Click to expand...
Click to collapse
I'm really sorry. I didn't mean to be rude at all. English is not my mother language and I may have used the wrong terms.
I didn't mean to tell you to stop discussing whether it will be possible or not in the future, I just wanted to clarify that if you do it right now you will lock your bootloader (what I thought you didn't understand from my previous posts) and that there's no point in discussing that particular step.
If some devs will actually make the DRM keys work on UB with a custom kernel I guess there's a lot of happy users. Though I still think that it would be a lot work (looking into other Xperia devices there's never been success for DRM keys in that case).

Related

[Q] TA backup question based on previous Xperias

Hi guys,
Long time Android hacker, first time Sony user.
Im sorry if this has come up before but i have a question about the Bootloader unlock and TA partition wipe.
Based on experience of say the Z2, even if you acquire root first and backup your TA partition, are you able to run custom roms/kernels with the DRM/screen/camera optimizations at the same time? Or is the only point of the backup to restore if you are re-locking the bootloader?
I ask because if i cant have the screen optimization and root at the same time, i wont bother waiting to see if a root exploit becomes available as ill never run the phone stock anyway. If based on previous phones it might be possible to have both once you have a backup i will probably wait as i have other phones to use.
Thanks for your time.
With an unlocked bootloader you cannot have those DRM keys
If you restore the TA backup then you automatically relock the bootloader as well.
You can not have your cake and eat unfortunately.
Danthemanz said:
Hi guys,
Long time Android hacker, first time Sony user.
Im sorry if this has come up before but i have a question about the Bootloader unlock and TA partition wipe.
Based on experience of say the Z2, even if you acquire root first and backup your TA partition, are you able to run custom roms/kernels with the DRM/screen/camera optimizations at the same time? Or is the only point of the backup to restore if you are re-locking the bootloader?
I ask because if i cant have the screen optimization and root at the same time, i wont bother waiting to see if a root exploit becomes available as ill never run the phone stock anyway. If based on previous phones it might be possible to have both once you have a backup i will probably wait as i have other phones to use.
Thanks for your time.
Click to expand...
Click to collapse
No, backup is only if you want to relock bootloader and run Stock rom again.
You cant use DRM with other ROMS/KERNELS
EDIT
Sorry gregbradley, you was a little bit faster
Thanks for the quick response guys.
Looks like I'll start the unlocking process and get this baby up and running!
Danthemanz said:
Thanks for the quick response guys.
Looks like I'll start the unlocking process and get this baby up and running!
Click to expand...
Click to collapse
Just a quick note, if you unlock before you backup the TA partition, you will never be able to restore the DRM keys

Will there be more roms, mods, soon?

I bought the z3 hoping to also have good development like the z2.
I know the device is quite new, can anyone tell me how long it took for the z2 to get much development?
Or is there any reason the z3 will not get as good development?
Thank you all in advance.
Some say it's the bootloader (DRM thing) but you can root without unlocking the bootloader and backup DRM keys.
It could also be that there are some more bugs to be cleaned from CM12 as most ROMs are based off of it, but as I have seen, all CM12 ROMs seem functional.
Perhaps it's not a popular device amongst developers, there isn't CWM or TWRP for any CM based ROM. Only Cyanogen recovery is built into the CM kernel.
I hope there will be more ROMs in development! Like AOKP, Dirty Unicorns and more others. It seems quite empty at the moment.
@Aronuser You just need to have some patience. I guess there will be also a good support but we will see, no one can really say it and how you said the device is actually new.
@squabbi what do you mean with bootloader thing? If I remember right in the past it was always the same: unlocking the BL -> loose DRM keys..
But there is already the chance to root without unlocking the BL and then to do a TA-Backup(in which the DRM keys are included).. so I do not really understand what you mean with it
gripfly said:
@Aronuser You just need to have some patience. I guess there will be also a good support but we will see, no one can really say it and how you said the device is actually new.
@squabbi what do you mean with bootloader thing? If I remember right in the past it was always the same: unlocking the BL -> loose DRM keys..
But there is already the chance to root without unlocking the BL and then to do a TA-Backup(in which the DRM keys are included).. so I do not really understand what you mean with it
Click to expand...
Click to collapse
You can root without unlocking the boot, but then there is no need to backup TA keys
If you then unlock the boot it is advisable to backup the DRM keys, but you cannot restore them whilst the boot is unlocked as restoring them automatically relocks your boot.
SO if you want CM or other AOSP roms then you have to lose the DRM keys. Restoring them will mean you can only boot a stock sony rom
gregbradley said:
You can root without unlocking the boot, but then there is no need to backup TA keys
If you then unlock the boot it is advisable to backup the DRM keys, but you cannot restore them whilst the boot is unlocked as restoring them automatically relocks your boot.
SO if you want CM or other AOSP roms then you have to lose the DRM keys. Restoring them will mean you can only boot a stock sony rom
Click to expand...
Click to collapse
Yeah that's more or less what I wanted to say, may I didn't wrote it as well. But that's nothing new and was minimum since the Z series launched by SONY a "problem".
But if he thought about this then(or than?) I might didn't understand it as he wanted to say it.

First things to do when I get the OnePlus One?

Bought the bullet and bought the OnePlus One today...
What are the first things to do as soon as I get the OnePlus One?
Also I mean "normal" things; Rooting, unlocking bootloader, "enjoying it" etc. are not normal and do not count.
Thank you
The first thing you need to do is unlock the bootloader. This is because all user data is wiped during the unlock process, so it's better for it to be done before you really start using the phone (installing apps, taking images, etc). Once you've unlocked your bootloader, install TWRP recovery so you can make a backup of your stock setup before you start really messing with it, this is super important, and make sure you keep at least one backup or ROM zip on your phone at all times. The next most important thing to do is to backup your EFS partition, sometimes the EFS becomes corrupted just by chance and if you don't have a backup you'll have a great looking paperweight on your hands. I have detailed instructions on how to do all of these things in my guide thread here:
[GUIDES][Q&A]How-To Guides For Beginners + Q&A
timmaaa said:
The first thing you need to do is unlock the bootloader. This is because all user data is wiped during the unlock process, so it's better for it to be done before you really start using the phone (installing apps, taking images, etc). Once you've unlocked your bootloader, install TWRP recovery so you can make a backup of your stock setup before you start really messing with it, this is super important, and make sure you keep at least one backup or ROM zip on your phone at all times. The next most important thing to do is to backup your EFS partition, sometimes the EFS becomes corrupted just by chance and if you don't have a backup you'll have a great looking paperweight on your hands. I have detailed instructions on how to do all of these things in my guide thread here:
[GUIDES][Q&A]How-To Guides For Beginners + Q&A
Click to expand...
Click to collapse
Hang on, I have to make another XDA account to thank you twice
Great answer and really helpful. Thats the kind of attitude I love to see and really makes XDA shine.
Again thanks. Im gonna go ahead and read that and I apoligize for not reading it before hand. The thing that surprised the most is unlocking the bootloader, erases all user data. Intresting.
Can the bootloader, for whatever reason necessary, be relocked?
riahc3 said:
Hang on, I have to make another XDA account to thank you twice
Great answer and really helpful. Thats the kind of attitude I love to see and really makes XDA shine.
Again thanks. Im gonna go ahead and read that and I apoligize for not reading it before hand. The thing that surprised the most is unlocking the bootloader, erases all user data. Intresting.
Can the bootloader, for whatever reason necessary, be relocked?
Click to expand...
Click to collapse
It can indeed be relocked using the same method with a different command. You may want to lock it again if you were selling the device and you wanted to return it to 100% stock or of the box condition. Otherwise best to leave it open to at the least flash a custom recovery.
gsmyth said:
It can indeed be relocked using the same method with a different command. You may want to lock it again if you were selling the device and you wanted to return it to 100% stock or of the box condition. Otherwise best to leave it open to at the least flash a custom recovery.
Click to expand...
Click to collapse
Good to know. I doubt Ill ever relock it but just to know.

Root E6653 Running Firmware 32.1.A.1.185

I'm really hoping I can be hand-held here in rooting my E6653. I've been out of the rooting game for a while and the Z5 digging through guides and threads looks like a whole lot harder process!
What's the process I have to use get my phone rooted? I understand that I need to unlock the bootloader, which I'm comfortable in doing myself. I can see a downgrade will more than likely be required. Sorry for the noob questions, but I just want to make sure I'm performing the correct rooting process.
I really only want to root my phone to have the ability to use Viper4Android, otherwise I'm truly happy with the phone as it is.
Raysie said:
I'm really hoping I can be hand-held here in rooting my E6653. I've been out of the rooting game for a while and the Z5 digging through guides and threads looks like a whole lot harder process!
What's the process I have to use get my phone rooted? I understand that I need to unlock the bootloader, which I'm comfortable in doing myself. I can see a downgrade will more than likely be required. Sorry for the noob questions, but I just want to make sure I'm performing the correct rooting process.
I really only want to root my phone to have the ability to use Viper4Android, otherwise I'm truly happy with the phone as it is.
Click to expand...
Click to collapse
Permanent Root is only available for UB only.
Currently UB poses problems with its DRM keys being lost forever.
You'll lose normal functions with the Camera, Bravia Engine, TrackID.. etc. dependent on the DRM keys stored on TA partition.
Before you perform UB you should backup your TA partition. using iovyroot. Better got a backup than sorry.
(http://forum.xda-developers.com/crossdevice-dev/sony/iovyroot-temp-root-tool-t3349597)
There are work around with the DRM problems, still it's better that you have a copy of the original TA you have on you device.
After that you can search for any possible ways to root your device.
Rooting UB: http://forum.xda-developers.com/xperia-z5/development/summary-rooting-z5-t3232042

starter question with rooting and unrooting Sony Xperia XZ

Hey, guys, I got fed up google and found this guide (https://forum.xda-developers.com/showpost.php?p=70504721&postcount=2). Sadly, I have found this guide after I unlocked the bootloader and so I am lost at what I should do next? I wanted to root my device, delete bloatware, isntal Xprivacy and lock the phone back up. The questions that I have now are:
1. Is it possible to return my phone to something that I had before if I skipped the TA back-up?
2. Does xprivacy necessarily have to have root enabled all the time or can I do the things that I wanted and just lock the phone back?
3. What is the best resource for fixing DRM key issue with the camera?
Thanks for all the help!
Loki
LokiSonofOdin said:
Hey, guys, I got fed up google and found this guide (https://forum.xda-developers.com/showpost.php?p=70504721&postcount=2). Sadly, I have found this guide after I unlocked the bootloader and so I am lost at what I should do next? I wanted to root my device, delete bloatware, isntal Xprivacy and lock the phone back up. The questions that I have now are:
1. Is it possible to return my phone to something that I had before if I skipped the TA back-up?
2. Does xprivacy necessarily have to have root enabled all the time or can I do the things that I wanted and just lock the phone back?
3. What is the best resource for fixing DRM key issue with the camera?
Thanks for all the help!
Loki
Click to expand...
Click to collapse
Well, once you unlocked your BL your DRM keys are gone for good.. Unless you made a TA backup..
2) you need root for xposed to work.. So no to that question and Xposed is know to cause a bootloop on some devices. So make sure you have a backup.
3) check the Guides section there are a few threads in there about flashing kernels and DRM fixes...
lilbrat said:
Well, once you unlocked your BL your DRM keys are gone for good.. Unless you made a TA backup..
2) you need root for xposed to work.. So no to that question and Xposed is know to cause a bootloop on some devices. So make sure you have a backup.
3) check the Guides section there are a few threads in there about flashing kernels and DRM fixes...
Click to expand...
Click to collapse
Thanks for the promt reply. Can I ask one more thing? If I want to instal AndroPlus Kernel, does it matter which version Nougat stock ROM I flash to my device?
LokiSonofOdin said:
Thanks for the promt reply. Can I ask one more thing? If I want to instal AndroPlus Kernel, does it matter which version Nougat stock ROM I flash to my device?
Click to expand...
Click to collapse
Sorry that one I don't know... But someone may chime in a bit later..

Categories

Resources