forked from anixart-mod/patcher
исправление патча package_name
This commit is contained in:
+27
-27
@@ -35,20 +35,32 @@ def apply(config: dict) -> bool:
|
||||
except:
|
||||
pass
|
||||
|
||||
rename_dir(
|
||||
"./decompiled/smali/com/swiftsoft/anixartd",
|
||||
os.path.join(
|
||||
"./decompiled", "smali", config["new_package_name"].replace(".", "/")
|
||||
),
|
||||
)
|
||||
rename_dir(
|
||||
"./decompiled/smali_classes2/com/swiftsoft/anixartd",
|
||||
os.path.join(
|
||||
"./decompiled",
|
||||
"smali_classes2",
|
||||
config["new_package_name"].replace(".", "/"),
|
||||
),
|
||||
)
|
||||
if os.path.exists("./decompiled/smali/com/swiftsoft/anixartd"):
|
||||
rename_dir(
|
||||
"./decompiled/smali/com/swiftsoft/anixartd",
|
||||
os.path.join(
|
||||
"./decompiled", "smali", config["new_package_name"].replace(".", "/")
|
||||
),
|
||||
)
|
||||
if os.path.exists("./decompiled/smali_classes2/com/swiftsoft/anixartd"):
|
||||
rename_dir(
|
||||
"./decompiled/smali_classes2/com/swiftsoft/anixartd",
|
||||
os.path.join(
|
||||
"./decompiled",
|
||||
"smali_classes2",
|
||||
config["new_package_name"].replace(".", "/"),
|
||||
),
|
||||
)
|
||||
if os.path.exists("./decompiled/smali_classes4/com/swiftsoft"):
|
||||
rename_dir(
|
||||
"./decompiled/smali_classes4/com/swiftsoft",
|
||||
os.path.join(
|
||||
"./decompiled",
|
||||
"smali_classes4",
|
||||
"/".join(config["new_package_name"].split(".")[:-1]),
|
||||
),
|
||||
)
|
||||
|
||||
# rename_dir(
|
||||
# "./decompiled/smali_classes3/com/swiftsoft/anixartd",
|
||||
# os.path.join(
|
||||
@@ -57,17 +69,7 @@ def apply(config: dict) -> bool:
|
||||
# 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)
|
||||
@@ -77,7 +79,7 @@ def apply(config: dict) -> bool:
|
||||
with open(file_path, "r", encoding="utf-8") as file:
|
||||
file_contents = file.read()
|
||||
|
||||
new_contents = new_contents.replace(
|
||||
new_contents = file_contents.replace(
|
||||
"com/swiftsoft",
|
||||
"/".join(config["new_package_name"].split(".")[:-1]),
|
||||
)
|
||||
@@ -86,8 +88,6 @@ def apply(config: dict) -> bool:
|
||||
except:
|
||||
pass
|
||||
|
||||
os.rmdir("./decompiled/smali_classes2/com/swiftsoft")
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user