[Soot-list] Use Soot to parse annotations stored in bytecodes

Xinxin Jin xinxinjin89 at gmail.com
Wed Oct 5 21:28:47 EDT 2016


Thank you very much, Bernhard ! It works !

On Wed, Oct 5, 2016 at 10:48 AM, Bernhard Berger <berber at tzi.de> wrote:

> Hi Xinxin,
>
> as far as I remember Jimple has no equivalent of annotations. They can be
> stored using the -xml-attributes or the -print-tags command line
> parameters. Within Soot you have to query the tags [1] to find the
> annotations you are interested in.
>
> Regards, Bernhard
>
> [1] https://ssebuild.cased.de/nightly/soot/javadoc/soot/tagkit/Host.html
>
> Am 05.10.2016 um 18:22 schrieb Xinxin Jin <xinxinjin89 at gmail.com>:
>
> Hi !
>
> I need to parse the java annotation from Android application and generate
> bytecode according to the parsed annotation.
>
> In the android source code, the annotation is defined like this. RetentionPolicy.RUNTIME
> means the annotation will be preserved in bytecode.
>
>
>
>
> *@Retention(RetentionPolicy.RUNTIME)public @interface MyAnnotation {}*
>
> Then I use Soot to transform the android APK to Jimple using this command:
> *java -classpath ${JAVA_CLASSPATH} soot.Main -android-jars
> $ANDROID_JARS_PATH -allow-phantom-refs -src-prec apk -ire -f J MyTest.apk*
>
> I checked the generated Jimple files, but found no code annotated with @
> *MyAnnotation*
>
> Can anyone tell me if Soot can't read the annotation in the bytecode or I
> applied incorrect command?
>
> Thank you very much !!!
>
> ​​
>
> --
> Xinxin
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA <Soot-list at cs.mcgill.ca>
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>
>
>


-- 
Xinxin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20161005/ed7c5d9d/attachment.html 


More information about the Soot-list mailing list