Skip to content

y-sudharshan/Priv-Guard

Repository files navigation

PrivGuard: AI-Based Privacy Leak Detector for Android Apps

PrivGuard is an AI-driven privacy analysis tool designed to detect hidden data leaks and unauthorized permission usage in Android mobile applications. By combining static and dynamic analysis, it uncovers suspicious behaviors and mismatches between requested permissions and runtime access — empowering users and developers with deeper insights into app privacy.


Current Progress

I have successfully implemented the core functionality of permission and behavior analysis, including:

Accomplishments

  • Static Permission Extraction

    • Extracted permissions from AndroidManifest.xml using decompilation tools.
    • Identified declared permissions vs. sensitive APIs accessed in Smali code.
  • Dynamic Permission Analysis via Hooking

    • Deployed Frida-server to hook into target APKs at runtime.
    • Extracted dynamic permission usage (e.g., location, contacts, camera).
    • Compared runtime permission access with those declared/requested to detect hidden or excessive permission usage.
  • Tested in Real-World-Like Environment

    • Successfully tested static and dynamic permission analysis on Android emulators:
      • Android Studio Emulator
      • Genymotion Emulator
    • Both using Google Pixel (x86_64 architecture, 5th Generation) setup for enhanced compatibility and performance.
  • Initial Comparison Engine

    • Developed logic to flag discrepancies between:
      • Permissions declared in manifest
      • Permissions asked during installation/runtime
      • Permissions accessed dynamically

Tools & Technologies Used

Tool / Library Purpose
Frida + Frida-server Dynamic analysis and runtime function hooking
Apktool APK decompilation and static analysis
AAPT Extracting APK metadata and manifest entries
Androguard Parsing and analyzing DEX files
Test APKs from F-Droid Used as open-source targets for analysis
Android Studio Emulator Real-time test environment for dynamic hooking
Genymotion Emulator Alternate emulator with good Frida compatibility
Python + Bash Scripts Automating extraction and comparison tasks

To Be Done / Roadmap

Here are the next key steps planned for building out the full system:

  1. Supervised ML Model for Privacy Risk Classification

    • Train a model to classify apps as Low, Medium, or High Risk based on extracted features.
  2. Policy Matching via NLP

    • Use a BERT-based NLP model to parse privacy policies.
    • Match stated intentions with actual runtime behaviors and flag discrepancies.
  3. Threat Visualization

    • Build an interactive threat graph showing:
      • User data entry points → accessed APIs → external destinations
      • Highlight suspicious paths and flows
  4. Real-time Browser Extension (Bonus)

    • Scan Play Store/F-Droid app links
    • Show privacy risk score before installation

Project Structure

project structure


Disclaimer

This project is intended for research and educational purposes only. Do not use on commercial or closed-source apps without explicit permission. Respect privacy and legality.


Contributions

I welcome suggestions to improve this tool. Contributions are open to those interested in Android security, machine learning, or privacy engineering.


Contact

For queries or collaboration, reach out at:
y-sudharshan (Github -username)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published