From cc49aad2aa234b45d96826bc5800fc5f19e83662 Mon Sep 17 00:00:00 2001 From: wowlikon Date: Sat, 13 Sep 2025 19:29:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87?= =?UTF-8?q?=D0=B5=D1=81=D0=BA=D0=BE=D0=B9=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D1=81=D0=B5=D1=80=D0=B2=D0=B5=D1=80=D0=B0=20=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D0=BD=D0=B0=D1=8F=20=D1=81=D0=B1=D0=BE=D1=80?= =?UTF-8?q?=D0=BA=D0=B0=20apk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +++- main.py | 25 ++++++++++++++++++++++++- patches/change_server.py | 10 ++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 753760c..d3967cb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ original tools __pycache__ -.venv \ No newline at end of file +.venv +*.jks +*.pass diff --git a/main.py b/main.py index a2a5fcf..860a72a 100644 --- a/main.py +++ b/main.py @@ -110,7 +110,7 @@ def decompile_apk(apk: str): def compile_apk(apk: str): print("Компилируем apk...") try: - result = subprocess.run( + subprocess.run( "tools/apktool b decompiled -o " + os.path.join("modified", apk), shell=True, check=True, @@ -118,6 +118,29 @@ def compile_apk(apk: str): stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, ) + subprocess.run( + "zipalign -v 4 " + os.path.join("modified", apk) + " " + os.path.join("modified", apk.replace(".apk", "-aligned.apk")), + shell=True, + check=True, + text=True, + stdout=subprocess.DEVNULL, + stderr=subprocess.PIPE, + ) + subprocess.run( + "apksigner sign " + + "--v1-signing-enabled false " + + "--v2-signing-enabled true " + + "--v3-signing-enabled true " + + "--ks keystore.jks " + + "--ks-pass file:keystore.pass " + + "--out " + os.path.join("modified", apk.replace(".apk", "-mod.apk")) + + " " + os.path.join("modified", apk.replace(".apk", "-aligned.apk")), + shell=True, + check=True, + text=True, + stdout=subprocess.DEVNULL, + stderr=subprocess.PIPE, + ) except subprocess.CalledProcessError as e: print("Ошибка при выполнении команды:") print(e.stderr) diff --git a/patches/change_server.py b/patches/change_server.py index ac66248..9149e7d 100644 --- a/patches/change_server.py +++ b/patches/change_server.py @@ -27,4 +27,14 @@ def apply(config: dict) -> bool: with open(filepath, 'w') as f: f.write(content.replace('const-string v1, "https://anixhelper.github.io/pages/urls.json"', f'const-string v1, "{new_api["gh"]}"')) + content = "" + tqdm.write("Удаление динамического выбора сервера") + filepath = './decompiled/smali_classes2/com/swiftsoft/anixartd/DaggerApp_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.smali' + with open(filepath, 'r') as f: + for line in f.readlines(): + if "addInterceptor" in line: continue + content += line + with open(filepath, 'w') as f: + f.write(content) + return True