check if java is installed and the version of python

This commit is contained in:
Florian Bezannier
2020-11-25 14:37:29 +01:00
parent bb888219c2
commit c46ef85d33
2 changed files with 10 additions and 4 deletions
+7 -4
View File
@@ -3,22 +3,22 @@ import os
import shutil
import xml.etree.ElementTree as ET
import base64
from ChargeControl import ChargeControl, ChargeControls
from MyPSACC import MyPSACC
from sys import argv
import tarfile
import sys
def getxmlvalue(root, name):
for child in root.findall("*[@name='" + name + "']"):
return child.text
current_dir = os.getcwd()
script_dir = dir_path = os.path.dirname(os.path.realpath(__file__))
if sys.version_info < (3, 6):
raise RuntimeError("This application requres Python 3.6+")
if argv[1].endswith(".apk"):
from androguard.core.bytecodes.apk import APK
a = APK(argv[1])
@@ -34,6 +34,9 @@ else:
password = argv[2]
else:
password = ""
res = os.system("java --version")
if res != 0:
print("You need to install java on your computer : https://www.java.com/fr/download/")
os.system(f"java -jar {script_dir}/abe-all.jar unpack {argv[1]} backup.tar {password}")
my_tar = tarfile.open('backup.tar')
+3
View File
@@ -1,3 +1,4 @@
import sys
import threading
from threading import Thread
@@ -81,6 +82,8 @@ def parse_args():
if __name__ == "__main__":
if sys.version_info < (3, 6):
raise RuntimeError("This application requres Python 3.6+")
parser = parse_args()
args = parser.parse_args()
my_logger(handler_level=args.debug)