Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potentially unintentional package name change during simplification #153

Closed
droidresearch opened this issue Dec 4, 2020 · 5 comments
Closed

Comments

@droidresearch
Copy link

Provide specific APK, DEX, or file hash
https://github.com/CalebFenton/simplify/blob/master/simplify/obfuscated-app.apk

Describe the bug
The awesome simplify project does simplify the code given in the example obfuscated app (WhiteNoise.java). However, there is a change to the package name as part of the simplification. This might be an unintentional as per the inventor of the project, the smalivm does not have the logic to rename the package name.

To Reproduce
java -jar simplify/build/libs/simplify.jar -it 'org/cf/obfuscated' -et 'MainActivity' simplify/obfuscated-app.apk

Attempted work-arounds
I have read the README and I am trying to read the code to understand whether I can contribute any root cause.

Screenshots
image

@CalebFenton
Copy link
Owner

Thanks for the issue @droidresearch. What you use for decompilation?

@droidresearch
Copy link
Author

Hi @CalebFenton, I used jadx-1.2 version (https://github.com/skylot/jadx/releases/tag/v1.2.0)

@CalebFenton
Copy link
Owner

I'm unable to reproduce the issue on a Mac. I don't think the issue is with simplify because in your example the unobfuscated app says the package was renamed from org.cf.obfuscated.WhiteNoise. This reads like Jadx renamed the package for some reason, and then probably semi-randomly renamed it again when you decompiled the simplified version.
Screen Shot 2020-12-08 at 3 04 27 PM

How'd you run jadx?

Closing, but feel free to continue commenting here.

@CalebFenton
Copy link
Owner

Ah, I think I see. This command produces the output you're seeing:

./jadx --deobf --deobf-min 3  ~/repos/simplify/obfuscated-app_simple.apk

And the relevant bits from the readme:

  --deobf                             - activate deobfuscation
  --deobf-min                         - min length of name, renamed if shorter, default: 3

jadx considers cf in the package name to be too short and is padding it as part of its deobfuscation logic.

@droidresearch
Copy link
Author

Thanks, @caleb.. This is interesting. I will check the decompiler’s default options and take a look at its deobf logic as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants