Skip to content

Commit 294a499

Browse files
authored
更新 build.gradle.kts
1 parent 3eec61a commit 294a499

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

app/build.gradle.kts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,52 @@ android {
3333
abiFilters += listOf("arm64-v8a")
3434
}
3535
}
36+
37+
// ****** sign apk ******
38+
signingConfigs {
39+
create("releaseee") {
40+
val localProperties = Properties()
41+
val localPropertiesFile = rootProject.file("local.properties")
42+
enableV1Signing = true
43+
enableV2Signing = true
44+
enableV3Signing = true
45+
if (localPropertiesFile.exists()) {
46+
localProperties.load(FileInputStream(localPropertiesFile))
47+
48+
val storeFilePath = localProperties.getProperty("storeFile")
49+
val storePasswordValue = localProperties.getProperty("storePassword")
50+
val keyAliasValue = localProperties.getProperty("keyAlias")
51+
val keyPasswordValue = localProperties.getProperty("keyPassword")
52+
53+
if (storeFilePath != null && storePasswordValue != null &&
54+
keyAliasValue != null && keyPasswordValue != null) {
55+
storeFile = file(storeFilePath)
56+
storePassword = storePasswordValue
57+
keyAlias = keyAliasValue
58+
keyPassword = keyPasswordValue
59+
} else {
60+
logger.error("There is sth wrong with file content:local.properties !")
61+
}
62+
} else {
63+
logger.error("File not exist:local.properties !")
64+
}
65+
}
66+
}
67+
68+
buildTypes {
69+
debug {
70+
//signingConfig = signingConfigs.getByName("releaseee")
71+
//applicationIdSuffix '.debug'
72+
versionNameSuffix = "-debug"
73+
}
74+
release {
75+
signingConfig = signingConfigs.getByName("releaseee")
76+
77+
}
78+
}
79+
// ****** sign apk ******
80+
81+
3682
buildTypes {
3783
release {
3884
isMinifyEnabled = false // Enable code shrinking

0 commit comments

Comments
 (0)