Пример #1
0
def main():
    os.system('cls' if os.name == 'nt' else 'clear')
    ShowBanner()
    global isJAVAInstalled
    isJAVAInstalled = CheckJAVA()
    ADBSerialId = deviceId.init()
    if (ADBSerialId):
        sdPath = subprocess.getoutput(
            adb + ADBSerialId + ' shell "echo $EXTERNAL_STORAGE"') or '/sdcard'
    else:
        sdPath = ''
    ExtractAB(isJAVAInstalled,
              sdPath=sdPath,
              ADBSerialId=ADBSerialId,
              callingFromOtherModule=False)
Пример #2
0
def main():
    os.system('cls' if os.name == 'nt' else 'clear')
    ShowBanner()
    global isJAVAInstalled
    isJAVAInstalled = CheckJAVA()
    global tcpPort
    if(tcpIP):
        if(not tcpPort):
            tcpPort = '5555'
        ADBSerialId = tcpDeviceId.init(tcpIP, tcpPort)
    else:
        ADBSerialId = deviceId.init()

    if(ADBSerialId):
        sdPath = subprocess.getoutput(
            adb + ADBSerialId + ' shell "echo $EXTERNAL_STORAGE"') or '/sdcard'
    else:
        sdPath = ''
    ExtractAB(isJAVAInstalled, sdPath=sdPath,
              ADBSerialId=ADBSerialId, callingFromOtherModule=False, isTarOnly=isTarOnly)
isLinux = False
if platform.system() == 'Windows': isWindows = True
if platform.system() == 'Linux': isLinux = True

# Global command line helpers
adb = 'bin\\adb.exe -s '
tmp = 'tmp/'
if (isLinux):
    adb = 'adb -s '


def ReinstallWhatsApp(ADBSerialId):
    CustomPrint('Reinstallting original WhatsApp.')
    if (os.path.isfile(tmp + 'WhatsAppbackup.apk')):
        try:
            os.system(adb + ADBSerialId + ' install -r -d ' + tmp +
                      'WhatsAppbackup.apk')
        except Exception as e:
            print(e)
            CustomPrint(
                'Could not restore WhatsApp, install from Play Store.\nHowever if it crashes then you have to clear storage/clear data from settings => app settings => WhatsApp.'
            )
    else:
        CustomPrint(
            'Could not find backup APK, install from play store.\nHowever if it crashes then you have to clear storage/clear data from settings => app settings => WhatsApp.',
            'red')


if __name__ == "__main__":
    ADBSerialId = deviceId.init()
    ReinstallWhatsApp(ADBSerialId)