Skip to content

Commit bedf270

Browse files
committed
use forward slash to parse zip entries first
1 parent 6ce1f68 commit bedf270

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/processing/mode/android/AndroidBuild.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,8 +940,6 @@ private File createTempBuildFolder(final Sketch sketch) throws IOException {
940940
private void installGradlew(File exportFolder) throws IOException {
941941
File gradlewFile = mode.getContentFile("mode/gradlew.zip");
942942
AndroidUtil.extractFolder(gradlewFile, exportFolder, true, true);
943-
File execFile = new File(exportFolder, "gradlew");
944-
execFile.setExecutable(true);
945943
}
946944

947945

src/processing/mode/android/AndroidUtil.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,12 @@ static public void extractFolder(File file, File newPath, boolean setExec,
194194

195195
if (remRoot) {
196196
// Remove root folder from path
197-
int idx = currentEntry.indexOf(File.separator);
197+
int idx = currentEntry.indexOf("/");
198+
if (idx == -1) {
199+
// Let's try the system file separator
200+
// https://stackoverflow.com/a/16485210
201+
idx = currentEntry.indexOf(File.separator);
202+
}
198203
currentEntry = currentEntry.substring(idx + 1);
199204
}
200205

0 commit comments

Comments
 (0)