assert "Dalvik".equals(System.getProperty("java.vm.name")); in dalvik.test
Hi, I am starting working with WALA for make an android static analysis tool. I wanted to ask how am I supposed to resolve this error, because if it seems that the framework is expected to run in a dalvik VM, but I just would like to analyze an apk on Ubuntu. Thanks in advance.
PS: there are some tutorials on WALA with Android more than https://github.com/wala/Examples, which have the same issue?
@Jacoppy we're going to need some more details on what exactly you're trying to do (exact commands, etc.) in order to understand the problem here.
I am just trying to run the dalvik tests and I get Assertion Error due to this : Dalvik".equals(System.getProperty("java.vm.name")); If you take for example com.ibm.wala.dalvik.drivers.APKCallGraphDriver.java I get this error when it tries to launch Util.androidLibs(); Am I supposed to provide specific libraries? Thanks
^ @juliandolby?
Maybe we need to better document what needs to be installed on the system to run the Dalvik tests. Our Travis config uses a base image with Android stuff installed, so I imagine you might need the SDK installed.
I have Android Studio installed in, I have just seend that the function libs in com.ibm.wala.dalvik.drivers.APKCallGraphDriver.java searches for actually some libraries into a folder libs. I tried to put inside the android.jar of different SDK version but I have other errors so I am not pretty sure what to do. Anyway I would need WALA for build up an Android slicer, there is maybe some usefull doc around? I really appreciate your help @msridhar . Thanks :)
I tried also to install the same version of your build tools, 26.0.2, and copy all the jars and dex inside that folder but now I have this issue:
using /tmp/name1264526317189494409_classes.dex
java.lang.NullPointerException: entry
at java.util.zip.ZipFile.getInputStream(ZipFile.java:361)
at java.util.jar.JarFile.getInputStream(JarFile.java:447)
at com.ibm.wala.dalvik.classLoader.DexFileModule.
@Jacoppy can you see if ./gradlew test :com.ibm.wala.dalvik.test:test works for you? Warning: it may download a lot of stuff (like its own copy of the SDK)
Yes this is my output: Parallel execution is an incubating feature.
BUILD SUCCESSFUL in 6m 11s 106 actionable tasks: 13 executed, 93 up-to-date
Ok so the tests pass! So how were you trying to run tests before? I think the solution will be in fixing config to be more like the Gradle build.
Well, I have tried both gradle and JUnit tests. Even if these gradle tests works, the JUnit have some issues, as the Assertion error I mentioned you in testJLex, com.ibm.wala.dalvik.test.callGraph.JVMLDalvikComparisonTest . I also tried to use /com.ibm.wala.dalvik.test/source/com/ibm/wala/dalvik/drivers/APKCallGraphDriver.java with another APK, not only the one tested and I got those errors. Same thing for the examples here : https://github.com/wala/Examples , after having imported the needed dependency and having customized the launcher with an apk of mine, it throws those errors. Maybe all these things are not needed but were the only materials I found on Android.
How are you running tests? In Eclipse? IntelliJ?
On Tue, Aug 28, 2018 at 11:30 AM Jacoppy [email protected] wrote:
Well, I have tried both gradle and JUnit tests. Even if these gradle tests works, the JUnit have some issues, as the Assertion error I mentioned you in testJLex, com.ibm.wala.dalvik.test.callGraph.JVMLDalvikComparisonTest . I also tried to use /com.ibm.wala.dalvik.test/source/com/ibm/wala/dalvik/drivers/APKCallGraphDriver.java with another APK, not only the one tested and I got those errors. Same thing for the examples here : https://github.com/wala/Examples , after having imported the needed dependency and having customized the launcher with an apk of mine, it throws those errors. Maybe all these things are not needed but were the only materials I found on Android.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wala/WALA/issues/346#issuecomment-416693110, or mute the thread https://github.com/notifications/unsubscribe-auth/AALyUYkq3NztVf_fPRXyU4VhNsQkPyxOks5uVYxHgaJpZM4WQBRc .
Eclipse
Being more precise, Eclipse photon on Ubuntu 18.04 .
Ok, I don't use Eclipse anymore. We'll need help from @juliandolby here
On Tue, Aug 28, 2018 at 11:37 AM Jacoppy [email protected] wrote:
Being more precise, Eclipse photon on Ubuntu 18.04 .
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wala/WALA/issues/346#issuecomment-416695182, or mute the thread https://github.com/notifications/unsubscribe-auth/AALyUWIgx3LMsnsRg27ku-rP8ofWc48Sks5uVY3QgaJpZM4WQBRc .
Okay, anyway the good thing is that all gradle tests work correctly. I'll keep digging into WALA for answers, but keep me updated please @msridhar @juliandolby . Thank you very much @msridhar and sorry for bothering.
No problem, glad to help!
On Tue, Aug 28, 2018 at 11:44 AM Jacoppy [email protected] wrote:
Okay, anyway the good thing is that all gradle tests work correctly. I'll keep digging into WALA for answers, but keep me updated please @msridhar https://github.com/msridhar @juliandolby https://github.com/juliandolby . Thank you very much @msridhar https://github.com/msridhar and sorry for bothering.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wala/WALA/issues/346#issuecomment-416697531, or mute the thread https://github.com/notifications/unsubscribe-auth/AALyUdPGs8LB0JseBmaCTpOr6L7wFVUDks5uVY-DgaJpZM4WQBRc .
@Jacoppy I am having a similar issue. Please email [email protected] if you were able to come up with a solution. Willing to work with you to resolve this issue.
Hey @baileynottingham , do the tests run for you? If I do not remember wrong, I had to compile everything using gradle by hand, project by project, more than using the final gradle wrapper. But if you need more assistance feel free to text me!
In order to actually help here, we need step-by-step instructions on how to reproduce.