Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More client deobfuscation #128

Merged
merged 8 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions client/src/main/java/agolf/AGolf.java

This file was deleted.

37 changes: 21 additions & 16 deletions client/src/main/java/agolf/GameApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public void initApplet(Parameters parameters) {
this.aBoolean3773 = false;
}

@Override
public String getAppletInfo() {
return "-= AGolf =-\nCopyright (c) 2002-2012 Playforia (www.playforia.info)\nProgramming: Pasi Laaksonen\nGraphics: Janne Matilainen";
}

public void textsLoadedNotify(TextManager textManager) {
this.gameContainer.textManager = textManager;
}
Expand All @@ -59,25 +64,25 @@ public void defineSounds(SoundManager soundManager) {

public void defineImages(ImageManager imageManager, String var2) {
this.gameContainer.imageManager = imageManager;
imageManager.defineImage("bg-lobbyselect.gif");
imageManager.defineImage("bg-lobby-single.gif");
imageManager.defineImage("bg-lobby-single-fade.jpg");
imageManager.defineImage("bg-lobby-dual.gif");
imageManager.defineImage("bg-lobby-multi.gif");
imageManager.defineImage("bg-lobby-multi-fade.jpg");
imageManager.defineImage("bg-lobby-password.gif");
imageManager.defineImage("shapes.gif");
imageManager.defineImage("elements.gif");
imageManager.defineImage("special.gif");
imageManager.defineImage("balls.gif");
imageManager.defineSharedImage("ranking-icons.gif"); // TODO
imageManager.defineSharedImage("language-flags.png"); // TODO
imageManager.defineSharedImage("credit-background.jpg"); // TODO
imageManager.defineSharedImage("tf-background.gif"); // TODO
imageManager.defineGameImage("bg-lobbyselect.gif");
imageManager.defineGameImage("bg-lobby-single.gif");
imageManager.defineGameImage("bg-lobby-single-fade.jpg");
imageManager.defineGameImage("bg-lobby-dual.gif");
imageManager.defineGameImage("bg-lobby-multi.gif");
imageManager.defineGameImage("bg-lobby-multi-fade.jpg");
imageManager.defineGameImage("bg-lobby-password.gif");
imageManager.defineGameImage("shapes.gif");
imageManager.defineGameImage("elements.gif");
imageManager.defineGameImage("special.gif");
imageManager.defineGameImage("balls.gif");
imageManager.defineSharedImage("ranking-icons.gif");
imageManager.defineSharedImage("language-flags.png");
imageManager.defineSharedImage("credit-background.jpg");
imageManager.defineSharedImage("tf-background.gif");

for (int i = 0; i < GameBackgroundCanvas.trackAdvertSize; ++i) {
if (this.gameContainer.adverts[i] != null) {
imageManager.defineImage("ad" + i, this.gameContainer.adverts[i]);
imageManager.defineGameImage("ad" + i, this.gameContainer.adverts[i]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/agolf/LobbySelectPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void paint(Graphics g) {
}

public void update(Graphics g) {
g.drawImage(this.gameContainer.imageManager.getImage("bg-lobbyselect"), 0, 0, this);
g.drawImage(this.gameContainer.imageManager.getGameImage("bg-lobbyselect"), 0, 0, this);
g.setColor(Color.black);
g.setFont(GameApplet.fontSerif26b);
if (!this.gameContainer.disableSinglePlayer) {
Expand Down
8 changes: 4 additions & 4 deletions client/src/main/java/agolf/SpriteManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ protected void loadSprites() {
for (int var1 = 0; var1 < GameBackgroundCanvas.trackAdvertSize; ++var1) {
try {
String var2 = "ad" + var1;
Image var3 = this.imageManager.getIfAvailable(var2);
Image var3 = this.imageManager.getGameImageIfLoaded(var2);
if (var3 != null) {
this.imageManager.unDefineImage(var2);
this.imageManager.unloadGameImage(var2);
this.anIntArrayArray968[var1] = this.imageManager.getPixels(
var3,
GameBackgroundCanvas.anIntArray78[var1] * 15,
Expand Down Expand Up @@ -101,8 +101,8 @@ public int[][] method1138() {

private Image[] parseSpriteSheet(
String spriteSheetName, int spriteCount, int spritesPerRow, int spriteWidth, int spriteHeight) {
Image spriteSheet = this.imageManager.getImage(spriteSheetName);
this.imageManager.unDefineImage(spriteSheetName);
Image spriteSheet = this.imageManager.getGameImage(spriteSheetName);
this.imageManager.unloadGameImage(spriteSheetName);
int sheetWidth = this.imageManager.getWidth(spriteSheet);
int sheetHeight = this.imageManager.getHeight(spriteSheet);

Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/agolf/lobby/LobbyDualPlayerPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected LobbyDualPlayerPanel(GameContainer gameContainer, int width, int heigh
this.height = height;
this.setSize(width, height);
this.synchronizedObject = new Object();
this.setBackground(gameContainer.imageManager.getImage("bg-lobby-dual"));
this.setBackground(gameContainer.imageManager.getGameImage("bg-lobby-dual"));
this.create();
this.challengeFloodProtection = new ChallengeFloodProtection();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void paint(Graphics g) {
}

public synchronized void update(Graphics g) {
g.drawImage(this.gameContainer.imageManager.getImage("bg-lobby-password"), 0, 0, this);
g.drawImage(this.gameContainer.imageManager.getGameImage("bg-lobby-password"), 0, 0, this);
}

public void keyPressed(KeyEvent evt) {
Expand Down
4 changes: 2 additions & 2 deletions client/src/main/java/agolf/lobby/LobbyMultiPlayerPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void update(Graphics g) {

this.graphics.setColor(GameApplet.colourGameBackground);
this.graphics.fillRect(0, 0, this.width, this.height);
this.graphics.drawImage(this.gameContainer.imageManager.getImage("bg-lobby-multi"), 0, 0, this);
this.graphics.drawImage(this.gameContainer.imageManager.getGameImage("bg-lobby-multi"), 0, 0, this);
Color var2 = new Color(76, 229, 255);
this.graphics.setColor(GameApplet.colourTextBlack);
this.graphics.setFont(GameApplet.fontSerif26b);
Expand Down Expand Up @@ -497,7 +497,7 @@ protected void create() {
this.trackList = new MultiColorList(listTitles, var3, 1, this.width / 2 - 40, 125);
this.trackList.setLocation(this.width / 2 + 20, 75);
this.trackList.setBackgroundImage(
this.gameContainer.imageManager.getImage("bg-lobby-multi-fade"), this.width / 2 + 20, 75);
this.gameContainer.imageManager.getGameImage("bg-lobby-multi-fade"), this.width / 2 + 20, 75);
this.trackList.setSelectable(1);
this.trackList.addItemListener(this);
trackList.setListListener(this);
Expand Down
4 changes: 2 additions & 2 deletions client/src/main/java/agolf/lobby/LobbySinglePlayerPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void update(Graphics g) {

this.graphics.setColor(GameApplet.colourGameBackground);
this.graphics.fillRect(0, 0, this.width, this.height);
this.graphics.drawImage(this.gameContainer.imageManager.getImage("bg-lobby-single"), 0, 0, this);
this.graphics.drawImage(this.gameContainer.imageManager.getGameImage("bg-lobby-single"), 0, 0, this);
Color trainingOutlineColour = new Color(14, 219, 14);
Color championshipOutlineColour = new Color(0, 205, 0);
this.graphics.setColor(GameApplet.colourTextBlack);
Expand Down Expand Up @@ -295,7 +295,7 @@ private void create() {
this.trackSetList = new MultiColorList(trackSetListTitles, var2, 1, 250, 130);
this.trackSetList.setLocation(this.width - 290, 130);
this.trackSetList.setBackgroundImage(
this.gameContainer.imageManager.getImage("bg-lobby-single-fade"), this.width - 290, 130);
this.gameContainer.imageManager.getGameImage("bg-lobby-single-fade"), this.width - 290, 130);
this.trackSetList.setSelectable(1);
this.trackSetList.addItemListener(this);
trackSetList.setListListener(this);
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/com/aapeli/applet/AApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public void update(Graphics graphics) {
this.appletGraphics.setColor(backgroundColor);
this.appletGraphics.fillRect(0, 0, this.appletWidth, this.appletHeight);
if (this.imageManager != null && this.backgroundImageKey != null) {
Image image = this.imageManager.getIfAvailable(this.backgroundImageKey);
Image image = this.imageManager.getGameImageIfLoaded(this.backgroundImageKey);
if (image != null) {
this.appletGraphics.drawImage(image, this.backgroundXOffset, this.backgroundYOffset, this);
}
Expand Down
28 changes: 14 additions & 14 deletions client/src/main/java/com/aapeli/client/AutoPopups.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,36 @@

public class AutoPopups {

private Class78 aClass78_1327;
private Class88 aClass88_1328;
private SignUpHandler signUpHandler;
private TellFriendHandler tellFriendHandler;
private long aLong1330;
private static final String aString1331 = "facebook";

public AutoPopups(AApplet var1) {
if (!var1.param.getSiteName().equalsIgnoreCase("facebook")) {
this.aClass78_1327 = new Class78(var1);
this.aClass88_1328 = new Class88(var1.param, var1.textManager, var1.imageManager);
this.signUpHandler = new SignUpHandler(var1);
this.tellFriendHandler = new TellFriendHandler(var1.param, var1.textManager, var1.imageManager);
}

this.aLong1330 = 0L;
}

public AutoPopups(Parameters var1, TextManager var2, ImageManager var3) {
if (!var1.getSiteName().equalsIgnoreCase("facebook")) {
this.aClass88_1328 = new Class88(var1, var2, var3);
this.tellFriendHandler = new TellFriendHandler(var1, var2, var3);
}
}

public ColorButton getTellFriendButton() {
return this.aClass88_1328 != null ? this.aClass88_1328.method1699() : null;
return this.tellFriendHandler != null ? this.tellFriendHandler.method1699() : null;
}

public void gameFinished(boolean var1) {
synchronized (this) {
if (this.method1561()) {
if (this.aClass78_1327 != null && this.aClass78_1327.method1599(var1)) {
if (this.signUpHandler != null && this.signUpHandler.method1599(var1)) {
this.method1562();
} else if (this.aClass88_1328 != null && this.aClass88_1328.method1700()) {
} else if (this.tellFriendHandler != null && this.tellFriendHandler.method1700()) {
this.method1562();
}
}
Expand All @@ -44,7 +44,7 @@ public void gameFinished(boolean var1) {
public void personalRecord() {
synchronized (this) {
if (this.method1561()) {
if (this.aClass78_1327 != null && this.aClass78_1327.method1600()) {
if (this.signUpHandler != null && this.signUpHandler.method1600()) {
this.method1562();
}
}
Expand All @@ -54,7 +54,7 @@ public void personalRecord() {
public void rankingChanged(int var1, int var2) {
synchronized (this) {
if (this.method1561()) {
if (this.aClass78_1327 != null && this.aClass78_1327.method1601(var1, var2)) {
if (this.signUpHandler != null && this.signUpHandler.method1601(var1, var2)) {
this.method1562();
}
}
Expand All @@ -63,12 +63,12 @@ public void rankingChanged(int var1, int var2) {

public void close() {
synchronized (this) {
if (this.aClass78_1327 != null) {
this.aClass78_1327.method1602();
if (this.signUpHandler != null) {
this.signUpHandler.method1602();
}

if (this.aClass88_1328 != null) {
this.aClass88_1328.method1701();
if (this.tellFriendHandler != null) {
this.tellFriendHandler.method1701();
}
}
}
Expand Down
53 changes: 53 additions & 0 deletions client/src/main/java/com/aapeli/client/BackgroundLoaderThread.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.aapeli.client;

import java.awt.Image;

class BackgroundLoaderThread implements Runnable {

private IPanel panel;
private ImageManager imageManager;
private String backgroundKey;
private int xOffset;
private int yOffset;
private boolean isSharedImage;
private boolean running;
private final IPanel anIPanel1415;

protected BackgroundLoaderThread(
IPanel unused,
IPanel panel,
ImageManager imageManager,
String backgroundKey,
int xOffset,
int yOffset,
boolean isSharedImage) {
this.anIPanel1415 = unused;
this.panel = panel;
this.imageManager = imageManager;
this.backgroundKey = backgroundKey;
this.xOffset = xOffset;
this.yOffset = yOffset;
this.isSharedImage = isSharedImage;
this.running = true;
Thread thread = new Thread(this);
thread.setDaemon(true);
thread.start();
}

public void run() {
Image image;
if (!this.isSharedImage) {
image = this.imageManager.getGameImage(this.backgroundKey);
} else {
image = this.imageManager.getShared(this.backgroundKey);
}

if (this.running) {
this.panel.setBackground(image, this.xOffset, this.yOffset);
}
}

protected void stop() {
this.running = false;
}
}
Loading