How to unroot and go back to stock? F3111 - Sony Xperia XA Questions & Answers

How to unroot and go back to stock? Also I followed a guide and I have my DRM key backup on my PC.. Can I restore my DRM key after going to stock? How?

Hi.
If you're using SuperSU then there should be a "full unroot" option in the settings.
Did you backup your TA (trim area) partition using the dirtycow exploit? Then you should have the file TAbackup.img
Just push it to /data/local/tmp/TAbackup.img
I tried the following code the other day and it executed just fine but then my phone was bricked :S
Code:
adb shell dd if=/data/local/tmp/TAbackup.img of=/dev/block/mmcblk0p1
I fixed the soft brick by flashing a new stock firmware using Androxyde's Flashtool.
To my surprise the TA partition was fully restored and so were the DRM keys.
Before running this code you should double-check that your TA partition is indeed /dev/block/mmcblk0p1
For that you can use the parted tool. While still being rooted just push the parted executable to /system/bin/
and run this command:
Code:
parted /dev/block/mmcblk0
Good luck!

lebigmac said:
Hi.
If you're using SuperSU then there should be a "full unroot" option in the settings.
Did you backup your TA (trim area) partition using the dirtycow exploit? Then you should have the file TAbackup.img
Just push it to /data/local/tmp/TAbackup.img
I tried the following code the other day and it executed just fine but then my phone was bricked :S
Code:
adb shell dd if=/data/local/tmp/TAbackup.img of=/dev/block/mmcblk0p1
I fixed the soft brick by flashing a new stock firmware using Androxyde's Flashtool.
To my surprise the TA partition was fully restored and so were the DRM keys.
Before running this code you should double-check that your TA partition is indeed /dev/block/mmcblk0p1
For that you can use the parted tool. While still being rooted just push the parted executable to /system/bin/
and run this command:
Code:
parted /dev/block/mmcblk0
Good luck!
Click to expand...
Click to collapse
Can I do this after I flashed the official firmware? Because I already flash it.. And how do I check if the DRM keys are there? I get a notification when I go to software update in setting s that there's an update but I can't find how to download it

lebigmac said:
Hi.
If you're using SuperSU then there should be a "full unroot" option in the settings.
Did you backup your TA (trim area) partition using the dirtycow exploit? Then you should have the file TAbackup.img
Just push it to /data/local/tmp/TAbackup.img
I tried the following code the other day and it executed just fine but then my phone was bricked :S
Code:
adb shell dd if=/data/local/tmp/TAbackup.img of=/dev/block/mmcblk0p1
I fixed the soft brick by flashing a new stock firmware using Androxyde's Flashtool.
To my surprise the TA partition was fully restored and so were the DRM keys.
Before running this code you should double-check that your TA partition is indeed /dev/block/mmcblk0p1
For that you can use the parted tool. While still being rooted just push the parted executable to /system/bin/
and run this command:
Code:
parted /dev/block/mmcblk0
Good luck!
Click to expand...
Click to collapse
I rooted the phone again and did what you said. Now everything is ok and my DRM key was fully restored.
Thanks!

vraciu' said:
how do I check if the DRM keys are there?
Click to expand...
Click to collapse
If you go into service menu by calling *#*#7378423#*#*
Then go into service tests>security
The widevine and ckb should say Key OK active
And FIDO keys should be provisioned

Related

Android SDK to Backup my G6-L11

Hello everybody,
I'm new user on this forum please forgive me for my english as I am Belgian.
I try to make a backup of my Huawei G6-L11 with Android SDK.
I am on Xbuntu 14.04 (I am not a specialist but I use it for some months). I have installed the packages android-tools-adb and android-tools-fastboot and also android sdk.
My phone is connected to the PC via usb and the debug mode is active.
I followed the next steps in a terminal
[email protected]:~$ adb devices
List of devices attached
68a0f6753968 device
[email protected]:~$ adb backup -apk -shared -all -f backup.ab
Now unlock your device and confirm the backup operation.
[email protected]:~$
Click to expand...
Click to collapse
The problem is that I unlock the phone but the backup does not begin. Why? What can I do to begin it?
I really need to do this operation as I can not make any upgrade, any changes on my phone as the memory is full
Thanks a lot for your help
Use ADB, need root
Sent from my HUAWEI G6-L11 using XDA-Developers mobile app
persona78 said:
Use ADB, need root
Sent from my HUAWEI G6-L11 using XDA-Developers mobile app
Click to expand...
Click to collapse
Hello,
Thanks for your reply
I have tried with root and it does not function
I followed the steps I saw here https://memo-linux.com/android-utiliser-adb-pour-faire-une-sauvegarde-complete-de-son-smartphone-ou-tablette-sur-pc-sous-gnulinux/
And I can do the first steps, the problem is that the phone is not locked as it should be and the backup does not begin
Other solution?
Thanks a lot
Hello,
I become completely crazy with my problem :silly: I can't do it
I tried a lot of manipulations in order to do the backup and I found something interesting. In a file I had to create in /etc/udev.rules.d/ with the name 51-android.rules, I saw that the product ID seems change every time it is connected/disconnected of the PC. It was 1054, 1037 and also 1051. I suppose it make some trouble... Is it possible to blok it, ?
HTML:
ATTR{idVendor}=="12d1", ATTR{idProduct}=="1051", MODE=”0666"
Thanks a lot.
Hi!
With the phone ON, with root, plug USB, choose MTP, tuurn ON debug mode, it will pop up a window in phone requesting permissions to connect YOU MUST GIVE IT, need 2GB free in your sd card, use ADB and type this:
adb shell "su -c 'dd if=/dev/block/mmcblk0p4 of=/storage/sdcard1/rpm.img bs=4096; dd if=/dev/block/mmcblk0p5 of=/storage/sdcard1/tz.img bs=4096; dd if=/dev/block/mmcblk0p1 of=/storage/sdcard1/sbl1.img bs=4096; dd if=/dev/block/mmcblk0p11 of=/storage/sdcard1/modem.img bs=4096; dd if=/dev/block/mmcblk0p9 of=/storage/sdcard1/modemst1.img bs=4096; dd if=/dev/block/mmcblk0p10 of=/storage/sdcard1/modemst2.img bs=4096; dd if=/dev/block/mmcblk0p2 of=/storage/sdcard1/sdi.img bs=4096; dd if=/dev/block/mmcblk0p6 of=/storage/sdcard1/aboot.img bs=4096; dd if=/dev/block/mmcblk0p19 of=/storage/sdcard1/recovery.img bs=4096; dd if=/dev/block/mmcblk0p23 of=/storage/sdcard1/system.img bs=4096; dd if=/dev/block/mmcblk0p18 of=/storage/sdcard1/boot.img bs=4096; dd if=/dev/block/mmcblk0p24 of=/storage/sdcard1/userdata.img bs=4096; dd if=/dev/block/mmcblk0p21 of=/storage/sdcard1/cache.img bs=4096; dd if=/dev/block/mmcblk0p20 of=/storage/sdcard1/cust.img bs=4096; dd if=/dev/block/mmcblk0p12 of=/storage/sdcard1/fsg.img bs=4096'"
Now you have your ROM images in sd card. You will need a flash zip to flash it if you need it.
You can use this one, only need to paste the images inside.
RomBackup.zip
https://mega.nz/#!n5plABBT
Key:
!L5EVKRl6AnTyr24IrhwPacxU_DbO7t2moVVzw9gOOT4
Use TWRP to flash it: http://forum.xda-developers.com/ascend-g6/general/twrp-3-0-0-0-g6-lte-devices-t3378495
Hi Persona78,
Thanks a lot for your quick answer
As I understand what you explain in your answer, you proposed me to flash the ROM of the phone but that is not my aim. I only want to make a backup for after try to increase the internal memory. I do not want to root the phone so I found on Internet the ADB program.
I plug the phone which is ON, I plug it with the USB cable, choose MTP transfer protocol, turn it on debug mode and agree with the pop up on the phone. Everything is good until the time when a message should appear to UNLOCK the phone in order to backup. This message does not appear as the phone is already unlocked and as it get blocked, no message appears. Whatever, the backup does not begin!
Thanks a lot.
filipinne13 said:
Hi Persona78,
Thanks a lot for your quick answer
As I understand what you explain in your answer, you proposed me to flash the ROM of the phone but that is not my aim. I only want to make a backup for after try to increase the internal memory. I do not want to root the phone so I found on Internet the ADB program.
I plug the phone which is ON, I plug it with the USB cable, choose MTP transfer protocol, turn it on debug mode and agree with the pop up on the phone. Everything is good until the time when a message should appear to UNLOCK the phone in order to backup. This message does not appear as the phone is already unlocked and as it get blocked, no message appears. Whatever, the backup does not begin!
Thanks a lot.
Click to expand...
Click to collapse
Hmmm, all apps I know to do backup use root.
You can use CWM or TWRP to backup, but they don't backup cust, and I don't know if recover to images default size.
The only way I know is fashing default ROM.
---------- Post added at 09:54 AM ---------- Previous post was at 09:50 AM ----------
persona78 said:
Hmmm, all apps I know to do backup use root.
You can use CWM or TWRP to backup, but they don't backup cust, and I don't know if riecover to images default size.
The only way I know is fashing default ROM.
Click to expand...
Click to collapse
I have a L11 rom, modify by me, resided and if you create in sd card a primary ext4 partition it wil send the apps to sd card automatically.
Hello Persona78,
Hmmm, all apps I know to do backup use root.
You can use CWM or TWRP to backup, but they don't backup cust, and I don't know if recover to images default size.
The only way I know is fashing default ROM.
Click to expand...
Click to collapse
Finally, I made a manual backup by drag and drop and also with Mybackup which do not use root.
I have a L11 rom, modify by me, resided and if you create in sd card a primary ext4 partition it wil send the apps to sd card automatically.
Click to expand...
Click to collapse
I made a reset of the phone with the manufacturer's parameters but I would like to use one other rom as they do not have any update for this model but it seems to be complicated to do it. I do not know how to backup the manufacturer's rom as I met a problem after. I think I would not be possible for me to root, unlock, extend the sd card with Gparted (as I work under UBUNTU 14.04 LTS), and make the update with the new rom, as I am not so talented with computer science.
Thanks a lot.
I tried and finally I have used Gparted in order to split the sd card. I have now 4 partitions
- swap partition (29 mb),
- fat32 partition (6.35 Gb)
- ext4 partition (23.34Gb)
try one of my versions
You can try one of my versions.
Read first to know what you get if you flash it!
https://www.facebook.com/Huawei.Ascend.G6.L11.Kit.kat.B370/?ref=bookmarks

[Guide] [XT16XX] Moto G4/Plus Complete Partition Backup/Restore Zip/Script

Code:
#include <disclaimer.h>
/*
* Your warranty is now.......(wait a minute)........still valid?
*
* I am not responsible for bricked devices.
* YOU are choosing to make these modifications, and if you point
* your finger at me for messing up your device, I will laugh at you.
*/
As we know that on flashing ROMs/kernels/other mods, we sometimes do some mistake or face some issues so it is always recommended to take backup.
But unfortunately, TWRP does not takes backup of all the partitions.
When you open/dev/block/bootdevice/by-name/ you can see the names of the partitions and there are a total of 48 partitions. Of course not every one of them is important to back up, but it's better to be safe than sorry.
This method has been tested on my Moto G4 Plus (XT1643) and all the parts are work on it (backup and restore both using zip file and batch file)
Here is the list to all those partitions along with their number/id (maybe that's what its called, please correct me if there's any mistake)
Code:
Number/ID Name
mmcblk0p1 modem
mmcblk0p2 fsc
mmcblk0p3 ssd
mmcblk0p4 sbl1
mmcblk0p5 sbl1bak
mmcblk0p6 rpm
mmcblk0p7 rpmbak
mmcblk0p8 tz
mmcblk0p9 tzbak
mmcblk0p10 hyp
mmcblk0p11 hypbak
mmcblk0p12 dsp
mmcblk0p13 modemst1
mmcblk0p14 modemst2
mmcblk0p15 DDR
mmcblk0p16 fsg
mmcblk0p17 sec
mmcblk0p18 aboot
mmcblk0p19 abootbak
mmcblk0p20 logs
mmcblk0p21 utags
mmcblk0p22 utagsBackup
mmcblk0p23 cid
mmcblk0p24 logo
mmcblk0p25 clogo
mmcblk0p26 metadata
mmcblk0p27 kpan
mmcblk0p28 boot
mmcblk0p29 recovery
mmcblk0p30 persist
mmcblk0p31 misc
mmcblk0p32 config
mmcblk0p33 limits
mmcblk0p34 mota
mmcblk0p35 devcfg
mmcblk0p36 dip
mmcblk0p37 syscfg
mmcblk0p38 cmnlib
mmcblk0p39 keymaster
mmcblk0p40 frp
mmcblk0p41 padC
mmcblk0p42 sp
mmcblk0p43 hw
mmcblk0p44 customize
mmcblk0p45 oem
mmcblk0p46 cache
mmcblk0p47 system
mmcblk0p48 userdata
modemst1 and modemst2 are your EFS (the IMEI which you see in settings). When we flash Stock ROM, we erase them with fastboot erase commands but they are regenerated with the help of persist, so never ever restore somebody else's persist on your device and always keep a backup of modemst1, modemst2 a.k.a EFS and persist.
@givitago has already made a backup script for all the partitions which can be found here: Complete Partition Backup Script, so huge thanx to him!
Q) So why create another thread?
A) Frankly speaking, this thread does the same work as the above-mentioned thread, but it also talks about restoring the backup.
Also, now you can back up the partitions with a TWRP flashable zip file and restore them too with a TWRP flashable zip too!
The backup and restore will be done using dd commands.
Those who are unaware of dd commands, it is generally used for converting files.
Here is the syntax for dd command (I have used colors so that it is easy to differentiate them):
Code:
[COLOR="Green"]su
dd[/COLOR] [COLOR="Blue"]if=/directoryName/fileName[SIZE="4"].[/SIZE]fileExtension[/COLOR] [COLOR="DeepSkyBlue"]of=/yourDirectoryName/yourFileName[SIZE="4"].[/SIZE]yourFileExtension[/COLOR]
directoryName is the generic name of the directory where the file (which we want to access) is present.
fileName is the generic name of the file which we want to access.
fileExtension is the generic file extension of the file which we want to access.
yourDirectoryName is the generic name of the directory where we will store the file.
yourFileName is the generic name of the file which we will store as backup.
yourFileExtension is the generic file extension of the file which we are taking a backup of.
And lastly, su because we will run these commands under root permissions.
This thread is divided into 2 parts, backup and restore.
We will be using .img extension for the backed up partitions.
Pre-requisites:
You must be on latest Stock ROM
You must be rooted (install Elemental-X kernel first and then flash Magisk otherwise you will have boot issues)
Terminal app or adb drivers in PC/Laptop
Official TWRP only (if you use adb in TWRP)
Note: The below commands are to be typed in a terminal app or adb shell.
Q) How to type in adb shell?
A) Open command prompt in the folder where you have adb and fastboot installed and type:
Code:
adb shell
Code:
su
This command it to get root access for the terminal/shell. Grant the root access and you will see that the $ symbol is replaced with# symbol which means that root access has been granted.
You can skip this command if you are using TWRP (although then you wouldn't be able to backup build.prop)
Note: The flashable zip files are attached as well as their link has been given. The rar files are the ones which contain the commands for backup/restore and also contains the batch file.
Its been a while since I have moved on to a newer device, and not remember quite a few things about the device. Here is something important to note:
echo92 said:
Just a thought, do you think it'd be worth stressing to users of the recovery script to ensure they do NOT include any of the bootloader partitions in their recovery folder? I've seen a couple of users hard brick their devices by attempting to flash older bootloader partitions accidentally ( luckily, now we've got a newer OPJ28.111-22 blankflash).
I think the partitions to avoid restoring are:
mmcblk0p4 sbl1
mmcblk0p5 sbl1bak
mmcblk0p6 rpm
mmcblk0p7 rpmbak
mmcblk0p8 tz
mmcblk0p9 tzbak
mmcblk0p10 hyp
mmcblk0p11 hypbak
mmcblk0p18 aboot
mmcblk0p19 abootbak
Possibly more if there are other critical partitions not accounted for.
Click to expand...
Click to collapse
This method won't backup/restore system, userdata and cache as they take up too much space and are reset on flashing Stock ROM again.
Part 1: Backup
Here are the list of commands which will be used to backup the partitions:
Code:
mkdir /sdcard/Athene_Partitions
dd if=/system/build.prop of=/sdcard/Athene_Partitions/build.prop
dd if=/dev/block/bootdevice/by-name/aboot of=/sdcard/Athene_Partitions/aboot.img
dd if=/dev/block/bootdevice/by-name/abootbak of=/sdcard/Athene_Partitions/abootbak.img
dd if=/dev/block/bootdevice/by-name/boot of=/sdcard/Athene_Partitions/boot.img
dd if=/dev/block/bootdevice/by-name/cid of=/sdcard/Athene_Partitions/cid.img
dd if=/dev/block/bootdevice/by-name/clogo of=/sdcard/Athene_Partitions/clogo.img
dd if=/dev/block/bootdevice/by-name/cmnlib of=/sdcard/Athene_Partitions/cmnlib.img
dd if=/dev/block/bootdevice/by-name/config of=/sdcard/Athene_Partitions/config.img
dd if=/dev/block/bootdevice/by-name/customize of=/sdcard/Athene_Partitions/customize.img
dd if=/dev/block/bootdevice/by-name/DDR of=/sdcard/Athene_Partitions/DDR.img
dd if=/dev/block/bootdevice/by-name/devcfg of=/sdcard/Athene_Partitions/devcfg.img
dd if=/dev/block/bootdevice/by-name/dip of=/sdcard/Athene_Partitions/dip.img
dd if=/dev/block/bootdevice/by-name/dsp of=/sdcard/Athene_Partitions/dsp.img
dd if=/dev/block/bootdevice/by-name/frp of=/sdcard/Athene_Partitions/frp.img
dd if=/dev/block/bootdevice/by-name/fsc of=/sdcard/Athene_Partitions/fsc.img
dd if=/dev/block/bootdevice/by-name/fsg of=/sdcard/Athene_Partitions/fsg.img
dd if=/dev/block/bootdevice/by-name/hw of=/sdcard/Athene_Partitions/hw.img
dd if=/dev/block/bootdevice/by-name/hyp of=/sdcard/Athene_Partitions/hyp.img
dd if=/dev/block/bootdevice/by-name/hypbak of=/sdcard/Athene_Partitions/hypbak.img
dd if=/dev/block/bootdevice/by-name/keymaster of=/sdcard/Athene_Partitions/keymaster.img
dd if=/dev/block/bootdevice/by-name/kpan of=/sdcard/Athene_Partitions/kpan.img
dd if=/dev/block/bootdevice/by-name/limits of=/sdcard/Athene_Partitions/limits.img
dd if=/dev/block/bootdevice/by-name/logo of=/sdcard/Athene_Partitions/logo.img
dd if=/dev/block/bootdevice/by-name/logs of=/sdcard/Athene_Partitions/logs.img
dd if=/dev/block/bootdevice/by-name/metadata of=/sdcard/Athene_Partitions/metadata.img
dd if=/dev/block/bootdevice/by-name/misc of=/sdcard/Athene_Partitions/misc.img
dd if=/dev/block/bootdevice/by-name/modem of=/sdcard/Athene_Partitions/modem.img
dd if=/dev/block/bootdevice/by-name/modemst1 of=/sdcard/Athene_Partitions/modemst1.img
dd if=/dev/block/bootdevice/by-name/modemst2 of=/sdcard/Athene_Partitions/modemst2.img
dd if=/dev/block/bootdevice/by-name/mota of=/sdcard/Athene_Partitions/mota.img
dd if=/dev/block/bootdevice/by-name/oem of=/sdcard/Athene_Partitions/oem.img
dd if=/dev/block/bootdevice/by-name/padC of=/sdcard/Athene_Partitions/padC.img
dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/Athene_Partitions/persist.img
dd if=/dev/block/bootdevice/by-name/recovery of=/sdcard/Athene_Partitions/recovery.img
dd if=/dev/block/bootdevice/by-name/rpm of=/sdcard/Athene_Partitions/rpm.img
dd if=/dev/block/bootdevice/by-name/rpmbak of=/sdcard/Athene_Partitions/rpmbak.img
dd if=/dev/block/bootdevice/by-name/sbl1 of=/sdcard/Athene_Partitions/sbl1.img
dd if=/dev/block/bootdevice/by-name/sbl1bak of=/sdcard/Athene_Partitions/sbl1bak.img
dd if=/dev/block/bootdevice/by-name/sec of=/sdcard/Athene_Partitions/sec.img
dd if=/dev/block/bootdevice/by-name/sp of=/sdcard/Athene_Partitions/sp.img
dd if=/dev/block/bootdevice/by-name/ssd of=/sdcard/Athene_Partitions/ssd.img
dd if=/dev/block/bootdevice/by-name/syscfg of=/sdcard/Athene_Partitions/syscfg.img
dd if=/dev/block/bootdevice/by-name/tz of=/sdcard/Athene_Partitions/tz.img
dd if=/dev/block/bootdevice/by-name/tzbak of=/sdcard/Athene_Partitions/tzbak.img
dd if=/dev/block/bootdevice/by-name/utags of=/sdcard/Athene_Partitions/utags.img
dd if=/dev/block/bootdevice/by-name/utags-Backup of=/sdcard/Athene_Partitions/utags-Backup.img
The first command mkdir is used to create a folder named "Athene_Partitions" in your /sdcard directory, where all the partitions will be saved.
There is also a command to back up build.prop
Note: /sdcard is the same as the Internal storage directory. Do not confuse it with micro Sdcard as it has its directory named as /external_sd
I have not included backup of system, userdata, and cache partitions (system and userdata have huge sizes)
All these commands will create a backup of all the partitions except system, userdata and cache.
You can simply copy and paste them on the terminal and it will execute all of the commands simultaneously one after the other.
I am attaching a .bat file and a .txt file which will basically do the same thing as typing or copy-pasting the above commands.
Note: Backup-Partitions.bat and Backup-Partitions.txt should be saved together in adb and fastboot folder, otherwise the .bat file won't work.
I have created a TWRP flashable zip file which will do the same task as above. Make sure you flash it in Official TWRP only (Unofficial TWRP will also work, but I was facing some problem while restoring the partitions which were backed up using Unofficial TWRP, so just a warning).
Downloads:
Link: https://www.androidfilehost.com/?fid=11410963190603873123
md5: 16b9b34c82ca0cd8674428145961abff
Part 2: Restore
Note: Make sure that you place only the partitions which you want to restore in Athene_Partitions(if its not there, create it and put all the partitions which you want to restore in that folder) folder in /sdcard directory. Its fine if you still run all the commands while restoring partitions, as it will just ignore the files which it didn't find.
If you are using TWRP to restore the partitions, make sure it Official TWRP only (Unofficial TWRP won't work because for some partitions it might reboot in between (It happened with me and I do not know which partitions are causing this (one of them is hw)) so just a warning)
Here are the commands
Code:
dd if=/sdcard/Athene_Partitions/build.prop of=/system/build.prop
dd if=/sdcard/Athene_Partitions/aboot.img of=/dev/block/bootdevice/by-name/aboot
dd if=/sdcard/Athene_Partitions/abootbak.img of=/dev/block/bootdevice/by-name/abootbak
dd if=/sdcard/Athene_Partitions/boot.img of=/dev/block/bootdevice/by-name/boot
dd if=/sdcard/Athene_Partitions/cid.img of=/dev/block/bootdevice/by-name/cid
dd if=/sdcard/Athene_Partitions/clogo.img of=/dev/block/bootdevice/by-name/clogo
dd if=/sdcard/Athene_Partitions/cmnlib.img of=/dev/block/bootdevice/by-name/cmnlib
dd if=/sdcard/Athene_Partitions/config.img of=/dev/block/bootdevice/by-name/config
dd if=/sdcard/Athene_Partitions/customize.img of=/dev/block/bootdevice/by-name/customize
dd if=/sdcard/Athene_Partitions/DDR.img of=/dev/block/bootdevice/by-name/DDR
dd if=/sdcard/Athene_Partitions/devcfg.img of=/dev/block/bootdevice/by-name/devcfg
dd if=/sdcard/Athene_Partitions/dip.img of=/dev/block/bootdevice/by-name/dip
dd if=/sdcard/Athene_Partitions/dsp.img of=/dev/block/bootdevice/by-name/dsp
dd if=/sdcard/Athene_Partitions/frp.img of=/dev/block/bootdevice/by-name/frp
dd if=/sdcard/Athene_Partitions/fsc.img of=/dev/block/bootdevice/by-name/fsc
dd if=/sdcard/Athene_Partitions/fsg.img of=/dev/block/bootdevice/by-name/fsg
dd if=/sdcard/Athene_Partitions/hw.img of=/dev/block/bootdevice/by-name/hw
dd if=/sdcard/Athene_Partitions/hyp.img of=/dev/block/bootdevice/by-name/hyp
dd if=/sdcard/Athene_Partitions/hypbak.img of=/dev/block/bootdevice/by-name/hypbak
dd if=/sdcard/Athene_Partitions/keymaster.img of=/dev/block/bootdevice/by-name/keymaster
dd if=/sdcard/Athene_Partitions/kpan.img of=/dev/block/bootdevice/by-name/kpan
dd if=/sdcard/Athene_Partitions/limits.img of=/dev/block/bootdevice/by-name/limits
dd if=/sdcard/Athene_Partitions/logo.img of=/dev/block/bootdevice/by-name/logo
dd if=/sdcard/Athene_Partitions/logs.img of=/dev/block/bootdevice/by-name/logs
dd if=/sdcard/Athene_Partitions/metadata.img of=/dev/block/bootdevice/by-name/metadata
dd if=/sdcard/Athene_Partitions/misc.img of=/dev/block/bootdevice/by-name/misc
dd if=/sdcard/Athene_Partitions/modem.img of=/dev/block/bootdevice/by-name/modem
dd if=/sdcard/Athene_Partitions/modemst1.img of=/dev/block/bootdevice/by-name/modemst1
dd if=/sdcard/Athene_Partitions/modemst2.img of=/dev/block/bootdevice/by-name/modemst2
dd if=/sdcard/Athene_Partitions/mota.img of=/dev/block/bootdevice/by-name/mota
dd if=/sdcard/Athene_Partitions/oem.img of=/dev/block/bootdevice/by-name/oem
dd if=/sdcard/Athene_Partitions/padC.img of=/dev/block/bootdevice/by-name/padC
dd if=/sdcard/Athene_Partitions/persist.img of=/dev/block/bootdevice/by-name/persist
dd if=/sdcard/Athene_Partitions/recovery.img of=/dev/block/bootdevice/by-name/recovery
dd if=/sdcard/Athene_Partitions/rpm.img of=/dev/block/bootdevice/by-name/rpm
dd if=/sdcard/Athene_Partitions/rpmbak.img of=/dev/block/bootdevice/by-name/rpmbak
dd if=/sdcard/Athene_Partitions/sbl1.img of=/dev/block/bootdevice/by-name/sbl1
dd if=/sdcard/Athene_Partitions/sbl1bak.img of=/dev/block/bootdevice/by-name/sbl1bak
dd if=/sdcard/Athene_Partitions/sec.img of=/dev/block/bootdevice/by-name/sec
dd if=/sdcard/Athene_Partitions/sp.img of=/dev/block/bootdevice/by-name/sp
dd if=/sdcard/Athene_Partitions/ssd.img of=/dev/block/bootdevice/by-name/ssd
dd if=/sdcard/Athene_Partitions/syscfg.img of=/dev/block/bootdevice/by-name/syscfg
dd if=/sdcard/Athene_Partitions/tz.img of=/dev/block/bootdevice/by-name/tz
dd if=/sdcard/Athene_Partitions/tzbak.img of=/dev/block/bootdevice/by-name/tzbak
dd if=/sdcard/Athene_Partitions/utags.img of=/dev/block/bootdevice/by-name/utags
dd if=/sdcard/Athene_Partitions/utagsBackup.img of=/dev/block/bootdevice/by-name/utagsBackup
Like earlier in Step 1, I have not included system, userdata and cache.
You can simply copy and paste them on the terminal and it will execute all of the commands simultaneously one after the other.
I am attaching a .bat file and a .txt file which will basically do the same thing as typing or copy-pasting the above commands.
Note: Restore-Partitions.bat and Restore-Partitions.txt should be saved together in adb and fastboot folder, otherwise the .bat file won't work.
I have created a TWRP flashable zip file which will do the same task as above. Make sure you flash it in Official TWRP only (Unofficial TWRP won't work because for some partitions it might reboot in between (It happened with me and I do not know which partitions are causing this (one of them is hw)) so just a warning).
Just like earlier, just place the partitions you want to restore in Athene_Paritions folder and the zip file will ignore the partitions which aren't present.
Downloads:
Link: https://www.androidfilehost.com/?fid=11410963190603873124
md5: cfd44f834b72342816c308e915791135
Also do note that some people who weren't able to flash hw.img after getting their device changed from Moto G4 Plus to Moto G4, the restoring part wouldn't work for you unless you skip restoring hw.img, but trying won't hurt.
reserved.
Heeth21 said:
reserved.
Click to expand...
Click to collapse
how can i restore system, userdata and cache if i had a 16 gb model? i haven`t enough free space to backup these big parts. :c
commands through termanal app works well, but i want to backup all 48 parts of the stock ROM.
change all "sdcard" to "way_to_my_sd_card" through Msoft Word (faster) and run the script in terminal app, but it crashes and reboot in the process.
vlrgamaley said:
how can i restore system, userdata and cache if i had a 16 gb model? i haven`t enough free space to backup these big parts. :c
commands through termanal app works well, but i want to backup all 48 parts of the stock ROM.
Click to expand...
Click to collapse
I too have 16 GB model. Its just not practically possible to take backup of all these partitions on internal storage.
System, user data and cache will be changed(first erased and then recreated) if you clean flash a Custom ROM.
And on flashing Stock ROM, you will always have them so there isn't much to worry about their backup.
However if you still insist on taking their backup, there are two ways,
0. Reboot to recovery
1. Take their backup in external sd card.
The commands will be:
Code:
su
dd if=/dev/block/bootdevice/by-name/cache of=/external_sd/cache.img
dd if=/dev/block/bootdevice/by-name/system of=/external_sd/system.img
dd if=/dev/block/bootdevice/by-name/userdata of=/external_sd/userdata.img
These commands will save them in your external sd card.
2. Take their backup in PC/Laptop and then convert them
The commands will be:
Code:
adb pull /dev/block/bootdevice/by-name/cache
adb pull /dev/block/bootdevice/by-name/system
adb pull /dev/block/bootdevice/by-name/userdata
These commands will save their copy in your adb folder (so make sure you have enough space in that drive)
These files will have no extension so while restoring them take care of file extensions, so if we want to save them as .img files, we will have to convert them.
Now there are two ways to convert them:
a. Using Command Prompt/Command Line:
In Windows as well as in Linux, their file checksum remains the same, so no worries!
Also, I have restored the converted file (which was converted in Windows) and they work just fine!
Make sure you are running the command prompt/command line from the same directory where your cache, userdata and system files are stored.
Code:
In windows:
ren cache cache.img
ren userdata userdata.img
ren system system.img
In Linux:
mv cache cache.img
mv userdata userdata.img
mv system system.img
b. Directly changing their extension by renaming them:
Just rename the files manually.
Code:
cache->cache.img
system->system.img
userdata->userdata.img
This will change their file extensions.
In Windows as well as in Linux, the checksum remains the same by this method.
Also, I have restored the converted file (which was converted in Windows) and they work just fine!
Though I would still recommend converting them via command prompt/command line!
Edit: If you are using adb pull, it will take time as userdata and system are big partitions, also not to ignore the quality of USB cable, so be patient, it will take a while!
Edit2: @vlrgamaley was your friend able to recover their IMEI, I saw you earlier post in other thread.
Edit2: @vlrgamaley was your friend able to recover their IMEI, I saw you earlier post in other thread.
Click to expand...
Click to collapse
he wrote on phone "persist" twrp backup from Lenovo forum (in ext4 format), and after that phone works. gsm, 3g and calls also works, but 4g isn`t work and imei = 0 is staying. but calls works, and that`s not bad in that situation.
i try to backup userdata on sd and it crashes and boot again and again :c strange.
vlrgamaley said:
he wrote on phone "persist" twrp backup from Lenovo forum (in ext4 format), and after that phone works. gsm, 3g and calls also works, but 4g isn`t work and imei = 0 is staying. but calls works, and that`s not bad in that situation.
i try to backup userdata on sd and it crashes and boot again and again :c strange.
Click to expand...
Click to collapse
He messed up his device for good now. He will never able to recover IMEI now, unless by editing persist.
Backup by rebooting in TWRP.
Heeth21 said:
He messed up his device for good now. He will never able to recover IMEI now, unless by editing persist.
Click to expand...
Click to collapse
i don`t know why he hurry up with that, but he did it and now no way to return)
Heeth21 said:
Backup by rebooting in TWRP.
Click to expand...
Click to collapse
backup userdata in TWRP? ok.
vlrgamaley said:
backup userdata in TWRP? ok.
Click to expand...
Click to collapse
Well, you could do that infact, as TWRP can backup data, system and cache.
If you want to take their backup in .img format, reboot your device in TWRP as TWRP has adb enabled by default and then follow post #6 (https://forum.xda-developers.com/showpost.php?p=78354296&postcount=6)
Heeth21 said:
Well, you could do that infact, as TWRP can backup data, system and cache.
If you want to take their backup in .img format, reboot your device in TWRP as TWRP has adb enabled by default and then follow post #6 (https://forum.xda-developers.com/showpost.php?p=78354296&postcount=6)
Click to expand...
Click to collapse
ooooooooo, hard for me lol) "adb not found" but adb is on (from cmd on windows), and now phone in recovery. what i did wrong? i so stupid, sry)
vlrgamaley said:
ooooooooo, hard for me lol) "adb not found" but adb is on (from cmd on windows), and now phone in recovery? what i did wrong? i so stupid, sry)
Click to expand...
Click to collapse
Make sure you open command prompt from inside the adb folder or direct the command prompt to adb directory.
Open the folder where adb is present, press shift button + mouse right click and then you will see some options like refresh, view, sort by, etc. Select "Open command prompt window here" or "Open powershell window here" or similar to that.
If you open command prompt, then just continue, and if you open powershell, then just type "cmd" and hit enter and then backup.
To check if your device is recognized by pc in adb mode, type "adb devices" and you will see the serial number for your device.
If you have any more questions, do ask, don't do anything stupid as dd commands are very powerful and a mistake could by costly!
Heeth21 said:
Well, you could do that infact, as TWRP can backup data, system and cache.
If you want to take their backup in .img format, reboot your device in TWRP as TWRP has adb enabled by default and then follow post #6 (https://forum.xda-developers.com/showpost.php?p=78354296&postcount=6)
Click to expand...
Click to collapse
very strange error.
vlrgamaley said:
very strange error.
Click to expand...
Click to collapse
Could you explain??
Heeth21 said:
Could you explain??
Click to expand...
Click to collapse
you can see it on attach picture. that command isn`t work and i haven`t backup file of "cache" in adb folder...
vlrgamaley said:
you can see it on attach picture. that command isn`t work and i haven`t backup file of "cache" in adb folder...
Click to expand...
Click to collapse
Sorry, I missed the screenshot. What version of TWRP are you using?? Please use official TWRP, as mentioned in OP. I am using official TWRP and it works fine for me.
Here is the link to Official TWRP: https://dl.twrp.me/athene/
Download the latest version (3.2.1.0) and save the twrp in your adb folder, reboot to bootloader mode and then flash it. Command:
Code:
fastboot flash recovery twrp-3.2.1-0-athene.img
.
Then reboot into recovery from fastboot itself by using volume keys and selecting recovery option
Here is a screenshot when I use adb pull:
Heeth21 said:
Sorry, I missed the screenshot. What version of TWRP are you using?? Please use official TWRP, as mentioned in OP. I am using official TWRP and it works fine for me.
Here is the link to Official TWRP: https://dl.twrp.me/athene/
Download the latest version (3.2.1.0) and save the twrp in your adb folder, reboot to bootloader mode and then flash it. Command:
.
Then reboot into recovery from fastboot itself by using volume keys and selecting recovery option
Here is a screenshot when I use adb pull:
Click to expand...
Click to collapse
i have official twrp 3.2.1 right now and boot into recovery from fastboot through volume keys)
but command in prompt isn't work) wtf?)
vlrgamaley said:
i have official twrp 3.2.1 right now and boot into recovery from fastboot through volume keys)
but command in prompt isn't work) wtf?)
Click to expand...
Click to collapse
Did you wipe cache?? Try the commands for system and userdata and check if they work.
And please attach a screenshot
Heeth21 said:
Did you wipe cache?? Try the commands for system and userdata and check if they work.
And please attach a screenshot
Click to expand...
Click to collapse
ok, now is night in Siberia, and i go to sleep. tomorrow (+12 hrs) i try and write here about results)
vlrgamaley said:
ok, now is night in Siberia, and i go to sleep. tomorrow (+12 hrs) i try and write here about results)
Click to expand...
Click to collapse
If you are okay with a twrp backup, then just backup data, system and cache from twrp and store them.

FRP unlock impossible ?

Hello all,
I'm writing today here because I have a Xperia XZ (F8331) phone locked waiting for google account.
Unfortunatly, I don't know one of the previous google account. I tried all procedure available in Youtube (talkback or select text to have option to go to the Internet). I don't know why but I don't have access to this option, maybe because of SwiftKey keyboard.
I also tried to reinstall official ROM using flashtool.
Would be great if any of you can help me.
You can't get around it unless you somehow manage to wipe internal storage with locked bootloader. Only thing I can suggest is to unlock bootloader but you will need the imei. I think you can find it inside the sim tray. So give it a try. Keep in mind that you will lose your ta parition.
My suggestion would also be to unlock the bootloader. For that, you need to find out the IMEI of your device and then go to the Sony Unlock Bootloader page.
After you have unlocked your bootloader, you can go ahead and wipe the frp partition.
If you want to back up your DRM keys, you can follow this guide: https://forum.xda-developers.com/crossdevice-dev/sony/universal-dirtycow-based-ta-backup-t3514236
You need to flash Android Marshmallow for the TA backup to work.
But in my opinion, you don't need to back up your TA partition, since there is a fix for missing DRM keys available.
Technical details:
To get around the FRP protection feature, you have to wipe the FRP partition. It is mounted at /persistent (not /persist !) and the name of the partition is "frp" and the block device is "/dev/block/mmcblk0p46". You can the following in TWRP:
Code:
mkdir /frp
mount -t /dev/block/mmcblk0p46 /frp
ls -la /frp
You should see what's inside that partition and delete it.
Code:
umount /frp
cat /dev/zero > /dev/block/bootdevice/by-name/frp

persist.img backup and restore

Hey guys! I was doing some forum surfing and I heard about this image called persist.img. I found out that it's specific to each device and you lose widevine if you flash a generic one. So I have 2 questions to ask you guys.
1. If I have a backup of my own persist.img, can I flash it and not lose widevine?
2. How do I actually back up the image?
Thanks on advance guys! ⊂((・▽・))⊃
1. not sure honestly, but I backup anyway to try if it does when time comes.
(Root is needed)
From computer:
adb shell dd if=/dev/block/bootdevice/by-name/persist of=/tmp/persist.img
adb pull /tmp/persist.img persist.img
Or from phone from terminal emulator;
su
dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/persist.img
Make a copy of this to somewhere else(drive/pc etc).
Not completely sure about restoring it, I think you can just flash it via fastboot.
Lossyx said:
1. not sure honestly, but I backup anyway to try if it does when time comes.
(Root is needed)
From computer:
adb shell dd if=/dev/block/bootdevice/by-name/persist of=/tmp/persist.img
adb pull /tmp/persist.img persist.img
Or from phone from terminal emulator;
su
dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/persist.img
Make a copy of this to somewhere else(drive/pc etc).
Not completely sure about restoring it, I think you can just flash it via fastboot.
Click to expand...
Click to collapse
That's great! Thanks for the help
Hey. How can we backup it without root?
Lossyx said:
1. not sure honestly, but I backup anyway to try if it does when time comes.
(Root is needed)
From computer:
adb shell dd if=/dev/block/bootdevice/by-name/persist of=/tmp/persist.img
adb pull /tmp/persist.img persist.img
Or from phone from terminal emulator;
su
dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/persist.img
Make a copy of this to somewhere else(drive/pc etc).
Not completely sure about restoring it, I think you can just flash it via fastboot.
Click to expand...
Click to collapse
where can i find the persist.img file in the device ? i search using google files app and it wasnt there.
Kagetane Hiruko said:
where can i find the persist.img file in the device ? i search using google files app and it wasnt there.
Click to expand...
Click to collapse
There is a app from play store called partitions backup it shows all partitions including persist and let's u make a copy for back up
hammered58 said:
There is a app from play store called partitions backup it shows all partitions including persist and let's u make a copy for back up
Click to expand...
Click to collapse
Needs root though.
You could do an msmtool readback i think it's called using msmtool. to backup without root. you do need windows for it though.

[SOLVED] Help to mount userdata in linux or repair userdata.img

After an Update of Two magisk modules, my Ulefone Armor 11 5G staied stucked on boot logo, I can only enter in recovery or fastboot.
I try to build a TWRP, but it is not able to mount userdata.
I was able to download with the help of mtkclient all the partition on my phone, even userdata , it took 7 hours.
I wanted to load the image in linux but using mount disk imag or using the command sudo mount -o loop userdata.img ~/Armor_11_5G doesn't do anything not even an error message.
I'm wondering if the filesystem was corrupted during the update.
Is it possible to repair the fylesystem like in Windows?
Thanks
did you previously disable encryption and factory reset long time before the modules updates failed?
what do you mean mount doesn't do anything not even an error message? either it give error message or it succeed.
I didn't disable encryption before updating the modules, I already updated this modules many times.
what do you mean mount doesn't do anything not even an error message? either it give error message or it succeed.
Click to expand...
Click to collapse
That is the problem, it doesn't succed and I don't have an error message. The file is 256 Gbyte big, I don't know if it plays a role. I'm using Ubuntu 22
if phone is encrypted that's just 256G garbage. post the output of
Code:
$ parted <file> unit B print
Here are the results of parted
Code:
Error: /home/*****/Public/userdata.bin.img: unrecognised disk label
Model: (file)
Disk /home/osboxes/Public/userdata.bin.img: 249208733696B
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
Thanks
You may try https://www.cgsecurity.org/wiki/TestDisk_Download
I'd be glad for your feedback.
sorry thought it's whole disk, but it's only 232G file therefore parted won't print partition table
does apply to FDE only
assuming this file is dump of single userdata partition, open with HxD editor. if the partition image is not encrypted, you will see lot zeros within first 1024 bytes.
in that case you can check for file system type is ext4 or f2fs.
Code:
$ xxd -l 1080 dump.img | grep 53ef
$ xxd -l 1024 dump.img | grep 1020.f5f2
But most likely the userdata partition is encrypted, therefore no way to recover data offline.
The easiest way not to load Magisk modules is, not to load Magisk. Flashing stock boot.img will solve it.
Beware, in case you disabled encryption beforehand, booting stock boot.img will force encryption. This may take long time without notice.
I never disabled encryption, I don't know if Magisk do it without informing. I used this phone for an year without a problem.
After the update I left the phone on for one night but nothing happens. I tried to reflash the stock boot image, and again a whole night wait, but again nothing happens.
Reading the fstab the file system should be ext4.
The file is the dump of the whole userdata partition of my Ulefone Armor 11 5G.
I did a backup of the whole system before doing any experiment so if the partition table is corrupted maybe if I reflash back the userdata partition with a working partition table I have again access to the datas.
there is no partition table in userdata partition, I just gave you wrong advise. because the phones total storage is 256G, I made wrong assumptions (you can view partition table from file pgpt.bin)
full 1:1 backup is impossible for FBE encryption because encryption keys are stored in TEE. once you factory reset device backup of userdata + metadata becomes useless.
fstab doesn't tell you what file you just have dumped. if you can't find ext4 super magic (#7) it's impossible to loop mount that file (and impossible to decrypt on linux PC)
if you can't fix boot-loop by stock boot.img then it's unrelated to magisk modules. you can however enable adb in default.prop and capture adb logcat during boot-loop for further analysis. you could also inject own script that deletes some files (only DE encrypted files, CE encrypted files requires lock screen credentials aka pin/pattern)
boot this TWRP and get log from adb
Code:
$ fastboot boot recovery.img
$ adb shell twrp decrypt '1234'
$ adb pull /tmp/recovery.log
https://twrp.me/faq/openrecoveryscript.html
full 1:1 backup is impossible for FBE encryption because encryption keys are stored in TEE. once you factory reset device backup of userdata + metadata becomes useless.
Click to expand...
Click to collapse
With mtk client I was able to do the backup of tee1 and tee2 and also of gpt_backup and gpt_main.
$ xxd -l 1080 dump.img | grep 53ef
$ xxd -l 1024 dump.img | grep 1020.f5f2
Click to expand...
Click to collapse
Doesn't produce any results.
I have immediately the command prompt.
you can however enable adb in default.prop
Click to expand...
Click to collapse
How can I do that? Which value should I change in default.prop?
so your "backup" is encrypted. please note Trustonic Kinibi is TEE OS running in secure memory one can't access or backup with mtkclient. the tee partitions in phone storage do not contain any encryption key (none of the partitions does, secure memory is not even a partition). the only crypto related partition is metadata used for keydirectory of metadata encryption (on top of FBE encryption) but it is useless for backup purposes.
yes you can modify default.prop in boot.img, ro.secure=0 should give root access.
https://forum.xda-developers.com/t/...hone-with-broken-screen.2965462/post-85905033
Code:
ro.secure=0
ro.debuggable=1
persist.service.adb.enable=1
in case the default.prop modification is not sufficient, you need additional command to be executed as root.
Code:
# settings put global adb_enabled 1
as you installed magisk, you could use magisk overlay.d/sbin/ for running startup script.
https://forum.xda-developers.com/t/...ithout-losing-your-data.4383255/post-86934375
aIecxs said:
boot this TWRP and get log from adb
Code:
$ fastboot boot recovery.img
$ adb shell twrp decrypt '1234'
$ adb pull /tmp/recovery.log
https://twrp.me/faq/openrecoveryscript.html
Click to expand...
Click to collapse
How about this TWRP? it should be able to decrypt userdata. if decryption failed, provide recovery.log
Until tomorrow I cannot do a logcat and I cannot find my view logcat on my laptop.
I unpacked boot.img with Carliv Image Kitchen and there is no default.prop, that is present in the recovery as prop.default.
Is there a way to backup secure memory of Trustonic?
How about this TWRP? it should be able to decrypt userdata. if decryption failed, provide recovery.log
Click to expand...
Click to collapse
I already tried that version but it cannot decrypt, that' why I'm trying to build my own version of TWRp with the help of the creator of that version of TWRP, but I'm stucked.
oh, you know how to build TWRP with proper FBE + metadata encryption support? have a look at other Oppo devices how they did... good luck.
regarding default.prop in boot.img (it's a symlink to system unfortunately) you can do it the other way
use magisk overlay.d/sbin/
create a boot script that does the thing with resetprop -n <prop_name> <prop_value>
don't use outdated Carliv Image Kitchen! use osm0sis AIK from link above.
oh, you know how to build TWRP with proper FBE + metadata encryption support? have a look at other Oppo devices how they did... good luck.
Click to expand...
Click to collapse
I'm learning.
I try to integrate the decryption service following the suggestion of ADeadTrouser on Github, but the service doesn't want to start and I don't understand why.
I never checked Oppo, I will take a look at them also, thanks for the suggestion.
I think I figured out now the adb logcat at least. hope that helps
https://forum.xda-developers.com/t/accessing-my-phone-with-a-dead-screen.4542763/post-88016019
I tried your script butr nothing happens, the telephone is not listed when I type
Code:
adb devices
and if I type
Code:
adb logcat
I receive the message waiting for device
you might follow the thread
wenyendev said:
You may try https://www.cgsecurity.org/wiki/TestDisk_Download
I'd be glad for your feedback.
Click to expand...
Click to collapse
I run the software on the image and it identify the contents and can read the encrypted and not encrypted part, that means that all the files are there, but I cannot mount in Linux or in TWRP
The fact that I cannot mount in Linux or TWRP the userdata image/partition can be that is corrupted the partition or the file index?
That would also explain why the script for Magisk provided by aIecxs is not able to copy the adb_key from the cache in the data partition.

Categories

Resources