From c9217a419af6946f44264eca3cb82a13b6bd8b28 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Thu, 8 Dec 2016 23:03:50 +0800 Subject: [PATCH] Fix crashing when zip not signed --- app/src/main/java/com/topjohnwu/magisk/utils/ZipUtils.java | 4 +++- build.gradle | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/ZipUtils.java b/app/src/main/java/com/topjohnwu/magisk/utils/ZipUtils.java index ab5c957b3..705cd99bb 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/ZipUtils.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/ZipUtils.java @@ -136,7 +136,9 @@ public class ZipUtils { Enumeration e = zipfile.entries(); while(e.hasMoreElements()) { entry = (JarEntry) e.nextElement(); - if (!entry.getName().contains(path)) { + if (!entry.getName().contains(path) + || entry.getName().charAt(entry.getName().length() - 1) == '/') { + // Ignore directories, only create files continue; } Logger.dev("ZipUtils: Extracting: " + entry); diff --git a/build.gradle b/build.gradle index d8c8b5d16..cfc177153 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.2' + classpath 'com.android.tools.build:gradle:2.2.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files