Restoring Google Authenticator after stock to LineageOS 19.1 - OnePlus 6 Questions & Answers

Hi,
I've just upgraded from latest OnePlus stock ROM of Android 11 to LineageOS 19.1. I've made backups before formatting everything, a full NANDroid with TWRP, one using the Migrate app, one with Oandbackupx of all apps. Also Google's way, but that doesn't back this app up, which seems to be quiet bad...
After trying to restore from all the mentioned sources, Google Authenticator can't seem to be restored. It always ends up empty. Is there a a specific protection for that data? I've similar issue with Dropbox as an example, it asks me to login after a restore. Whereas other apps preserved their logins...
Would be great to restore it, as I had like 30+ MFA codes added. Any suggestions?
Thank you!

There is only one way to transfer codes to another phone in the case of Google Authenticator.
Perhaps there is an analogy with the Dropbox access application. You'll have to check it out for yourself.

Hi,
Ok, thanks for the info. This is just sad to hear.
Going back to the original system with restoring the NANDroid backup go get this code might not work either?
Thank you.

I can't seem to find a solution. So I'm switching to Authy and in the same time I'll add it to KeePassXC, which can also do it... This can't happen again, I have to reset 2FA on 30+ sites

antivirtel said:
I can't seem to find a solution. So I'm switching to Authy and in the same time I'll add it to KeePassXC, which can also do it... This can't happen again, I have to reset 2FA on 30+ sites
Click to expand...
Click to collapse
whats stopping you from flashing your nandroid backup back to regain access? Isn't the whole beauty of nandroid backups the fact that they're more like system snapshots?
We currently are running into the same problem (although different phone, different situation but same effective result. We already came from a custom rom but forgot to get the transfer QRs from the Auth app.)

Okay so let me update you on my findings. If you have a back-up of Authenticators data (made before the update Google pushed out earlier this month*) you could fish out the database file (called database, without any file extention, stored in the folder database (full path to the file in a TWRP backup would be /data/data/com.google.android.apps.authenticator2/database/database)) and just read out the table accounts using any sqlite3 tool. This table has a column called secrets which contains the keys. There even is a free (linux/cygwin) set of scripts that can generate QRs for you if you do not feel like punching in the keys manually.
Theoretically placing the database file into the database folder of the app (overwriting the empty one) or using something like Titanium Backup should work too if you have not updated the app on your old device/installation yet.
*With the last update Google started encrypting the secrets before writing them to the database and nobody has been able to find the key which they used for that (yet)

screen said:
whats stopping you from flashing your nandroid backup back to regain access? Isn't the whole beauty of nandroid backups the fact that they're more like system snapshots?
Click to expand...
Click to collapse
I'm now on Android 12, and since TWRP doesn't support the new encryption, I can't just take a NANDroid backup of the current one and flash the old one in (without losing much of the current one, which I don't want). Unless there's something new around this, that won't be too much of a help.
I can think of restoring the NANDroid backup to an Android emulator, but it doesn't seem to be possible:
https://www.reddit.com/r/Android/comments/k7v4c/_/c2i5l9g
(unless it has changed in the last 11 years).
screen said:
Okay so let me update you on my findings. If you have a back-up of Authenticators data (made before the update Google pushed out earlier this month*) you could fish out the database file (called database, without any file extention, stored in the folder database (full path to the file in a TWRP backup would be /data/data/com.google.android.apps.authenticator2/database/database)) and just read out the table accounts using any sqlite3 tool. This table has a column called secrets which contains the keys. There even is a free (linux/cygwin) set of scripts that can generate QRs for you if you do not feel like punching in the keys manually.
Theoretically placing the database file into the database folder of the app (overwriting the empty one) or using something like Titanium Backup should work too if you have not updated the app on your old device/installation yet.
*With the last update Google started encrypting the secrets before writing them to the database and nobody has been able to find the key which they used for that (yet)
Click to expand...
Click to collapse
Yeah, I already checked that file, it's encrypted in there, I was using the latest versions of the apps when I made the backup, didn't think that won't be enough. The weird thing is that restoring it won't restore the data. So it must use some device related key or it just detects that it's a different device... Annoying, backing it up doesn't actually do any good...
Do you have any other idea? Thank you!

antivirtel said:
I'm now on Android 12, and since TWRP doesn't support the new encryption, I can't just take a NANDroid backup of the current one and flash the old one in (without losing much of the current one, which I don't want). Unless there's something new around this, that won't be too much of a help.
I can think of restoring the NANDroid backup to an Android emulator, but it doesn't seem to be possible:
https://www.reddit.com/r/Android/comments/k7v4c/_/c2i5l9g
(unless it has changed in the last 11 years).
Yeah, I already checked that file, it's encrypted in there, I was using the latest versions of the apps when I made the backup, didn't think that won't be enough. The weird thing is that restoring it won't restore the data. So it must use some device related key or it just detects that it's a different device... Annoying, backing it up doesn't actually do any good...
Do you have any other idea? Thank you!
Click to expand...
Click to collapse
Well, if Authenticator doesn't pick up on databases from other installations that would sugest that Authenticator has a way to link a database to an Authenticator installation. Meaning, the only way you could possibly have a chance to retrieve the data is to restore your nandroid backup (and use the Authenticator in there to make your transfer QR codes), count your losses as far as your current installation goes and reinstall a 12 rom from scratch. (Or find a way to get the key used to encrypt the secrets, if you have the key you just decrypt them and punch them in manually (or use the earlier scripts for QR code gen))

screen said:
Well, if Authenticator doesn't pick up on databases from other installations that would sugest that Authenticator has a way to link a database to an Authenticator installation. Meaning, the only way you could possibly have a chance to retrieve the data is to restore your nandroid backup (and use the Authenticator in there to make your transfer QR codes), count your losses as far as your current installation goes and reinstall a 12 rom from scratch. (Or find a way to get the key used to encrypt the secrets, if you have the key you just decrypt them and punch them in manually (or use the earlier scripts for QR code gen))
Click to expand...
Click to collapse
It's sad that nobody seems to have the keys to decrypt the secrets.
Wish I had a nandroid backup or just an earlier backup of the app's data before they started to encrypt their db.
I'm losing many accounts here.

shokolatha said:
It's sad that nobody seems to have the keys to decrypt the secrets.
Wish I had a nandroid backup or just an earlier backup of the app's data before they started to encrypt their db.
I'm losing many accounts here.
Click to expand...
Click to collapse
To prevent exactly this from happening (again) I've switched to Authy like @antivirtel suggested earlier. Authy saves your secrets to your authy-account, and a big plus they actually have a desktop program too so I don't have to use my phone per se (I often just leave it home not needing my phone _untill_ I need 2FA somewhere lol). I'm sorry for your losses but at least take this as a learning oppertunity and switch to an 2FA/MFA application that does cloud

Exporting a QR code from google authenticator then taking a screenshot\pic of it and saving that for future phones has served me well so far..

I think if I read correctly, TWRP just released their new version with Android 12 decryption support, so I can go and extract it now from my nandroid backup. https://twrp.me/site/update/2022/10/10/3.7.0-released.html - did someone test this?
BTW, I also saved the 2FA codes to KeePassXC/DX, works brilliantly there too, has nice integration both on desktop and Android.

Hi,
I've finally found a way to save my current ROM and go back to my old backup of stock A11 (restore a NANDroid backup), and try to access G Auth, but it was empty straight away. Tried a restore with Neo Backup, no change. Unfortunately it seems like it's all gone. At least I have the DB file, it has a list of accounts, so I at least know where I had MFA...
Unless someone else has a clue how to restore it, someone?
Given it's finally getting cloud sync feature, Google should release a way to restore it. Google please do!
Thanks!

Related

[Q] Titanium Backup: (filter) labels are not restored

I checked the "Auto-sync TB settings"
Then do a full wipe, reinstall TB (or launch the TB included in the ROM) and re-check that check box ... and
NOTHING
My filter labels don't reappear.
Everything else works fine, how does that setting work, is there a file on the SD card somewhere that I can check to see if TB created it fine?
I have the paid version and am now using 3.0.0.7 on Starburst 1.2.1
After 4 times re-classifying 300 apps I'd really like to solve this, what am I doing wrong, what can I check to make sure those settings are saved?
It is really hindering my ROM installations ;-)
Since no-one seems to have this problem I did some investigating myself and found a database called "custom" in /data/data/com.keramidas.TitaniumBackup/databases/ this seems to hold the filter information, I'll be keeping a copy of that next time I do a full wipe in case that "Sync" setting doesn't work again.
BelgianAtheist said:
Since no-one seems to have this problem I did some investigating myself and found a database called "custom" in /data/data/com.keramidas.TitaniumBackup/databases/ this seems to hold the filter information, I'll be keeping a copy of that next time I do a full wipe in case that "Sync" setting doesn't work again.
Click to expand...
Click to collapse
Nice Find dude! I was looking for a solution and you got it!
Lately it has been working well for me.
I've also found where the backup on the SD card is, it is in:
[sdcard]/data/com.keramidas.TitaniumBackup/
Here is a settings directory with the labels db and all settings and it also has a licensing file so that a fresh install knows you have the paid version without having to connect to the Market.
BelgianAtheist said:
Lately it has been working well for me.
I've also found where the backup on the SD card is, it is in:
[sdcard]/data/com.keramidas.TitaniumBackup/
Here is a settings directory with the labels db and all settings and it also has a licensing file so that a fresh install knows you have the paid version without having to connect to the Market.
Click to expand...
Click to collapse
Thanks.
But i don't understand how to solve the exact same problem as you had before. I know that this directory exists and the labels are saved there (/data/data/com.keramidas.TitaniumBackup/databases/).
You make a backup of this folder on the SD card and after wiping your mobile phone you restore this folder and start TB afterwards?
I hope you still track this topic
Thanks.
EDIT: At least i found a workaround for me. Seems like TB overwrites the Sync folder. Therefor i've installed a ROM (after wiping), installed Titanium Backup, made all my settings (encryption, labels, pro key, dropbox settings) and made a ROM backup with ROM Manager. It's not what i want. But i can live with that for now.
I have this same exact issue. No fixes yet
I wrote the TB support and they've requested some additional information. I hope they will fix it.
The support said TB has problems with dual sd devices.
I own a HTC Desize Z which is not a dual sd device.
1 - Replace files in SDCard\data\com.keramidas.TitaniumBackup\settings\ with your backup.
2 - Wipe Titanium data
3 - Start Titanium ..
Thinking it is it first start it will restore settings... don't know why it do not work the first time after flashing...
Seems that it do not check "Auto-Synced" settings on every start, only first start (empty data)
I have the same problem.
I hope it can be solved.
=======================
2011.12.21 Update
hi, guys, I found another app can restore TB's settings.
Delta Backup(market.android.com/details?id=com.ds.deltabackup)
u can use Delta Backup to backup "Titanium Backup".
When reinstall TB, just use Delta Backup to restore TB.
It works!
Honusnap said:
1 - Replace files in SDCard\data\com.keramidas.TitaniumBackup\settings\ with your backup.
2 - Wipe Titanium data
3 - Start Titanium ..
Thinking it is it first start it will restore settings... don't know why it do not work the first time after flashing...
Seems that it do not check "Auto-Synced" settings on every start, only first start (empty data)
Click to expand...
Click to collapse
This works - THANKS! Luckily, I had backed up /sdcard/data before the wipe.
Easy enough to have a script to do this, or TB can add a feature to copy /sdcard/data/com.keramidas.TB to /sdcard/data-backup/com.keramidas.TB whenever the app exits or is terminated, then look for that directory during its first start.
Unfortunately it seems we are a tiny minority. Theres practically no info on label deletion online or in the wiki. This used to happen often when I was flashing almost weekly but I haven't changed ROMs in a while and a sense rom I just tried had a modified TB included and it deleted my highly detailed labels. It should at least keep a cache of the old setting temporarily. Even my iPad does that in cydia when you change a plist. Gonna try restoring a nandroid with sdext, super outdated though. Kinda ridiculous that a great backup app's greatest weakness is backing itself up. I still get occasional licensing issues too so who knows.
Anyone happen to know a way to restore recently overwritten data either in the phone data/data or sd/data?
Here's to a useful daily update!
crammed174 said:
Kinda ridiculous that a great backup app's greatest weakness is backing itself up.
Click to expand...
Click to collapse
That's really weird. And the TB support doesn't even know what I'm talking about. After it got too complicated for them, they stopped writing me. Maybe someone should write them again and show TB support this topic.
I'm trying to fix this issue with symlinks. I will create a backed up ROM with ROM Manager where the database file links directly to my sdcard. I think this should work.
Galaxy S3 Problem Solved!
Honusnap said:
1 - Replace files in SDCard\data\com.keramidas.TitaniumBackup\settings\ with your backup.
2 - Wipe Titanium data
3 - Start Titanium ..
Thinking it is it first start it will restore settings... don't know why it do not work the first time after flashing...
Seems that it do not check "Auto-Synced" settings on every start, only first start (empty data)
Click to expand...
Click to collapse
Thanks man, this saved my problem.
The SD-Card in the SGS3 is in mnt/extSdCard, which means I also had to change the path for the backup folder to get it working.
There is also the possibility to manually import these settings to TB by opening the files in SDCard\data\com.keramidas.TitaniumBackup\settings\.
Honusnap said:
1 - Replace files in SDCard\data\com.keramidas.TitaniumBackup\settings\ with your backup.
2 - Wipe Titanium data
3 - Start Titanium ..
Thinking it is it first start it will restore settings... don't know why it do not work the first time after flashing...
Seems that it do not check "Auto-Synced" settings on every start, only first start (empty data)
Click to expand...
Click to collapse
I agree. This is probably the most straightforward approach.
Although..., I have to say, the the last time that I re-installed a fresh (from the Market) not an apk on my sd (my normal M.O) my labels were restored. Who knows!
Oh and as far as TiBu even knowing of or handling this issue, I still haven't heard anything from them after writing to them.
I guess every great warrior has a weakness.
BelgianAtheist said:
Since no-one seems to have this problem I did some investigating myself and found a database called "custom" in /data/data/com.keramidas.TitaniumBackup/databases/ this seems to hold the filter information, I'll be keeping a copy of that next time I do a full wipe in case that "Sync" setting doesn't work again.
Click to expand...
Click to collapse
Thank you fixed it for me
I was having this problem after including titanium backup in my rom. I think the problem is this:
System apps are allowed to start at boot (user apps aren't until they have been run at least once by the user)
Titanium backup starts at boot to check it if it needs to schedule any tasks
Sometimes this will happen on the first boot and before the sdcard has mounted, and it will fail to load the settings.
When you later run it yourself it will wipe the previous settings from the sdcard.
For now to get around this each time you install a new rom which includes titanium backup you can go in to settings and force close / clear data before you run it for the first time. Your previous settings should still be on the sdcard and will now be imported.
I will contact the developer about this - hopefully it wouldn't take much to fix.
[Edit] Thinking about it, pre-ics the boot permissions weren't enforced so this might happen with it installed as a user app too if you reboot before running it.
Originally Posted by Honusnap
1 - Replace files in SDCard\data\com.keramidas.TitaniumBackup\settings\ with your backup.
2 - Wipe Titanium data
3 - Start Titanium ..
Thinking it is it first start it will restore settings... don't know why it do not work the first time after flashing...
Seems that it do not check "Auto-Synced" settings on every start, only first start (empty data)
Click to expand...
Click to collapse
I am still not clear
1-there are 2 copies of the "data\com.keramidas.TitaniumBackup"
One on the internal memory and one in the external memory. Which one I back up and later over write .
2-How do I wipe titanium data?
Sorry if the questions sound stupid but I am stuck
------------------------------------
edit
I found the answers
thanks
ChromJ said:
I am still not clear
1-there are 2 copies of the "data\com.keramidas.TitaniumBackup"
One on the internal memory and one in the external memory. Which one I back up and later over write .
2-How do I wipe titanium data?
Sorry if the questions sound stupid but I am stuck
------------------------------------
edit
I found the answers
thanks
Click to expand...
Click to collapse
Hi!
Would you mind to post your answers? I am also interested in learning this...
Does anyone know if these problems we are having are due to the fact that some devices have both internal and external sdcards? (like the transformer family)
In preferences we are able to change the location of the back up copies but not the location of the titanium back up user configuration (labels, profiles, set up...)
Every time I have tried to use TB I end up loosing my TB configuration... quite annoying!
Thanks
Apps Organizer
An easy way to restore your labels in Titanium Backup (TB) is to use the recommended program Apps Organizer (AO) .
https://play.google.com/store/apps/details?id=com.google.code.appsorganizer
Assign labels using AO and you can see and use them to filter TB. Export the labels from AO. In your new ROM install AO and Import the labels. You will see them in TB in your new ROM and can use them to filter.
You may find my related Wiki is helpful:
http://forum.xda-developers.com/wiki/Android_ROM_Update
Cheers
Tom
Szczepanik said:
An easy way to restore your labels in Titanium Backup (TB) is to use the recommended program Apps Organizer (AO) .
https://play.google.com/store/apps/details?id=com.google.code.appsorganizer
Assign labels using AO and you can see and use them to filter TB. Export the labels from AO. In your new ROM install AO and Import the labels. You will see them in TB in your new ROM and can use them to filter.
You may find my related Wiki is helpful:
http://forum.xda-developers.com/wiki/Android_ROM_Update
Cheers
Tom
Click to expand...
Click to collapse
:
AO is helpful. I just restore AO with Data. Some things AO does not, tasker plugins for example.
It is ironic TiBU doesn't have a straightforward way to backup its settings.

[Q] "adb restore" leaves stuff out

I am trying to restore files back to my reset OnePlus One using "adb restore <file>" but while the restore happens without error, some files/folders are not restored. I have checked the backup file and the files and folders are present in the backup file, yet adb restore does not restore them
My backup is created with this command:
adb backup -f backup.ab -apk -obb -shared -all -system
And I try to restore with this:
adb restore backup.ab
Especially in the /sdcard/Android/data are a lot of files and folders missing and apps are not getting restored to their working state.
How do I restore the backup properly? Do I have to push every single file/folder to the phone manually?
Never mind. I just noticed that the backup files did not care to backup the /sdcard/Android folder and I have lost all files.
Why is it so impossible to make a proper backup on Android?
I am so close to ditching android just because I cannot get a working backup/restore to work!
And no, my phone is not rooted as rooting erases my files. Chicken and egg problem. I really hate android here.
"adb restore" didn't restore any of my accounts! I am so very pissed about android right now. Such a "mature" platform and no working backup/restore.
Plenty of tools offering to make backup/restore, but the all require me to erase all data (root) making the backup moot. And those tools that do not require root cannot backup anything besides what "adb backup" offers to back up (which is more miss than hit).
I am really envious of Apple users here. They have perfect (so it seems) working backup and restore.
... and I cannot add the missing accounts because they are already created. So, none of my accounts were restored and even though all accounts are actually there, none of them can synchronize as they are not there.
And all this trouble just to fix non-working MMS which turned out not to work after a reset anyway. I hate really hate android. So f...... unreliable.
I seriously cannot recommend anyone to use adb backup/restore. This will totally mess up your phone. Copy files manually and write down all your accounts (type/username/password/all settings) create them manually afterwards. "adb restore" cannot restore accounts.
If everything is lost at this point might as well root now and use titanium backup or parcel in the future? Not sure if parcel can backup accounts, titanium backup can though
Sent From Lollipopified Bacon Goodness!
ek69 said:
If everything is lost at this point might as well root now and use titanium backup or parcel in the future? Not sure if parcel can backup accounts, titanium backup can though
Sent From Lollipopified Bacon Goodness!
Click to expand...
Click to collapse
Indeed
galmok said:
And no, my phone is not rooted as rooting erases my files. Chicken and egg problem. I really hate android here.
Click to expand...
Click to collapse
Why didn't you just connect to your PC and copy your files across? Or at least research the phone before you bought it or started using it? If you unlock the bootloader when you receive the device the wiping that occurs during the unlocking process is a non-event.
There's no reason to "hate Android" because of this situation. There are several ways to make backups on an Android device, you just failed to unlock your device at the correct time. Just trying to put it into perspective a bit here.
Transmitted via Bacon
timmaaa said:
Why didn't you just connect to your PC and copy your files across? Or at least research the phone before you bought it or started using it? If you unlock the bootloader when you receive the device the wiping that occurs during the unlocking process is a non-event.
There's no reason to "hate Android" because of this situation. There are several ways to make backups on an Android device, you just failed to unlock your device at the correct time. Just trying to put it into perspective a bit here.
Transmitted via Bacon
Click to expand...
Click to collapse
I cannot copy everything to my pc. Accounts for instance cannot be copied. Same with system settings, Wi-Fi passwords and some apps do not survive the adb backup/restore (like Waze that enters a crash loop) and other apps just vanish. This system is not user friendly. There is no way I could make anyone I know accept this phone if they knew they couldn't back it up. They know nothing about rooting but they will not accept a non-working backup.
I at least tried (hard) to make a backup and restored it back and that was a horrible experience. I cannot help wondering why Google hasn't arranged android to have working backups. Apple has it and it seems near perfect compared to android.
galmok said:
I cannot copy everything to my pc. Accounts for instance cannot be copied. Same with system settings, Wi-Fi passwords and some apps do not survive the adb backup/restore (like Waze that enters a crash loop) and other apps just vanish. This system is not user friendly. There is no way I could make anyone I know accept this phone if they knew they couldn't back it up. They know nothing about rooting but they will not accept a non-working backup.
I at least tried (hard) to make a backup and restored it back and that was a horrible experience. I cannot help wondering why Google hasn't arranged android to have working backups. Apple has it and it seems near perfect compared to android.
Click to expand...
Click to collapse
Google does have backups, in the settings menu. Most of the system settings are backed up (and even if they weren't it should only take a total of ten mins to set them up again). Apps are backed up and downloaded again on a fresh install. It all works perfectly if you know what you're doing.
Transmitted via Bacon
timmaaa said:
Google does have backups, in the settings menu. Most of the system settings are backed up (and even if they weren't it should only take a total of ten mins to set them up again). Apps are backed up and downloaded again on a fresh install. It all works perfectly if you know what you're doing.
Transmitted via Bacon
Click to expand...
Click to collapse
Except I have apps that are not on Google Play. I cannot backup my Wi-Fi passwords and am forced to let Google keep a copy. And there are so many settings that 10 minutes is far from enough to find them all and fix them. And the point is, I shouldn't have to. I should be able to make a backup, preferably compartmentalized, and restore the sections I want, if not all. And it should be 1 tool.
Also, following a reset, the phone will begin reinstalling apps from Google Play and what happens if I begin adb restore at the same time? I didn't want to find out and let it install. But when some games use 1.5GB of storage, that takes a long time. Would be much faster if I knew I could use adb restore.
Oh well, I will have to accept the horrible backup/restore solution for this phone, but I really am envious of the backup/restore for iOS devices.

WhatsApp - restore encrypted backup (crypt12) (full backup of phone required)

What’s this about?
WhatsApp was driving me nuts the other day! Why? Because it would not restore my message backup without a reason.
When I take the time and read the following will it help me?
Well, maybe. That depends on what you did. I wanted to restore my WhatsApp encrypted backup file (FILE! not Google backup) and it worked out.
When will the following maybe help me?
you have a WhatsApp backup file (encrypted, e.g. crypt12 -> msgstore.db.crypt12)
you wiped your phone’s data
you have a backup of your phone (TWRP or similar) or already have the WhatsApp key
What happened to you?
I changed from stock ROM to custom ROM (CyanogeMod in my case). Because I did a clean flash I made some preparations in advance. I backed up my WhatsApp messages and copied the whole folder to my SD card. I wiped my phone using TWRP (system, data, cache...). After the custom ROM flash I installed WhatsApp and wanted to restore my messages. Didn’t worked out.
What happened?
I did a little bit of research and little did I know the message file was encrypted. Because WhatsApp is super smart it stores the key for the decryption not in the WhatsApp folder (okay, this would really be stupid). As soon as you wipe your data the key will be erased. Good bye key! So, I am not an expert and it could be that there is a way easier method to restore you messages but I didn’t found one. I just want to share my experience so hopefully someone can save a lot of time. I would have been happy if I found something like this earlier or if I would have at least known about the key. Now I know.
NOTE
Without a backup of your phone, to be more specific, of your phone’s data or the WhatsApp key the following will be useless!
NOTE
Your phone can get broken! I am not responsible for that. Everything you do is on your own risk! Also, I’ll try to help but I am not a 24/7 support technician.
NOTE
Read everything first before you start! Maybe I messed something up. So, take a look first!
So, what to do?
1) Retrieve the key from your phone’s data backup.
a) Because we are all smart we do a full backup before we flash crazy stuff on our phone, right?! I did that with TWRP. Any other backup might work as well. You’ll have to find out on your own. The TWRP backup file is something like “data.ext3.win000”, “data.ext3.win001”. Copy it to your computer. Add the extension .tar or .tar.gz (“data.ext3.win000.tar”, “data.ext3.win001.tar”). In my case both worked. If you can already browse your backup file continue with e).
b) Download and Install 7-Zip.
c) With the 7-Zip file manager you can open and search inside the renamed TWRP files.
d) 7-Zip doesn’t recognize if your data is stored in more than one file. I guess if you pick the right file extensions it would. But, like I said, I am not an expert. So, in this case the win000-file has other files in it than the win001-file. If you don’t find the key in the first one, open up the next one.
e) Open the first file. There will be some kind of blank folder. Open it and you’ll see your phones data. Navigate to \data\data\com.whatsapp\files\.
f) There you should see a file named key. If so, start yell “hurray!”. In my case I saw two key files. I don’t know why but every file was doubled (maybe someone can explain that to me).
g) One of the files was about 158 Bytes. That should be it. To be sure extract the first key file. Open it with the windows editor. If there are letters in it that you can read it’s the wrong file.
h) Extract the other one and open it, too. You see some gibberish? Congratulations, this should be your key! Copy the file to your phones SD card or something similar.
2) Restore your backup
a) Install WhatsApp if not already happened. If you already activated the app go to settings, apps, select WhatsApp and erase all data (NOTE! Your own risk! All data will be gone!). This is necessary because WhatsApp will only ask once after the activation if the backup should be restored. Maybe there is another way but I don’t know it.
b) Copy the whole WhatsApp folder to your phone (the backed up one from the SD, see above). Or just put the backup file into \WhatsApp\Databases\. If you have an older backup file like msgstore.db-2016-01-01.crypt12 rename it into msgstore.db.crypt12. As far as I know only the last named file will be restored.
c) Start WhatsApp and activate it.
d) STOP! WhatsApp will ask you if it should restore the backup. Don’t do it! If you did it and it failed start again from a). Just leave the screen like that, don’t do anything. Turn off your phone! Yep, you heard right. WhatsApp will remember the state it’s in.
e) Boot into TWRP. If you have a file manager that can access your phones data you could use that one, too. I think root will be required for that. I just had the limited stock file manager. The latest TWRP has a file manager integrated without restrictions (check for yourself first!). I used that one (complicated maybe, I know!).
f) Open the file manager (Advanced - File Manager) and navigate to your key-file. Tap on it and select copy.
g) Navigate to \data\data\com.whatsapp\files and copy the key-file into this folder (just tap the blue folder at the right bottom of the screen).
h) Reboot you phone. Start WhatsApp. It should open up and directly ask you if you want to restore your backup. Try to restore it. If you’re lucky it’ll work. For me it did! Congratulations.
Endnote
I didn’t know about the key when I erased my phone’s data. Next time that one will be backed up, too. So I can save a lot of time.
This whole thing here might be very complicated and I guess there is a lot better way to do it. But I didn’t found it. So, I just want to at least share my experience. Maybe someone will profit.
Another thing you need to know here;
The file named key should have a UID WhatsApp for user and group permissions.
You can set these using TotalCommander via Properties
and you should set these while whatsapp is killed/down and while the key is already in the /data/data/../files/ dir.
I also had a case where in the last stage, so before the final boot to restore the database, I had to do a Wipe Cache and Dalvik cache. If I did not do that, whatsapp would skip the restore question and continue activation as if it was a new one, and then *overwrite* the key file I had put there, no matter what I tried!
You don't have to do any of this if you haven't changed your cell number!
1) Copy your latest crypt 12 file to /sdcard/WhatsApp/Databases/
2) Install / Activate WhatsApp
3) WhatsApp will retrieve the key from their server and restore your backup.
This only works if you haven't changed numbers, but it's easy as 1, 2, 3!
I tried this but it didn't work out for me. Thats the reason I wrote this. So far couldn't find another way to restore the backup. Maybe in newer WhatsApp versions this works?!
TripCode said:
You don't have to do any of this if you haven't changed your cell number!
1) Copy your latest crypt 12 file to /sdcard/WhatsApp/Databases/
2) Install / Activate WhatsApp
3) WhatsApp will retrieve the key from their server and restore your backup.
This only works if you haven't changed numbers, but it's easy as 1, 2, 3!
Click to expand...
Click to collapse
That's actually not true. I followed their instructions to the letter, but they failed. I did not get a Restore prompt, and it actually erased the entire whatsapp cryptxx file.
The official way probably fails when you upgrade from LL to MM, but I'm not so sure about even that, because it also failed a long time ago on my htc desire just changing from rom to rom (with a clean /data/data dir).
jult said:
That's actually not true. I followed their instructions to the letter, but they failed. I did not get a Restore prompt, and it actually erased the entire whatsapp cryptxx file.
The official way probably fails when you upgrade from LL to MM, but I'm not so sure about even that, because it also failed a long time ago on my htc desire just changing from rom to rom (with a clean /data/data dir).
Click to expand...
Click to collapse
Sounds like you have had a bad experience. I do a lot of dev work with WhatsApp. I have swapped between several devices as low as API7 to API24. I have never had an issue restoring WhatsApp via the official 3 step method. My devices use a selection of stock / custom roms. As long as you got it working that's the main thing, but I would advise people to try the official restoration procedure before they venture into anything more technical as the official procedure will work most of the time.
Hi, I googled and came to this page.
I hope someone can help in restoring either local .crypt12 backup file or from google drive backup.
It started when my phone got no space and WhatsApp crashed.
For the first time, I clicked restore but it couldn't restore as got no space and WhatsApp closed the app itself.
I was carelessly when starting WhatsApp again and didn't click "restore from previous database" on the 2nd time.
I searched online for the WhatsApp help and deleted some apps to free up space.
Then, I uninstalled WhatsApp and reinstalled again. However, the problem came when after re-installation and needed to authenticate my old WhatsApp number by SMS.
As I just kept using the old WhatsApp number that was originally from a prepaid SIM card which I bought years ago and I didn't top up the stored value for a few years back, so I couldn't receive voice and SMS from that old WhatsApp number as it was properly become a dormant mobile number .
Is that a way I can restore from, for I made a copy of the crypt12 database before uninstalling WhatsApp (I didn't copy the key before uninstalling & reinstalling, and I am not sure if I had a copy of the key before, that I tried to backup using windows explorer to copy to my computer long ago.
Many thanks.
TripCode said:
Sounds like you have had a bad experience. I do a lot of dev work with WhatsApp. I have swapped between several devices as low as API7 to API24. I have never had an issue restoring WhatsApp via the official 3 step method. My devices use a selection of stock / custom roms. As long as you got it working that's the main thing, but I would advise people to try the official restoration procedure before they venture into anything more technical as the official procedure will work most of the time.
Click to expand...
Click to collapse
hi i used yowhatsapp and try to use the original whatsapp app i get messages back but cant see old pictures and cant here old voice messages they were imported somehow to the new package named com.yowhatsapp istead.
could someone point me in the right direction on how i can restore whatsapp with mediafiles`? my mediafiles are all there but just working with yowhatsapp
lycca said:
Hi, I googled and came to this page.
I hope someone can help in restoring either local .crypt12 backup file or from google drive backup.
It started when my phone got no space and WhatsApp crashed.
For the first time, I clicked restore but it couldn't restore as got no space and WhatsApp closed the app itself.
I was carelessly when starting WhatsApp again and didn't click "restore from previous database" on the 2nd time.
I searched online for the WhatsApp help and deleted some apps to free up space.
Then, I uninstalled WhatsApp and reinstalled again. However, the problem came when after re-installation and needed to authenticate my old WhatsApp number by SMS.
As I just kept using the old WhatsApp number that was originally from a prepaid SIM card which I bought years ago and I didn't top up the stored value for a few years back, so I couldn't receive voice and SMS from that old WhatsApp number as it was properly become a dormant mobile number .
Is that a way I can restore from, for I made a copy of the crypt12 database before uninstalling WhatsApp (I didn't copy the key before uninstalling & reinstalling, and I am not sure if I had a copy of the key before, that I tried to backup using windows explorer to copy to my computer long ago.
Many thanks.
Click to expand...
Click to collapse
Did this yesterday but this will only work if your number has not changed, first uninstall whatsapp, if you have a copy of your latest. msgstore.db .crypt12 file, (found on your Whatsapp folder in your SD card under Databases) copy it from there to your internal memory Whatsapp Database folder. Please note that any existing msgstore.db .crypt12 file must first be deleted. Go to your SD card whatsapp folder named backup and copy the backup crypt file as well to the internal memory whatsapp folder only after deleting the existing folder. Install whatsapp and authenticate the install , do not accept the backup prompt. Once installed go to Chats and run a backup to google drive. Your key is in the DB files and will be uploaded to google drive along with all backuped data. Uninstall Whatsapp and reinstall, this time accept the backup prompt. Verify that the two files that you copied still exist in both the SD and internal memory, allow a normal backup to occur at 4am and check in the morning. All files should be recovered and the old key should be reinstalled.
Thank you very much for your guide. I upgraded a phone to a custom rom and even though I made a recent in-app backup and never used another phone number/sim card, Whatsapp was not able to restore the data.
Glad I made a complete NAND backup just to be safe....
@sexler (what a name )
THX a lot for your guide!
I changed from Android 7 (LineageOS) to Android 8.1 (CarbonRom) without using Google-Apps anymore. So no Backup from the cloud would be possible.
Only the "c) Start WhatsApp and activate it." was not possible with my Whatsapp. But I just did the activation later and after that he noticed that there where a backup.
Your guide helped out of my 7 days quest
THX THX THX!
Greetings by Idijt
@I_did_it_just_tmrrow
You're welcome!
It’s very nice to know that almost three years later the instructions can help someone. Thank you for your feedback.
Have a nice weekend.
Is the method still working?
timenewroman said:
Is the method still working?
Click to expand...
Click to collapse
Why not, the crypt is the same and there are some tools on versioning sites like github/gitlab who offer de-crypter.
Should work. Give it a try and tell us.
I'm trying to use this method to restore old 2015-16 WhatsApp chats to a BlueStacks virtual Android machine. I haven't had much luck.
NB though I did copy over both the key file and the msgstore.db to the com.whatsapp folder (as well as having the crypt12 file available)- I'm gonna try now while just copying over the key, once Whatsapp decides I'm not a robot and sends me verification again
EDIT: tried again, with msgstore.db.crypt12 and key only. Followed the procedure closely, and used BSTweaker to copy over the key file at the appropriate stage into BlueStacks. No luck. Failed to restore. I noticed that the permissions on the key file are different (RW for Owner, Group and Others).
Can anyone help me figure this out? Do I need to change the permissions or something? Any help would be appreciated!
EDIT2: SOLVED!!!!! Praise God! I managed to transfer my old conversations, profile pictures and media using this method: https://forum.xda-developers.com/android/general/whatsapp-reencryption-crypt12-backup-t3779487
TL;DR - I copied over, from one Bluestacks Android VM (v0.8 - ancient, from 2015), to antother Bluestacks Android VM (v4.180.0.1005 - latest as of writing) the following files/folders:
/data/data/com.whatsapp/databases/msgstore.db << (unencrypted database - requires ROOT)
/data/data/com.whatsapp/files/Avatars/[a couple of files that were obviously un-named jpg profile pictures] << (profile pics - requires ROOT)
/storage/emulated/0/Whatsapp/ << (Whatsapp media folder)
I didn't need my encryption key or crypt12 database at all; all the methods I'd tried to restore using these failed miserably (including the one in the Original Post here). Whatsapp "detected a problem" on reloading the app, and restored my old conversations from years ago - so happy!
i wanna share my experience when Whatsapp refused to restore using .crypt12 file. There's like 10 of the .crypt file in my phone, but all seems corrupted. So restoring using CRYPT12 file is out of question here.
all this happen when i'm trying to move my Whatsapp from old OP3T to new OP5. I thought it wont take more that 1 hour to complete. I was wayyyyyy wrong.
Please note that I'm using custom ROM based on Android 10 (Q).
I already have some Titanium Backup of my Whatsapp. So what I do is extract msgstore.db from the Titanium Backup .tar file (data/data/com.whatsapp/databases). What important is the SELINUX permission/setting on that msgstore.db file. Use any file manager that allows SELINUX context changes, such as Root Explorer.
The key file from /data/data/com.whatsapp/files also important, because I have 2 of it (one from my old OP3T, the other from OP5). The key from OP3T can be used to restore msgstore.db on my OP5.
Its really painful lesson to me, as I can't use Whatsapp from May 1st until today (May 10). That's 10 freaking day without Whatsapp!!
I could just continue using Whatsapp fresh like new, but the old chat messages is really valuable to me.
To those who having any kind of issue, don't stop trying. Never quit! There's always solution, sooner or later.
This is also a useful link for understanding how whatsapp
files function
Hi, I am having the same problem as with restoring my Whatsapp history and wondered if any kind soul can help me to restore my Whatsapp history?
What I had done :
I had my S8 rooted. The whole phone was wipe when it was rooted. I hope this step is correct.
My encrypted backup (crypt12 and crypt14) was saved already before I rooted and I also need a backup of my phone (just not the application data because the Dr Fone software mentioned that my S8 needed to be rooted before I can backup my application data)
But I couldnt find the folders you mentioned here :
/data/data/com.whatsapp/databases/msgstore.db << (unencrypted database - requires ROOT)
/data/data/com.whatsapp/files/Avatars/[a couple of files that were obviously un-named jpg profile pictures] << (profile pics - requires ROOT)
/storage/emulated/0/Whatsapp/ << (Whatsapp media folder)
Can anyone guide me pls?
Hey guys need your help actually i mistakenly deleted a chat for that i thought I would delete my WhatsApp and reinstall it and use the backup of last night and restore it..
But it turned out while installing it asked for Google drive but i haved created any backup file on my Google drive and only had it on my internal storage but WhatsApp didn't got the local file and said no backup found after that all my chat was deleted.
It rewrite all my WhatsApp folder and now it is showing just one encrypt file and all other data and backup got deleted.
I also checked com.whatsapp file in Android > media > com.whatsApp but it is deleted from there as well.
Those msgs were really important any help would be appreciated.
Thank you
Hello guys, about this subject.
I've tried a few stuff but i can't restore it like in the pass.
My s10e, it's clean, no custom rom, only default. When i did (like in the past without knowing about the key stuff) was to copy manually all my media photos/stickers/etc., and the conversations, all those crypt files. So now i have 2 clean crypt file with my last conversations. I really want to recover all of it.
Please tell me there's a way without rooting , i've read and see so many videos but i can't find a good way to restore it.
I was thinking maybe using an old phone, put the crypt files on the sd card, change the chip, try to restore it with and old whatsapp version(?).
I really need my conversations back. It's really important. Any ideas?

Restore nandroid on different device

Hi,
i need help. How can i restore a nandroid from one oneplus 6 on another?
I tried to do it but ended up in a bootloop to recovery.
Original phone is rooted (which shouldn't be a problem, right) and encrypted and secured with pin, fingerprint and face unlock.
Is maybe the encrption the problem, or has it soething to do with A/B partitions?
Both phones were on the same version of OxygenOS and i used the same version of TWRP.
Any solutions?
Thanks
kerngehirn said:
Hi,
i need help. How can i restore a nandroid from one oneplus 6 on another?
I tried to do it but ended up in a bootloop to recovery.
Original phone is rooted (which shouldn't be a problem, right) and encrypted and secured with pin, fingerprint and face unlock.
Is maybe the encrption the problem, or has it soething to do with A/B partitions?
Both phones were on the same version of OxygenOS and i used the same version of TWRP.
Any solutions?
Thanks
Click to expand...
Click to collapse
But why would you want to do that?
Why won't you just transfer all your important files over to the other OP6 and just start fresh. Restoring your apps doesn't take that much time and you'll probably waste more time on getting your original plan to work.
It could very well be that encryption causes issues when trying to restore a nandroid backup.
It's the little things like for example all my open chrome tabs, or the whatsapp images that will be messed up after restore. And so on. It's just so much easier to continue where I left off. No restoring of apps and settings and whatnot.
kerngehirn said:
It's the little things like for example all my open chrome tabs, or the whatsapp images that will be messed up after restore. And so on. It's just so much easier to continue where I left off. No restoring of apps and settings and whatnot.
Click to expand...
Click to collapse
But you can just save and restore Chrome sessions as long your logged into the same account right?
And I don't know why you think WhatsApp images will get messed up? Sounds more like a bad experience you had which was probably caused by an unfortunate bug/glitch or an user error. The build-in backup feature of WhatsApp never failed on me and just makes a backup on your GDrive and restores it when you log in with your number again. Manually transferring the WhatsApp folder is an alternative that works fine too.
And what are you planning to do when you get a new device? You'll definitely have to manually restore things then so why can't you now, doesn't take a full day to do so and actually works without issues. But to sum it up, I think you are wasting time by trying to restore a nandroid backup on an other device than it's originally created on.
You also might want to look into Titanium Backup, Migrate or it's alternatives. You can use those two apps to backup apps and their data and possibly more and restore it on a fresh system.
kerngehirn said:
It's the little things like for example all my open chrome tabs, or the whatsapp images that will be messed up after restore. And so on. It's just so much easier to continue where I left off. No restoring of apps and settings and whatnot.
Click to expand...
Click to collapse
There are different apps for that such as Migrate, OAndBackupX or Swift which can backup apps as they are now and you can then restore them back to another device without any issues (particularly Migrate)

Question Root without phone resetting? Or backup app+it's data via adb or similar?

So I'm changing phones, but there's one app which I would have to backup including it's data. If I'd be rooted I could use Titanium Backup, unfortunately I'm not rooted.
Is there a way to root without wiping the phone or is there another way to backup the apps data (and restore) via adb or something else?
Google backup and restore is pretty good, it should restore your apps
beanbean50 said:
Google backup and restore is pretty good, it should restore your apps
Click to expand...
Click to collapse
But I need the actual data of the app, does that come with Google backup and restore?
App in question is WhatsApp and I need the app including the registration etc on the new phone. Titanium backup can do that, but obviously needs root
Whatsapp has its own backup and restore feature I use it all the time. It will restore all your data, chats etc but you have to log in first
beanbean50 said:
Whatsapp has its own backup and restore feature I use it all the time. It will restore all your data, chats etc but you have to log in first
Click to expand...
Click to collapse
I know... that's exactly the issue though. I'm asking for a way to backup 1:1 so I don't need to do the login. Which Titanium Backup can do since it's does it with all the apps data, but that obviously needs root which I don't have. Hence I'm asking for help here.
I found this which doesn't need root not sure how deep it goes though
How to fully backup and restore your Android device without root
One of Android’s little-known tricks is its built-in backup and restore process that allows users to save their private data...
9to5google.com
beanbean50 said:
I found this which doesn't need root not sure how deep it goes though
How to fully backup and restore your Android device without root
One of Android’s little-known tricks is its built-in backup and restore process that allows users to save their private data...
9to5google.com
Click to expand...
Click to collapse
For that I'd need a way to remove everything from the backup besides WhatsApp though. As that does a backup and restore of everything, all apps, all file system etc IIRC
Trying adb backup now, there seems to be a java tool that allows you to open the backup file on pc
GitHub - nelenkov/android-backup-extractor: Android backup extractor
Android backup extractor. Contribute to nelenkov/android-backup-extractor development by creating an account on GitHub.
github.com
M4-NOOB said:
For that I'd need a way to remove everything from the backup besides WhatsApp though. As that does a backup and restore of everything, all apps, all file system etc IIRC
Trying adb backup now, there seems to be a java tool that allows you to open the backup file on pc
GitHub - nelenkov/android-backup-extractor: Android backup extractor
Android backup extractor. Contribute to nelenkov/android-backup-extractor development by creating an account on GitHub.
github.com
Click to expand...
Click to collapse
Unfortunately WhatsApp wasn't included in the full backup for some reason
I just tried an app on play store called Swift Backup and it worked!
I made a backup of just whatsapp then deleted it and it restored it without signing in
beanbean50 said:
I just tried an app on play store called Swift Backup and it worked!
I made a backup of just whatsapp then deleted it and it restored it without signing in
Click to expand...
Click to collapse
Is your phone rooted? Because all it does for me is apk backup, no data
hmm.. yep I'm rooted
why can't you sign in to whatsapp on your new phone
beanbean50 said:
hmm.. yep I'm rooted
why can't you sign in to whatsapp on your new phone
Click to expand...
Click to collapse
I'm living in the UK for a few more months, but still use my German number on WhatsApp. The number has since been retired so I can't get SMS/calls on that one anymore, so I'm unable to sign in.
I wish I would've rooted the phone....
M4-NOOB said:
So I'm changing phones, but there's one app which I would have to backup including it's data. If I'd be rooted I could use Titanium Backup, unfortunately I'm not rooted.
Is there a way to root without wiping the phone or is there another way to backup the apps data (and restore) via adb or something else?
Click to expand...
Click to collapse
Smart swich is proudly sponsors
tiennhu89 said:
Smart swich is proudly sponsors
Click to expand...
Click to collapse
Is that the Samsung moving phones thingy? Does that move apps including it's data so you don't have to set them up again?
I usually avoid the moving data from phone to phone during setup, because I take setting up a new phone as an opportunity to clean up data/apps. So I only reinstall those I actually need
EDIT: Just tried it, sadly not:
https://imgur.com/gyCtmLs
M4-NOOB said:
Is that the Samsung moving phones thingy? Does that move apps including it's data so you don't have to set them up again?
I usually avoid the moving data from phone to phone during setup, because I take setting up a new phone as an opportunity to clean up data/apps. So I only reinstall those I actually need
EDIT: Just tried it, sadly not:
https://imgur.com/gyCtmLs
Click to expand...
Click to collapse
Backup with ur whatsapp. Its too easy. Anyway, in case u cant do it, think u have to reset only single app (whatsapp - like ur screenshot), so u cant?
tiennhu89 said:
Backup with ur whatsapp. Its too easy. Anyway, in case u cant do it, think u have to reset only single app (whatsapp - like ur screenshot), so u cant?
Click to expand...
Click to collapse
As mentioned in here, using the backup inside WhatsApp still needs you to sign in again on the new phone which isn't my goal. I want to backup ALL of WhatsApp including the sign in, so I can just move it to the new phone without logging in.
M4-NOOB said:
As mentioned in here, using the backup inside WhatsApp still needs you to sign in again on the new phone which isn't my goal. I want to backup ALL of WhatsApp including the sign in, so I can just move it to the new phone without logging in.
Click to expand...
Click to collapse
Then u have 2 options:
1 - Root your phone.
2 - Ask dev of Whatsapp to do something for u (for all too.lol). But i think it'll never come true. Its too risky for any apps.
tiennhu89 said:
Then u have 2 options:
1 - Root your phone.
2 - Ask dev of Whatsapp to do something for u (for all too.lol). But i think it'll never come true. Its too risky for any apps.
Click to expand...
Click to collapse
Yeah thanks, I know it's possible with root which I don't have and doing it wipes the phone which makes my whole reason for this pointless.
This whole post was just asking if there's any way to do it without root. If you can't help don't reply?

Categories

Resources