-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtinker_support.gradle
89 lines (74 loc) · 2.44 KB
/
tinker_support.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
apply plugin: 'com.tencent.bugly.tinker-support'
//此处填写每次构建生产的基准包目录
def bakPath = file("${buildDir}/bakApk/")
//此处填写每次构建生产的基准包文件
def baseApkDir = "app-1128-16-46-21"
def isDebug(){
return true
}
def getBuildTypeName() {
return isDebug() ? "debug" : "release"
}
def getVersion() {
return "${appConfig.versionName}.${appConfig.versionCode}"
}
def getApkName() {
return "Upgrade-${getBuildTypeName()}-v${getVersion()}.apk"
}
def getRFileName() {
return "app-${getBuildTypeName()}-R.txt"
}
def getTinkerIdValue() {
return "app-${getVersion()}"
}
tinkerSupport {
//开启tinker-support插件,默认值true
enable = enableTinkerSupport
//自定归档目录,默认值当前module的子目录tinker
autoBackupApkDir = "${bakPath}"
//是否启用覆盖tinkerPatch配置功能,默认值false
//开启后,tinkerPatch配置不生效,即无需添加tinkerPatch
overrideTinkerPatchConfiguration = true
//编译补丁包,必须指定基准版本的apk
baseApk = "${bakPath}/${baseApkDir}/${getApkName()}"
//对应tinker插件applyMapping
// baseApkProguardMapping = "${bakPath}/${baseApkDir}/app-release-mapping.txt"
//对应tinker插件的applyResourceMapping
baseApkResourceMapping = "${bakPath}/${baseApkDir}/${getRFileName()}"
//构建基准包和补丁包都要指定不同的tinkerId,并且必须保持唯一性
tinkerId = getTinkerIdValue()
//构建多渠道补丁时使用
// buildAllFlavorsDir="${bakPath}/${baseApkDir}"
//是否启用加固模式,默认为false
isProtectedApp = true
//是否开启反射Application模式
enableProxyApplication = false
//是否支持新增非export的Activity(注意:设置为true才能修改AndroidManifest文件)
supportHotplugComponent = true
}
//一般,无需对下面的参数做任何修改
tinkerPatch {
ignoreWarning = false
useSign = true
dex {
dexMode = "jar"
pattern = ["classes*.dex",
"assets/secondary-dex-?.jar"]
loader = []
}
lib {
pattern = ["lib/*/*.so"]
}
res {
pattern = ["res/*", "r/*", "assets/*", "resources.arsc", "AndroidManifest.xml"]
ignoreChange = []
largeModSize = 100
}
packageConfig {}
sevenZip {
zipArtifact = "com.tencent.mm:SevenZip:1.1.10"
}
buildConfig {
keepDexApply = false
}
}