Closed YuvrajRaghuvanshiS closed 3 years ago
I can't find any way to download LegacyWhatsApp.apk inside device itself
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')
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.')
This format is working.