From 725710f19c09bf1cf3373207dd349be2bcdc5039 Mon Sep 17 00:00:00 2001 From: Jonas Klauke Date: Tue, 19 Sep 2023 13:01:47 +0200 Subject: [PATCH 1/2] improved the getting started documentation --- docs/getting-started.md | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index d2b41ac9e60..ece9f35b4d7 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -40,10 +40,8 @@ You can use bytecode analysis typically when you do not have access to the sourc !!! example "Create a project to analyze Java bytecode" ~~~java - Path pathToBinary = Paths.get("src/test/resources/BasicSetup/binary"); - AnalysisInputLocation inputLocation = - PathBasedAnalysisInputLocation.createForClassContainer(pathToBinary); + new JavaClassPathAnalysisInputLocation("path2Binary"); JavaLanguage language = new JavaLanguage(8); @@ -60,10 +58,8 @@ If you have access to the source code, it is also possible to create a project f !!! example "Create a project to analyze Java source code" ~~~java - Path pathToSource = Paths.get("src/test/resources/BasicSetup/source"); - AnalysisInputLocation inputLocation = - new JavaSourcePathAnalysisInputLocation(pathToSource.toString()); + new JavaSourcePathAnalysisInputLocation("path2Source"); JavaLanguage language = new JavaLanguage(8); @@ -76,7 +72,7 @@ If you have a [Jimple](../jimple) file, you can create a project for analyzing j !!! example "Create a project to analyze jimple code" ~~~java - Path pathToJimple = Paths.get("src/test/resources/BasicSetup/jimple"); + Path pathToJimple = Paths.get("path2Jimple"); AnalysisInputLocation inputLocation = new JimpleAnalysisInputLocation(pathToJimple); @@ -124,10 +120,13 @@ Let's say the following is the target program that we want to analyze: } - public static void main(String[] var0) { - - System.out.println("Hello World!"); - + public static void main(String[] args) { + HelloWorld hw = new HelloWorld; + hw.hello(); + } + + public void hello() { + } } @@ -213,9 +212,8 @@ Below we show a comparison of the code so far with the same functionality in soo === "SootUp" ``` java - Path pathToBinary = Paths.get("src/test/resources/BasicSetup/binary"); AnalysisInputLocation inputLocation = - PathBasedAnalysisInputLocation.createForClassContainer(pathToBinary); + new JavaClassPathAnalysisInputLocation("path2Binary"); JavaLanguage language = new JavaLanguage(8); From 9343413bb5121d57f4ea03cda209e3ad0e20b81a Mon Sep 17 00:00:00 2001 From: Jonas Klauke Date: Tue, 19 Sep 2023 13:05:20 +0200 Subject: [PATCH 2/2] fixed example --- docs/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index ece9f35b4d7..d913d88bd55 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -121,7 +121,7 @@ Let's say the following is the target program that we want to analyze: } public static void main(String[] args) { - HelloWorld hw = new HelloWorld; + HelloWorld hw = new HelloWorld(); hw.hello(); }