Treamz updates#2
Open
ljmatan wants to merge 8 commits into
Open
Conversation
This change ensures that when a method in a base class is obfuscated, all its overriding implementations in subclasses are renamed to the same obfuscated name. The previous implementation iterated through a flat list of method declarations, generating a new random name for each, which resulted in different names for a method and its overrides. The new implementation groups method declarations by their semantic element, generates a single obfuscated name for each group, and then applies that name to all declarations and references within that group. This maintains the semantic link between a method and its overrides, ensuring they are obfuscated consistently.
This commit addresses two issues: 1. **Constructor Renaming:** The obfuscator now correctly renames constructor declarations to match their enclosing class when the class itself is obfuscated. This fixes the 'constructor name must match enclosing class' error. This was achieved by adding to in to ensure the class name part of the constructor declaration is treated as a reference to the class. 2. **Ignore .gr.dart files:** Added a filter in to ignore files ending with during source collection. These are typically generated files and should not be obfuscated.
- Modified to introduce a new method in . This method filters declarations, ensuring only types are added to the collection for obfuscation.
- Updated all methods in , , and to use instead of directly adding to the collection.
- Corrected the initialization of in to use literal string names ('NoObfuscation', 'publicApi') for annotations, ensuring correctly prevents obfuscation for annotated classes.
- Adjusted SDK constraints in and to and downgraded to to resolve dependency conflicts with the current Dart SDK.
- Made Wrote 1/10 file /Users/dmytro/Developer/obfuscator/out/copy/example/lib/utils.dart iterations. Latest: ExampleUtility.
Wrote 2/10 file /Users/dmytro/Developer/obfuscator/out/copy/example/lib/main.dart iterations. Latest: ExampleUtility.
Wrote 3/10 file /Users/dmytro/Developer/obfuscator/out/copy/example/lib/main.dart iterations. Latest: SecretClass.
Wrote 4/10 file /Users/dmytro/Developer/obfuscator/out/copy/example/lib/main.dart iterations. Latest: SecretClass.
Wrote 5/10 file /Users/dmytro/Developer/obfuscator/out/copy/example/lib/api.dart iterations. Latest: ExampleAPi.
Wrote 6/10 file /Users/dmytro/Developer/obfuscator/out/copy/example/lib/api.dart iterations. Latest: ExampleAPi.
Wrote 7/10 file /Users/dmytro/Developer/obfuscator/out/copy/example/lib/api.dart iterations. Latest: ExampleAPi.
Wrote 8/10 file /Users/dmytro/Developer/obfuscator/out/copy/example/lib/src/private.dart iterations. Latest: ExamplePrivateClass.
Wrote 9/10 file /Users/dmytro/Developer/obfuscator/out/copy/example/lib/src/private.dart iterations. Latest: ExamplePrivateClass.
Wrote 10/10 file /Users/dmytro/Developer/obfuscator/out/copy/example/lib/src/private.dart iterations. Latest: ExamplePrivateClass. executable.
- Modified to re-enable obfuscation for variables (fields) by including types in the method. Method obfuscation remains disabled. - Added logic to in to exclude classes annotated with from obfuscation, similar to and annotated classes.
This commit addresses a modification detected in lib/src/generator.dart by git status. No functional changes were intended or made to this file during recent tasks. The modification is likely due to automatic formatting or tooling during dependency updates. Committing to clear the working directory status.
# Conflicts: # lib/src/config.dart
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.