添加签名,解锁release

This commit is contained in:
2020-11-26 15:26:44 +08:00
parent d89c845e4c
commit 3530c5762f

View File

@@ -16,6 +16,10 @@ apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'
android {
lintOptions {
checkReleaseBuilds false
abortOnError false
}
compileSdkVersion COMPILE_SDK
buildToolsVersion BUILD_TOOLS_VERSION
@@ -28,9 +32,46 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
//签名
signingConfigs {
debug {
storeFile file("src/doc/xueshibaoos.jks")
storePassword "123456"
keyAlias "xueshibaoos"
keyPassword "123456"
v2SigningEnabled false
}
release {// 签名文件
storeFile file("src/doc/xueshibaoos.jks")
storePassword "123456"
keyAlias "xueshibaoos"
keyPassword "123456"
v2SigningEnabled false
}
}
buildTypes {
debug {
// 显示Log
buildConfigField "boolean", "LOG_DEBUG", "true"
versionNameSuffix "-debug"
minifyEnabled false
//Zipalign优化
zipAlignEnabled true
signingConfig signingConfigs.debug
}
release {
// 不显示Log
buildConfigField "boolean", "LOG_DEBUG", "false"
//混淆
minifyEnabled false
//Zipalign优化
zipAlignEnabled true
//前一部分代表系统默认的android程序的混淆文件该文件已经包含了基本的混淆声明后一个文件是自己的定义混淆文件
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//签名
signingConfig signingConfigs.release
// 将release版本的包名重命名加上版本及日期
}
}
@@ -74,16 +115,16 @@ android {
}
// Disable release builds for now
android.variantFilter { variant ->
if (variant.buildType.name.endsWith('release')) {
variant.setIgnore(true)
}
// Icon recents is Go only
if (name.contains("WithQuickstepIconRecents") && !name.contains("l3go")) {
variant.setIgnore(true)
}
}
// android.variantFilter { variant ->
// if (variant.buildType.name.endsWith('release')) {
// variant.setIgnore(true)
// }
//
// // Icon recents is Go only
// if (name.contains("WithQuickstepIconRecents") && !name.contains("l3go")) {
// variant.setIgnore(true)
// }
// }
sourceSets {
main {