diff --git a/client/src/main/java/client.java b/client/src/main/java/client.java index f79b82f4..4cceeed6 100644 --- a/client/src/main/java/client.java +++ b/client/src/main/java/client.java @@ -1257,7 +1257,10 @@ public static void main(@OriginalArg(0) String[] args) { signlink.sunjava = true; } - signlink.startpriv(InetAddress.getByName("w1.225.2004scape.org")); + System.out.println("sign"); + InetAddress addr = InetAddress.getByName("w1.225.2004scape.org"); + System.out.println("signpriv"); + signlink.startpriv(addr); @Pc(82) client c = new client(); c.initApplication(789, 532); @@ -3635,13 +3638,16 @@ private void drawMinimap() { } @OriginalMember(owner = "client!client", name = "b", descriptor = "(B)Ljava/awt/Component;") - @Override protected Component getBaseComponent() { - if (signlink.mainapp == null) { - return this; - } else { + if (signlink.mainapp != null) { return signlink.mainapp; - } + } + + if (super.frame != null) { + return super.frame; + } + + return this; } @OriginalMember(owner = "client!client", name = "m", descriptor = "(I)V") diff --git a/client/src/main/java/jagex2/client/GameShell.java b/client/src/main/java/jagex2/client/GameShell.java index 15ccf536..7c25369c 100644 --- a/client/src/main/java/jagex2/client/GameShell.java +++ b/client/src/main/java/jagex2/client/GameShell.java @@ -274,9 +274,10 @@ public final void mousePressed(@OriginalArg(0) MouseEvent e) { @Pc(2) int x = e.getX(); @Pc(5) int y = e.getY(); - Insets insets = this.getInsets(); - x -= insets.left; - y -= insets.top; + if (this.frame != null) { + x -= 4; + y -= 24; + } this.idleCycles = 0; this.mouseClickX = x; @@ -348,9 +349,10 @@ public final void mouseDragged(@OriginalArg(0) MouseEvent e) { @Pc(2) int x = e.getX(); @Pc(5) int y = e.getY(); - Insets insets = this.getInsets(); - x -= insets.left; - y -= insets.top; + if (this.frame != null) { + x -= 4; + y -= 24; + } this.idleCycles = 0; this.mouseX = x; @@ -366,9 +368,10 @@ public final void mouseMoved(@OriginalArg(0) MouseEvent e) { @Pc(2) int x = e.getX(); @Pc(5) int y = e.getY(); - Insets insets = this.getInsets(); - x -= insets.left; - y -= insets.top; + if (this.frame != null) { + x -= 4; + y -= 24; + } this.idleCycles = 0; this.mouseX = x; @@ -566,7 +569,11 @@ protected void refresh() { @OriginalMember(owner = "client!a", name = "b", descriptor = "(B)Ljava/awt/Component;") protected Component getBaseComponent() { - return this; + if (this.frame != null) { + return this.frame; + } + + return this; } @OriginalMember(owner = "client!a", name = "a", descriptor = "(Ljava/lang/Runnable;I)V") diff --git a/client/src/main/java/jagex2/client/ViewBox.java b/client/src/main/java/jagex2/client/ViewBox.java index 74ccf0a5..a688936d 100644 --- a/client/src/main/java/jagex2/client/ViewBox.java +++ b/client/src/main/java/jagex2/client/ViewBox.java @@ -3,6 +3,7 @@ import org.openrs2.deob.annotation.OriginalArg; import org.openrs2.deob.annotation.OriginalClass; import org.openrs2.deob.annotation.OriginalMember; +import org.openrs2.deob.annotation.Pc; import java.awt.*; @@ -17,17 +18,17 @@ public ViewBox(@OriginalArg(2) GameShell shell, @OriginalArg(3) int width, @Orig this.shell = shell; this.setTitle("Jagex"); this.setResizable(false); - - this.setLayout(new BorderLayout()); - this.add(shell); - this.pack(); - - // for compatibility with Java < 1.4 - Insets insets = this.getInsets(); - this.setSize(width + insets.left + insets.bottom, height + insets.top + insets.bottom); - this.setVisible(true); - + this.show(); this.toFront(); + this.resize(width + 8, height + 28); + } + + @OriginalMember(owner = "client!b", name = "getGraphics", descriptor = "()Ljava/awt/Graphics;") + @Override + public Graphics getGraphics() { + @Pc(2) Graphics g = super.getGraphics(); + g.translate(4, 24); + return g; } @OriginalMember(owner = "client!b", name = "update", descriptor = "(Ljava/awt/Graphics;)V") diff --git a/client/src/main/java/sign/signlink.java b/client/src/main/java/sign/signlink.java index 91b8f56d..d9935409 100644 --- a/client/src/main/java/sign/signlink.java +++ b/client/src/main/java/sign/signlink.java @@ -130,10 +130,12 @@ public static void startpriv(@OriginalArg(0) InetAddress address) { urlreq = null; socketip = address; + System.out.println("sign 5"); @Pc(33) Thread thread = new Thread(new signlink()); thread.setDaemon(true); thread.start(); + System.out.println("sign 6"); while (!active) { try { Thread.sleep(50L); @@ -142,52 +144,28 @@ public static void startpriv(@OriginalArg(0) InetAddress address) { } } + @OriginalMember(owner = "client!sign/signlink", name = "findcachedir", descriptor = "()Ljava/lang/String;") public static String findcachedir() { - @Pc(50) String[] paths = new String[] { - // prioritize home directories - System.getProperty("user.home"), - // System.getenv("HOME"), System.getenv("HOMEDRIVE") + System.getenv("HOMEPATH"), System.getenv("USERPROFILE"), - // System.getenv("user.home"), "~", - // fall back to OS-specific paths - "c:", "c:/windows", "c:/winnt", "d:/windows", "d:/winnt", "e:/windows", "e:/winnt", "f:/windows", "f:/winnt", - // fall back to temporary cache directories (RAM or browser cache) - "/tmp", "" - }; - @Pc(52) String dir = ".lostcity"; - - for (@Pc(54) int i = 0; i < paths.length; i++) { + @Pc(50) String[] local50 = new String[] { "c:/windows/", "c:/winnt/", "d:/windows/", "d:/winnt/", "e:/windows/", "e:/winnt/", "f:/windows/", "f:/winnt/", "c:/", "~/", "/tmp/", "" }; + @Pc(52) String local52 = ".file_store_32"; + for (@Pc(54) int local54 = 0; local54 < local50.length; local54++) { try { - @Pc(59) String path = paths[i]; - @Pc(67) File file; - - if (path == null) { - continue; - } - - if (path.length() > 0) { - file = new File(path); - - if (!file.exists()) { + @Pc(59) String local59 = local50[local54]; + @Pc(67) File local67; + if (local59.length() > 0) { + local67 = new File(local59); + if (!local67.exists()) { continue; } } - - file = new File(path + "/" + dir); - if ((!file.exists() && !file.mkdir()) || !file.canWrite()) { - continue; + local67 = new File(local59 + local52); + if (local67.exists() || local67.mkdir()) { + return local59 + local52 + "/"; } - - file = new File(path + "/" + dir + "/" + signlink.clientversion); - if ((!file.exists() && !file.mkdir()) || !file.canWrite()) { - continue; - } - - return path + "/" + dir + "/" + signlink.clientversion + "/"; - } catch (@Pc(102) Exception ignored) { + } catch (@Pc(102) Exception local102) { } } - return null; } @@ -394,11 +372,15 @@ public static void reporterror(@OriginalArg(0) String message) { @OriginalMember(owner = "client!sign/signlink", name = "run", descriptor = "()V") public void run() { + System.out.println("sign 1"); active = true; + System.out.println("sign 2"); @Pc(3) String cacheDir = findcachedir(); + System.out.println("sign 3"); uid = getuid(cacheDir); + System.out.println("sign 4"); @Pc(8) int threadId = threadliveid; while (threadliveid == threadId) { if (socketreq != 0) {