mirror of
https://github.com/izzy2lost/Starship.git
synced 2026-07-05 15:19:42 -07:00
try to fix release build - I over optimized it
This commit is contained in:
@@ -73,13 +73,12 @@ android {
|
||||
jniDebuggable false
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
// Use less aggressive ProGuard rules for native apps
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
|
||||
// R8 full mode is enabled by default in newer AGP versions
|
||||
|
||||
// Optimize native libraries
|
||||
// Keep some debug info for crash reports
|
||||
ndk {
|
||||
debugSymbolLevel 'NONE'
|
||||
debugSymbolLevel 'SYMBOL_TABLE'
|
||||
}
|
||||
|
||||
// Sign the release build
|
||||
|
||||
Vendored
+36
-10
@@ -1,9 +1,9 @@
|
||||
# Starship Android ProGuard Rules
|
||||
|
||||
# Keep SDL classes
|
||||
# Keep SDL classes - critical for native integration
|
||||
-keep class org.libsdl.app.** { *; }
|
||||
|
||||
# Keep native methods
|
||||
# Keep all native methods and JNI callbacks
|
||||
-keepclasseswithmembernames class * {
|
||||
native <methods>;
|
||||
}
|
||||
@@ -28,24 +28,50 @@
|
||||
# Keep DocumentFile for SAF
|
||||
-keep class androidx.documentfile.provider.DocumentFile { *; }
|
||||
|
||||
# Optimization settings
|
||||
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
|
||||
-optimizationpasses 5
|
||||
# Keep all classes that might be accessed via JNI
|
||||
-keep class * {
|
||||
public static <methods>;
|
||||
public static <fields>;
|
||||
}
|
||||
|
||||
# Keep enums - often used by native code
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
|
||||
# Keep Serializable classes
|
||||
-keepclassmembers class * implements java.io.Serializable {
|
||||
static final long serialVersionUID;
|
||||
private static final java.io.ObjectStreamField[] serialPersistentFields;
|
||||
private void writeObject(java.io.ObjectOutputStream);
|
||||
private void readObject(java.io.ObjectInputStream);
|
||||
java.lang.Object writeReplace();
|
||||
java.lang.Object readResolve();
|
||||
}
|
||||
|
||||
# Less aggressive optimization for native apps
|
||||
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*,!code/removal/advanced,!code/removal/simple
|
||||
-optimizationpasses 3
|
||||
-allowaccessmodification
|
||||
-dontpreverify
|
||||
|
||||
# Remove logging in release builds
|
||||
# Don't remove logging completely - keep error logs for crash reports
|
||||
-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(...);
|
||||
}
|
||||
|
||||
# Keep line numbers for crash reports
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
# Keep line numbers and source file for crash reports
|
||||
-keepattributes SourceFile,LineNumberTable,*Annotation*,Signature
|
||||
|
||||
# Rename source file attribute to something shorter
|
||||
# Rename source file attribute
|
||||
-renamesourcefileattribute SourceFile
|
||||
|
||||
# Don't warn about missing classes that might be platform-specific
|
||||
-dontwarn javax.**
|
||||
-dontwarn java.awt.**
|
||||
-dontwarn org.slf4j.**
|
||||
|
||||
Reference in New Issue
Block a user