From a0c2d12eeb887b272908c382f4bf95f75128e063 Mon Sep 17 00:00:00 2001 From: ZhanGSKen Date: Sun, 15 Mar 2026 15:06:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BA=94=E7=94=A8=E5=AF=86?= =?UTF-8?q?=E9=92=A5=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3df93fef..81113866 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,6 +1,13 @@ plugins { id "com.android.application" } +// 读取秘钥配置文件 +// +def keyProps = new Properties() +def keyPropsFile = rootProject.file('appkey.keystore') +if (keyPropsFile.exists()) { + keyProps.load(new FileInputStream(keyPropsFile)) +} ext { // The packageVariant defines the bootstrap variant that will be included in the app APK. @@ -74,25 +81,38 @@ android { } } } - + + + // 配置签名 signingConfigs { + winboll { + keyAlias keyProps['keyAlias'] + keyPassword keyProps['keyPassword'] + storeFile keyProps['storeFile'] ? file(keyProps['storeFile']) : null + storePassword keyProps['storePassword'] + } + } + + /*signingConfigs { debug { storeFile file('testkey_untrusted.jks') keyAlias 'alias' storePassword 'xrj45yWGLbsO7W0v' keyPassword 'xrj45yWGLbsO7W0v' } - } + }*/ buildTypes { release { + signingConfig signingConfigs.winboll minifyEnabled true shrinkResources false // Reproducible builds proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { - signingConfig signingConfigs.debug + signingConfig signingConfigs.winboll + //signingConfig signingConfigs.debug } }