diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2a267e0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.vscode +tmp/* +extracted/* diff --git a/README.md b/README.md index 903a4a2..eda8c20 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ v4.4 - Changed primary mirror for legacy apk. v4.5 - Fixed issue pushing cipher key to emulated storage. v4.6 - Updated primary mirror for legacy apk (again). v4.7 - Added new sanity checks and support for Android API 24 (7.0 Nougat). +v4.7-E1.0 - Unofficial version to fix some errors which appear on newer android versions (7+). ###### PREREQUISITES: diff --git a/WhatsAppKeyDBExtract.bat b/WhatsAppKeyDBExtract.bat index 4a1f04d..c1ca57f 100644 --- a/WhatsAppKeyDBExtract.bat +++ b/WhatsAppKeyDBExtract.bat @@ -1,7 +1,7 @@ @echo off SETLOCAL ENABLEDELAYEDEXPANSION color 0a -title WhatsApp Key/DB Extractor 4.7 (Official) +title WhatsApp Key/DB Extractor 4.7 Enhanced 1.0 (Unofficial by p4r4d0x86) echo. echo ========================================================================= echo = This script will extract the WhatsApp Key file and DB on Android 4.0+ = @@ -12,18 +12,14 @@ echo = permissions. You will NOT lose ANY data and your current version will = echo = be restored at the end of the extraction process so try not to panic. = echo = Script by: TripCode (Greets to all who visit: XDA Developers Forums). = echo = Thanks to: dragomerlin for ABE and to Abinash Bishoyi for being cool. = -echo = ### Version: v4.7 (12/10/2016) ### = +echo = ### Version: v4.7-E1.0 (08/05/2019) ### = echo ========================================================================= echo. if not exist bin ( -echo Unable to locate the bin directory! Did you extract all the files from the & echo archive ^(maintaining structure^) and are you running from that directory? -echo. -echo Exiting ... -echo. -bin\adb.exe kill-server -pause -exit + echo Unable to locate the bin directory! Did you extract all the files from the & echo archive ^(maintaining structure^) and are you running from that directory? + goto exit ) + echo Please connect your Android device with USB Debugging enabled: echo. bin\adb.exe kill-server @@ -33,18 +29,15 @@ bin\adb.exe shell getprop ro.build.version.sdk > tmp\sdkver.txt set /p sdkver= tmp\wapath.txt bin\adb.exe shell "echo $EXTERNAL_STORAGE" > tmp\sdpath.txt bin\adb.exe shell dumpsys package com.whatsapp | bin\grep.exe versionName > tmp\wapver.txt @@ -52,167 +45,306 @@ bin\curl.exe -sI http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk | bin set /p apkflen= tmp\newwapver.txt + set /p currentversion= /sdcard/whatsapp.ab" + bin\adb.exe pull /sdcard/whatsapp.ab tmp/whatsapp.ab + ) else ( + if %sdkver% geq 23 ( + echo Android 6 to 8.1 + bin\adb.exe shell "bu 1 backup com.whatsapp ^> /sdcard/whatsapp.ab" + bin\adb.exe pull /sdcard/whatsapp.ab tmp/whatsapp.ab + ) else ( + echo Android before 6 + bin\adb.exe shell "bu 1 backup -noapk com.whatsapp ^> /sdcard/whatsapp.ab" + bin\adb.exe pull /sdcard/whatsapp.ab tmp/whatsapp.ab + ) + ) + ) else ( + echo Unsupported option + goto backup + ) +) + +REM Test on backup size +For %%f in (tmp\whatsapp.ab) do ( + echo Size of tmp\whatsapp.ab is %%~zf bytes + if %%~zf equ 0 ( + echo Backup is empty + echo Backup extraction skipped + goto clean + ) +) + +echo. +echo ##### Backup extraction ##### if exist tmp\whatsapp.ab ( -echo. -set /p password="Please enter your backup password (leave blank for none) and press Enter: " -echo. -if "!password!" == "" ( -java -jar bin\abe.jar unpack tmp\whatsapp.ab tmp\whatsapp.tar + echo. + set /p password="Please enter your backup password (leave blank for none) and press Enter: " + echo. + if "!password!" == "" ( + java -jar bin\abe.jar unpack tmp\whatsapp.ab tmp\whatsapp.tar + ) else ( + java -jar bin\abe.jar unpack tmp\whatsapp.ab tmp\whatsapp.tar "!password!" + ) + bin\tar.exe xvf tmp\whatsapp.tar -C tmp\ apps/com.whatsapp/f/key + bin\tar.exe xvf tmp\whatsapp.tar -C tmp\ apps/com.whatsapp/db/msgstore.db + bin\tar.exe xvf tmp\whatsapp.tar -C tmp\ apps/com.whatsapp/db/wa.db + bin\tar.exe xvf tmp\whatsapp.tar -C tmp\ apps/com.whatsapp/db/axolotl.db + bin\tar.exe xvf tmp\whatsapp.tar -C tmp\ apps/com.whatsapp/db/chatsettings.db + echo. + if exist tmp\apps\com.whatsapp\f\key ( + echo Extracting whatsapp.cryptkey ... + copy tmp\apps\com.whatsapp\f\key extracted\whatsapp.cryptkey + echo. + ) + if exist tmp\apps\com.whatsapp\db\msgstore.db ( + echo Extracting msgstore.db ... + copy tmp\apps\com.whatsapp\db\msgstore.db extracted\msgstore.db + echo. + ) + if exist tmp\apps\com.whatsapp\db\wa.db ( + echo Extracting wa.db ... + copy tmp\apps\com.whatsapp\db\wa.db extracted\wa.db + echo. + ) + if exist tmp\apps\com.whatsapp\db\axolotl.db ( + echo Extracting axolotl.db ... + copy tmp\apps\com.whatsapp\db\axolotl.db extracted\axolotl.db + echo. + ) + if exist tmp\apps\com.whatsapp\db\chatsettings.db ( + echo Extracting chatsettings.db ... + copy tmp\apps\com.whatsapp\db\chatsettings.db extracted\chatsettings.db + echo. + ) + if exist tmp\apps\com.whatsapp\f\key ( + echo Pushing cipher key to: %sdpath%/WhatsApp/Databases/.nomedia + bin\adb.exe push tmp\apps\com.whatsapp\f\key %sdpath%/WhatsApp/Databases/.nomedia + echo. + ) ) else ( -java -jar bin\abe.jar unpack tmp\whatsapp.ab tmp\whatsapp.tar "!password!" -) -bin\tar.exe xvf tmp\whatsapp.tar -C tmp\ apps/com.whatsapp/f/key -bin\tar.exe xvf tmp\whatsapp.tar -C tmp\ apps/com.whatsapp/db/msgstore.db -bin\tar.exe xvf tmp\whatsapp.tar -C tmp\ apps/com.whatsapp/db/wa.db -bin\tar.exe xvf tmp\whatsapp.tar -C tmp\ apps/com.whatsapp/db/axolotl.db -bin\tar.exe xvf tmp\whatsapp.tar -C tmp\ apps/com.whatsapp/db/chatsettings.db -echo. -if exist tmp\apps\com.whatsapp\f\key ( -echo Extracting whatsapp.cryptkey ... -copy tmp\apps\com.whatsapp\f\key extracted\whatsapp.cryptkey -echo. -) -if exist tmp\apps\com.whatsapp\db\msgstore.db ( -echo Extracting msgstore.db ... -copy tmp\apps\com.whatsapp\db\msgstore.db extracted\msgstore.db -echo. -) -if exist tmp\apps\com.whatsapp\db\wa.db ( -echo Extracting wa.db ... -copy tmp\apps\com.whatsapp\db\wa.db extracted\wa.db -echo. -) -if exist tmp\apps\com.whatsapp\db\axolotl.db ( -echo Extracting axolotl.db ... -copy tmp\apps\com.whatsapp\db\axolotl.db extracted\axolotl.db -echo. -) -if exist tmp\apps\com.whatsapp\db\chatsettings.db ( -echo Extracting chatsettings.db ... -copy tmp\apps\com.whatsapp\db\chatsettings.db extracted\chatsettings.db -echo. -) -if exist tmp\apps\com.whatsapp\f\key ( -echo Pushing cipher key to: %sdpath%/WhatsApp/Databases/.nomedia -bin\adb.exe push tmp\apps\com.whatsapp\f\key %sdpath%/WhatsApp/Databases/.nomedia -echo. + echo Backup extraction failed ) + +:clean echo Cleaning up temporary files ... echo. if exist tmp\whatsapp.ab ( -del tmp\whatsapp.ab /s /q + del tmp\whatsapp.ab /s /q ) if exist tmp\whatsapp.tar ( -del tmp\whatsapp.tar /s /q + del tmp\whatsapp.tar /s /q ) if exist tmp\waplen.txt ( -del tmp\waplen.txt /s /q + del tmp\waplen.txt /s /q ) if exist tmp\sdpath.txt ( -del tmp\sdpath.txt /s /q + del tmp\sdpath.txt /s /q ) if exist tmp\wapath.txt ( -del tmp\wapath.txt /s /q + del tmp\wapath.txt /s /q ) if exist tmp\wapver.txt ( -del tmp\wapver.txt /s /q + del tmp\wapver.txt /s /q +) +if exist tmp\newwapver.txt ( + del tmp\newwapver.txt /s /q ) if exist tmp\sdkver.txt ( -del tmp\sdkver.txt /s /q + del tmp\sdkver.txt /s /q ) if exist tmp\apps ( -rmdir tmp\apps /s /q + rmdir tmp\apps /s /q ) -echo. echo Done + + echo. -) else ( -echo Operation failed -) +echo ##### Restore previous WhatsApp version ##### if not exist tmp\%apkname% ( -echo Downloading WhatsApp %versionName% to local folder -bin\curl.exe -o tmp\%apkname% http://www.cdn.whatsapp.net/android/%versionName%/WhatsApp.apk + echo Downloading WhatsApp %versionName% to local folder + bin\curl.exe -o tmp\%apkname% http://www.cdn.whatsapp.net/android/%versionName%/WhatsApp.apk ) + + if exist tmp\%apkname% ( -echo Restoring WhatsApp %versionName% -if %sdkver% geq 17 ( -bin\adb.exe install -r -d tmp\%apkname% -) else ( -bin\adb.exe install -r tmp\%apkname% -) + :restore + echo When debugging or on error, you might save time by not restoring the updated version. + set /p restore="Do you want to restore previous WhatsApp version (Y/N)? " + echo. + if /i "!restore!" == "Y" goto restoreY + if /i "!restore!" == "N" goto exit + echo Unsupported option + goto :restore + + :restoreY + echo Restoring WhatsApp previous version + if %sdkver% geq 17 ( + bin\adb.exe install -r -d tmp\%apkname% + ) else ( + bin\adb.exe install -r tmp\%apkname% + ) + echo. + echo Restore complete + echo. + echo Removing WhatsApp previous version temporary apk + del tmp\%apkname% /s /q +) + + +:exit echo. -echo Restore complete +echo Exiting ... echo. -echo Removing WhatsApp %versionName% temporary apk -del tmp\%apkname% /s /q -) -) else ( -echo Operation failed -) -) -) set sdkver= set apkpath= set sdpath= @@ -223,9 +355,6 @@ set version= set versInfo= set versionName= set password= -echo. -echo Operation complete -echo. bin\adb.exe kill-server pause exit diff --git a/WhatsAppKeyDBExtract.sh b/WhatsAppKeyDBExtract.sh index 2d1a6a5..80a0001 100644 --- a/WhatsAppKeyDBExtract.sh +++ b/WhatsAppKeyDBExtract.sh @@ -2,16 +2,22 @@ tput bold; tput setaf 2; + is_adb=1 [[ -z $(which adb) ]] && { is_adb=0; } + is_curl=1 [[ -z $(which curl) ]] && { is_curl=0; } + is_grep=1 [[ -z $(which grep) ]] && { is_grep=0; } + is_java=1 [[ -z $(which java) ]] && { is_java=0; } + is_tar=1 [[ -z $(which tar) ]] && { is_tar=0; } + is_tr=1 [[ -z $(which tr) ]] && { is_tr=0; } @@ -25,120 +31,171 @@ echo -e " = be restored at the end of the extraction process so try not to panic. = = Script by: TripCode (Greets to all who visit: XDA Developers Forums). = = Thanks to: dragomerlin for ABE and to Abinash Bishoyi for being cool. = -= ### Version: v4.7 (12/10/2016) ### = += ### Version: v4.7-E1.0 (26/10/2020) ### = ========================================================================= " + if (($is_adb == 0)); then -echo -e "\e[0;33m Error: adb is not installed - please install adb and run again!\e[0m" + echo -e "\e[0;33m Error: adb is not installed - please install adb and run again!\e[0m" elif (($is_curl == 0)); then -echo -e "\e[0;33m Error: curl is not installed - please install curl and run again!\e[0m" + echo -e "\e[0;33m Error: curl is not installed - please install curl and run again!\e[0m" elif (($is_grep == 0)); then -echo -e "\e[0;33m Error: grep is not installed - please install grep and run again!\e[0m" + echo -e "\e[0;33m Error: grep is not installed - please install grep and run again!\e[0m" elif (($is_java == 0)); then -echo -e "\e[0;33m Error: java is not installed - please install java and run again!\e[0m" + echo -e "\e[0;33m Error: java is not installed - please install java and run again!\e[0m" elif (($is_tar == 0)); then -echo -e "\e[0;33m Error: tar is not installed - please install tar and run again!\e[0m" + echo -e "\e[0;33m Error: tar is not installed - please install tar and run again!\e[0m" elif (($is_tr == 0)); then -echo -e "\e[0;33m Error: tr is not installed - please install tr and run again!\e[0m" -else -echo -e "\nPlease connect your Android device with USB Debugging enabled:\n" -adb kill-server -adb start-server -adb wait-for-device -sdkver=$(adb shell getprop ro.build.version.sdk | tr -d '[[:space:]]') -sdpath=$(adb shell "echo \$EXTERNAL_STORAGE/WhatsApp/Databases/.nomedia" | tr -d '[[:space:]]') -if [ $sdkver -le 13 ]; then -echo -e "\nUnsupported Android Version - this method only works on 4.0 or higher :/\n" -adb kill-server -else -apkpath=$(adb shell pm path com.whatsapp | grep package | tr -d '[[:space:]]') -version=$(adb shell dumpsys package com.whatsapp | grep versionName | tr -d '[[:space:]]') -apkflen=$(curl -sI http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk | grep Content-Length | grep -o '[0-9]*') -if [ $apkflen -eq 18329558 ]; then -apkfurl=http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk -else -apkfurl=http://whatcrypt.com/WhatsApp-2.11.431.apk -fi -apkname=$(basename ${apkpath/package:/}) -if [ ! -f tmp/LegacyWhatsApp.apk ]; then -echo -e "\nDownloading legacy WhatsApp 2.11.431 to local folder\n" -curl -o tmp/LegacyWhatsApp.apk $apkfurl -echo -e "" -else -echo -e "\nFound legacy WhatsApp 2.11.431 in local folder\n" -fi -if [ -z "$apkpath" ]; then -echo -e "\nWhatsApp is not installed on the target device\nExiting ..." -else -echo -e "WhatsApp ${version/versionName=/} installed\n" -if [ $sdkver -ge 11 ]; then -adb shell am force-stop com.whatsapp -else -adb shell am kill com.whatsapp -fi -echo -e "Backing up WhatsApp ${version/versionName=/}" -adb pull ${apkpath/package:/} tmp -echo -e "Backup complete\n" -if [ $sdkver -ge 23 ]; then -echo -e "Removing WhatsApp ${version/versionName=/} skipping data" -adb shell pm uninstall -k com.whatsapp -echo -e "Removal complete\n" -fi -echo -e "Installing legacy WhatsApp 2.11.431" -if [ $sdkver -ge 17 ]; then -adb install -r -d tmp/LegacyWhatsApp.apk -else -adb install -r tmp/LegacyWhatsApp.apk -fi -echo -e "Install complete\n" -if [ $sdkver -ge 23 ]; then -adb backup -f tmp/whatsapp.ab com.whatsapp -else -adb backup -f tmp/whatsapp.ab -noapk com.whatsapp -fi -if [ -f tmp/whatsapp.ab ]; then -echo -e "\nPlease enter your backup password (leave blank for none) and press Enter: " -read password -java -jar bin/abe.jar unpack tmp/whatsapp.ab tmp/whatsapp.tar $password -tar xvf tmp/whatsapp.tar -C tmp apps/com.whatsapp/f/key -tar xvf tmp/whatsapp.tar -C tmp apps/com.whatsapp/db/msgstore.db -tar xvf tmp/whatsapp.tar -C tmp apps/com.whatsapp/db/wa.db -tar xvf tmp/whatsapp.tar -C tmp apps/com.whatsapp/db/axolotl.db -tar xvf tmp/whatsapp.tar -C tmp apps/com.whatsapp/db/chatsettings.db -echo -e "\nSaving whatsapp.cryptkey ..." -cp tmp/apps/com.whatsapp/f/key extracted/whatsapp.cryptkey -echo -e "Saving msgstore.db ..." -cp tmp/apps/com.whatsapp/db/msgstore.db extracted/msgstore.db -echo -e "Saving wa.db ..." -cp tmp/apps/com.whatsapp/db/wa.db extracted/wa.db -echo -e "Saving axolotl.db ..." -cp tmp/apps/com.whatsapp/db/axolotl.db extracted/axolotl.db -echo -e "Saving chatsettings.db ..." -cp tmp/apps/com.whatsapp/db/chatsettings.db extracted/chatsettings.db -echo -e "\nPushing cipher key to: $sdpath" -adb push tmp/apps/com.whatsapp/f/key $sdpath -else -echo -e "Operation failed" -fi -if [ ! -f tmp/$apkname ]; then -echo -e "\nDownloading WhatsApp ${version/versionName=/} to local folder\n" -curl -o tmp/$apkname http://www.cdn.whatsapp.net/android/${version/versionName=/}/WhatsApp.apk -fi -echo -e "\nRestoring WhatsApp ${version/versionName=/}" -if [ $sdkver -ge 17 ]; then -adb install -r -d tmp/$apkname + echo -e "\e[0;33m Error: tr is not installed - please install tr and run again!\e[0m" else -adb install -r tmp/$apkname -fi -echo -e "Restore complete\n\nCleaning up temporary files ..." -rm tmp/whatsapp.ab -rm tmp/whatsapp.tar -rm -rf tmp/apps -rm tmp/$apkname -echo -e "Done\n\nOperation complete\n" -fi -fi + echo -e "\nPlease connect your Android device with USB Debugging enabled:\n" + + sudo adb kill-server + sudo adb start-server + adb wait-for-device + sdkver=$(adb shell getprop ro.build.version.sdk | tr -d '[[:space:]]') + sdpath=$(adb shell "echo \$EXTERNAL_STORAGE/WhatsApp/Databases/.nomedia" | tr -d '[[:space:]]') + + if [ $sdkver -le 13 ]; then + echo -e "\nUnsupported Android Version - this method only works on 4.0 or higher :/\n" + adb kill-server + else + apkpath=$(adb shell pm path com.whatsapp | grep package | tr -d '[[:space:]]') + version=$(adb shell dumpsys package com.whatsapp | grep versionName | tr -d '[[:space:]]') + apkflen=$(curl -sI http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk | grep Content-Length | grep -o '[0-9]*') + + if [ $apkflen -eq 18329558 ]; then + apkfurl=http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk + else + apkfurl=http://whatcrypt.com/WhatsApp-2.11.431.apk + fi + + apkname=$(basename ${apkpath/package:/}) + + if [ ! -f tmp/LegacyWhatsApp.apk ]; then + echo -e "\nDownloading legacy WhatsApp 2.11.431 to local folder\n" + curl -o tmp/LegacyWhatsApp.apk $apkfurl + echo -e "" + else + echo -e "\nFound legacy WhatsApp 2.11.431 in local folder\n" + fi + + if [ -z "$apkpath" ]; then + echo -e "\nWhatsApp is not installed on the target device\nExiting ..." + else + echo -e "WhatsApp ${version/versionName=/} installed\n" + + if [ $sdkver -ge 11 ]; then + adb shell am force-stop com.whatsapp + else + adb shell am kill com.whatsapp + fi + + echo -e "Backing up WhatsApp ${version/versionName=/}" + adb pull ${apkpath/package:/} tmp + echo -e "Backup complete\n" + + if [ $sdkver -ge 23 ]; then + echo -e "Removing WhatsApp ${version/versionName=/} skipping data" + adb shell pm uninstall -k com.whatsapp + echo -e "Removal complete\n" + fi + + echo -e "Installing legacy WhatsApp 2.11.431" + if [ $sdkver -ge 24 ]; then + + echo -e "\nAndroid version 7.0 or higher detected\n" + echo -e "Device may have to be rebooted to downgrade and avoid failure like [INSTALL_FAILED_VERSION_DOWNGRADE]\n" + + adb reboot + adb wait-for-device + read -p "Wait device reboot, unlock and the press Enter to continue... " + fi + + if [ $sdkver -ge 17 ]; then + adb install -r -d tmp/LegacyWhatsApp.apk + else + adb install -r tmp/LegacyWhatsApp.apk + fi + + echo -e "Install complete\n" + echo -e "You can backup using 'adb backup' command (option A)\n" + echo -e "or you can use 'bu' command and then 'adb pull' (option B) (need enough storage on sdcard)\n" + read -n1 -p "Please select an option? [A,B] " input + + echo -e "\n\n" + + if [[ $input == "A" || $input == "a" ]]; then + if [ $sdkver -ge 23 ]; then + adb backup -f tmp/whatsapp.ab com.whatsapp + else + adb backup -f tmp/whatsapp.ab -noapk com.whatsapp + fi + elif [[ $input == "B" || $input == "b" ]]; then + if [ $sdkver -ge 28 ]; then + echo -e "\nAndroid 9.0 or higher\n" + adb shell "bu backup com.whatsapp ^> /sdcard/whatsapp.ab" + adb pull /sdcard/whatsapp.ab tmp/whatsapp.ab + elif [ $sdkver -ge 23 ]; then + echo -e "\nAndroid 6 to 8.1\n" + adb shell "bu 1 backup com.whatsapp ^> /sdcard/whatsapp.ab" + adb pull /sdcard/whatsapp.ab tmp/whatsapp.ab + else + echo -e "\nAndroid before 6\n" + adb shell "bu 1 backup -noapk com.whatsapp ^> /sdcard/whatsapp.ab" + adb pull /sdcard/whatsapp.ab tmp/whatsapp.ab + fi + else + echo -e "Sorry, unsupported option\n" + fi + + if [ -f tmp/whatsapp.ab ]; then + echo -e "\nPlease enter your backup password (leave blank for none) and press Enter: " + read password + java -jar bin/abe.jar unpack tmp/whatsapp.ab tmp/whatsapp.tar $password + tar xvf tmp/whatsapp.tar -C tmp apps/com.whatsapp/f/key + tar xvf tmp/whatsapp.tar -C tmp apps/com.whatsapp/db/msgstore.db + tar xvf tmp/whatsapp.tar -C tmp apps/com.whatsapp/db/wa.db + tar xvf tmp/whatsapp.tar -C tmp apps/com.whatsapp/db/axolotl.db + tar xvf tmp/whatsapp.tar -C tmp apps/com.whatsapp/db/chatsettings.db + echo -e "\nSaving whatsapp.cryptkey ..." + cp tmp/apps/com.whatsapp/f/key extracted/whatsapp.cryptkey + echo -e "Saving msgstore.db ..." + cp tmp/apps/com.whatsapp/db/msgstore.db extracted/msgstore.db + echo -e "Saving wa.db ..." + cp tmp/apps/com.whatsapp/db/wa.db extracted/wa.db + echo -e "Saving axolotl.db ..." + cp tmp/apps/com.whatsapp/db/axolotl.db extracted/axolotl.db + echo -e "Saving chatsettings.db ..." + cp tmp/apps/com.whatsapp/db/chatsettings.db extracted/chatsettings.db + echo -e "\nPushing cipher key to: $sdpath" + adb push tmp/apps/com.whatsapp/f/key $sdpath + else + echo -e "Operation failed" + fi + + if [ ! -f tmp/$apkname ]; then + echo -e "\nDownloading WhatsApp ${version/versionName=/} to local folder\n" + curl -o tmp/$apkname http://www.cdn.whatsapp.net/android/${version/versionName=/}/WhatsApp.apk + fi + + echo -e "\nRestoring WhatsApp ${version/versionName=/}" + if [ $sdkver -ge 17 ]; then + adb install -r -d tmp/$apkname + else + adb install -r tmp/$apkname + fi + + echo -e "Restore complete\n\nCleaning up temporary files ..." + # rm tmp/whatsapp.ab + # rm tmp/whatsapp.tar + rm -rf tmp/apps + rm tmp/$apkname + echo -e "Done\n\nOperation complete\n" + fi + fi fi + adb kill-server -read -p "Please press Enter to quit..." +read -p "Please press Enter to quit... " exit 0 diff --git a/bin/AdbWinApi.dll b/bin/AdbWinApi.dll index b5586eb..7abe26c 100644 Binary files a/bin/AdbWinApi.dll and b/bin/AdbWinApi.dll differ diff --git a/bin/AdbWinUsbApi.dll b/bin/AdbWinUsbApi.dll index 0c9e00b..e7a6de1 100644 Binary files a/bin/AdbWinUsbApi.dll and b/bin/AdbWinUsbApi.dll differ diff --git a/bin/abe.jar b/bin/abe.jar index 58fe769..3175577 100644 Binary files a/bin/abe.jar and b/bin/abe.jar differ diff --git a/bin/adb.exe b/bin/adb.exe index dc1ff1e..5a9007d 100644 Binary files a/bin/adb.exe and b/bin/adb.exe differ