tinker-support.gradle 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. apply plugin: 'com.tencent.bugly.tinker-support'
  2. def bakPath = file("${buildDir}/bakApk/")
  3. /**
  4. * 此处填写每次构建生成的基准包目录
  5. */
  6. def baseApkDir = "launcher-1224-16-13-43"
  7. /**
  8. * 对于插件各参数的详细解析请参考
  9. */
  10. tinkerSupport {
  11. // 开启tinker-support插件,默认值true
  12. enable = true
  13. autoGenerateTinkerId = true
  14. // 指定归档目录,默认值当前module的子目录tinker
  15. autoBackupApkDir = "${bakPath}"
  16. // 是否启用覆盖tinkerPatch配置功能,默认值false
  17. // 开启后tinkerPatch配置不生效,即无需添加tinkerPatch
  18. overrideTinkerPatchConfiguration = true
  19. // 编译补丁包时,必需指定基线版本的apk,默认值为空
  20. // 如果为空,则表示不是进行补丁包的编译
  21. // @{link tinkerPatch.oldApk }
  22. baseApk = "${bakPath}/${baseApkDir}/launcher-release.apk"
  23. // 对应tinker插件applyMapping
  24. baseApkProguardMapping = "${bakPath}/${baseApkDir}/app-release-mapping.txt"
  25. // 对应tinker插件applyResourceMapping
  26. baseApkResourceMapping = "${bakPath}/${baseApkDir}/app-release-R.txt"
  27. // 构建基准包和补丁包都要指定不同的tinkerId,并且必须保证唯一性
  28. // tinkerId = "base-1.0.0"
  29. // tinkerId = "patch-1.0.2"
  30. // 构建多渠道补丁时使用
  31. // buildAllFlavorsDir = "${bakPath}/${baseApkDir}"
  32. // 是否启用加固模式,默认为false.(tinker-spport 1.0.7起支持)
  33. // isProtectedApp = true
  34. // 是否开启反射Application模式
  35. enableProxyApplication = false
  36. // 是否支持新增非export的Activity(注意:设置为true才能修改AndroidManifest文件)
  37. supportHotplugComponent = true
  38. }
  39. /**
  40. * 一般来说,我们无需对下面的参数做任何的修改
  41. * 对于各参数的详细介绍请参考:
  42. * https://github.com/Tencent/tinker/wiki/Tinker-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97
  43. */
  44. tinkerPatch {
  45. //oldApk ="${bakPath}/${appName}/app-release.apk"
  46. ignoreWarning = false
  47. useSign = true
  48. dex {
  49. dexMode = "jar"
  50. pattern = ["classes*.dex"]
  51. loader = []
  52. }
  53. lib {
  54. pattern = ["lib/*/*.so"]
  55. }
  56. res {
  57. pattern = ["res/*", "r/*", "assets/*", "resources.arsc", "AndroidManifest.xml"]
  58. ignoreChange = []
  59. largeModSize = 100
  60. }
  61. packageConfig {
  62. }
  63. sevenZip {
  64. zipArtifact = "com.tencent.mm:SevenZip:1.1.10"
  65. // path = "/usr/local/bin/7za"
  66. }
  67. buildConfig {
  68. keepDexApply = false
  69. //tinkerId = "1.0.1-base"
  70. //applyMapping = "${bakPath}/${appName}/app-release-mapping.txt" // 可选,设置mapping文件,建议保持旧apk的proguard混淆方式
  71. //applyResourceMapping = "${bakPath}/${appName}/app-release-R.txt" // 可选,设置R.txt文件,通过旧apk文件保持ResId的分配
  72. }
  73. }