From 3530c5762f0e3fa60ce31adaac027e218704cd8b Mon Sep 17 00:00:00 2001 From: Administrator <981964879@qq.com> Date: Thu, 26 Nov 2020 15:26:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AD=BE=E5=90=8D=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E9=94=81release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 61 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 3651c80..676e0d7 100644 --- a/build.gradle +++ b/build.gradle @@ -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 {