]> git.saurik.com Git - backport.git/commitdiff
Throw correct ZipException from ZipFile's method.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 21 Jul 2013 03:09:02 +0000 (20:09 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 21 Jul 2013 03:17:03 +0000 (20:17 -0700)
src/com/saurik/backport/Hook.java

index 5c0173a8ea95f2fd7d874c058e933053799c7b91..6d0e1341d52c3a0fd6b7337f47cecfa9b8f72a43 100644 (file)
@@ -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();
+                            }
                         }
                     }
                 );