Meituan-Dianping / Meituan-Dianping/Robust

热更新方法的返回值类型不匹配 .VerifyError: Verifier rejected

Open
#314 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.5k
Forks
806
PR merge metrics
No merged PRs in 30d

Description

热更新补丁加载的时候失败了,报的错误:
W/System.err: java.lang.VerifyError: Verifier rejected class PatchManipulateImp.TemplateViewManagerPatch: android.widget.TextView PatchManipulateImp.TemplateViewManagerPatch.createAndGetOriginalTextView() failed to verify: android.widget.TextView PatchManipulateImp.TemplateViewManagerPatch.createAndGetOriginalTextView(): [0x5D9] returning 'Reference: java.lang.Object', but expected from declaration 'Reference: android.widget.TextView' (declaration of 'PatchManipulateImp.TemplateViewManagerPatch' appears in patch2.10.0_38.jar_temp.jar)

查看补丁文件代码:
发现生成的 TemplateViewManagerPatch.createAndGetOriginalTextView 方法返回类型为TextView但是方法内却返回Object类型的对象

实际部分补丁代码:
private TextView createAndGetOriginalTextView(View paramView, JsonCardViewHolder paramJsonCardViewHolder, MessageData paramMessageData)
{
Object localObject1;
Context localContext;
label57: Object localObject2;
label159: int i;
label223: Object localObject3;
label291: label307: label473: Object localObject4;
...
return localObject4; //此处为什么会返回Object类型的对象,而不是函数定义的TextView?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting PatchManipulateImp.TemplateViewManagerPatch.createAndGetOriginalTextView in patch2.10.0_38.jar_temp.jar and compare its declared return type with the generated return value. Trace the corresponding source method and patch-generation path; the issue is done when the generated method verifies with a TextView-compatible return type.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
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.