Debug School

rakesh kumar
rakesh kumar

Posted on

Flutter Obfuscation And Build Optimization

Referene1
Referene2
Referene3
Referene4
Referene5

Image description

Image description
Once we are done with the development of the app somethings are really important like code security, app size, and obfuscation. This blog will explain how you can obfuscate the application in flutter? and how the app size can be reduced in simple steps

In software development, obfuscation is the deliberate act of creating source or machine code that is difficult for humans to understand. This is done to deter reverse engineering which provides code in place and getting leak anywhere.

There are two ways to create a build and upload it to store

App Bundle
Apk
Enter fullscreen mode Exit fullscreen mode

You need to run the below commands as per your need, everyone has their own purpose.

For AppBundle:

Without splitting:

flutter build appbundle --obfuscate --split-debug-info=/<directory>
Enter fullscreen mode Exit fullscreen mode

Splitting:

flutter build appbundle --target-platform android-arm,android-arm64,android-x64 --obfuscate --split-debug-info=/<directory>
Enter fullscreen mode Exit fullscreen mode

For APK:

Without splitting:

flutter build apk --obfuscate --split-debug-info=/<directory>
Enter fullscreen mode Exit fullscreen mode

Splitting:

flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi --obfuscate --split-debug-info=/<directory>
Enter fullscreen mode Exit fullscreen mode

The / can be replaced with the relative path of the project or exact location.

Ex:

./ProjectFolderName/debug(It will create ProjectFolderName folder inside your project directory)
/Users/apple/Desktop/items/debug (It will be specific path of folder )
Enter fullscreen mode Exit fullscreen mode

Top comments (0)