Обновление вывода информации о патчах, добавление патча лайков/дизлайков
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
"""
|
||||
Заменяет сервер api
|
||||
"""Заменяет сервер api
|
||||
|
||||
"change_server": {
|
||||
"enabled": true,
|
||||
@@ -24,11 +23,11 @@ class Config(PatchConfig):
|
||||
|
||||
# Patch
|
||||
def apply(config: Config, base: Dict[str, Any]) -> bool:
|
||||
response = requests.get(config.server)
|
||||
response = requests.get(config.server) # Получаем данные для патча
|
||||
assert response.status_code == 200, f"Failed to fetch data {response.status_code} {response.text}"
|
||||
|
||||
new_api = json.loads(response.text)
|
||||
for item in new_api['modifications']:
|
||||
for item in new_api['modifications']: # Применяем замены API
|
||||
tqdm.write(f"Изменение {item['file']}")
|
||||
filepath = './decompiled/smali_classes2/com/swiftsoft/anixartd/network/api/'+item['file']
|
||||
|
||||
@@ -40,7 +39,7 @@ def apply(config: Config, base: Dict[str, Any]) -> bool:
|
||||
tqdm.write(f"⚠ Не найдено {item['src']}")
|
||||
f.write(content.replace(item['src'], item['dst']))
|
||||
|
||||
tqdm.write(f"Изменение Github ссылки")
|
||||
tqdm.write(f"Изменение Github ссылки") # Обновление ссылки на поиск серверов в Github
|
||||
filepath = './decompiled/smali_classes2/com/swiftsoft/anixartd/utils/anixnet/GithubPagesNetFetcher.smali'
|
||||
|
||||
with open(filepath, 'r') as f:
|
||||
@@ -49,10 +48,10 @@ def apply(config: Config, base: Dict[str, Any]) -> 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("Удаление динамического выбора сервера")
|
||||
tqdm.write("Удаление динамического выбора сервера") # Отключение автовыбора сервера
|
||||
filepath = './decompiled/smali_classes2/com/swiftsoft/anixartd/DaggerApp_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.smali'
|
||||
|
||||
content = ""
|
||||
with open(filepath, 'r') as f:
|
||||
for line in f.readlines():
|
||||
if "addInterceptor" in line: continue
|
||||
|
||||
Reference in New Issue
Block a user