Question

Now I want to see what dose this instruction's every argument actually mean, but no mater what way I used to write java code and, I had never seen filled-new-array in dex:

int[] iArr1 = new int[5];//just a new-array
int[] iArr2 = {3, 4, 5, 6};//a "new-array" and "fill-array-data"

I think iArr2 should generate a filled-new-array and the elements are So, how to generate a filled-new-array instruction in dex file?

Every useful answer will be grateful!

Was it helpful?

Solution

The filled-new-array opcode is typically used when creating multi-dimensional arrays.

Either of the below should get you a filled-new-array instruction.

int[][] iiArr1 = new int[1][2];
int[][] iiArr2 = new int[][] { { 3, 4, 5, 6 }, { 7, 8, 9, 0} };

To find similar examples for other opcodes, I recommend looking at the tests for the dx tool, which have example java code to produce most opcodes. For example, this test has example java code that produces the filled-new-array opcode

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top