Question Ways to return the device to stock? - OnePlus Nord 2 5G

I am a bit of a scaredy cat, and I don’t want to pollute the GSI thread with this question.
OnePlus is not offering fast boot flash images for their Nord 2. And the only way to get a custom rom is by flashing a custom vbmeta image and a system image for GSI.
The question now arises, how could one come back from a GSI into stock? I would assume I would need to do ADB push/pull and copy the whole system NAND to a file, then restore that if needed.
Would that be true? Or are there better / faster / safer ways to turn the phone to stock?
I have not yet received my unit, but i want to start tinkering with it as soon as I get my hands on it. So I want to know if there are any ways to undo any and all modifications i would do to the system.
Cheers

Can't twrp backup as system.img

ajaz35 said:
Can't twrp backup as system.img
Click to expand...
Click to collapse
I am unsure if this is being worded as a factual statement, or as a question.

I am telling that TWRP Backs up system as System.img in most Phones.
Same should apply to Nord 2.

ajaz35 said:
I am telling that TWRP Backs up system as System.img in most Phones.
Same should apply to Nord 2.
Click to expand...
Click to collapse
It should apply, but there's the issue of backups needing to be bit-perfect to ensure not to upset dm-verity
I have however found a bunch of commands that i will be testing in about 6 days, once i receive the terminal. I will be placing them for future reference, and for any poor souls who may need this:
Code:
adb backup --twrp -f /directory/to/save/dump.db
Not exactly my cup of tea, but this should combine bit-perfect system and vendor images with space-saving regular file copies of other lesser i mportant partitions, and ignoring the /data/media partition. Should be good enough.
Code:
adb root
adb shell 'dd if=/dev/block/mmcblk0 2>/dev/null' > mmcblk0.img
These two commands should, on an ideal world, with debugging enabled on the target device, and from within TWRP, create a bit-perfect copy of the entire nand and leave them on the CWD. however, the path may differ from what i've found, different chipset and all. However, that's nothing that a good old
Code:
lsblk -l
won't solve. The tricky bit will be actually pulling the file back. Since redirects can seemigly be used to copy the image file to the CWD, redirects may be able to be used to write to disk remotely. This one requires more research.
Alternatively, i will need to buy an OTG cable, get a large enough flash drive, and mount it for the purposes and DD'ing the file out and into the device. If all else fails, with 8GB of RAM it should be able to store 1/16 of the total NAND flash onto ram and slowly stitch the nand in chunks. Not shore how well would that go, too many points of failure. But keeping this for my own musings.
Another possible answer would be to boot into TWRP, running
Code:
lsblk -l
to see all the mount points, and using
Code:
adb push / adb pull
on each of them. Research indicates one can't copy the whole NAND this way, but individual partitions. Should suffice as long as the subsequent coopies are bit-perfect. Assuming one can push the generated image back, this may be the most satisfactory answer.
I will attempt to perform these tasks when i receive the phone and see if it can successfuly restore it's own backup.

ajaz35 said:
I am telling that TWRP Backs up system as System.img in most Phones.
Same should apply to Nord 2.
Click to expand...
Click to collapse
Additionally, one should note that i intend on fully backing up the NAND of the device. Just the system partition is insufficient. as there may be updates on the way that may make restoring the system partition from an OTA image impossible. Therefore, a full NAND copy is needed. altnernatively, if a low-level copy cannot be achieved, individual bit-perfect copies of individual partitions will need to suffice, and hoping no GSI or custom rom maniulates any of the protected partitions.

Do you flash the system.img from my backup?
Oneplus Nord 2 Oxygen 11.3 DN2103 EEA ROM
Flash at your own risk. I am not responsible for any damage or data loss to the device during this process! Downloads: The Fastboot restoration file can be downloaded in here: DN2103_11_A.07 DN2103_11_A.10 *deleted DN2103_11_A.11 *deleted...
forum.xda-developers.com

sakarya1980 said:
Do you flash the system.img from my backup?
Oneplus Nord 2 Oxygen 11.3 DN2103 EEA ROM
Flash at your own risk. I am not responsible for any damage or data loss to the device during this process! Downloads: The Fastboot restoration file can be downloaded in here: DN2103_11_A.07 DN2103_11_A.10 *deleted DN2103_11_A.11 *deleted...
forum.xda-developers.com
Click to expand...
Click to collapse
As I stated previously. I have yet to receive my terminal. So I haven’t flashed anything yet.
however, disabling dm-verity, installing your system image, see it it fails, and if it fails, backing up, will be a great way to test if my backups are effective.
I want to toy around with your image and PHH’s once I get the terminal. So I’m just trying to preemptively have backups in place for when I inevitably flash something without paying attention and bricking the device.
that reminds me, were you the one who needed a full system dump a few weeks ago on another thread? I can upload my image once I get it working
Edit: just checked it was phhusson who needed the dump. Sorry about the mix up

ZanaGB said:
As I stated previously. I have yet to receive my terminal. So I haven’t flashed anything yet.
however, disabling dm-verity, installing your system image, see it it fails, and if it fails, backing up, will be a great way to test if my backups are effective.
I want to toy around with your image and PHH’s once I get the terminal. So I’m just trying to preemptively have backups in place for when I inevitably flash something without paying attention and bricking the device.
that reminds me, were you the one who needed a full system dump a few weeks ago on another thread? I can upload my image once I get it working
Edit: just checked it was phhusson who needed the dump. Sorry about the mix up
Click to expand...
Click to collapse
I tested rhe gsi Versions, but not good i flash my system.img, dtbo, persist and vbmeta and go back to stock

Just got notified that the phone arrived. So this evening i will get it up and running then worry about backing up later.

Hi. How return the device to stock and lock bootloader? Is there manual?​

shnailcheg said:
Hi. How return the device to stock and lock bootloader? Is there manual?​
Click to expand...
Click to collapse
Assuming you didn't install any custom ROM, all you have to do is boot onto fastboot and type fastboot OEM lock or fastboot flashing lock. Forgot which exactly.

I have root installed

shnailcheg said:
I have root installed
Click to expand...
Click to collapse
restore your full NAND backup and godspeed

have you tried this method on nord 2?

shnailcheg said:
have you tried this method on nord 2?
Click to expand...
Click to collapse
I made a nand copy but never backed it up.I ended up not needing root for anything and I won't install any ROMs until there's any good ways to have a failsafe for backups. So to all effects I have a backup I haven't tested. I am not gonna risk losing my IMEI or having a zombified phone due to missing blocks on the backup.
To be specific. I have ways to get data OUT of the phone. But I don't have a reliable way to get the data IN and ensure nothing critical is missing or overwritten in the process. And I am too afraid to lose my phone just testing if backups ACTUALLY work.

K
ZanaGB said:
I am a bit of a scaredy cat, and I don’t want to pollute the GSI thread with this question.
OnePlus is not offering fast boot flash images for their Nord 2. And the only way to get a custom rom is by flashing a custom vbmeta image and a system image for GSI.
The question now arises, how could one come back from a GSI into stock? I would assume I would need to do ADB push/pull and copy the whole system NAND to a file, then restore that if needed.
Would that be true? Or are there better / faster / safer ways to turn the phone to stock?
I have not yet received my unit, but i want to start tinkering with it as soon as I get my hands on it. So I want to know if there are any ways to undo any and all modifications i would do to the system.
Cheers
Click to expand...
Click to collapse
Keep nandroid backup evry time you want to go back just restore that nandroid backup using twrp if you gets data restoration error just deselect data emmc win file in backup and restore.
Remember on android 12 gsi twrp data encryption issue so u can't able to access internal storage to restore the backup so first go back to android 11 gsi, now transfer that backup to twrp folder and then boot back to twrp and restore
I personally done this when I stuck on android 12gsi

pankspoo said:
K
Keep nandroid backup evry time you want to go back just restore that nandroid backup using twrp if you gets data restoration error just deselect data emmc win file in backup and restore.
Remember on android 12 gsi twrp data encryption issue so u can't able to access internal storage to restore the backup so first go back to android 11 gsi, now transfer that backup to twrp folder and then boot back to twrp and restore
I personally done this when I stuck on android 12gsi
Click to expand...
Click to collapse
One thing i have been reading from the TWRP Nandroid backups, is that people who install the GSI and then restore, lose their IMEI data and other baked-in addresses.
Is that the case? I would imagine that since TWRP backups aren't bit-for-bit it could cause problems. Have you tested for that?
EDIT: additionally, i guess i absolutely need an OTG adatper to properly restore the backup, since the mere ac of restoring the backup would destroy the backup in the process, wouldn't it?

ZanaGB said:
One thing i have been reading from the TWRP Nandroid backups, is that people who install the GSI and then restore, lose their IMEI data and other baked-in addresses.
Is that the case? I would imagine that since TWRP backups aren't bit-for-bit it could cause problems. Have you tested for that?
EDIT: additionally, i guess i absolutely need an OTG adatper to properly restore the backup, since the mere ac of restoring the backup would destroy the backup in the process, wouldn't it?
Click to expand...
Click to collapse
No if u r on android 12 gsi u need OTG there twrp will not work.
No issue in Restoration on android 11gsi

pankspoo said:
No if u r on android 12 gsi u need OTG there twrp will not work.
No issue in Restoration on android 11gsi
Click to expand...
Click to collapse
So. The way i understand it.
1: Full backup from the stock ROM ( Android 11 Based ) using TWRP
2: Install a GSI, for example, Android 12 GSI
3: In need of going back, first install the Android 11 GSI
4: Once with the 11 GSI installed, recover the TWRP Backup
Would that be correct?

Related

[Q] Nabi 2 Kids Android Tablet

Hello Everyone,
I have not play with any android devices since android 2.0 and even back then found self rooting tools. I got my Kid Nabi2 tablet. Runs Android 4.0.4 currently. Nice little tablet. Problem is only have 8GB or storage. About 4gb after all system partitions and recoveries. So my question is can I safely back up my recovery partition to external source to free up some space? I assume recovery partition has complete recovery files when I do restore to factory option. I I remember correctly android has few partitions. /boot, /system, /recovery, /sd. is there a way just to have your operating system and whatever apps. Have recovery mode but have files on like sd card. If I decide to root this device dose that changes anything in my recovery partition. If device is rooted can I just go back to completely stock by doing factory reset? I just want to make sure that if I root it and want to go back to complete stock for any reason I can do that.
You can restore from your backup that gets made after you flash the custom recovery.
Here is the original script for using on Windows:
http://forum.xda-developers.com/showthread.php?p=32207344
Though you should use the gapps package from http://forum.xda-developers.com/showthread.php?p=35888524 as it gets rid of the 'android upgrading' messages on every boot.
If you want a more manual method, or are on linux, see http://forum.xda-developers.com/showthread.php?t=2016463
t499user said:
You can restore from your backup that gets made after you flash the custom recovery.
Here is the original script for using on Windows:
http://forum.xda-developers.com/showthread.php?p=32207344
Though you should use the gapps package from http://forum.xda-developers.com/showthread.php?p=35888524 as it gets rid of the 'android upgrading' messages on every boot.
If you want a more manual method, or are on linux, see http://forum.xda-developers.com/showthread.php?t=2016463
Click to expand...
Click to collapse
T499user, thank you for replaying. I do run windows. I did look at the section you direct me to me before. What I don't understand is when you root with his program do I use option 1 or 2. Where dose the back up go and how do I restore it later? when I restore dose that bring it back completely to stock, meaning just like it was when i got it? I'm currently running new nabi software do I have to worry about losing wifi?
Also is there a way of freeing up space on my nabi 2 by keeping a back up somewhere else. I think now there is recovery/back up partition. that works when I do factory reset. is that is how that works?
By installing new custom recovery would other recovery still be there?
Sorry trying to get back after many Apple years..
skull791 said:
T499user, thank you for replaying. I do run windows. I did look at the section you direct me to me before. What I don't understand is when you root with his program do I use option 1 or 2. Where dose the back up go and how do I restore it later? when I restore dose that bring it back completely to stock, meaning just like it was when i got it? I'm currently running new nabi software do I have to worry about losing wifi?
Also is there a way of freeing up space on my nabi 2 by keeping a back up somewhere else. I think now there is recovery/back up partition. that works when I do factory reset. is that is how that works?
By installing new custom recovery would other recovery still be there?
Sorry trying to get back after many Apple years..
Click to expand...
Click to collapse
I prefer to do it manually, but if you are going to use the script, use option 2. Then you can install gapps from TWRP using http://forum.xda-developers.com/showthread.php?t=2065878.
The backup that gets created is of the current system state. It is stored in /sdcard/TWRP/backups/*serialnumber*/backupname
No worries about wifi as long as you did all of the OTA updates.
t499user said:
I prefer to do it manually, but if you are going to use the script, use option 2. Then you can install gapps from TWRP using http://forum.xda-developers.com/showthread.php?t=2065878.
The backup that gets created is of the current system state. It is stored in /sdcard/TWRP/backups/*serialnumber*/backupname
No worries about wifi as long as you did all of the OTA updates.
Click to expand...
Click to collapse
Now do I have to install TWRP or when i root it will do it for me?
It will be done with the script.
t499user said:
It will be done with the script.
Click to expand...
Click to collapse
What dose exactly gets back up?
also do you know why nabi2 only has about 4.45gb of free storage when total is 8gb? 3.55gb seems a lot for system files???
skull791 said:
What dose exactly gets back up?
also do you know why nabi2 only has about 4.45gb of free storage when total is 8gb? 3.55gb seems a lot for system files???
Click to expand...
Click to collapse
The system, boot, and data partitions get backed up. That is the way they set it up for the partitions.
All of your questions have already been answered in the other threads, might want to do a search for 'Nabi' and have a read.
t499user said:
The system, boot, and data partitions get backed up. That is the way they set it up for the partitions.
All of your questions have already been answered in the other threads, might want to do a search for 'Nabi' and have a read.
Click to expand...
Click to collapse
T499user trust me I been reading crazy and still cant find an answer. Want to point me to the right place ?
No problem, I would start with the following:
http://forum.xda-developers.com/showthread.php?t=1905674
http://forum.xda-developers.com/showthread.php?t=2016463
t499user said:
No problem, I would start with the following:
http://forum.xda-developers.com/showthread.php?t=1905674
http://forum.xda-developers.com/showthread.php?t=2016463
Click to expand...
Click to collapse
Thank you. I did read all of them. Do you know where I can find something about android system file. Mostly why I have only 4.45gb out of 8. Is thereba way to move back up patition? To external source to free up some space?

Can TWRP backup encrypted phones?

Can TWRP backup encrypted phones?
Because since it has been encrypted, it is failing. I'd like to make a backup before I try installing a new ROM.
automatism said:
Can TWRP backup encrypted phones?
Because since it has been encrypted, it is failing. I'd like to make a backup before I try installing a new ROM.
Click to expand...
Click to collapse
Same here. TWRP cannot access /data
Would it be possible with CWM recovery?
If encrypted, you need to make sure you enter your encryption password right when it asks in TW recovery. This will allow TeamWin to decrypt the drive and be able to back it up.
thehayk said:
If encrypted, you need to make sure you enter your encryption password right when it asks in TW recovery. This will allow TeamWin to decrypt the drive and be able to back it up.
Click to expand...
Click to collapse
It's never asked me for a password
automatism said:
It's never asked me for a password
Click to expand...
Click to collapse
It depends on which TWRP version you have.
Sent from my GT-I9001 Gadget of Mass Destruction with CM11 using XDA Developers App.
What version of TWRP would I need? I have v2.8.1.0 and I've never been asked for the password.
hnkotnis said:
It depends on which TWRP version you have.
Sent from my GT-I9001 Gadget of Mass Destruction with CM11 using XDA Developers App.
Click to expand...
Click to collapse
Mersine said:
What version of TWRP would I need? I have v2.8.1.0 and I've never been asked for the password.
Click to expand...
Click to collapse
At backup screen where you select the partitions (system, data etc). There is options called as encrypt backup.
This is available for TWRP v2.8.1.0 on my Samsung Galaxy S Plus GT-I9001.
Press Thanks if helped.
Since Googling "twrp backup encrypted phone" puts this thread as the number one result, I'd like to offer up that this doesn't work. The encryption password looks to me to be for encrypting the backup file itself, not for decrypting /data. As near as I can tell, the only way to back up /data is to use a tool such as Titanium Backup, although I haven't tried that yet myself, I am about to.
hnkotnis said:
At backup screen where you select the partitions (system, data etc). There is options called as encrypt backup.
This is available for TWRP v2.8.1.0 on my Samsung Galaxy S Plus GT-I9001.
Press Thanks if helped.
Click to expand...
Click to collapse
This is NOT what OP requested. He (we) want to backup an encrypted device, that is our /data is encrypted and twrp is unable to mount it (confirmed by the dev themselves.) to be clear: there is no twrp or cwm version able to mount encrypted /data so far.
Is this available?
Stopgap ways of backing up encrypted phones?
So I've been researching this problem for some time now, and I've got a couple suggestions.
CAVEAT: I haven't tried any of this yet.
First, there is Online Nandroid Backup. Since it backs up while the phone is running, the encrypted partitions should be available to it. But I suspect it restores while the system is running, which kind of defeats the purpose -- with a Nandroid backup, you can take a non-working phone and flash it back to the same condition when it did work. That's the whole point of wanting it, because testing ROMs is a lot easier.
Second, I'm experimenting with a way to do this with a dd command in an ADB shell. Basically you would execute a command like this:
dd if=/dev/block/mmcblk0p32 of=/storage/sdcard1/userdata.img​
Then that could, theoretically, be flashed back using fastboot flash userdata userdata.img. This is tricky, though, because you have to manually find your partitions and their equivalent names, etc. Also, fastboot doesn't work on all phones....
The one thing that is certain: CWM/Philz/TWRP all fail at event mounting the /data partition, much less backing it up. And (I think) an ADB backup is not going to work because it only applies to apps and their data, not the system itself, or its settings.
It makes you wonder how people with encryption make whole-phone backups in case something goes wrong (or if they do it at all). Sure, there's Titanium Backup, but that's one app at a time. Anyway, if I find out anything more useful while testing these ideas, I'll post it here.
Thanks for pointing me in the right direction. I just did that in the TWRP console.
You can find out your device partitions with
Code:
cat /etc/fstab
.
Then use dd as previously specified, but use an external sd card as the target:
Code:
dd if=/dev/block/mmcblk0p36 of=/external_sd/userata.img
.
This will take a while. Depending on the size of your /data partion quite a while. And there is no progress indicator.
Edit: Actually you can monitor the progress over adb. Just open an adb shell and do a
Code:
ls -al /external_sd/userdata.img
. The current size of the file gives an indication for the progress. In the end the file will have the same size as the data partition.
You can also enter the commands through adb to begin with... makes typing much easier.
I'll get around to testing these idea at some point, but for now I've had to (re)build this phone 4 times since August... so once it started looking solid again, I decided on Online Nandroid as my solution for now. It should give a workable restoration no matter what (but it will need a full wipe to clear encryption beforehand).
I'm curious as to what will happen when you fastboot flash that image file back on to the phone, though. I wonder if it's still encrypted and works, or isn't encrypted and works, or doesn't work at all.
There's also the disparity between the state of the filesystems on /system and /data if they're backed up at times too far apart. That one won't be apparent until something breaks, I think.
via XDA Mobile (D415)
I haven't gotten around to restore the image yet. I don't know whether this will work through fastboot, but it should definitely work with dd again from the recovery, this time from the image to the /data partition.
And the file system is certainly still encrypted, it wasn't ever decrypted.
I have to go back to the stock ROM on my phone for a moment, I'll report back if I could restore the dd image file.
BubuIIC said:
I haven't gotten around to restore the image yet. I don't know whether this will work through fastboot, but it should definitely work with dd again from the recovery, this time from the image to the /data partition.
And the file system is certainly still encrypted, it wasn't ever decrypted.
I have to go back to the stock ROM on my phone for a moment, I'll report back if I could restore the dd image file.
Click to expand...
Click to collapse
Theoretically, a dd image is an exact copy of the partition, and can just be dropped right in there. So yes, it should still be encrypted... unless flashing it back somehow munges the footer on /userdata, which the phone needs for encryption (I've seen this happen, and it actually caused a bootloop; thankfully, I was able to fix it). But I am hopeful it works when you try it.
Also, I spoke to a guy today who said his phone has no problem backing up encrypted partitions. In fact, his recovery asks for a password before running. I had him specifically confirm that his whole phone is encrypted, not just the backup file. He says his version is 2.7.1.0 running on a Nexus 4 (mako).
So now I've gotta find that version, and I think it has to be customized for the L90 too. I'll post request in that thread and see if I can get ahold of it.
via XDA Mobile (D415)
Bump
Last post in here made it seem like yes for some phones, and no for others. I'd love to encrypt my phone, but not if it means I can't make a nand backup in TWRP. Anyone want to chime in and see if this answer has become more definitive in the last 9 months?
jfsat said:
Last post in here made it seem like yes for some phones, and no for others. I'd love to encrypt my phone, but not if it means I can't make a nand backup in TWRP. Anyone want to chime in and see if this answer has become more definitive in the last 9 months?
Click to expand...
Click to collapse
I have Cyanogenmod cm-12.1-20150901 and TWRP 2.8.5.0
Once I encrypted the device, TWRP prompts for a password when it starts. However, when I type the passphrase, it says:
Password Failed, Please Try Again
forrestgump2000 said:
I have Cyanogenmod cm-12.1-20150901 and TWRP 2.8.5.0
Once I encrypted the device, TWRP prompts for a password when it starts. However, when I type the passphrase, it says:
Password Failed, Please Try Again
Click to expand...
Click to collapse
Did you ever find a solution for/to this?
Nandroid backups using TWRP Works with Nexus 7
I had an issue with this, too. I'm using CM 12.1.
First, make sure that you've flashed the latest TWRP for your device.
The issue was that the whole disk encryption is tied to the lock screen password/PIN/pattern.
So, I changed my lock screen to a password ensuring that it must also be used to start up Android. This changed both the lock screen and the whole disk encryption password to the same password. Now, when I reboot into recovery, TWRP requests a password and I supply the password that I changed my lock screen to. This allows /data to be mounted. A backup can be done on the internal storage or you can mount a USB storage device backing up the Nandroid images there instead.
Hope this helps.
****Confirmed this works with Android 6.0 from Google.
cableghost said:
Did you ever find a solution for/to this?
Click to expand...
Click to collapse
Nope. But I also don't use an Android phone anymore, so I haven't been looking.

How to install an update.zip with not matching device id

Hi. Recently I stuffed my ZTE Blade A452 with MIUI ROM found on here: hxxp://forum.android.com.pl/topic/319435-a452miui-v8-miui-global-8020. I also installed TWRP . I've been using it for a while and unfortunately it didn't meet my expectations. It is barely usable, phone crashes a few times a day, apps aren't kept in background.
I decided to come back to my stock ROM. I don't have, however, any back up of it. There are some sdcard packages on ZTE's support page, however when I tried to install it with TWRP, it displays that packages (all of them) are for device id P635F33, while my device is P635E40. And I found nothing for my dev id.
Is there a way to force installing one of those packages in my phone? Editing version.txt inside update.zip did nothing.
Maybe one of you guys have a matching package?
Also my sister's got the same model, Blade A452, bought at the same service provider. Maybe there is a way to extract a ROM from her phone and put it into mine? (Her device must be left quite untouched).
damiandbcz said:
Hi. Recently I stuffed my ZTE Blade A452 with MIUI ROM found on here: hxxp://forum.android.com.pl/topic/319435-a452miui-v8-miui-global-8020. I also installed TWRP . I've been using it for a while and unfortunately it didn't meet my expectations. It is barely usable, phone crashes a few times a day, apps aren't kept in background.
I decided to come back to my stock ROM. I don't have, however, any back up of it. There are some sdcard packages on ZTE's support page, however when I tried to install it with TWRP, it displays that packages (all of them) are for device id P635F33, while my device is P635E40. And I found nothing for my dev id.
Is there a way to force installing one of those packages in my phone? Editing version.txt inside update.zip did nothing.
Maybe one of you guys have a matching package?
Also my sister's got the same model, Blade A452, bought at the same service provider. Maybe there is a way to extract a ROM from her phone and put it into mine? (Her device must be left quite untouched).
Click to expand...
Click to collapse
You Have a Same Phone Available .That is Great. You can give her Sleep Drug Sneak Into Her Room.Get the Phone From Under The pillow.And Now You can Unlock The bootloader flash TWRP Make a Backup and Then Flash Stock Recovery.Then Put The Phone Back Under The Pillow.The Process Will only Take about 30Mins.
5Min to unlock Bootloader
2.5Min to flash TWRP.
2.5Min to install stock Recovery
And 20 min to move the back Up
Or
You can Slice her Throat and Get the phone.Seriously Save 30Min of time.
Or
You can Backup Using a Desktop Application and Restore on your Phone.
Sent from my Nexus 6P using Tapatalk
Atifbaig786 said:
You can Unlock The bootloader flash TWRP Make a Backup and Then Flash Stock Recovery
Or
You can Backup Using a Desktop Application and Restore on your Phone.
Click to expand...
Click to collapse
Yeah, TWRP on her phone isn't an option, as the whole system is quite buggy and she's gonna probably use the restore option. I'm gonna try with some desktop apps and give an answer in 1-2 hours. Thank you.
Sorry it took so long to answer.
I couldn't make a nandroid backup any desktop app (MTK Droid Tools can't create scatter file, couldn't find any other app).
As I said, TWRP was not an option. But I managed to do the nandroid backup from phone-level anyways.
First I rooted the source device with KingRoot, installed on it BusyBox and made a custom TWRP-style backup on SDcard with Online Nandroid Backup *ROOT. Default settings are fine, even though it couldn't recognize my phone model.
Then I moved SD into target device and performed a backup with TWRP (just to create my device directory). Then I moved the source-phone backup into the new-created directory and performed Restore.
And Voila! On my phone there was a 1:1 copy of the system. It wiped out TWRP so I could perform a system Restore and get a factory-new soft.
Thank You. I didn't even realize it was possible to restore A-Backup on B-Device. Even though my sister's phone was a P635F33 (I didn't know it earlier) and mine was P635E40, it worked well.
damiandbcz said:
Sorry it took so long to answer.
I couldn't make a nandroid backup any desktop app (MTK Droid Tools can't create scatter file, couldn't find any other app).
As I said, TWRP was not an option. But I managed to do the nandroid backup from phone-level anyways.
First I rooted the source device with KingRoot, installed on it BusyBox and made a custom TWRP-style backup on SDcard with Online Nandroid Backup *ROOT. Default settings are fine, even though it couldn't recognize my phone model.
Then I moved SD into target device and performed a backup with TWRP (just to create my device directory). Then I moved the source-phone backup into the new-created directory and performed Restore.
And Voila! On my phone there was a 1:1 copy of the system. It wiped out TWRP so I could perform a system Restore and get a factory-new soft.
Thank You. I didn't even realize it was possible to restore A-Backup on B-Device. Even though my sister's phone was a P635F33 (I didn't know it earlier) and mine was P635E40, it worked well.
Click to expand...
Click to collapse
It Did Work Right.I am Happy To Be of Your Assistance.
Sent from my Nexus 6P using Tapatalk

Be careful the TWRP for BS series

Avoid and pass by a fool and a madman
Thanks for this warning post. Glad that we only use it in "boot mode" to extract the boot.img, and backup our system partitions, and we don't install it just to make sure things are not touched. The chinese version TWRP can't read Global version's encrypted user data, so it can't install anything on your phone unless you format the user data within TWRP, I guess.
wga0 said:
Is it needed to provide our own twrp, which is bulit into all of the global version, with the official TWRP? Are you really need it?
Click to expand...
Click to collapse
Well, I only use it to backup system partitions of non-rooted phone and nothing else, so if we could find another way to do that then I can easily ditch it. Otherwise it would be nice if we have our own Global TWRP for sure.
wga0 said:
I bought this phone to play games.... but It make me only to work terribly...
Click to expand...
Click to collapse
I feel you bro, as I have the same problems as yours.
KM7 said:
Thanks for this warning post. Glad that we only use it in "boot mode" to extract the boot.img, and backup our system partitions, and we don't install it just to make sure things are not touched. The chinese version TWRP can't read Global version's encrypted user data, so it can't install anything on your phone unless you format the user data within TWRP, I guess.
Well, I only use it to backup system partitions of non-rooted phone and nothing else, so if we could find another way to do that then I can easily ditch it. Otherwise it would be nice if we have our own Global TWRP for sure.
I feel you bro, as I have the same problems as yours.
Click to expand...
Click to collapse
Oh.. you're right. It uses different encryption, so it can't approach to userdata. :good:
Just re-lock the critical sections will be good for global users, and it seems that china users need to be careful. And I didn't see it through. I just stopped at the batch files it uses... It can be merely unofficial twrp. Thank you for your great discovery...

A proper way to create complete backup?

Hello, maybe someone could point me in the right direction, just trying to make a complete backup of my phone ( samsung galaxy S22), so I could back everything up when needed, I have tried the 'titanium backup' and 'swift backup' tools so far, but they only back up the .apks, and my google login credentials are lost..
Really kind of lost browsing through some 11 year old topics about 'nandroid' and 'ClockWorkMod', do people use these tools today?
Thank you
no way. use samsung smart switch and cross fingers
I don't know Samsung from a hole in the ground.
If your device has Qualcomm EDL (and open Firehose loader) you could make a full raw backup of the entire flash.
That's not really helpful if you want to grab a single file but it means that you can restore your device to a snapshot.
@Renate restoring snapshot is not possible after factory reset, as the encryption key is not in userspace and therefore not in backup.
afaik there is no samsung signed firehose programmer leaked for SM8450 (and probably never will) and that device is also shipped with Exynos 2200.
aIecxs said:
Restoring snapshot is not possible after factory reset, as the encryption key is not in userspace and therefore not in backup.
Click to expand...
Click to collapse
Well, that's a good reason not to factory reset!
So, where is the encryption key stored?
get some coffee and read about tee...
encrypted file encryption keys are stored in files metadata, but DEK required for decrypting keys is random generated and securely deleted from TEE keystore on factory reset. I don't know exactly what triggers that deleteKey (it's another OS) but it can survive simple formatting userdata.
aIecxs said:
get some coffee and read about tee...
Click to expand...
Click to collapse
Well, I did have my second coffee already and I know about as much about TEE as I want (which is little).
My point being, if you make a full flash backup, then do whatever, then restore the complete flash, how is that not going to get you back wherever you were?
There are tons of ELF and data partitions used by TEE, TZ.
But are you telling me there is some state built into a device that is neither OTP or flash?
right, it's not in flash storage emmc/ufs.
Appreciate te replies!
Is there any other popular android device which would support the earlier mentioned flashing method?
Thanks!!
aIecxs said:
right, it's not in flash storage emmc/ufs.
Click to expand...
Click to collapse
I'd still like to know exactly where that is.
There are enough partitions called keymaster and other stuff.
Well, ok, but if you don't use factory reset a full flash backup is the best way to get you back to where you were.
actually, it IS in flash storage, but you won't see it
https://www.wikipedia.org/wiki/Replay_Protected_Memory_Block
Note: for all devices running old (FDE) full disk encryption, the static hardware master key is used directly, and the encrypted DEK is stored in crypto-footer (userspace) therefore restoring full raw backup was always possible.
Google and Samsung devices in general used to lack raw access. However, things have changed with Samsung started shipping MediaTek SoCs on their low-/mid-range lines.
But if you're looking for full backup solution, don't use any DRM related or banking apps and don't care about losing warranty and Samsung Knox, rooting and removing encryption is possible so you could just use TWRP or Swift Backup.
aIecxs said:
actually, it IS in flash storage, but you won't see it
https://www.wikipedia.org/wiki/Replay_Protected_Memory_Block
Note: for all devices running old (FDE) full disk encryption, the static hardware master key is used directly, and the encrypted DEK is stored in crypto-footer (userspace) therefore restoring full raw backup was always possible.
Google and Samsung devices in general used to lack raw access. However, things have changed with Samsung started shipping MediaTek SoCs on their low-/mid-range lines.
But if you're looking for full backup solution, don't use any DRM related or banking apps and don't care about losing warranty and Samsung Knox, rooting and removing encryption is possible so you could just use TWRP or Swift Backup.
Click to expand...
Click to collapse
Thank you, that's the thing, as a matter of fact I already have tried using swift backup tool, but all google accounts are lost when backing up, and the apps that have used google to log in ( like play store, google maps etc ) are also losing the connected account.
Any suggestions on how to transfer the google accounts as well?
Thanks again!
actually Swift Backup should work. it looks like some extended Google One fork with optional root features. google account is required for it to work, not sure what problems you are facing?
aIecxs said:
actually Swift Backup should work. it looks like some extended Google One fork with optional root features. google account is required for it to work, not sure what problems you are facing?
Click to expand...
Click to collapse
The main issue for me was that it doesn't back up my google signed in accounts.
After reading for one more day I stumbled upon one of your very interesting posts on this thread - https://forum.xda-developers.com/t/android-12-and-nandroid-backup.4420185/
Here you explain how it's possible to pull out the 'nandroid' image from the phone to the computer which is exactly what I was looking for, but couldn't express clearly.
That's 100% the functionality I am looking for
- Ability to pull out the exact state of the phone to a file on the computer
- Put it back in if things go south, and all my files are exactly as they were at that point.
1) From your experience, do you think it would be possible to achieve this on a Samsung phone?
2) As far as I understood, after doing a 'factory reset' I would no longer be able to put the old 'nandroid' image back, because of the encryption?
Thank you for your time!
P.s I would be happy to pay for a consultation on this topic from you or someone who has managed to do this.
I also would like to see a full nandroid backup solution tool similar to how Windows System image backup works - a full 1:1 flash image with all files and settings intact of an android device.
Renate said:
I don't know Samsung from a hole in the ground.
If your device has Qualcomm EDL (and open Firehose loader) you could make a full raw backup of the entire flash.
That's not really helpful if you want to grab a single file but it means that you can restore your device to a snapshot.
Click to expand...
Click to collapse
How do I do this @Renate with my one plus pro 9 phone? I have the MSM tool, how do I dump a full system image?
immortalwon said:
How do I do this with my one plus pro 9 phone? I have the MSM tool, how do I dump a full system image?
Click to expand...
Click to collapse
I don't know.
I've been trying to get down to brass tacks what's the difference between this MSM Tool and a generic EDL client.
I don't know about its authorization and phone-home-ness.
I'm not even sure if with VIP you can transfer complete device images.
OTOH, VIP is built into many loaders but not used.
I don't have a OnePlus. I'd need a USB capture to say anything intelligent.
I know on my Android 10 ereader I can simply (with my EDL client):
Code:
C:\>edl /r /s0 /c0 mybackup.img
That's for eMMC. For UFS you'd probably need six files.
Renate said:
I don't know.
I've been trying to get down to brass tacks what's the difference between this MSM Tool and a generic EDL client.
I don't know about its authorization and phone-home-ness.
I'm not even sure if with VIP you can transfer complete device images.
OTOH, VIP is built into many loaders but not used.
I don't have a OnePlus. I'd need a USB capture to say anything intelligent.
I know on my Android 10 ereader I can simply (with my EDL client):
Code:
C:\>edl /r /s0 /c0 mybackup.img
That's for eMMC. For UFS you'd probably need six files.
Click to expand...
Click to collapse
I found a way to do a full image readback using the msm tool, which downloads everything firmware related to my pc on the main C:/ drive. The question is, if I ever need to in the future, how do we use the restore function of the msm tool to restore these backups?
EDIT: I don't think it was a full image backup after all because the backups in total are 13gb, while my device is using a lot more storage then that.
@myndeswx what you have linked in post #14 is exactly what Migrate does. It creates tarball archives of apps of decrypted /data partition during runtime. Restoring will work after factory reset because it's a backup of plain files. However, it's far from complete, it is not atomic, still security critical apps using android keystore cannot restored, and it requires rooted device (with all its disadvantages)
For Samsung phones there is currently a hack to gain temporary access to /data with system privileges (uid 1000) floating around (haven't tried)
***LOCKED UNTIL FURTHER NOTICE*** System Shell Exploit - ALL Samsung Mobile Devices NO BL UNLOCK REQUIRED.
***MODERATOR ANNOUNCEMENT: THREAD CLOSED*** @K0mraid3 you are hereby required to provide proper credit in your OP as follows: Link the assigned CVE for this exploit as it mentions the author's blog and GitHub, OR Link the original research repo...
forum.xda-developers.com
hallo i have S22 exynos S908B
- Magisk 26.1
- Encrypted
- S-health working
- Health connect working
- Bank apps working
- Galaxy Watch 4 working
i extracted Titanium Baclups and see there is only installation apk because data in Android/data is encrypted so Titanium backup can't see it and not advise about not backupped data.
Android/data is accessible only by mtp/usb by pc.
So what option i have for backup?
by twrp can i baclup partitions with dd command? After can i restore it without factory reset? (can't factory reset because cause encryption keys lost)
Any working way for bakup?

Categories

Resources