Skip to content

Commit 0ccd281

Browse files
Fixed NullPointerExceptions on Windows
1 parent 269e6ed commit 0ccd281

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/com/stericson/RootShell/containers/RootClass.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public AnnotationsFinder() throws IOException {
150150
} catch (InterruptedException e) {
151151
}
152152

153-
File rawFolder = new File("res/raw");
153+
File rawFolder = new File("res" + File.separator + "raw");
154154
if (!rawFolder.exists()) {
155155
rawFolder.mkdirs();
156156
}
@@ -159,14 +159,14 @@ public AnnotationsFinder() throws IOException {
159159
if (onWindows) {
160160
cmd = new String[]{
161161
"cmd", "/C",
162-
"dx --dex --output=res/raw/anbuild.dex "
162+
"dx --dex --output=res" + File.separator + "raw" + File.separator + "anbuild.dex "
163163
+ builtPath + File.separator + "anbuild.jar"
164164
};
165165
} else {
166166
cmd = new String[]{
167167
getPathToDx(),
168168
"--dex",
169-
"--output=res/raw/anbuild.dex",
169+
"--output=res" + File.separator + "raw" + File.separator + "anbuild.dex",
170170
builtPath + File.separator + "anbuild.jar"
171171
};
172172
}
@@ -177,11 +177,11 @@ public AnnotationsFinder() throws IOException {
177177
} catch (InterruptedException e) {
178178
}
179179
}
180-
System.out.println("All done. ::: anbuild.dex should now be in your project's res/raw/ folder :::");
180+
System.out.println("All done. ::: anbuild.dex should now be in your project's res" + File.separator + "raw" + File.separator + " folder :::");
181181
}
182182

183183
protected void lookup(File path, List<File> fileList) {
184-
String desourcedPath = path.toString().replace("src/", "");
184+
String desourcedPath = path.toString().replace("src" + File.separator, "");
185185
File[] files = path.listFiles();
186186
for (File file : files) {
187187
if (file.isDirectory()) {

0 commit comments

Comments
 (0)