HamiltonianCycle / ClassNameDeobfuscator

Simple script to parse through the .smali files produced by apktool and extract the .source annotation lines.
80 stars 12 forks source link

Change in Script if Possible #1

Open parind opened 7 years ago

parind commented 7 years ago

@HamiltonianCycle. I used your Python script its amazing. But I am trying to make it possible to rename the smali files to the .source header files. So as your script outputs as for example "u.aly.a.smali ==> u.aly.CCSQLMANAGER.smali" to somewhat like "a.smali|CCSQLMANAGER.smali". So if the output being saved to a txt file. The txt file can be used with BulkRenameUtility to Bulk rename. I am new to Python otherwise would have done this myself. Please can you help me.

HamiltonianCycle commented 7 years ago

Hey @parind, sorry for the delayed response here. I was quite surprised to see an issue on this repo, glad you find it useful.

I made a quick PR to add support for what I think you're asking, see #2. However, I haven't worked on this script since the day I posted it here a year and a half ago. Since then, I have switched computers and never bothered to setup apktool. Long story short, the changes I am proposing here are entirely untested.

While this is a pretty simple changeset, I don't want to just merge it without some validation. If you're still interested in these changes, could you check out the BulkOutput branch and validate the following:

  1. The script's output is the same as it was before when used like:

    python ClassNameDeobfuscator.py namespace.

  2. The script's output is in the format you need when used like:

    python ClassNameDeobfuscator.py -f bulk namespace

Once verified to be working in both cases (and as you need, of course), I'll merge the PR.

parind commented 7 years ago

----Terminal Start------ $ python ClassNameDeobfuscator.py -f bulk xyz.livenettv.stream [*] Deobfuscating class names from namespace xyz.livenettv.stream... Traceback (most recent call last): File "ClassNameDeobfuscator.py", line 102, in main() File "ClassNameDeobfuscator.py", line 99, in main deobfuscator.execute() File "ClassNameDeobfuscator.py", line 90, in execute self.walk_namespace_dir(namespace_dir) File "ClassNameDeobfuscator.py", line 81, in walk_namespace_dir message = self.format_message(filename, deobfuscated_name) TypeError: format_message() missing 1 required positional argument: 'deobfuscated' $ ------Terminal End-------

parind commented 7 years ago

@HamiltonianCycle Did you see the issue for the Bulk Output. I posted the issue some days before.