alibaba / alibaba/AndFix

dalvik虚拟机可以测通,但在art上会报runtime error

Open
#274 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
7k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

首先感谢阿里集团及项目作者开源了这个项目,在测试过程中,我发现在api19 dalvik虚拟机上可正常跑通流程。但是在 api 22 art虚拟机上在 loadPatch后,进入修改页面时报错。

错误复现

protect void onCreate(){
//如果在此修改一行代码,会报 java.lang.NoSuchMethodError
andfixText();
}

protect void andfixTest(){
//在此修改一行代码,会报 java.lang.IncompatibleClassChangeError
}

//错误信息1
FATAL EXCEPTION: main
Process: com.example.hzligan.sdk, PID: 13249
java.lang.NoSuchMethodError: No super method onCreate(Landroid/os/Bundle;)V in class Lcom/lofter/in/activity/LofterInBaseActivity; or its super classes (declaration of 'com.lofter.in.activity.LofterInBaseActivity' appears in /data/app/com.example.hzligan.sdk-1/base.apk)
at com.lofter.in.activity.HomeProductListActivity_CF.onCreate(HomeProductListActivity.java:54)
at android.app.Activity.performCreate(Activity.java:6036)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2422)
at android.app.ActivityThread.access$800(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1319)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5313)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1116)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:809)

//错误信息2
java.lang.IncompatibleClassChangeError: The method 'void com.lofter.in.activity.HomeProductListActivity_CF.andfixtest()' was expected to be of type direct but instead was found to be of type virtual (declaration of 'com.lofter.in.activity.HomeProductListActivity' appears in /data/app/com.example.hzligan.sdk-1/base.apk)
at com.lofter.in.activity.HomeProductListActivity.onCreate(HomeProductListActivity.java:76)
at android.app.Activity.performCreate(Activity.java:6423)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2451)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2569)
at android.app.ActivityThread.access$900(ActivityThread.java:160)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1409)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:935)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:726)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported flow on API 19 Dalvik and API 22 ART, focusing on the loadPatch path and the modified onCreate and andfixtest methods. Investigate the reported NoSuchMethodError and IncompatibleClassChangeError; done means the patched app completes the modification flow on ART without either runtime error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.