109 lines
5.5 KiB
Groovy
109 lines
5.5 KiB
Groovy
allprojects { project ->
|
||
buildscript {
|
||
ext.booster_version = '3.1.0'
|
||
ext.plugin_version = "0.2.7"
|
||
|
||
repositories {
|
||
mavenLocal()
|
||
google()
|
||
mavenCentral()
|
||
jcenter()
|
||
maven { url 'https://oss.sonatype.org/content/repositories/public' }
|
||
}
|
||
|
||
dependencies {
|
||
// booster
|
||
classpath "com.didiglobal.booster:booster-gradle-plugin:$booster_version"
|
||
classpath "com.didiglobal.booster:booster-transform-shared-preferences:$booster_version"
|
||
classpath "com.didiglobal.booster:booster-transform-r-inline:$booster_version"
|
||
classpath "com.didiglobal.booster:booster-transform-br-inline:$booster_version"
|
||
classpath "com.didiglobal.booster:booster-transform-finalizer-watchdog-daemon:$booster_version"
|
||
classpath "com.didiglobal.booster:booster-transform-res-check:$booster_version"
|
||
classpath "com.didiglobal.booster:booster-transform-activity-thread:$booster_version"
|
||
|
||
// byteX
|
||
classpath "com.bytedance.android.byteX:base-plugin:${plugin_version}"
|
||
classpath "com.bytedance.android.byteX:const-inline-plugin:${plugin_version}"
|
||
classpath "com.bytedance.android.byteX:method-call-opt-plugin:${plugin_version}"
|
||
classpath "com.bytedance.android.byteX:access-inline-plugin:${plugin_version}"
|
||
}
|
||
}
|
||
repositories {
|
||
mavenLocal()
|
||
google()
|
||
mavenCentral()
|
||
jcenter()
|
||
maven { url 'https://oss.sonatype.org/content/repositories/public' }
|
||
}
|
||
|
||
project.afterEvaluate {
|
||
// apply plugin only with this init script
|
||
if (project.name == "app") {
|
||
project.apply plugin: 'com.didiglobal.booster'
|
||
|
||
project.apply plugin: "com.gh.gamecenter.plugin"
|
||
|
||
project.apply plugin: 'bytex'
|
||
project.apply plugin: 'bytex.const_inline' // inline 常量 https://github.com/bytedance/ByteX/blob/master/const-inline-plugin/README-zh.md
|
||
project.apply plugin: 'bytex.method_call_opt' // 移除 log https://github.com/bytedance/ByteX/blob/master/method-call-opt-plugin/README-zh.md
|
||
project.apply plugin: 'bytex.access_inline' // inline access https://github.com/bytedance/ByteX/blob/master/access-inline-plugin/README-zh.md
|
||
|
||
project.const_inline {
|
||
enable true
|
||
enableInDebug false
|
||
logLevel "INFO"
|
||
autoFilterReflectionField = true //使用插件内置的反射检查过滤掉可能的反射常量,建议为true
|
||
//supposesReflectionWithString = false //使用插件内置字符串匹配可能反射常量,建议为false
|
||
skipWithRuntimeAnnotation true //过滤掉带有运行时注解的常量,推荐true
|
||
skipWithAnnotations = [
|
||
//过滤掉被注解注释过的常量,包含class
|
||
"android/support/annotation/Keep",
|
||
]
|
||
whiteList = []
|
||
}
|
||
|
||
project.method_call_opt {
|
||
enable true
|
||
enableInDebug false
|
||
logLevel "DEBUG"
|
||
//是否在log中显示删除方法调用指令后的方法指令,一般调试时使用
|
||
showAfterOptInsLog false
|
||
//需要删除的方法配置
|
||
methodList = [
|
||
//下面的每一项配置必须严格按照数据配置,一个地方不对这一项不生效。
|
||
//class#method#desc
|
||
"android/util/Log#v#(Ljava/lang/String;Ljava/lang/String;)I",
|
||
"android/util/Log#v#(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I",
|
||
"android/util/Log#d#(Ljava/lang/String;Ljava/lang/String;)I",
|
||
"android/util/Log#d#(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I",
|
||
"android/util/Log#i#(Ljava/lang/String;Ljava/lang/String;)I",
|
||
"android/util/Log#i#(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I",
|
||
"android/util/Log#w#(Ljava/lang/String;Ljava/lang/String;)I",
|
||
"android/util/Log#w#(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I",
|
||
"android/util/Log#e#(Ljava/lang/String;Ljava/lang/String;)I",
|
||
"android/util/Log#e#(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I",
|
||
"android/util/Log#println#(ILjava/lang/String;Ljava/lang/String;)I",
|
||
|
||
"java/lang/Throwable#printStackTrace#()V",
|
||
"com/google/devtools/build/android/desugar/runtime/ThrowableExtension#printStackTrace#(Ljava/lang/Throwable;)V",
|
||
|
||
//项目中的方法
|
||
"com/lightgame/utils/Utils#log#(Ljava/lang/String;)V",
|
||
"com/lightgame/utils/Utils#log#(Ljava/lang/int;Ljava/lang/String;Ljava/lang/String;)V",
|
||
"com/lightgame/utils/Utils#log#(Ljava/lang/String;Ljava/lang/String;)V",
|
||
"com/lightgame/utils/Utils#log#(Ljava/lang/String;Ljava/lang/Object;)V",
|
||
"com/lightgame/utils/Utils#log#(Ljava/lang/Object;)V",
|
||
]
|
||
onlyCheckList = []
|
||
whiteList = []
|
||
}
|
||
|
||
project.access_inline {
|
||
enable true
|
||
enableInDebug false
|
||
logLevel "DEBUG"
|
||
}
|
||
}
|
||
|
||
}
|
||
} |