Results 1 to 3 of 3
  1. #1
    ForeverP is offline Member
    Join Date
    Apr 2011
    Posts
    14
    Rep Power
    0

    Default Obfuscate a .class? Help please

    I've spent a lot of time developing a text adventure that connects to MySQL and has dynamic signatures and a lot more, but in the code it connects to my MySQL database and has the username and password, but I wanted to allow others to play it but I'm afraid if I allow that, some wise guy will decompile it and basically "hack" the game. How can I obfuscate a .class so people can't get the MySQL info and/or alter the game code.

    Thanks if anyone can help. Yes I've tried obfuscating it but there are a ton of errors. No it's not a .jar I just want to obfuscate a single .class.

  2. #2
    f1gh is offline Member
    Join Date
    Nov 2010
    Posts
    46
    Rep Power
    0

    Default

    i don't know what you are trying to do, obfuscating a class is something i don't know about, but you could create an external definition of the mysql connection information and don't include it directly into your code.

    You could do a injection using spring or something along those lines to provide a context for the data source to allow you to establish the connection.

  3. #3
    doWhile is online now Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default

    There are obfuscators out there you could use (such as ProGuard), but I somewhat doubt they will accomplish what you want...in this scenario you should consider having a server side tier which performs the connections, the client just interacts with that tier to send requests and receive information - in this case the username/password resides on the server and not the client.

Similar Threads

  1. Obfuscate a .class? Help please
    By ForeverP in forum New To Java
    Replies: 2
    Last Post: 04-29-2011, 12:33 PM
  2. Replies: 0
    Last Post: 03-27-2011, 05:49 AM
  3. Replies: 5
    Last Post: 01-26-2011, 06:38 PM
  4. Replies: 7
    Last Post: 05-06-2009, 12:42 PM
  5. Obfuscate the code
    By jayaganesh in forum Advanced Java
    Replies: 1
    Last Post: 12-11-2007, 10:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •