Skip to content

Commit c9132ba

Browse files
Add files via upload
1 parent d6e569c commit c9132ba

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

WhatsAppKeyDBExtract.bat

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22
SETLOCAL ENABLEDELAYEDEXPANSION
33
color 0a
4-
title WhatsApp Key/DB Extractor 4.6 (Official)
4+
title WhatsApp Key/DB Extractor 4.7 (Official)
55
echo.
66
echo =========================================================================
77
echo = This script will extract the WhatsApp Key file and DB on Android 4.0+ =
@@ -12,7 +12,7 @@ echo = permissions. You will NOT lose ANY data and your current version will =
1212
echo = be restored at the end of the extraction process so try not to panic. =
1313
echo = Script by: TripCode (Greets to all who visit: XDA Developers Forums). =
1414
echo = Thanks to: dragomerlin for ABE and to Abinash Bishoyi for being cool. =
15-
echo = ### Version: v4.6 (11/10/2016) ### =
15+
echo = ### Version: v4.7 (12/10/2016) ### =
1616
echo =========================================================================
1717
echo.
1818
if not exist bin (
@@ -48,11 +48,11 @@ exit
4848
bin\adb.exe shell pm path com.whatsapp | bin\grep.exe package > tmp\wapath.txt
4949
bin\adb.exe shell "echo $EXTERNAL_STORAGE" > tmp\sdpath.txt
5050
bin\adb.exe shell dumpsys package com.whatsapp | bin\grep.exe versionName > tmp\wapver.txt
51-
bin\curl.exe -sI http://31.7.186.215/WhatsApp-2.11.431.apk | bin\grep.exe Content-Length > tmp\waplen.txt
51+
bin\curl.exe -sI http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk | bin\grep.exe Content-Length > tmp\waplen.txt
5252
set /p apkflen=<tmp\waplen.txt
5353
set apkflen=%apkflen:Content-Length: =%
5454
if %apkflen% == 18329558 (
55-
set apkfurl=http://31.7.186.215/WhatsApp-2.11.431.apk
55+
set apkfurl=http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk
5656
) else (
5757
set apkfurl=http://whatcrypt.com/WhatsApp-2.11.431.apk
5858
)
@@ -191,6 +191,10 @@ echo.
191191
) else (
192192
echo Operation failed
193193
)
194+
if not exist tmp\%apkname% (
195+
echo Downloading WhatsApp %versionName% to local folder
196+
bin\curl.exe -o tmp\%apkname% http://www.cdn.whatsapp.net/android/%versionName%/WhatsApp.apk
197+
)
194198
if exist tmp\%apkname% (
195199
echo Restoring WhatsApp %versionName%
196200
if %sdkver% geq 17 (

WhatsAppKeyDBExtract.ps1

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$Host.UI.RawUI.WindowTitle = "WhatsApp Key/DB Extractor 4.6 (Official)"
1+
$Host.UI.RawUI.WindowTitle = "WhatsApp Key/DB Extractor 4.7 (Official)"
22
Function TerminateWithReason([String] $reason)
33
{
44
"`r`n$reason`r`n`r`nExiting...`r`n"
@@ -15,7 +15,7 @@ exit
1515
"= be restored at the end of the extraction process so try not to panic. ="
1616
"= Script by: TripCode (Greets to all who visit: XDA Developers Forums). ="
1717
"= Thanks to: dragomerlin for ABE and to Abinash Bishoyi for being cool. ="
18-
"= ### Version: v4.6 (11/10/2016) ### ="
18+
"= ### Version: v4.7 (12/10/2016) ### ="
1919
"=========================================================================`r`n"
2020
If (!(Test-Path "bin"))
2121
{
@@ -44,7 +44,7 @@ $version = $version.Trim() -replace 'versionName='
4444
} Else {
4545
TerminateWithReason("WhatsApp is not installed on the target device")
4646
}
47-
$apkflen = Invoke-Expression "bin\curl.exe -sI http://31.7.186.215/WhatsApp-2.11.431.apk | bin\grep.exe Content-Length 2>&1"
47+
$apkflen = Invoke-Expression "bin\curl.exe -sI http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk | bin\grep.exe Content-Length 2>&1"
4848
If ($apklen)
4949
{
5050
$apkflen = $apkflen.Trim() -replace 'Content-Length: '
@@ -53,7 +53,7 @@ $apkflen = 0;
5353
}
5454
If ($apkflen -eq 18329558)
5555
{
56-
$apkfurl = "http://31.7.186.215/WhatsApp-2.11.431.apk"
56+
$apkfurl = "http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk"
5757
} Else {
5858
$apkfurl = "http://whatcrypt.com/WhatsApp-2.11.431.apk"
5959
}
@@ -160,8 +160,11 @@ If (Test-Path "tmp\apps")
160160
Remove-Item tmp\apps -recurse
161161
}
162162
"Done`r`n"
163-
If (Test-Path "tmp\$apkname")
163+
if (-Not (Test-Path "tmp\$apkname"))
164164
{
165+
"Downloading WhatsApp $version to local folder`r`n"
166+
Invoke-Expression "bin\curl.exe -o tmp\$apkname http://www.cdn.whatsapp.net/android/$version/WhatsApp.apk"
167+
}
165168
"Restoring WhatsApp $version"
166169
If ($sdkver -ge 17)
167170
{
@@ -170,7 +173,6 @@ Invoke-Expression "bin\adb.exe install -r -d tmp\$apkname"
170173
Invoke-Expression "bin\adb.exe install -r tmp\$apkname"
171174
}
172175
"Restore complete`r`n"
173-
}
174176
"Removing WhatsApp $version temporary apk`r`n"
175177
Remove-Item tmp\$apkname
176178
"`r`nOperation complete`r`n"

WhatsAppKeyDBExtract.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ echo -e "
2525
= be restored at the end of the extraction process so try not to panic. =
2626
= Script by: TripCode (Greets to all who visit: XDA Developers Forums). =
2727
= Thanks to: dragomerlin for ABE and to Abinash Bishoyi for being cool. =
28-
= ### Version: v4.6 (11/10/2016) ### =
28+
= ### Version: v4.7 (12/10/2016) ### =
2929
=========================================================================
3030
"
3131
if (($is_adb == 0)); then
@@ -53,9 +53,9 @@ adb kill-server
5353
else
5454
apkpath=$(adb shell pm path com.whatsapp | grep package | tr -d '[[:space:]]')
5555
version=$(adb shell dumpsys package com.whatsapp | grep versionName | tr -d '[[:space:]]')
56-
apkflen=$(curl -sI http://31.7.186.215/WhatsApp-2.11.431.apk | grep Content-Length | grep -o '[0-9]*')
56+
apkflen=$(curl -sI http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk | grep Content-Length | grep -o '[0-9]*')
5757
if [ $apkflen -eq 18329558 ]; then
58-
apkfurl=http://31.7.186.215/WhatsApp-2.11.431.apk
58+
apkfurl=http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk
5959
else
6060
apkfurl=http://whatcrypt.com/WhatsApp-2.11.431.apk
6161
fi
@@ -120,6 +120,10 @@ adb push tmp/apps/com.whatsapp/f/key $sdpath
120120
else
121121
echo -e "Operation failed"
122122
fi
123+
if [ ! -f tmp/$apkname ]; then
124+
echo -e "\nDownloading WhatsApp ${version/versionName=/} to local folder\n"
125+
curl -o tmp/$apkname http://www.cdn.whatsapp.net/android/${version/versionName=/}/WhatsApp.apk
126+
fi
123127
echo -e "\nRestoring WhatsApp ${version/versionName=/}"
124128
if [ $sdkver -ge 17 ]; then
125129
adb install -r -d tmp/$apkname

0 commit comments

Comments
 (0)