Greetings,
Just to make things clear, I have used the search feature. However, I am not clear on the answers that I am reading.
I need to restore or export 1 SMS thread (or entire mmssms.db, doesn't matter) from an old ROM.
Last week my ROM crashed, and I had to switch to a new ROM.
It was a Sense 3.0 ROM (phone is HTC Droid Incredible 2). I was playing around with the different lockscreen options, applied the Stocks Lockscreen, and when I locked/unlocked my phone to see how it looked, nothing but My wallpaper and the top status bar showed up. There was no way to unlock the phone. I had to yank battery to reboot. The phone feature still worked, as I could see the text messages come through on the status bar, and my phone rang, but no notifications cam up on the screen. I was stuck. I did a ClockworkMod backup (aka Nandroid?) and switched to another ROM.
I used unyaffs on my Ubuntu Machine to extract the contents of data.img.
I have the mmssms.db file from /data/com.android.providers.telephony/databases backed up.
Using "SQLite database browser" I can see a preview of the SMS thread.
Technically, I don't need the SMS thread on my phone. If I have a .txt that is neat, organized, and readable, that will be fine. I just assume that I should reinsert the thread (or entire mmssms.db) into my current ROM so I can use SMS Backup and Restore.
My ultimate goal is to be able to get the SMS thread into a text document or large screenshot, which I can send to some friends. It involves a joke/prank, and is quite funny....a bit hard to explain.
How can I get the old mmssms.db (or just one thread) into my current ROM, or into a text document (or something of the like)? I have read something that mentions adb...which I am now Googling to find out what it stands for....so you can guess the amount of knowledge I have on it...
I believe I made that clear....if it is not, let me know, and I'll edit/repost.
tl;dr?
* Need SMS message thread from old ROM
* 1) Old ROM crashed.
* a) Can't get in
* i) Made a backup
* 2) Unyaffed backup
* a) Saved mmssms.db
How to get SMS thread (or entire mmssms.db into new ROM or into text document on computer?
Thanks for all the help!
[::AP::]
Try this on your console, if you have usb debugging enabled.
It should let your phone boot without auto activating the lockscreen.
Code:
adb -d shell
# sqlite3 data/data/com.android.providers.settings/databases/settings.db
sqlite> update system set value=0 where name='lock_pattern_autolock';
sqlite> .exit
# exit
adb reboot
Edit: Wasnt there a post before saying, if you could get in, it would be enough?
Thanks for the response.
Yes, getting into the old ROM would be enough, so I could use a SMS Backup tool, email the texts, and forget about it.
However, I am pretty new to Android. I'm a bit lost with your explanation.
Console meaning....the terminal in Ubuntu (phone connected?)....Android SDK?
If you could go into more detail, that would be great. Thanks.
[::AP::] said:
Thanks for the response.
Yes, getting into the old ROM would be enough, so I could use a SMS Backup tool, email the texts, and forget about it.
However, I am pretty new to Android. I'm a bit lost with your explanation.
Console meaning....the terminal in Ubuntu (phone connected?)....Android SDK?
If you could go into more detail, that would be great. Thanks.
Click to expand...
Click to collapse
First thing you need to do is make sure you have the android sdk. The sdk are the tools that let you "communicate" with your mobile device through the computer. If you don't have it, google android sdk installation and you should be able to fnd the link. I tried to put the actuall link but I was able to because I don't have more than 8 posts, sorry.
Now you can remove and install files from your android device as needed.
1. Connect your phone to your computer.
2. Using your Linux Terminal, change directory to the platform-tools folder. On my Windows computer I type cd c:\android-sdk\platform-tools but your sdk folder might have a different name so you should type something like this: cd /sdk-folder-name/platform-tools
3. Now type in: adb devices and your devices should be listed. If you get a message saying No Device Found then you need turn on usb debug mode or you need the drivers installed on your computer for your phone.
4.If your device is found, you need to back up your current database by typing: adb pull /data/data/com.android.providers.telephony/databases "directory on your linux machine where you want the files to be save"
5. Now type: adb push "path to the mmssms.db file" /data/data/com.android.providers.telephony/databases and do the same for the telephony.db file. Both of these files must be pushed onto your device in order to see the text messeges.
6. You should be able to see your texts from your old rom now on your new rom. Once you're done just push your backed up mmssms.db and telephony.db file from your newer rom back into your phone.
I don't know of a way to combine the text so this is the way I do it. I hope that helps!
Sorry for the late response - I have been quite busy.
I'll try this out and let you know.
Thanks a ton,
[::AP::]
This is an old thread but I'd like to share my recent experience with restoring SMS messages. Today decided to try mod on my Nexus 6 running rooted stock Nougat. Did full backup with TWRP, tried the mod, didn't have use for it and did full restore. All SMS messages were gone. Checked mmssms.db sure enough size was 0. So why TWRP didn't restore is a good question.
The way is was restored is by extracting mmssms.db and journal from TWRP backup using Nandroid Manager and copying to my location /data/user_de/0/com.android.providers.telephony. Started messenger but still no messages. Opened terminal app and changed ownership and group on both files. After that everything was restored to prebackup state.
I'm trying to do the same thing between a Droid Turbo and GS4. The Turbo screen died, but the phone boots and can go to recovery.
VZW GS4 - 5.0.1
VZW Droid Turbo - 6.0
- I copied the entire /data/data/com.android.provider.telephone directory from the Turbo using ADB
- Copied Turbo mmssms.db to the S4 (renamed the old S4 file mmssms.db.bak)
- Set permissions to 660, radio:radio (as per the old S4 file)
After a restart, Messages showed the old S4 text messages, even though I renamed the original mmssms.db file.
In other words, the S4 shows the old message history, even though the mmssms.db file has changed!
- There were two other files, mmssms.db-shm, mmssms.db-wal
- Renamed these to *.bak
After a restart, Messages now shows no text message history.
When I copied the telephony.db files over, the Phone app went into a bootloop, with a constant repeating dialog that it had crashed. I had to go into adb to reset the files.
It looks like something else is needed to make Messages see the new sms db.
Dear Hjicons,
Could you please give exact commands and what to type in adb shell to change the ownership and group of the mmssms.db and the journal?
Thanks in advance.
I did it "on the fly" without adb, only using MiXplorer
On a rooted Moto G XT1032 running KK
Copy (replace) backed up .db files in data/data/com.android.providers.telephony/databases
set permission to 600 rw-rw---- and owner, group to 1001 radio on all newly replaced files
Terminate (kill) message app, relaunch it and you're good to go, without even rebooting.
I set long press back key to terminate (kill) app via GravityBox
The same you can do with phone calls .db (same dir), or Whatsapp .db, in com.whatsapp/databases, permission to 600 and owner/group Whatsapp, then kill and relaunch
Related
I been performing this myself with great success, but you need ROOT access AND busybox installed. Create a folder on your phone's SD card called tmp. You'll need adb in order to adb shell, and gain root access. (in cmd, adb shell <enter> su <enter> confirm you are on a # prompt not the $ prompt)
Now copy and paste each line, press enter after each line pasted. Confirm the files copied after each line by running ls /mnt/sdcard/tmp/mmssms.db
Code:
cp /dbdata/databases/com.android.providers.contacts/contacts2.db /mnt/sdcard/tmp/contacts2.db
cp /dbdata/databases/com.android.providers.telephony/mmssms.db /mnt/sdcard/tmp/mmssms.db
cp /dbdata/databases/com.sec.android.provider.logsprovider/logs.db /mnt/sdcard/tmp/logs.db
cp /dbdata/databases/com.sec.android.app.memo/Memo.db /mnt/sdcard/tmp/Memo.db
cp /dbdata/databases/com.android.providers.calendar/calendar.db /mnt/sdcard/tmp/calendar.db
Once that is done, mount the phone to your computer and copy the TMP folder to your computer. When you flash the custom rom, you'll have to keep the SIM card out of the phone because you do not want new history items written to the log files.
Next ls -l /dbdata/databases/com.android.providers.contacts/contacts2.db (and the others) to see what permissions/owner they have, if you simply cp the files from /mnt/sdcard/tmp to their locations, you'll get force closes in the application (because it's not able to write log data).
Make note is the owner for each db file. Then back to adb shell, su, cd /mnt/sdcard/tmp (trust everyone knows to copy the tmp folder from PC onto your phone) cp contacts2.db /dbdata/databases/com.android.providers.contacts/contacts2.db (and the others!).
Once the files are copied back to their locations on the device, run the following:
Code:
chmod 660 /dbdata/databases/com.android.providers.contacts/contacts2.db
chown app_15.app_15 /dbdata/databases/com.android.providers.contacts/contacts2.db
Obviously you want to use the app_X.app_X you saw from running ls -l /path/filename before copying the backed up log file.
bravomail said:
This is quick comparative review.
Overall for KB1.
TiBu restore of system setting from JS32.2.1 or JS52.2.1 other than WiFi highly discouraged. I had uncurable Force Close for Browser and for MMS. Say g-bye to your messaging history, or find other ways of transferring it.
Click to expand...
Click to collapse
Original thread is here http://forum.xda-developers.com/showthread.php?t=969343
SMS Backup and Restore is a great app that does exactly what it's title indicates, without root.
https://market.android.com/details?id=com.riteshsahu.SMSBackupRestore
Call logs backup and restore also does exactly what it's title indicates, without root.
https://market.android.com/details?id=com.riteshsahu.CallLogBackupRestore
Both free and developed by the same guy, I've used both many times without a hitch.
I sync my contacts with gmail, so no problem there.
hauj0bb said:
SMS Backup and Restore is a great app that does exactly what it's title indicates, without root.
https://market.android.com/details?id=com.riteshsahu.SMSBackupRestore
Call logs backup and restore also does exactly what it's title indicates, without root.
https://market.android.com/details?id=com.riteshsahu.CallLogBackupRestore
Both free and developed by the same guy, I've used both many times without a hitch.
I sync my contacts with gmail, so no problem there.
Click to expand...
Click to collapse
+1
The manual method is pointless and extra work for nothing. These apps work flawlessly. I've used them many times as well.
I know there are apps which backup the same settings, my whole point for posting is I do not backup contacts with Google. So I kept trying different things until putting this together and I know it's a pain but all that really is done is copying and pasting lines into an SU adb shell.
askpcguy said:
I know there are apps which backup the same settings, my whole point for posting is I do not backup contacts with Google. So I kept trying different things until putting this together and I know it's a pain but all that really is done is copying and pasting lines into an SU adb shell.
Click to expand...
Click to collapse
You do not use google account or you just don't use it for backing up contacts...
I use a Google account but not to sync or backup contacts.
Sent from my SAMSUNG-SGH-I897 using XDA App
Thanks for good info!
Thanks for good info!
I personally don't care about my SMS history. Other people text a lot.
Another alternative is to use Google backup/synchronization. I never tried it. Anyone?
In my experience, backing up phone contacts using Gmail syncing is not 100%. Some fields in the on phone contact records are not properly carried into Gmail contact records and viceversa.
You'd think since Android is Google and Gmail is Google this would work flawlessly.
askpcguy said:
I been performing this myself with great success, but you need ROOT access AND busybox installed. Create a folder on your phone's SD card called tmp. You'll need adb in order to adb shell, and gain root access. (in cmd, adb shell <enter> su <enter> confirm you are on a # prompt not the $ prompt)
Now copy and paste each line, press enter after each line pasted. Confirm the files copied after each line by running ls /mnt/sdcard/tmp/mmssms.db
Code:
Next ls -l /dbdata/databases/com.android.providers.contacts/contacts2.db (and the others) to see what permissions/owner they have, if you simply cp the files from /mnt/sdcard/tmp to their locations, you'll get force closes in the application (because it's not able to write log data).
Make note is the owner for each db file. Then back to adb shell, su, cd /mnt/sdcard/tmp (trust everyone knows to copy the tmp folder from PC onto your phone) cp contacts2.db /dbdata/databases/com.android.providers.contacts/contacts2.db (and the others!).
Once the files are copied back to their locations on the device, run the following:
[CODE]chmod 660 /dbdata/databases/com.android.providers.contacts/contacts2.db
chown app_15.app_15 /dbdata/databases/com.android.providers.contacts/contacts2.db
Obviously you want to use the app_X.app_X you saw from running ls -l /path/filename before copying the backed up log file.
Click to expand...
Click to collapse
Are you doing all this above because
Code:
cp -p
failed to preserve attributes or something? Or do your fingers like the exercise...
Oh, I bet it's because it is that the attributes are getting scrubbed when they are copied off the device to your computer...
I only do this manual method because I want to retain my history and contacts between Roms.
Sent from my SAMSUNG-SGH-I897 using XDA App
I was asking specifically why you didn't use the "-p" preserve attributes flag when using the cp (copy) command. But I now realize your may be storing your backups in a way that blows away the info anyway. so you need to set ownership and permissions manually after restore..
Because I push the files to an external sd card which is copied to my computer.
Sent from my SAMSUNG-SGH-I897 using XDA App
TiBu does this, too. But thanks for the info. It's good too know how to do things manually, too.
Sent from my SAMSUNG-SGH-I897 using XDA Premium App
I don't think titanium backup will backup call history. It does get the contacts and calendar though.
Sent from my SAMSUNG-SGH-I897 using XDA App
I found this thread very useful for the restoration of all my recent messages!!
the backup i have done with smsbackup&restore is 12hour before the disaster
what happened? simply after a normal reboot my Desire HD was going to bootloop! i've tried several restore procedures but i find out that /data partition is somehow "bad", don't know why...
the only thing i can do is backup data partition with clockworldmod and unyaff it on a pc;
then i followed the instructions in the OP and i succedeed in making succesfully a backup of all my messages ;
the only difference is the different path in which mmssms.db is located in Desire HD:
i have in /data/data/com.android.providers.telephony/databases/
thank you again mate, very detailed guide
Glad someone found this useful! This is only compatible with Froyo roms, Gingerbread uses the /datadata folder and I haven't needed to manually backup the files because MIUI backup does it so amazingly well!
Well, this is pretty neat. I'm forever reflashing my phone and having to reload everything.
Which is a p-a-i-n..
One question though, is there anyway to do all this using "adb shell"? I'd love to incorporate this into a batch file I'm making, with the proper credits of course, and it'd be nice to press a button and have the PC do all the hard work.
askpcguy said:
I don't think titanium backup will backup call history. It does get the contacts and calendar though.
Sent from my SAMSUNG-SGH-I897 using XDA App
Click to expand...
Click to collapse
Super Backup from the Market does all 3:
https://market.android.com/details?id=com.idea.backup.smscontacts&feature=search_result
The apps in post #2 are great too.
Ticklefish said:
Well, this is pretty neat. I'm forever reflashing my phone and having to reload everything.
Which is a p-a-i-n..
One question though, is there anyway to do all this using "adb shell"? I'd love to incorporate this into a batch file I'm making, with the proper credits of course, and it'd be nice to press a button and have the PC do all the hard work.
Click to expand...
Click to collapse
I tried, I had sort of a working bash script but ran into problems trying to get the script root access to do the copying/restoring. Come to think of it, if you wanted to get fancy, you could make a clockwork mod flashable zip. One for backup and one for restore.
-Yes, I know there are apps which might do this however I wanted to learn on my own.
Well, yes, there are backup apps but you have to reinstall those apps and wait while they put your data back in bit by bit. Granted it may not take long but when you're reflashing what seems like once every five minutes, it can take forever!
The zip route seems like a good idea. That way, you can back up, install a rom and restore your details all from one screen. I'll have to have a look at it.
Sent from my U20i using XDA App
Hello XDA!!!this is my first post...
I wanted to be able to send sms messages using my pc but i couldnt find anything useful....
So, after doing some research i managed to create and modify some scripts and got the results i wanted...
The scripts run on linux and have been tested on Arch Linux and Ubuntu...
There are 2 main scripts:
One for reading the phone's messages..
And one for sending messages...
The second script also reads a file called "contacts" and displays its content...
The "contacts" file does not use the phones contacts...the user can open it using a text editor and write his own contacts...
There is also another file called "adb_location" which the user must open with a text editor and paste location of adb...
#######Requirements#########
* Rooted android phone with sqlite3 installed(I believe most custom roms have sqlite3 installed)(My phone is rooted nexus S with CM9)
* Linux pc (tested: Arch Linux and Android)
* ADB installed and working properly
#######After Download#########
* Extract sms.zip wherever you want
* Connect your rooted phone to pc in debugging mode (so it can interact with ADB)
* Open the extracted folder
* Open the file: "adb_location" using a text editor and replace the line: "/opt/android-sdk/platform-tools/adb" with your own adb location
* Open the file: "contacts" and replace the examples with the contacts that you will be using
* Open in terminal the file: "reader-refresh.sh" to read the messages from your phone
* Open in terminal the file: "launch-contacts.sh" to view your contacts and send messages
Here is a demonstration video...not vary instructive but i thing it will help:
XDA wont let me post an outside link...so if you want to see the video search on youtube : "Send sms using pc via adb (linux - android)"
note: If you don't know how to root your phone, flash custom roms or install adb on your linux system, there are plenty of tutorials available on the web
WWWOOOUUUAAAHHHH.
Thanks 1000 times. I have been trying with Qtadb (qtadb installed on both sides). It is supposed to send sms but never could make it ork (client not responding)
I just found your script, and as an Arch user, noting to do than run it!! And working.
Very good script mate.
TY again, as I spend all day long on my box, and typing SMS on my SGS2 small keyboard is a pane in the ass.
polizois said:
Hello XDA!!!this is my first post...
I wanted to be able to send sms messages using my pc but i couldnt find anything useful....
So, after doing some research i managed to create and modify some scripts and got the results i wanted...
Click to expand...
Click to collapse
I think I will use this and adapt it to a web page my sister can use in Abu Dhabi to text anyone in the US for free through my phone.
Thank you so much for the research you have done. KUDOS!
ICS/Jellybean
Hi
can anyone confirm this is working in ICS/Jellybean (particularly on a SGS2)?
thanks, Ian
Sorted
Got things working again ... needed another
sleep 1
$ADB shell input keyevent 22
after the first one.
thanks for the fix...
iandoug said:
Got things working again ... needed another
sleep 1
$ADB shell input keyevent 22
after the first one.
Click to expand...
Click to collapse
Thanks for the fix my friend...I have't worked on it since I posted it on xda, because noone seemed to care...
Noone has marked this solved so I am posting here to make it easier to find the solution that works.
Credit goes to hachamacha.....if this works for you, please click the link below and click 'thanks' on his original post. I can't figure out how to quote his post without it just adding to the many pages of the OP he commented on, plus I have changed the instructions to do it all within TWRP instead of using adb. It worked and was much simpler, BUT, he gets the credit for the solution.
https://forum.xda-developers.com/oneplus-5/help/error-255-twrp-t3739468/page2
For me the problem was hidden 999 files. I cleared everything mentioned in all the other posts, but still could not back up. The 999 files were tucked away in 2 spots no one had mentioned in any post.
Reminder, turn off your screenlock password before you start.
I booted into TWRP, clicked advanced, terminal, cd /data/, typed "ls */999", made a note of all the locations that had 999 files.
Then I ran "ls */10" to make sure there was not a guest profile( there wasn't for me, but you may have one).
Went back to file manager, navigated to each location, deleted the 999 folders.
Rebooted into TWRP, repeated the previous steps to verify no more 999 files, advanced, back up. Worked like a charm.
Reboot system.
Be sure to copy the file to your computer if you are going to install a custom ROM as it will get wiped in the process.
Here is the content of hachamacha's post post:
"I just ran into this too. I'm looking here after the fact and the way I fixed it and don't see what I did so this is it:
- for me, it was the presence of multi-user directories in numerous places. I don't use multi-users on pie so not sure why they're there, but it hurts nothing to delete them.
- if I only deleted 999, that'd not have worked for me
- First: I read the recovery.log file after rebooting after the failed backup. It's a big file, so I transferred it to a laptop and used notepad+ --
- Look in there for the error (tarfork) and then look for the file/directory that began the chain of errors. Mine happened to be /data/vendor_ce/10
- Go to your /data/ folder in root explorer (or equiv):
- Do an ls */10 to find out all the places the 10 user occurs or you'll then get the error on the next 10 file. For me it was 5 other dirs.
- All you should have for user number directories in those places is 0 (unless you use multiple users and then I don't know).
- delete each one. I did it all from adb on a booted op5. so like this: "rm -r /data/{folder}/xx" where {folder} is where you found the 10 11 whatever, and xx is user-numbers other than 0
- when you've got them all gone, reboot directly into recovery so you have no chance of the system recreating them (so for me: adb reboot recovery)
- Backup. Mine worked no errors and was actually faster too because the errors take time to timeout.
- reboot system
Careful when using 'rm -r' that you only delete what you want to or you can mess up your phone. - cheers.
Edit: Twrp Version: Probably should mention SW versions: Twrp, latest 991 blu_spark twrp, OS: 9.0.3 Pie, Other: xXx noLimits Rom/"
PattayaGlock said:
Noone has marked this solved so I am posting here to make it easier to find the solution that works.
Credit goes to hachamacha.....if this works for you, please click the link below and click 'thanks' on his original post. I can't figure out how to quote his post without it just adding to the many pages of the OP he commented on, plus I have changed the instructions to do it all within TWRP instead of using adb. It worked and was much simpler, BUT, he gets the credit for the solution.
https://forum.xda-developers.com/oneplus-5/help/error-255-twrp-t3739468/page2
For me the problem was hidden 999 files. I cleared everything mentioned in all the other posts, but still could not back up. The 999 files were tucked away in 2 spots no one had mentioned in any post.
Reminder, turn off your screenlock password before you start.
I booted into TWRP, clicked advanced, terminal, cd /data/, typed "ls */999", made a note of all the locations that had 999 files.
Then I ran "ls */10" to make sure there was not a guest profile( there wasn't for me, but you may have one).
Went back to file manager, navigated to each location, deleted the 999 folders.
Rebooted into TWRP, repeated the previous steps to verify no more 999 files, advanced, back up. Worked like a charm.
Reboot system.
Be sure to copy the file to your computer if you are going to install a custom ROM as it will get wiped in the process.
Here is the content of hachamacha's post post:
"I just ran into this too. I'm looking here after the fact and the way I fixed it and don't see what I did so this is it:
- for me, it was the presence of multi-user directories in numerous places. I don't use multi-users on pie so not sure why they're there, but it hurts nothing to delete them.
- if I only deleted 999, that'd not have worked for me
- First: I read the recovery.log file after rebooting after the failed backup. It's a big file, so I transferred it to a laptop and used notepad+ --
- Look in there for the error (tarfork) and then look for the file/directory that began the chain of errors. Mine happened to be /data/vendor_ce/10
- Go to your /data/ folder in root explorer (or equiv):
- Do an ls */10 to find out all the places the 10 user occurs or you'll then get the error on the next 10 file. For me it was 5 other dirs.
- All you should have for user number directories in those places is 0 (unless you use multiple users and then I don't know).
- delete each one. I did it all from adb on a booted op5. so like this: "rm -r /data/{folder}/xx" where {folder} is where you found the 10 11 whatever, and xx is user-numbers other than 0
- when you've got them all gone, reboot directly into recovery so you have no chance of the system recreating them (so for me: adb reboot recovery)
- Backup. Mine worked no errors and was actually faster too because the errors take time to timeout.
- reboot system
Careful when using 'rm -r' that you only delete what you want to or you can mess up your phone. - cheers.
Edit: Twrp Version: Probably should mention SW versions: Twrp, latest 991 blu_spark twrp, OS: 9.0.3 Pie, Other: xXx noLimits Rom/"
Click to expand...
Click to collapse
I followed your instructions and this is the text I got from the log file at the first instance of TarFork :
I:InfoManager saving '/external_sd/TWRP/BACKUPS/R58NC01GKMZ/2021-06-14--12-28-49_RP1A200720012A515FXXU4DUB1/system.info'
I:createTarFork() process ended with RC=0"
The second instance of Tarfork had this text:
I:Error adding file '/data/log/kTkdhdczEiKXeoU2sGBddC/_o43CsDAAAAQG3UaA4eJvz5TSJ2ntkPOu' to '/external_sd/TWRP/BACKUPS/R58NC01GKMZ/2021-06-14--12-28-49_RP1A200720012A515FXXU4DUB1/data.f2fs.win000'
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:InfoManager saving '/external_sd/TWRP/BACKUPS/R58NC01GKMZ/2021-06-14--12-28-49_RP1A200720012A515FXXU4DUB1/data.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.
I tried all kinds of searches unsuccessfully in Terminal Emulator but since my log text is very different than your example I am at a loss. Do you have any advice of where I should go from here?
Recovering WhatsApp messages from Android phone without root
I did this on 19-20 November 2021
My phone is a stock Huawei P20 Pro CLT-L09 up to date with all Android/EMUI/app updates, connected to Windows 10 PC by USB.
This worked and I have good verifiable and complete data even though I am opted in to the multi-device beta, with the caveat that most viewing tools are not (yet) updated to understand the new database structure that it uses.
If you already have a crypt14 encrypted WhatsApp message database, this will recover the keyfile to allow decryption too - key from phone tested against my crypt14 database I downloaded from the Google Drive backup.
I used this method rather than exporting chats due to the 10,000/40,000 message limits on chat exports with/without media. Also that I didn't really want to export each chat individually.
Tools used on Windows 10:
GitHub - p4r4d0x86/WhatsApp-Key-DB-Extractor: Allows WhatsApp users to extract their cipher key and databases on non-rooted Android devices.
Allows WhatsApp users to extract their cipher key and databases on non-rooted Android devices. - GitHub - p4r4d0x86/WhatsApp-Key-DB-Extractor: Allows WhatsApp users to extract their cipher key and ...
github.com
Get the Google USB Driver | Android Studio | Android Developers
The Google USB Driver is required to perform adb debugging on Windows with Google devices.
developer.android.com
https://aapks.com/apk/whatsapp/version/7518022/ if this link dies, you need an APK of WhatsApp of an old enough version. This is v2.11.431 and worked for me.
https://github.com/B16f00t/whapa/ (I actually put this in a Linux VM, with an additional sudo apt install python3-tk required to get that running)
The WhaGoDri tab in Whapa works brilliantly for recovering a Google Drive backup of your database (if you use 2FA, set an app-specific password for this tool) - as of October 2021, this now downloads a msgstore.db.crypt14 encrypted format. All the media associated with it is still unencrypted and downloads just fine. Personally I ran this first to have a clean data set to work from, and it's by far the easiest way to get the media. If you don't do this, then copy the media off the phone manually.
Starting out:
I would suggest opting out of the WhatsApp multi-device beta if you're currently in. I didn't - but if you do, then your final output should be better supported by existing tools for reading WhatsApp chats such as https://andreas-mausch.de/whatsapp-viewer/.
I backed everything up to Google Drive manually and downloaded all files from that backup with Whapa. After that you will need to set WhatsApp on the phone to "Never" back up to Google Drive and press backup again to create the local backups needed - otherwise the tools will fail.
Put your phone into developer mode, enable Android debugging over USB, personally I set it to permit during charging too so if it's connected, it's debugging. Fewer points of failure. Install the Windows Android drivers.
Unzip the WhatsApp Key DB Extractor into a folder (I created one on the desktop)
Add the old version of WhatsApp to the tmp folder and call it LegacyWhatsApp.apk
Now I needed to EDIT the WhatsAppKeyDBExtract.ps1 script (I used this rather than the batch script, if you want to use the bat file you're on your own!)
Following line 91 (should be after "Install complete" of LegacyWhatsApp.apk and before "If ($sdkver -ge 23)") I added the following line:
Read-Host 'Please open WhatsApp now'
As to why I added this point to pause in the program - it seemed to work better than not opening WhatsApp - it allows Android to set permissions for the old app to work better in the next steps.
Now you're ready to start!
Right-click the WhatsAppKeyDBExtract.ps1 script and select Run.
It will unload and save out your newest version of WhatsApp, and load in the legacy version. Once you are prompted to open WhatsApp from the line we added above, open the newly-installed old version and allow it all permissions requested. Don't worry that it then crashes out.
Then press Enter in the Powershell window and let it complete.
Note this may all take quite a lot of time - my crypt14 database from Google Drive was about 250MB, the unencrypted database upwards of 500MB, and the transfer time was probably about 5 minutes. So don't worry if it doesn't look like it is doing a lot!
At this point you are done! Check the findings: in the extracted folder, you should have the three critical files
1. msgstore.db which is your unencrypted message database (if you want to sanity check this, use a tool like DB Broswer (SQLite) or just a text editor and look for readable text to show it is not encrypted)
2. wa.db which is needed to assign contact names to the messages
3. whatsapp.cryptkey - this last one will let you decrypt the crypt14 file we saved from Google Drive earlier using Whapa. This is usually the hard one to get without rooting the phone!
If the process goes wrong at any point you might have the phone in a weird state. Personally I found uninstalling the old version of WhatsApp (ensuring that the checkbox was set to KEEP the data on the phone), reinstalling the newest version from the Google Play Store, opening that and letting it reload the WhatsApp chat backup from the phone was sufficient to get me ready to start again with no data loss.
As I mentioned at the start. Current tools (WhatsApp Viewer and Whapa) don't cope with the changed database structure that the multi-device beta uses in the same files. It doesn't look too complex to work out which old fields correspond to new ones to modify the readers, but that is an exercise for another day...
Things that DIDN'T work:
https://github.com/EliteAndroidApps/WhatsApp-Key-DB-Extractor - too old and the java code throws an error on the version on Android, ultimately failing to recover anything useful
https://github.com/SimonGhoul/Manual-WhatsApp-Key-DB-Extractor - not that it doesn't work per se, just the more automated version above has fewer steps for a novice user to screw up with!
https://www.imyfone.com/transfer-backup-restore-whatsapp/ - failed to decrypt the Google Drive recovered version (and I wasn't wild about giving my Google account creds to a random Chinese company either), also failed on some sort of timeout when recovering data through USB.
KingoRoot (both PC-based or APK directly) - doesn't support a P20 Pro CLT-L09 on latest version of Android, so no root for me that way
TWRP rooting - this will wipe the phone entirely and I was not convinced I'd get my data back from Google Drive! So I didn't try this
https://mobiletrans.wondershare.com/ - actually, technically speaking this works perfectly (as long as you follow the instructions *exactly* and are very patient). But I didn't like the proprietary interface and clunky chat export mechanism, nor the having-to-pay-for-it part
Things I haven't tried:
Importing anything to iOS. I'm making a clean start on my new phone!
Questions / comments / support:
Honestly I just documented this as it worked for me on this date with the current versions of stuff, I couldn't find any other instructions that worked without modification. I don't hack around with WhatsApp and phones for fun or for a living, I just wanted a readable backup to go back to as I'm switching to iOS. So... I probably won't check this again, but I hope it helps provide a data point and links/instructions for something that works.
Thank you @lightbrigade for this helpful article. I got the message store decrypted and could see message through Whatsapp viewer and SQLite browser. But I'm not able to locate deleted message in either of those tools. Do you know which table contains deleted messages by any chance?
Thanks, this was the closest I got after hours of trying to export my chats.
I successfully got my database backup using Whapa (crypt14 encrypted)
as well as the key using db extractor.
I also did a manual backup of my database (also crypt14 encrypted)
Unfortunately, msgstore.db in the "extracted" folder is still encrypted after using db extractor.
I tried decoding crypt14 databases using Whatsapp Viewer, but I got the error message:
"Decryption failed. Error during unzipping (inflate). In 99% this means you tried to use an invalid key."
Why is this key invalid? My P30 pro can't be rooted with EMUI 10...
TheReini said:
Thanks, this was the closest I got after hours of trying to export my chats.
I successfully got my database backup using Whapa (crypt14 encrypted)
as well as the key using db extractor.
I also did a manual backup of my database (also crypt14 encrypted)
Unfortunately, msgstore.db in the "extracted" folder is still encrypted after using db extractor.
I tried decoding crypt14 databases using Whatsapp Viewer, but I got the error message:
"Decryption failed. Error during unzipping (inflate). In 99% this means you tried to use an invalid key."
Why is this key invalid? My P30 pro can't be rooted with EMUI 10...
Click to expand...
Click to collapse
I have the excact same issue. Decrypting with "WhatsApp-Key-DB-Extractor" works, but i only decrypts my current messages. I need to decrypt an old G-Dirve backup. The "whatsapp.cryptkey" created by the Tool does not work with with "WhatsApp Viewer" or "whapa".
I have a rooted device, but i cannot find the key file on my device, so i cannot test it this way.
Oh my god, I finally managed to decrypt my chats...
I'm not sure if my approach works in your case, but maybe it's worth a try...
#No root needed
#No risk of losing current Chats
Instructions:
1) Make a cloud backup of your chats.
2) Download Bluestacks and allow root access
3) Install Whatsapp on Bluestacks and load your backup
4) Create a local backup in Whatsapp on Bluestacks
5) Download a root file explorer (I used "Root Browser") and copy the key file from
/data/data/com.whatsapp/files
to some path on bluestacks sdcard
6) Open the preinstalled file explorer (Media-Manager) and export both the keyfile from 5) and your database from /sdcard/Whatsapp/Databases to your local Windows machine.
(Key file can also be extracted on the phone itself (without Bluestacks Emulator) using
WhatsApp-Key-DB-Extractor-master)
7) Clone the following repository to your local machine and decrypt your database
GitHub - ElDavoo/wa-crypt-tools: Decrypts WhatsApp .crypt12, .crypt14 and .crypt15 files.
Decrypts WhatsApp .crypt12, .crypt14 and .crypt15 files. - GitHub - ElDavoo/wa-crypt-tools: Decrypts WhatsApp .crypt12, .crypt14 and .crypt15 files.
github.com
Failed tries:
- Whapa always exported a 0 byte database
- WhatSoup Web Scraper kept crashing after some minutes on Windows, as well as Linux VMware
- WhatsApp Viewer threw an Error: unzipping (inflate), invalid key
!!! Important !!!
Windows Text Editor doesn't display the decrypted database in a readable way.
You have to open it in some kind of SQL software or test it online here:
SQL Online Compiler - Next gen SQL Editor
SQL OnLine - Next gen SQL Editor: SQLite, MariaDB / MySQL, PostgreSQL, MS SQL Server. User-friendly interface for data science. No registration for start, No DownLoad, No Install. Online test SQL script. Online Open/Save SQLite file. Online view all table DB. Fiddle link SQL text and DB file...
sqliteonline.com
Hey everyone, I ended up using this app:
GitHub - p4r4d0x86/WhatsApp-Key-DB-Extractor: Allows WhatsApp users to extract their cipher key and databases on non-rooted Android devices.
Allows WhatsApp users to extract their cipher key and databases on non-rooted Android devices. - GitHub - p4r4d0x86/WhatsApp-Key-DB-Extractor: Allows WhatsApp users to extract their cipher key and ...
github.com
But it didnt work and ended up deleting my local backups... is there anyway to recover it?
Google drive back up is a week old.
Samsung s22 non-rooted phone
Any help would be appreciated.
Doesn't work for accounts that transferred accounts to another phone.
Key file gets deleted from old phone if you use whatsapp on another device.
Hello folks,
I am getting a
Performing Streamed Install
adb: failed to install tmp\LegacyWhatsApp.apk: Failure [-26: Package com.whatsapp new target SDK 19 doesn't support runtime permissions but the old target SDK 31 does.]
Click to expand...
Click to collapse
on WhatsApp-Key-DB-Extractor-master with Android 12 (Realme RMX3393).
Using the APK mentioned in the inital post as legacy APK.
Any ideas how to cirumvent that or what else to try?
By the way Whapa to downlowd the Drive data worked like a charm but I am unable to get my hands on the key.
The people that achieved the extraction could they state on what OS the ewxtraction was successful?
I could get relatively easily down to an Android version 10 ... ;-)
hi, sorry but couldnt understand if this process would solve my problem, so im asking; i made a backup for my Whatsapp to Drive then made a factory reset to my phone, installed Whatsapp, before i restored my real back, i did a new backup and i realized that, my real backup gone, only one i could restore is the new one which is nothing inside, is there a way to get older backup in Drive, or do you guys think can i get those files on my internal storage via any data recovery software? Thanks in advance!
Hi there ! Greetings from France
I got a Samsung Galaxy S21 5G "classic" 128GB
I'm currently in dispute with my insurer, my automobile expert and my garage.
I'd like to access the Outlook cache because I viewed a photo of my car (taken by the expert), bodywork done, before painting, via the Edge browser integrated into Outlook, without being able to save it.
I didn't insist because I didn't think it would end up in litigation, serious mistake, because the expert deleted all the photos in the file (oddly)
They claim to have removed my quarter window, and not to have removed my front bumper, this photo would prove the opposite, if I manage to recover it
But I can't.
I tried via samsung explorer, also on windows, it's impossible without root, but root will wipe all my data...
In the android "applications" section, when I click on Outlook (4.2247.1), there's written :
App 236MB
Data 1.45GB
Cache 181MB
Total 1.87GB of inaccessible data
What do you guys think ?
I'd really like to recover this photo, to shut them up, although it's provable even without a photo, there would be no further discussion if I managed to get it back.
Thanks
gr3g68 said:
Hi there ! Greetings from France
I got a Samsung Galaxy S21 5G "classic" 128GB
I'm currently in dispute with my insurer, my automobile expert and my garage.
I'd like to access the Outlook cache because I viewed a photo of my car (taken by the expert), bodywork done, before painting, via the Edge browser integrated into Outlook, without being able to save it.
I didn't insist because I didn't think it would end up in litigation, serious mistake, because the expert deleted all the photos in the file (oddly)
They claim to have removed my quarter window, and not to have removed my front bumper, this photo would prove the opposite, if I manage to recover it
But I can't.
I tried via samsung explorer, also on windows, it's impossible without root, but root will wipe all my data...
In the android "applications" section, when I click on Outlook (4.2247.1), there's written :
App 236MB
Data 1.45GB
Cache 181MB
Total 1.87GB of inaccessible data
What do you guys think ?
I'd really like to recover this photo, to shut them up, although it's provable even without a photo, there would be no further discussion if I managed to get it back.
Thanks
Click to expand...
Click to collapse
Sorry, the only way to access the cache is either with root or by flashing TWRP then using TWRP to create a android backup of all data on your device and then extracting the data you are looking for from the nandroid backup. If your bootloader is locked, you would have to unlock the bootloader to install TWRP, which would wipe your data.
It is "possible" to unlock the bootloader(this will wipe your data) then root the device then recover the deleted data using one of the several different data recovery software on PC, this is commonly done to retrieve lost data from rooted devices. There is no guarantee that you will be able to retrieve your data intact.
outlook is email right? so why you don't just open the email again?
depending on app manifest you can copy app data (including cache files) to PC with adb backup.
this app will find cached pictures and thumbnails in emulated storage (existing only, impossible to recover deleted files)
FindMyPhoto – Recover Photos o - Apps on Google Play
A truely free app to recover deleted photos on Android devices.
play.google.com
beware of noobs advise! unlocking bootloader is just nonsense, it's simply impossible to recover just a single file from factory reset!
aIecxs said:
outlook is email right? so why you don't just open the email again?
depending on app manifest you can copy app data (including cache files) to PC with adb backup.
this app will find cached pictures and thumbnails in emulated storage (existing only, impossible to recover deleted files)
FindMyPhoto – Recover Photos o - Apps on Google Play
A truely free app to recover deleted photos on Android devices.
play.google.com
beware of noobs advise! unlocking bootloader is just nonsense, it's simply impossible to recover just a single file from factory reset!
Click to expand...
Click to collapse
The pictures were stored in my personal space of the expert's site, he sent me the link via email, and my client is Outlook.
So I opened it in Outlook, with the (s***ty) integrated lite version of Edge
Thank you very much, I'll try these two solutions !
OK I'll not unlock my BL
link only pictures might stored in browser cache. check for each app manifest if backup is allowed.
I tried "Findmyphotos" without success
Now I'll install DevToolsPro and I'll tell you
android:allowBackup="false" =[
I think that I have also opened it in Samsung Internet browser, but backup is also not allowed
as that flag should be ignored for apps targeting API level 30+ you can try anyway (leave password blank)
Code:
adb backup [-f <file>] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all] [-system|nosystem] [-keyvalue|-nokeyvalue] [<packages...>]
Android 11 forces apps to support local backups but not cloud backups
It's no secret that backing up and restoring apps and data sucks on Android, especially when switching devices. Android 11 is slightly making things better.
www.xda-developers.com
if no app data is backed up it should at least work with D2D transfer software like Samsung Smart Switch (not sure it can decrypted though)
How to decode Samsung Smart Switch .enc files
Made a backup of my Galaxy S9 to the desktop with Samsung Smart Switch. Inside the folder APKFILE there is say org.mozilla.firefox.enc so how can I decode it to see its contents?
forum.xda-developers.com
My SGS 21 is running android 13
What does the code mean ?
"adb backup [-f <file>] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all] [-system|nosystem] [-keyvalue|-nokeyvalue] [<packages...>]"
First, on Smartphone, enable hidden menu Developer options. this is done by tapping buildno (7x) seven times (settings - about phone).
In settings - developer options - enable usb-debugging.
you need computer for adb backup. I will describe for windows.
download platform-tools then connect device with usb-debugging enabled and install usb drivers. now add platform-tools directory to path (or navigate to directory with 'cd') in cmd.exe
if adb is available you should see device serialno when typing 'adb devices' (requires confirmation on phone).
then get the package name of the app and create backup (requires confirmation on phone)
Code:
adb devices
adb backup com.android.chrome
you can unpack backup.ab with abe.jar + 7-zip.
https://nelenkov.blogspot.com/2012/06/unpacking-android-backups.html
Code:
java.exe -jar abe.jar unpack backup.ab backup.tar [password]
[GUIDE] How to extract, create or edit android adb backups
What is an android adb backup? An adb backup is a file with ab extension, generated by android's backup manager when we request it via adb shell. This allows you to backup some data of the phone, but is not a replacement of a clockworkmod backup...
forum.xda-developers.com
Thank you for the tutorial, I'll try this tomorrow after a good sleep
It seems to be a little bit tricky, although I studied electronics, I have not practiced for 10 years =D
try with app that allows backup, first. like Chrome (com.android.chrome)
OK, I have to move platform tools directory in C:\ (root)
Is that right ?
location doesn't matter. you can place it Program files (x86) or Desktop. I have it in C:\Android directory
Sorry I can't post here with my computer since my Last message, the forum shows "we ran into some problems, please try again later..."
So I don't understand this :
now add platform-tools directory to path (or navigate to directory with 'cd') in cmd.exe
maybe that helps
https://duckduckgo.com/?q=How+to+set+the+path+and+environment+variables+in+Windows
Thank you for your help alecxs, my insurance sent me the pictures !
So I don't need to tweak my phone