[flutter_tools] wire up complete support for Dart obfuscation#50509
[flutter_tools] wire up complete support for Dart obfuscation#50509jonahwilliams merged 12 commits intoflutter:masterfrom
Conversation
|
How would deobfuscating work? Also |
|
Discussed offline a bit: the obfuscation does not apply to the debug symbols, so the workflow is the same for |
| argParser.addFlag(FlutterOptions.kDartObfuscationOption, | ||
| help: 'In a release build, this flag removes identifiers and replaces them ' | ||
| 'with randomized values for the purposes of source code obfuscation. The ' | ||
| 'mapping between the values and the original identifiers is stored the ' |
There was a problem hiding this comment.
is stored the -> is stored in the
| help: 'In a release build, this flag removes identifiers and replaces them ' | ||
| 'with randomized values for the purposes of source code obfuscation. The ' | ||
| 'mapping between the values and the original identifiers is stored the ' | ||
| 'symbol map created with the "--split-debug-info" option. For an app built ' |
There was a problem hiding this comment.
What happens when someone passes --obfuscate but not --split-debug-info?
There was a problem hiding this comment.
We don't output the obfuscation map. I think this is okay for now, since we don't actually have a tool to de-obfuscate a stack trace, only flutter symbols. I can document that this should always be combined with split-debug-info
There was a problem hiding this comment.
If it should always be paired with --split-debug-info then it would be good to give an error otherwise, or fill in a default value for it, I think.
There was a problem hiding this comment.
Updated so that obfuscate requires split-debug-info
|
@zanderso did you have any more comments on this? |
…utter into add_obfuscation_support
|
How can I use this feature? I think I'm not getting it correctly. |
|
@jonahwilliams Can you please share steps to execute this feature? No updated has been posted on guide. |
|
I've filled an issue to update the documentation: flutter/website#3827 I also tried to make the
|
Description
Previously Dart obfuscation was supported in a somewhat ad-hoc fashion via extra-gen-snapshot-args for Android and tool source code modification for iOS (see https://github.com/flutter/flutter/wiki/Obfuscating-Dart-Code )
This PR adds "complete" support by wiring it up through the existing build flags and infrastructure in a similar manner to the split-debug-info flag.
#50043
My understanding of the obfuscation map is that it would only be necessary if the
--obfuscateflag is not combined with the--split-debug-infooption. In that case, we might be able to simplify this a bit by constraining obfuscate to require split-debug-info. The user still only has to track one auxiliary file and we in turn simplify the supported configuration. @zanderso for thoughts on command line usability.