Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APUT_OBJECT changed to APUT #20

Closed
brazdil opened this issue Aug 30, 2013 · 4 comments
Closed

APUT_OBJECT changed to APUT #20

brazdil opened this issue Aug 30, 2013 · 4 comments

Comments

@brazdil
Copy link
Owner

brazdil commented Aug 30, 2013

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
Copy link
Owner Author

brazdil commented Aug 30, 2013

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

@brazdil brazdil closed this as completed Aug 30, 2013
@brazdil brazdil reopened this Aug 30, 2013
@xurubin
Copy link
Collaborator

xurubin commented Sep 1, 2013

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
Copy link
Owner Author

brazdil commented Sep 2, 2013

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
Copy link
Collaborator

xurubin commented Sep 2, 2013

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

@xurubin xurubin closed this as completed Sep 2, 2013
brazdil added a commit that referenced this issue Sep 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants