简体   繁体   中英

Flutter build signed apk or appbundle with code obfuscation

I was looking for a way to obfuscate my Android APK/AppBundle, then I found this command :

flutter build apk --obfuscate --split-debug-info=/<project-name>/<directory>

But it doesn't have keystore information so I can't publish this file on the Google Play Console. Then, I found this post for building the app with keys but then it doesn't use obfuscation.

So, how do I build a release version of my app with Dart code obfuscation?

Obfuscate Code: We have 2 level for obfuscate your code:

  • Obfuscate for native code (Java, Kotlin), this config will at gradle file. you can read more at:

https://developer.android.com/studio/build/shrink-code

  • Obfuscate Dart code. (the same with your command)

https://docs.flutter.dev/deployment/obfuscate

You can obfuscate both Native Code and Dart Code.

Build release for APK.

  • If you don't have keystore to sign app, you can create it with this guide:

https://developer.android.com/studio/publish/app-signing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM