Skip to content
This repository was archived by the owner on Jul 27, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/obfuscapk/obfuscators/class_rename/class_rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def transform_package_name(self, manifest_xml_root: Element):
self.encrypted_package_name = ".".join(
[self.encrypt_identifier(token) for token in self.package_name.split(".")]
)

# Rename package name in manifest file.
manifest_xml_root.set("package", self.encrypted_package_name)
manifest_xml_root.set(
Expand Down Expand Up @@ -314,7 +314,7 @@ def obfuscate(self, obfuscation_info: Obfuscation):
obfuscation_info.get_resource_directory()
)
for file_name in file_names
if file_name.endswith(".xml") and "layout" in root # Only layout files.
if file_name.endswith(".xml") and ("layout" in root or "xml" in root) # Only res/layout-*/ and res/xml-*/ folders.
)
xml_files.add(obfuscation_info.get_manifest_file())

Expand Down
5 changes: 4 additions & 1 deletion src/obfuscapk/obfuscators/method_rename/method_rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def rename_method_invocations(
smali_files: List[str],
methods_to_rename: Set[str],
android_class_names: Set[str],
classes_to_ignore: List[str],
interactive: bool = False,
):
for smali_file in util.show_list_progress(
Expand All @@ -192,6 +193,7 @@ def rename_method_invocations(
("direct" in invoke_type or "static" in invoke_type)
and method in methods_to_rename
and class_name not in android_class_names
and not any(cls in class_name for cls in classes_to_ignore)
):
method_name = invoke_match.group("invoke_method")
out_file.write(
Expand Down Expand Up @@ -233,7 +235,8 @@ def obfuscate(self, obfuscation_info: Obfuscation):
obfuscation_info.get_smali_files(),
renamed_methods,
android_class_names,
obfuscation_info.interactive,
util.get_libs_to_ignore(),
obfuscation_info.interactive
)

except Exception as e:
Expand Down