Closed limengyun2008 closed 6 years ago
比如有个类ClassA 里面有11个方法,插桩id分别为1-11
按照原来的逻辑,如果修复方法11。生成ClassAPatchControl的isSupport方法里应该是 "11:".contains(methodNo);
对于方法11返回true,这个没有问题 但对于方法1也返回true,那这个问题就大了
如果恰巧修复的是第一个分配ID的Class,这个问题复现的概率几乎是百分之百。因为一个类很容易就有11个方法
修复方案: 修改成 ":11:".contains(":" + methodNo + ":"); 这样似乎就安全了。
比如有个类ClassA 里面有11个方法,插桩id分别为1-11
按照原来的逻辑,如果修复方法11。生成ClassAPatchControl的isSupport方法里应该是 "11:".contains(methodNo);
对于方法11返回true,这个没有问题 但对于方法1也返回true,那这个问题就大了
如果恰巧修复的是第一个分配ID的Class,这个问题复现的概率几乎是百分之百。因为一个类很容易就有11个方法
修复方案: 修改成 ":11:".contains(":" + methodNo + ":");
这样似乎就安全了。