use of com.taobao.atlas.update.util.PatchCleaner in project atlas by alibaba.
the class AtlasUpdater method update.
/**
* 更新主入口
* @param updateInfo 更新的基础信息
* @param patchFile tpatch包
* @throws MergeException
* @throws BundleException
*/
public static void update(UpdateInfo updateInfo, File patchFile) throws MergeException, BundleException {
MergeCallback mergeCallback = new MergeCallback() {
@Override
public void onMergeResult(boolean result, String bundleName) {
if (result) {
Log.d("[dexmerge]", "merge bundle " + bundleName + " success ");
} else {
Log.e("[dexmerge]", "merge bundle " + bundleName + " fail ");
}
}
};
PatchMerger patchMerger = new PatchMerger(updateInfo, patchFile, mergeCallback);
try {
patchMerger.merge();
} catch (IOException e) {
e.printStackTrace();
}
PatchInstaller patchInstaller = new PatchInstaller(patchMerger.mergeOutputs, updateInfo);
patchInstaller.install();
new PatchCleaner().clearUpdatePath(updateInfo.workDir.getAbsolutePath());
}
Aggregations