混淆pag资源

This commit is contained in:
luojian 2025-07-15 22:03:08 +08:00
parent f7888d5346
commit 1ea990a3b7
2 changed files with 12 additions and 3 deletions

View File

@ -68,6 +68,8 @@ lawn_layout = "res/layout".replace("/", os.sep)
qucikset_manifest = "quickstep/AndroidManifest-launcher.xml".replace("/", os.sep) qucikset_manifest = "quickstep/AndroidManifest-launcher.xml".replace("/", os.sep)
lawn_manifest = "AndroidManifest.xml".replace("/", os.sep) lawn_manifest = "AndroidManifest.xml".replace("/", os.sep)
pag_file = "lawnchair/assets/pag_wallpaper_slide.pag".replace("/", os.sep)
class ProjectProguard(Task): class ProjectProguard(Task):
def __init__(self, context: Context): def __init__(self, context: Context):
@ -146,6 +148,7 @@ class ProjectProguard(Task):
self.add_proguard_key("launcher_help") self.add_proguard_key("launcher_help")
self.add_proguard_key("launcher_uninstall") self.add_proguard_key("launcher_uninstall")
self.add_proguard_key("launcher_onboard") self.add_proguard_key("launcher_onboard")
self.add_proguard_key("pag_wallpaper_slide")
self.update_id(os.path.join(self.context.temp_project_path, lawn_layout)) self.update_id(os.path.join(self.context.temp_project_path, lawn_layout))
self.update_id(os.path.join(self.context.temp_project_path, layout_path)) self.update_id(os.path.join(self.context.temp_project_path, layout_path))
@ -176,6 +179,9 @@ class ProjectProguard(Task):
self.update_proguard(os.path.join(self.context.temp_project_path, lawn_layout)) self.update_proguard(os.path.join(self.context.temp_project_path, lawn_layout))
target_pag_file = os.path.join(self.context.temp_project_path, pag_file)
FileUtils.move(target_pag_file,
target_pag_file.replace("pag_wallpaper_slide", generate_encryption_key("pag_wallpaper_slide")))
pass pass

View File

@ -178,7 +178,7 @@ storePassword=123456
dst_path = os.path.join(self.context.temp_project_path, f"lawnchair{os.sep}assets") dst_path = os.path.join(self.context.temp_project_path, f"lawnchair{os.sep}assets")
for file in list(filter(lambda f: f != "google_fonts.json", os.listdir(dst_path))): for file in list(filter(lambda f: not (f == "google_fonts.json" or f == "pag_wallpaper_slide.pag"), os.listdir(dst_path))):
FileUtils.delete(os.path.join(dst_path, file), True) FileUtils.delete(os.path.join(dst_path, file), True)
pass pass
@ -188,8 +188,9 @@ storePassword=123456
with open(os.path.join(mainly_path, "tkg_config_mainly.properties"), 'rb') as f: with open(os.path.join(mainly_path, "tkg_config_mainly.properties"), 'rb') as f:
self.context.config = javaproperties.load(f) self.context.config = javaproperties.load(f)
if self.context.admob_app_id is None or self.context.admob_app_id == "": # 不打admob
self.context.admob_app_id = self.context.get_config("admob_id") # if self.context.admob_app_id is None or self.context.admob_app_id == "":
# self.context.admob_app_id = self.context.get_config("admob_id")
pass pass
def update_icon(self): def update_icon(self):
@ -383,10 +384,12 @@ plugins {
for i in range(3): for i in range(3):
try: try:
url = f"https://repo.dgtverse.cn/repository/tk_my/straw/hachisdk_unity_{self.context.package_name}/maven-metadata.xml" url = f"https://repo.dgtverse.cn/repository/tk_my/straw/hachisdk_unity_{self.context.package_name}/maven-metadata.xml"
print(url)
version = get_latest_version(url) version = get_latest_version(url)
if version: if version:
return version return version
except Exception as e: except Exception as e:
print(e)
pass pass
raise Exception("sdk prolink error.") raise Exception("sdk prolink error.")