Question

I am new on learning dalvik, and I want to dump out every instruction in dalvik. But there are still 3 instructions I can not get no matter how I write the code. They are 'not-int', 'not-long', 'const-string/jumbo'.

I written like this to get 'not-int' but failed:

int y = ~x;

Dalvik generated an 'xor x, -1' instead.

and I know 'const-string/jumbo' means that there is more than 65535 strings in the code and the index is 32bit. But when I decleared 70000 strings in the code, the compiler said the code was too long.

So the question is: how to get 'not-int' and 'const-string/jumbo' in dalvik by java code?

Was it helpful?

Solution

const-string/jumbo is easy. As you noted, you just need to define more than 65535 strings, and reference one of the later ones. They don't all need to be in a single class file, just in the same DEX file.

Take a look at dalvik/tests/056-const-string-jumbo, in particular the "build" script that generates a Java source file with a large number of strings.

As far as not-int and not-long go, I don't think they're ever generated. I ran dexdump -d across a pile of Android 4.4 APKs and didn't find a single instance of either.

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