[Soot-list] 回复:AW: 回复:AW: Incomplete CallGraph

qpj 412832527 at qq.com
Mon Jul 14 07:45:20 EDT 2014


Hi Steven,


I use your AndroidEntryPointConstants as entry point which you can see in the attachment. It seems CallGraph can reach methods in subclass of android.app.Activity, but can not reach subClass of other android class, such as android.widget.AdapterView$OnItemClickListener, for I find you take android.app.Activity as entry point. So if I'd like to reach method in onClickListener, does it means I need build a generateListenerLifecycle(Set<String> entryPoints,SootClass currentClass,JNopStmt endClassStmt,Local classLocal) method?


Best regads,
Xiangxing




------------------ 原始邮件 ------------------
发件人: "Steven Arzt";<Steven.Arzt at cased.de>;
发送时间: 2014年7月14日(星期一) 下午5:12
收件人: "qpj"<412832527 at qq.com>; "'soot-list'"<soot-list at sable.mcgill.ca>; 

主题: AW: 回复:AW: [Soot-list] Incomplete CallGraph




Hi Xiangxing,

 

Soot should be able to consider the onClick() handle ras reachable. What does your entry point look like? How do you construct it? SPARK starts from the entry point you supply and will only find methods that are transitively reachable from there.

 

Best regards,

  Steven

 

Von: qpj [mailto:412832527 at qq.com] 
Gesendet: Freitag, 11. Juli 2014 18:27
An: Steven Arzt; soot-list
Betreff: 回复:AW: [Soot-list] Incomplete CallGraph

 

Hi Steven,‍


Thank you for reply. I checked Scene.v().getReachableMethods().contains(myMethod) and found the result is false.‍


Actually my analysis code is about Android's Listener.


Class A{


public void onCreate(){


         listView.setOnClickListener(new onClickListener(


                 public onClick(View v){


                          showDocument()
                 }));


}


public void showDocument(){
//To Do


}


}


Does it mean Scene cannot reach to onClick()? If yes, do you have any idea of getting the source method of showDocument()? ‍


 


Best regards,


Xiangxing


 


 


------------------ 原始邮件 ------------------


发件人: "Steven Arzt";<Steven.Arzt at cased.de>;


发送时间: 2014年7月11日(星期五) 晚上11:20


收件人: "qpj"<412832527 at qq.com>; "'soot-list'"<soot-list at sable.mcgill.ca>; 


主题: AW: [Soot-list] Incomplete CallGraph



 


Hi Xiangxing,

 

Please check whether the method containing the calls for which you do not find any callees in the callgraph is itself marked as reachable. If a method a() calls a method b(), you only get a corresponding call graph edge if a() is reachable in the first place. The check is easy: Scene.v().getReachableMethods().contains(myMethod).

 

If this is ok, then make sure that there is a constructor call for base object on which you invoke the method. Take the following example:

 

A a = new A();

a.foo();

 

In this case, there will be a call edge to A.foo(). But if you take the following example and assume that the factory method “makeA” is a phantom method for which we do not have a body, there will not be a callgraph edge:

 

A a = makeA();

a.foo();

 

Best regards,

  Steven

 

Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA] Im Auftrag von qpj
Gesendet: Freitag, 11. Juli 2014 17:13
An: soot-list
Betreff: [Soot-list] Incomplete CallGraph

 

Hi All,


When I use 


Iterator<MethodOrMethodContext> targets = new Targets(cg.edgesOutOf(sm));


I found sm do not have any targets if sm is a method came from a class whose name contains $(like cz.romario.opensudoku.gui.FileListActivity$2).


                                   


My code:


for(SootClass sootClass:Scene.v().getClasses()){


            if(sootClass.getName().startsWith("cz.romario.opensudoku.gui.FileListActivity")){                                               


                        innList.add(sootClass);


            }          


}


for(SootClass sc:innList){


            for(SootMethod sm:sc.getMethods()){


                        Iterator<MethodOrMethodContext> targets = new Targets(cg.edgesOutOf(sm));


                        System.out.println(sm+":");


                        while(targets.hasNext())


                              System.out.println(targets.next());


            }


}‍



My result:


<cz.romario.opensudoku.gui.FileListActivity: void onCreate(android.os.Bundle)>:


targetMethod:<java.io.File: void <clinit>()>


targetMethod:<java.lang.StringBuilder: java.lang.String toString()>


targetMethod:<java.lang.StringBuilder: java.lang.StringBuilder append(java.lang.String)>


targetMethod:<java.lang.StringBuilder: java.lang.StringBuilder append(java.lang.String)>


targetMethod:<java.lang.StringBuilder: void <init>(java.lang.String)>


targetMethod:<java.util.Date: void <init>(long)>


targetMethod:<java.io.File: long lastModified()>


targetMethod:<java.io.File: java.lang.String getName()>‍



 


<cz.romario.opensudoku.gui.FileListActivity$2: void <init>(cz.romario.opensudoku.gui.FileListActivity)>:


targetMethod:<java.lang.Object: void <init>()>


<cz.romario.opensudoku.gui.FileListActivity$2: boolean accept(java.io.File)>:


no targets.


 


<cz.romario.opensudoku.gui.FileListActivity$3: void <init>(cz.romario.opensudoku.gui.FileListActivity)>:


targetMethod:<java.lang.Object: void <init>()>


<cz.romario.opensudoku.gui.FileListActivity$3: void onClick(android.content.DialogInterface,int)>:


no targets.


 


As you can see:


1. In cz.romario.opensudoku.gui.FileListActivity, I can get all targets of onCreate(). ‍



2. In cz.romario.opensudoku.gui.FileListActivity$2 and ‍cz.romario.opensudoku.gui.FileListActivity$3, I cannot get any targets from accept() and onClick().‍


Do any one meet with this problem before? 


Best Regard.


 


Xiangxing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140714/92533412/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AndroidEntryPointCreator.java
Type: application/octet-stream
Size: 40033 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140714/92533412/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AndroidEntryPointConstants.java
Type: application/octet-stream
Size: 7556 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140714/92533412/attachment-0003.obj 


More information about the Soot-list mailing list