From 8d77942a6c4de1894a54266e1eefb9a06dab78a9 Mon Sep 17 00:00:00 2001 From: huangjian Date: Wed, 18 Aug 2021 14:23:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9E=83=E5=9C=BE=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=8F=92=E4=BB=B6(oppo=E6=B8=A0=E9=81=93=E4=BD=BF?= =?UTF-8?q?=E7=94=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 30 ++++++++++++++++++++++++++++-- app/proguard-rules.pro | 1 + build.gradle | 1 + core/build.gradle | 4 ++++ gradle.properties | 4 ++-- 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2cc71a578..044b0d9e2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,6 +6,8 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'com.huawei.agconnect' +apply plugin: 'android-junk-code' + android { compileSdkVersion 29 @@ -190,6 +192,10 @@ android { dimension 'default' } + oppo { + dimension 'default' + } + } buildToolsVersion = '28.0.3' @@ -259,7 +265,7 @@ dependencies { api(name: 'MiddleTierSDK-external-release-5.5.13874142', ext: 'aar') api(name: 'SecurityBodySDK-external-release-5.5.19', ext: 'aar') api(name: 'SecurityGuardSDK-external-release-5.5.14240408', ext: 'aar') - + //数字滚动效果 implementation 'com.github.YvesCheung:RollingText:1.2.3' // 引入原有第三方裁图源码,方便修改 @@ -293,7 +299,27 @@ dependencies { repositories { flatDir { - dirs 'aliyun-libs', 'quick-pass-libs','com.huawei.agconnect' + dirs 'aliyun-libs', 'quick-pass-libs', 'com.huawei.agconnect' } mavenCentral() } + +android.applicationVariants.all { variant -> + print("variant.name=" + variant.name) + switch (variant.name) {//变体名称,如果没有设置productFlavors就是buildType名称,如果有设置productFlavors就是flavor+buildType,例如(freeRelease、proRelease) + case "oppoRelease": + androidJunkCode.configMap.put(variant.name, { + packageBase = "com.mango.plugin.ui" //生成java类根包名 + packageCount = 30 //生成包数量 + activityCountPerPackage = 30 //每个包下生成Activity类数量 + excludeActivityJavaFile = false + //是否排除生成Activity的Java文件,默认false(layout和写入AndroidManifest.xml还会执行),主要用于处理类似神策全埋点编译过慢问题 + otherCountPerPackage = 50 //每个包下生成其它类的数量 + methodCountPerClass = 20 //每个类下生成方法数量 + resPrefix = "mango_" //生成的layout、drawable、string等资源名前缀 + drawableCount = 300 //生成drawable资源数量 + stringCount = 300 //生成string数量 + }) + break + } +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index a9042d003..464130449 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -440,4 +440,5 @@ -keep class com.zego.**{*;} +-keep class com.mango.plugin.**{*;} diff --git a/build.gradle b/build.gradle index 861c3a342..6b1479486 100644 --- a/build.gradle +++ b/build.gradle @@ -26,6 +26,7 @@ buildscript { classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.16' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.huawei.agconnect:agcp:1.3.1.300' + classpath "com.github.qq549631030:android-junk-code:1.0.7" } } diff --git a/core/build.gradle b/core/build.gradle index 95c5d8d16..8d03c529e 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -57,6 +57,10 @@ android { accompany { dimension 'default' } + + oppo { + dimension 'default' + } } buildToolsVersion = '28.0.3' diff --git a/gradle.properties b/gradle.properties index a0754c18e..3375adc96 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,5 +20,5 @@ with_jenkins=false #\u6253\u652F\u6301x86\u7684\u6A21\u62DF\u5668\u5305\u4F7F\u7528 ndk_abi_filters=arm -version_name=5.1.1 -version_code=511 \ No newline at end of file +version_name=3.3.0 +version_code=330 \ No newline at end of file