From 1da78f2d9112419f57fd2211c181781482521ec8 Mon Sep 17 00:00:00 2001 From: "guillem.cordoba" Date: Thu, 5 Dec 2024 19:12:05 +0100 Subject: [PATCH] Added signing --- src-tauri/gen/android/.gitignore | 4 ++-- src-tauri/gen/android/app/build.gradle.kts | 23 ++++++++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src-tauri/gen/android/.gitignore b/src-tauri/gen/android/.gitignore index b248203..fcaa194 100644 --- a/src-tauri/gen/android/.gitignore +++ b/src-tauri/gen/android/.gitignore @@ -13,7 +13,7 @@ build .externalNativeBuild .cxx local.properties -key.properties +keystore.properties /.tauri -/tauri.settings.gradle \ No newline at end of file +/tauri.settings.gradle diff --git a/src-tauri/gen/android/app/build.gradle.kts b/src-tauri/gen/android/app/build.gradle.kts index 83b35ed..8161f2b 100644 --- a/src-tauri/gen/android/app/build.gradle.kts +++ b/src-tauri/gen/android/app/build.gradle.kts @@ -1,3 +1,4 @@ +import java.io.FileInputStream import java.util.Properties plugins { @@ -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" @@ -43,6 +61,7 @@ android { .plus(getDefaultProguardFile("proguard-android-optimize.txt")) .toList().toTypedArray() ) + signingConfig = signingConfigs.getByName("release") } } kotlinOptions { @@ -66,4 +85,4 @@ dependencies { androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0") } -apply(from = "tauri.build.gradle.kts") \ No newline at end of file +apply(from = "tauri.build.gradle.kts")