Cleanup and better logging
This commit is contained in:
@@ -233,6 +233,7 @@ public class ClientLoader
|
|||||||
Hooks hooks = gson.fromJson(new BufferedReader(new FileReader(hooksFile)), Hooks.class);
|
Hooks hooks = gson.fromJson(new BufferedReader(new FileReader(hooksFile)), Hooks.class);
|
||||||
|
|
||||||
if (hooks.clientInstance.equals("") ||
|
if (hooks.clientInstance.equals("") ||
|
||||||
|
hooks.clientClass.equals("") ||
|
||||||
hooks.projectileClass.equals("") ||
|
hooks.projectileClass.equals("") ||
|
||||||
hooks.actorClass.equals("") ||
|
hooks.actorClass.equals("") ||
|
||||||
hooks.playerClass.equals(""))
|
hooks.playerClass.equals(""))
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import java.util.jar.JarInputStream;
|
|||||||
import javassist.ClassPool;
|
import javassist.ClassPool;
|
||||||
import javassist.CtClass;
|
import javassist.CtClass;
|
||||||
import javassist.NotFoundException;
|
import javassist.NotFoundException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.client.RuneLite;
|
import net.runelite.client.RuneLite;
|
||||||
import net.runelite.client.rs.ClientLoader;
|
import net.runelite.client.rs.ClientLoader;
|
||||||
import net.runelite.client.rs.bytecode.transformers.ActorTransform;
|
import net.runelite.client.rs.bytecode.transformers.ActorTransform;
|
||||||
@@ -28,6 +29,7 @@ import net.runelite.client.rs.bytecode.transformers.ProjectileTransform;
|
|||||||
import net.runelite.http.api.RuneLiteAPI;
|
import net.runelite.http.api.RuneLiteAPI;
|
||||||
import org.xeustechnologies.jcl.JarClassLoader;
|
import org.xeustechnologies.jcl.JarClassLoader;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class ByteCodePatcher
|
public class ByteCodePatcher
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -51,43 +53,43 @@ public class ByteCodePatcher
|
|||||||
);
|
);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
RuneLite.splashScreen.setSubMessage("Transforming Client");
|
||||||
|
Class clientClass = Class.forName(hooks.clientClass, false, child);
|
||||||
|
transformClient(clientClass);
|
||||||
|
RuneLite.splashScreen.setProgress(1, 5);
|
||||||
|
|
||||||
RuneLite.splashScreen.setSubMessage("Transforming Actor");
|
RuneLite.splashScreen.setSubMessage("Transforming Actor");
|
||||||
Class actorClass = Class.forName(hooks.actorClass, false, child);
|
Class actorClass = Class.forName(hooks.actorClass, false, child);
|
||||||
transformActor(actorClass);
|
transformActor(actorClass);
|
||||||
RuneLite.splashScreen.setProgress(1, 5);
|
RuneLite.splashScreen.setProgress(2, 5);
|
||||||
|
|
||||||
RuneLite.splashScreen.setSubMessage("Transforming Projectile");
|
RuneLite.splashScreen.setSubMessage("Transforming Projectile");
|
||||||
Class projectileClass = Class.forName(hooks.projectileClass, false, child);
|
Class projectileClass = Class.forName(hooks.projectileClass, false, child);
|
||||||
transformProjectile(projectileClass);
|
transformProjectile(projectileClass);
|
||||||
RuneLite.splashScreen.setProgress(2, 5);
|
RuneLite.splashScreen.setProgress(3, 5);
|
||||||
|
|
||||||
RuneLite.splashScreen.setSubMessage("Transforming Player");
|
RuneLite.splashScreen.setSubMessage("Transforming Player");
|
||||||
Class playerClass = Class.forName(hooks.playerClass, false, child);
|
Class playerClass = Class.forName(hooks.playerClass, false, child);
|
||||||
transformPlayer(playerClass);
|
transformPlayer(playerClass);
|
||||||
RuneLite.splashScreen.setProgress(3, 5);
|
|
||||||
|
|
||||||
RuneLite.splashScreen.setSubMessage("Transforming Client");
|
|
||||||
Class clientClass = Class.forName("client", false, child);
|
|
||||||
transformClient(clientClass);
|
|
||||||
RuneLite.splashScreen.setProgress(4, 5);
|
RuneLite.splashScreen.setProgress(4, 5);
|
||||||
|
|
||||||
// Odds and ends
|
// Odds and ends
|
||||||
RuneLite.splashScreen.setSubMessage("Transforming Error method");
|
RuneLite.splashScreen.setSubMessage("Transforming Error method");
|
||||||
ErrorTransform et = new ErrorTransform();
|
transformStackTrace();
|
||||||
et.modify(null);
|
|
||||||
RuneLite.splashScreen.setProgress(5, 5);
|
RuneLite.splashScreen.setProgress(5, 5);
|
||||||
|
|
||||||
RuneLite.splashScreen.setSubMessage("");
|
RuneLite.splashScreen.setSubMessage("");
|
||||||
ByteCodeUtils.updateHijackedJar();
|
ByteCodeUtils.updateHijackedJar();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,23 +167,50 @@ public class ByteCodePatcher
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Class classToLoad = Class.forName(entry.getName().replace(".class", ""), false, child);
|
Class classToLoad = Class.forName(entry.getName().replace(".class", ""), false, child);
|
||||||
|
checkClient(classToLoad);
|
||||||
checkActor(classToLoad);
|
checkActor(classToLoad);
|
||||||
checkProjectile(classToLoad);
|
checkProjectile(classToLoad);
|
||||||
checkPlayer(classToLoad);
|
checkPlayer(classToLoad);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
System.out.println("Class not found: " + entry.getName());
|
// System.out.println("Class not found: "+entry.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void checkClient(Class current)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Method method = current.getDeclaredMethod("getProjectiles");
|
||||||
|
if (method != null)
|
||||||
|
{
|
||||||
|
hooks.clientClass = current.getName();
|
||||||
|
log.info("[RuneLitePlus] Transforming Client at class: " + current.getName());
|
||||||
|
ClientTransform ct = new ClientTransform();
|
||||||
|
ct.modify(current);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (NoSuchMethodException | NoClassDefFoundError e)
|
||||||
|
{
|
||||||
|
// e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void transformClient(Class client)
|
||||||
|
{
|
||||||
|
log.info("[RuneLitePlus] Transforming Client at class: " + client.getName());
|
||||||
|
ClientTransform ct = new ClientTransform();
|
||||||
|
ct.modify(client);
|
||||||
|
}
|
||||||
|
|
||||||
private static void checkActor(Class current)
|
private static void checkActor(Class current)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -190,19 +219,20 @@ public class ByteCodePatcher
|
|||||||
if (method != null)
|
if (method != null)
|
||||||
{
|
{
|
||||||
hooks.actorClass = current.getName();
|
hooks.actorClass = current.getName();
|
||||||
System.out.println("[RuneLitePlus] Transforming Actor at class: " + current.getName());
|
log.info("[RuneLitePlus] Transforming Actor at class: " + current.getName());
|
||||||
ActorTransform at = new ActorTransform();
|
ActorTransform at = new ActorTransform();
|
||||||
at.modify(current);
|
at.modify(current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (NoSuchMethodException | NoClassDefFoundError e) {
|
catch (NoSuchMethodException | NoClassDefFoundError e)
|
||||||
e.printStackTrace();
|
{
|
||||||
|
// e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void transformActor(Class actor)
|
private static void transformActor(Class actor)
|
||||||
{
|
{
|
||||||
System.out.println("[RuneLitePlus] Transforming Actor at class: " + actor.getName());
|
log.info("[RuneLitePlus] Transforming Actor at class: " + actor.getName());
|
||||||
ActorTransform at = new ActorTransform();
|
ActorTransform at = new ActorTransform();
|
||||||
at.modify(actor);
|
at.modify(actor);
|
||||||
}
|
}
|
||||||
@@ -215,20 +245,20 @@ public class ByteCodePatcher
|
|||||||
if (method != null)
|
if (method != null)
|
||||||
{
|
{
|
||||||
hooks.projectileClass = current.getName();
|
hooks.projectileClass = current.getName();
|
||||||
System.out.println("[RuneLitePlus] Transforming Projectile at class: " + current.getName());
|
log.info("[RuneLitePlus] Transforming Projectile at class: " + current.getName());
|
||||||
ProjectileTransform pt = new ProjectileTransform();
|
ProjectileTransform pt = new ProjectileTransform();
|
||||||
pt.modify(current);
|
pt.modify(current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (NoSuchMethodException | NoClassDefFoundError e)
|
catch (NoSuchMethodException | NoClassDefFoundError e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void transformProjectile(Class projectile)
|
private static void transformProjectile(Class projectile)
|
||||||
{
|
{
|
||||||
System.out.println("[RuneLitePlus] Transforming Projectile at class: " + projectile.getName());
|
log.info("[RuneLitePlus] Transforming Projectile at class: " + projectile.getName());
|
||||||
ProjectileTransform pt = new ProjectileTransform();
|
ProjectileTransform pt = new ProjectileTransform();
|
||||||
pt.modify(projectile);
|
pt.modify(projectile);
|
||||||
}
|
}
|
||||||
@@ -241,29 +271,28 @@ public class ByteCodePatcher
|
|||||||
if (method != null)
|
if (method != null)
|
||||||
{
|
{
|
||||||
hooks.playerClass = current.getName();
|
hooks.playerClass = current.getName();
|
||||||
System.out.println("[RuneLitePlus] Transforming Player at class: " + current.getName());
|
log.info("[RuneLitePlus] Transforming Player at class: " + current.getName());
|
||||||
PlayerTransform pt = new PlayerTransform();
|
PlayerTransform pt = new PlayerTransform();
|
||||||
pt.modify(current);
|
pt.modify(current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (NoSuchMethodException | NoClassDefFoundError e)
|
catch (NoSuchMethodException | NoClassDefFoundError e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void transformPlayer(Class player)
|
private static void transformPlayer(Class player)
|
||||||
{
|
{
|
||||||
System.out.println("[RuneLitePlus] Transforming Player at class: " + player.getName());
|
log.info("[RuneLitePlus] Transforming Player at class: " + player.getName());
|
||||||
PlayerTransform pt = new PlayerTransform();
|
PlayerTransform pt = new PlayerTransform();
|
||||||
pt.modify(player);
|
pt.modify(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void transformClient(Class clazz)
|
private static void transformStackTrace()
|
||||||
{
|
{
|
||||||
System.out.println("[RuneLitePlus] Transforming Client");
|
log.info("[RuneLitePlus] Transforming Stack Trace");
|
||||||
ClientTransform bt = new ClientTransform();
|
ErrorTransform et = new ErrorTransform();
|
||||||
bt.modify(clazz);
|
et.modify(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ public class Hooks {
|
|||||||
public String projectileClass = "";
|
public String projectileClass = "";
|
||||||
public String playerClass = "";
|
public String playerClass = "";
|
||||||
public String[] protectedStuff;
|
public String[] protectedStuff;
|
||||||
|
public String clientClass = "";
|
||||||
|
|
||||||
public Hooks() {
|
public Hooks() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ import javassist.CtClass;
|
|||||||
import javassist.CtMethod;
|
import javassist.CtMethod;
|
||||||
import javassist.CtNewMethod;
|
import javassist.CtNewMethod;
|
||||||
import javassist.NotFoundException;
|
import javassist.NotFoundException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.client.rs.bytecode.ByteCodePatcher;
|
import net.runelite.client.rs.bytecode.ByteCodePatcher;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class ActorTransform implements Transform
|
public class ActorTransform implements Transform
|
||||||
{
|
{
|
||||||
private CtClass ct;
|
private CtClass ct;
|
||||||
@@ -47,6 +49,13 @@ public class ActorTransform implements Transform
|
|||||||
" return this.getRsAnimation();" +
|
" return this.getRsAnimation();" +
|
||||||
"}", ct);
|
"}", ct);
|
||||||
ct.addMethod(getAnimation);
|
ct.addMethod(getAnimation);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -63,6 +72,13 @@ public class ActorTransform implements Transform
|
|||||||
ByteCodePatcher.clientInstance + ".getCallbacks().post((java.lang.Object)animationChanged);" +
|
ByteCodePatcher.clientInstance + ".getCallbacks().post((java.lang.Object)animationChanged);" +
|
||||||
"}", ct);
|
"}", ct);
|
||||||
ct.addMethod(getAnimationChanged);
|
ct.addMethod(getAnimationChanged);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformGraphicChanged() throws CannotCompileException, NotFoundException
|
private void transformGraphicChanged() throws CannotCompileException, NotFoundException
|
||||||
@@ -78,6 +94,13 @@ public class ActorTransform implements Transform
|
|||||||
ByteCodePatcher.clientInstance + ".getCallbacks().post(localGraphicChanged);" +
|
ByteCodePatcher.clientInstance + ".getCallbacks().post(localGraphicChanged);" +
|
||||||
"}", ct);
|
"}", ct);
|
||||||
ct.addMethod(graphicChanged);
|
ct.addMethod(graphicChanged);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,10 @@ import javassist.NotFoundException;
|
|||||||
import javassist.bytecode.AnnotationsAttribute;
|
import javassist.bytecode.AnnotationsAttribute;
|
||||||
import javassist.bytecode.ClassFile;
|
import javassist.bytecode.ClassFile;
|
||||||
import javassist.bytecode.ConstPool;
|
import javassist.bytecode.ConstPool;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.client.rs.bytecode.ByteCodePatcher;
|
import net.runelite.client.rs.bytecode.ByteCodePatcher;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class ClientTransform implements Transform
|
public class ClientTransform implements Transform
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -55,6 +57,13 @@ public class ClientTransform implements Transform
|
|||||||
|
|
||||||
protectedGetMenuOptions.setName("getMenuOptions");
|
protectedGetMenuOptions.setName("getMenuOptions");
|
||||||
ct.addMethod(protectedGetMenuOptions);
|
ct.addMethod(protectedGetMenuOptions);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformGetProjectiles() throws CannotCompileException, NotFoundException
|
private void transformGetProjectiles() throws CannotCompileException, NotFoundException
|
||||||
@@ -87,7 +96,13 @@ public class ClientTransform implements Transform
|
|||||||
javassist.bytecode.annotation.Annotation annotation = new javassist.bytecode.annotation.Annotation("Override", constPool);
|
javassist.bytecode.annotation.Annotation annotation = new javassist.bytecode.annotation.Annotation("Override", constPool);
|
||||||
attr.setAnnotation(annotation);
|
attr.setAnnotation(annotation);
|
||||||
getProjectiles.getMethodInfo().addAttribute(attr);
|
getProjectiles.getMethodInfo().addAttribute(attr);
|
||||||
System.out.println("Added override annotation for getprojectiles");
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformProtectedGetMenuTargets() throws CannotCompileException, NotFoundException
|
private void transformProtectedGetMenuTargets() throws CannotCompileException, NotFoundException
|
||||||
@@ -99,6 +114,13 @@ public class ClientTransform implements Transform
|
|||||||
|
|
||||||
protectedGetMenuTargets.setName("getMenuTargets");
|
protectedGetMenuTargets.setName("getMenuTargets");
|
||||||
ct.addMethod(protectedGetMenuTargets);
|
ct.addMethod(protectedGetMenuTargets);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformGetCollisionMaps() throws CannotCompileException, NotFoundException
|
private void transformGetCollisionMaps() throws CannotCompileException, NotFoundException
|
||||||
@@ -116,6 +138,13 @@ public class ClientTransform implements Transform
|
|||||||
|
|
||||||
getCollisionMaps = CtMethod.make("public net.runelite.rs.api.RSCollisionData[] getCollisionMaps() { return getRsCollisionMaps(); }", ct);
|
getCollisionMaps = CtMethod.make("public net.runelite.rs.api.RSCollisionData[] getCollisionMaps() { return getRsCollisionMaps(); }", ct);
|
||||||
ct.addMethod(getCollisionMaps);
|
ct.addMethod(getCollisionMaps);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformProtectedGetMenuIdentifiers() throws CannotCompileException, NotFoundException
|
private void transformProtectedGetMenuIdentifiers() throws CannotCompileException, NotFoundException
|
||||||
@@ -127,6 +156,13 @@ public class ClientTransform implements Transform
|
|||||||
|
|
||||||
protectedGetMenuIdentifiers.setName("getMenuIdentifiers");
|
protectedGetMenuIdentifiers.setName("getMenuIdentifiers");
|
||||||
ct.addMethod(protectedGetMenuIdentifiers);
|
ct.addMethod(protectedGetMenuIdentifiers);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformProtectedGetMenuTypes() throws CannotCompileException, NotFoundException
|
private void transformProtectedGetMenuTypes() throws CannotCompileException, NotFoundException
|
||||||
@@ -141,6 +177,13 @@ public class ClientTransform implements Transform
|
|||||||
newProtectedGetMenuTypes.setName("getMenuTypes");
|
newProtectedGetMenuTypes.setName("getMenuTypes");
|
||||||
|
|
||||||
ct.addMethod(newProtectedGetMenuTypes);
|
ct.addMethod(newProtectedGetMenuTypes);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformProtectedGetMenuActionParams0() throws CannotCompileException, NotFoundException
|
private void transformProtectedGetMenuActionParams0() throws CannotCompileException, NotFoundException
|
||||||
@@ -152,6 +195,13 @@ public class ClientTransform implements Transform
|
|||||||
|
|
||||||
protectedGetMenuActionParams0.setName("getMenuActionParams0");
|
protectedGetMenuActionParams0.setName("getMenuActionParams0");
|
||||||
ct.addMethod(protectedGetMenuActionParams0);
|
ct.addMethod(protectedGetMenuActionParams0);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformProtectedGetMenuActionParams1() throws CannotCompileException, NotFoundException
|
private void transformProtectedGetMenuActionParams1() throws CannotCompileException, NotFoundException
|
||||||
@@ -162,6 +212,13 @@ public class ClientTransform implements Transform
|
|||||||
ct.removeMethod(protectedGetMenuActionParams1);
|
ct.removeMethod(protectedGetMenuActionParams1);
|
||||||
protectedGetMenuActionParams1.setName("getMenuActionParams1");
|
protectedGetMenuActionParams1.setName("getMenuActionParams1");
|
||||||
ct.addMethod(protectedGetMenuActionParams1);
|
ct.addMethod(protectedGetMenuActionParams1);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformGetMenuEntries() throws CannotCompileException, NotFoundException
|
private void transformGetMenuEntries() throws CannotCompileException, NotFoundException
|
||||||
@@ -199,6 +256,13 @@ public class ClientTransform implements Transform
|
|||||||
" return arrmenuEntry;" +
|
" return arrmenuEntry;" +
|
||||||
"}", ct);
|
"}", ct);
|
||||||
ct.addMethod(getMenuEntries);
|
ct.addMethod(getMenuEntries);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformSetMenuEntries() throws CannotCompileException, NotFoundException
|
private void transformSetMenuEntries() throws CannotCompileException, NotFoundException
|
||||||
@@ -273,6 +337,13 @@ public class ClientTransform implements Transform
|
|||||||
, ct);
|
, ct);
|
||||||
|
|
||||||
ct.addMethod(onMenuOptionsChanged);
|
ct.addMethod(onMenuOptionsChanged);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformRenderSelf() throws CannotCompileException
|
private void transformRenderSelf() throws CannotCompileException
|
||||||
@@ -289,6 +360,13 @@ public class ClientTransform implements Transform
|
|||||||
renderSelf.getMethodInfo().addAttribute(attr);
|
renderSelf.getMethodInfo().addAttribute(attr);
|
||||||
|
|
||||||
ct.addMethod(renderSelf);
|
ct.addMethod(renderSelf);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformDraw2010Menu() throws CannotCompileException, NotFoundException
|
private void transformDraw2010Menu() throws CannotCompileException, NotFoundException
|
||||||
@@ -350,6 +428,13 @@ public class ClientTransform implements Transform
|
|||||||
"}"
|
"}"
|
||||||
, ct);
|
, ct);
|
||||||
ct.addMethod(draw2010Menu);
|
ct.addMethod(draw2010Menu);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: fix not being able to click far away objects towards top of screen only.
|
//TODO: fix not being able to click far away objects towards top of screen only.
|
||||||
@@ -431,6 +516,13 @@ public class ClientTransform implements Transform
|
|||||||
" return false;" +
|
" return false;" +
|
||||||
"}", ct);
|
"}", ct);
|
||||||
ct.addMethod(boundingboxCheck2);
|
ct.addMethod(boundingboxCheck2);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformcheckClickBox() throws CannotCompileException, NotFoundException
|
private void transformcheckClickBox() throws CannotCompileException, NotFoundException
|
||||||
@@ -539,5 +631,12 @@ public class ClientTransform implements Transform
|
|||||||
" }" +
|
" }" +
|
||||||
"}", ct);
|
"}", ct);
|
||||||
ct.addMethod(checkClickBox);
|
ct.addMethod(checkClickBox);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import javassist.CannotCompileException;
|
|||||||
import javassist.CtClass;
|
import javassist.CtClass;
|
||||||
import javassist.CtMethod;
|
import javassist.CtMethod;
|
||||||
import javassist.NotFoundException;
|
import javassist.NotFoundException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.client.rs.bytecode.ByteCodePatcher;
|
import net.runelite.client.rs.bytecode.ByteCodePatcher;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
// This prevents the client from sending stack traces to Jagex at all, even classes outside of runelite.
|
// This prevents the client from sending stack traces to Jagex at all, even classes outside of runelite.
|
||||||
public class ErrorTransform implements Transform
|
public class ErrorTransform implements Transform
|
||||||
{
|
{
|
||||||
@@ -21,8 +23,6 @@ public class ErrorTransform implements Transform
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
System.out.println("[RuneLitePlus] Transforming error method at class: " + ERROR_INSTANCE_CLASS);
|
|
||||||
|
|
||||||
ct = ByteCodePatcher.classPool.get(ERROR_INSTANCE_CLASS);
|
ct = ByteCodePatcher.classPool.get(ERROR_INSTANCE_CLASS);
|
||||||
transformError();
|
transformError();
|
||||||
|
|
||||||
@@ -46,5 +46,12 @@ public class ErrorTransform implements Transform
|
|||||||
" System.out.println(\"[RuneLitePlus] Prevented preceeding stack trace from being sent to Jagex\");" +
|
" System.out.println(\"[RuneLitePlus] Prevented preceeding stack trace from being sent to Jagex\");" +
|
||||||
"}", ct);
|
"}", ct);
|
||||||
ct.addMethod(error);
|
ct.addMethod(error);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ import javassist.CtClass;
|
|||||||
import javassist.CtMethod;
|
import javassist.CtMethod;
|
||||||
import javassist.CtNewMethod;
|
import javassist.CtNewMethod;
|
||||||
import javassist.NotFoundException;
|
import javassist.NotFoundException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.client.rs.bytecode.ByteCodePatcher;
|
import net.runelite.client.rs.bytecode.ByteCodePatcher;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class PlayerTransform implements Transform
|
public class PlayerTransform implements Transform
|
||||||
{
|
{
|
||||||
private CtClass ct;
|
private CtClass ct;
|
||||||
@@ -36,6 +38,13 @@ public class PlayerTransform implements Transform
|
|||||||
protectedGetSkullIcon.setName("getRsSkullIcon");
|
protectedGetSkullIcon.setName("getRsSkullIcon");
|
||||||
|
|
||||||
ct.addMethod(protectedGetSkullIcon);
|
ct.addMethod(protectedGetSkullIcon);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformGetSkullIcon() throws CannotCompileException, NotFoundException
|
private void transformGetSkullIcon() throws CannotCompileException, NotFoundException
|
||||||
@@ -69,5 +78,12 @@ public class PlayerTransform implements Transform
|
|||||||
"return null;" +
|
"return null;" +
|
||||||
"}", ct);
|
"}", ct);
|
||||||
ct.addMethod(getSkullIcon);
|
ct.addMethod(getSkullIcon);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ import javassist.CtClass;
|
|||||||
import javassist.CtMethod;
|
import javassist.CtMethod;
|
||||||
import javassist.CtNewMethod;
|
import javassist.CtNewMethod;
|
||||||
import javassist.NotFoundException;
|
import javassist.NotFoundException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.client.rs.bytecode.ByteCodePatcher;
|
import net.runelite.client.rs.bytecode.ByteCodePatcher;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class ProjectileTransform implements Transform
|
public class ProjectileTransform implements Transform
|
||||||
{
|
{
|
||||||
private CtClass ct;
|
private CtClass ct;
|
||||||
@@ -49,6 +51,13 @@ public class ProjectileTransform implements Transform
|
|||||||
ByteCodePatcher.clientInstance + ".getCallbacks().post(projectileMoved);" +
|
ByteCodePatcher.clientInstance + ".getCallbacks().post(projectileMoved);" +
|
||||||
"}", ct);
|
"}", ct);
|
||||||
ct.addMethod(getAnimation);
|
ct.addMethod(getAnimation);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformInteracting() throws CannotCompileException
|
private void transformInteracting() throws CannotCompileException
|
||||||
@@ -92,5 +101,12 @@ public class ProjectileTransform implements Transform
|
|||||||
" }" +
|
" }" +
|
||||||
"}", ct);
|
"}", ct);
|
||||||
ct.addMethod(getInteracting);
|
ct.addMethod(getInteracting);
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
"[RuneLitePlus] transformed {} ({}) at class: {}",
|
||||||
|
this.getClass().getSimpleName(),
|
||||||
|
new Object(){}.getClass().getEnclosingMethod().getName(),
|
||||||
|
ct.getName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user