This repository was archived by the owner on Jul 27, 2024. It is now read-only.
const_string_encryption: Don't create/modify static constructor when there's no code to add#96
Merged
ClaudiuGeorgiu merged 1 commit intoClaudiuGeorgiu:masterfrom May 17, 2021
Conversation
…there's no code to add Right now, even when there's no static string in a class, obfuscapk adds a static constructor (which is empty because there's no decryption code to add) and every single class in a project is modified because of this. This patch skips adding the static constructor when there's no code to add so only classes with static strings are modified.
techee
commented
May 16, 2021
| lines[static_constructor_line + 1] = "\t.locals 1\n" | ||
| lines[static_constructor_line + 2] = "\n{0}".format( | ||
| static_string_encryption_code | ||
| if static_string_encryption_code != "": |
Contributor
Author
There was a problem hiding this comment.
This if is actually the only change, the rest is just indentation.
Codecov Report
@@ Coverage Diff @@
## master #96 +/- ##
==========================================
- Coverage 77.73% 77.57% -0.16%
==========================================
Files 49 49
Lines 2452 2453 +1
Branches 485 486 +1
==========================================
- Hits 1906 1903 -3
- Misses 417 422 +5
+ Partials 129 128 -1
Continue to review full report at Codecov.
|
Owner
|
Thanks @techee! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Right now, even when there's no static string in a class, obfuscapk adds a static
constructor (which is empty because there's no decryption code to add) and every
single class in a project is modified because of this.
This patch skips adding the static constructor when there's no code to add
so only classes with static strings are modified.
I'm not sure how to run the unit tests so I don't know if they pass or not.