DroidAssist icon indicating copy to clipboard operation
DroidAssist copied to clipboard

如果目标方法中抛异常了,插入,替换等操作就无效了

Open fengyuwuzu526 opened this issue 1 year ago • 0 comments

如果我需要替换的方法是抛异常的,那么就无法替换,或者插入log等。 比如我想创建文件方法前后添加log 方法如下 public boolean createNewFile() throws IOException { SecurityManager security = System.getSecurityManager(); if (security != null) security.checkWrite(path); if (isInvalid()) { throw new IOException("Invalid file path"); } return fs.createFileExclusively(path); }

此时xml配置这样写 <MethodCall> <Source> void java.io.File.createNewFile() </Source> <TargetBefore> android.util.Log.e("@@@@@","java.io.FilecreateNewFile"); </TargetBefore> </MethodCall>

发现无效。

fengyuwuzu526 avatar May 10 '23 07:05 fengyuwuzu526