Merge remote-tracking branch 'ext_upstream/master' into master3

# Conflicts:
#	deobfuscator/pom.xml
#	deobfuscator/src/main/java/net/runelite/asm/attributes/Exceptions.java
#	deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Element.java
#	deobfuscator/src/main/java/net/runelite/asm/attributes/code/InstructionType.java
#	deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/FieldInstruction.java
#	deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/LVTInstruction.java
#	deobfuscator/src/main/java/net/runelite/asm/attributes/code/instructions/PutField.java
#	deobfuscator/src/main/java/net/runelite/asm/pool/Class.java
#	deobfuscator/src/main/java/net/runelite/asm/pool/Field.java
#	deobfuscator/src/main/java/net/runelite/deob/Deob.java
#	deobfuscator/src/main/java/net/runelite/deob/DeobProperties.java
#	deobfuscator/src/main/java/net/runelite/deob/clientver/VersionClassVisitor.java
#	deobfuscator/src/main/java/net/runelite/deob/deobfuscators/lvt/LVTType.java
#	deobfuscator/src/main/java/net/runelite/deob/deobfuscators/lvt/MapKey.java
#	deobfuscator/src/main/java/net/runelite/deob/deobfuscators/mapping/ConstructorMapper.java
#	deobfuscator/src/main/java/net/runelite/deob/deobfuscators/mapping/ExecutionMapper.java
#	deobfuscator/src/main/java/net/runelite/deob/deobfuscators/mapping/Mapper.java
#	deobfuscator/src/main/java/net/runelite/deob/deobfuscators/mapping/ParallelExecutorMapping.java
#	deobfuscator/src/main/java/net/runelite/deob/updater/ParameterRenamer.java
#	deobfuscator/src/test/java/net/runelite/asm/annotations/MyAnnotation.java
#	deobfuscator/src/test/java/net/runelite/asm/execution/mapper/StaticStepTest.java
#	deobfuscator/src/test/java/net/runelite/asm/execution/tests/TableSwitch.java
#	deobfuscator/src/test/java/net/runelite/asm/signature/SignatureTest.java
#	deobfuscator/src/test/java/net/runelite/asm/visitors/ClassFileVisitorTest.java
#	deobfuscator/src/test/java/net/runelite/deob/TemporyFolderLocation.java
#	deobfuscator/src/test/java/net/runelite/deob/clientver/ClientVersionTest.java
#	deobfuscator/src/test/java/net/runelite/deob/deobfuscators/transformers/buffer/RuneliteBufferTest.java
#	deobfuscator/src/test/java/net/runelite/deob/deobfuscators/unusedclass/ClassA.java
#	deobfuscator/src/test/java/net/runelite/deob/deobfuscators/unusedclass/EmptyClass.java
#	deobfuscator/src/test/java/net/runelite/deob/deobfuscators/unusedclass/EmptyInterface.java
#	deobfuscator/src/test/java/net/runelite/osb/inject/FieldHook.java
#	injected-client/pom.xml
#	injector-plugin/pom.xml
#	injector-plugin/src/main/java/net/runelite/injector/Inject.java
#	injector-plugin/src/main/java/net/runelite/injector/InjectMojo.java
#	injector-plugin/src/main/java/net/runelite/injector/InjectionException.java
#	injector-plugin/src/main/java/net/runelite/injector/MixinInjector.java
#	injector-plugin/src/main/java/net/runelite/injector/raw/ClearColorBuffer.java
#	injector-plugin/src/main/java/net/runelite/injector/raw/DrawAfterWidgets.java
#	injector-plugin/src/main/java/net/runelite/injector/raw/RasterizerHook.java
#	pom.xml
#	runelite-api/src/main/java/net/runelite/api/Actor.java
#	runelite-api/src/main/java/net/runelite/api/Client.java
#	runelite-api/src/main/java/net/runelite/api/CollisionData.java
#	runelite-api/src/main/java/net/runelite/api/EquipmentInventorySlot.java
#	runelite-api/src/main/java/net/runelite/api/NPCDefinition.java
#	runelite-api/src/main/java/net/runelite/api/Perspective.java
#	runelite-api/src/main/java/net/runelite/api/coords/WorldArea.java
#	runelite-api/src/main/java/net/runelite/api/coords/WorldPoint.java
#	runelite-api/src/main/java/net/runelite/api/events/GraphicChanged.java
#	runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java
#	runelite-api/src/main/java/net/runelite/api/events/NpcActionChanged.java
#	runelite-api/src/main/java/net/runelite/api/events/PostItemDefinition.java
#	runelite-api/src/main/java/net/runelite/api/events/SpotAnimationChanged.java
#	runelite-api/src/main/java/net/runelite/api/vars/AccountType.java
#	runelite-api/src/main/java/net/runelite/mapping/Construct.java
#	runelite-api/src/main/java/net/runelite/mapping/Hook.java
#	runelite-api/src/main/java/net/runelite/mapping/Implements.java
#	runelite-api/src/main/java/net/runelite/mapping/ObfuscatedSignature.java
#	runelite-client/src/main/java/net/runelite/client/game/ItemManager.java
#	runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java
#	runelite-client/src/main/java/net/runelite/client/plugins/barrows/BarrowsOverlay.java
#	runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java
#	runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java
#	runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/MapClue.java
#	runelite-client/src/main/java/net/runelite/client/plugins/cooking/CookingPlugin.java
#	runelite-client/src/main/java/net/runelite/client/plugins/equipmentinspector/EquipmentInspectorPlugin.java
#	runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java
#	runelite-client/src/main/java/net/runelite/client/plugins/highalchemy/HighAlchemyOverlay.java
#	runelite-client/src/main/java/net/runelite/client/plugins/instancemap/InstanceMapOverlay.java
#	runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesPlugin.java
#	runelite-client/src/main/java/net/runelite/client/plugins/inventorysetups/InventorySetupPlugin.java
#	runelite-client/src/main/java/net/runelite/client/plugins/inventoryviewer/InventoryViewerOverlay.java
#	runelite-client/src/main/java/net/runelite/client/plugins/loginscreen/LoginScreenPlugin.java
#	runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsPlugin.java
#	runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java
#	runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsPlugin.java
#	runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderOverlay.java
#	runelite-client/src/main/java/net/runelite/client/plugins/skillcalculator/banked/CriticalItem.java
#	runelite-client/src/main/java/net/runelite/client/plugins/wiki/WikiPlugin.java
#	runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java
#	runelite-client/src/main/java/net/runelite/client/ui/overlay/arrow/ArrowUtil.java
#	runelite-client/src/main/java/net/runelite/client/util/PvPUtil.java
#	runelite-client/src/test/java/net/runelite/client/plugins/cooking/CookingPluginTest.java
#	runelite-mixins/src/main/java/net/runelite/mixins/RSAbstractIndexCacheMixin.java
#	runelite-mixins/src/main/java/net/runelite/mixins/RSActorMixin.java
#	runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java
#	runelite-mixins/src/main/java/net/runelite/mixins/RSMessageMixin.java
#	runelite-mixins/src/main/java/net/runelite/mixins/RSPlayerCompositionMixin.java
#	runelite-mixins/src/main/java/net/runelite/mixins/RSTileMixin.java
#	runescape-api/src/main/java/net/runelite/mapping/Implements.java
#	runescape-api/src/main/java/net/runelite/mapping/ObfuscatedSignature.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSBufferProvider.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSClient.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSCollisionData.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSCombatInfo1.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSCombatInfoListHolder.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSDecorativeObject.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSFriendContainer.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSGameShell.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSGroundObject.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSItem.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSItemLayer.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSIterableNodeDeque.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSJagexLoginType.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSKeyHandler.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSMainBufferProvider.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSMapElementConfig.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSMessage.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSMessageNode.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSModel.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSPlayerComposition.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSRasterProvider.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSSequenceDefinition.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSSpritePixels.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSWallObject.java
#	runescape-api/src/main/java/net/runelite/rs/api/RSWorldMap.java
This commit is contained in:
Lucas
2019-06-08 23:06:59 +02:00
490 changed files with 740 additions and 38563 deletions

View File

@@ -38,19 +38,19 @@ import net.runelite.cache.models.VertexNormal;
public class ItemSpriteFactory public class ItemSpriteFactory
{ {
public static final BufferedImage createSprite(ItemProvider itemProvider, ModelProvider modelProvider, public static final BufferedImage createSprite(ItemProvider itemProvider, ModelProvider modelProvider,
SpriteProvider spriteProvider, TextureProvider textureProvider, SpriteProvider spriteProvider, TextureProvider textureProvider,
int itemId, int quantity, int border, int shadowColor, int itemId, int quantity, int border, int shadowColor,
boolean noted) throws IOException boolean noted) throws IOException
{ {
SpritePixels spritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, Sprite spritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider,
itemId, quantity, border, shadowColor, noted); itemId, quantity, border, shadowColor, noted);
return spritePixels == null ? null : spritePixels.toBufferedImage(); return spritePixels == null ? null : spritePixels.toBufferedImage();
} }
private static final SpritePixels createSpritePixels(ItemProvider itemProvider, ModelProvider modelProvider, private static final Sprite createSpritePixels(ItemProvider itemProvider, ModelProvider modelProvider,
SpriteProvider spriteProvider, TextureProvider textureProvider, SpriteProvider spriteProvider, TextureProvider textureProvider,
int itemId, int quantity, int border, int shadowColor, int itemId, int quantity, int border, int shadowColor,
boolean noted) throws IOException boolean noted) throws IOException
{ {
ItemDefinition item = itemProvider.provide(itemId); ItemDefinition item = itemProvider.provide(itemId);
@@ -83,11 +83,11 @@ public class ItemSpriteFactory
return null; return null;
} }
SpritePixels auxSpritePixels = null; Sprite auxSpritePixels = null;
if (item.notedTemplate != -1) if (item.notedTemplate != -1)
{ {
auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider,
item.notedID, 10, 1, 0, true); item.notedID, 10, 1, 0, true);
if (auxSpritePixels == null) if (auxSpritePixels == null)
{ {
return null; return null;
@@ -96,7 +96,7 @@ public class ItemSpriteFactory
else if (item.boughtTemplateId != -1) else if (item.boughtTemplateId != -1)
{ {
auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider,
item.boughtId, quantity, border, shadowColor, false); item.boughtId, quantity, border, shadowColor, false);
if (auxSpritePixels == null) if (auxSpritePixels == null)
{ {
return null; return null;
@@ -105,7 +105,7 @@ public class ItemSpriteFactory
else if (item.placeholderTemplateId != -1) else if (item.placeholderTemplateId != -1)
{ {
auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider,
item.placeholderId, quantity, 0, 0, false); item.placeholderId, quantity, 0, 0, false);
if (auxSpritePixels == null) if (auxSpritePixels == null)
{ {
return null; return null;
@@ -114,7 +114,7 @@ public class ItemSpriteFactory
RSTextureProvider rsTextureProvider = new RSTextureProvider(textureProvider, spriteProvider); RSTextureProvider rsTextureProvider = new RSTextureProvider(textureProvider, spriteProvider);
SpritePixels spritePixels = new SpritePixels(36, 32); Sprite spritePixels = new Sprite(36, 32);
Graphics3D graphics = new Graphics3D(rsTextureProvider); Graphics3D graphics = new Graphics3D(rsTextureProvider);
graphics.setBrightness(0.6d); graphics.setBrightness(0.6d);
graphics.setRasterBuffer(spritePixels.pixels, 36, 32); graphics.setRasterBuffer(spritePixels.pixels, 36, 32);
@@ -142,12 +142,12 @@ public class ItemSpriteFactory
itemModel.calculateBoundsCylinder(); itemModel.calculateBoundsCylinder();
itemModel.rotateAndProject(graphics, 0, itemModel.rotateAndProject(graphics, 0,
item.yan2d, item.yan2d,
item.zan2d, item.zan2d,
item.xan2d, item.xan2d,
item.xOffset2d, item.xOffset2d,
itemModel.modelHeight / 2 + var17 + item.yOffset2d, itemModel.modelHeight / 2 + var17 + item.yOffset2d,
var18 + item.yOffset2d); var18 + item.yOffset2d);
if (item.boughtTemplateId != -1) if (item.boughtTemplateId != -1)
{ {
auxSpritePixels.drawAtOn(graphics, 0, 0); auxSpritePixels.drawAtOn(graphics, 0, 0);
@@ -175,8 +175,8 @@ public class ItemSpriteFactory
} }
graphics.setRasterBuffer(graphics.graphicsPixels, graphics.setRasterBuffer(graphics.graphicsPixels,
graphics.graphicsPixelsWidth, graphics.graphicsPixelsWidth,
graphics.graphicsPixelsHeight); graphics.graphicsPixelsHeight);
graphics.setRasterClipping(); graphics.setRasterClipping();
graphics.rasterGouraudLowRes = true; graphics.rasterGouraudLowRes = true;

View File

@@ -26,7 +26,7 @@ package net.runelite.cache.item;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
class SpritePixels class Sprite
{ {
public int[] pixels; public int[] pixels;
public int width; public int width;
@@ -34,7 +34,7 @@ class SpritePixels
public int offsetX; public int offsetX;
int offsetY; int offsetY;
public SpritePixels(int[] var1, int var2, int var3) public Sprite(int[] var1, int var2, int var3)
{ {
this.pixels = var1; this.pixels = var1;
this.width = var2; this.width = var2;
@@ -43,7 +43,7 @@ class SpritePixels
this.offsetX = 0; this.offsetX = 0;
} }
public SpritePixels(int var1, int var2) public Sprite(int var1, int var2)
{ {
this(new int[var2 * var1], var1, var2); this(new int[var2 * var1], var1, var2);
} }

View File

@@ -39,7 +39,12 @@
<dependency> <dependency>
<groupId>net.runelite</groupId> <groupId>net.runelite</groupId>
<artifactId>runelite-api</artifactId> <artifactId>runelite-api</artifactId>
<version>1.5.27-SNAPSHOT</version> <version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.runelite.rs</groupId>
<artifactId>runescape-api</artifactId>
<version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.runelite</groupId> <groupId>net.runelite</groupId>
@@ -75,14 +80,9 @@
<dependency> <dependency>
<groupId>net.runelite.rs</groupId> <groupId>net.runelite.rs</groupId>
<artifactId>rs-client</artifactId> <artifactId>rs-client</artifactId>
<version>1.5.27-SNAPSHOT</version> <version>${project.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>net.runelite.rs</groupId>
<artifactId>runescape-api</artifactId>
<version>1.5.27-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>net.runelite.rs</groupId> <groupId>net.runelite.rs</groupId>
<artifactId>vanilla</artifactId> <artifactId>vanilla</artifactId>

View File

@@ -36,6 +36,6 @@ public class DeobProperties
InputStream resourceAsStream = DeobProperties.class.getResourceAsStream("/deob.properties"); InputStream resourceAsStream = DeobProperties.class.getResourceAsStream("/deob.properties");
properties.load(resourceAsStream); properties.load(resourceAsStream);
return properties.getProperty("git.commit.id"); return "420";
} }
} }

View File

@@ -31,5 +31,7 @@ public class TestClass
public int field1; public int field1;
@MyAnnotation("method1") @MyAnnotation("method1")
public void method1() { } public void method1()
{
}
} }

View File

@@ -67,11 +67,12 @@ public class MultiplyOneDeobfuscatorTest
ins.addInstruction(i); ins.addInstruction(i);
Label label = new Label(ins), Label label = new Label(ins),
label2 = new Label(ins); label2 = new Label(ins);
LDC one = new LDC(ins, 1); LDC one = new LDC(ins, 1);
Instruction body[] = { Instruction body[] =
{
new SiPush(ins, (short) 256), new SiPush(ins, (short) 256),
new ILoad(ins, 0), new ILoad(ins, 0),
@@ -122,7 +123,7 @@ public class MultiplyOneDeobfuscatorTest
ins.addInstruction(i); ins.addInstruction(i);
Label label = new Label(ins), Label label = new Label(ins),
label2 = new Label(ins); label2 = new Label(ins);
LDC one = new LDC(ins, 1); LDC one = new LDC(ins, 1);
IMul mul = new IMul(ins); IMul mul = new IMul(ins);
@@ -204,8 +205,8 @@ public class MultiplyOneDeobfuscatorTest
ins.addInstruction(i); ins.addInstruction(i);
Label label = new Label(ins), Label label = new Label(ins),
label2 = new Label(ins), label2 = new Label(ins),
label3 = new Label(ins); label3 = new Label(ins);
LDC one = new LDC(ins, 1); LDC one = new LDC(ins, 1);
IMul mul = new IMul(ins); IMul mul = new IMul(ins);

View File

@@ -24,7 +24,6 @@
*/ */
package net.runelite.deob.deobfuscators.exprargorder; package net.runelite.deob.deobfuscators.exprargorder;
import java.io.File;
import java.util.List; import java.util.List;
import net.runelite.asm.ClassGroup; import net.runelite.asm.ClassGroup;
import net.runelite.asm.attributes.Code; import net.runelite.asm.attributes.Code;
@@ -48,7 +47,6 @@ import net.runelite.asm.attributes.code.instructions.Pop;
import net.runelite.asm.attributes.code.instructions.SiPush; import net.runelite.asm.attributes.code.instructions.SiPush;
import net.runelite.asm.attributes.code.instructions.VReturn; import net.runelite.asm.attributes.code.instructions.VReturn;
import net.runelite.deob.ClassGroupFactory; import net.runelite.deob.ClassGroupFactory;
import net.runelite.deob.util.JarUtil;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import org.junit.Test; import org.junit.Test;

View File

@@ -31,7 +31,6 @@ import net.runelite.asm.ClassGroup;
import net.runelite.deob.TemporyFolderLocation; import net.runelite.deob.TemporyFolderLocation;
import net.runelite.deob.util.JarUtil; import net.runelite.deob.util.JarUtil;
import org.junit.After; import org.junit.After;
import org.junit.Test;
import org.junit.Before; import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
import org.junit.rules.TemporaryFolder; import org.junit.rules.TemporaryFolder;

View File

@@ -31,7 +31,6 @@ import net.runelite.asm.ClassGroup;
import net.runelite.deob.util.JarUtil; import net.runelite.deob.util.JarUtil;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test;
public class AnnotationRenamerTest public class AnnotationRenamerTest
{ {

View File

@@ -33,11 +33,11 @@ import java.net.URL;
import java.net.URLClassLoader; import java.net.URLClassLoader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.runelite.runeloader.inject.GetterInjectInstruction;
import net.runelite.runeloader.inject.InjectionModscript;
import net.runelite.mapping.Export; import net.runelite.mapping.Export;
import net.runelite.mapping.ObfuscatedName; import net.runelite.mapping.ObfuscatedName;
import net.runelite.runeloader.inject.GetterInjectInstruction;
import net.runelite.runeloader.inject.Injection; import net.runelite.runeloader.inject.Injection;
import net.runelite.runeloader.inject.InjectionModscript;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore; import org.junit.Ignore;
@@ -52,7 +52,7 @@ public class CheckExports
@Before @Before
public void before() throws MalformedURLException, ClassNotFoundException public void before() throws MalformedURLException, ClassNotFoundException
{ {
ClassLoader loader = new URLClassLoader(new URL[] { CLIENT.toURL() }); ClassLoader loader = new URLClassLoader(new URL[]{CLIENT.toURL()});
Class c = loader.loadClass("net.runelite.rs.client.client"); Class c = loader.loadClass("net.runelite.rs.client.client");
classes.add(c); classes.add(c);
@@ -75,14 +75,20 @@ public class CheckExports
for (Class c : classes) for (Class c : classes)
{ {
if (c.getName().equals("net.runelite.rs.client.client") && name.equals("client")) if (c.getName().equals("net.runelite.rs.client.client") && name.equals("client"))
{
return c; return c;
}
ObfuscatedName oc = (ObfuscatedName) c.getDeclaredAnnotation(ObfuscatedName.class); ObfuscatedName oc = (ObfuscatedName) c.getDeclaredAnnotation(ObfuscatedName.class);
if (oc == null) if (oc == null)
{
continue; continue;
}
if (oc.value().equals(name)) if (oc.value().equals(name))
{
return c; return c;
}
} }
return null; return null;
} }
@@ -91,19 +97,23 @@ public class CheckExports
{ {
for (Field f : c.getDeclaredFields()) for (Field f : c.getDeclaredFields())
{ {
ObfuscatedName oc = (ObfuscatedName) f.getDeclaredAnnotation(ObfuscatedName.class); ObfuscatedName oc = f.getDeclaredAnnotation(ObfuscatedName.class);
if (oc == null) if (oc == null)
{
continue; continue;
}
if (oc.value().equals(name)) if (oc.value().equals(name))
{
return f; return f;
}
} }
return null; return null;
} }
private boolean isExported(Field f) private boolean isExported(Field f)
{ {
Export export = (Export) f.getDeclaredAnnotation(Export.class); Export export = f.getDeclaredAnnotation(Export.class);
return export != null; return export != null;
} }
@@ -115,7 +125,7 @@ public class CheckExports
for (int i = 0; i < mod.getGetterInjects().size(); ++i) for (int i = 0; i < mod.getGetterInjects().size(); ++i)
{ {
GetterInjectInstruction gii = (GetterInjectInstruction) mod.getGetterInjects().get(i); GetterInjectInstruction gii = mod.getGetterInjects().get(i);
Class c = this.findClassWithObfuscatedName(gii.getGetterClassName()); Class c = this.findClassWithObfuscatedName(gii.getGetterClassName());
Assert.assertNotNull(c); Assert.assertNotNull(c);

View File

@@ -33,12 +33,12 @@ import java.net.URL;
import java.net.URLClassLoader; import java.net.URLClassLoader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.runelite.runeloader.inject.GetterInjectInstruction;
import net.runelite.runeloader.inject.InjectionModscript;
import net.runelite.mapping.Export; import net.runelite.mapping.Export;
import net.runelite.mapping.ObfuscatedGetter; import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName; import net.runelite.mapping.ObfuscatedName;
import net.runelite.runeloader.inject.GetterInjectInstruction;
import net.runelite.runeloader.inject.Injection; import net.runelite.runeloader.inject.Injection;
import net.runelite.runeloader.inject.InjectionModscript;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore; import org.junit.Ignore;
@@ -53,7 +53,7 @@ public class CheckMappings
@Before @Before
public void before() throws MalformedURLException, ClassNotFoundException public void before() throws MalformedURLException, ClassNotFoundException
{ {
ClassLoader loader = new URLClassLoader(new URL[] { CLIENT.toURL() }); ClassLoader loader = new URLClassLoader(new URL[]{CLIENT.toURL()});
Class c = loader.loadClass("client"); Class c = loader.loadClass("client");
classes.add(c); classes.add(c);
@@ -76,14 +76,20 @@ public class CheckMappings
for (Class c : classes) for (Class c : classes)
{ {
if (c.getName().equals("net.runelite.rs.client.client") && name.equals("client")) if (c.getName().equals("net.runelite.rs.client.client") && name.equals("client"))
{
return c; return c;
}
ObfuscatedName oc = (ObfuscatedName) c.getDeclaredAnnotation(ObfuscatedName.class); ObfuscatedName oc = (ObfuscatedName) c.getDeclaredAnnotation(ObfuscatedName.class);
if (oc == null) if (oc == null)
{
continue; continue;
}
if (oc.value().equals(name)) if (oc.value().equals(name))
{
return c; return c;
}
} }
return null; return null;
} }
@@ -92,29 +98,37 @@ public class CheckMappings
{ {
for (Field f : c.getDeclaredFields()) for (Field f : c.getDeclaredFields())
{ {
ObfuscatedName oc = (ObfuscatedName) f.getDeclaredAnnotation(ObfuscatedName.class); ObfuscatedName oc = f.getDeclaredAnnotation(ObfuscatedName.class);
if (oc == null) if (oc == null)
{
continue; continue;
}
if (oc.value().equals(name)) if (oc.value().equals(name))
{
return f; return f;
}
} }
return null; return null;
} }
private Integer getIntegerMultiplier(Field f) private Integer getIntegerMultiplier(Field f)
{ {
ObfuscatedGetter getter = (ObfuscatedGetter) f.getDeclaredAnnotation(ObfuscatedGetter.class); ObfuscatedGetter getter = f.getDeclaredAnnotation(ObfuscatedGetter.class);
if (getter == null) if (getter == null)
{
return null; return null;
}
return getter.intValue() == 0 ? null : getter.intValue(); return getter.intValue() == 0 ? null : getter.intValue();
} }
private String getExportedName(Field f) private String getExportedName(Field f)
{ {
Export e = (Export) f.getDeclaredAnnotation(Export.class); Export e = f.getDeclaredAnnotation(Export.class);
if (e == null) if (e == null)
{
return null; return null;
}
return e.value(); return e.value();
} }
@@ -126,7 +140,7 @@ public class CheckMappings
for (int i = 0; i < mod.getGetterInjects().size(); ++i) for (int i = 0; i < mod.getGetterInjects().size(); ++i)
{ {
GetterInjectInstruction gii = (GetterInjectInstruction) mod.getGetterInjects().get(i); GetterInjectInstruction gii = mod.getGetterInjects().get(i);
Class c = this.findClassWithObfuscatedName(gii.getGetterClassName()); Class c = this.findClassWithObfuscatedName(gii.getGetterClassName());
Assert.assertNotNull(c); Assert.assertNotNull(c);

View File

@@ -33,11 +33,11 @@ import net.runelite.asm.Type;
import net.runelite.asm.attributes.Annotations; import net.runelite.asm.attributes.Annotations;
import net.runelite.asm.attributes.annotation.Annotation; import net.runelite.asm.attributes.annotation.Annotation;
import net.runelite.asm.attributes.annotation.Element; import net.runelite.asm.attributes.annotation.Element;
import net.runelite.deob.util.JarUtil;
import net.runelite.runeloader.inject.AddInterfaceInstruction; import net.runelite.runeloader.inject.AddInterfaceInstruction;
import net.runelite.runeloader.inject.GetterInjectInstruction; import net.runelite.runeloader.inject.GetterInjectInstruction;
import net.runelite.runeloader.inject.InjectionModscript;
import net.runelite.deob.util.JarUtil;
import net.runelite.runeloader.inject.Injection; import net.runelite.runeloader.inject.Injection;
import net.runelite.runeloader.inject.InjectionModscript;
import org.junit.After; import org.junit.After;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
@@ -138,7 +138,7 @@ public class MappingImporter
for (int i = 0; i < mod.getGetterInjects().size(); ++i) for (int i = 0; i < mod.getGetterInjects().size(); ++i)
{ {
GetterInjectInstruction gii = (GetterInjectInstruction) mod.getGetterInjects().get(i); GetterInjectInstruction gii = mod.getGetterInjects().get(i);
ClassFile cf = this.findClassWithObfuscatedName(gii.getGetterClassName()); ClassFile cf = this.findClassWithObfuscatedName(gii.getGetterClassName());
Assert.assertNotNull(cf); Assert.assertNotNull(cf);

View File

@@ -36,7 +36,9 @@ public class Utils
} }
if (attrName.equalsIgnoreCase("fps")) if (attrName.equalsIgnoreCase("fps"))
{
attrName = "FPS"; attrName = "FPS";
}
return attrName; return attrName;
} }

View File

@@ -6,59 +6,74 @@ import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.InsnList; import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
public class MethodModInstruction { public class MethodModInstruction
private final int startIndex; {
private final AbstractInsnNode[] nodes; private final int startIndex;
public final String owner; private final AbstractInsnNode[] nodes;
public final String method; public final String owner;
public final String desc; public final String method;
public final String desc;
public MethodModInstruction(int var1, AbstractInsnNode[] var2, String var3, String var4, String var5) { public MethodModInstruction(int var1, AbstractInsnNode[] var2, String var3, String var4, String var5)
this.startIndex = var1; {
this.nodes = var2; this.startIndex = var1;
this.owner = var3; this.nodes = var2;
this.method = var4; this.owner = var3;
this.desc = var5; this.method = var4;
} this.desc = var5;
}
public boolean valid(ClassNode var1) { public boolean valid(ClassNode var1)
return var1.name.equalsIgnoreCase(this.owner); {
} return var1.name.equalsIgnoreCase(this.owner);
}
public void inject(ClassNode var1) { public void inject(ClassNode var1)
Iterator var3 = var1.methods.iterator(); {
Iterator var3 = var1.methods.iterator();
while(true) { while (true)
MethodNode var2; {
do { MethodNode var2;
do { do
if(!var3.hasNext()) { {
return; do
} {
if (!var3.hasNext())
{
return;
}
var2 = (MethodNode)var3.next(); var2 = (MethodNode) var3.next();
} while(!var2.name.equalsIgnoreCase(this.method)); } while (!var2.name.equalsIgnoreCase(this.method));
} while(!var2.desc.equalsIgnoreCase(this.desc)); } while (!var2.desc.equalsIgnoreCase(this.desc));
InsnList var4 = var2.instructions; InsnList var4 = var2.instructions;
try { try
AbstractInsnNode var5 = var4.get(this.startIndex); {
AbstractInsnNode var6 = null; AbstractInsnNode var5 = var4.get(this.startIndex);
AbstractInsnNode var6 = null;
for(int var7 = 0; var7 < this.nodes.length; ++var7) { for (int var7 = 0; var7 < this.nodes.length; ++var7)
if(var6 == null) { {
var4.insertBefore(var5, this.nodes[var7]); if (var6 == null)
} else { {
var4.insert(var6, this.nodes[var7]); var4.insertBefore(var5, this.nodes[var7]);
} }
else
{
var4.insert(var6, this.nodes[var7]);
}
var6 = this.nodes[var7]; var6 = this.nodes[var7];
} }
} catch (Exception var8) { }
System.err.println("Failed on " + this.startIndex + " @ " + this.owner + "." + this.method + " " + this.desc); catch (Exception var8)
var8.printStackTrace(); {
} System.err.println("Failed on " + this.startIndex + " @ " + this.owner + "." + this.method + " " + this.desc);
} var8.printStackTrace();
} }
}
}
} }

View File

@@ -2,18 +2,20 @@ package net.runelite.runeloader.inject;
import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.AbstractInsnNode;
public class ReplaceNodeInstruction { public class ReplaceNodeInstruction
public final String owner; {
public final String method; public final String owner;
public final String desc; public final String method;
public final int index; public final String desc;
public final AbstractInsnNode replaceWith; public final int index;
public final AbstractInsnNode replaceWith;
public ReplaceNodeInstruction(String var1, String var2, String var3, int var4, AbstractInsnNode var5) { public ReplaceNodeInstruction(String var1, String var2, String var3, int var4, AbstractInsnNode var5)
this.owner = var1; {
this.method = var2; this.owner = var1;
this.desc = var3; this.method = var2;
this.index = var4; this.desc = var3;
this.replaceWith = var5; this.index = var4;
} this.replaceWith = var5;
}
} }

View File

@@ -1,13 +1,6 @@
package net.runelite.runeloader.inject; package net.runelite.runeloader.inject;
import java.util.Iterator;
import org.objectweb.asm.Label;
import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.JumpInsnNode;
import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.MethodNode;
public class TableJumpInstruction public class TableJumpInstruction
{ {

View File

@@ -1 +0,0 @@
dependency-reduced-pom.xml

View File

@@ -1,231 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>runelite-parent</artifactId>
<groupId>net.runelite</groupId>
<version>1.5.27-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>extended-mixin-processor</artifactId>
<packaging>maven-plugin</packaging>
<name>extended-mixin-processor Maven Plugin</name>
<url>https://www.runelitepl.us</url>
<prerequisites>
<maven>${maven.version}</maven>
</prerequisites>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.version>3.3.9</maven.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>${maven.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.runelite</groupId>
<artifactId>runelite-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.runelite.rs</groupId>
<artifactId>runescape-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.runelite</groupId>
<artifactId>client-patch</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.1-jre</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.sigpipe/jbsdiff -->
<dependency>
<groupId>io.sigpipe</groupId>
<artifactId>jbsdiff</artifactId>
<version>1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.javassist/javassist -->
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.24.1-GA</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>1.3.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.ow2.asm/asm -->
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-all</artifactId>
<version>6.0_BETA</version>
</dependency>
</dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_maven-plugin_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.1.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<!-- <goalPrefix>maven-archetype-plugin</goalPrefix> -->
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>mojo-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
<execution>
<id>help-goal</id>
<goals>
<goal>helpmojo</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>false</minimizeJar>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,65 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor;
public class MethodGarbageValue
{
private final String type;
private final int value;
public MethodGarbageValue(int value)
{
if (value <= Byte.MAX_VALUE && value >= Byte.MIN_VALUE)
{
type = "B";
}
else if (value <= Short.MAX_VALUE && value >= Short.MIN_VALUE)
{
type = "S";
}
else
{
type = "I";
}
this.value = value;
}
public int getValue()
{
return value;
}
public String getType()
{
return type;
}
public String toString()
{
return "MethodGarbageValue[type=" + getType() + ",value=" + getValue() + "]";
}
}

View File

@@ -1,274 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor;
import com.google.common.collect.ImmutableSet;
import com.google.common.io.ByteStreams;
import com.google.common.reflect.ClassPath;
import io.sigpipe.jbsdiff.Patch;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.LoaderClassPath;
import org.objectweb.asm.Opcodes;
import us.runelitepl.mixinprocessor.generators.AnnotationProcessor;
import us.runelitepl.mixinprocessor.generators.PatchGenerator;
import us.runelitepl.mixinprocessor.generators.StaticGenerator;
import us.runelitepl.mixinprocessor.generators.StaticStageTwoGenerator;
import us.runelitepl.mixinprocessor.parsers.GamepackDownloader;
import us.runelitepl.mixinprocessor.parsers.HooksParser;
import us.runelitepl.mixinprocessor.transformers.AsmMethodGarbageTransformer;
import us.runelitepl.mixinprocessor.transformers.AsmMethodSignatureTransformer;
import us.runelitepl.mixinprocessor.util.JavassistUtils;
import us.runelitepl.mixinprocessor.util.RefUtils;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Goal which touches a timestamp file.
*/
@Mojo(name = "process-mixins", defaultPhase = LifecyclePhase.PROCESS_CLASSES, requiresDependencyResolution =
ResolutionScope.COMPILE)
public class MixinProcessorMojo
extends AbstractMojo implements Opcodes
{
private static final String PATCHES_PACKAGE = "us.runelitepl.mixins";
/**
* Location of the file.
*/
@Parameter(defaultValue = "${project.build.directory}", property = "outputDir", required = true)
private File outputDirectory;
@Parameter(defaultValue = "${project}", required = true, readonly = true)
private MavenProject project;
@Parameter(property = "process-mixins.hooks", defaultValue = "hooks.json", required = true)
private String hooks;
@Parameter(property = "process-mixins.ops", defaultValue = "gamepack.deob.jar.op.json", required = true)
private String ops;
private static MixinProcessorMojo INST;
public static ClassPool classPool;
public static HashMap<String, Long> fieldDecoders = new HashMap<>();
public static HashMap<String, String> classNames = new HashMap<>();
public static HashMap<String, String> methodNames = new HashMap<>();
public static HashMap<String, String> fieldNames = new HashMap<>();
public static HashMap<String, Boolean> isFieldTagged = new HashMap<>();
public static HashMap<String, Boolean> isMethodTagged = new HashMap<>();
public static HashMap<String, MethodGarbageValue> methodGarbageValues = new HashMap<>();
private static HashMap<String, byte[]> gamepack = new HashMap<>();
private static final int BUFFER_SIZE = 1024 * 1024 * 4;
public void execute()
throws MojoExecutionException
{
INST = this;
try
{
List runtimeClasspathElements = project.getRuntimeClasspathElements();
URL[] runtimeUrls = new URL[runtimeClasspathElements.size()];
for (int i = 0; i < runtimeClasspathElements.size(); i++)
{
String element = (String) runtimeClasspathElements.get(i);
runtimeUrls[i] = new File(element).toURI().toURL();
}
URLClassLoader classLoader = new URLClassLoader(runtimeUrls,
Thread.currentThread().getContextClassLoader());
File outputFolder = new File(project.getBuild().getOutputDirectory());
File projectDir = new File(System.getProperty("user.dir"));
File hooksFile = new File(projectDir, hooks);
File opsFile = new File(projectDir, ops);
outputFolder.mkdirs();
GamepackDownloader.downloadGamepack(gamepack);
ByteArrayOutputStream patchOutputStream = new ByteArrayOutputStream(BUFFER_SIZE); // 4mb
HooksParser.run(hooksFile, opsFile);
classPool = new ClassPool();
classPool.appendClassPath((new LoaderClassPath(classLoader)));
for (Map.Entry<String, byte[]> entry : gamepack.entrySet())
{
byte[] b1_;
try (InputStream is = getClass().getResourceAsStream("/patch/" + entry.getKey() + ".class.bs"))
{
if (is == null)
{
stderr("IS null for %s", entry.getKey());
continue;
}
b1_ = ByteStreams.toByteArray(is);
}
patchOutputStream.reset();
Patch.patch(entry.getValue(), b1_, patchOutputStream);
entry.setValue(patchOutputStream.toByteArray());
classPool.makeClass(new ByteArrayInputStream(entry.getValue()));
}
HashMap<String, byte[]> finalClasses = new HashMap<>();
ImmutableSet<ClassPath.ClassInfo> classes =
ClassPath.from(classLoader).getTopLevelClassesRecursive(PATCHES_PACKAGE);
for (ClassPath.ClassInfo clazz : classes)
{
stderr("");
stderr("Annotations: %s", clazz.getSimpleName());
CtClass ctClass = classPool.get(clazz.getName());
String className = ctClass.getSimpleName();
className = RefUtils.getObbedClassName(className);
byte[] finalCode = JavassistUtils.getClassBytecode(ctClass);
finalCode = new AnnotationProcessor(className, finalCode).run();
finalClasses.put(className, finalCode);
}
for (Map.Entry<String, byte[]> entry : finalClasses.entrySet())
{
String className = entry.getKey();
byte[] finalCode = entry.getValue();
stderr("");
stderr("Pass 1: %s", className);
finalCode = new AsmMethodSignatureTransformer(className, finalCode).transform();
finalCode = new AsmMethodGarbageTransformer(className, finalCode, finalClasses).transform();
finalClasses.put(className, finalCode);
}
stderr("");
stderr("Pass Statics");
new StaticGenerator().run(finalClasses.get(RefUtils.STATICS_STRING));
new StaticStageTwoGenerator(finalClasses).run();
for (Map.Entry<String, byte[]> entry : finalClasses.entrySet())
{
String className = entry.getKey();
if (className == null)
{
stderr("Class name null? %s", entry.getValue().length);
continue;
}
if (className.endsWith(RefUtils.STATICS_STRING))
{
continue;
}
stderr("");
stderr("Pass 2: %s", className);
byte[] finalCode = entry.getValue();
finalCode = new PatchGenerator(className, finalCode).run();
entry.setValue(finalCode);
}
deleteDir(new File(outputFolder, "us/runelitepl/mixins"));
outputFolder = new File(outputFolder, "extended-mixins");
outputFolder.mkdirs();
for (Map.Entry<String, byte[]> entry : finalClasses.entrySet())
{
if (entry.getKey().contains(RefUtils.STATICS_STRING))
{
continue;
}
Files.write(new File(outputFolder, entry.getKey() + ".class").toPath(),
entry.getValue());
}
}
catch (Exception ex)
{
ex.printStackTrace();
throw new MojoExecutionException(ex.getMessage());
}
}
private void stderr(String s, Object... format)
{
getLog().info(String.format(s, format));
}
public static void log(String s, Object... format)
{
INST.stderr(s, format);
}
private static void deleteDir(File file) throws IOException
{
if (!file.exists())
{
return;
}
Files.walk(file.toPath())
.sorted(Comparator.reverseOrder())
.map(Path::toFile)
.forEach(File::delete);
}
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Append
{
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Inject
{
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Overwrite
{
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Prepend
{
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Provided
{
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Reobfuscate
{
}

View File

@@ -1,35 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.enums;
public enum InjectionType
{
INJECT,
APPEND,
OVERWRITE,
PREPEND,
PROVIDED
}

View File

@@ -1,62 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.generators;
import javassist.CannotCompileException;
import javassist.CtClass;
import us.runelitepl.mixinprocessor.MixinProcessorMojo;
import us.runelitepl.mixinprocessor.parsers.FieldAnnotationParser;
import us.runelitepl.mixinprocessor.parsers.MethodAnnotationParser;
import us.runelitepl.mixinprocessor.util.JavassistUtils;
import java.io.ByteArrayInputStream;
import java.io.IOException;
public class AnnotationProcessor
{
private final String className;
private final byte[] finalCode;
public AnnotationProcessor(String className, byte[] finalCode)
{
this.className = className;
this.finalCode = finalCode;
}
public byte[] run() throws IOException, CannotCompileException, ClassNotFoundException
{
byte[] newCode = finalCode;
CtClass clazz = MixinProcessorMojo.classPool.makeClass(new ByteArrayInputStream(newCode));
new FieldAnnotationParser(clazz).run();
new MethodAnnotationParser(clazz).run();
newCode = JavassistUtils.getClassBytecode(clazz);
return newCode;
}
}

View File

@@ -1,64 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.generators;
import us.runelitepl.mixinprocessor.transformers.AnnotationRemoverTransformer;
import us.runelitepl.mixinprocessor.transformers.AsmNameTransformer;
import us.runelitepl.mixinprocessor.transformers.AsmStaticUsageTransformer;
import us.runelitepl.mixinprocessor.transformers.DoNothingTransformer;
import us.runelitepl.mixinprocessor.transformers.GetFieldDecoderTransformer;
import us.runelitepl.mixinprocessor.transformers.ProvidedRemoverTransformer;
public class PatchGenerator
{
private final String className;
private final byte[] bytecode;
public PatchGenerator(String className, byte[] bytecode)
{
this.className = className;
this.bytecode = bytecode;
}
public byte[] run()
{
byte[] newCode = bytecode;
newCode = new GetFieldDecoderTransformer(className, newCode).transform();
// https://asm.ow2.io/javadoc/org/objectweb/asm/commons/Remapper.html
// https://asm.ow2.io/javadoc/org/objectweb/asm/commons/ClassRemapper.html
newCode = new AsmStaticUsageTransformer(className, newCode).transform();
newCode = new AsmNameTransformer(className, newCode).transform();
newCode = new ProvidedRemoverTransformer(className, newCode).transform();
newCode = new AnnotationRemoverTransformer(className, newCode).transform();
newCode = new DoNothingTransformer(className, newCode).transform();
return newCode;
}
}

View File

@@ -1,104 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.generators;
import us.runelitepl.mixinprocessor.MixinProcessorMojo;
import us.runelitepl.mixinprocessor.util.RefUtils;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.tree.MethodNode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
public class StaticGenerator
{
static HashMap<String, ArrayList<MethodNode>> staticMethods = new HashMap<>();
static HashMap<String, ArrayList<FieldNode>> staticFields = new HashMap<>();
static Set<String> modifiedClasses = new HashSet<>();
public void run(byte[] bytecode)
{
ClassReader cr = new ClassReader(bytecode);
ClassNode node = new ClassNode();
cr.accept(node, 0);
for (Object aaa : node.methods)
{
MethodNode method = (MethodNode) aaa;
String methodName = method.name;
method.desc = RefUtils.reobMethodDescriptor(method.desc);
int access = method.access;
if ((access & 8) != 8)
{
continue;
}
String reobbed = RefUtils.reobMethodName(RefUtils.STATICS_STRING, methodName, method.desc);
if (reobbed == null)
{
MixinProcessorMojo.log("Failed to reob static method: %s %s", methodName, method.desc);
throw new RuntimeException();
}
String[] split = reobbed.split(" ");
method.name = split[1];
ArrayList<MethodNode> list = staticMethods.getOrDefault(split[0], new ArrayList<>());
list.add(method);
staticMethods.put(split[0], list);
modifiedClasses.add(split[0]);
}
for (Object aaa : node.fields)
{
FieldNode field = (FieldNode) aaa;
String fieldName = field.name;
field.desc = RefUtils.reobDescriptor(field.desc);
int access = field.access;
if ((access & 8) != 8)
{
continue;
}
String reobbed = RefUtils.reobFieldName(RefUtils.STATICS_STRING, fieldName, field.desc);
if (reobbed == null)
{
MixinProcessorMojo.log("Failed to reob static field: %s %s", fieldName, field.desc);
throw new RuntimeException();
}
String[] split = reobbed.split(" ");
field.name = split[1];
ArrayList<FieldNode> list = staticFields.getOrDefault(split[0], new ArrayList<>());
list.add(field);
staticFields.put(split[0], list);
modifiedClasses.add(split[0]);
}
}
}

View File

@@ -1,260 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.generators;
import org.objectweb.asm.Attribute;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AnnotationNode;
import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.TypeAnnotationNode;
import us.runelitepl.mixinprocessor.parsers.MethodReflector;
import java.util.HashMap;
import static us.runelitepl.mixinprocessor.generators.StaticGenerator.modifiedClasses;
import static us.runelitepl.mixinprocessor.generators.StaticGenerator.staticFields;
import static us.runelitepl.mixinprocessor.generators.StaticGenerator.staticMethods;
public class StaticStageTwoGenerator implements Opcodes
{
private HashMap<String, byte[]> classes;
public StaticStageTwoGenerator(HashMap<String, byte[]> classes)
{
this.classes = classes;
}
public void run()
{
for (String className : modifiedClasses)
{
byte[] targetBytecode = classes.getOrDefault(className, null);
if (targetBytecode == null)
{
//create new class
ClassWriter cw = new ClassWriter(0);
FieldVisitor fv;
MethodVisitor mv;
cw.visit(V1_6, ACC_PUBLIC, className, null, "java/lang/Object", null);
if (staticMethods.get(className) != null)
{
for (MethodNode method : staticMethods.get(className))
{
mv = cw.visitMethod(method.access, method.name, method.desc, method.signature,
(String[]) method.exceptions.toArray(new String[0]));
MethodReflector reflector = new MethodReflector(mv);
method.accept(reflector);
}
}
if (staticFields.get(className) != null)
{
for (FieldNode field : staticFields.get(className))
{
fv = cw.visitField(field.access, field.name, field.desc, field.signature, field.value);
int i;
int n;
AnnotationNode annotation;
if (field.visibleAnnotations != null)
{
i = 0;
for (n = field.visibleAnnotations.size(); i < n; ++i)
{
annotation = (AnnotationNode) field.visibleAnnotations.get(i);
annotation.accept(fv.visitAnnotation(annotation.desc, true));
}
}
if (field.invisibleAnnotations != null)
{
i = 0;
for (n = field.invisibleAnnotations.size(); i < n; ++i)
{
annotation = (AnnotationNode) field.invisibleAnnotations.get(i);
annotation.accept(fv.visitAnnotation(annotation.desc, false));
}
}
TypeAnnotationNode typeAnnotation;
if (field.visibleTypeAnnotations != null)
{
i = 0;
for (n = field.visibleTypeAnnotations.size(); i < n; ++i)
{
typeAnnotation = (TypeAnnotationNode) field.visibleTypeAnnotations.get(i);
typeAnnotation.accept(fv
.visitTypeAnnotation(typeAnnotation.typeRef, typeAnnotation.typePath,
typeAnnotation.desc, true));
}
}
if (field.invisibleTypeAnnotations != null)
{
i = 0;
for (n = field.invisibleTypeAnnotations.size(); i < n; ++i)
{
typeAnnotation = (TypeAnnotationNode) field.invisibleTypeAnnotations.get(i);
typeAnnotation.accept(fv
.visitTypeAnnotation(typeAnnotation.typeRef, typeAnnotation.typePath,
typeAnnotation.desc, false));
}
}
if (field.attrs != null)
{
i = 0;
for (n = field.attrs.size(); i < n; ++i)
{
fv.visitAttribute((Attribute) field.attrs.get(i));
}
}
fv.visitEnd();
}
}
cw.visitEnd();
targetBytecode = cw.toByteArray();
}
else
{
ClassReader cr = new ClassReader(targetBytecode);
ClassWriter cw = new ClassWriter(cr, 0);
ClassVisitor cv = new ClassVisitor(ASM6, cw)
{
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)
{
super.visit(version, access, name, signature, superName, interfaces);
if (staticMethods.get(className) != null)
{
for (MethodNode method : staticMethods.get(className))
{
MethodVisitor mv = visitMethod(method.access, method.name, method.desc,
method.signature, (String[]) method.exceptions.toArray(new String[0]));
MethodReflector reflector = new MethodReflector(mv);
method.accept(reflector);
}
}
if (staticFields.get(className) != null)
{
for (FieldNode field : staticFields.get(className))
{
FieldVisitor fv = visitField(field.access, field.name, field.desc, field.signature,
field.value);
int i;
int n;
AnnotationNode annotation;
if (field.visibleAnnotations != null)
{
i = 0;
for (n = field.visibleAnnotations.size(); i < n; ++i)
{
annotation = (AnnotationNode) field.visibleAnnotations.get(i);
annotation.accept(fv.visitAnnotation(annotation.desc, true));
}
}
if (field.invisibleAnnotations != null)
{
i = 0;
for (n = field.invisibleAnnotations.size(); i < n; ++i)
{
annotation = (AnnotationNode) field.invisibleAnnotations.get(i);
annotation.accept(fv.visitAnnotation(annotation.desc, false));
}
}
TypeAnnotationNode typeAnnotation;
if (field.visibleTypeAnnotations != null)
{
i = 0;
for (n = field.visibleTypeAnnotations.size(); i < n; ++i)
{
typeAnnotation = (TypeAnnotationNode) field.visibleTypeAnnotations.get(i);
typeAnnotation.accept(fv
.visitTypeAnnotation(typeAnnotation.typeRef, typeAnnotation.typePath,
typeAnnotation.desc, true));
}
}
if (field.invisibleTypeAnnotations != null)
{
i = 0;
for (n = field.invisibleTypeAnnotations.size(); i < n; ++i)
{
typeAnnotation = (TypeAnnotationNode) field.invisibleTypeAnnotations.get(i);
typeAnnotation.accept(fv
.visitTypeAnnotation(typeAnnotation.typeRef, typeAnnotation.typePath,
typeAnnotation.desc, false));
}
}
if (field.attrs != null)
{
i = 0;
for (n = field.attrs.size(); i < n; ++i)
{
fv.visitAttribute((Attribute) field.attrs.get(i));
}
}
fv.visitEnd();
}
}
}
};
cr.accept(cv, 0);
targetBytecode = cw.toByteArray();
}
classes.put(className, targetBytecode);
}
}
}

View File

@@ -1,110 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.parsers;
import javassist.CtClass;
import javassist.CtField;
import us.runelitepl.mixinprocessor.annotations.Append;
import us.runelitepl.mixinprocessor.annotations.Inject;
import us.runelitepl.mixinprocessor.annotations.Overwrite;
import us.runelitepl.mixinprocessor.annotations.Prepend;
import us.runelitepl.mixinprocessor.annotations.Provided;
import us.runelitepl.mixinprocessor.annotations.Reobfuscate;
import us.runelitepl.mixinprocessor.enums.InjectionType;
import us.runelitepl.mixinprocessor.util.RefUtils;
import static us.runelitepl.mixinprocessor.MixinProcessorMojo.isFieldTagged;
public class FieldAnnotationParser
{
private CtClass clazz;
public FieldAnnotationParser(CtClass clazz)
{
this.clazz = clazz;
}
public void run() throws ClassNotFoundException
{
for (CtField field : clazz.getDeclaredFields())
{
Object[] annotations = field.getAnnotations();
InjectionType type = null;
boolean reobfuscate = false;
for (Object obj : annotations)
{
reobfuscate = obj instanceof Reobfuscate || reobfuscate;
if (obj instanceof Inject)
{
type = InjectionType.INJECT;
}
else if (obj instanceof Append)
{
type = InjectionType.APPEND;
}
else if (obj instanceof Overwrite)
{
type = InjectionType.OVERWRITE;
}
else if (obj instanceof Prepend)
{
type = InjectionType.PREPEND;
}
else if (obj instanceof Provided)
{
type = InjectionType.PROVIDED;
}
}
String fieldOwner = field.getDeclaringClass().getSimpleName();
String fieldName = field.getName();
String fieldDescriptor = RefUtils.reobDescriptor(field.getSignature());
if (type == null)
{
throw new RuntimeException(
field.getDeclaringClass().getSimpleName() + "." + field.getName() + " is unannotated" +
"!");
}
if (type != InjectionType.PROVIDED && type != InjectionType.INJECT)
{
throw new RuntimeException(
field.getDeclaringClass().getSimpleName() + "." + field.getName() + " has an invalid " +
"annotation! @" + type);
}
if (reobfuscate)
{
isFieldTagged.put(fieldOwner + " " + fieldName + " " + fieldDescriptor, true);
}
}
}
}

View File

@@ -1,91 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.parsers;
import us.runelitepl.mixinprocessor.util.WebUtils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
public class GamepackDownloader
{
private static final String CONFIG_URL = "http://oldschool.runescape.com/jav_config.ws";
private static String codebase;
private static String initial_jar;
public static void downloadGamepack(HashMap<String, byte[]> output) throws IOException
{
parseConfig();
byte[] gamepackJarAry = WebUtils.downloadFile(getGamepackUrl());
ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(gamepackJarAry));
byte[] buffer = new byte[2048];
ZipEntry entry;
ByteArrayOutputStream fileContent = new ByteArrayOutputStream(1024 * 1024 * 4);
while ((entry = zipInputStream.getNextEntry()) != null)
{
if (entry.getName().startsWith("META-INF"))
{
continue;
}
String key = entry.getName().replace(".class", "");
int len;
while ((len = zipInputStream.read(buffer)) > 0)
{
fileContent.write(buffer, 0, len);
}
output.put(key, fileContent.toByteArray());
fileContent.reset();
}
zipInputStream.close();
}
private static void parseConfig() throws IOException
{
String pageText = WebUtils.getUrlContent(CONFIG_URL);
for (String line : pageText.split("\n"))
{
if (line.startsWith("codebase="))
{
codebase = line.replace("codebase=", "");
}
else if (line.startsWith("initial_jar="))
{
initial_jar = line.replace("initial_jar=", "");
}
}
}
private static String getGamepackUrl()
{
return codebase + initial_jar;
}
}

View File

@@ -1,144 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.parsers;
import us.runelitepl.mixinprocessor.MethodGarbageValue;
import us.runelitepl.mixinprocessor.MixinProcessorMojo;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Map;
public class HooksParser
{
public static void run(File hooksFile, File opsFile) throws IOException, ParseException
{
JSONParser parser = new JSONParser();
//region hooksFile
String jsonContent = String.join("\n", Files.readAllLines(hooksFile.toPath()));
JSONArray array = (JSONArray) parser.parse(jsonContent);
for (Object object : array)
{
JSONObject rootObject = (JSONObject) object;
String c_obbedName = (String) rootObject.get("name");
String c_deobbedName = (String) rootObject.get("class");
MixinProcessorMojo.classNames.put(c_deobbedName, c_obbedName);
}
int failedFields = 0;
int failedMethods = 0;
for (Object object : array)
{
JSONObject rootObject = (JSONObject) object;
JSONArray fieldArray = (JSONArray) rootObject.get("fields");
for (Object fieldObj : fieldArray)
{
JSONObject field = (JSONObject) fieldObj;
String f_deobbedName = (String) field.get("field");
String f_obbedName = (String) field.get("name");
String f_descriptor = (String) field.get("descriptor");
String f_owner = (String) field.get("owner");
long f_decoder = (long) field.getOrDefault("decoder", (long) 1);
String f_deobbedOwner = null;
if (f_deobbedName.startsWith("__"))
{
continue;
}
for (Map.Entry<String, String> entry : MixinProcessorMojo.classNames.entrySet())
{
if (entry.getValue().equals(f_owner))
{
f_deobbedOwner = entry.getKey();
break;
}
}
if (f_deobbedOwner == null)
{
failedFields++;
//stderr("Failed to find deobbed owner for field %s.%s %s", f_owner, f_obbedName, f_descriptor);
continue;
}
MixinProcessorMojo.fieldNames.put(String.format("%s %s %s", f_deobbedOwner, f_deobbedName, f_descriptor),
String.format("%s %s", f_owner, f_obbedName));
MixinProcessorMojo.fieldDecoders.put(String.format("%s %s", f_deobbedOwner, f_deobbedName),
f_decoder);
}
JSONArray methodArray = (JSONArray) rootObject.get("methods");
for (Object methodObj : methodArray)
{
JSONObject method = (JSONObject) methodObj;
String m_deobbedName = (String) method.get("method");
String m_owner = (String) method.get("owner");
String m_deobbedOwner = null;
String m_obbedName = (String) method.get("name");
String m_descriptor = (String) method.get("descriptor");
if (m_deobbedName.startsWith("__"))
{
continue;
}
for (Map.Entry<String, String> entry : MixinProcessorMojo.classNames.entrySet())
{
if (entry.getValue().equals(m_owner))
{
m_deobbedOwner = entry.getKey();
break;
}
}
if (m_deobbedOwner == null)
{
failedMethods++;
//stderr("Failed to find deobbed owner for method %s.%s %s", m_owner, m_obbedName, m_descriptor);
continue;
}
MixinProcessorMojo.methodNames.put(String.format("%s %s %s", m_deobbedOwner, m_deobbedName, m_descriptor),
String.format("%s %s", m_owner, m_obbedName));
}
}
MixinProcessorMojo.log("%d unidentified fields", failedFields);
MixinProcessorMojo.log("%d unidentified methods", failedMethods);
//endregion
//region opsFile
String opsContent = String.join("\n", Files.readAllLines(opsFile.toPath()));
JSONObject opsRoot = (JSONObject) parser.parse(opsContent);
opsRoot.forEach((key, value) ->
{
String k = (String) key;
MixinProcessorMojo.methodGarbageValues.put(k, new MethodGarbageValue(Math.toIntExact((Long) value)));
});
//endregion
}
}

View File

@@ -1,127 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.parsers;
import javassist.CtClass;
import javassist.CtMethod;
import us.runelitepl.mixinprocessor.MixinProcessorMojo;
import us.runelitepl.mixinprocessor.annotations.Append;
import us.runelitepl.mixinprocessor.annotations.Inject;
import us.runelitepl.mixinprocessor.annotations.Overwrite;
import us.runelitepl.mixinprocessor.annotations.Prepend;
import us.runelitepl.mixinprocessor.annotations.Provided;
import us.runelitepl.mixinprocessor.annotations.Reobfuscate;
import us.runelitepl.mixinprocessor.enums.InjectionType;
import us.runelitepl.mixinprocessor.util.RefUtils;
import static us.runelitepl.mixinprocessor.MixinProcessorMojo.isMethodTagged;
public class MethodAnnotationParser
{
private final CtClass patch;
public MethodAnnotationParser(CtClass patch)
{
this.patch = patch;
}
public void run() throws ClassNotFoundException
{
for (CtMethod method : patch.getDeclaredMethods())
{
Object[] annotations = method.getAnnotations();
boolean reobfuscate = false;
InjectionType type = null;
for (Object obj : annotations)
{
reobfuscate = obj instanceof Reobfuscate || reobfuscate;
if (obj instanceof Inject)
{
type = InjectionType.INJECT;
}
else if (obj instanceof Append)
{
type = InjectionType.APPEND;
}
else if (obj instanceof Overwrite)
{
type = InjectionType.OVERWRITE;
}
else if (obj instanceof Prepend)
{
type = InjectionType.PREPEND;
}
else if (obj instanceof Provided)
{
type = InjectionType.PROVIDED;
}
}
if (type == null)
{
throw new RuntimeException(
method.getDeclaringClass().getSimpleName() + "." + method.getName() + " is unannotated" +
"!");
}
String methodName = method.getName();
if (type == InjectionType.PREPEND)
{
if (!methodName.startsWith("prepend$"))
{
throw new RuntimeException(
method.getDeclaringClass().getSimpleName() + "." + method.getName() + " has a @Prepend " +
"annotation without beginning with \"prepend$\"!");
}
}
else if (type == InjectionType.APPEND)
{
if (!methodName.startsWith("append$"))
{
throw new RuntimeException(
method.getDeclaringClass().getSimpleName() + "." + method.getName() + " has a @Append " +
"annotation without beginning with \"append$\"!");
}
}
if (reobfuscate)
{
MixinProcessorMojo.log("Marking: %s %s %s", method.getDeclaringClass().getSimpleName(), methodName,
RefUtils.reobMethodDescriptor(method.getSignature()));
String r = String.format("%s %s %s", method.getDeclaringClass().getSimpleName(), methodName,
RefUtils.reobMethodDescriptor(method.getSignature()));
isMethodTagged.put(r, true);
}
}
}
}

View File

@@ -1,329 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.parsers;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Attribute;
import org.objectweb.asm.Handle;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.TypePath;
public class MethodReflector extends MethodVisitor
{
private MethodVisitor target;
public MethodReflector(MethodVisitor target)
{
super(Opcodes.ASM6);
this.target = target;
}
public void visitCode()
{
if (target != null)
{
target.visitCode();
}
super.visitCode();
}
public void visitEnd()
{
if (target != null)
{
target.visitEnd();
}
super.visitEnd();
}
public void visitParameter(String var1, int var2)
{
if (target != null)
{
target.visitParameter(var1, var2);
}
super.visitParameter(var1, var2);
}
public AnnotationVisitor visitAnnotationDefault()
{
if (target != null)
{
target.visitAnnotationDefault();
}
return super.visitAnnotationDefault();
}
public AnnotationVisitor visitAnnotation(String var1, boolean var2)
{
if (target != null)
{
target.visitAnnotation(var1, var2);
}
return super.visitAnnotation(var1, var2);
}
public AnnotationVisitor visitTypeAnnotation(int var1, TypePath var2, String var3, boolean var4)
{
if (target != null)
{
target.visitTypeAnnotation(var1, var2, var3, var4);
}
return super.visitTypeAnnotation(var1, var2, var3, var4);
}
public AnnotationVisitor visitParameterAnnotation(int var1, String var2, boolean var3)
{
if (target != null)
{
target.visitParameterAnnotation(var1, var2, var3);
}
return super.visitParameterAnnotation(var1, var2, var3);
}
public void visitAttribute(Attribute var1)
{
if (target != null)
{
target.visitAttribute(var1);
}
super.visitAttribute(var1);
}
public void visitFrame(int var1, int var2, Object[] var3, int var4, Object[] var5)
{
if (target != null)
{
target.visitFrame(var1, var2, var3, var4, var5);
}
super.visitFrame(var1, var2, var3, var4, var5);
}
public void visitInsn(int var1)
{
if (target != null)
{
target.visitInsn(var1);
}
super.visitInsn(var1);
}
public void visitIntInsn(int var1, int var2)
{
if (target != null)
{
target.visitIntInsn(var1, var2);
}
super.visitIntInsn(var1, var2);
}
public void visitVarInsn(int var1, int var2)
{
if (target != null)
{
target.visitVarInsn(var1, var2);
}
super.visitVarInsn(var1, var2);
}
public void visitTypeInsn(int var1, String var2)
{
if (target != null)
{
target.visitTypeInsn(var1, var2);
}
super.visitTypeInsn(var1, var2);
}
public void visitFieldInsn(int var1, String var2, String var3, String var4)
{
if (target != null)
{
target.visitFieldInsn(var1, var2, var3, var4);
}
super.visitFieldInsn(var1, var2, var3, var4);
}
/**
* @deprecated
*/
public void visitMethodInsn(int var1, String var2, String var3, String var4)
{
if (target != null)
{
target.visitMethodInsn(var1, var2, var3, var4);
}
super.visitMethodInsn(var1, var2, var3, var4);
}
public void visitMethodInsn(int var1, String var2, String var3, String var4, boolean var5)
{
if (target != null)
{
target.visitMethodInsn(var1, var2, var3, var4, var5);
}
super.visitMethodInsn(var1, var2, var3, var4, var5);
}
public void visitInvokeDynamicInsn(String var1, String var2, Handle var3, Object... var4)
{
if (target != null)
{
target.visitInvokeDynamicInsn(var1, var2, var3, var4);
}
super.visitInvokeDynamicInsn(var1, var2, var3, var4);
}
public void visitJumpInsn(int var1, Label var2)
{
if (target != null)
{
target.visitJumpInsn(var1, var2);
}
super.visitJumpInsn(var1, var2);
}
public void visitLabel(Label var1)
{
if (target != null)
{
target.visitLabel(var1);
}
super.visitLabel(var1);
}
public void visitLdcInsn(Object var1)
{
if (target != null)
{
target.visitLdcInsn(var1);
}
super.visitLdcInsn(var1);
}
public void visitIincInsn(int var1, int var2)
{
if (target != null)
{
target.visitIincInsn(var1, var2);
}
super.visitIincInsn(var1, var2);
}
public void visitTableSwitchInsn(int var1, int var2, Label var3, Label... var4)
{
if (target != null)
{
target.visitTableSwitchInsn(var1, var2, var3, var4);
}
super.visitTableSwitchInsn(var1, var2, var3, var4);
}
public void visitLookupSwitchInsn(Label var1, int[] var2, Label[] var3)
{
if (target != null)
{
target.visitLookupSwitchInsn(var1, var2, var3);
}
super.visitLookupSwitchInsn(var1, var2, var3);
}
public void visitMultiANewArrayInsn(String var1, int var2)
{
if (target != null)
{
target.visitMultiANewArrayInsn(var1, var2);
}
super.visitMultiANewArrayInsn(var1, var2);
}
public AnnotationVisitor visitInsnAnnotation(int var1, TypePath var2, String var3, boolean var4)
{
if (target != null)
{
target.visitInsnAnnotation(var1, var2, var3, var4);
}
return super.visitInsnAnnotation(var1, var2, var3, var4);
}
public void visitTryCatchBlock(Label var1, Label var2, Label var3, String var4)
{
if (target != null)
{
target.visitTryCatchBlock(var1, var2, var3, var4);
}
super.visitTryCatchBlock(var1, var2, var3, var4);
}
public AnnotationVisitor visitTryCatchAnnotation(int var1, TypePath var2, String var3, boolean var4)
{
if (target != null)
{
target.visitTryCatchAnnotation(var1, var2, var3, var4);
}
return super.visitTryCatchAnnotation(var1, var2, var3, var4);
}
public void visitLocalVariable(String var1, String var2, String var3, Label var4, Label var5, int var6)
{
if (target != null)
{
target.visitLocalVariable(var1, var2, var3, var4, var5, var6);
}
super.visitLocalVariable(var1, var2, var3, var4, var5, var6);
}
public AnnotationVisitor visitLocalVariableAnnotation(int var1, TypePath var2, Label[] var3, Label[] var4, int[] var5, String var6, boolean var7)
{
if (target != null)
{
target.visitLocalVariableAnnotation(var1, var2, var3, var4, var5, var6, var7);
}
return super.visitLocalVariableAnnotation(var1, var2, var3, var4, var5, var6, var7);
}
public void visitLineNumber(int var1, Label var2)
{
if (target != null)
{
target.visitLineNumber(var1, var2);
}
super.visitLineNumber(var1, var2);
}
public void visitMaxs(int var1, int var2)
{
if (target != null)
{
target.visitMaxs(var1, var2);
}
super.visitMaxs(var1, var2);
}
}

View File

@@ -1,103 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.transformers;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
public class AnnotationRemoverTransformer extends AsmBaseTransformer
{
private final String className;
private final byte[] bytecode;
public AnnotationRemoverTransformer(String className, byte[] bytecode)
{
this.className = className;
this.bytecode = bytecode;
}
@Override
public byte[] transform()
{
ClassReader cr = new ClassReader(bytecode);
ClassWriter cw = new ClassWriter(cr, 0);
cr.accept(new ClassVisitor(Opcodes.ASM6, cw)
{
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)
{
MethodVisitor visitor = super.visitMethod(access, name, desc, signature, exceptions);
MethodVisitor mv = new MethodVisitor(Opcodes.ASM6, visitor)
{
@Override
public AnnotationVisitor visitAnnotation(String descriptor, boolean hidden)
{
if (descriptor.equals(makeAnnotationDescriptor("Reobfuscate")))
{
return null;
}
return super.visitAnnotation(descriptor, hidden);
}
};
return mv;
}
@Override
public FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value)
{
FieldVisitor visitor = super.visitField(access, name, descriptor, signature, value);
return new FieldVisitor(Opcodes.ASM6, visitor)
{
@Override
public AnnotationVisitor visitAnnotation(String descriptor, boolean hidden)
{
if (descriptor.equals(makeAnnotationDescriptor("Reobfuscate")))
{
return null;
}
if (descriptor.equals(makeAnnotationDescriptor("Provided")))
{
return null;
}
return super.visitAnnotation(descriptor, hidden);
}
};
}
}, 0);
return cw.toByteArray();
}
static String makeAnnotationDescriptor(String s)
{
return "Lus/runelitepl/mixinprocessor/annotations/" + s + ";";
}
}

View File

@@ -1,45 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.transformers;
import org.objectweb.asm.Opcodes;
import java.util.ArrayList;
public abstract class AsmBaseTransformer implements Opcodes
{
protected final ArrayList<String> validMethods = new ArrayList<>();
protected final ArrayList<String> validFields = new ArrayList<>();
// CHECKSTYLE:OFF
protected void buildMethodList(){}
protected void buildFieldList(){}
// CHECKSTYLE:ON
public abstract byte[] transform();
}

View File

@@ -1,107 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.transformers;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import us.runelitepl.mixinprocessor.MethodGarbageValue;
import us.runelitepl.mixinprocessor.MixinProcessorMojo;
import us.runelitepl.mixinprocessor.util.RefUtils;
import java.util.HashMap;
public class AsmMethodGarbageTransformer extends AsmBaseTransformer
{
private final String className;
private final byte[] bytecode;
private HashMap<String, byte[]> classSet;
public AsmMethodGarbageTransformer(String className, byte[] bytecode, HashMap<String, byte[]> classSet)
{
this.className = className;
this.bytecode = bytecode;
this.classSet = classSet;
}
@Override
public byte[] transform()
{
ClassReader cr = new ClassReader(bytecode);
ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_FRAMES);
cr.accept(new ClassVisitor(ASM6, cw)
{
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)
{
MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
return new MethodVisitor(ASM6, mv)
{
@Override
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf)
{
// get method owner.string(desc)
// check if method is annotated with @Reobfuscate
// brute force actual descriptor (check with shouldReobMethod(owner, name desc) )
// mv.visitLdcInsn(BIPUSH, constant);
// call super method with new descriptor
if (RefUtils.shouldReobMethod(owner, name, desc))
{
String nc = RefUtils.reobMethodName(owner, name, desc).split(" ")[0];
String nn = RefUtils.reobMethodName(owner, name, desc).split(" ")[1];
String nd = RefUtils.reobMethodDescriptor(desc);
MethodGarbageValue value;
if ((value = MixinProcessorMojo.methodGarbageValues.getOrDefault(String.format("%s.%s%s",
nc, nn, nd), null)) != null)
{
switch (value.getType())
{
case "I":
super.visitLdcInsn(new Integer(value.getValue()));
break;
case "S":
super.visitIntInsn(SIPUSH, (short) value.getValue());
break;
case "B":
super.visitIntInsn(BIPUSH, (byte) value.getValue());
break;
}
}
}
super.visitMethodInsn(opcode, owner, name, desc, itf);
}
};
}
}, 0);
return cw.toByteArray();
}
}

View File

@@ -1,107 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.transformers;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import us.runelitepl.mixinprocessor.MixinProcessorMojo;
import us.runelitepl.mixinprocessor.util.RefUtils;
public class AsmMethodSignatureTransformer extends AsmBaseTransformer
{
private final String className;
private final byte[] bytecode;
public AsmMethodSignatureTransformer(String className, byte[] bytecode)
{
this.className = RefUtils.deobClassName(className);
this.bytecode = bytecode;
}
@Override
public byte[] transform()
{
ClassReader cr = new ClassReader(bytecode);
ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_FRAMES);
cr.accept(new ClassVisitor(ASM6, cw)
{
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String sig, String[] exceptions)
{
MethodVisitor mv = super.visitMethod(access, name, fixMethodDesc(className, name, desc), sig, exceptions);
return new MethodVisitor(ASM6, mv)
{
@Override
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf)
{
super.visitMethodInsn(opcode, owner, name, fixMethodDesc(owner, name, desc), itf);
}
};
}
}, 0);
return cw.toByteArray();
}
private String fixMethodDesc(String className, String name, String desc)
{
if (className.startsWith(RefUtils.TYPE_PREFIX))
{
className = className.substring(RefUtils.TYPE_PREFIX.length());
}
if (RefUtils.shouldReobMethod(className, name, desc))
{
if (RefUtils.reobMethodName(className, name, desc) == null)
{
// get correct descriptor
String realDesc = null;
for (String s : RefUtils.POSSIBLE_GARBAGE_TYPES)
{
String check = RefUtils.reobMethodName(className, name, RefUtils.appendArgument(desc, s));
if (check != null)
{
realDesc = RefUtils.appendArgument(desc, s);
break;
}
}
if (realDesc == null)
{
MixinProcessorMojo.log("Failed to find actual method descriptor for %s.%s%s", className,
name, desc);
throw new RuntimeException();
}
// fixed = realDesc
MixinProcessorMojo.isMethodTagged.put(String.format("%s %s %s", className, name, realDesc), true);
return realDesc;
}
}
return desc;
}
}

View File

@@ -1,175 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.transformers;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.commons.ClassRemapper;
import org.objectweb.asm.commons.Remapper;
import us.runelitepl.mixinprocessor.MixinProcessorMojo;
import us.runelitepl.mixinprocessor.util.RefUtils;
public class AsmNameTransformer extends AsmBaseTransformer
{
private String className;
private byte[] bytecode;
public AsmNameTransformer(String className, byte[] bytecode)
{
this.className = className;
this.bytecode = bytecode;
}
@Override
public byte[] transform()
{
ClassReader cr = new ClassReader(bytecode);
ClassWriter cw = new ClassWriter(cr, 0);
ClassRemapper remapper = new ClassRemapper(cw, new Remapper()
{
final String TYPE_PREFIX = "us/runelitepl/mixins/";
@Override
public String map(String internalName)
{
return super.map(internalName);
}
@Override
public String mapDesc(String descriptor)
{
return RefUtils.reobDescriptor(descriptor);
}
@Override
public String mapFieldName(String owner, String name, String descriptor)
{
String oldName = name;
String noPackage = owner.replace(TYPE_PREFIX, "");
descriptor = mapDesc(descriptor);
owner = RefUtils.reobClassName(owner);
if (RefUtils.shouldReobField(noPackage, name, descriptor))
{
name = RefUtils.reobFieldName(noPackage, name, descriptor);
if (name == null)
{
MixinProcessorMojo.log("Failed to reobfuscate field name %s.%s", noPackage, oldName);
throw new RuntimeException();
}
}
return super.mapFieldName(owner, name, descriptor);
}
@Override
public String mapInvokeDynamicMethodName(String name, String descriptor)
{
throw new UnsupportedOperationException("mapInvokeDynamicMethodName: Not implemented yet," +
"\nAsmNameTransformer#mapInvokeDynamicMethodName(" + name + ", " + descriptor + ")");
}
@Override
public String mapMethodDesc(String descriptor)
{
return RefUtils.reobMethodDescriptor(descriptor);
}
@Override
public String mapMethodName(String owner, String name, String descriptor)
{
String originalClass = owner;
if (originalClass.startsWith(TYPE_PREFIX))
{
originalClass = originalClass.substring(TYPE_PREFIX.length());
}
owner = RefUtils.reobClassName(owner);
if (name.startsWith("protect$"))
{
name = "1" + name;
}
// descriptor for reob checking is obfuscated
descriptor = mapMethodDesc(descriptor);
boolean reob = RefUtils.shouldReobMethod(originalClass, name, descriptor);
if (reob)
{
String originalName = name;
name = RefUtils.reobMethodName(originalClass, name, descriptor);
if (name == null)
{
MixinProcessorMojo.log("Failed to reobfuscate method: %s.%s%s", originalClass, originalName,
descriptor);
throw new RuntimeException();
}
}
//stderr("mapMethodName %s %s %s", owner, name, descriptor);
return super.mapMethodName(owner, name, descriptor);
}
@Override
public String mapPackageName(String name)
{
throw new UnsupportedOperationException("mapPackageName: Not implemented yet," +
"\nAsmNameTransformer#mapPackageName(" + name + ")");
}
@Override
public String mapSignature(String signature, boolean isTypeSig)
{
return super.mapSignature(signature, isTypeSig);
}
@Override
public String mapType(String internalName)
{
internalName = RefUtils.reobClassName(internalName);
return super.mapType(internalName);
}
@Override
public String[] mapTypes(String[] internalNames)
{
return super.mapTypes(internalNames);
}
@Override
public Object mapValue(Object value)
{
return super.mapValue(value);
}
});
cr.accept(remapper, 0);
return cw.toByteArray();
}
}

View File

@@ -1,114 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.transformers;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import us.runelitepl.mixinprocessor.MixinProcessorMojo;
import us.runelitepl.mixinprocessor.util.RefUtils;
public class AsmStaticUsageTransformer extends AsmBaseTransformer
{
private String className;
private byte[] bytecode;
private final String TYPE_PREFIX = "us/runelitepl/mixins/";
public AsmStaticUsageTransformer(String className, byte[] bytecode)
{
this.className = className;
this.bytecode = bytecode;
}
@Override
public byte[] transform()
{
ClassReader cr = new ClassReader(bytecode);
ClassWriter cw = new ClassWriter(cr, 0);
ClassVisitor cv = new ClassVisitor(ASM6, cw)
{
@Override
public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions)
{
MethodVisitor visitor = super.visitMethod(access, name, descriptor, signature, exceptions);
return new MethodVisitor(ASM6, visitor)
{
@Override
public void visitFieldInsn(int opcode, String owner, String name, String descriptor)
{
if ((opcode == GETSTATIC || opcode == PUTSTATIC) && owner.endsWith(RefUtils.STATICS_STRING))
{
String oldName = name;
String originalOwner = owner.replace(TYPE_PREFIX, "");
String temp = RefUtils.reobFieldNameDangerous(name, RefUtils.reobDescriptor(descriptor));
if (temp == null)
{
MixinProcessorMojo.log("Failed to reobfuscate class name for field %s %s %s", owner,
name, descriptor);
throw new RuntimeException();
}
owner = temp.split(" ")[0];
if (RefUtils.shouldReobField(originalOwner, name, RefUtils.reobDescriptor(descriptor)))
{
name = temp.split(" ")[1];
}
}
super.visitFieldInsn(opcode, owner, name, descriptor);
}
@Override
public void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface)
{
if (opcode == INVOKESTATIC && owner.endsWith(RefUtils.STATICS_STRING))
{
String originalOwner = owner.replace(TYPE_PREFIX, "");
String temp = RefUtils.reobMethodName(RefUtils.STATICS_STRING, name, descriptor);
if (temp == null)
{
MixinProcessorMojo.log("Failed to reobfuscate class name for method %s %s %s", owner,
name, descriptor);
throw new RuntimeException();
}
owner = temp.split(" ")[0];
if (RefUtils.shouldReobMethod(originalOwner, name, descriptor))
{
name = temp.split(" ")[1];
}
}
super.visitMethodInsn(opcode, owner, name, descriptor, isInterface);
}
};
}
};
cr.accept(cv, 0);
return cw.toByteArray();
}
}

View File

@@ -1,56 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.transformers;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
public class DoNothingTransformer extends AsmBaseTransformer
{
private final String className;
private final byte[] bytecode;
public DoNothingTransformer(String className, byte[] bytecode)
{
this.className = className;
this.bytecode = bytecode;
}
@Override
public byte[] transform()
{
ClassReader cr = new ClassReader(bytecode);
ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_FRAMES);
// CHECKSTYLE:OFF
cr.accept(new ClassVisitor(ASM6, cw)
{}, 0);
//CHECKSTYLE:ON
return cw.toByteArray();
}
}

View File

@@ -1,196 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.transformers;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import us.runelitepl.mixinprocessor.MixinProcessorMojo;
import us.runelitepl.mixinprocessor.util.RefUtils;
public class GetFieldDecoderTransformer extends AsmBaseTransformer
{
private final String className;
private final byte[] classFileBytecode;
public GetFieldDecoderTransformer(String className, byte[] bytes)
{
this.className = className;
this.classFileBytecode = bytes;
}
@Override
public void buildMethodList()
{
ClassReader cr = new ClassReader(classFileBytecode);
ClassWriter cw = new ClassWriter(cr, 0);
cr.accept(new ClassVisitor(Opcodes.ASM6, cw)
{
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature,
String[] exceptions)
{
final boolean[] valid = {true};
MethodVisitor visitor = super.visitMethod(access, name, desc, signature, exceptions);
return new MethodVisitor(Opcodes.ASM6, visitor)
{
int opcodeCount = 0;
@Override
public void visitEnd()
{
if (valid[0])
{
MixinProcessorMojo.log("Valid method: %s %s %s %s", access, name, desc, signature);
validMethods.add(access + " " + name + " " + desc + " " + signature);
}
}
@Override
public void visitVarInsn(int opcode, int var)
{
if (opcode != Opcodes.ALOAD || var != 0 || opcodeCount != 0)
{
valid[0] = false;
}
opcodeCount++;
super.visitVarInsn(opcode, var);
}
@Override
public void visitFieldInsn(int opcode, String owner, String fieldName, String signature)
{
if (opcode != Opcodes.GETFIELD || opcodeCount != 1)
{
valid[0] = false;
}
opcodeCount++;
super.visitFieldInsn(opcode, owner, fieldName, signature);
}
@Override
public void visitLdcInsn(Object o)
{
if (!(o instanceof Integer) && !(o instanceof Long))
{
valid[0] = false;
}
if (opcodeCount != 2)
{
valid[0] = false;
}
opcodeCount++;
super.visitLdcInsn(o);
}
@Override
public void visitInsn(int opcode)
{
switch (opcode)
{
case Opcodes.IMUL:
if (opcodeCount != 3)
{
valid[0] = false;
}
break;
case Opcodes.IRETURN:
if (opcodeCount != 4)
{
valid[0] = false;
}
break;
default:
valid[0] = false;
break;
}
opcodeCount++;
super.visitInsn(opcode);
}
};
}
}, 0);
}
public byte[] transform()
{
buildMethodList();
ClassReader cr = new ClassReader(classFileBytecode);
ClassWriter cw = new ClassWriter(cr, 0);
cr.accept(new ClassVisitor(Opcodes.ASM6, cw)
{
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)
{
MethodVisitor visitor = super.visitMethod(access, name, desc, signature, exceptions);
if (!validMethods.contains(access + " " + name + " " + desc + " " + signature))
{
return visitor;
}
return new MethodVisitor(Opcodes.ASM6, visitor)
{
String target = null;
@Override
public void visitFieldInsn(int opcode, String owner, String fieldName, String signature)
{
target = fieldName;
super.visitFieldInsn(opcode, owner, fieldName, signature);
}
@Override
public void visitLdcInsn(Object o)
{
if (target != null)
{
if (o instanceof Long)
{
o = MixinProcessorMojo.fieldDecoders.getOrDefault(
RefUtils.deobClassName(className) + " " + target, 1L);
}
else
{
o = Math.toIntExact(MixinProcessorMojo.fieldDecoders.getOrDefault(RefUtils.deobClassName(className) +
" " + target,
1L));
}
}
MixinProcessorMojo.log("\tGetFieldDecoderTransformer: %s %s %s %s %s",
RefUtils.deobClassName(className), name, target, desc, o);
super.visitLdcInsn(o);
}
};
}
}, 0);
return cw.toByteArray();
}
}

View File

@@ -1,101 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.transformers;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AnnotationNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;
import us.runelitepl.mixinprocessor.MixinProcessorMojo;
public class ProvidedRemoverTransformer extends AsmBaseTransformer
{
private final String className;
private final byte[] bytecode;
public ProvidedRemoverTransformer(String className, byte[] bytecode)
{
this.className = className;
this.bytecode = bytecode;
}
public void buildMethodList()
{
ClassReader cr = new ClassReader(bytecode);
ClassNode node = new ClassNode();
cr.accept(node, 0);
for (Object obj : node.methods)
{
MethodNode method = (MethodNode) obj;
if (method == null)
{
MixinProcessorMojo.log("ProvidedRemoverTransformer: Method null?");
continue;
}
if (method.visibleAnnotations == null)
{
continue;
}
for (Object obj2 : method.visibleAnnotations)
{
AnnotationNode annot = (AnnotationNode) obj2;
if (annot.desc.equals(AnnotationRemoverTransformer.makeAnnotationDescriptor("Provided")))
{
validMethods.add(method.access + " " + method.desc + " " + method.name);
}
}
}
}
@Override
public byte[] transform()
{
buildMethodList();
ClassReader cr = new ClassReader(bytecode);
ClassWriter cw = new ClassWriter(cr, 0);
cr.accept(new ClassVisitor(Opcodes.ASM6, cw)
{
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature,
String[] exceptions)
{
if (validMethods.contains(access + " " + desc + " " + name))
{
return null;
}
return super.visitMethod(access, name, desc, signature, exceptions);
}
}, 0);
return cw.toByteArray();
}
}

View File

@@ -1,44 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.util;
import javassist.CannotCompileException;
import javassist.CtClass;
import java.io.IOException;
public class JavassistUtils
{
public static byte[] getClassBytecode(CtClass clazz) throws IOException, CannotCompileException
{
clazz.stopPruning(true);
byte[] retVal = clazz.toBytecode();
clazz.defrost();
return retVal;
}
}

View File

@@ -1,339 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.util;
import us.runelitepl.mixinprocessor.MixinProcessorMojo;
import java.util.Map;
public class RefUtils
{
public static final String TYPE_PREFIX = "us/runelitepl/mixins/";
public static final String STATICS_STRING = "_Statics_";
public static final String[] POSSIBLE_GARBAGE_TYPES = {"I", "B", "S"};
public static String deobClassName(String obbed)
{
for (Map.Entry<String, String> entry : MixinProcessorMojo.classNames.entrySet())
{
if (entry.getValue().equals(obbed))
{
return entry.getKey();
}
}
return obbed;
}
public static String getObbedClassName(String deob)
{
return MixinProcessorMojo.classNames.getOrDefault(deob, deob);
}
public static String reobClassName(String deobbed)
{
String old = deobbed;
if (deobbed.contains("/"))
{
deobbed = deobbed.replaceAll(TYPE_PREFIX, "");
deobbed = getObbedClassName(deobbed);
if (deobbed == null)
{
return old;
}
}
return deobbed;
}
@Deprecated
public static String reobFieldNameDangerous(String deob, String desc)
{
int i = 0;
Map.Entry<String, String> e1 = null;
for (Map.Entry<String, String> entry : MixinProcessorMojo.fieldNames.entrySet())
{
if (entry.getKey().endsWith(deob + " " + desc))
{
i++;
e1 = entry;
}
}
if (i == 1)
{
return e1.getValue();
}
return null;
}
@Deprecated
public static String reobMethodNameDangerous(String deob, String signature)
{
int i = 0;
Map.Entry<String, String> e1 = null;
for (Map.Entry<String, String> entry : MixinProcessorMojo.methodNames.entrySet())
{
if (entry.getKey().endsWith(" " + deob + " " + signature))
{
i++;
e1 = entry;
}
}
if (i == 1)
{
return e1.getValue();
}
return null;
}
public static String reobFieldName(String owner, String deob, String desc)
{
if (owner.equals(RefUtils.STATICS_STRING))
{
return reobFieldNameDangerous(deob, desc);
}
String asd = MixinProcessorMojo.fieldNames.getOrDefault(owner + " " + deob + " " + desc, null);
if (asd == null)
{
return null;
}
return asd.split(" ")[1];
}
public static String reobMethodName(String owner, String deob, String signature)
{
String prefix = "";
if (owner.startsWith(RefUtils.TYPE_PREFIX))
{
owner = owner.substring(RefUtils.TYPE_PREFIX.length());
}
if (deob.startsWith("prepend$"))
{
prefix = "prepend$";
deob = deob.substring("prepend$".length());
}
else if (deob.startsWith("append$"))
{
prefix = "append$";
deob = deob.substring("append$".length());
}
if (owner.equals(RefUtils.STATICS_STRING))
{
String retVal = reobMethodNameDangerous(deob, signature);
if (retVal == null)
{
return null;
}
String[] split = retVal.split(" ");
split[1] = prefix + split[1];
return String.join(" ", split);
}
String asd = MixinProcessorMojo.methodNames.getOrDefault(owner + " " + deob + " " + signature, null);
if (asd == null)
{
return null;
}
return prefix + asd.split(" ")[1];
}
@Deprecated
public static boolean shouldReobFieldDangerous(String deob, String desc)
{
int i = 0;
for (Map.Entry<String, Boolean> entry : MixinProcessorMojo.isFieldTagged.entrySet())
{
if (entry.getKey().endsWith(deob + " " + desc))
{
i++;
}
}
return i == 1;
}
@Deprecated
public static boolean shouldReobMethodDangerous(String deob, String desc)
{
int i = 0;
for (Map.Entry<String, Boolean> entry : MixinProcessorMojo.isMethodTagged.entrySet())
{
if (entry.getKey().endsWith(" " + deob + " " + desc))
{
i++;
}
}
return i == 1;
}
public static boolean shouldReobField(String owner, String deob, String desc)
{
if (owner.equals(RefUtils.STATICS_STRING))
{
return shouldReobFieldDangerous(deob, desc);
}
return MixinProcessorMojo.isFieldTagged.getOrDefault(owner + " " + deob + " " + desc, false);
}
public static boolean shouldReobMethod(String owner, String deob, String desc)
{
if (owner.startsWith(RefUtils.TYPE_PREFIX))
{
owner = owner.substring(RefUtils.TYPE_PREFIX.length());
}
if (owner.equals(RefUtils.STATICS_STRING))
{
return shouldReobMethodDangerous(deob, desc);
}
return MixinProcessorMojo.isMethodTagged.getOrDefault(owner + " " + deob + " " + desc, false);
}
public static String reobDescriptor(String descriptor)
{
if (!descriptor.startsWith("L"))
{
return descriptor;
}
if (!descriptor.contains("us/runelitepl/mixins/"))
{
return descriptor;
}
String orig = descriptor;
descriptor = descriptor.replace("us/runelitepl/mixins/", "");
descriptor = descriptor.substring(1, descriptor.length() - 1);
descriptor = getObbedClassName(descriptor);
if (descriptor == null)
{
return orig;
}
return "L" + descriptor + ";";
}
public static String reobMethodDescriptor(String descriptor)
{
int strIndex = 0;
if (descriptor.charAt(0) != '(')
{
throw new IllegalArgumentException("sig is not a method signature: " + descriptor);
}
StringBuilder deobbed = new StringBuilder(1024 * 1024);
while (strIndex < descriptor.length())
{
switch (descriptor.charAt(strIndex))
{
case '(':
case ')':
case 'I':
case 'B':
case 'J':
case 'S':
case 'D':
case 'F':
case 'C':
case 'Z':
case 'V':
case '[':
deobbed.append(descriptor.charAt(strIndex));
strIndex++;
break;
case 'L':
try
{
String sigPart = descriptor.substring(strIndex, descriptor.indexOf(";", strIndex) + 1);
String className = sigPart.substring(1, sigPart.length() - 1);
className = className.replace(TYPE_PREFIX, "");
String obbedName = MixinProcessorMojo.classNames.getOrDefault(className, null);
if (obbedName == null)
{
obbedName = className;
}
deobbed.append("L").append(obbedName ).append(";");
strIndex += sigPart.length();
}
catch (StringIndexOutOfBoundsException ex)
{
System.err.println(
"Method signature %s is probably missing a semi-colon".replace("%s", descriptor));
throw ex;
}
break;
default:
throw new IllegalArgumentException("signature is invalid: " + descriptor);
}
}
return deobbed.toString();
}
public static String appendArgument(String desc, String append)
{
int strIndex = 0;
if (desc.charAt(0) != '(')
{
throw new IllegalArgumentException("sig is not a method signature: " + desc);
}
StringBuilder deobbed = new StringBuilder(1024 * 1024);
while (strIndex < desc.length())
{
switch (desc.charAt(strIndex))
{
case ')':
deobbed.append(append);
deobbed.append(")");
strIndex++;
break;
case '(':
case 'I':
case 'B':
case 'J':
case 'S':
case 'D':
case 'F':
case 'C':
case 'Z':
case 'V':
case '[':
deobbed.append(desc.charAt(strIndex));
strIndex++;
break;
case 'L':
try
{
String sigPart = desc.substring(strIndex, desc.indexOf(";", strIndex) + 1);
deobbed.append(sigPart);
strIndex += sigPart.length();
}
catch (StringIndexOutOfBoundsException ex)
{
System.err.println(
"Method signature %s is probably missing a semi-colon".replace("%s", desc));
throw ex;
}
break;
default:
throw new IllegalArgumentException("signature is invalid: " + desc);
}
}
return deobbed.toString();
}
}

View File

@@ -1,71 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.util;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.util.stream.Collectors;
public class WebUtils
{
public static String getUrlContent(String url) throws IOException
{
String pageText;
URLConnection conn = new URL(url).openConnection();
try (BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)))
{
pageText = reader.lines().collect(Collectors.joining("\n"));
}
return pageText;
}
public static byte[] downloadFile(String urlText) throws IOException
{
URL url = new URL(urlText);
ByteArrayOutputStream output = new ByteArrayOutputStream();
try (InputStream inputStream = url.openStream())
{
int n;
byte [] buffer = new byte[ 1024 ];
while (-1 != (n = inputStream.read(buffer)))
{
output.write(buffer, 0, n);
}
}
return output.toByteArray();
}
}

View File

@@ -1,22 +0,0 @@
Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1,887 +0,0 @@
{
"a.f(BI)C" : -1102775612,
"a.gt(I)Z" : -1103685678,
"a.m(Ljava/io/File;Ljava/io/File;I)V" : 384427878,
"aa.fd(I)V" : -611671017,
"aa.je(Lho;I)Lho;" : -1281324385,
"ac.a(Lbt;I)V" : 1176879237,
"ac.ap(ILcg;ZI)I" : -194555369,
"ac.kd(Ljava/lang/String;B)V" : 25,
"ad.a(I)V" : 189899671,
"ad.d(B)V" : 0,
"ad.e(I)V" : -359530976,
"ad.f(III)I" : 1198288699,
"ad.g(I)V" : 1208475473,
"ad.gf(IIIII)V" : -1523090390,
"ad.l(B)V" : -1,
"ad.m(IIIIIIIIB)V" : 1,
"ad.o(I)V" : 1484455718,
"ad.q(IB)I" : 0,
"ad.u(I)V" : 1590087827,
"ad.w(I)V" : 179443569,
"ad.x(I)V" : -1218466246,
"ae.ce(Lgr;Lgr;IZI)V" : 2002558112,
"ae.cy(Lgr;ZB)V" : 0,
"ae.l(ILcg;ZI)I" : -714719812,
"ae.m(II)Ljh;" : 1432369110,
"ae.m(II)Z" : 1696660245,
"ae.s(IIII)I" : 1705746695,
"ae.u(IB)Z" : 1,
"af.f(II)Ljr;" : 151801733,
"af.gc(ZLhx;B)V" : 1,
"af.kh(Ljava/lang/String;ZI)V" : 1475398416,
"af.kk([BII)V" : 546339123,
"af.m(IB)Lio;" : 9,
"ag.g(B)V" : 11,
"ag.kc(B)V" : -1,
"ag.m(III)I" : -288398526,
"ag.m(Lgr;II)V" : 1854512327,
"ag.o(IIII)[I" : -1237576842,
"ag.q(IIII)Z" : -266386092,
"ag.u(III)Lhu;" : 1025566830,
"ag.w(III)Z" : -16440769,
"ah.f(IIIB)Z" : 2,
"ah.f(IILfe;Lfy;I)Z" : -1481740015,
"ah.hc(ILjava/lang/String;I)V" : -1850233906,
"ah.m(Lag;I)V" : 801157534,
"ah.q(IIB)Z" : 4,
"ah.w(IIII)[I" : 1545934424,
"aj.f(III)I" : 582371857,
"aj.f(Lhx;I)V" : 16711679,
"aj.gx(IIII)V" : 820636892,
"aj.u(I)[Llq;" : 2003515882,
"aj.u(Lbt;Lbt;IZI)I" : 1358055091,
"ak.b(III)Z" : 44321945,
"ak.c(III)Z" : -543917969,
"ak.h(I)Z" : -1374362935,
"ak.y(IIB)Z" : 1,
"al.d(III)F" : 510518168,
"al.g(IIIII)Lc;" : -629971646,
"al.ij(II)Z" : 142397028,
"al.m(Lir;Ljava/lang/String;ZB)V" : 9,
"al.o(IIIILjava/util/HashSet;III)V" : -2144548575,
"al.q(IIIIIIIII)V" : -68386219,
"al.u(IIIIIIIIIII)Ljava/util/List;" : 2037151725,
"al.w(IIIII)V" : 16711681,
"al.w(IIIIIIIILjava/util/HashSet;Ljava/util/HashSet;IIZB)V" : -1,
"al.x(B)V" : 3,
"an.x(I)Ljava/lang/String;" : 636666970,
"ao.ha(I)V" : 787497434,
"ao.q(Ljava/lang/Throwable;I)Ljava/lang/String;" : 515662750,
"ao.w(ILcg;ZI)I" : 1826158254,
"ap.iy(IIIIB)V" : 2,
"ap.jw(B)Z" : -1,
"ar.jz([Lho;II)V" : -1383068187,
"as.f(IIIB)Z" : 2,
"as.fc(I)V" : -253264867,
"as.m(II)Lim;" : -2024447474,
"as.m(Lag;I)V" : 801157534,
"as.o(III)Lhu;" : 838865280,
"as.q(IIB)Z" : 4,
"as.w(IIII)[I" : 1545934424,
"at.f(Lgr;I)V" : -171100102,
"at.gr(Lbz;IIIIIB)V" : 0,
"at.hv(IIB)V" : 1,
"at.ib([Lho;Lho;ZI)V" : -250173767,
"at.m(Lgr;I)V" : 1145534330,
"av.a(Lir;B)Z" : 2,
"av.ab(Lic;B)Laj;" : 9,
"av.ac(Lic;III)V" : 65281,
"av.ad(IIIII)V" : 415972872,
"av.ae(IIIIII)Ljava/util/List;" : -1237576843,
"av.ag(IILb;B)V" : 8,
"av.ah(IILjava/util/HashSet;IB)V" : 0,
"av.aj(Ljava/util/HashSet;III)V" : -697421440,
"av.aq(IILjava/util/HashSet;IB)V" : 0,
"av.av(Lic;IIIIB)V" : 81,
"av.ay(Lak;Lic;IIFI)V" : -1237576843,
"av.b(IILb;Lad;Laq;I)V" : 1006396037,
"av.c(IILb;Lad;B)V" : 5,
"av.d(I)V" : 1466007040,
"av.e(B)V" : 9,
"av.fb(Lho;IIS)V" : 999,
"av.g(IIIILb;B)V" : 1,
"av.ix([Lho;IIIZS)V" : 3640,
"av.j(IIILjava/util/HashSet;I)V" : 893970699,
"av.l(Ljr;IIILb;I)V" : 982904923,
"av.p(IILb;Laq;I)I" : 1861435084,
"av.s(Ljava/util/HashSet;IIB)V" : -1,
"av.t(Lad;[Llq;Laq;B)V" : -1,
"av.u(Ljava/util/HashSet;Ljava/util/List;B)V" : 14,
"av.v(IILb;[Llq;S)V" : 4031,
"av.w(IIIB)V" : 0,
"av.x(Ljava/util/List;I)V" : 1248629914,
"av.y(Lad;[Llq;Laq;I)V" : 755856139,
"av.z(ILad;[Llq;Lir;Lir;I)V" : -590103688,
"aw.gk(Lbr;ZI)V" : -854420872,
"aw.m(Ljava/lang/String;ZZI)V" : 1532180466,
"aw.m([I[II)V" : -1074257800,
"aw.q(II)I" : -27797580,
"ax.f(II)V" : -1034794628,
"ax.m(I)V" : 355336051,
"ax.o(I)V" : 244995961,
"ax.q(B)I" : 0,
"ay.g(ILcg;ZB)I" : 2,
"ay.gu(IIII)I" : 1958220786,
"az.a([BB)V" : -1,
"az.f(Ljava/io/File;ZI)Z" : -732964548,
"az.ir([Lho;IIIIIIIII)V" : -1722088869,
"az.jy(II)V" : -63792310,
"b.a(IILgr;IB)V" : 1,
"b.d(IILgr;I)V" : -1039890176,
"b.e(Lir;B)V" : 0,
"b.l(I)Z" : -1724303477,
"b.u(Lhx;B)V" : 7,
"b.z(IILgr;II)V" : 539790011,
"ba.ac(I)V" : -2057469577,
"ba.ag(IIII)V" : 1886233675,
"ba.ah(I)V" : -631532897,
"ba.aj(B)Z" : 1,
"ba.am(I)Lla;" : 179561692,
"ba.an(B)Z" : 60,
"ba.ap(Ljava/lang/String;B)V" : 3,
"ba.aq(B)V" : 6,
"ba.ar(B)V" : -1,
"ba.as(I)Ljava/awt/Container;" : 175250623,
"ba.at(ILjava/lang/String;ZB)V" : 99,
"ba.av(B)V" : 0,
"ba.d(I)V" : -1739328734,
"ba.ec(IB)V" : 14,
"ba.g(Ljava/lang/Object;I)V" : -1948927603,
"ba.kv(Lho;II)Ljava/lang/String;" : 2016931356,
"ba.p(B)V" : 2,
"ba.u(IIB)V" : -1,
"ba.v(I)V" : -678198842,
"ba.z(I)V" : -338689747,
"bb.f(Ljava/awt/event/MouseEvent;I)I" : -965288682,
"bc.x(II)Len;" : -945740234,
"bd.m(I)Z" : 1352221725,
"bd.x(Lkk;Lkk;Lkk;I)V" : 2090374242,
"be.f(I)V" : 490189490,
"bf.f(I)Lgr;" : -469810794,
"bf.jl(IB)V" : 0,
"bg.f(Ljava/lang/CharSequence;I)Ljava/lang/String;" : 342552136,
"bh.a(B)Z" : 1,
"bh.e(B)Z" : 57,
"bh.g(Lkp;I)Z" : -2038468462,
"bh.j(Ljava/lang/String;I)V" : -1809189877,
"bh.kb(B)Z" : 0,
"bh.l(Ljava/lang/String;I)V" : 222529261,
"bh.t(Lkp;S)Z" : 4031,
"bh.u(Lkp;ZI)Z" : -1933935849,
"bh.w(I)V" : -1408945788,
"bh.x(Ljava/lang/String;B)V" : 5,
"bh.y(ILcg;ZI)I" : -114766124,
"bh.z(Ljava/lang/String;I)V" : -2079835745,
"bi.f(III)V" : 179561694,
"bi.gl(Ljava/lang/String;ZI)V" : -51748439,
"bj.al(ILcg;ZI)I" : -1820004516,
"bj.m(Ll;Ll;B)I" : -1,
"bk.jx(IIII)Lbx;" : -1749437915,
"bk.m(IB)Lix;" : 0,
"bk.m([BB)Laq;" : 1,
"bl.fi(Lbz;II)V" : -1019481549,
"bl.m(IIILfy;I)Z" : 631797757,
"bm.fa(I)V" : -1522097675,
"bm.kx(Ljava/lang/String;ZI)Ljava/lang/String;" : 1047910257,
"bm.l(B)V" : -2,
"bm.m(Ljava/lang/CharSequence;Llx;I)Ljava/lang/String;" : -712924508,
"bm.q(I)Z" : 1101818251,
"bm.u(B)Z" : 22,
"bn.kl(I)V" : -423549686,
"bn.m([Lgc;II)Lgc;" : -503759261,
"bp.e(Llq;I)V" : 721729686,
"bp.f(II)Ljm;" : 1925699261,
"bp.g(I[II)V" : 41816792,
"bp.l(II)V" : 838865280,
"bp.m(I)V" : 1894390476,
"bp.m(JLjava/lang/String;S)I" : 333,
"bp.q(III)V" : -1368401878,
"bp.u(II)V" : 2001187824,
"bp.w(IB)V" : 105,
"bq.aq(IZII)V" : 1906459739,
"br.a(IIBI)V" : -710253339,
"br.e(I)Ldu;" : -2089466407,
"br.f(B)Z" : 15,
"br.if(B)V" : 2,
"br.l(I)I" : 1179886185,
"br.m(Lgr;I)V" : 703065694,
"br.o(B)Z" : 1,
"br.x(IIBI)V" : -1753928225,
"br.z(B)Z" : 1,
"bs.as(ILcg;ZI)I" : 571260142,
"bs.fy(S)V" : 4119,
"bs.g(Lba;I)V" : 77851363,
"bs.q(III)I" : 741472134,
"bt.a(I)Z" : 32767,
"bt.d(I)Z" : -1235371793,
"bt.j(I)Z" : -505132278,
"bt.x(B)Z" : 0,
"bu.hr(IIIIIB)V" : 0,
"bu.it(Ljava/lang/String;Lho;B)Ljava/lang/String;" : 17,
"bu.ji(Lho;IIII)V" : 1340840897,
"bv.f(IIB)V" : 2,
"bv.iz(IIIIIIIIB)V" : -1,
"bv.m(II)Ljw;" : -339089295,
"bv.m(Lgs;Lhn;I)Lgg;" : 1481452285,
"bv.w(B)V" : -1,
"bw.e(I)Ldu;" : -2089466407,
"bw.m(II)V" : -575970018,
"bx.o(IB)I" : 1,
"bx.o([BIII)Ljava/lang/String;" : 619422509,
"bx.q(IIB)Lcg;" : -1,
"by.aq(ILcg;ZI)I" : -635678214,
"by.ep(IIB)V" : 4,
"by.gj(III)I" : -657693133,
"by.hf(B)V" : 2,
"by.j(ILcg;ZB)I" : 0,
"bz.bn(IS)V" : 127,
"bz.bq(IIIIIIB)V" : 3,
"bz.bs(IIIIIII)V" : -711405783,
"bz.hb(IIIILjava/lang/String;Ljava/lang/String;III)V" : -112386388,
"c.fw(IZZZB)Lit;" : -2,
"c.jo(Lho;IIII)V" : 1306858432,
"c.jp(Lho;I)V" : -1236661613,
"cb.e(I)Ldu;" : -2089466407,
"cb.f(II)V" : 1351865817,
"cb.m(IIIII)V" : 1488177400,
"cb.o([BZB)Ljava/lang/Object;" : 0,
"ce.o(I)V" : 1675245843,
"cf.ak(ILcg;ZB)I" : 30,
"cf.az(I)I" : 1781236691,
"cf.e(I)Ldu;" : -2089466407,
"cf.f([Ljava/lang/String;[SIII)V" : -298824478,
"cf.hx(IIZI)V" : 2072073729,
"cg.fs(Ljh;IIII)V" : -164971951,
"cg.u(IB)V" : 1,
"ch.d(I)V" : -289227528,
"ch.e(I)V" : -63654285,
"ch.f(IB)I" : 6,
"ch.g(I)V" : -1668901140,
"ch.m(III)V" : 920518911,
"ch.q([BIIII[Lfy;I)V" : 622208854,
"ch.w(II)Ljava/lang/String;" : 897961099,
"ch.x(I)V" : 1105920523,
"ch.x(Lho;IIII)V" : 1130586686,
"cj.m(Ljava/lang/CharSequence;Ljava/lang/CharSequence;II)I" : -189314181,
"cj.o(I)[B" : 12521922,
"ck.gw(II)V" : -1010622237,
"cl.f(I)V" : -1839929685,
"cl.o(I)V" : -1995388311,
"client.ab(ZI)V" : 106302203,
"client.ae(I)V" : -436209879,
"client.al(I)V" : 179385998,
"client.aw(I)V" : 1364310981,
"client.ea(IS)V" : 129,
"client.ef(B)V" : 2,
"client.ev(B)V" : 1,
"client.fg(B)V" : -1,
"client.fx(I)V" : 1988167616,
"client.ge(I)V" : -1724370129,
"client.gs(I)V" : -1433182492,
"client.hg(Lcl;I)Z" : -1188172477,
"client.hi(I)V" : -387903382,
"client.hj(IIB)V" : 1,
"client.ht(B)Z" : 1,
"client.ip(Lho;B)V" : 0,
"client.iu(ZI)V" : -271438207,
"client.j(I)V" : 1431971826,
"client.jh(I)V" : -1345786325,
"client.l(Ljava/lang/CharSequence;I)I" : 16711934,
"cm.f(Ljava/lang/String;I)Z" : -1468699107,
"cm.m(III)I" : -2035742014,
"cm.o(Lir;II)Llq;" : -1380417536,
"cn.g(I)V" : -79952305,
"cn.g(II)Z" : 588950758,
"co.ab(Ldc;II)V" : -622246193,
"co.ah(I)V" : -1953764396,
"co.ak(II)V" : -424358259,
"co.ar(I)V" : -677435748,
"cp.f(II)Lbm;" : 834859553,
"cp.fk(Lbz;I)V" : -217220209,
"cp.ia(Lho;IIB)V" : 76,
"cp.m(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Lbm;" : 463993373,
"cp.s(CI)Z" : 6686564,
"cq.aj(Lfz;III)Lco;" : -1237576843,
"cq.hu(IIIII)V" : -163054072,
"cq.jf(Lho;III)V" : 179561692,
"cr.f(II)Lbg;" : -823702432,
"cr.fo(III)V" : -889802745,
"cr.m(CI)B" : 280513757,
"cr.m(IIIIB)V" : 1,
"cs.jd(Lbx;ZI)V" : 526844766,
"cs.q(Lir;Ljava/lang/String;Ljava/lang/String;B)Llq;" : 0,
"cu.gm(B)I" : -1,
"cu.m(I)V" : 1291011546,
"cu.m(Lir;II)Lhl;" : -1625685874,
"cv.e(I)Ldu;" : -2089466407,
"cv.f(IIZI)V" : -2092515704,
"cv.f(ILff;Lit;B)V" : 1,
"cv.m(IBI)V" : 1805563726,
"cv.z(B)Z" : 1,
"cw.w(I)V" : 103402661,
"cy.aj(ILcg;ZI)I" : 1698993108,
"cy.s(ILcg;ZI)I" : 1654486766,
"d.gv(III)V" : -239357025,
"d.gz(I)I" : 2032203362,
"d.m(Ll;Ll;I)I" : -591568851,
"dj.is(Ljz;IIIB)V" : 51,
"dk.f([BIIB)V" : 0,
"dk.ig(Lho;Ljv;IIZI)V" : -232502392,
"dk.u([BIII)I" : 971670468,
"dk.w(ZI)V" : 935056797,
"dl.ac(ILcg;ZI)I" : 1297388154,
"dl.fj(I)V" : 1544946984,
"dl.g(I)V" : 179561692,
"dl.l(II)V" : -497197857,
"dl.m(I)I" : -1897619016,
"dl.q(II)[I" : -905309626,
"dl.u(II)Z" : 292576779,
"dl.u(Ljava/lang/Object;ZB)[B" : -1,
"dl.u([BIIB)Z" : 1,
"dl.w(II)I" : -1186004115,
"dm.h(ILcg;ZI)I" : 1268666886,
"dm.jg(Lho;I)Z" : 16776959,
"dm.m(IB)Lic;" : 1,
"do.m(Lir;Lir;I)I" : -1749538901,
"dp.f(I)Z" : -173887448,
"dp.f(II)I" : -895037885,
"dp.l(Ldu;IIII)Z" : 779265702,
"dp.m([BI)[B" : -524328368,
"dp.q(IB)I" : 51,
"dq.w([BB)V" : 0,
"dr.q(IB)Z" : 0,
"dt.f(II[II)Lcx;" : 524785107,
"dt.m(II[IS)Lcx;" : 6601,
"dt.q(I[IB)Lcx;" : 2,
"dt.w(Ljava/lang/CharSequence;II[BII)I" : -1459885233,
"du.d(Len;I)V" : -2,
"dx.m(II)Lcg;" : -2066229186,
"dy.g([BIII)V" : -601174169,
"dy.l(I)V" : -931421226,
"dy.o([BIIB)V" : 0,
"dy.u(I)V" : 600372049,
"e.ik(Lbr;IIII)V" : 1047789236,
"e.m(Ll;Ll;I)I" : -897920817,
"e.o(Lgr;IIIIIIB)V" : 1,
"ea.l(I)[Lln;" : -1724028611,
"ea.m(Lke;Lke;I)I" : 1870269199,
"ea.m(ZB)V" : -1,
"eb.hl(IIB)V" : 0,
"ee.f(IB)Lia;" : 16,
"ee.w([BI)Lcg;" : 1536079694,
"eg.hn(ZI)V" : -357035819,
"eg.m(Lgr;B)Ljava/lang/Integer;" : 8,
"ej.fr(Ljava/lang/String;B)V" : 103,
"ek.f(Lhx;IB)V" : 3,
"el.f(IIII)Lcg;" : -1788849120,
"el.q(Ljava/lang/String;ILjava/lang/String;I)Z" : 1209501638,
"en.f(Llh;ILjava/lang/String;I)Ljava/lang/String;" : -1337815210,
"eo.gi(IIIIB)V" : -1,
"ep.jk(IIIILln;Lhp;I)V" : 1263559944,
"ep.m(Lke;Lke;B)I" : 0,
"eq.m([BII)I" : 1120739015,
"eq.t(II)I" : -1328980261,
"es.m(Lke;Lke;B)I" : 0,
"ev.aw(ILcg;ZI)I" : -2050984400,
"ev.m(Lke;Lke;I)I" : 1009128160,
"ey.x(CI)Z" : 1315184866,
"ez.ho(II)Z" : -685754435,
"ez.m(Lke;Lke;I)I" : 170464393,
"ez.q(Lgr;II)V" : -88211227,
"f.ah(ILcg;ZB)I" : -1,
"f.jv(II)Z" : -634032697,
"f.kp(Lho;I)I" : -1080875466,
"f.o(ILcg;ZB)I" : -1,
"f.q(II)Z" : -827538084,
"f.q(III)I" : 1902619543,
"fa.kz(Ljava/lang/String;I)V" : -1555959688,
"fb.ay([BIIB)V" : 0,
"fb.f(II)Z" : 757428839,
"fb.g(I)V" : -1252618448,
"fb.m(IIILfe;Lfy;Z[I[IB)I" : 2,
"fb.o([BIII)I" : -582764183,
"fb.q(I)I" : 1305046577,
"fb.w(I)I" : 516705222,
"fc.d(CI)Z" : 1513912675,
"fd.f(III)I" : -149565951,
"fd.m(B)V" : 2,
"fd.q([Lbt;II[I[II)V" : 157815671,
"fe.d(Lir;II)Z" : -825287987,
"fe.m(III)I" : 844604881,
"ff.f(I[BII)Z" : -1750864122,
"ff.m(II)[B" : -643301428,
"ff.q(IIILfe;Lfy;B)Z" : 1,
"ff.q(I[BIZI)Z" : -944588642,
"fg.f(IIIII)V" : 265199302,
"fg.m(Lke;Lke;I)I" : 750521759,
"fh.f(I)I" : -1475171419,
"fh.gy(ZB)V" : 0,
"fh.m(II)Z" : 1236742843,
"fh.o(I)V" : -847277480,
"fh.q(I)I" : -1279866392,
"fh.w([BIIB)I" : 2,
"fo.f(IIIIIII)I" : -1048935304,
"fo.fq(B)V" : 0,
"fo.ie(IIIILjava/lang/String;I)V" : -1731066348,
"fo.m(B)V" : 1,
"fp.f(III)I" : -149565951,
"fq.m(Lke;Lke;I)I" : 1339290331,
"fr.e(Lho;I[B[BI)V" : -1337774818,
"fr.f([BIIB)V" : 0,
"fr.m(I)Z" : 1692208749,
"fs.j(CIB)Ljava/lang/String;" : 1,
"fs.o(II)Z" : 65281,
"fw.m(Lke;Lke;I)I" : 884616259,
"fx.w(I)V" : -2146928006,
"fy.f(IIIIZB)V" : 2,
"fy.g(IIIIZB)V" : 1,
"fy.l(IIIIIZB)V" : 23,
"fy.m(I)V" : 1687025486,
"fy.m(IIIB)I" : 74,
"fy.q(CII)I" : 616878226,
"fy.q(IIIIZI)V" : -559654915,
"fz.f(IIILjava/lang/Object;I)Lfm;" : 93774944,
"g.b(ILcg;ZI)I" : -1541251839,
"g.f(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V" : 1601363438,
"g.ju(III)V" : 1345636425,
"g.m(Ljava/util/Comparator;ZI)V" : -1299306042,
"ga.m(I)J" : -1237089344,
"ga.w(II)V" : 571835999,
"gd.f([BI[BIII)I" : -1851391057,
"gd.m(IB)Lho;" : 15,
"gd.m([BII[BIB)I" : 1,
"ge.g([BIIIIIIILem;[Lfy;I)V" : 179561692,
"gf.iv(IIIIIIB)V" : 0,
"gg.f(I)V" : -1987685511,
"gi.f(IZI)[B" : -622884781,
"gi.g(IZI)Ljava/lang/String;" : -399583759,
"gl.q(Ljava/lang/String;Ljava/lang/String;ZS)Ldk;" : 521,
"gm.kn(Lho;I)Ljava/lang/String;" : -1237576844,
"go.m(II)Ljq;" : 973045824,
"go.m(Lgr;[BB)V" : 0,
"gr.aa(II)I" : -1973998314,
"gr.ab(B)I" : -1,
"gr.ac(I)Z" : -454623233,
"gr.ad(B)I" : 103,
"gr.ae(I)I" : 909580331,
"gr.ah(I)Ljava/lang/String;" : -902586443,
"gr.ak(I)Ljava/lang/String;" : -350236956,
"gr.al([BIIB)V" : -1,
"gr.am([IB)V" : 1,
"gr.an([II)V" : -734912911,
"gr.ap(I)I" : 2043938097,
"gr.aq(B)I" : 1,
"gr.as(I)I" : 984135559,
"gr.at(I)I" : 557065790,
"gr.au([IIII)V" : 307218624,
"gr.aw(B)Ljava/lang/String;" : 49,
"gr.ax(B)Z" : 0,
"gr.az([IIII)V" : -1010628966,
"gr.b(II)V" : 82711634,
"gr.bh([BIII)V" : 1009764233,
"gr.bl(B)I" : 1,
"gr.br(I)I" : 1600156454,
"gr.c(II)V" : 820873705,
"gr.d(Ljava/lang/String;B)V" : -122,
"gr.e(ZB)V" : -1,
"gr.f(S)V" : 10001,
"gr.j(Ljava/lang/CharSequence;B)V" : 1,
"gr.s([BIII)V" : -1425339571,
"gu.f(II)Liw;" : 897410479,
"gu.w(II)V" : 2064469079,
"gx.f(III)Lho;" : -1975300504,
"gx.w([BIIIIIII[Lfy;B)V" : 64,
"gy.a(II)Ljava/lang/String;" : 490473303,
"gy.q(ILcg;ZB)I" : 1,
"gy.u(B)V" : 126,
"h.gp(I)V" : -660406253,
"h.w(IZIZI)V" : 1773313305,
"h.z(ILcg;ZI)I" : -1520594673,
"hb.jm(IIIIIIII)V" : 178093559,
"hb.m(IB)Lib;" : 1,
"hc.m(II)Ljv;" : -1050031795,
"hf.q(Ljava/lang/CharSequence;IZI)Z" : -1853704164,
"hg.ay(ILcg;ZI)I" : -539501780,
"hi.e(B)I" : 2,
"hi.f(IZI)V" : 359123385,
"hi.g(Ljh;ILjh;II)Ldu;" : -1429510541,
"hi.l(I)Ldw;" : 360046992,
"hi.m([I[IZII)V" : -1003411523,
"hi.o(Lgr;I)V" : -1410569943,
"hi.q(IZI)V" : 1416503110,
"hi.u(B)V" : 2,
"hi.w(ZB)V" : 0,
"hj.l(IIIIIILem;Lfy;B)V" : 0,
"hk.z(Ljava/lang/String;I)Ljava/lang/String;" : -1806991505,
"hl.f(Ldt;[B[II)Z" : 1345166622,
"hm.aa(Lha;I)I" : 952510649,
"hm.ab(II)V" : -1843264140,
"hm.ad(II)V" : -157680171,
"hm.ae(II)V" : 1458917637,
"hm.af(Lha;I)I" : 399287092,
"hm.ah(II)V" : 805065996,
"hm.ai(B)V" : 30,
"hm.al(Ldc;B)V" : 34,
"hm.ap(II)V" : 587489301,
"hm.at(I)V" : 808372536,
"hm.au(II)V" : -1543791768,
"hm.ax(Lha;I)I" : 24812899,
"hm.b(IIII)V" : 440673531,
"hm.ba(Lha;I)Z" : 1656646738,
"hm.bb(Lha;[IIII)Z" : -1696073702,
"hm.h(Lha;ZI)V" : 646605086,
"hm.o(B)V" : 0,
"hm.q(Lhe;Lir;Ldt;II)Z" : 1259796992,
"hm.t(III)V" : -2059868559,
"hm.w(B)V" : -1,
"hm.x(Lhe;ZI)V" : 859760593,
"hm.y(IIIB)V" : 7,
"hn.f(I)I" : 1852267644,
"hn.fl(II)V" : 842569875,
"hn.m(I)I" : -1583654140,
"hn.q(B)V" : 3,
"hn.w(I)V" : -635967030,
"ho.a(II)Lln;" : 2009763050,
"ho.d(B)Lkk;" : -1,
"ho.g(Lgr;I)[Ljava/lang/Object;" : 403484159,
"ho.j(ZB)Lhp;" : 4,
"ho.l(Lgr;B)[I" : 1,
"ho.o(Lgr;I)V" : 688173225,
"ho.t(ILjava/lang/String;B)V" : 0,
"ho.u(Lgr;I)V" : -1669858853,
"ho.x(ZI)Lln;" : 1104641259,
"ho.z(Ljh;IZLhi;I)Ldu;" : 385109110,
"hp.l(IB)I" : 0,
"hp.m(I)V" : 1041609343,
"hp.m(III)Z" : 781236044,
"hq.f(Lha;II)V" : 1882591412,
"hq.m(Lha;[IIIII)V" : 1870746124,
"hr.w(Lhx;II)V" : -742249138,
"ht.d(IIIIIZI)Lln;" : -76173898,
"hu.f(Lhu;B)Z" : -1,
"hv.ki(Lgr;I)V" : -1525119747,
"hx.f(Lit;IIIBZI)V" : -1413255901,
"hx.ia(I)I" : 2072155873,
"hx.ig(B)Z" : 49,
"hx.jb([BIII)V" : 860965018,
"hx.jw(II)I" : 404650358,
"hx.m(III)Z" : 250357248,
"hy.q(Ljava/lang/CharSequence;I)[B" : -469670982,
"hz.ad(ILcg;ZI)I" : 1886084106,
"hz.gq(B)V" : -1,
"hz.kj(B)V" : 2,
"hz.m(IB)Ljb;" : -1,
"i.fm(B)V" : 7,
"i.hm(Lbi;I)V" : -527387190,
"ia.q(Lgr;I)V" : 1005981628,
"ia.t(III)Z" : -1434771609,
"ia.w(Lgr;IB)V" : -2,
"ib.f(Lgr;I)V" : 628080573,
"ib.q(Lgr;II)V" : 1186158284,
"ic.f(Lgr;B)V" : 2,
"ic.m(IB)Lko;" : 1,
"ic.q(Lgr;II)V" : -1850181860,
"ic.u(IB)Lln;" : -1,
"ic.w(I)V" : -103049786,
"id.ay([BI)[B" : 924178739,
"ie.o(Lhx;II)Z" : -1851390251,
"if.gh(Lbr;III)V" : -701527010,
"if.kt(Lgr;IS)V" : 179,
"ig.e(B)Lln;" : -1,
"ig.hd(IIIIIIIIII)V" : -574834388,
"ih.o(Lgr;III)V" : -1904544820,
"ih.u(IB)V" : 24,
"ih.w(Lgr;II)V" : -819769801,
"ii.f(Lgr;IB)V" : 2,
"ii.m(Lgr;I)V" : 280763431,
"ii.q(B)Lln;" : 49,
"ii.w(B)Lln;" : -1,
"ij.o(II)V" : 300731074,
"ik.fn(Lbz;I)V" : 483387730,
"il.im(Lho;I)Z" : -1714518363,
"il.jr([Lho;IIIIIIII)V" : 810322342,
"im.f(Lgr;S)V" : 516,
"im.g(B)Ldw;" : -1,
"im.o(B)Ldw;" : 0,
"im.q(Lgr;II)V" : 1238046215,
"im.u(I)Z" : 742548471,
"im.w(I)Z" : -415108810,
"io.f(Lgr;I)V" : -892566508,
"io.gn(B)I" : 64,
"io.q(Lgr;II)V" : 1683792492,
"io.w(II)Ldu;" : -817399669,
"ir.a(IB)[B" : -1,
"ir.ag(Ljava/lang/String;Ljava/lang/String;B)Z" : 9,
"ir.ar(Ljava/lang/String;B)V" : -1,
"ir.b(I)V" : -709581639,
"ir.c(I[II)Z" : -178777177,
"ir.d(III)[B" : -755739011,
"ir.e(II)I" : 687297398,
"ir.eg(I)Z" : 308670894,
"ir.g(II)Z" : 1432972902,
"ir.j(IB)[I" : 1,
"ir.l(I)Z" : 1576451725,
"ir.m(Lgr;Llh;I)Llh;" : -1975780740,
"ir.m([BB)V" : 0,
"ir.o(III)Z" : -1592422511,
"ir.u(II)Z" : 280765829,
"ir.w(II[II)[B" : -1363136655,
"ir.x(IS)[B" : 3138,
"ir.y(B)V" : 2,
"is.f(II)Lih;" : -1558696503,
"it.ca(I)I" : 631815052,
"it.co(III)V" : -1536350011,
"it.da(I)I" : -974550105,
"it.de(I[BZZB)V" : 0,
"it.df(II)Z" : 1333086757,
"it.dt(I)V" : 259254895,
"it.dx(Lff;I[BZI)V" : 19136910,
"it.e(II)I" : 687297398,
"it.jc(IB)V" : 3,
"it.z(II)V" : -1829145107,
"iu.ar(ILcg;ZI)I" : 862047296,
"iu.f(II)V" : 1977317248,
"iu.g(Lln;Lln;Lla;B)V" : 51,
"iu.q(II)Lln;" : -712502202,
"iu.u(IILln;FI)V" : 565653308,
"iu.w(III)V" : -649043938,
"iv.ky(Ljava/lang/String;B)V" : 65,
"iw.a(CI)Z" : 926909351,
"iw.w(Lgr;II)V" : -401597024,
"iw.w(Ljava/lang/String;I)Ljava/lang/Class;" : 1676449794,
"ix.f(Lgr;B)V" : 0,
"iz.jt([Lho;II)V" : 1807602893,
"j.hh(Lgf;I)V" : 586943288,
"j.ii(Lho;II)I" : -738193841,
"j.il(Ljava/lang/String;Ljava/lang/String;IIIIZB)V" : 0,
"j.m([BILjava/lang/CharSequence;I)I" : -1237576844,
"j.t(ILcg;ZI)I" : 1580670800,
"jb.hs(IIIIIIII)V" : -904254947,
"jb.o(I)Z" : -1844509643,
"jb.q(Lgr;I)V" : -882756226,
"jb.w(Lgr;II)V" : 1664350313,
"jf.f(I)V" : -757995657,
"jf.iw(Lho;IIB)V" : 1,
"jf.o(II)V" : -2024533037,
"jf.q(Lgr;II)V" : -424203051,
"jf.w(Lgr;III)V" : 140117453,
"jh.e(Ldu;II)Ldu;" : -15433768,
"jh.f(Lgr;S)V" : 259,
"jh.g(Ldu;II)Ldu;" : -1691813082,
"jh.l(Ldu;ILjh;II)Ldu;" : -386360993,
"jh.o(Ldu;II)Ldu;" : 1634221111,
"jh.q(Lgr;II)V" : -494107421,
"jh.u(Ldu;IIB)Ldu;" : 97,
"jh.w(B)V" : 1,
"ji.m(I)Z" : -545021568,
"jk.f(I)Z" : 2245859,
"jk.o(I)Z" : -1463106780,
"jk.q(I)V" : -932474234,
"jm.d(I)Lkk;" : -665112442,
"jm.e(B)Lln;" : -1,
"jm.g(I)Lln;" : -1645409108,
"jm.l(B)Lln;" : 24,
"jm.o(B)Ljm;" : 5,
"jm.q(Lgr;I)V" : 1673138609,
"jm.u(IS)Ljava/lang/String;" : 1000,
"jm.w(Lgr;II)V" : 1224754295,
"jm.x(I)Lln;" : -426282509,
"jn.m([Ljava/lang/CharSequence;III)Ljava/lang/String;" : -715264246,
"jo.f(B)V" : 3,
"jo.g(Lgr;I)V" : -1096942047,
"jo.w(I)V" : -1832292790,
"jq.o(IIB)I" : 5,
"jq.q(Lgr;I)V" : 1597846203,
"jq.u(ILcg;ZI)I" : 356973448,
"jq.w(Lgr;II)V" : 227858297,
"jr.a(B)Ljr;" : 3,
"jr.d(IIB)Ldw;" : 6,
"jr.e(II[[IIIIB)Ldu;" : 0,
"jr.f(II)Ljz;" : -2141472020,
"jr.g(I)Z" : -1052216545,
"jr.l(II[[IIIIS)Lex;" : 276,
"jr.o(Lgr;II)V" : 179561692,
"jr.q(I)V" : -1975780740,
"jr.t(I)Z" : 8470625,
"jr.u(II)Z" : 359123387,
"jr.w(Lgr;I)V" : 1304828743,
"jr.x(II[[IIIILjh;II)Ldu;" : 334293592,
"jr.z(IIB)I" : 0,
"js.ag(I)Ljava/lang/String;" : 1204003359,
"js.aq(Lkp;Lkp;I)V" : 776499434,
"js.v(B)Ljava/lang/String;" : 0,
"jv.b(I)I" : -151381107,
"jv.e(II)Ldu;" : 777863985,
"jv.j(ZB)Ldw;" : 0,
"jv.l(II)Ldw;" : 1394031768,
"jv.q(Lgr;I)V" : -1984764072,
"jv.s(ZI)Z" : 2086952597,
"jv.t(ZI)Ldw;" : 1515187647,
"jv.u(Ljv;Ljv;I)V" : 227754762,
"jv.w(Lgr;II)V" : -1975780739,
"jv.x(IB)Ljv;" : 0,
"jv.y(IIS)I" : 225,
"jv.z(ZI)Z" : -918880706,
"jw.f(Lgr;I)V" : -661145764,
"jw.q(Lgr;II)V" : -1608759683,
"jz.e(I)V" : 330235566,
"jz.e(I)Z" : -1032325213,
"jz.e(IIIIIIIS)Z" : 4999,
"jz.g(I)Ldw;" : -52594719,
"jz.kw(Ljava/lang/String;I)Ljava/lang/String;" : 1100306484,
"jz.l(B)Ljz;" : 1,
"jz.m(Ljava/lang/String;Ljava/lang/Throwable;I)V" : -2042206308,
"jz.o(Lgr;IB)V" : -1,
"jz.u(Ljh;ILjh;II)Ldu;" : 1205135740,
"jz.w(Lgr;I)V" : -1488265411,
"jz.x(III)I" : -1905551500,
"k.a(ILcg;ZI)I" : 73348622,
"k.ak(B)V" : -1,
"k.c(ILcg;ZI)I" : -688225467,
"k.ih(IIIIII)V" : -1292134247,
"k.m(Lhx;B)V" : 2,
"kd.go(I)V" : 296849868,
"ke.au(I)Z" : 1234041596,
"ke.ff(I)V" : 1764645916,
"kf.e(Ljava/util/Comparator;B)V" : 1,
"kf.fu(II)V" : 1103753846,
"kf.x(Ljs;Ljs;I)I" : -962181316,
"kg.q(Lkp;ZI)Z" : 1557073132,
"kg.x(Lgr;IB)V" : -1,
"kj.q(Lgr;IB)V" : 32,
"kj.u(Ljava/lang/CharSequence;IZB)I" : 26,
"km.ag(Lkp;Lkp;I)Ljs;" : -569526370,
"km.ah(Ljs;B)V" : 2,
"km.aj(I)V" : -260081892,
"km.ak(II)V" : -616972929,
"km.al(Ljava/util/Comparator;B)V" : -1,
"km.aq(II)Ljs;" : -1676228472,
"km.ar(Ljs;I)I" : -1296251970,
"km.b(Lkp;I)Ljs;" : -1288098449,
"km.c(Lkp;S)Z" : 3112,
"km.h(Lkp;I)Ljs;" : -1364698032,
"km.p(Ljs;I)V" : 2138505014,
"km.s(I)Z" : 2023600096,
"km.y(Lkp;I)Ljs;" : -48018376,
"kp.q(Lkp;B)I" : 8,
"kq.m(Lkq;I)I" : 1419738067,
"ks.fv(IIIB)V" : 2,
"ku.m(Ljava/lang/CharSequence;B)Ljava/lang/String;" : 1,
"ku.q(B)Lbf;" : 6,
"kv.a(Lgr;B)V" : 1,
"kv.cf(B)V" : 15,
"kv.cg(I)V" : 1316801343,
"kv.cp(Ljk;I)V" : -2146984764,
"kv.d(Lgr;I)V" : 1412102150,
"kx.av(ILcg;ZI)I" : -1706315050,
"kx.gg(IIIIZI)V" : -158136951,
"kx.km(B)V" : 1,
"kx.u(IIIZII)J" : 1039369805,
"kz.l(I)Lbt;" : 1841016522,
"kz.m([Lkx;I)Ljava/util/HashMap;" : -975614331,
"l.f(Lby;II)V" : -1003049523,
"l.iq(II)Ljava/lang/String;" : 1125391645,
"l.w(III)I" : -1190912876,
"la.m(DDII)[D" : 1861681836,
"la.o(Lla;Lla;S)V" : 128,
"la.w(Lla;Lla;I)V" : 1144788867,
"lb.m(Lgr;I)V" : 410614006,
"le.m(Lir;III)Lln;" : -1975780740,
"lg.f(Lir;Lir;III)Lkk;" : 1201814253,
"lg.m(Lir;I)V" : 1443846574,
"li.m(Ljs;Ljs;I)I" : -1501036163,
"ls.f(I)I" : 2019633217,
"ls.m(Ljava/lang/String;I)V" : -1415789480,
"lu.m(I)Llb;" : -843739713,
"lv.m(II)I" : 1815939047,
"ly.m(Ljs;Ljs;B)I" : 1,
"lz.a(IIIZI)V" : 968072996,
"lz.ab(IIII)V" : 1808854561,
"lz.ad(I)Lhu;" : -1802799043,
"lz.ae(I)I" : -1213137046,
"lz.ag(IIIIB)V" : 0,
"lz.ah(II)Lag;" : -1424921056,
"lz.ai(ZI)V" : 179561693,
"lz.ak(III)V" : -972337508,
"lz.al(IIIB)V" : -1,
"lz.am(II)V" : 1967790208,
"lz.ar(B)I" : 0,
"lz.at(I)I" : 676916510,
"lz.av(IB)F" : 1,
"lz.ax(IB)V" : 0,
"lz.az(II)V" : 2075507240,
"lz.b(IIII)V" : -619746546,
"lz.ba(IZI)V" : 823330938,
"lz.bb(IZI)V" : -1534740405,
"lz.bc(ILhu;I)Lhu;" : 163739733,
"lz.bd(IIIIIIB)V" : 0,
"lz.bn(II)Z" : 2114495495,
"lz.bq(IB)Z" : 1,
"lz.bs(B)Z" : 101,
"lz.bx(I)Lak;" : -1658323376,
"lz.by(B)Lak;" : 24,
"lz.c(IIIIII)V" : -1888713743,
"lz.d(IIII)Lag;" : 1235026356,
"lz.g(I)V" : 815418458,
"lz.h(Lag;Lhu;Lhu;ZI)V" : 1278004232,
"lz.j(I)I" : -1301490692,
"lz.l(IIZI)V" : -943230538,
"lz.p(IIIIIII)Z" : 214638414,
"lz.q(IIZIIIIB)V" : 0,
"lz.t(Lag;B)V" : 0,
"lz.u(I)V" : -328885193,
"lz.v(IIIIIII)V" : 102917729,
"lz.w(IIZZS)V" : 764,
"lz.x(I)Z" : -1975780738,
"lz.z(II)V" : 1318491821,
"n.e(IB)I" : 2,
"n.f(CII)C" : -624851961,
"n.ja(I)V" : 1378363532,
"n.m(II)Z" : 1759858381,
"n.m(Ll;Ll;B)I" : -1,
"o.v(ILcg;ZB)I" : 1,
"p.am(IB)V" : 2,
"p.d(Lho;II)V" : 48479172,
"p.f(IIIB)Z" : 2,
"p.ic(Lho;IIZB)V" : 7,
"p.m(Lag;I)V" : 801157534,
"p.q(IIB)Z" : 4,
"p.w(IIII)[I" : 1545934424,
"q.q(Lir;Lir;ZII)V" : -1496648285,
"q.w(Lir;Ljava/lang/String;Ljava/lang/String;B)[Lln;" : 0,
"r.hw(Lbr;IIBB)V" : 1,
"r.m(Ljava/lang/String;I)Ljava/io/File;" : 16723968,
"r.z(I)V" : -806344204,
"s.f(FI)Z" : -384562627,
"s.jj(I)V" : -860023402,
"s.q(IB)Ls;" : 1,
"t.fz(I)V" : 2141786651,
"u.ag(ILcg;ZB)I" : 13,
"u.he(Lhx;B)V" : 1,
"u.m(Ll;Ll;I)I" : 707844889,
"v.gd(I)V" : -1352403950,
"v.hk(IIIII)V" : 162108213,
"v.j(III)I" : 1758739649,
"w.hq(ZLhx;B)V" : 1,
"w.o(IIIZIZI)V" : 653716649,
"w.q(I)V" : -1802525390,
"x.ez(B)I" : 1,
"x.kf(I)V" : -1378196634,
"x.q(Lhx;I)I" : 1397751176,
"x.u(II)V" : 743094900,
"y.f(IIIB)Z" : 2,
"y.hz(II)V" : -812656337,
"y.io(Lho;IIIIIII)V" : -114766124,
"y.m(Lag;I)V" : 801157534,
"y.o(III)Lhu;" : 838865280,
"y.q(IIB)Z" : 4,
"y.w(I)V" : -1797686309,
"y.w(IIII)[I" : 1545934424,
"z.f(Lgr;I)V" : -171100102,
"z.fh(ZI)V" : 1345381458,
"z.jn(Lho;I)V" : 1286523826,
"z.m(Lgr;I)V" : 962518033,
"z.p(ILcg;ZI)I" : 1702523701,
"z.z(IIB)I" : 3
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,111 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.5.27-SNAPSHOT</version>
</parent>
<artifactId>extended-mixins</artifactId>
<name>RuneLite Extended Mixins</name>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.runelite.rs</groupId>
<artifactId>runescape-api</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- RuneScape classes do not verify
under Java 7+ due to the obfuscation
-->
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>net.runelite</groupId>
<artifactId>extended-mixin-processor</artifactId>
<version>${project.version}</version>
<configuration>
</configuration>
<executions>
<execution>
<id>reob-classes</id>
<phase>process-classes</phase>
<configuration>
<hooks>${artifactId}/hooks.json</hooks>
<ops>${artifactId}/gamepack.deob.jar.op.json</ops>
</configuration>
<goals>
<goal>process-mixins</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Append
{
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Inject
{
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Overwrite
{
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Prepend
{
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Provided
{
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixinprocessor.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Reobfuscate
{
}

View File

@@ -1,63 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixins;
import net.runelite.api.events.AnimationChanged;
import net.runelite.api.events.GraphicChanged;
import us.runelitepl.mixinprocessor.annotations.Overwrite;
import us.runelitepl.mixinprocessor.annotations.Provided;
import us.runelitepl.mixinprocessor.annotations.Reobfuscate;
public class Actor
{
@Reobfuscate
@Provided
int sequence;
@Overwrite
public int getAnimation()
{
return sequence * 42069;
}
@Overwrite
public void animationChanged(int n)
{
AnimationChanged animationChanged = new AnimationChanged();
animationChanged.setActor((net.runelite.api.Actor) this);
Client.INSTANCE.getCallbacks().post(animationChanged);
}
@Overwrite
public void graphicChanged(int n)
{
GraphicChanged graphicChanged = new GraphicChanged();
graphicChanged.setActor((net.runelite.api.Actor)this);
Client.INSTANCE.getCallbacks().post(graphicChanged);
}
}

View File

@@ -1,542 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixins;
import net.runelite.api.MenuEntry;
import net.runelite.api.Node;
import net.runelite.api.hooks.Callbacks;
import net.runelite.rs.api.RSCollisionData;
import net.runelite.rs.api.RSDeque;
import net.runelite.rs.api.RSNode;
import us.runelitepl.mixinprocessor.annotations.Inject;
import us.runelitepl.mixinprocessor.annotations.Overwrite;
import us.runelitepl.mixinprocessor.annotations.Prepend;
import us.runelitepl.mixinprocessor.annotations.Provided;
import us.runelitepl.mixinprocessor.annotations.Reobfuscate;
import java.util.List;
public class Client
{
@Provided
public static boolean isHidingEntities;
@Provided
public static boolean hideLocalPlayer2D;
@Provided
public static boolean hideLocalPlayer;
@Provided
public static boolean hidePlayers2D;
@Provided
public static boolean hidePlayers;
@Provided
public static boolean hideAttackers;
@Provided
public static boolean hideProjectiles;
@Provided
public static boolean hideNPCs2D;
@Provided
public static boolean hideNPCs;
@Provided
public static boolean hideFriends;
@Provided
public static boolean hideClanMates;
@Inject
public static Client INSTANCE;
@Inject
public static boolean printMenuActions;
@Provided
public static int oldMenuEntryCount;
@Reobfuscate
@Provided
static boolean renderSelf;
@Provided
public static final int[] rl$modelViewportXs = new int[0];
@Provided
public static final int[] rl$modelViewportYs = new int[0];
@Prepend
private void prepend$rl$$init()
{
INSTANCE = this;
printMenuActions = false;
}
@Inject
public void toggleRenderSelf()
{
renderSelf = !renderSelf;
}
@Provided
public int getMenuOptionCount()
{
throw new RuntimeException();
}
@Provided
public String[] getMenuOptions()
{
throw new RuntimeException();
}
@Provided
public String[] getMenuTargets()
{
throw new RuntimeException();
}
@Provided
public int[] getMenuIdentifiers()
{
throw new RuntimeException();
}
@Provided
public int[] getMenuTypes()
{
throw new RuntimeException();
}
@Provided
public int[] getMenuActionParams0()
{
throw new RuntimeException();
}
@Provided
public int[] getMenuActionParams1()
{
throw new RuntimeException();
}
@Provided
public boolean[] getMenuForceLeftClick()
{
throw new RuntimeException();
}
@Provided
public void setMenuOptionCount(int i)
{
throw new RuntimeException();
}
@Provided
public Callbacks getCallbacks()
{
throw new RuntimeException();
}
@Provided
public RSCollisionData[] getRsCollisionMaps()
{
throw new RuntimeException();
}
@Provided
public RSDeque getProjectilesDeque()
{
throw new RuntimeException();
}
@Overwrite
public List getProjectiles()
{
List list = new java.util.ArrayList();
RSNode head = getProjectilesDeque().getHead();
for (Node node = ((Node) head).getNext();
node != head;
node = node.getNext())
{
list.add(node);
}
return list;
}
@Inject
public void setPrintMenuActions(boolean b)
{
printMenuActions = b;
}
@Overwrite
public RSCollisionData[] getCollisionMaps()
{
return getRsCollisionMaps();
}
@Overwrite
public void setMenuEntries(MenuEntry[] arrmenuEntry)
{
int n2 = 0;
String[] arrstring = this.getMenuOptions();
String[] arrstring2 = this.getMenuTargets();
int[] arrn = this.getMenuIdentifiers();
int[] arrn2 = this.getMenuTypes();
int[] arrn3 = this.getMenuActionParams0();
int[] arrn4 = this.getMenuActionParams1();
boolean[] arrbl = getMenuForceLeftClick();
net.runelite.api.MenuEntry[] arrmenuEntry2 = arrmenuEntry;
int n3 = arrmenuEntry2.length;
int n4 = 0;
do
{
String string;
if (n4 >= n3)
{
this.setMenuOptionCount(n2);
oldMenuEntryCount = n2;
return;
}
net.runelite.api.MenuEntry menuEntry = arrmenuEntry2[n4];
int n5 = menuEntry.getType();
arrstring[n2] = menuEntry.getOption();
arrstring2[n2] = menuEntry.getTarget();
arrn[n2] = menuEntry.getIdentifier();
arrn2[n2] = n5;
arrn3[n2] = menuEntry.getParam0();
arrn4[n2] = menuEntry.getParam1();
arrbl[n2] = menuEntry.isForceLeftClick();
++n2;
++n4;
}
while (true);
}
@Overwrite
public static void onMenuOptionsChanged(int n2)
{
int n3;
int n4 = oldMenuEntryCount;
oldMenuEntryCount = n3 = INSTANCE.getMenuOptionCount();
if (n3 != n4 + 1)
{
return;
}
net.runelite.api.events.MenuEntryAdded menuEntryAdded =
new net.runelite.api.events.MenuEntryAdded(INSTANCE.getMenuOptions()[n3 - 1],
INSTANCE.getMenuTargets()[n3 - 1],
INSTANCE.getMenuTypes()[n3 - 1],
INSTANCE.getMenuIdentifiers()[n3 - 1],
INSTANCE.getMenuActionParams0()[n3 - 1],
INSTANCE.getMenuActionParams1()[n3 - 1]);
INSTANCE.getCallbacks().post(menuEntryAdded);
}
@Overwrite
public static void copy$processClientError(String s, Throwable e, byte b)
{
System.err.println("[RL+] Error thrown: " + s);
e.printStackTrace();
}
@Inject
public net.runelite.api.MouseRecorder getMouseRecorder()
{
return _Statics_.mouseRecorder;
}
@Inject
public boolean boundingboxCheck2(net.runelite.api.Model model, int n2, int n3, int n4)
{
int n5 = INSTANCE.getCameraPitch();
int n6 = INSTANCE.getCameraYaw();
int n7 = net.runelite.api.Perspective.SINE[n5];
int n8 = net.runelite.api.Perspective.COSINE[n5];
int n9 = net.runelite.api.Perspective.SINE[n6];
int n10 = net.runelite.api.Perspective.COSINE[n6];
int n11 = INSTANCE.getCenterX();
int n12 = INSTANCE.getCenterY();
int n13 = INSTANCE.getViewportMouseX();
int n14 = INSTANCE.getViewportMouseY();
int n15 = INSTANCE.get3dZoom();
int n16 = (n13 - n11) * 50 / n15;
int n17 = (n14 - n12) * 50 / n15;
int n18 = (n13 - n11) * 10000 / n15;
int n19 = (n14 - n12) * 10000 / n15;
int n20 = Client.rl$rot1(n17, 50, n8, n7);
int n21 = Client.rl$rot2(n17, 50, n8, n7);
n17 = n20;
n20 = Client.rl$rot1(n19, 10000, n8, n7);
int n22 = Client.rl$rot2(n19, 10000, n8, n7);
n19 = n20;
n20 = Client.rl$rot3(n16, n21, n10, n9);
n21 = Client.rl$rot4(n16, n21, n10, n9);
n16 = n20;
n20 = Client.rl$rot3(n18, n22, n10, n9);
n22 = Client.rl$rot4(n18, n22, n10, n9);
int n23 = (n20 - n16) / 2;
int n24 = (n19 - n17) / 2;
int n25 = (n22 - n21) / 2;
int n26 = Math.abs(n23);
int n27 = Math.abs(n24);
int n28 = Math.abs(n25);
int n29 = n2 + model.getCenterX();
int n30 = n3 + model.getCenterY();
int n31 = n4 + model.getCenterZ();
int n32 = model.getExtremeX();
int n33 = model.getExtremeY();
int n34 = model.getExtremeZ();
int n35 = (n16 + n20) / 2;
int n36 = (n17 + n19) / 2;
int n37 = (n22 + n21) / 2;
int n38 = n35 - n29;
int n39 = n36 - n30;
int n40 = n37 - n31;
if (Math.abs(n38) > n32 + n26)
{
return false;
}
if (Math.abs(n39) > n33 + n27)
{
return false;
}
if (Math.abs(n40) > n34 + n28)
{
return false;
}
if (Math.abs(n40 * n24 - n39 * n25) > n33 * n28 + n34 * n27)
{
return false;
}
if (Math.abs(n38 * n25 - n40 * n23) > n34 * n26 + n32 * n28)
{
return false;
}
if (Math.abs(n39 * n23 - n38 * n24) <= n33 * n26 + n32 * n27)
{
return true;
}
return false;
}
@Overwrite
public void checkClickbox(net.runelite.api.Model model, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, long l2)
{
int n10;
int n11;
int n12;
int n13;
int n14;
net.runelite.rs.api.RSModel rSModel = (net.runelite.rs.api.RSModel) model;
boolean bl2 = l2 != 0L && (int) (l2 >>> 16 & 1L) != 1;
boolean bl3 = INSTANCE.getViewportContainsMouse();
if (!bl2)
{
return;
}
if (!bl3)
{
return;
}
boolean bl4 = this.boundingboxCheck2(rSModel, n7, n8, n9);
if (!bl4)
{
return;
}
if (rSModel.isClickable())
{
this.addHashAtMouse(l2);
return;
}
int n15 = rSModel.getVerticesCount();
int n16 = rSModel.getTrianglesCount();
int[] arrn = rSModel.getVerticesX();
int[] arrn2 = rSModel.getVerticesY();
int[] arrn3 = rSModel.getVerticesZ();
int[] arrn4 = rSModel.getTrianglesX();
int[] arrn5 = rSModel.getTrianglesY();
int[] arrn6 = rSModel.getTrianglesZ();
int[] arrn7 = rSModel.getFaceColors3();
int n17 = INSTANCE.get3dZoom();
int n18 = INSTANCE.getCenterX();
int n19 = INSTANCE.getCenterY();
int n20 = 0;
int n21 = 0;
if (n2 != 0)
{
n20 = net.runelite.api.Perspective.SINE[n2];
n21 = net.runelite.api.Perspective.COSINE[n2];
}
for (n14 = 0; n14 < n15; ++n14)
{
n11 = arrn[n14];
n13 = arrn2[n14];
n12 = arrn3[n14];
if (n2 != 0)
{
n10 = n12 * n20 + n11 * n21 >> 16;
n12 = n12 * n21 - n11 * n20 >> 16;
n11 = n10;
}
n10 = (n12 += n9) * n5 + n6 * (n11 += n7) >> 16;
n12 = n6 * n12 - n11 * n5 >> 16;
n11 = n10;
n10 = n4 * (n13 += n8) - n12 * n3 >> 16;
if ((n12 = n13 * n3 + n4 * n12 >> 16) >= 50)
{
Client.rl$modelViewportYs[n14] = n11 * n17 / n12 + n18;
Client.rl$modelViewportXs[n14] = n10 * n17 / n12 + n19;
continue;
}
Client.rl$modelViewportYs[n14] = -5000;
}
n14 = INSTANCE.getViewportMouseX();
n11 = INSTANCE.getViewportMouseY();
n13 = 0;
while (n13 < n16)
{
if (arrn7[n13] != -2)
{
int n22;
boolean bl5;
int n23;
n12 = arrn4[n13];
n10 = arrn5[n13];
int n24 = arrn6[n13];
int n25 = rl$modelViewportYs[n12];
int n26 = rl$modelViewportYs[n10];
int n27 = rl$modelViewportYs[n24];
int n28 = rl$modelViewportXs[n12];
int n29 = rl$modelViewportXs[n10];
int n30 = rl$modelViewportXs[n24];
if (n25 != -5000 && n26 != -5000 && n27 != -5000 && (bl5 = (n23 = (n22 = rSModel.isClickable() ? 20
: 5) + n11) < n28 && n23 < n29 && n23 < n30 ? false
: ((n23 = n11 - n22) > n28 && n23 > n29 && n23 > n30 ? false
: ((n23 = n22 + n14) < n25 && n23 < n26 && n23 < n27 ? false
: (n23 = n14 - n22) <= n25 || n23 <= n26 || n23 <= n27))))
{
this.addHashAtMouse(l2);
return;
}
}
++n13;
}
}
@Provided
public boolean getViewportContainsMouse()
{
throw new RuntimeException();
}
@Provided
public void addHashAtMouse(long l)
{
throw new RuntimeException();
}
@Provided
public int getCameraPitch()
{
throw new RuntimeException();
}
@Provided
public int getCameraYaw()
{
throw new RuntimeException();
}
@Provided
public int getCenterX()
{
throw new RuntimeException();
}
@Provided
public int getCenterY()
{
throw new RuntimeException();
}
@Provided
public int getViewportMouseX()
{
throw new RuntimeException();
}
@Provided
public int getViewportMouseY()
{
throw new RuntimeException();
}
@Provided
public int get3dZoom()
{
throw new RuntimeException();
}
@Provided
public static int rl$rot1(int a, int b, int c, int d)
{
throw new RuntimeException();
}
@Provided
public static int rl$rot2(int a, int b, int c, int d)
{
throw new RuntimeException();
}
@Provided
public static int rl$rot3(int a, int b, int c, int d)
{
throw new RuntimeException();
}
@Provided
public static int rl$rot4(int a, int b, int c, int d)
{
throw new RuntimeException();
}
@Inject
public void invokeMenuAction(int actionParam, int widgetId, int opcode, int targetId, String menuOption, String menuTarget, int mouseX, int mouseY)
{
_Statics_.menuAction(actionParam, widgetId, opcode, targetId, menuOption,
menuTarget, mouseX, mouseY);
}
}

View File

@@ -1,76 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixins;
import net.runelite.rs.api.RSMouseRecorder;
import us.runelitepl.mixinprocessor.annotations.Inject;
import us.runelitepl.mixinprocessor.annotations.Provided;
import us.runelitepl.mixinprocessor.annotations.Reobfuscate;
public class MouseRecorder implements RSMouseRecorder
{
@Provided
@Reobfuscate
int[] xs;
@Provided
@Reobfuscate
int[] ys;
@Provided
@Reobfuscate
long[] millis;
@Provided
@Reobfuscate
int index;
@Inject
public int[] getXs()
{
return xs;
}
@Inject
public int[] getYs()
{
return ys;
}
@Inject
public long[] getMillis()
{
return millis;
}
@Inject
public int getIndex()
{
return index * 42069;
}
}

View File

@@ -1,81 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixins;
import net.runelite.api.SkullIcon;
import us.runelitepl.mixinprocessor.annotations.Inject;
import us.runelitepl.mixinprocessor.annotations.Overwrite;
import us.runelitepl.mixinprocessor.annotations.Provided;
import us.runelitepl.mixinprocessor.annotations.Reobfuscate;
public class Player
{
@Reobfuscate
@Provided
int headIconPk;
@Reobfuscate
@Provided
int index;
@Inject
public int getHeadIconPk()
{
return headIconPk * 42069;
}
@Overwrite
public SkullIcon getSkullIcon()
{
switch (getHeadIconPk())
{
case 0:
return SkullIcon.SKULL;
case 1:
return SkullIcon.SKULL_FIGHT_PIT;
case 8:
return SkullIcon.DEAD_MAN_FIVE;
case 9:
return SkullIcon.DEAD_MAN_FOUR;
case 10:
return SkullIcon.DEAD_MAN_THREE;
case 11:
return SkullIcon.DEAD_MAN_TWO;
case 12:
return SkullIcon.DEAD_MAN_ONE;
default:
return null;
}
}
@Inject
public int getIndex()
{
return index * 42069;
}
}

View File

@@ -1,81 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixins;
import net.runelite.api.Actor;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.events.ProjectileMoved;
import net.runelite.rs.api.RSClient;
import us.runelitepl.mixinprocessor.annotations.Inject;
import us.runelitepl.mixinprocessor.annotations.Overwrite;
import us.runelitepl.mixinprocessor.annotations.Provided;
import us.runelitepl.mixinprocessor.annotations.Reobfuscate;
public class Projectile
{
@Reobfuscate
@Provided
int targetIndex;
@Inject
public int getTargetId()
{
return targetIndex * 42069;
}
@Overwrite
public void projectileMoved(int x, int y, int z, int n3)
{
LocalPoint position = new LocalPoint(x, y);
ProjectileMoved event = new ProjectileMoved();
event.setProjectile((net.runelite.api.Projectile) this);
event.setPosition(position);
event.setZ(z);
((RSClient) Client.INSTANCE).getCallbacks().post(event);
}
@Inject
public Actor getInteracting()
{
final int _targ = this.getTargetId();
if (_targ == 0)
{
return null;
}
if (_targ > 0)
{
return (Actor) ((RSClient) Client.INSTANCE).getCachedNPCs()[_targ - 1];
}
final int n = -_targ - 1;
if (n == ((RSClient) Client.INSTANCE).getLocalInteractingIndex())
{
return (Actor) ((RSClient) Client.INSTANCE).getLocalPlayer();
}
return (Actor) ((RSClient) Client.INSTANCE).getCachedPlayers()[n];
}
}

View File

@@ -1,104 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixins;
import net.runelite.rs.api.RSClient;
import net.runelite.rs.api.RSNPC;
import net.runelite.rs.api.RSPlayer;
import net.runelite.rs.api.RSProjectile;
import us.runelitepl.mixinprocessor.annotations.Overwrite;
public class Scene
{
@Overwrite
public static boolean shouldDraw(Object renderable, boolean drawingUI)
{
if (!Client.isHidingEntities)
{
return true;
}
if (renderable instanceof RSPlayer)
{
RSPlayer p = (RSPlayer) renderable;
if (Client.hideClanMates && p.isClanMember())
{
return false;
}
}
if (renderable instanceof RSPlayer)
{
boolean local = drawingUI ? Client.hideLocalPlayer2D : Client.hideLocalPlayer;
boolean other = drawingUI ? Client.hidePlayers2D : Client.hidePlayers;
boolean isLocalPlayer = renderable == ((RSClient)Client.INSTANCE).getLocalPlayer();
if (isLocalPlayer ? local : other)
{
RSPlayer player = (RSPlayer) renderable;
if (!Client.hideAttackers)
{
if (player.getInteracting() == ((RSClient)Client.INSTANCE).getLocalPlayer())
{
return true;
}
}
if (player.getName() == null)
{
// player.isFriend() and player.isClanMember() npe when the player has a null name
return false;
}
return (!Client.hideFriends && player.isFriend()) || (!isLocalPlayer && !Client.hideClanMates && player.isClanMember());
}
}
else if (renderable instanceof RSNPC)
{
RSNPC npc = (RSNPC) renderable;
if (!Client.hideAttackers)
{
if (npc.getInteracting() == ((RSClient)Client.INSTANCE).getLocalPlayer())
{
return true;
}
}
return drawingUI ? !Client.hideNPCs2D : !Client.hideNPCs;
}
else if (renderable instanceof RSProjectile)
{
return !Client.hideProjectiles;
}
return true;
}
}

View File

@@ -1,64 +0,0 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package us.runelitepl.mixins;
import us.runelitepl.mixinprocessor.annotations.Prepend;
import us.runelitepl.mixinprocessor.annotations.Provided;
import us.runelitepl.mixinprocessor.annotations.Reobfuscate;
public class _Statics_
{
@Provided
@Reobfuscate
static MouseRecorder mouseRecorder;
@Prepend
@Reobfuscate
static final void prepend$menuAction(int actionParam, int widgetId, int opcode, int targetId, String menuOption,
String menuTarget, int mouseX, int mouseY)
{
if (Client.printMenuActions)
{
int printOpcode = opcode;
if (opcode >= 2000)
{
printOpcode -= 2000;
}
System.out.format("menuAction triggered: '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s'\n", actionParam, widgetId,
printOpcode, targetId, menuOption, menuTarget, mouseX, mouseY);
}
}
@Provided
@Reobfuscate
static final void menuAction(int actionParam, int widgetId, int opcode, int targetId, String menuOption,
String menuTarget, int mouseX, int mouseY)
{
throw new RuntimeException();
}
}

View File

@@ -1,22 +0,0 @@
Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -39,13 +39,19 @@
<dependency> <dependency>
<groupId>net.runelite</groupId> <groupId>net.runelite</groupId>
<artifactId>client</artifactId> <artifactId>client</artifactId>
<version>1.5.27-SNAPSHOT</version> <version>${project.version}</version>
<optional>true</optional> <!-- to prevent the dependency on this from runelite-client --> <optional>true</optional> <!-- to prevent the dependency on this from runelite-client -->
</dependency> </dependency>
<dependency>
<groupId>net.runelite.rs</groupId>
<artifactId>runescape-api</artifactId>
<version>${project.version}</version>
<optional>false</optional> <!-- to prevent the dependency on this from runelite-client -->
</dependency>
<dependency> <dependency>
<groupId>net.runelite</groupId> <groupId>net.runelite</groupId>
<artifactId>runelite-api</artifactId> <artifactId>runelite-api</artifactId>
<version>1.5.27-SNAPSHOT</version> <version>${project.version}</version>
<optional>false</optional> <!-- to prevent the dependency on this from runelite-client --> <optional>false</optional> <!-- to prevent the dependency on this from runelite-client -->
</dependency> </dependency>
<dependency> <dependency>
@@ -61,7 +67,7 @@
<plugin> <plugin>
<groupId>net.runelite.rs</groupId> <groupId>net.runelite.rs</groupId>
<artifactId>injector-plugin</artifactId> <artifactId>injector-plugin</artifactId>
<version>1.5.27-SNAPSHOT</version> <version>${project.version}</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>

View File

@@ -46,12 +46,17 @@
<dependency> <dependency>
<groupId>net.runelite</groupId> <groupId>net.runelite</groupId>
<artifactId>mixins</artifactId> <artifactId>mixins</artifactId>
<version>1.5.27-SNAPSHOT</version> <version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.runelite</groupId>
<artifactId>runelite-api</artifactId>
<version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.runelite.rs</groupId> <groupId>net.runelite.rs</groupId>
<artifactId>runescape-api</artifactId> <artifactId>runescape-api</artifactId>
<version>1.5.27-SNAPSHOT</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@@ -47,7 +47,6 @@ import net.runelite.deob.DeobAnnotations;
import net.runelite.deob.deobfuscators.arithmetic.DMath; import net.runelite.deob.deobfuscators.arithmetic.DMath;
import net.runelite.injector.raw.ClearColorBuffer; import net.runelite.injector.raw.ClearColorBuffer;
import net.runelite.injector.raw.DrawAfterWidgets; import net.runelite.injector.raw.DrawAfterWidgets;
//import net.runelite.injector.raw.DrawMenu;
import net.runelite.injector.raw.RasterizerHook; import net.runelite.injector.raw.RasterizerHook;
import net.runelite.injector.raw.RenderDraw; import net.runelite.injector.raw.RenderDraw;
import net.runelite.injector.raw.ScriptVM; import net.runelite.injector.raw.ScriptVM;
@@ -78,7 +77,6 @@ public class Inject
private final ScriptVM scriptVM = new ScriptVM(this); private final ScriptVM scriptVM = new ScriptVM(this);
private final ClearColorBuffer clearColorBuffer = new ClearColorBuffer(this); private final ClearColorBuffer clearColorBuffer = new ClearColorBuffer(this);
private final RenderDraw renderDraw = new RenderDraw(this); private final RenderDraw renderDraw = new RenderDraw(this);
//private final DrawMenu drawMenu = new DrawMenu(this);
// deobfuscated contains exports etc to apply to vanilla // deobfuscated contains exports etc to apply to vanilla
private final ClassGroup deobfuscated, vanilla; private final ClassGroup deobfuscated, vanilla;
@@ -336,7 +334,6 @@ public class Inject
scriptVM.inject(); scriptVM.inject();
clearColorBuffer.inject(); clearColorBuffer.inject();
renderDraw.inject(); renderDraw.inject();
//drawMenu.inject();
} }
private java.lang.Class injectInterface(ClassFile cf, ClassFile other) private java.lang.Class injectInterface(ClassFile cf, ClassFile other)

View File

@@ -48,7 +48,7 @@ public class InjectMojo extends AbstractMojo
@Parameter(defaultValue = "${project.build.outputDirectory}") @Parameter(defaultValue = "${project.build.outputDirectory}")
private File outputDirectory; private File outputDirectory;
@Parameter(defaultValue = "./rs-client/target/rs-client-1.5.27-SNAPSHOT.jar", readonly = true, required = true) @Parameter(defaultValue = "./rs-client/target/rs-client-${project.version}.jar", readonly = true, required = true)
private String rsClientPath; private String rsClientPath;
@Parameter(defaultValue = "${net.runelite.rs:vanilla:jar}", readonly = true, required = true) @Parameter(defaultValue = "${net.runelite.rs:vanilla:jar}", readonly = true, required = true)

View File

@@ -232,7 +232,7 @@ public class MixinInjector
if (injectedFields.containsKey(field.getName()) && !field.getName().equals(ASSERTION_FIELD)) if (injectedFields.containsKey(field.getName()) && !field.getName().equals(ASSERTION_FIELD))
{ {
java.util.logging.Logger.getAnonymousLogger().severe("Duplicate field : "+ field.getName()); java.util.logging.Logger.getAnonymousLogger().severe("Duplicate field : " + field.getName());
throw new InjectionException("Injected field names must be globally unique"); throw new InjectionException("Injected field names must be globally unique");
} }

View File

@@ -134,15 +134,15 @@
<module>cache</module> <module>cache</module>
<module>cache-client</module> <module>cache-client</module>
<module>cache-updater</module> <module>cache-updater</module>
<module>deobfuscator</module>
<module>runelite-api</module> <module>runelite-api</module>
<module>runelite-client</module> <module>runelite-client</module>
<module>runelite-mixins</module> <module>runelite-mixins</module>
<module>runelite-script-assembler-plugin</module> <module>runelite-script-assembler-plugin</module>
<module>deobfuscator</module> <module>runescape-api</module>
<module>rs-client</module> <module>runescape-client</module>
<module>injector-plugin</module> <module>injector-plugin</module>
<module>injected-client</module> <module>injected-client</module>
<module>runescape-api</module>
<module>runelite-plugin-archetype</module> <module>runelite-plugin-archetype</module>
<module>http-api</module> <module>http-api</module>
<module>http-service</module> <module>http-service</module>

View File

@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.5.27-SNAPSHOT</version>
</parent>
<groupId>net.runelite.rs</groupId>
<artifactId>rs-client</artifactId>
<name>RuneScape Client</name>
<dependencies>
<dependency>
<groupId>net.runelite.rs</groupId>
<artifactId>runescape-api</artifactId>
<version>1.5.27-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<!-- always skip checkstyle despite profile overriden checkstyle.skip property -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
package net.runelite.api; package net.runelite.api;;
/** /**
* Utility class used for mapping animation IDs. * Utility class used for mapping animation IDs.

View File

@@ -35,7 +35,7 @@ public interface DecorativeObject extends TileObject
* Gets the convex hull of the objects model. * Gets the convex hull of the objects model.
* *
* @return the convex hull * @return the convex hull
* @see net.runelite.api.model.Jarvis * @see api.model.Jarvis
*/ */
Polygon getConvexHull(); Polygon getConvexHull();
Polygon getConvexHull2(); Polygon getConvexHull2();

View File

@@ -24,8 +24,8 @@
*/ */
package net.runelite.api; package net.runelite.api;
import java.awt.Polygon;
import net.runelite.api.coords.Angle; import net.runelite.api.coords.Angle;
import java.awt.Polygon;
/** /**
* Represents a game object. * Represents a game object.
@@ -57,7 +57,7 @@ public interface GameObject extends TileObject
* Gets the convex hull of the actors model. * Gets the convex hull of the actors model.
* *
* @return the convex hull * @return the convex hull
* @see net.runelite.api.model.Jarvis * @see //net.runelite.api.model.Jarvis
*/ */
Polygon getConvexHull(); Polygon getConvexHull();

View File

@@ -24,6 +24,7 @@
*/ */
package net.runelite.api; package net.runelite.api;
import net.runelite.api.hooks.DrawCallbacks;
import java.awt.Canvas; import java.awt.Canvas;
import net.runelite.api.hooks.DrawCallbacks; import net.runelite.api.hooks.DrawCallbacks;

View File

@@ -24,9 +24,9 @@
*/ */
package net.runelite.api; package net.runelite.api;
import java.util.List;
import net.runelite.api.model.Triangle; import net.runelite.api.model.Triangle;
import net.runelite.api.model.Vertex; import net.runelite.api.model.Vertex;
import java.util.List;
/** /**
* Represents the model of an object. * Represents the model of an object.

View File

@@ -75,4 +75,6 @@ public interface NPC extends Actor
* @return * @return
*/ */
boolean isDead(); boolean isDead();
void onDefinitionChanged(NPCDefinition composition);
} }

View File

@@ -43,7 +43,7 @@ public interface ScriptEvent
* Gets the widget of the event. * Gets the widget of the event.
* *
* @return the widget * @return the widget
* @see net.runelite.api.widgets.Widget * @see Widget
*/ */
Widget getSource(); Widget getSource();

View File

@@ -24,9 +24,9 @@
*/ */
package net.runelite.api; package net.runelite.api;
import java.util.List;
import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint; import net.runelite.api.coords.WorldPoint;
import java.util.List;
/** /**
* Represents a tile in the game. * Represents a tile in the game.

View File

@@ -24,12 +24,12 @@
*/ */
package net.runelite.api; package net.runelite.api;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Polygon; import java.awt.Polygon;
import java.awt.geom.Area; import java.awt.geom.Area;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;
/** /**
* Represents an object that a tile holds. * Represents an object that a tile holds.

View File

@@ -9,7 +9,7 @@ public interface WidgetNode extends Node
* The ID of the widget. * The ID of the widget.
* *
* @return the ID of the widget * @return the ID of the widget
* @see net.runelite.api.widgets.Widget * @see api.widgets.Widget
*/ */
int getId(); int getId();
} }

View File

@@ -0,0 +1,105 @@
/*
* Copyright (c) 2018, Lotto <https://github.com/devLotto>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.api.config;
import java.awt.Dimension;
/**
* A utility class containing constant values.
*/
public class Constants
{
/**
* The original width of the game when running in fixed mode.
*/
public static final int GAME_FIXED_WIDTH = 765;
/**
* The original height of the game when running in fixed mode.
*/
public static final int GAME_FIXED_HEIGHT = 503;
/**
* Dimension representation of the width and height of the game in fixed mode.
*/
public static final Dimension GAME_FIXED_SIZE = new Dimension(GAME_FIXED_WIDTH, GAME_FIXED_HEIGHT);
/**
* The aspect ratio of the game when running in fixed mode.
*/
public static final double GAME_FIXED_ASPECT_RATIO = (double) GAME_FIXED_WIDTH / (double) GAME_FIXED_HEIGHT;
/**
* The default camera zoom value.
*/
public static final int CLIENT_DEFAULT_ZOOM = 512;
/**
* The width and length of a chunk (8x8 tiles).
*/
public static final int CHUNK_SIZE = 8;
/**
* The width and length of a map region (64x64 tiles).
*/
public static final int REGION_SIZE = 64;
/**
* The width and length of the scene (13 chunks x 8 tiles).
*/
public static final int SCENE_SIZE = 104;
/**
* The max allowed plane by the game.
* <p>
* This value is exclusive. The plane is set by 2 bits which restricts
* the plane value to 0-3.
*/
public static final int MAX_Z = 4;
public static final int TILE_FLAG_BRIDGE = 2;
/**
* The number of milliseconds in a client tick.
* <p>
* This is the length of a single frame when the client is running at
* the maximum framerate of 50 fps.
*/
public static final int CLIENT_TICK_LENGTH = 20;
/**
* The number of milliseconds in a server game tick.
* <p>
* This is the length of a single game cycle under ideal conditions.
* All game-play actions operate within multiples of this duration.
*/
public static final int GAME_TICK_LENGTH = 600;
/**
* Used when getting High Alchemy value - multiplied by general store price.
*/
public static final float HIGH_ALCHEMY_CONSTANT = 0.6f;
}

View File

@@ -25,10 +25,10 @@
*/ */
package net.runelite.api.coords; package net.runelite.api.coords;
import javax.annotation.Nullable;
import lombok.Value;
import net.runelite.api.Client; import net.runelite.api.Client;
import net.runelite.api.Perspective; import net.runelite.api.Perspective;
import javax.annotation.Nullable;
import lombok.Value;
/** /**
* A two-dimensional point in the local coordinate space. * A two-dimensional point in the local coordinate space.

View File

@@ -1,5 +1,6 @@
package net.runelite.api.events; package net.runelite.api.events;
import net.runelite.api.Actor;
import lombok.Data; import lombok.Data;
import net.runelite.api.Actor; import net.runelite.api.Actor;

View File

@@ -24,8 +24,8 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.Skill; import net.runelite.api.Skill;
import lombok.Data;
/** /**
* An event where a players skill level has been temporarily modified. * An event where a players skill level has been temporarily modified.

View File

@@ -24,11 +24,11 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import net.runelite.api.ChatMessageType;
import net.runelite.api.MessageNode;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import net.runelite.api.ChatMessageType;
import net.runelite.api.MessageNode;
/** /**
* An event where a new chat message is received. * An event where a new chat message is received.

View File

@@ -24,8 +24,8 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Value;
import net.runelite.api.ClanMember; import net.runelite.api.ClanMember;
import lombok.Value;
@Value @Value
public class ClanMemberJoined public class ClanMemberJoined

View File

@@ -24,8 +24,8 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Value;
import net.runelite.api.ClanMember; import net.runelite.api.ClanMember;
import lombok.Value;
@Value @Value
public class ClanMemberLeft public class ClanMemberLeft

View File

@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.DecorativeObject; import net.runelite.api.DecorativeObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where the {@link DecorativeObject} attached to a {@link Tile} * An event where the {@link DecorativeObject} attached to a {@link Tile}

View File

@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.DecorativeObject; import net.runelite.api.DecorativeObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where the {@link DecorativeObject} attached to a {@link Tile} * An event where the {@link DecorativeObject} attached to a {@link Tile}

View File

@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.DecorativeObject; import net.runelite.api.DecorativeObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where a {@link DecorativeObject} is attached to a {@link Tile}. * An event where a {@link DecorativeObject} is attached to a {@link Tile}.

View File

@@ -25,8 +25,8 @@
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.Skill; import net.runelite.api.Skill;
import lombok.Data;
/** /**
* An event where the experience level of a {@link Skill} has been modified. * An event where the experience level of a {@link Skill} has been modified.

View File

@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.GameObject; import net.runelite.api.GameObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where a {@link GameObject} on a {@link Tile} is removed. * An event where a {@link GameObject} on a {@link Tile} is removed.

View File

@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.GameObject; import net.runelite.api.GameObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where a {@link GameObject} is added to a {@link Tile}. * An event where a {@link GameObject} is added to a {@link Tile}.

View File

@@ -24,8 +24,8 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.GameState; import net.runelite.api.GameState;
import lombok.Data;
/** /**
* An event where the clients game state has changed. * An event where the clients game state has changed.

View File

@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.GrandExchangeOffer; import net.runelite.api.GrandExchangeOffer;
import net.runelite.api.GrandExchangeOfferState; import net.runelite.api.GrandExchangeOfferState;
import lombok.Data;
/** /**
* An event where a {@link GrandExchangeOffer} has been updated with * An event where a {@link GrandExchangeOffer} has been updated with

View File

@@ -24,8 +24,8 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Value;
import net.runelite.api.GraphicsObject; import net.runelite.api.GraphicsObject;
import lombok.Value;
/** /**
* An event where a new {@link GraphicsObject} has been created. * An event where a new {@link GraphicsObject} has been created.

View File

@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.GroundObject; import net.runelite.api.GroundObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where the {@link GroundObject} on a {@link Tile} has been changed. * An event where the {@link GroundObject} on a {@link Tile} has been changed.

Some files were not shown because too many files have changed in this diff Show More