Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor SootUp module structure #1049

Merged
merged 19 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Please make sure to use Java8 to execute.
### Exception: Provider "jrt" not found
```shell
java.lang.ExceptionInInitializerError
at sootup.java.bytecode.inputlocation.JrtFileSystemAnalysisInputLocationTest.getClassSource(JrtFileSystemAnalysisInputLocationTest.java:28)
at inputlocation.sootup.java.bytecode.frontend.JrtFileSystemAnalysisInputLocationTest.getClassSource(JrtFileSystemAnalysisInputLocationTest.java:28)
...
Caused by: java.nio.file.ProviderNotFoundException: Provider "jrt" not found
```
Expand Down
28 changes: 20 additions & 8 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,22 @@ Add the following dependencies to your ```pom.xml``` / ```build.gradle```.
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.java.sourcecode</artifactId>
<artifactId>sootup.java.sourcecode.frontend</artifactId>
<version>{{ git_latest_release }}</version>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.java.bytecode</artifactId>
<artifactId>sootup.java.bytecode.frontend</artifactId>
<version>{{ git_latest_release }}</version>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.jimple.parser</artifactId>
<artifactId>sootup.jimple.frontend</artifactId>
<version>{{ git_latest_release }}</version>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.apk.frontend</artifactId>
<version>{{ git_latest_release }}</version>
</dependency>
<dependency>
Expand All @@ -46,7 +51,12 @@ Add the following dependencies to your ```pom.xml``` / ```build.gradle```.
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.analysis</artifactId>
<artifactId>sootup.analysis.intraprocedural</artifactId>
<version>{{ git_latest_release }}</version>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.analysis.interprocedural</artifactId>
<version>{{ git_latest_release }}</version>
</dependency>
<dependency>
Expand All @@ -72,11 +82,13 @@ Add the following dependencies to your ```pom.xml``` / ```build.gradle```.

compile "org.soot-oss:sootup.core:{{ git_latest_release }}"
compile "org.soot-oss:sootup.java.core:{{ git_latest_release }}"
compile "org.soot-oss:sootup.java.sourcecode:{{ git_latest_release }}"
compile "org.soot-oss:sootup.java.bytecode:{{ git_latest_release }}"
compile "org.soot-oss:sootup.jimple.parser:{{ git_latest_release }}"
compile "org.soot-oss:sootup.java.sourcecode.frontend:{{ git_latest_release }}"
compile "org.soot-oss:sootup.java.bytecode.frontend:{{ git_latest_release }}"
compile "org.soot-oss:sootup.jimple.frontend:{{ git_latest_release }}"
compile "org.soot-oss:sootup.apk.frontend:{{ git_latest_release }}"
compile "org.soot-oss:sootup.callgraph:{{ git_latest_release }}"
compile "org.soot-oss:sootup.analysis:{{ git_latest_release }}"
compile "org.soot-oss:sootup.analysis.intraprocedural:{{ git_latest_release }}"
compile "org.soot-oss:sootup.analysis.interprocedural:{{ git_latest_release }}"
compile "org.soot-oss:sootup.qilin:{{ git_latest_release }}"
compile "org.soot-oss:sootup.codepropertygraph:{{ git_latest_release }}"
```
Expand Down
47 changes: 37 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,19 @@
</scm>
<modules>
<module>sootup.core</module>
<module>sootup.jimple.parser</module>
<module>sootup.jimple.frontend</module>
<module>sootup.java.core</module>
<module>sootup.java.bytecode</module>
<module>sootup.java.sourcecode</module>
<module>sootup.interceptors</module>
<module>sootup.java.bytecode.frontend</module>
<module>sootup.java.sourcecode.frontend</module>
<module>sootup.tests</module>
<module>sootup.callgraph</module>
<module>sootup.qilin</module>
<module>sootup.analysis</module>
<module>sootup.analysis.interprocedural</module>
<module>sootup.analysis.intraprocedural</module>
<module>sootup.examples</module>
<module>sootup.report</module>
<module>sootup.apk.parser</module>
<module>sootup.apk.frontend</module>
<module>sootup.codepropertygraph</module>
</modules>

Expand Down Expand Up @@ -407,6 +409,12 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.13</version>
<scope>test</scope>
</dependency>
<!-- adds `@Nullable` and `@Nonnull` annotations -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand All @@ -430,25 +438,44 @@
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.java.bytecode</artifactId>
<artifactId>sootup.java.bytecode.frontend</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.java.sourcecode</artifactId>
<artifactId>sootup.java.sourcecode.frontend</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.jimple.parser</artifactId>
<artifactId>sootup.jimple.frontend</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.analysis</artifactId>
<artifactId>sootup.analysis.interprocedural</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.analysis.intraprocedural</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.interceptors</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.codepropertygraph</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.apk.frontend</artifactId>
<version>${project.version}</version>
</dependency>

</dependencies>
</dependencyManagement>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<name>SootUp Analysis</name>
<artifactId>sootup.analysis</artifactId>
<name>SootUp Interprocedural Analysis</name>
<artifactId>sootup.analysis.interprocedural</artifactId>
<packaging>jar</packaging>
<parent>
<groupId>org.soot-oss</groupId>
Expand All @@ -19,18 +19,23 @@
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.java.bytecode</artifactId>
<artifactId>sootup.java.bytecode.frontend</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.java.sourcecode</artifactId>
<artifactId>sootup.java.sourcecode.frontend</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.upb.cs.swt</groupId>
<artifactId>heros</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import sootup.core.model.SootClass;
import sootup.core.model.SootMethod;
import sootup.core.signatures.MethodSignature;
import sootup.java.bytecode.inputlocation.DefaultRTJarAnalysisInputLocation;
import sootup.java.bytecode.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.bytecode.frontend.inputlocation.DefaultRTJarAnalysisInputLocation;
import sootup.java.bytecode.frontend.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.types.JavaClassType;
import sootup.java.core.views.JavaView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
import sootup.core.types.PrimitiveType;
import sootup.core.types.Type;
import sootup.core.util.printer.StmtPrinter;
import sootup.java.bytecode.inputlocation.DefaultRTJarAnalysisInputLocation;
import sootup.java.bytecode.frontend.inputlocation.DefaultRTJarAnalysisInputLocation;
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.types.JavaClassType;
import sootup.java.core.views.JavaView;
import sootup.java.sourcecode.inputlocation.JavaSourcePathAnalysisInputLocation;
import sootup.java.frontend.inputlocation.JavaSourcePathAnalysisInputLocation;

@Tag("Java8")
public class CGEdgeUtilTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
import sootup.core.model.SootMethod;
import sootup.core.model.SourceType;
import sootup.core.signatures.MethodSignature;
import sootup.java.bytecode.inputlocation.DefaultRTJarAnalysisInputLocation;
import sootup.java.bytecode.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.bytecode.frontend.inputlocation.DefaultRTJarAnalysisInputLocation;
import sootup.java.bytecode.frontend.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.types.JavaClassType;
import sootup.java.core.views.JavaView;
Expand Down
36 changes: 36 additions & 0 deletions sootup.analysis.intraprocedural/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<name>SootUp Intraprocedural Analysis</name>
<artifactId>sootup.analysis.intraprocedural</artifactId>
<packaging>jar</packaging>
<parent>
<groupId>org.soot-oss</groupId>
<artifactId>sootup</artifactId>
<version>1.3.1-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.core</artifactId>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.java.bytecode.frontend</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.soot-oss</groupId>
<artifactId>sootup.java.sourcecode.frontend</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
stschott marked this conversation as resolved.
Show resolved Hide resolved
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sootup.codepropertygraph.ddg;
package sootup.analysis.intraprocedural.reachingdefs;

/*-
* #%L
Expand Down Expand Up @@ -32,10 +32,10 @@
import sootup.core.jimple.common.stmt.JAssignStmt;
import sootup.core.jimple.common.stmt.Stmt;

class ReachingDefs {
public class ReachingDefs {
private final Map<Stmt, List<Stmt>> reachingDefs;

ReachingDefs(StmtGraph<? extends BasicBlock<?>> graph) {
public ReachingDefs(StmtGraph<? extends BasicBlock<?>> graph) {
this.reachingDefs = new HashMap<>();

ReachingDefsAnalysis analysis = new ReachingDefsAnalysis(graph);
Expand All @@ -61,7 +61,7 @@ class ReachingDefs {
}
}

Map<Stmt, List<Stmt>> getReachingDefs() {
public Map<Stmt, List<Stmt>> getReachingDefs() {
return reachingDefs;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sootup.codepropertygraph.ddg;
package sootup.analysis.intraprocedural.reachingdefs;

/*-
* #%L
Expand Down
3 changes: 2 additions & 1 deletion sootup.apk.parser/pom.xml → sootup.apk.frontend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<version>1.3.1-SNAPSHOT</version>
</parent>

<artifactId>sootup.apk.parser</artifactId>
<name>SootUp APK Frontend</name>
<artifactId>sootup.apk.frontend</artifactId>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import Util.*;
import dexpler.DexClassProvider;
import dexpler.DexFileProvider;
package sootup.apk.frontend;

import java.io.IOException;
import java.nio.file.Path;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import main.AndroidVersionInfo;
import org.jf.dexlib2.iface.DexFile;
import sootup.apk.frontend.Util.*;
import sootup.apk.frontend.dexpler.DexClassProvider;
import sootup.apk.frontend.dexpler.DexFileProvider;
import sootup.apk.frontend.main.AndroidVersionInfo;
import sootup.core.frontend.SootClassSource;
import sootup.core.inputlocation.AnalysisInputLocation;
import sootup.core.model.ClassModifier;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package sootup.apk.frontend;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import sootup.apk.frontend.interceptors.DexNullTransformer;
import sootup.apk.frontend.interceptors.DexNumberTranformer;
import sootup.core.transform.BodyInterceptor;
import sootup.java.core.interceptors.*;
import sootup.java.core.interceptors.Dex.DexNullTransformer;
import sootup.java.core.interceptors.Dex.DexNumberTranformer;

public enum DexBodyInterceptors {
Default(new DexNumberTranformer(), new DexNullTransformer());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package Util;
package sootup.apk.frontend.Util;

import java.util.*;
import javax.annotation.Nonnull;
import main.AndroidVersionInfo;
import org.jf.dexlib2.iface.Annotation;
import org.jf.dexlib2.iface.AnnotationElement;
import org.jf.dexlib2.iface.value.EncodedValue;
import sootup.apk.frontend.main.AndroidVersionInfo;
import sootup.core.signatures.PackageName;
import sootup.core.types.*;
import sootup.core.views.View;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dexpler;
package sootup.apk.frontend.dexpler;

import java.nio.file.Path;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dexpler;
package sootup.apk.frontend.dexpler;

import Util.DexUtil;
import java.io.File;
import java.nio.file.Path;
import java.util.*;
Expand All @@ -12,6 +11,7 @@
import org.jf.dexlib2.iface.*;
import org.jf.dexlib2.iface.Field;
import org.jf.dexlib2.iface.Method;
import sootup.apk.frontend.Util.DexUtil;
import sootup.core.IdentifierFactory;
import sootup.core.frontend.ResolveException;
import sootup.core.inputlocation.AnalysisInputLocation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dexpler;
package sootup.apk.frontend.dexpler;

import java.io.File;
import java.io.IOException;
Expand Down
Loading
Loading