[Soot-list] Any way to get the body of callback methods (not android default handlers) ?

Bodden, Eric eric.bodden at sit.fraunhofer.de
Wed Feb 18 14:47:24 EST 2015


Hi Xinxin.

I think the problem is that the bytecode's structure differs from the source code's. Although in the source the two anonymous subclasses of Listener resp. ErrorListener are lexically contained in the constructor call, they are not in the bytecode. Please inspect the call to StringRequest.<init>. You should see references the second and third parameter both being initialized with instances of classes such as Response.Listener$1. You have to inspect the bodies of the onResponse methods in those classes.

Hope that helps,
Eric

> On 18.02.2015, at 18:21, Xinxin Jin <xinxinjin89 at gmail.com> wrote:
> 
> Hi all,
> 
> I have an application which calls new StringRequest()of Volley library:
> 
> 
> StringRequest request = new StringRequest(url,
>          ​    ​new Response.Listener() {
> 	​           ​@Override
> 	​       ​    public void onResponse(Object response) {
> 	​                    ​Log.d(TAG, "response " + ((String) response).substring(0,500));
> 	​       ​}
> 	​   ​}, new Response.ErrorListener() {
> 	​           ​@Override
> 	​           ​public void onErrorResponse(VolleyError error) {
>              ​        ​Log.d(TAG, "error message");
> 	    ​ }
> 	});
> 
> 
> It contains two callbacks as its parameters: Response​.Listener() and Response.ErrorListener().
> 
> When I parse reached methods of this application, it can only reach SootMethod StringRequest: <init>, but when I examine all the statements in this method, I cannot find bodies of the two registered listeners. Is there any way to get the method body of onResponse() ?
> 
> ​Thank you for your help !​
> 
> --
> Xinxin
> 
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list

--
Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering at Fraunhofer SIT, TU Darmstadt and EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 869-127
Room B5.11, Fraunhofer SIT, Rheinstraße 75, 64295 Darmstadt

-------------- 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/20150218/c931a035/attachment.bin 


More information about the Soot-list mailing list