I've been working on a game for Android and iOS for a while. It uses a LAMP server backend.
I was told how it would be easy to extract information from the .apk once I had built my game. I tried it and sure enough I could find my network call functions and server passwords there.
The way how I ensure that only my app can make calls to the server is by using HTTP POST via SSL where the password is passed. If the password matches that of the server then the call gets approved. After that the server checks the actual user's ID and password and gets their data, etc.
The first time the game launches, the server will create a profile for the player. I had thought that this was secure, but now that I know anyone can just extract my .apk and repackage it and then use my server as a backend since they have the keys.
How on Earth can I protect my server from something like that? How can I be sure that only my app will be able to access my servers?