I'm trying to make a control flow graph with the soot API from an Android APK. I have read a lot but i feel a little bit helpless how to start from scratch. I'm using a nighty build of soot (downloaded here: https://ssebuild.cased.de/nightly/soot/lib/) because I read that version 2.5.0 is outdated. I found a lot with google, for example:
https://mailman.cs.mcgill.ca/pipermail/soot-list/2014-September/007303.html
First I need to load the Android APK file. On the link it's done with:
SetupApplication app = new SetupApplication(...)
But thats already the first problem, there is no SetupApplication in the nightly build soot.jar.
I did it with the command line, like here:
http://www.abartel.net/dexpler/
that worked almost, but building the control flow graph is only the first step. After that I have to manipulate the graphs and use it as an input for some other framework. So command line is no option for me. I would prefer to do it with Java!
Can someone help a soot newbie?
For getting call graph through Soot, try the Soot lib located at https://github.com/secure-software-engineering/soot-infoflow-android instead.
Then import soot.jimple.infoflow.android.SetupApplication in your Java source code.
Everything should be fine.
Related
I would like to get the path to the working directory of a specific process (for example for the PID of the process). I am Not Talking about the working or current Directory of the process where my Java Code is running. Its a simple task with Linux, but for Windows i cant find a proper solution. Furthermore, it would be nice, if its a Command or a Framework for Java, because i will need the path in my Code. I am not looking for the path to the executable, also Not for a solution with wmic or process explorer.
Already thanks for the help.
I already tried commands like tlist and wmic, but those solutions cant be utilize in my code. I am looking for a solution that i can use without special installations on Windows.
JNI and JNA provide means to call directly into native libraries from Java code, and it is feasible to use these to call out to Windows libraries.
There is a github project that appears to be close to the need: https://github.com/kohsuke/winp. Perhaps you can add the needed code and send up a pull request, or fork the project.
Note that any solution here is going to be windows-specific, meaning the application using it will not run on another platform. Given the nature of the question, that doesn't sound like it would ever be a concern.
How do I combine a standalone Java application with an Android application?
I have a piece of code taken from the Google quick start examples that perform a task that I can't seem to be able to combine with my activity source code.
I'm of course talking about the following Google example: Sheet API, if I just add it as a standalone class and tell Android Studio to run this application, before my Android application, then it will produce what the code is suppose to do.
If I try to copy and paste the exact code into one of my activities it will give a couple of problems. One is that it can not find my keystore, another is a threading issue which I understand, another being that it can not find the credentials (even if the file is present), the newTrustedTransport-method call will be an issue, the setDataStoreFactory-method call will be an issue, file creation even with the correct uses-permissions and so on.
What is going on in the background that would make exactly the same source code work in one instance and not the other? What do I not know about Android Studio, and how an Android project works in the background for me having these issues?
I had an idea that I could just keep this standalone application as it is and store a file with the result that this Sheet example would provide me. But, since I do not have enough experience with Android Studio I have no idea if the result will be available for the actual Android application once it was made into a release. Will it? I can't save the output file generated by the Sheet example, under the res-folder, under the app module for some reason (scope?).
With other words... Can I have a standalone application, that is tasked to run before the Android application, to gather data and it will be doing this EACH time the Android application is run on a client? I feel like it would be stupid if the IDE would present this like this would actually work but then when the application is made into a release then the standalone application will not "follow" and be part of the release...
If I could just combine the source codes, I will not be having this issue at all. No examples online, neither Github or Youtube can provide me with answers on how to do this. Many examples online provide me with source code that is either out of date or just not what I'm looking for, and I really hate Google's way of explaining things. Just look at how they give code examples under this page: Google API Client Library for Java, and not give a full example where they would fit into the a project. Maybe all I need to make everything work is to use the code under "The library runs on Android 4.0 or higher (#Beta)."
Im trying to get JOGL to work in Eclipse on my Mac but im having some issues; just to clarify I have never used JOGL before in my entire life so this whole thing is very new to me. Ive tried looking for some tutorials but they are all outdated/use different files on every website I go to.
So, I have downloaded the latest build from the JOGL site (jogamp-all-platforms.7z) and I have extracted it. I have a new project in Eclipse which I have just created, when I select 'Add JARs...' in User Libraries im only given the choice of '.classpath' or '.project' which doesn't seem to be an issue on any of the tutorials written. I was just wondering if im doing something wrong at this point?
It's explained
here in the official JogAmp wiki.
I'm looking for some sample code to reference of a slideshow built in android. I was looking at these and they seem perfect but they only offer the .apk to download. I want to be able to download and see all of the file so i can learn from them. Can anyone help me find similar code or be able to read these?
http://code.google.com/p/android-slideshow/
http://code.google.com/p/android-slideshow-widget/
In the Google code link of your question: check the tab labelled 'Source' and use subversion to get code out the the repository.
Peter,
The source is provided: http://code.google.com/p/android-slideshow/source/browse/#svn%2Ftrunk
Alternatively, you can checkout a copy of the software using subversion. follow the instructions here: http://code.google.com/p/android-slideshow/source/checkout
go to checkout tag, path is given over there , copy that path and run it in your linux terminal.it will download the code for you.
a friend of mine uses SCILAB for doing his mathematicall "homework" for his studies and he told me, that it should be possible to use Java source code diretly in SCILAB.
The background is that I presented my current Java project and I would like to plot this in 3D, but I haven't done graphical output so far. And he proposed to let SCILAB do the 3D plotting, because there are some ready to use plot scemes implented. But he couldn't tell me how to achive this, so that's why I'm here :).
So my first question is, if this is possible to directly use Java source code in SCILAB or at least to some kind of connection between both?
And how this is done! :)
Thank you in advance,
Andreas
in Netbeans first create a java project.
then go to properties of the project you have created and go to libraries..
in libraries "add jar"
now go to the scilab installed directory
scilab-->modules-->javasci-->jar
in that there will be jar file names javasci.jar
add this to library..
and you are done.
now go to your main file and check out import javasci.*;
and in main function
Scilab.exec("plot2d(1,3)");
you can see a scilab window
at least I found this http://www.scilab.org/product/man/compile_and_run_javasci.html
so it is possible, but I have some problems to get this to work in netbens and eclipse.
has anyone done this before?