Skip to content

Commit

Permalink
Added signing
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Dec 5, 2024
1 parent aa7a731 commit 1da78f2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src-tauri/gen/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build
.externalNativeBuild
.cxx
local.properties
key.properties
keystore.properties

/.tauri
/tauri.settings.gradle
/tauri.settings.gradle
23 changes: 21 additions & 2 deletions src-tauri/gen/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import java.io.FileInputStream
import java.util.Properties

plugins {
Expand All @@ -17,13 +18,30 @@ android {
compileSdk = 34
namespace = "studio.darksoil.messengerdemo"
defaultConfig {
manifestPlaceholders["usesCleartextTraffic"] = "false"
manifestPlaceholders["usesCleartextTraffic"] = "true"
applicationId = "studio.darksoil.messengerdemo"
minSdk = 24
targetSdk = 34
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
}

signingConfigs {
create("release") {
val keystorePropertiesFile = rootProject.file("keystore.properties")
val keystoreProperties = Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
}

keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["password"] as String
storeFile = file(keystoreProperties["storeFile"] as String)
storePassword = keystoreProperties["password"] as String
}
}


buildTypes {
getByName("debug") {
manifestPlaceholders["usesCleartextTraffic"] = "true"
Expand All @@ -43,6 +61,7 @@ android {
.plus(getDefaultProguardFile("proguard-android-optimize.txt"))
.toList().toTypedArray()
)
signingConfig = signingConfigs.getByName("release")
}
}
kotlinOptions {
Expand All @@ -66,4 +85,4 @@ dependencies {
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
}

apply(from = "tauri.build.gradle.kts")
apply(from = "tauri.build.gradle.kts")

0 comments on commit 1da78f2

Please sign in to comment.