Oh yes. It’s all there, in the constant pool. To make it even easier for myself, I downloaded jad and decompiled the file called TestShooter.class.
Here’s a short sample, with the password censored for your sanity:
public TestShooter()
{
speed = 10;
prevTime = System.currentTimeMillis();
elapsedTime = 0.0F;
prevSec = 0;
fps = 0;
frameCount = 0;
mouseX = 0;
mouseY = 0;
scrollX = 0;
scrollY = 0;
scrollXchange = 0;
itemLibrary = new ItemLibrary();
enemyLibrary = new EnemyLibrary();
entities = new LinkedList();
projectiles = new LinkedList();
effects = new LinkedList();
items = new LinkedList();
enemies = new LinkedList();
debug = false;
incX = 10D;
incY = 5D;
shakeX = 0;
shakeY = 0;
rangeX = 10;
rangeY = 10;
curShake = 0;
small = new Font("Copperplate Gothic Light", 1, 10);
regular = new Font("Copperplate Gothic Light", 1, 12);
bigger = new Font("Copperplate Gothic Light", 1, 18);
title = new Font("Copperplate Gothic Light", 1, 22);
screen = 0;
prevScreen = 0;
changeScreen = false;
gameFlag = true;
ran = new Random();
teleportTime = 0;
maxTeleport = 2000;
halfTeleportDone = false;
deathTime = 0;
maxDeath = 2000;
tk = Toolkit.getDefaultToolkit();
imageLoader = new ImageLoader(new MediaTracker(this), tk);
imageLibrary = new ImageLibrary(imageLoader);
map = new Map(600, 400, imageLoader);
antiGravityExplosion = new Audio("Sounds/antiGravityExplosion.wav");
explosion = new Audio("Sounds/explosion1.wav");
teleport = new Audio("Sounds/enemyExplode.wav");
bubbles = new Audio("Sounds/bubbles.wav");
equip = new Audio("Sounds/pickUp.wav");
enemyDying = new Audio("Sounds/enemyDying.wav");
enemyAttack = new Audio("Sounds/enemyAttack.wav");
zombieAttack = new Audio("Sounds/zombieAttack.wav");
zombieDying = new Audio("Sounds/zombieDying.wav");
healthBoost = new Audio("Sounds/healthBoost.wav");
armorBoost = new Audio("Sounds/armorBoost.wav");
credxDie = new Audio("Sounds/credxDie.wav");
credxBoost = new Audio("Sounds/credxBoost.wav");
buttonCount = 3;
menuChoice = -1;
menu_image = (new Image[] {
imageLoader.loadImage("Images/training.gif"), imageLoader.loadImage("Images/playGame.gif"), imageLoader.loadImage("Images/mapEditor.gif")
});
menu_image_highlight = (new Image[] {
imageLoader.loadImage("Images/trainingH.gif"), imageLoader.loadImage("Images/playGameH.gif"), imageLoader.loadImage("Images/mapEditorH.gif")
});
username = "";
userId = "";
userName = "Corvine_admin";
password = "<password>";
url = "jdbc:mysql://mysql27.ixwebhosting.com/Corvine_ProjectX";
conn = null;
scrollSpeed = 0.8F;
loadEntities = false;
play = false;
episodeChoice = -1;
crossHair = tk.createCustomCursor(imageLoader.loadImage("Images/crosshair.gif"), new Point(15, 15), "crosshair");
titleImage = imageLoader.loadImage("Images/Title.gif");
}
Your giving anyone who can download this code full access to your database, or at least as much access as the Corvine_admin has. That’s very bad, and I suggest you change that password immediately.
One more secure solution is to make an servlet that runs on the same server as the applet runs from, and have that servlet do all the database communication. Note that you should absolutely not run raw sql commands from the user/client, nor should you ever insert raw strings into sql commands.
Never, ever trust any code that you give to someone else, no matter how compiled or obfuscated it is. If the game client knows it, the user in control of the client knows it. If the game client can do it, so can the user.
[edit:]
Also, that’s not a very secure password. 