soot-oss / soot

Soot - A Java optimization framework
GNU Lesser General Public License v2.1
2.83k stars 708 forks source link

java.lang.RuntimeException when trying to process WhatsApp.apk #282

Closed yongabc closed 9 years ago

yongabc commented 9 years ago

Steps to reproduce: 1.) ...

Files used to reproduce: ...

Soot version: trunk

Command line: --soot-classpath ./WhatsApp.apk: -d ./wout -android-jars /home/zy/adt/sdk/platforms -allow-phantom-refs -src-prec apk -ire -f J -process-dir ./WhatsApp.apk

Max Memory: 1820MB

Stack trace: java.lang.RuntimeException: tried to get nonexistent method <java.lang.NullPointerException: void (java.lang.String)> at soot.Scene.getMethod(Scene.java:619) at soot.dexpler.Util.addExceptionAfterUnit(Util.java:294) at soot.jimple.toolkits.typing.TypeAssigner.replaceNullType(TypeAssigner.java:185) at soot.jimple.toolkits.typing.TypeAssigner.internalTransform(TypeAssigner.java:118) at soot.BodyTransformer.transform(BodyTransformer.java:51) at soot.BodyTransformer.transform(BodyTransformer.java:58) at soot.BodyTransformer.transform(BodyTransformer.java:63) at soot.dexpler.DexBody.jimplify(DexBody.java:584) at soot.dexpler.DexMethod$1.getBody(DexMethod.java:149) at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:91) at soot.SootMethod.retrieveActiveBody(SootMethod.java:324) at soot.PackManager.retrieveAllBodies(PackManager.java:1135) at soot.PackManager.runPacksNormally(PackManager.java:458) at soot.PackManager.runPacks(PackManager.java:391) at soot.Main.run(Main.java:244) at soot.Main.main(Main.java:152)

StevenArzt commented 9 years ago

Please remove the APK file from Soot's classpath, it is sufficient to have it in process-dir. If you do not specify a manual classpath, Soot will use the default which should also resolve this issue.

@Alexandre-Bartel We should discuss again whether we can really assume to have android.jar on the classpath or should have some graceful default if it's not there.

yongabc commented 9 years ago

Thanks your reply, I removed the "--soot-classpath ./WhatsApp.apk:" from command line, however, a new situation appeared, the execution of soot does not terminate, it is blocked while printing "Warning: com.google.android.maps.Projection is a phantom class!"

I followed the page "http://www.abartel.net/dexpler/" to setup the soot system.

yongabc commented 9 years ago

It has finished after a long time.

Soot finished on Sat Oct 04 10:29:03 CST 2014 Soot has run for 849 min. 9 sec.

StevenArzt commented 9 years ago

Some apps take some time, but more than 800 minutes is definitely too long. Please assign more memory to Soot using the -Xmx JVM parameter, e.g. java -Xmx4g -jar soot-trunk.jar ...

tingsu commented 9 years ago

Hi, guys, I also encounter a similar problem. After i removed the APK file from Soot's classpath, it works.

StevenArzt commented 9 years ago

The new Soot builds cache the UnitGraph whever possible. This shoud alleviate the performance problem at least a bit.