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.42k stars 807 forks source link

修复一个PatchControl类isSupport可能会多重匹配的bug。 #233

Closed limengyun2008 closed 6 years ago

limengyun2008 commented 6 years ago

比如有个类ClassA 里面有11个方法,插桩id分别为1-11

按照原来的逻辑,如果修复方法11。生成ClassAPatchControl的isSupport方法里应该是 "11:".contains(methodNo);

对于方法11返回true,这个没有问题 但对于方法1也返回true,那这个问题就大了

如果恰巧修复的是第一个分配ID的Class,这个问题复现的概率几乎是百分之百。因为一个类很容易就有11个方法

修复方案: 修改成 ":11:".contains(":" + methodNo + ":");
这样似乎就安全了。