[Soot-list] Using a string to find an edge

Bodden, Eric eric.bodden at sit.fraunhofer.de
Sat Apr 11 03:27:28 EDT 2015


Hi Jason.

> Is it possible to create a Unit and a SootMethod from a given string?
> 
> So let's say I create a call graph from "class A".  And I have a list of possible methods that could exist in "class A" in basic string format ("methodA", "methodB", ...).
> 
> Is it possible to resolve if the edge exists by calling callgraph.findEdge(unit, sootmethod), using a newly created Unit and SootMethod that are derived from my string input?

No, not really. You have to use the actual unit of the code that resides in the Scene at the time the callgraph was created. You can fabricate a handle to the sootmethod, though, by using the appropriate methods to look up the method object in the Scene.

> I've read the documentation and it sounds like I can do this with a SootMethod, but the Unit creation is a bit unclear as it seems the Unit resolves to the Jimple notation.

Creating a somehow equivalent unit would not be sufficient. What are you trying to do anyway? Sounds like a very strange use case to have…

Cheers,
Eric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150411/5cabe5e9/attachment-0001.bin 


More information about the Soot-list mailing list