update for release builds

This commit is contained in:
izzy2lost
2025-09-12 08:02:18 -04:00
parent d0045ddd0b
commit 55de53061a
2 changed files with 67 additions and 20 deletions
+7 -20
View File
@@ -12,7 +12,7 @@ android {
minSdk 26
targetSdk 36
versionCode 1
versionName "1.0"
versionName "1.0.0"
// APK
setProperty("archivesBaseName","PSX2_${versionCode}_${new Date().format('yyyyMMddHHmm')}")
@@ -22,39 +22,26 @@ android {
arguments(
'-DANDROID=true',
'-DCMAKE_BUILD_TYPE=Release',
'-DANDROID_STL=c++_static'
'-DANDROID_STL=c++_static',
'-DPCSX2_PROFILER=OFF'
)
// arguments '-DANDROID=true','-DCMAKE_BUILD_TYPE=Debug','-DANDROID_STL=c++_static'
}
}
ndk {
//noinspection ChromeOsAbiSupport
abiFilters 'arm64-v8a'
}
// Placeholder to toggle profileable per buildType (for AGI)
manifestPlaceholders = [
profileable: "false"
]
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
ndk {
// Keep symbol table for crash triage while testing
debugSymbolLevel 'SYMBOL_TABLE'
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
// Build for profiling with Android GPU Inspector
benchmark {
// Release-like build, not debuggable, but profileable
initWith release
debuggable false
// Use debug keystore to simplify installs
signingConfig signingConfigs.debug
// Turn on profileable in manifest via placeholder
manifestPlaceholders = [ profileable: "true" ]
}
}
// Relax lint for test release builds
+60
View File
@@ -0,0 +1,60 @@
# PSX2 Emulator ProGuard Rules
# Keep native methods
-keepclasseswithmembernames class * {
native <methods>;
}
# Keep NativeApp class and all its methods (JNI interface)
-keep class com.izzy2lost.psx2.NativeApp {
public static <methods>;
}
# Keep MainActivity for proper lifecycle
-keep class com.izzy2lost.psx2.MainActivity {
public <methods>;
}
# Keep all classes that might be referenced from native code
-keep class com.izzy2lost.psx2.** { *; }
# Keep Glide for image loading
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep class * extends com.bumptech.glide.module.AppGlideModule {
<init>(...);
}
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
-keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
*** rewind();
}
# Keep Material Design components
-keep class com.google.android.material.** { *; }
-keep interface com.google.android.material.** { *; }
# Keep AndroidX components
-keep class androidx.** { *; }
-keep interface androidx.** { *; }
# Remove logging in release 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(...);
}
# Optimize and obfuscate
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
# Keep line numbers for crash reports
-keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute SourceFile