From ae9900ea0bb59f6a20685d08e733b030f606cafa Mon Sep 17 00:00:00 2001 From: Geoffrey ROYER Date: Tue, 8 Nov 2022 23:13:41 +0100 Subject: [PATCH] Update patch-apk.py Fix getApktoolVersion for NT systems --- patch-apk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patch-apk.py b/patch-apk.py index 011f72c..adf10a6 100755 --- a/patch-apk.py +++ b/patch-apk.py @@ -154,9 +154,10 @@ def getObjectionVersion(): def getApktoolVersion(): output = "" if os.name == "nt": + args = ["apktool.bat", "-version"] proc = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE) + output = proc.stdout.readline().decode("utf-8").strip() proc.communicate(b"\r\n") - output = proc.stdout.decode("utf-8").strip() else: proc = subprocess.run(["apktool", "-version"], stdout=subprocess.PIPE) output = proc.stdout.decode("utf-8").strip() @@ -651,4 +652,3 @@ def enableUserCerts(apkfile): #################### if __name__ == "__main__": main() -