- Obfuscation with ProGuard
- Using the License Verification Library
- Using SSL for Network Communication
Using SSL for Network Communication
Another form of exploitation networked applications suffer from involves the sniffing of network communication between your application and its server. If you're following good coding practices with credentials, that’s great, but we're not talking about that sort of protection. Instead, someone could use this information to determine how your server works and abuse that knowledge. This is most commonly done with games, but could be done with any app that relies upon an application server.
In a game, someone might be able to gain points, levels, experience, swords of smiting, or anything else that is useful, simply by performing the same or similar network command multiple times. If the method for performing the action is easily determined through sniffing, the smart user might decide to write a script to do the work for them. Although they have a valid account, and have possibly even have paid for the game, they will give themselves an unfair advantage against other users. Some cheaters simply do this for their own benefit, while other more entrepreneurially-minded cheaters may monetize their findings and provide them to others.
While there are always methods for automating playing of games, or other systems, using an encrypting communication method that takes these cheating methods into account will help make it more difficult to create those systems. Generally speaking, Android has full support for HTTPS and creating SSL (or TLS) protected sockets. You have no excuse not to use them.
Conclusion
In this article, you have learned a variety of straightforward methods to protect your Android applications from theft and tampering. Although no method is perfect, and pirates and vampires will always have a place in this world, there’s no reason to make yourself an easy target. So prime your cannons, wreath yourself in garlic, obfuscate with ProGuard, ensure strong licensing with LVL, and protect your network communication from cheaters. The longer it takes for your application to be cracked and stolen, then more likely those lazy pirates and vampires will simply turn to easier prey.