@@ -59,7 +59,7 @@ public static void setupJarLoader(File file) throws IOException, InvalidJarExcep
5959 *
6060 * @param recursive Check sub-directories of adjacent folders.
6161 */
62- public static void setupJarLoader (boolean recursive )
62+ public static void setupJarLoader (boolean recursive ) throws FallbackException
6363 {
6464 loader = auto (recursive );
6565 }
@@ -84,7 +84,7 @@ private static ByteLoader fromJar(File jar) throws IOException, InvalidJarExcept
8484 * @param recurse Check sub-directories of adjacent folders.
8585 * @return JavaDeobfuscator loader. {@code null} if no JavaDeobfuscator jar could be found.
8686 */
87- private static ByteLoader auto (boolean recurse )
87+ private static ByteLoader auto (boolean recurse ) throws FallbackException
8888 {
8989 return iter (new File (System .getProperty ("user.dir" )), recurse );
9090 }
@@ -96,14 +96,14 @@ private static ByteLoader auto(boolean recurse)
9696 * @param recurse whether to recurse into subdirectories
9797 * @return JavaDeobfuscator loader.
9898 */
99- private static ByteLoader iter (File dir , boolean recurse )
99+ private static ByteLoader iter (File dir , boolean recurse ) throws FallbackException
100100 {
101101 System .out .println ("Searching for deobfuscator in " + dir .getAbsolutePath ());
102102 File [] files = dir .listFiles ();
103103 // return if no files exist in the directory
104104 if (files == null )
105105 {
106- return null ;
106+ throw new FallbackException ( "Loading problem" , "No files found in directory: " + dir . getAbsolutePath (), null ) ;
107107 }
108108 // check for common names
109109 File deobfuscator = new File (dir , "deobfuscator.jar" );
@@ -131,10 +131,11 @@ private static ByteLoader iter(File dir, boolean recurse)
131131 // check sub-dirs
132132 if (recurse && file .isDirectory ())
133133 {
134- ByteLoader v = iter (file , true );
135- if (v != null )
134+ try
136135 {
137- return v ;
136+ return iter (file , true );
137+ } catch (FallbackException e ) {
138+ // ignore
138139 }
139140 }
140141 // check files in the directory
@@ -150,7 +151,7 @@ else if (file.getName().endsWith(".jar"))
150151 }
151152 }
152153 }
153- return null ;
154+ throw new FallbackException ( "Loading problem" , "No deobfuscator jar found in directory: " + dir . getAbsolutePath (), null ) ;
154155 }
155156
156157 /**
0 commit comments