Mobile security · senior
Hardening: secrets, obfuscation, root detection and attestation
Anything shipped in the APK, IPA or JS bundle can be extracted, so real secrets stay on the server, obfuscation (R8, Hermes bytecode) only slows attackers down, root/jailbreak checks are weak client signals, and high-risk actions should be gated by attestation verified on your server (Play Integrity, App Attest).
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- API keys in JS, in .env tools (react-native-config, EXPO_PUBLIC_*) or in native config are extractable. Proxy secret calls through your backend; restrict public keys (Maps) by package name + SHA-1 or bundle id.
- Hermes bytecode can be decompiled; base64 is encoding, not encryption. R8 shrinks and obfuscates Java/Kotlin (needs keep rules for reflection); Expo SDK 58 turns R8 on for release builds.
- Root/jailbreak detection (jail-monkey, freeRASP) looks for su binaries, hooking tools and Frida. It is easy to bypass, so treat it as a signal, not a gate.
- Play Integrity: your server checks requestDetails (package, requestHash or nonce, timestamp), appIntegrity (PLAY_RECOGNIZED), deviceIntegrity (MEETS_DEVICE_INTEGRITY by default; BASIC and STRONG are opt-in), accountDetails, and optional environmentDetails such as appAccessRiskVerdict (apps that capture or overlay the screen).
- iOS: App Attest (generateKey → attestKey → generateAssertion) verified on your server; DeviceCheck for per-device flags.
- Sensitive screens: FLAG_SECURE on Android blocks screenshots and recording; blur the app-switcher snapshot on iOS; let the payment partner's native SDK handle PIN entry; turn off autofill and logging there.
- OWASP MASVS v2 groups (STORAGE, CRYPTO, AUTH, NETWORK, PLATFORM, CODE, RESILIENCE, PRIVACY) make a good checklist for any security answer.
The red pen
Common traps: mistake → fix
Mistake: "We base64 the key, so it is hidden"
Fix: anyone can decode it.
Mistake: "isRooted() in JS stops fraud"
Fix: it is bypassed in minutes; verify attestation on the server.
Mistake: "Cache the integrity verdict for a week"
Fix: request it per sensitive action with a fresh nonce / requestHash.
Easy to hard
Questions interviewers ask, easy to hard
- A pentest found your Maps key and a third-party secret in the APK. How, and what is the fix?
- Product wants to block rooted phones from making payments. How would you approach it?
- What does Play Integrity give you, and why must the server verify it?
- What protections do you add to a UPI PIN or card screen?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.