Skip to content

Instantly share code, notes, and snippets.

@linghuiluo
Last active March 11, 2019 12:20
Show Gist options
  • Save linghuiluo/8b54c06ae23c7f6f5109a967cce151ad to your computer and use it in GitHub Desktop.
Save linghuiluo/8b54c06ae23c7f6f5109a967cce151ad to your computer and use it in GitHub Desktop.
WALA VS. SOOT (Public static field initialization)

JAVA SOURCE CODE

public final class R {
     public static final class style {
            public static final int AppBaseTheme=0x7f050000;
            public static final int AppTheme=0x7f050001;
        }
 }
 

JIMPLE FROM WALA SOURCE CODE FRONT END

public class de.ecspride.R$style extends java.lang.Object
{
    public static final int AppBaseTheme;
    public static final int AppTheme;

    void <init>()
    {
        de.ecspride.R$style r0;
        java.lang.Object $r1;
        r0 := @this: de.ecspride.R$style;
        specialinvoke $r1.<java.lang.Object: void <init>()>();
        return;
    }

    static void <clinit>()
    {
        <de.ecspride.R$style: int AppBaseTheme> = 2131034112;
        <de.ecspride.R$style: int AppTheme> = 2131034113;
        return;
    }
}

JIMPLE FROM SOOT BYTE CODE FRONT END

public final class de.ecspride.R$style extends java.lang.Object
{
    public static final int AppBaseTheme;
    public static final int AppTheme;

    public void <init>()
    {
        de.ecspride.R$style $r0;
        $r0 := @this: de.ecspride.R$style;
        specialinvoke $r0.<java.lang.Object: void <init>()>();
        return;
    }
}
@juliandolby
Copy link

This is nice. It shows @linghuiluo's WALA IR converter helping us find issues in WALA or Soot by revealing differences in what the IR looks like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment