Skip to content

GamePointAnalytics/dark-pattern-detector-android

Repository files navigation

Dark Pattern Detector — Android App

A privacy-first Android app that detects manipulative design patterns in screenshots and websites using on-device AI (Gemini Nano), with zero sensitive data leaving your device.

Key Features

  • Screenshot Analysis: Share a screenshot directly to the app for instant analysis.
  • Website Analysis: Enter a URL to analyze live website content without taking screenshots.
  • Dual-Engine Detection: Uses Gemini Nano for multimodal on-device analysis on supported devices. Other devices automatically use an OCR and pattern-matching fallback.
  • Privacy-First: Analysis is performed 100% on-device. Screenshots are held in memory only and never saved to disk.

How It Works

Via Screenshots

  1. 📸 Take a screenshot of a suspicious app or website.
  2. 📤 Tap Share → Dark Pattern Detector.
  3. 🧠 The app analyzes the visual elements on-device.
  4. 📊 View detected patterns with confidence scores.

Via URL

  1. 🔗 Paste a website URL into the app's home screen.
  2. 🌐 The app loads the site in a local WebView and extracts text context.
  3. 🧠 Gemini Nano (or the Regex fallback) processes the text to identify deceptive language.

Privacy

  • On-Device Analysis: AI inference, OCR, and pattern matching run locally via Android's AICore and ML Kit.
  • ℹ️ Website Loading Uses the Network: An entered URL is loaded from its website before the extracted text is analyzed locally.
  • Ephemeral Storage: Screenshots are never written to disk or sent to a server.
  • Secure Web Loading: INTERNET permission is used strictly to load the requested URL in a local WebView for text extraction. No browsing data or history is collected.

Tech Stack

Layer Technology
Language Kotlin (2.4.0)
UI Jetpack Compose (Material 3)
AI (Multimodal + Text) ML Kit GenAI Prompt API
Fallback ML Kit OCR + Pattern Matching
Build System Gradle 9.6.1 + Compose Compiler

Building

  1. Open the project in Android Studio.
  2. Ensure you have the Android SDK 37 and Kotlin 2.4.0 configured.
  3. Sync Gradle and run on your device or emulator.
  4. Note on Gemini Nano: To test the AI features, you must run the app on a physical, supported device (e.g., Pixel 8/9, Galaxy S24). On some devices, you may need to enable "AICore Settings" in Developer Options to trigger the model download. Emulators will automatically use the Regex fallback.

Dark Patterns Detected

Category Example
Fake Urgency "Offer ends in 00:05:00!"
Fake Scarcity "Only 2 left in stock!"
Fake Social Proof "15 people viewing this"
Confirmshaming "No thanks, I hate saving money"
Hidden Costs "Service fee: $4.99"
Hidden Subscription "Free trial, then $9.99/month"
Nagging "You left items in your cart!"
Hard to Cancel "Call to cancel your subscription"
Preselection "☑ Sign me up for emails"
Trick Wording "Uncheck to not receive emails"
Forced Action "Sign up to continue reading"
Sneaking "Insurance added to cart"

License

MIT

About

A privacy-first Android app that detects manipulative design patterns in screenshots using on-device AI (Gemini Nano), with zero data leaving your device.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages