Skip to content

Commit

Permalink
deobfuscator: modify RuntimeExceptions to not remove for client.init
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderhenne committed Mar 7, 2018
1 parent 8048b50 commit f73f544
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class RuntimeExceptions implements Deobfuscator
@Override
public void run(ClassGroup group)
{
boolean foundInit = false;

int i = 0;
for (ClassFile cf : group.getClasses())
{
Expand All @@ -49,6 +51,14 @@ public void run(ClassGroup group)
Code c = m.getCode();
if (c == null)
continue;

// Keep one handler in the client so the deobfuscator
// keeps the client error handling related methods
if (cf.getName().equals("client") && m.getName().equals("init"))
{
foundInit = true;
continue;
}

for (net.runelite.asm.attributes.code.Exception e : new ArrayList<>(c.getExceptions().getExceptions()))
{
Expand All @@ -61,6 +71,11 @@ public void run(ClassGroup group)
}
}

if (!foundInit)
{
throw new IllegalStateException("client.init(...) method seems to be missing!");
}

logger.info("Remove {} exception handlers", i);
}
}

0 comments on commit f73f544

Please sign in to comment.