alibaba / alibaba/AndFix

AndFix不支持修改Activity中的private方法吗?

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

Description

我修改Activity中的private方法,在中兴G720T手机(4.4.4,dalvik)上测试通过,但在5.0以上的手机如oppo r9、米5、魅族pro5、华为honor7、三星S4手机上崩溃,报错如下,是不支持修改art模式的private方法吗?
AndroidRuntime: FATAL EXCEPTION: main
Process: com.ucs, PID: 14275
java.lang.IncompatibleClassChangeError: The method 'void com.app.activity.customer.CustomerListActivity_CF.a()' was expected to be of type direct but instead was found to be of type virtual (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
at com.app.activity.customer.CustomerListActivity.onResume(SourceFile:111)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1292)
at android.app.Activity.performResume(Activity.java:6160)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3176)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3223)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2575)
at android.app.ActivityThread.access$800(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1446)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5528)
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:952)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported IncompatibleClassChangeError in CustomerListActivity.onResume and compare the Dalvik and ART behavior described in the issue. Trace how AndFix handles private Activity methods on Android 5.0 and later; done means establishing whether this scenario is supported and documenting or addressing the confirmed cause.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.