Question

I'm currently working on a Wrapper for Android, Which wraps an android apk with some DRM related stuff.. which are by the way Android activities..

The activities i had created worked perfectly when I tested them in an Emulator as well as on a Device.

I tried integrating it with an Application from our org's apps store... Steps below

Extracted the apk with apktool * Extracted class files with dex2jar * added the class files to an Eclipse android project as classes folder * Added the activity def from the original app manifest to my manifest * Compiled and Launched the app from eclipse*

Note : The activities I had created are working very fine.. They load complete their work and try to launch the game application i was using to Test Integration.

here's when I come across the VerifyError

11-20 22:44:07.670: W/System.err(281):     at
***java.lang.Thread.run(Thread.java:1096)
11-20 22:44:08.050: W/dalvikvm(281): VFY: register1 v0 type 12, wanted
10
11-20 22:44:08.050: W/dalvikvm(281): VFY: register1 v1 type 12, wanted
10
11-20 22:44:08.050: W/dalvikvm(281): VFY:  rejecting opcode 0x71 at
0x0016
11-20 22:44:08.050: W/dalvikvm(281): VFY:  rejected Lao;.a (Ldh;)I
11-20 22:44:08.050: W/dalvikvm(281): Verifier rejected class Lao;***
11-20 22:44:08.060: D/AndroidRuntime(281): Shutting down VM
11-20 22:44:08.060: W/dalvikvm(281): threadid=1: thread exiting with
uncaught exception (group=0x4001d800)
11-20 22:44:08.170: E/AndroidRuntime(281): FATAL EXCEPTION: main
11-20 22:44:08.170: E/AndroidRuntime(281): java.lang.VerifyError: ao
11-20 22:44:08.170: E/AndroidRuntime(281):     at
ca.jamdat.flight.trivialpursuit_hvga_eu.FlAndroidApp.onCreate(Unknown
Source)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2627)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
android.os.Handler.dispatchMessage(Handler.java:99)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
android.os.Looper.loop(Looper.java:123)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
android.app.ActivityThread.main(ActivityThread.java:4627)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
java.lang.reflect.Method.invokeNative(Native Method)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
java.lang.reflect.Method.invoke(Method.java:521)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-20 22:44:08.170: E/AndroidRuntime(281):     at
dalvik.system.NativeStart.main(Native Method)
Was it helpful?

Solution

And now I have worked around the problem..

The problem probably is dex2jar tool i used to extract the .class files from the apk (classes probably being corrupt).

I created smali files of my implementation and pasted them into smali folder of the actual application extracted using the apktool and loaded the classes using reflecion rather than directly importing them into my compiled bytecode.

Offfffffff resolved... :)

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