tinker-support.gradle 2.8 KB

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