Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
auth.cfg
*.pyc
logs/
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Allows WhatsApp users on Android to extract their backed up WhatsApp data from G

###### BRANCH UPDATES:
v1.0 - Initial release.
v1.1 - Added Python 3 support.
v1.1 - Added Python 3 support.


###### PREREQUISITES:
Expand All @@ -12,21 +12,24 @@ v1.1 - Added Python 3 support.
3. Android device with WhatsApp installed and the Google Drive backup feature enabled
4. Google services device id (if you want to reduce the risk of being logged out of Google)
Search Google Play for "device id" for plenty of apps that can reveal this information
5. Google account login credentials (username and password)
5. Google account login credentials (username and password)
6. Generate an App Password if your Google account has 2-factor-authentication.
App passwords are generated at https://security.google.com/settings/security/apppasswords.


###### INSTRUCTIONS:
1. Extract "WhatsApp-GD-Extractor-master.zip".
2. Edit the [auth] section in "settings.cfg".
3. Run python WhatsAppGDExtract.py from your command console.
4. Read the usage examples that are displayed.
5. Run any of the examples.
2. Install dependencies (`pip install -r requirements.txt`)
3. Copy `auth.cfg.example` to `auth.cfg`. Fill in your Google credentials in the file.
4. Run python WhatsAppGDExtract.py from your command console.
5. Read the usage examples that are displayed.
6. Run any of the examples.


###### TROUBLESHOOTING:
1. Check you have the required imports installed (configparser and requests).
I.E.: pip install configparser requests

I.E.: `pip install -r requirements.txt`
2. If you have 2-factor-authentication enabled, make sure you use an App Password instead of your Google passsword.

###### CREDITS:
AUTHOR: TripCode
21 changes: 16 additions & 5 deletions WhatsAppGDExtract.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,22 @@ def gDriveFileMap():
def getConfigs():
global gmail, passw, devid, pkg, sig, client_pkg, client_sig, client_ver
config = ConfigParser()
auth = ConfigParser()
try:
config.read('settings.cfg')
gmail = config.get('auth', 'gmail')
passw = config.get('auth', 'passw')
devid = config.get('auth', 'devid')
auth.read('auth.cfg')
gmail = auth.get('auth', 'gmail')
passw = auth.get('auth', 'passw')
devid = auth.get('auth', 'devid')
pkg = config.get('app', 'pkg')
sig = config.get('app', 'sig')
client_pkg = config.get('client', 'pkg')
client_sig = config.get('client', 'sig')
client_ver = config.get('client', 'ver')
except(ConfigParser.NoSectionError, ConfigParser.NoOptionError):
quit('The "settings.cfg" file is missing or corrupt!')
if passw == "" or passw is None:
quit('The "auth.cfg" file should contain your gmail password')

def jsonPrint(data):
print(json.dumps(json.loads(data), indent=4, sort_keys=True))
Expand All @@ -96,7 +100,11 @@ def localFileList():

def createSettingsFile():
with open('settings.cfg', 'w') as cfg:
cfg.write('[auth]\ngmail = alias@gmail.com\npassw = yourpassword\ndevid = 0000000000000000\n\n[app]\npkg = com.whatsapp\nsig = 38a0f7d505fe18fec64fbf343ecaaaf310dbd799\n\n[client]\npkg = com.google.android.gms\nsig = 38918a453d07199354f8b19af05ec6562ced5788\nver = 9877000')
cfg.write('[app]\npkg = com.whatsapp\nsig = 38a0f7d505fe18fec64fbf343ecaaaf310dbd799\n\n[client]\npkg = com.google.android.gms\nsig = 38918a453d07199354f8b19af05ec6562ced5788\nver = 9877000')

def createAuthFile():
with open('auth.cfg', 'w') as cfg:
cfg.write('[auth]\ngmail = alias@gmail.com\npassw=\ndevid = 0000000000000000\n\n')

def getSingleFile(data, asset):
data = json.loads(data)
Expand All @@ -118,8 +126,11 @@ def getMultipleFiles(data, folder):

def runMain(mode, asset, bID):
global bearer
if os.path.isfile('settings.cfg') == False:
if not os.path.isfile('settings.cfg'):
createSettingsFile()
if not os.path.exists('auth.cfg'):
createAuthFile()
quit("Please fill in your Google authentication details in auth.cfg")
getConfigs()
bearer = getGoogleDriveToken(getGoogleAccountTokenFromAuth())
drives = gDriveFileMap()
Expand Down
5 changes: 5 additions & 0 deletions auth.cfg.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[auth]
gmail = alias@gmail.com
passw=
devid = 0000000000000000

3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
requests
configparser

7 changes: 1 addition & 6 deletions settings.cfg
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
[auth]
gmail = alias@gmail.com
passw = yourpassword
devid = 0000000000000000

[app]
pkg = com.whatsapp
sig = 38a0f7d505fe18fec64fbf343ecaaaf310dbd799

[client]
pkg = com.google.android.gms
sig = 38918a453d07199354f8b19af05ec6562ced5788
ver = 9877000
ver = 9877000