YuvrajRaghuvanshiS / WhatsApp-Key-Database-Extractor

The most advanced and complete solution for extracting WhatsApp key/DB from package directory (/data/data/com.whatsapp) without root access.
MIT License
447 stars 57 forks source link

Features/Fast #51

Closed YuvrajRaghuvanshiS closed 3 years ago

YuvrajRaghuvanshiS commented 3 years ago
adb shell pm install /data/local/tmp/app.apk 

This format is working.

YuvrajRaghuvanshiS commented 3 years ago

I can't find any way to download LegacyWhatsApp.apk inside device itself

YuvrajRaghuvanshiS commented 3 years ago
if(isFast):
    # Check if Legacy WhatsApp exists in /data/local/tmp
    res = subprocess.getoutput(
        'adb shell ls /data/local/tmp/LegacyWhatsApp.apk'.split())
    if(not re.findall('No such file or directory', res)[0]):
        CustomPrint(
            'Downloading legacy WhatsApp V2.11.431 to /data/local/tmp folder')
            # Download apk here, somehow.
    else:
        CustomPrint(
            'Found legacy WhatsApp V2.11.431 apk in /data/local/tmp folder')
YuvrajRaghuvanshiS commented 3 years ago
def BackupWhatsAppDataasAb(SDKVersion):
    if(isFast):
        CustomPrint(
            'Backing up WhatsApp data as /sdcard/whatsapp.ab. May take time, don\'t panic.')
        try:
            if(SDKVersion >= 28):
                os.system(
                    adb + ' shell "bu backup com.whatsapp ^> /sdcard/whatsapp.ab"')
            elif(SDKVersion >= 23):
                os.system(
                    adb + ' shell "bu 1 backup com.whatsapp ^> /sdcard/whatsapp.ab"')
            else:
                os.system(
                    adb + ' shell "bu 1 backup -noapk com.whatsapp ^> "')
        except Exception as e:
            CustomPrint('\a' + e, 'red')
            Exit()
        CustomPrint('Done backing up data. Size : ' +
                    str(subprocess.getoutput(adb + ' shell ls -s /sdcard/whatsapp.ab').split()[0]) + ' kiloBytes.')
        # Either pull it here on some thread or later after reinstalling.
    else:
        CustomPrint('Backing up WhatsApp data as ' + tmp +
                    'whatsapp.ab. May take time, don\'t panic.')
        try:
            os.system(adb + ' backup -f ' + tmp + 'whatsapp.ab com.whatsapp') if(SDKVersion >=
                                                                                 23) else os.system(adb + ' backup -f ' + tmp + 'whatsapp.ab -noapk com.whatsapp')
        except Exception as e:
            CustomPrint(e, 'red')
        CustomPrint('Done backing up data. Size : ' +
                    str(os.path.getsize(tmp + 'whatsapp.ab')) + ' bytes.')