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

新的包运行时某些机型出现SuperNotCalledException #289

Closed wuxinrong1981415 closed 6 years ago

wuxinrong1981415 commented 6 years ago

异常类型:app运行时异常

app运行时,个别机型出现SuperNotCalledException导致崩溃

手机型号: Z60/Z70/小米 MI MAX 2等

手机系统版本: 5.0 、7.x都有

Robust版本: 0.4.82

Gradle版本:2.3.2

系统:如:Mac

堆栈/日志:

public final void d(Bundle paramBundle) { ChangeQuickRedirect localChangeQuickRedirect = a; Class localClass = Void.TYPE; if (PatchProxy.proxy(new Object[] { paramBundle }, this, localChangeQuickRedirect, false, 9267, new Class[] { Bundle.class }, localClass).isSupported) { return; } super.d(paramBundle); ((com.yxcorp.gifshow.activity.f)j()).a(this.b); }

反编译release包,查看对应出错的方法,没有加载patch,Robust插桩代码仍然进入if判断,且if条件为真,导致return;导致super.d(paramBundle)方法没有调用。

mivanzhang commented 6 years ago

if条件为真,补丁应该是打上了,你可以检查一下 补丁中 补丁方法的唯一编号,是不是补丁中方法编号 刚好和错误堆栈中方法编号相同,打上了错误的补丁

wuxinrong1981415 commented 6 years ago

@mivanzhang 昨天分析定位一天,终于找到原因了。确实是打上了补丁。也就是新版本打上了老版本的补丁。 原因是补丁是分版本号目录存放的,但是调用系统api方法PackageInfo.getPackageInfo()时,在某些机型上会发生异常。我们封装该方法时catch了,此时返回空串。这样,就导致老版本上加载补丁后,补丁存在了一个基准目录,用户升级到新版本后,由于无法获取到的版本号目录是基准目录后的空目录,也就是基础目录本身,因此就加载了老版本的补丁。

再次感谢

mivanzhang commented 6 years ago

You are welcome