AndFix热修复
来源:互联网 发布:高校教学软件行业 编辑:程序博客网 时间:2024/05/21 17:34
阿里官方开源项目及文档:AndFix
集成流程
1.添加依赖
dependencies {
compile 'com.alipay.euler:andfix:0.5.0@aar'
}
2.初始化
// 初始化patch管理类
mPatchManager = new PatchManager(context);
// 初始化patch版本
mPatchManager.init("1.0");
// 加载已经添加到PatchManager中的patch
mPatchManager.loadPatch();
3.添加补丁
public static void hotFix(String path){
//添加patch,只需指定patch的路径即可,补丁会立即生效
try {
mPatchManager.addPatch(path);
} catch (IOException e) {
e.printStackTrace();
Log.e("hotFix", "hotFix: "+e.getMessage() );
}
}
4.清除补丁
public static void clear(){
//删除所有已加载的patch文件
mPatchManager.removeAllPatch();
}
5.功能测试
public class Utils {
public void test(Context context){
Toast.makeText(context, "有BUG", Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "已修复", Toast.LENGTH_SHORT).show();
}
}
case R.id.test:
new Utils().test(this);
break;
case R.id.hotfix:
File file = new File(Environment.
getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/new.apatch");
if(file.exists()){
MainApplication.hotFix(file.getAbsolutePath());
KLog.e(file.getAbsolutePath());
}
else
Toast.makeText(this, "无补丁文件", Toast.LENGTH_SHORT).show();
break;
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
- AndFix 热补丁修复
- AndFix 热补丁修复
- AndFix热修复实现
- AndFix热修复问题
- andfix 热补丁修复
- 阿里巴巴andfix热修复
- AndFix热修复笔记
- Android 热修复-AndFix
- AndFix热修复Demo
- Android热修复---AndFix
- AndFix热补丁修复
- AndFix热修复
- Android 热修复 AndFix
- Android 热修复AndFix
- 热修复 AndFix
- AndFix 热修复使用
- Andfix热修复
- AndFix热修复
- DDD——战略建模(Strategic Modeling)和战术建模(Tactical Modeling)
- Ajax无刷新图片上传
- 缓存击穿之布隆过滤器bloom Filter实现方式
- ItemDecoration解析(二) onDraw onDrawOver
- 第九周项目1-二叉树算法库
- AndFix热修复
- Android 集成 FFmpeg (三) 获取 FFmpeg 执行进度
- HDU-1007-Quoit Design
- 防止SQL注入的五种方法
- 【Android】打印输出调用栈
- JMS消息队列
- #778 – 缩放变换动画(Animating a Scale Transform)
- 小怪生成和状态机
- 2017年泰国国际珠宝首饰展会刊(参展商名录)