diff --git a/tinker-build/tinker-patch-lib/src/main/java/com/tencent/tinker/build/decoder/DexDiffDecoder.java b/tinker-build/tinker-patch-lib/src/main/java/com/tencent/tinker/build/decoder/DexDiffDecoder.java index 40b7f8fd..d6f18559 100644 --- a/tinker-build/tinker-patch-lib/src/main/java/com/tencent/tinker/build/decoder/DexDiffDecoder.java +++ b/tinker-build/tinker-patch-lib/src/main/java/com/tencent/tinker/build/decoder/DexDiffDecoder.java @@ -187,6 +187,17 @@ public boolean patch(final File oldFile, final File newFile) throws IOException, } catch (Exception e) { e.printStackTrace(); } + + // If is protechted app mode. + // Just collect current old dex file and corresponding new dex file for further processing. + if (config.mIsProtectedApp) { + hasDexChanged = true; + oldAndNewDexFilePairList.add(new AbstractMap.SimpleEntry<>(oldFile, newFile)); + if (oldFile != null && oldFile.exists() && oldFile.length() > 0) { + oldDexFiles.add(oldFile); + } + return true; + } // If corresponding new dex was completely deleted, just return false. // don't process 0 length dex