Meituan-Dianping / Robust

Robust is an Android HotFix solution with high compatibility and high stability. Robust can fix bugs immediately without a reboot.
Apache License 2.0
4.41k stars 806 forks source link

方法构造函数被Proguard优化后。补丁无法正确反射构造函数,造成空指针。 #320

Open qStars opened 5 years ago

qStars commented 5 years ago

异常类型:app运行时异常

手机型号 Nexus 6p

手机系统版本:Android 5.0 - 9.0

Robust版本:0.4.82

Gradle版本:3.0.0

系统:Mac

//编码期默认方法签名 public SAdapter(Context context, List items, IMulItemViewType viewType) { super(context, items, viewType); }

//混淆,优化后。线上包中签名 public SAdapter(Context context, List items) { super(context, items, null); }

//补丁中反射调用函数 SAdapter sAdapter1 = (SAdapter)EnhancedRobustUtils. invokeReflectConstruct("com.test.adapter.SAdapter", getRealParameter(new Object[] { localContext,(List)EnhancedRobustUtils.getFieldValue("h", localObject5,SFragment.class),null }), new Class[] { Context.class, List.class, a.class });

//补丁之后因为找不到构造函数崩溃。