Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复加固模式构建出的patch包客户端加载不了的bug #1534

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

ChanJLee
Copy link

@ChanJLee ChanJLee commented Mar 4, 2021

bug产生的场景

old apk有5个dex,classes.dex ... classes4.dex, new apk 有6 个dex, classes.dex ... classes5.dex。当计算classes5.dex的变更的时候,因为classes5.dex没有在old apk中存在,所以就直接把classes5.dex写入最终的patch包中了

相关日志如下:

DexDecoder:add newly dex file: 
DexDecoder:write meta file data: classes5.dex,,81d839f97245fb1ea48fb6e2ed387c94,81d839f97245fb1ea48fb6e2ed387c94,0,0,3963140505,raw

当开启加固模式时,patch的构建需要计算出变更的类有哪些,当变更的类比较多且产生大于6个dex文件的时候,可能会覆写之前的classes5.dex,最终导致客户端在加载patch时验证dex的md5失败。

相关日志:

DexDecoder:write changed classes dex meta file data:
classes.dex,,e2ebdecaf1636729cd40465079f0e1b2,e2ebdecaf1636729cd40465079f0e1b2,0,0,0,jar
classes2.dex,,26a6391a44fdb810caf60cb39ea388e1,26a6391a44fdb810caf60cb39ea388e1,0,0,0,jar
classes3.dex,,2d3ae5cc031e81a394ad48c284ba31ba,2d3ae5cc031e81a394ad48c284ba31ba,0,0,0,jar
classes4.dex,,6bd67e2f3b4fd8645392de908622f20f,6bd67e2f3b4fd8645392de908622f20f,0,0,0,jar
classes5.dex,,8255f4a31fc4c6f89951ee8baa637d3c,8255f4a31fc4c6f89951ee8baa637d3c,0,0,0,jar
classes6.dex,,7e56dac5cb76af12743ed7b2ec432971,7e56dac5cb76af12743ed7b2ec432971,0,0,0,jar
classes7.dex,,cba6b04d063e1e59eff87c2896cfd888,cba6b04d063e1e59eff87c2896cfd888,0,0,0,jar
classes8.dex,,45311a240a4c4db61ee51a361030b9ae,45311a240a4c4db61ee51a361030b9ae,0,0,0,jar

patch中的dex_meta.txt

classes5.dex,,81d839f97245fb1ea48fb6e2ed387c94,81d839f97245fb1ea48fb6e2ed387c94,0,0,3963140505,jar
classes.dex,,6b1ea167ee2d5d063f82e381e535ac98,6b1ea167ee2d5d063f82e381e535ac98,0,0,0,jar
classes2.dex,,2d3ae5cc031e81a394ad48c284ba31ba,2d3ae5cc031e81a394ad48c284ba31ba,0,0,0,jar
classes3.dex,,7e56dac5cb76af12743ed7b2ec432971,7e56dac5cb76af12743ed7b2ec432971,0,0,0,jar
classes4.dex,,45311a240a4c4db61ee51a361030b9ae,45311a240a4c4db61ee51a361030b9ae,0,0,0,jar
classes5.dex,,6bd67e2f3b4fd8645392de908622f20f,6bd67e2f3b4fd8645392de908622f20f,0,0,0,jar
classes6.dex,,e2ebdecaf1636729cd40465079f0e1b2,e2ebdecaf1636729cd40465079f0e1b2,0,0,0,jar
classes7.dex,,cba6b04d063e1e59eff87c2896cfd888,cba6b04d063e1e59eff87c2896cfd888,0,0,0,jar
classes8.dex,,8255f4a31fc4c6f89951ee8baa637d3c,8255f4a31fc4c6f89951ee8baa637d3c,0,0,0,jar

test.dex,,56900442eb5b7e1de45449d0685e6e00,56900442eb5b7e1de45449d0685e6e00,0,0,0,jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant