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 } }