File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313.externalNativeBuild
1414.cxx
1515local.properties
16+
17+ # Signing keys - 签名密钥相关文件(请勿提交)
18+ keystore.properties
19+ * .jks
20+ * .keystore
Original file line number Diff line number Diff line change 1+ import java.util.Properties
2+
13plugins {
24 alias(libs.plugins.android.application)
35 alias(libs.plugins.kotlin.android)
46 alias(libs.plugins.kotlin.compose)
57 alias(libs.plugins.ksp)
68}
79
10+ // 读取 keystore.properties 文件
11+ val keystorePropertiesFile = rootProject.file(" keystore.properties" )
12+ val keystoreProperties = Properties ()
13+ if (keystorePropertiesFile.exists()) {
14+ keystoreProperties.load(keystorePropertiesFile.inputStream())
15+ }
16+
817android {
918 namespace = " com.mjn.puzzle"
1019 compileSdk = 35
@@ -19,13 +28,26 @@ android {
1928 testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
2029 }
2130
31+ // 签名配置
32+ signingConfigs {
33+ create(" release" ) {
34+ if (keystorePropertiesFile.exists()) {
35+ keyAlias = keystoreProperties.getProperty(" keyAlias" )
36+ keyPassword = keystoreProperties.getProperty(" keyPassword" )
37+ storeFile = rootProject.file(keystoreProperties.getProperty(" storeFile" ))
38+ storePassword = keystoreProperties.getProperty(" storePassword" )
39+ }
40+ }
41+ }
42+
2243 buildTypes {
2344 release {
2445 isMinifyEnabled = false
2546 proguardFiles(
2647 getDefaultProguardFile(" proguard-android-optimize.txt" ),
2748 " proguard-rules.pro"
2849 )
50+ signingConfig = signingConfigs.getByName(" release" )
2951 }
3052 }
3153 compileOptions {
You can’t perform that action at this time.
0 commit comments