Keep secrets and business logic on the server
What to do
- Move the valuable parts off the phone. Private API keys, payment and subscription checks, credit or reward maths and any algorithm you would hate to see copied belong on your backend, not in the app bundle.
- Let the app only show things. The APK or IPA draws screens, runs animations and displays results the server has already checked. It never decides who gets paid content.
Why it matters
Anything shipped inside the app can be read. A debugger, a hooking tool or a memory dump will reveal it to anyone patient enough. When every important decision is made and checked on your server, a person who decompiles the whole app still has only a shell that cannot work without you.
You are a senior application security architect reviewing my app. 1. Go through the client code below and list every hardcoded API key, secret, token, price or reward calculation, and any piece of business logic that runs on the device. 2. For each item, explain in plain words how an attacker could read it, abuse it or copy it. 3. Redesign the app so all of that runs on my server: give me the REST or GraphQL endpoints (Node.js or Python) with input validation and auth checks, and the updated client code that calls them using short-lived session tokens. My code / folder structure: [PASTE CODE OR FOLDER TREE HERE]