[Soot-list] Creating a callgraph of a SpringBootApplication

Eric Ortega eortega at pjrcorp.com
Thu Feb 18 20:06:44 EST 2021


Hi all,

Is it possible to create a callgraph of the following code?   I am able to compile and execute it with gradle and ‘java -jar’, but have been unable to find a solution using soot 4.2.0 + spark that indicates I’m on the right path to mapping edges across these @Bean/@Autowired annotations.  If anyone has any tips I’d be happy to try them out.


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;


@SpringBootApplication
public class Application
{
    @Autowired
    private InterfaceDef interfaceImpl;

    public static void main( final String[] args )
    {
        SpringApplication.run(Application.class, args);
    }

    @Bean
    public CommandLineRunner commandLineRunner(ApplicationContext ctx)
    {
        return args ->
        {
            interfaceImpl.func();
        };
    }


    public interface InterfaceDef
    {
        void func();
    }

    @Component(value = "interfaceImpl")
    public class InterfaceImpl implements InterfaceDef
    {
        @Override
        public void func()
        {
            System.out.println( "called InterfaceImpl" );
        }
    }

}


Thanks,
Eric Ortega
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20210219/9a21b667/attachment.html>


More information about the Soot-list mailing list