title: Obfuscate source code using ProGuard
body: <p>Recently I've had some problems with people cheating using an app for root users called Gamecih. Gamecih let's users pause games and change variables in runtime.</p>
  
  <p>If I obfuscate my code I though it'll be hard for cheaters to know what variables to change in runtime, but I'm also worried it might cause some other problems.</p>
  
  <p>I serialize game objects using Javas Serializable interface and then write them out to a file. Now let's say I'm serializing an object of the class "Player". It gets serialized and saved to a file. Then a user downloads the update with the Proguard implementation. Proguard will rename classes and class member names. Won't that cause major errors when trying to read in an already saved Player object?</p>
  
  <p>If I had not yet launched my game, this wouldn't be a problem. But now some players are playing on the same saved game(it's an RPG) for months. They would be pretty pissed off if they downloaded an update and had to start over from scratch.</p>
  
  <p>I know I can instruct Proguard not to obfuscate certain classes, but it's the Player class I really need to obfuscate.</p>
  
  <p>Clarification: Let's say I have the following simple <em>unobfuscated</em> class:</p>
  
  <pre><code>public class Player {
  
      private int gold;
      private String name;
      //Lots more.
  
      public Player(String name)
      {
          this.name = name;
      }
      public int getGold() {
          return gold;
      }
      public void setGold(int gold) {
          this.gold = gold;
      }
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
  }
  </code></pre>
  
  <p>A player is created, serialized and saved to a file. After I implement obfuscator, it might look like this: </p>
  
  <pre><code>public class Axynasf {
  
      private int akdmakn;
      private String anxcmjna;
  
      public Axynasf(String adna)
      {
          anxcmjna=adna;
      }
      public int getAkdmakn() {
          return akdmakn;
      }
      public void setAkdmakn(int akdmakn) {
          this.akdmakn = akdmakn;
      }
      public String getAnxcmjna() {
          return anxcmjna;
      }
      public void setAnxcmjna(String anxcmjna) {
          this.anxcmjna = anxcmjna;
      }
  }
  </code></pre>
  
  <p>Imagine that I post an update now and a player that has an unobfuscated version of Player downloads that update. When trying to read that Object there will be different member names and a different class name. I'll most likely get ClassCastException or something of the sorts.</p>