热修复 tinker接入及源码分析(11)


private static void patchDexFile(ZipFile baseApk, ZipFile patchPkg, ZipEntry oldDexEntry, ZipEntry patchFileEntry,ShareDexDiffPatchInfo patchInfo,File patchedDexFile) throws IOException {InputStream oldDexStream = null;InputStream patchFileStream = null;oldDexStream = new BufferedInputStream(baseApk.getInputStream(oldDexEntry));patchFileStream = (patchFileEntry != null ? new BufferedInputStream(patchPkg.getInputStream(patchFileEntry)) : null);new DexPatchApplier(oldDexStream, patchFileStream).executeAndSaveTo(patchedDexFile);}