Open super-h-c opened 3 years ago
这是预期之内的。因为 dexdiff 为了减小 patch 信息的大小,同时节省在手机上还原新dex的内存开销,在diff的时候是没有按二进制一致来做差分的。按 dexdiff 的差分信息合成出来的新 dex 只在逻辑上和原 dex 保持一致,二进制内容大概率是不同的。
比方说两个 Codes 信息在新旧两个 Dex 里分别位于 offset 100 和 200 的位置,那旧 Dex 里用 offset 100 引用它和新 Dex 里用 offset 200 引用它在逻辑上就是一样的,但两个dex的二进制内容就会因为 100 变成 200 而产生变化。
这是预期之内的。因为 dexdiff 为了减小 patch 信息的大小,同时节省在手机上还原新dex的内存开销,在diff的时候是没有按二进制一致来做差分的。按 dexdiff 的差分信息合成出来的新 dex 只在逻辑上和原 dex 保持一致,二进制内容大概率是不同的。
比方说两个 Codes 信息在新旧两个 Dex 里分别位于 offset 100 和 200 的位置,那旧 Dex 里用 offset 100 引用它和新 Dex 里用 offset 200 引用它在逻辑上就是一样的,但两个dex的二进制内容就会因为 100 变成 200 而产生变化。
好的,感谢感谢,那如果需要保证二进制一致的话,在这个差分算法的基础上 有办法吗?
异常类型:patch合成后的dex与源newDex的md5不一样,
手机型号:无,电脑端测试
tinker版本:1.7.7
堆栈/日志: File oldDex = new File("Hello.dex");
对比2个dex,发现部分差异,2个dex的map_list偏移量不一样
MapListOffset赋值的地方,为什么不直接是newDex的mapOffset呢? this.patchedMapListOffset = this.patchedEncodedArrayItemsOffset