Skip to content

Commit

Permalink
allow build apk when key.properties file is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
X-Wei authored Apr 21, 2024
1 parent f0ea846 commit 1be60d7
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,25 @@ android {
}

signingConfigs {
release {
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
release {
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}
buildTypes {
release {
signingConfig signingConfigs.release
if (signingConfigs.release.storeFile) {
signingConfig signingConfigs.release
} else {
signingConfig signingConfigs.debug
}
}
}
}
Expand Down

0 comments on commit 1be60d7

Please sign in to comment.