ClaudiuGeorgiu / Obfuscapk

An automatic obfuscation tool for Android apps that works in a black-box fashion, supports advanced obfuscation features and has a modular architecture easily extensible with new techniques
MIT License
1.09k stars 285 forks source link

class_rename incorrectly replaced the command #162

Closed Haoxiqiang closed 9 months ago

Haoxiqiang commented 1 year ago

I found an incorrectly replaced sample. If a smali file line has a defined const-string and the string length is 1. class_rename will replace all chars class_rename/class_rename.py#L196

line = line.replace(
    string_match.group("string_value"),
    dot_rename_transformations[
        string_match.group("string_value")
    ],
)

line_before: const-string v1, "r" line_after:
const-stp4b43b0aeing v1, "p4b43b0ae"