Extract WhatsApp encryption keys and local message databases from non-rooted Android devices for backup analysis and message recovery.
This is for ethical, legal use only. Do not attempt to access others’ accounts or data without permission.
Back in 2015, I had a Galaxy Tab 3 SM-T110 that stored a lot of my memories: photos, videos, and apps like WhatsApp and Instagram. Over time, it broke down, the battery gave out, and it just wouldn’t turn on anymore.
I managed to bring it back to life and recovered my media files. WhatsApp, however, no longer worked on Android 4.2.2, so I couldn’t open it. The good news was that the local WhatsApp data was still there, waiting to be recovered.
This tool helps you extract keys and local databases from WhatsApp for personal restoration and analysis.
- Extract WhatsApp encryption keys stored locally on the device.
- Retrieve local WhatsApp databases for analysis or personal backup.
- Work on non-rooted Android devices without compromising device security.
To reproduce the results exactly, install the following tools on your machine. The project does not include binaries due to licensing and security reasons.
| Tool / File | Version | Notes |
|---|---|---|
| Java (JDK/JRE) | 17.0.11 LTS | Required to run abe.jar. Confirm with java -version. |
| Android Debug Bridge (ADB) | 1.0.32 | Needed to communicate with the Android device. Confirm with adb version. |
| GNU tar | 1.12 | Used to extract .tar files generated by ABE. |
| ABE | abe-e252b0b.jar | Converts .ab backups to .tar. |
| Legacy WhatsApp APK | 2.11.431 | Used to install on the device for backup purposes. |
| Data Directory | — | data/ folder in project root to save extracted keys and databases (auto-created). |
| Logs Directory | — | logs/ folder in project root to save run logs (auto-created). |
Follow these steps to extract WhatsApp keys and databases safely:
- Ensure all required tools are downloaded and available:
- Java JDK (
17.0.11 LTS) - Android Debug Bridge (ADB) (
1.0.32) - GNU tar (
1.12) - ABE jar (
e252b0b) - Legacy WhatsApp APK (
2.11.431)
- Java JDK (
- Place these tools in a folder (for example,
requirements/) and updatewhatsapp_config.pywith the correct paths. - Make sure Python is installed and accessible from your terminal.
- Go to Settings → Developer Options.
- On Android 4.2+ (API 17+), Developer Options is hidden by default:
- Go to Settings → About phone/tablet.
- Tap Build number 7 times until you see “You are now a developer.”
- Return to Settings → Developer Options.
- Enable USB Debugging.
- Keep the device unlocked throughout the process.
- Use a USB cable to connect the device to your computer.
- Verify the connection:
adb devices
- The device should show up as
device. - If prompted, allow USB debugging access.
- The device should show up as
- Open a terminal/command prompt in the project directory.
- Run:
python whatsapp.py
- Most commands will run automatically on the device. Only interact with the device when prompted.
- When the script prompts, confirm the backup operation on your device.
- Do not disconnect or close the terminal during this step.
- Once complete:
- Extracted encryption keys and databases are in
data/. - Detailed logs are in
logs/.
- Extracted encryption keys and databases are in
- You can now safely analyze your WhatsApp backup or use it for personal restoration purposes.
- Keep your device unlocked and connected until the script finishes.
- Only run on devices and data you personally own.
- If the script fails:
- Check
adb devicesto ensure the device is listed. - Confirm the paths in
whatsapp_config.pyare correct. - Make sure USB debugging is enabled and the device is unlocked.
- Confirm Java version with
java -version.
- Check
Contributions are welcome! Suggest improvements, add instructions, or provide tips for other devices/WhatsApp versions. Please fork the repository and submit a pull request.
Important: Use responsibly. By using this tool, you agree to:
- Ownership Requirement: Only use on devices and data you personally own.
- No Liability: The creator or maintainer is not responsible for misuse, data loss, or legal consequences.
- Encryption Awareness: WhatsApp messages are encrypted. This tool is solely for personal backup and recovery.
Released under the GNU General Public License v3.0. Use, modify, and distribute according to GPL 3 terms.`;