Skip to content

Commit

Permalink
Minify release builds and strip logging (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesdemers authored Oct 10, 2023
1 parent 845638f commit 90b2022
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion template/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ react {
/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false
def enableProguardInReleaseBuilds = true

/**
* The preferred build flavor of JavaScriptCore (JSC)
Expand Down
14 changes: 12 additions & 2 deletions template/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@

# Add any project specific keep options here:

# com.mypackage should match the package value in your app/src/main/AndroidManifest.xml file.
-keep class com.mypackage.BuildConfig { *; }
# com.projectname should match the package value in your app/src/main/AndroidManifest.xml file.
-keep class com.projectname.BuildConfig { *; }
-keepresources string/build_config_package

# Strip logging from production builds
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int i(...);
public static int w(...);
public static int d(...);
public static int e(...);
}

0 comments on commit 90b2022

Please sign in to comment.