добавление вспомогательных функций, исправление добавления всплывающего окна первого запуска
This commit is contained in:
+14
-3
@@ -1,10 +1,12 @@
|
||||
"""Compress PNGs"""
|
||||
priority = 1
|
||||
|
||||
priority = -1
|
||||
from tqdm import tqdm
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
def compress_pngs(root_dir):
|
||||
compressed_files = []
|
||||
for dirpath, _, filenames in os.walk(root_dir):
|
||||
@@ -14,14 +16,23 @@ def compress_pngs(root_dir):
|
||||
tqdm.write(f"Сжимаю: {filepath}")
|
||||
try:
|
||||
subprocess.run(
|
||||
["pngquant", "--force", "--ext", ".png", "--quality=65-90", filepath],
|
||||
check=True, capture_output=True
|
||||
[
|
||||
"pngquant",
|
||||
"--force",
|
||||
"--ext",
|
||||
".png",
|
||||
"--quality=65-90",
|
||||
filepath,
|
||||
],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
)
|
||||
compressed_files.append(filepath)
|
||||
except subprocess.CalledProcessError as e:
|
||||
tqdm.write(f"Ошибка при сжатии {filepath}: {e}")
|
||||
return compressed_files
|
||||
|
||||
|
||||
def apply(config: dict) -> bool:
|
||||
files = compress_pngs("./decompiled")
|
||||
return len(files) > 0 and any(files)
|
||||
|
||||
+2
-1
@@ -50,5 +50,6 @@
|
||||
"xml_ns": {
|
||||
"android": "http://schemas.android.com/apk/res/android",
|
||||
"app": "http://schemas.android.com/apk/res-auto"
|
||||
}
|
||||
},
|
||||
"speeds": [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.5, 3.0, 9.0]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
"""Change application icon"""
|
||||
|
||||
priority = 0
|
||||
from tqdm import tqdm
|
||||
|
||||
import struct
|
||||
|
||||
|
||||
def float_to_hex(f):
|
||||
b = struct.pack(">f", f)
|
||||
return b.hex()
|
||||
|
||||
|
||||
def apply(config: dict) -> bool:
|
||||
assert float_to_hex(1.5) == "0x3fc00000"
|
||||
return False
|
||||
@@ -1,22 +1,20 @@
|
||||
"""Insert new files"""
|
||||
|
||||
priority = 0
|
||||
from tqdm import tqdm
|
||||
|
||||
import shutil
|
||||
import os
|
||||
|
||||
|
||||
def apply(config: dict) -> bool:
|
||||
# Mod first launch window
|
||||
shutil.copytree(
|
||||
"./patches/resources/smali_classes4/",
|
||||
"./decompiled/smali_classes4/"
|
||||
"./patches/resources/smali_classes4/", "./decompiled/smali_classes4/"
|
||||
)
|
||||
|
||||
# Mod assets
|
||||
shutil.copy(
|
||||
"./patches/resources/wowlikon.png",
|
||||
"./decompiled/assets/wowlikon.png"
|
||||
)
|
||||
shutil.copy("./patches/resources/avatar.png", "./decompiled/assets/avatar.png")
|
||||
shutil.copy(
|
||||
"./patches/resources/OpenSans-Regular.ttf",
|
||||
"./decompiled/assets/OpenSans-Regular.ttf",
|
||||
|
||||
+39
-1
@@ -1,13 +1,16 @@
|
||||
"""Change package name of apk"""
|
||||
|
||||
priority = -1
|
||||
from tqdm import tqdm
|
||||
|
||||
import os
|
||||
|
||||
|
||||
def rename_dir(src, dst):
|
||||
os.makedirs(os.path.dirname(dst), exist_ok=True)
|
||||
os.rename(src, dst)
|
||||
|
||||
|
||||
def apply(config: dict) -> bool:
|
||||
assert config["new_package_name"] is not None, "new_package_name is not configured"
|
||||
|
||||
@@ -27,7 +30,6 @@ def apply(config: dict) -> bool:
|
||||
"com/swiftsoft/anixartd",
|
||||
config["new_package_name"].replace(".", "/"),
|
||||
)
|
||||
|
||||
with open(file_path, "w", encoding="utf-8") as file:
|
||||
file.write(new_contents)
|
||||
except:
|
||||
@@ -47,6 +49,42 @@ def apply(config: dict) -> bool:
|
||||
config["new_package_name"].replace(".", "/"),
|
||||
),
|
||||
)
|
||||
# rename_dir(
|
||||
# "./decompiled/smali_classes3/com/swiftsoft/anixartd",
|
||||
# os.path.join(
|
||||
# "./decompiled",
|
||||
# "smali_classes3",
|
||||
# config["new_package_name"].replace(".", "/"),
|
||||
# ),
|
||||
# )
|
||||
if not os.path.exists("./decompiled/smali_classes4/"):
|
||||
return True
|
||||
|
||||
rename_dir(
|
||||
"./decompiled/smali_classes4/com/swiftsoft/anixartd",
|
||||
os.path.join(
|
||||
"./decompiled",
|
||||
"smali_classes4",
|
||||
config["new_package_name"].replace(".", "/"),
|
||||
),
|
||||
)
|
||||
for root, dirs, files in os.walk("./decompiled/smali_classes4/"):
|
||||
for filename in files:
|
||||
file_path = os.path.join(root, filename)
|
||||
|
||||
if os.path.isfile(file_path):
|
||||
try:
|
||||
with open(file_path, "r", encoding="utf-8") as file:
|
||||
file_contents = file.read()
|
||||
|
||||
new_contents = new_contents.replace(
|
||||
"com/swiftsoft",
|
||||
"/".join(config["new_package_name"].split(".")[:-1]),
|
||||
)
|
||||
with open(file_path, "w", encoding="utf-8") as file:
|
||||
file.write(new_contents)
|
||||
except:
|
||||
pass
|
||||
|
||||
os.rmdir("./decompiled/smali_classes2/com/swiftsoft")
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 26 MiB After Width: | Height: | Size: 26 MiB |
@@ -1,4 +1,4 @@
|
||||
.class public Lcom/wowlikon/about/$1;
|
||||
.class public Lcom/swiftsoft/about/$1;
|
||||
.super Landroid/graphics/drawable/GradientDrawable;
|
||||
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
const/4 v0, -0x1
|
||||
|
||||
.line 8
|
||||
invoke-direct {p0, v0}, Lcom/wowlikon/about/$1;->oooooo(I)V
|
||||
invoke-direct {p0, v0}, Lcom/swiftsoft/about/$1;->oooooo(I)V
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 9
|
||||
invoke-direct {p0, v0}, Lcom/wowlikon/about/$1;->oooooo(Z)V
|
||||
invoke-direct {p0, v0}, Lcom/swiftsoft/about/$1;->oooooo(Z)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
@@ -26,12 +26,12 @@
|
||||
.locals 0
|
||||
|
||||
.line 21
|
||||
invoke-virtual {p0, p1}, Lcom/wowlikon/about/$1;->setTint(I)V
|
||||
invoke-virtual {p0, p1}, Lcom/swiftsoft/about/$1;->setTint(I)V
|
||||
|
||||
const/16 p1, 0xff
|
||||
|
||||
.line 22
|
||||
invoke-virtual {p0, p1}, Lcom/wowlikon/about/$1;->setAlpha(I)V
|
||||
invoke-virtual {p0, p1}, Lcom/swiftsoft/about/$1;->setAlpha(I)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
@@ -40,7 +40,7 @@
|
||||
.locals 3
|
||||
|
||||
.line 26
|
||||
invoke-virtual {p0, p1}, Lcom/wowlikon/about/$1;->setAutoMirrored(Z)V
|
||||
invoke-virtual {p0, p1}, Lcom/swiftsoft/about/$1;->setAutoMirrored(Z)V
|
||||
|
||||
const/16 p1, 0x7f
|
||||
|
||||
@@ -57,31 +57,31 @@
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
invoke-virtual {p0, v0, p1}, Lcom/wowlikon/about/$1;->setStroke(II)V
|
||||
invoke-virtual {p0, v0, p1}, Lcom/swiftsoft/about/$1;->setStroke(II)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
# virtual methods
|
||||
.method public oooooo(II)Lcom/wowlikon/about/$1;
|
||||
.method public oooooo(II)Lcom/swiftsoft/about/$1;
|
||||
.locals 0
|
||||
|
||||
.line 13
|
||||
invoke-virtual {p0, p1}, Lcom/wowlikon/about/$1;->setColor(I)V
|
||||
invoke-virtual {p0, p1}, Lcom/swiftsoft/about/$1;->setColor(I)V
|
||||
|
||||
int-to-float p2, p2
|
||||
|
||||
.line 14
|
||||
invoke-virtual {p0, p2}, Lcom/wowlikon/about/$1;->setCornerRadius(F)V
|
||||
invoke-virtual {p0, p2}, Lcom/swiftsoft/about/$1;->setCornerRadius(F)V
|
||||
|
||||
.line 15
|
||||
invoke-direct {p0, p1}, Lcom/wowlikon/about/$1;->oooooo(I)V
|
||||
invoke-direct {p0, p1}, Lcom/swiftsoft/about/$1;->oooooo(I)V
|
||||
|
||||
const/4 p1, 0x1
|
||||
|
||||
.line 16
|
||||
invoke-direct {p0, p1}, Lcom/wowlikon/about/$1;->oooooo(Z)V
|
||||
invoke-direct {p0, p1}, Lcom/swiftsoft/about/$1;->oooooo(Z)V
|
||||
|
||||
return-object p0
|
||||
.end method
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.class public Lcom/wowlikon/about/$2;
|
||||
.class public Lcom/swiftsoft/about/$2;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
|
||||
move-result-object v11
|
||||
|
||||
const-string v12, "wowlikon.png"
|
||||
const-string v12, "avatar.png"
|
||||
|
||||
invoke-virtual {v11, v12}, Landroid/content/res/AssetManager;->open(Ljava/lang/String;)Ljava/io/InputStream;
|
||||
|
||||
@@ -189,16 +189,16 @@
|
||||
|
||||
move-result-object v3
|
||||
|
||||
const-string v11, "%D0%9C%D0%BE%D0%B4+%D1%81%D0%B4%D0%B5%D0%BB%D0%B0%D0%BD+wowlikon+%D1%81+%D0%BD%D0%BE%D0%B2%D1%8B%D1%8B%D0%BC%D0%B8+%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8F%D0%BC%D0%B8%21%0A%0A%D0%A1%D0%B4%D0%B5%D0%BB%D0%B0%D0%BD%D0%BE+%D1%81+%E2%9D%A4%EF%B8%8F+%D0%BE%D1%82+wowlikon"
|
||||
const-string v11, "%D0%9C%D0%BE%D0%B4+%D1%81%D0%B4%D0%B5%D0%BB%D0%B0%D0%BD+wowlikon+%D1%81+%D0%BD%D0%BE%D0%B2%D1%8B%D1%8B%D0%BC%D0%B8+%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8F%D0%BC%D0%B8%21%0A%0A%D0%A1%D0%B4%D0%B5%D0%BB%D0%B0%D0%BD%D0%BE+%D1%81+%E2%9D%A4%EF%B8%8F+%D0%BE%D1%82+swiftsoft"
|
||||
|
||||
.line 69
|
||||
invoke-virtual {v3, v11}, Landroid/app/AlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;
|
||||
|
||||
move-result-object v3
|
||||
|
||||
new-instance v11, Lcom/wowlikon/about/$4;
|
||||
new-instance v11, Lcom/swiftsoft/about/$4;
|
||||
|
||||
invoke-direct {v11}, Lcom/wowlikon/about/$4;-><init>()V
|
||||
invoke-direct {v11}, Lcom/swiftsoft/about/$4;-><init>()V
|
||||
|
||||
const-string v12, "\u041c\u044b \u0432 Telegram"
|
||||
|
||||
@@ -207,9 +207,9 @@
|
||||
|
||||
move-result-object v3
|
||||
|
||||
new-instance v11, Lcom/wowlikon/about/$3;
|
||||
new-instance v11, Lcom/swiftsoft/about/$3;
|
||||
|
||||
invoke-direct {v11}, Lcom/wowlikon/about/$3;-><init>()V
|
||||
invoke-direct {v11}, Lcom/swiftsoft/about/$3;-><init>()V
|
||||
|
||||
const-string v12, "\u041f\u043e\u043d\u044f\u0442\u043d\u043e"
|
||||
|
||||
@@ -229,13 +229,13 @@
|
||||
move-result-object v3
|
||||
|
||||
.line 75
|
||||
new-instance v11, Lcom/wowlikon/about/$1;
|
||||
new-instance v11, Lcom/swiftsoft/about/$1;
|
||||
|
||||
invoke-direct {v11}, Lcom/wowlikon/about/$1;-><init>()V
|
||||
invoke-direct {v11}, Lcom/swiftsoft/about/$1;-><init>()V
|
||||
|
||||
const/16 v12, 0x14
|
||||
|
||||
invoke-virtual {v11, v5, v12}, Lcom/wowlikon/about/$1;->oooooo(II)Lcom/wowlikon/about/$1;
|
||||
invoke-virtual {v11, v5, v12}, Lcom/swiftsoft/about/$1;->oooooo(II)Lcom/swiftsoft/about/$1;
|
||||
|
||||
move-result-object v5
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.class public Lcom/wowlikon/about/$3;
|
||||
.class public Lcom/swiftsoft/about/$3;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
# interfaces
|
||||
@@ -21,7 +21,7 @@
|
||||
.locals 1
|
||||
|
||||
.line 23
|
||||
invoke-virtual {p0, p1}, Lcom/wowlikon/about/$3;->oooooo(Ljava/lang/Object;)V
|
||||
invoke-virtual {p0, p1}, Lcom/swiftsoft/about/$3;->oooooo(Ljava/lang/Object;)V
|
||||
|
||||
const-string p1, "Dialog"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.class public Lcom/wowlikon/about/$4;
|
||||
.class public Lcom/swiftsoft/about/$4;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
# interfaces
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
.class public Lcom/wowlikon/authorization/AutoLogin;
|
||||
.class public Lcom/swiftsoft/authorization/AutoLogin;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
.class public Lcom/wowlikon/authorization/FirebaseDB;
|
||||
.class public Lcom/swiftsoft/authorization/FirebaseDB;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
.class public Lcom/wowlikon/authorization/Login;
|
||||
.class public Lcom/swiftsoft/authorization/Login;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
.class public Lcom/wowlikon/authorization/SaveLoginLocal;
|
||||
.class public Lcom/swiftsoft/authorization/SaveLoginLocal;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
Reference in New Issue
Block a user