Удаление автоматической замены сервера и полная сборка apk

This commit is contained in:
2025-09-13 19:29:29 +03:00
parent d6f616da7a
commit cc49aad2aa
3 changed files with 37 additions and 2 deletions
Vendored
+2
View File
@@ -5,3 +5,5 @@ tools
__pycache__ __pycache__
.venv .venv
*.jks
*.pass
+24 -1
View File
@@ -110,7 +110,7 @@ def decompile_apk(apk: str):
def compile_apk(apk: str): def compile_apk(apk: str):
print("Компилируем apk...") print("Компилируем apk...")
try: try:
result = subprocess.run( subprocess.run(
"tools/apktool b decompiled -o " + os.path.join("modified", apk), "tools/apktool b decompiled -o " + os.path.join("modified", apk),
shell=True, shell=True,
check=True, check=True,
@@ -118,6 +118,29 @@ def compile_apk(apk: str):
stdout=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
stderr=subprocess.PIPE, 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: except subprocess.CalledProcessError as e:
print("Ошибка при выполнении команды:") print("Ошибка при выполнении команды:")
print(e.stderr) print(e.stderr)
+10
View File
@@ -27,4 +27,14 @@ def apply(config: dict) -> bool:
with open(filepath, 'w') as f: 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"]}"')) 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 return True