project: Mixins

This commit is contained in:
Owain van Brakel
2021-10-30 10:16:51 +02:00
parent abf04a389f
commit 63309c2683
7 changed files with 41 additions and 38 deletions

View File

@@ -77,7 +77,7 @@ public class Deob
Stopwatch stopwatch = Stopwatch.createStarted();
ClassGroup group = JarUtil.load(new File(args[0]));
ClassGroup group = JarUtil.load(new File(args[0]), true);
// remove except RuntimeException
run(group, new RuntimeExceptions());

View File

@@ -50,6 +50,11 @@ public class JarUtil
private static final Logger logger = LoggerFactory.getLogger(JarUtil.class);
public static ClassGroup load(File jarfile)
{
return load(jarfile, false);
}
public static ClassGroup load(File jarfile, boolean skip)
{
ClassGroup group = new ClassGroup();
@@ -59,7 +64,7 @@ public class JarUtil
{
JarEntry entry = it.nextElement();
if (!entry.getName().endsWith(".class"))
if (!entry.getName().endsWith(".class") || (skip && entry.getName().contains("bouncycastle")))
{
continue;
}
@@ -93,12 +98,17 @@ public class JarUtil
}
public static ClassGroup loadClasses(Collection<File> files) throws IOException
{
return loadClasses(files, false);
}
public static ClassGroup loadClasses(Collection<File> files, boolean skip) throws IOException
{
final ClassGroup group = new ClassGroup();
for (File file : files)
{
if (!file.getName().endsWith(".class"))
if (!file.getName().endsWith(".class") || (skip && file.getName().contains("bouncycastle")))
{
continue;
}