From af924655a8e50a2191ea8a66fd5cb5301e383084 Mon Sep 17 00:00:00 2001 From: Nathaniel <31831208+MotionFlex0@users.noreply.github.com> Date: Sat, 3 Sep 2022 18:46:07 +0100 Subject: [PATCH] Fixed getApktoolVersion() for Windows --- patch-apk.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/patch-apk.py b/patch-apk.py index 011f72c..c3bfea4 100755 --- a/patch-apk.py +++ b/patch-apk.py @@ -154,9 +154,8 @@ def getObjectionVersion(): def getApktoolVersion(): output = "" if os.name == "nt": - proc = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE) - proc.communicate(b"\r\n") - output = proc.stdout.decode("utf-8").strip() + proc = subprocess.run(["apktool.bat", "--version"], input=b"\r\n", capture_output=True) + output = proc.stdout.decode("utf-8").split("\r\n")[0].strip(); else: proc = subprocess.run(["apktool", "-version"], stdout=subprocess.PIPE) output = proc.stdout.decode("utf-8").strip()