mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2024-11-16 04:42:17 +08:00
Fix: fix signing config
This commit is contained in:
parent
2f69985fe1
commit
b470dcc252
|
@ -30,7 +30,10 @@ android {
|
|||
named("release") {
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,6 +48,28 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
val signingFile = rootProject.file("keystore.properties")
|
||||
if (signingFile.exists()) {
|
||||
val properties = Properties().apply {
|
||||
signingFile.inputStream().use {
|
||||
load(it)
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
storeFile = rootProject.file(properties.getProperty("storeFile")!!)
|
||||
storePassword = properties.getProperty("storePassword")!!
|
||||
keyAlias = properties.getProperty("keyAlias")!!
|
||||
keyPassword = properties.getProperty("keyPassword")!!
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
named("release") {
|
||||
signingConfig = signingConfigs["release"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
dataBinding = true
|
||||
}
|
||||
|
@ -82,30 +107,6 @@ android {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs.apply {
|
||||
val signingFile = rootProject.file("keystore.properties")
|
||||
if ( signingFile.exists() ) {
|
||||
val properties = Properties().apply {
|
||||
signingFile.inputStream().use {
|
||||
load(it)
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
named("release") {
|
||||
storeFile = rootProject.file(Objects.requireNonNull(properties.getProperty("storeFile")))
|
||||
storePassword = Objects.requireNonNull(properties.getProperty("storePassword"))
|
||||
keyAlias = Objects.requireNonNull(properties.getProperty("keyAlias"))
|
||||
keyPassword = Objects.requireNonNull(properties.getProperty("keyPassword"))
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
named("release") {
|
||||
this.signingConfig = signingConfigs.findByName("release")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
|
Loading…
Reference in New Issue
Block a user