Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix proguard-rules.pro for fragment container view issue #20

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ apply plugin: 'androidx.navigation.safeargs.kotlin'
// Version components
ext.versionMajor = 1
ext.versionMinor = 2
ext.versionPatch = 6
ext.versionPatch = 7
ext.versionClassifier = "INTERNAL" // Change this to ALPHA, BETA, RC, or RELEASE as needed

// SDK versions
Expand All @@ -56,31 +56,26 @@ android {
versionName generateVersionName()
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

// Load local.properties file
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localProperties.load(new FileInputStream(localPropertiesFile))
}

def nasaApiKey = System.getenv("NASA_API_KEY") ?: localProperties['NASA_API_KEY'].toString()

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField 'String', 'NASA_API_KEY', "\"${nasaApiKey}\"" // remember to change for release
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

// Load local.properties file
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localProperties.load(new FileInputStream(localPropertiesFile))
}

def nasaApiKey = System.getenv("NASA_API_KEY") ?: localProperties['NASA_API_KEY'].toString()

buildTypes.each {
if (it.name == 'release') {
it.buildConfigField 'String', 'NASA_API_KEY', "\"${nasaApiKey}\"" // remember to change for release
} else {
it.buildConfigField 'String', 'NASA_API_KEY', "\"${nasaApiKey}\""
}
buildConfigField 'String', 'NASA_API_KEY', "\"${nasaApiKey}\""
}
}

Expand Down
8 changes: 8 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
# Serializables in the app
-keep public class * extends java.io.Serializable

-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

-keepclasseswithmembers class * {
public <init>(android.os.Parcel);
}

# Enums in the app
-keepclassmembers,allowoptimization enum * {
public static **[] values();
Expand Down
Loading