在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:soot-oss/soot开源软件地址:https://github.com/soot-oss/soot开源编程语言:Java 95.8%开源软件介绍:Using Soot? Let us know about it!We are regularly applying for funding to help us maintain Soot. You can help us immensely by letting us know about projects that use Soot, both commercially or in the form of research tools. Also many thanks to for supporting Soot with a free-to-use open source license! Thanks to our Sponsors...... for supporting the further Development of Soot! Amazon Web Services is a Gold Sponsor. Read more here about how to become a sponsor on your own. Soot supports Java 9 modules now!Try and get involved in Soot's Java 9 bleeding edge developement. What works and is tested?
What does not work yet?
What is Soot?Soot is a Java optimization framework. It provides four intermediate representations for analyzing and transforming Java bytecode:
See https://soot-oss.github.io/soot for details. How do I get started with Soot?We have some documentation on Soot in the wiki and also a large range of tutorials on Soot. For detailed information please also consider the Soot's JavaDoc and Options Documentations. Including Soot in your ProjectA Soot release is currently built for each commit to the <dependencies>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>soot</artifactId>
<version>4.2.1</version>
</dependency>
</dependencies> You can also obtain older builds of the A Soot SNAPSHOT is currently built for each commit to the <dependencies>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>soot</artifactId>
<version>4.3.0-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories> You can also obtain older builds of the How do I obtain Soot without Maven?We recommend using Soot with Maven You can obtain the latest release build of Soot directly. You can obtain the latest SNAPSHOT build of Soot directly. The The Building Soot yourselfIf you cannot work with the prebuild versions and need to build Soot on your own, please consider the wiki for further steps. About Soot's source codeSoot follows the git-flow convention. Releases and hotfixes are maintained in the master branch. Development happens in the develop branch. To catch the bleeding edge of Soot, check out the latter. In case of any questions, please consult the Soot mailing list at: http://www.sable.mcgill.ca/mailman/listinfo/soot-list/ How do I contribute to Soot?We are happy to accept arbitrary improvements to Soot in form of GitHub pull requests. Please read our contribution guidelines before setting up a pull request. Please help us improve Soot!You are using Soot and would like to help us support it in the future? Then please support us by filling out this little web form. That way you can help us in two ways:
How to use Soot's Java 9 Features?If you want to run Soot with Java > 8, you are done. Just run it as usal. If you want to execute Soot with Java 8 but analyze Java >8 Projects or vice versa, see below. Use from Source CodeTo load modules in Soot's // configure Soot's options, refer to example configurations below
Options.v().set_soot_modulepath(modulePath);
// load classes from modules into Soot
// Here, getClassUnderModulePath() expects the module path to be set using the Options class as seen above
Map<String, List<String>> map = ModulePathSourceLocator.v().getClassUnderModulePath(modulePath);
for (String module : map.keySet()) {
for (String klass : map.get(module)) {
logger.info("Loaded Class: " + klass + "\n");
loadClass(klass, false, module);
// the loadClass() method is defined below
}
}
//this must be called after all classes are loaded
Scene.v().loadNecessaryClasses();
public static SootClass loadClass(String name, boolean main, String module) {
SootClass c = ModuleScene.v().loadClassAndSupport(name, Optional.of(module));
c.setApplicationClass();
if (main)
Scene.v().setMainClass(c);
return c;
} ModuleUtil.module_mode() helps you check whether you have modules enabled in Soot. This is done based on whether the module path is set using the Options class. Example Configurations: Java 8, Java >= 9 Classpath, Java >= 9 Modulepathif(java < 9 ) { // when you have a target benchmark with Java < 9 and hence no modules
Options.v().set_prepend_classpath(true);
Options.v().set_process_dir(Arrays.asList(applicationClassPath().split(File.pathSeparator)));
Options.v().set_soot_classpath(sootClassPath());
}
if(java >= 9 && USE_CLASSPATH) { // when you have a target benchmark with Java >= 9 and do not want module support
Options.v().set_soot_classpath("VIRTUAL_FS_FOR_JDK" + File.pathSeparator + sootClassPath());
Options.v().set_process_dir(Arrays.asList(applicationClassPath().split(File.pathSeparator)));
}
if(java>=9 && USE_MODULEPATH) { // when you have a target benchmark with Java >= 9 and want module support
Options.v().set_prepend_classpath(true);
Options.v().set_soot_modulepath(sootClassPath());
Options.v().set_process_dir(Arrays.asList(applicationClassPath().split(File.pathSeparator)));
} In the above examples, applicationClassPath() should be replaced with the path to the application classes for analysis by Soot and sootClassPath() should be replaced with the Soot classpath. Use from the Command LineTo execute Soot using Java 1.9, but analyzing a classpath run, just as before:
if you want to specify the classpath explicitly run:
the value To load modules and classes in Soot using java 1.8 run:
Please replace |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论