Closed flankerhqd closed 9 years ago
Dex compiled out can be transformed successfully.
This is a misunderstanding. You class file references Android-specific exception types, but on your Soot classpath, you only have a Java JDK due to the -pp command-line option. This means that Soot is unable to resolve these exception types and cannot build a hierarchy from them.
In your code, there is an exception handler for multiple types. In such a case, Soot needs to find a common super type for all those exceptions to apply to the exception local. This however fails as there is no hierarchy.
The only thing we could do is to check if one of the exception types is a phantom class, and, if so, always use java.lang.Throwable as the type of the exception local. This could however get us into situation in which we produce invalid code. Assume that closest original common base class of two exceptions caught with the same handler is not java.lang.Throwable, but some class A. In that case, it would be totally valid to call some method a.foo() on the exception local as all exceptions caught there must be of type A or one of its subtypes. If we assign Throwable as a type to get away from situation in which we don't know the proper type, we would have a call to Throwable.foo() which would be invalid.
@StevenArzt Thanks for your explaination!
Hi: I encoutered the following exceptions when running soot on compiled android source's bytecode.
Command line is as follows, reproduced with lasted nightly build of soot java -jar soot-trunk.jar -process-dir classes.jar -pp -allow-phantom-refs
classes.jar can be found at http://tool.flanker017.me/classes.jar, which is actually compiled out from android framework.