ARM-software/workload-automation

Incompatibility of dexdump 30.0.X with some APKs

marcbonnici opened this issue · 1 comments

When using dexdump from android build tools v30.0.(1-3) some APKs do not generate valid XML causing subsequent parsing to fail.

E.g.

ParseError: not well-formed (invalid token): line 246835, column 8

An example of the dumped data to be parsed:

<field name="ZZ_ACTION_PACKED_0"
 type="java.lang.String"
 transient="false"
 volatile="false"
 static="true"
 final="true"
 visibility="private"
 value="�\C0\80�������������������&#x9;�&#xA;����&#xD;�\C0\80����������������\C0\80���\C0\80���\C0\80�����\C0\80��"
>

Cause of Issue

v30 of dexdump appears to try and extract additional classes some of which contain fields with incompatible values which are not escaped. The example in question is a constant defined in the Yylex class (https://artemis.ms.mff.cuni.cz/pogamut_files/javadoc/constant-values.html#cz.cuni.pogamut.Parser.Yylex.ZZ_ACTION_PACKED_0)

We need a way to filter and ignore invalid values to allow parsing to succeed.

Workaround

Downgrade android build tools to a version <30.0.0.