brazdil / dexter

1 stars 1 forks source link

APUT_OBJECT changed to APUT #20

Closed brazdil closed 11 years ago

brazdil commented 11 years ago

The Test_ArrayPut_NULL class contains the following method:

.method public execute(Ljava/lang/Object;)V
    .registers 3

    check-cast p1, [Ljava/lang/Object;

    const/4 v0, 0x0
    const/4 v1, 0x0
    aput-object v0, p1, v1

    return-void

.end method

Recompilation (with instrumentation), however, changes the array instruction to simple 'aput', which makes the class fail verification... Instrumentation doesn't change the instruction at all - simply wraps it with TRY/CATCH and adds one more instruction after, so it must be the compiler thinking that v0 is an integer. CodeAnalyzer correctly analyzes the code before instrumentation, as the const/4 v0, 0x0 instruction is correctly instrumented as NULL.

Test APK: https://www.dropbox.com/s/jpj37evl1nigos1/Dexter_Issue20.apk

brazdil commented 11 years ago

Might be related to the Google Keep phi issue...

xurubin commented 11 years ago

Hopefully fixed in d6a7530. It was a very silly one as I treated null reference as Integer type.

After this fix that test apk is throwing another exception which I think is related to some instrumenting code.

brazdil commented 11 years ago

Great! Looks like it's working! What exception is it throwing for you? I just tried the Dexter_Issue20.apk file and it both instruments and verifies. Unfortunately, running the tests from command line doesn't work, because it fails on executing native methods, just like we talked about. I also enabled the original test in the latest code and it works nicely. :-) So I think this should be closed...

xurubin commented 11 years ago

Yes it is the native println thing, in which case I'll close this issue.