准备
在APP的build.gradle文件中,添加依赖:
apply plugin: 'com.android.application'
//制作补丁时将这个打开,auto-patch-plugin紧跟着com.android.application
//apply plugin: 'auto-patch-plugin'
apply plugin: 'robust'
compile 'com.meituan.robust:robust:0.4.99'
在整个项目的build.gradle中加入
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.meituan.robust:gradle-plugin:0.4.99'
classpath 'com.meituan.robust:auto-patch-plugin:0.4.99'
}
}
将robust.xml文件拷到src同级目录:
image.png
实现PatchManipulate.java和RobustCallBack.java两个接口
PatchManipulate.java说明:
/**
* Created by hedex on 16/6/20.