shwenzhang / AndResGuard

proguard resource for Android by wechat team
Apache License 2.0
8.55k stars 1.54k forks source link

In an Android application that contains multiple Dynamic Feature modules, AndResGuard will report an error #462

Open TYZRPVX opened 3 years ago

TYZRPVX commented 3 years ago

PROBLEM DESCRIPTION: In an Android application that contains multiple Dynamic Feature modules, AndResGuard will report an error, corresponding to the error stack:

PROBLEM ANALYSIS: By analyzing the resources.arsc binary file, it is found that in the binary block of the chunk type of RES_TABLE_TYPE of the ordinary application, the data distribution first exists in TYPE_LIBRARY, and then there is the data block of TYPE_SPEC_TYPE. In applications that include Dynamic Feature, TYPE_LIBRARY data blocks and TYPE_SPEC_TYPE data blocks will alternate, and the existing chunk parsing logic will throw an exception.

FIX PLAN: rewrite the parsing logic of TYPE_LIBRARY, TYPE_SPEC_TYPE data blocks into the form of a while loop to support the scene where two types of data blocks are mixed

VERIFICATION SITUATION: The resource confusion is normal, and it has been running normally on the mobile QQ pipeline for a long time, and the release version is also running stable

TYZRPVX commented 3 years ago

same as #435 #446