标签:
背景
我的项目里有andfix类库源码,你可以直接把源码导入到项目中,如下图所示
public class MainApplication extends Application { private static final String TAG = "euler"; private static final String APATCH_PATH = "/out.apatch"; private static final String DIR = "apatch";//补丁文件夹 /** * patch manager */ private PatchManager mPatchManager; @Override public void onCreate() { super.onCreate(); // initialize mPatchManager = new PatchManager(this); mPatchManager.init("1.0"); Log.d(TAG, "inited."); // load patch mPatchManager.loadPatch(); // Log.d(TAG, "apatch loaded."); // add patch at runtime try { // .apatch file path String patchFileString = Environment.getExternalStorageDirectory() .getAbsolutePath() + APATCH_PATH; mPatchManager.addPatch(patchFileString); Log.d(TAG, "apatch:" + patchFileString + " added."); } catch (IOException e) { Log.e(TAG, "", e); } } }
安卓热修复,android打补丁,不用发版本就能实时的解决一些线上版本的bug
标签:
原文地址:http://blog.csdn.net/qiushi_1990/article/details/51108698