#766·smali

Seemingly illegal fill-array-data-payload is disassembled anyway

Author: jackwpaCreated May 1, 2020Updated May 19, 2025
Labelsnext-release

I recently encountered a dex file where a code portion of some initializer was disassembled as:

    :array
    nop
    .array-data 4
        0x123
        ....

That is, the fill-array-data-payload blob does not start with 0x300, as the specification says, but with a nop (so, 00 00), which is only then followed by 0x300. I did confirm this with a hex editor. So, it looks like baksmali skipped the NOP and parsed the subsequent array data as normal.

Is this legal? I crafted a similar file and ran it through dalvikvm on a production device. As expected, the verifier rejects it:

java.lang.VerifyError: Verifier rejected class ... [0xFFFFFFFF] unaligned array data table: at N, data offset N-1

So, which is right here? And does ART even apply the same verification that the dalvikvm tool does on a file?