A proper way to create complete backup?

Search This thread

myndeswx

Member
Feb 3, 2023
6
0
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
 

Renate

Recognized Contributor / Inactive Recognized Dev
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.
 

alecxs

Forum Moderator
Staff member
Feb 17, 2016
3,664
5
1,522
gitlab.com
@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.
 

alecxs

Forum Moderator
Staff member
Feb 17, 2016
3,664
5
1,522
gitlab.com
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.
 
Last edited:

Renate

Recognized Contributor / Inactive Recognized Dev
get some coffee and read about tee... ☕ :)
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?
 

myndeswx

Member
Feb 3, 2023
6
0
Appreciate te replies!
Is there any other popular android device which would support the earlier mentioned flashing method?
Thanks!!
 

alecxs

Forum Moderator
Staff member
Feb 17, 2016
3,664
5
1,522
gitlab.com
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.
 
Last edited:
  • Like
Reactions: myndeswx

myndeswx

Member
Feb 3, 2023
6
0
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.
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!
 

alecxs

Forum Moderator
Staff member
Feb 17, 2016
3,664
5
1,522
gitlab.com
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?
 
  • Like
Reactions: myndeswx

myndeswx

Member
Feb 3, 2023
6
0
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?
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.
 

immortalwon

Senior Member
Mar 11, 2017
101
28
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.
 

immortalwon

Senior Member
Mar 11, 2017
101
28
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.
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?
 

Renate

Recognized Contributor / Inactive Recognized Dev
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?
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.
 

immortalwon

Senior Member
Mar 11, 2017
101
28
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.
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.
 
Last edited:

alecxs

Forum Moderator
Staff member
Feb 17, 2016
3,664
5
1,522
gitlab.com
@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)
 
Last edited:
  • Like
Reactions: myndeswx

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    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.
    1
    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?
    1
    @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)