Implement a whitelist for deobfuscation #2040
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The deobfucator of jadx usually obfuscates packages or classes like
android.support.v4.*
android.support.v7.*
android.support.v4.os.*
android.support.annotation.Px
androidx.core.os.*
androidx.annotation.Px
Reproducible with any app (obfuscated or not) which uses support libraries.
Of course those names could be renamed again, but wouldn't it be easier with a configurable whitelist for deobfucation and reasonable defaults of well known classes and packages?
My default list may not be complete and if the list gets much longer in the future it could be better to switch to a file based whitelist.
This PR is a duplicate of #765 which was rejected, because jadx can't identify libraries and marked as duplicate of #66. In my opinion the opposite is now true: With this PR jadx would be able to identify more libraries correctly when deobfuscation is enabled:
And library detection might be a first step towards automatic dependency detection as a precondition of #66.
Off topic question: Do you also accept also sample scripts as PR?