Posts

Showing posts with the label deployment

How to obfuscate Flutter apps?

Flutter's wiki mentions obfuscation is an opt-in in release mode. And yet, the flutter build command has no relevant option - see: flutter help -v build apk Am I missing something here? Did they make obfuscation the default? Is obfuscation even relevant for flutter? Any pointers on this would be very appreciated. At the moment obfuscation is not directly exposed via the flutter CLI. You can try to explicitly pass arguements to the gen_snapshot like this: flutter build --extra-gen-snapshot-options=--obfuscate,--save-obfuscation-map=build/symbols.json --release Note: that obfuscation support is not very well tested and might not work at the moment. Obfuscation is needed - a flutter app knows its function names, which can be shown using Dart's StackTrace class. There's under-tested support for obfuscation. To enable it: For Android: Add to the file [ProjectRoot]/android/gradle.properties : extra-gen-snapshot-options=--obfuscate For iOS: First, edit [FlutterRoot]/pac...