[Soot-list] variable name conflict

Sergio Ferrero sferrero at ensoftcorp.com
Tue Jul 16 11:22:17 EDT 2013


Hello,

The class files contain debug symbols. However, I believe variables are
renamed and debug symbols are left behind when class files are converted to
a classes.dex file when the apk is exported.

Ok, thanks for the hint. I found locals are printed by
Printer.printLocalsInBody(). Would it be enough if I rename Locals as
needed using the Local. setName() method? As far as I know, the method body
will have references to the JimpleLocal objects.


Thanks
Best regards,
Sergio


On Tue, Jul 16, 2013 at 11:24 AM, Bodden, Eric <
eric.bodden at sit.fraunhofer.de> wrote:

> Hello.
>
> > On another note. I found this problem occurs if I go from java to
> jimple. However, the actual scenario in my case will be going from dex to
> jimple. So, I decided to create a simple android app in which one method
> recreates the problem of variables with same name in different blocks. I
> exported it as an apk, and then used my tool to unpack the apk and generate
> jimple files for it. I found the problem went away, because variable names
> now are different. This is the jimple code I got:
> >
> >    public void testDeclarations(boolean)
> >
> >     {
> >
> >         com.example.myfirstandroidapp.MyActivity $r0;
> >
> >         boolean $z0;
> >
> >         java.lang.String $r1;
> >
> >         java.lang.StringBuilder $r2;
> >
> >         java.io.PrintStream $r3;
> >
> >         char $c0;
> >
> >         int $i1;
> >
> > ...
> >
> >
> > So, it seems this might not be an as problematic issue as I thought.
>
> It depends. Was your app compiled with debug symbols? If I am not mistaken
> then Soot should also assign original variable names in this case, but for
> some reasons this does not seem to be happening in your setup.
>
> Anyway, Soot currently does nothing to assure non-clashing variable names
> when it prints .jimple files, but it could be extended to do so.
>
> Best wishes,
> Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130716/8b48ae8b/attachment.html 


More information about the Soot-list mailing list