Skip to content
Merged
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
21 changes: 17 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
apply plugin: 'com.android.application'

import java.util.Base64

// Load keystore properties
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
Expand All @@ -24,10 +27,20 @@ android {
signingConfigs {
release {
if (keystorePropertiesFile.exists()) {
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
// Decode base64 keystore and create temporary file
def keystoreBase64 = keystoreProperties['RELEASE_KEYSTORE_BASE64']
if (keystoreBase64) {
def keystoreBytes = Base64.getDecoder().decode(keystoreBase64)
def keystoreFile = new File(project.rootDir, 'temp-keystore.jks')
keystoreFile.withOutputStream { it.write(keystoreBytes) }
storeFile keystoreFile
} else {
// Fallback to file path if not base64
storeFile file(keystoreProperties['RELEASE_KEYSTORE_PATH'])
}
storePassword keystoreProperties['RELEASE_STORE_PASSWORD']
keyAlias keystoreProperties['RELEASE_KEY_ALIAS']
keyPassword keystoreProperties['RELEASE_KEY_PASSWORD']
}
}
}
Expand Down