From: Jay Freeman (saurik) Date: Sun, 21 Jul 2013 03:09:02 +0000 (-0700) Subject: Throw correct ZipException from ZipFile's method. X-Git-Tag: v0.9.1~2 X-Git-Url: https://git.saurik.com/backport.git/commitdiff_plain/79cf0362920a26a35b42ad4ec99f19b6cb50f618?ds=sidebyside Throw correct ZipException from ZipFile's method. --- diff --git a/src/com/saurik/backport/Hook.java b/src/com/saurik/backport/Hook.java index 5c0173a..6d0e134 100644 --- a/src/com/saurik/backport/Hook.java +++ b/src/com/saurik/backport/Hook.java @@ -37,6 +37,14 @@ import android.util.Log; import com.saurik.substrate.MS; public class Hook { + private static class WrongException + extends RuntimeException + { + public WrongException(Throwable cause) { + super(cause); + } + } + public static void initialize() { MS.hookClassLoad("java.util.zip.ZipFile", new MS.ClassLoadHook() { public void classLoaded(Class ZipFile$) { @@ -75,7 +83,11 @@ public class Hook { } }); - return invoke(thiz, args); + try { + return invoke(thiz, args); + } catch (WrongException wrong) { + throw wrong.getCause(); + } } } );