|
| 1 | +/* |
| 2 | + * (C) Copyright 2019, ForgetSky. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +apply plugin: 'com.tencent.bugly.tinker-support' |
| 18 | + |
| 19 | +def bakPath = file("${buildDir}/bakApk/") |
| 20 | + |
| 21 | +/** |
| 22 | + * 此处填写每次构建生成的基准包目录 |
| 23 | + */ |
| 24 | +def baseApkDir = "app-0208-15-10-00" |
| 25 | + |
| 26 | +/** |
| 27 | + * 对于插件各参数的详细解析请参考 |
| 28 | + */ |
| 29 | +tinkerSupport { |
| 30 | + |
| 31 | + // 开启tinker-support插件,默认值true |
| 32 | + enable = true |
| 33 | + |
| 34 | + // 指定归档目录,默认值当前module的子目录tinker |
| 35 | + autoBackupApkDir = "${bakPath}" |
| 36 | + |
| 37 | + // 是否启用覆盖tinkerPatch配置功能,默认值false |
| 38 | + // 开启后tinkerPatch配置不生效,即无需添加tinkerPatch |
| 39 | + overrideTinkerPatchConfiguration = true |
| 40 | + |
| 41 | + // 编译补丁包时,必需指定基线版本的apk,默认值为空 |
| 42 | + // 如果为空,则表示不是进行补丁包的编译 |
| 43 | + // @{link tinkerPatch.oldApk } |
| 44 | + baseApk = "${bakPath}/${baseApkDir}/app-release.apk" |
| 45 | + |
| 46 | + // 对应tinker插件applyMapping |
| 47 | + baseApkProguardMapping = "${bakPath}/${baseApkDir}/app-release-mapping.txt" |
| 48 | + |
| 49 | + // 对应tinker插件applyResourceMapping |
| 50 | + baseApkResourceMapping = "${bakPath}/${baseApkDir}/app-release-R.txt" |
| 51 | + |
| 52 | + // 构建基准包和补丁包都要指定不同的tinkerId,并且必须保证唯一性 |
| 53 | + tinkerId = "base-1.0.1" |
| 54 | + |
| 55 | + // 构建多渠道补丁时使用 |
| 56 | + // buildAllFlavorsDir = "${bakPath}/${baseApkDir}" |
| 57 | + |
| 58 | + // 是否启用加固模式,默认为false.(tinker-spport 1.0.7起支持) |
| 59 | + // isProtectedApp = true |
| 60 | + |
| 61 | + // 是否开启反射Application模式.推荐false,但是会增加接入成本 |
| 62 | + enableProxyApplication = true |
| 63 | + |
| 64 | + // 是否支持新增非export的Activity(注意:设置为true才能修改AndroidManifest文件) |
| 65 | + supportHotplugComponent = true |
| 66 | + |
| 67 | +} |
| 68 | + |
| 69 | +/** |
| 70 | + * 一般来说,我们无需对下面的参数做任何的修改 |
| 71 | + * 对于各参数的详细介绍请参考: |
| 72 | + * https://github.com/Tencent/tinker/wiki/Tinker-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97 |
| 73 | + */ |
| 74 | +tinkerPatch { |
| 75 | + //oldApk ="${bakPath}/${appName}/app-release.apk" |
| 76 | + ignoreWarning = false |
| 77 | + useSign = true |
| 78 | + dex { |
| 79 | + dexMode = "jar" |
| 80 | + pattern = ["classes*.dex"] |
| 81 | + loader = [] |
| 82 | + } |
| 83 | + lib { |
| 84 | + pattern = ["lib/*/*.so"] |
| 85 | + } |
| 86 | + |
| 87 | + res { |
| 88 | + pattern = ["res/*", "r/*", "assets/*", "resources.arsc", "AndroidManifest.xml"] |
| 89 | + ignoreChange = [] |
| 90 | + largeModSize = 100 |
| 91 | + } |
| 92 | + |
| 93 | + packageConfig { |
| 94 | + } |
| 95 | + sevenZip { |
| 96 | + zipArtifact = "com.tencent.mm:SevenZip:1.1.10" |
| 97 | +// path = "/usr/local/bin/7za" |
| 98 | + } |
| 99 | + buildConfig { |
| 100 | + keepDexApply = false |
| 101 | + //tinkerId = "1.0.1-base" |
| 102 | + //applyMapping = "${bakPath}/${appName}/app-release-mapping.txt" // 可选,设置mapping文件,建议保持旧apk的proguard混淆方式 |
| 103 | + //applyResourceMapping = "${bakPath}/${appName}/app-release-R.txt" // 可选,设置R.txt文件,通过旧apk文件保持ResId的分配 |
| 104 | + } |
| 105 | +} |
0 commit comments