Удаление автоматической замены сервера и полная сборка apk
This commit is contained in:
Vendored
+2
@@ -5,3 +5,5 @@ tools
|
||||
|
||||
__pycache__
|
||||
.venv
|
||||
*.jks
|
||||
*.pass
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user