[Soot-list] Android Studio and Soot

Ladislav Dorotík ladislavdorotik at gmail.com
Tue Jan 12 03:25:27 EST 2021


Hello guys,

I am czech student and I need to integrate Soot software under Android
native app (I have added dependencies, imported libs). My goal is to create
call graph from an APK file inside android device. I can get APK
information, as permissions, activities and so on, but I need to create
call graph, for which I want use soot (ideal in dot format), then use it to
compare the graph to database of graphs.

My problem is with platforms directory:

I have encountered situations where nothing for platforms directory works.
I have tried to locate platform dir just from SDK location of android
studio, I have tried to locate it in my project (as jar), even on the
sdcard - I have tried that with the jars from the android studio, but also
with jars from Sable Github <https://github.com/Sable/android-platforms>.

I am really stuck because everything I try ends with errors in the
attachment - directory does not exist, but well it exists for sure.

I have discovered one weird behavior which can be the reason. This is my
path to platformDir:
 String androidJarPath = "C:\\Users\\ladis\\AppData\\Local\\Android\\Sdk\\
platforms";
But in the error, the path appears with "/" at the start, so that may be
some collision, so I have tried to locate the path only with "/", but same
error appeared.
I have tried to load it from sources, so the "/" character is matching the
way of working with paths, then my path looked like "/platforms/" (with
downloaded jar files of android OSs), but that does not working at all.
I have tried to load android-jar even from the sd card, but the same error
showed up. I wanted to substitute the path in your android-infoflow, so the
software cant adds the first "/", but these are read-only jars.

I have also tried to change Paths, so the path was like "C:\\Users\\ladis\\
AppData\\Local\\Android\\Sdk\\platforms\\Android-30";   and "C:\\Users\\
ladis\\AppData\\Local\\Android\\Sdk\\platforms\\Android-30\\android.jar",
which I suppose is not the right way, but I was so depressed, that I had to
try everything.

For me, it appears like two options -
1. Is it possible, that my SDK/platforms folder must be for example android
16 because newer ones can produce this error?
2. Is it possible, that soot is adding this one "/" character at the start
which makes the collision?
I am absolutely helpless. I haven't found such a powerful framework as soot
- as it can create callgraph from apk, but this is something I haven't
expected. There must be some way to make it work.

I had also seen in GitHub issues, that lot of commands are deprecated and
new ones are used, for example Infoflow Config. I am probably using old
code, or something that I am not using at all. For example on old github
issues there are set sources and sinkns with method called on
SetupApplication object, but this method cant be found in class source
files.

I found this framework really attractive and powerful, but building it with
Android Studio is kinda problematic, even the dependencies from maven was
causing problems, but that was solved by manually adding jar files into
/libs folder, like in IntelliJ for example.

I appreciate your work and hope for finding the problem.

Yours sincerely,
Ladislav Dorotík
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20210112/e21216d4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sootPlatforms2.PNG
Type: image/png
Size: 31615 bytes
Desc: not available
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20210112/e21216d4/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sootPlatforms.PNG
Type: image/png
Size: 26790 bytes
Desc: not available
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20210112/e21216d4/attachment-0003.png>


More information about the Soot-list mailing list