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 = "KeepDancing-1228-18-08-25"
  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}/KeepDancing-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.2"
  29. // tinkerId = "1.0.4.100004_1228-18-08-28"
  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. }