This project is a dedicated Security Research & Development case study focusing on the secure integration of the Google AdMob SDK. It explores the critical balance between mobile monetization and Application Security (AppSec), specifically targeting third-party SDK hardening and user privacy.
Integrating advertising SDKs introduces significant supply-chain risks. This project implements advanced mitigations for common AdTech vulnerabilities.
- Limited Data Tracking: Programmatically configured the SDK to respect "Limit Ad Tracking" (LAT) headers and masked hardware identifiers.
- Regulatory Compliance: Implemented
tagForChildDirectedTreatmentto ensure strict adherence to COPPA and GDPR child-safety requirements. - Consent Management: Architecture designed to support the User Messaging Platform (UMP) SDK for secure, encrypted user consent collection.
- SDK Sandboxing: Audited SDK permissions to enforce the Principle of Least Privilege, ensuring the ad library cannot access sensitive user components (Contacts, Location, etc.).
- Manifest Hardening: Verified all AdMob-related
Activitiesare non-exported to prevent Intent Spoofing and unauthorized deep-linking. - Code Obfuscation: Custom R8/ProGuard rules applied to strip sensitive metadata and protect integration logic from reverse engineering.
- TLS Enforcement: Global enforcement of HTTPS via
network_security_config.xmlto prevent Ad-Injection and Man-in-the-Middle (MitM) attacks. - Data Leakage Prevention: Verified via Burp Suite proxying that no PII (Personally Identifiable Information) is transmitted via unencrypted or hidden ad request parameters.
- Anti-Clickjacking: Implemented strict lifecycle management for Interstitial ads to prevent UI Redressing, ensuring ads do not obscure sensitive transaction buttons or input fields.
- Memory Hygiene: Leveraged Kotlin Coroutines & StateFlow to ensure ad objects are cleared from the heap upon UI destruction, preventing memory-resident data leakage.
| Threat Vector | Risk | Mitigation Strategy |
|---|---|---|
| Ad-ID (IDFA) Leakage | Medium | ID masking and user-controlled tracking toggles. |
| Malicious Ad Payloads | High | Using strict targetSdkVersion 34+ to leverage Android system-level sandbox updates. |
| UI Redressing | Medium | Hardware-synced indicators and lifecycle-aware Ad-Views. |
| API Key Exposure | Low | Segregated sensitive IDs from source control via local.properties. |
- Language: Kotlin & Coroutines
- SDK: Google AdMob (Google Play Services)
- Architecture: Clean Architecture + MVVM
- AppSec Tools: MobSF, Burp Suite, Jadx-GUI, Wireshark.
-
Clone the repository:
git clone [https://github.com/nikolaivetrik24062010/AdMobApp.git](https://github.com/nikolaivetrik24062010/AdMobApp.git)
-
Setup Credentials: Add your ADMOB_APP_ID to local.properties (this file is git-ignored to prevent credential leakage).
-
Run Security Audit: Build the Release variant and inspect the APK via Jadx-GUI to confirm that the business logic is obfuscated and isolated from the advertising SDK.