-
Notifications
You must be signed in to change notification settings - Fork 282
Usage in WhatsappKeyDatabaseExtractor #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Not exactly sure what you are trying to do, but
Also, WhatsApp backs up to Google Drive, might be easier to just fetch your data from there. |
Sounds promising. |
However, I also then need to get the key out of the backup, what currently your tool (ok to be fair an abbrevation of your tool https://sourceforge.net/projects/adbextractor/) is used for |
Once you have the file, you should be able to extract it easily, it just a tar file with a header. If it's encrypted, you might need this tool, but running from Android should be trivial. It's just Java code. Check the README for details. |
Hey @nelenkov , I have tried that but got an exception. |
Again, what is the point of this? If you want to do this from an app, you can use the code in your Android app quite easily. If you are running in a terminal, might as well run in it on the PC. Not sure what's running in Tremux, but either the password is wrong, or the Java libraries you use somehow handle password derivation differently and you get the wrong key. |
Point was to make this process PC independent. Could not implement that inside of app because that is WhatsApp and I do not own their keystores. I believe Java libraries causing this as they are one of different variables in Termux. However it is just an idea. I have labelled that as "wontfix" |
Main goal is to get an unencrypted copy of your msgstore.db (your WhatsApp chat history). |
The tricky part is kick starting the backup from an app. That generally won't work, because you need the shell permission (see below) to connect to backup daemon. You could do this if device is rooted, but then you could just copy the WhatsApp backup file directly.
If you really want this to be an app, easiest would be to use Google Drive API and download the WhatsApp file from Google Drive. This script likely doesn't work as is anymore, but should give you an idea where to look for the backup. https://github.com/nelenkov/gdrive-appdata HTH |
Doesn't this project work with shell permissions? Because it uses adb G-Drive unfortunatly wont work, because the unlock key is afaik not uploaded. |
LADB is a clever trick, but it still just connects to ABD over the wireless interface. Not sure why they don't provide the JNI code. You are right about the key not being uploaded, but restore on new device works, so it is possible to derive it somehow without dumping all internal data. |
AFAIK the key is associated with ones WhatsApp account /number. |
Details here, but yes, you'd have to authenticate to get the key. |
But to get to the original question: |
You might have to link a tar library (or parse the tar header) to extract, but yes, there is nothing special, it's standard Java. You won't need the bouncy castle library, as it's bundled with Android. |
Hey @nelenkov , is there a runnable .jar file for the latest release? |
Releases page has a relatively recent build. You should be able to build with Java 11, not sure why 15 doesn't work. |
Could you provide a current build please? |
I've fixed the Travis CI build and there is now an |
Thanks a lot! Could you try to compile it with JDK15 (and release it)? Would just be interested to know if it's working for you. |
I don't have JDK15, but building with 1.8 and 11 work fine. |
@YuvrajRaghuvanshiS did you try that? |
Thank you @nelenkov , testing it |
@nelenkov you are a legend for sure.
Error with password can be solved with file |
For Java 8 you will need the unlimited policy jar files too: https://www.oracle.com/java/technologies/javase-jce8-downloads.html |
When I was working on termux I tried downloading those but couldn't some site issues were there. Are these totally necessary or just with "backups with password"? |
Those are necessary to be able to use AES-256 keys which Android uses to encrypt backups. If the backup is not encrypted, should work without the policy files too. |
The backups are encrypted tho |
Not necessarily, android encrypts /data partition with android PIN but I think if password is not provided while creating backup they are not encrypted, how else would it work on nopass.ab if that was encrypted? |
I think I remember that I've read somewhere that this is actually what happens... |
Look at the header of the file to find out if encrypted (it's just text). |
Not unless I provide password while creating backup. Can't say about modified ROMs tho. |
I want to ask whether an Android port is possible.
Background and the reason for this is, I would like to transfer my WhatsApp Chats to Signal via this project: https://community.signalusers.org/t/signal-fork-with-whatsapp-migration/21004
For it to work, one needs to get an unencrypted copy of their Chats (msgstore.db). This is possible via this tool:
https://github.com/YuvrajRaghuvanshiS/WhatsApp-Key-Database-Extractor
This project is using your wonderful tool. Unfortunatly, it was currently not possible to port this to Android.
See this issue: YuvrajRaghuvanshiS/WhatsApp-Key-Database-Extractor#14
The text was updated successfully, but these errors were encountered: