App Integrity & Injection Interview Questions

SECURITY › Security

What is the Play Integrity API, and what does it tell you?

What a strong answer covers: It lets your backend check that a request comes from your genuine, unmodified app installed from Google Play, running on a genuine Android device. The app requests a signed integrity token, sends it to your server, which decrypts and verifies it with Google and gets verdicts on app integrity, device integrity and licensing. It replaced SafetyNet Attestation.

How can attackers tamper with an Android app, and what can you do about it?

What a strong answer covers: They can decompile and modify the APK, repackage it, hook methods at runtime with tools like Frida, or run it on rooted devices or emulators. Mitigations: R8 obfuscation to raise effort, signature and integrity checks verified on the server through Play Integrity, keeping secrets and business rules on the server, and certificate pinning. No client-side measure is unbreakable.

What are the security risks of using WebView, and how do you reduce them?

What a strong answer covers: JavaScript bridges (addJavascriptInterface) let web content call into your app, so a malicious page or injected script can abuse them; loading untrusted URLs; file access (setAllowFileAccess, universal access from file URLs); and mixed content. Reduce risk by only loading trusted origins, keeping JavaScript off unless needed, avoiding or restricting interfaces, validating URLs in shouldOverrideUrlLoading, disabling file access, and using WebViewAssetLoader.

What injection vulnerabilities can affect Android apps?

What a strong answer covers: SQL injection through string-built queries in content providers or raw SQLite (use parameterised queries and Room); intent redirection, where an exported component forwards an attacker-controlled intent; path traversal in file names from untrusted input or zip entries ('../'); JavaScript injection in WebViews; and deserialisation of untrusted data. Validate input at every exported entry point.

How would you protect a premium feature or in-app purchase from being unlocked by a modified app?

What a strong answer covers: Never trust the client: verify purchases on your server with the Google Play Developer API and Real-time Developer Notifications, deliver premium content from the server only to verified entitlements, check Play Integrity tokens on sensitive requests, and treat client-side checks only as UX. Handle refunds and revocations server-side. Obfuscation raises effort but a determined attacker can bypass anything enforced only on the device.

Back to App Integrity & Injection