Skip to content

Gkemon/device-gpt

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

75 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DeviceGPT β€” AI-Assisted Android Device Monitor

A privacy-focused Android app that scans your device β€” battery, performance, network, and privacy β€” then helps you understand what's going on through any AI assistant you prefer (ChatGPT, Gemini, Claude, and more).

License Kotlin Compose Get it on Google Play

1k+ downloads Β· MIT licensed Β· No root required Β· Most features work offline


What it does

DeviceGPT scans your Android device and shows you what's happening underneath, in plain language. Four main areas:

Privacy & Security β€” Detects background mic/camera usage, spyware, screen recording apps, keyloggers, GPS spoofing tools, and motion while the phone is locked.

Network & ISP β€” Real speed tests (no estimates β€” it actually downloads 10 MB from Cloudflare), DNS manipulation detection, SSL hijack detection, Deep Packet Inspection (DPI) detection, ISP tracking analysis.

Performance β€” CPU, RAM, storage, battery health, temperature, frame rate. All via standard Android APIs. No root.

Power Consumption β€” Component-level power measurement using BatteryManager API (P = V Γ— I formula). Camera, display, CPU, and network workload power measured separately, with CSV export for research.

After any scan, tap "Ask AI" to share the data with your preferred AI assistant and get explanations in plain English.


Privacy approach

The app is built around the idea that you should be able to see what your phone is doing without having to send your data to a third party to find out.

  • Most features work offline β€” privacy scans, device info, power tracking, and health scoring all run locally
  • No account required to use the app
  • No data leaves the device unless you explicitly share it (via Ask AI or CSV export)
  • Analytics automatically disabled in Battery Saver, Do Not Disturb, Airplane Mode, and Doze Mode
  • Anonymous Firebase auth by default; Gmail linking is optional and only used for the leaderboard
  • Privacy scan results stay on your device

Full details in the Privacy & Data section.


Tech stack

Layer Choice
Language Kotlin 2.1.0
UI Jetpack Compose, Material Design 3
Architecture MVVM with ViewModels
Background work Foreground service + WorkManager
DI Manual (no Hilt/Koin)
Backend Firebase (Auth, Firestore, Analytics, Crashlytics, Remote Config)
Push OneSignal
Testing JUnit, Robolectric, Espresso, Compose UI Test
Build Gradle 8.13 (Kotlin DSL)
Min SDK API 24 (Android 7.0)
Target SDK API 36 (Android 15)

Architecture

Single-activity app with tab-based navigation. State is managed through ViewModels per major feature area:

  • DeviceInfoViewModel β€” system info, health scoring
  • PowerConsumptionViewModel β€” power experiments and tracking

A foreground SystemMonitorService handles continuous monitoring with proper Android service lifecycle management.

Data flow is unidirectional: UI β†’ ViewModel β†’ Utils/Services β†’ SharedPreferences/Flow β†’ UI.

Feature-to-code map

Feature Files
Device info ui/device_info_ui.kt, utils/device_utils.kt
Privacy scanner utils/device_utils.kt (lines 1553–1996)
Network monitoring ui/network_ui.kt, utils/network_utils.kt
Power consumption ui/power_consumption_card.kt, utils/power_consumption_utils.kt
Health scoring ui/health_section.kt, utils/health_score_utils.kt
AI assistant ui/ai_assistant_dialog.kt, utils/ai_prompt_generator.kt
Background service services/system_monitor_service.kt
Lock screen widget widgets/LockScreenMonitorWidget.kt

Quick start

git clone https://github.com/Gkemon/device-gpt.git
cd device-gpt
./gradlew assembleDebug

Or open in Android Studio (Iguana 2024.1.1+) and click Run.

Default builds use Google test ad IDs and placeholder Firebase config, so the app runs out of the box for development. To enable production features (your own Firebase, AdMob, OAuth), see Configuration.


Configuration

Sensitive config lives in local_config.properties (not committed). Templates are provided.

Firebase (required)

cp app/google-services.json.template app/google-services.json

Replace placeholder values with your Firebase project credentials. Package name should match com.teamz.lab.debugger in build.gradle.kts.

AdMob, OAuth, OneSignal (optional)

cp local_config.template local_config.properties

Fill in the IDs you want. Build-time injection handles the rest β€” no manual editing of strings.xml.

Release signing (optional)

cp key.properties.template key.properties
keytool -genkey -v -keystore release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias release-key

Debug builds work without this.


Testing

# Unit tests (31 files)
./gradlew :app:testDebugUnitTest

# UI tests (17 files, requires device/emulator)
./gradlew :app:connectedAndroidTest

# Coverage report
./gradlew :app:jacocoTestReport

Coverage reports land in app/build/reports/jacoco/jacocoTestReport/html/index.html.

Detailed testing notes in TESTING_GUIDE.md.


Privacy & data

Stays on your device

  • All device scan results (CPU, RAM, battery, network)
  • Health scores and history
  • Power consumption measurements
  • Privacy scan results (mic/camera logs, spyware detection)
  • App preferences

May go to Firebase (anonymized)

  • Crash reports (Crashlytics)
  • App usage events (Analytics) β€” automatically off in restricted device modes
  • Leaderboard scores (Firestore) β€” only if you opt in
  • Anonymous auth tokens

To disable analytics fully

Either disable Firebase Analytics in your Firebase project console, or modify AnalyticsUtils.kt to early-return in logEvent().


How power is measured

The math: P = V Γ— I.

  • V from BatteryManager.EXTRA_VOLTAGE (real millivolts)
  • I from BatteryManager.BATTERY_PROPERTY_CURRENT_NOW (real microamps)
  • Measurements use baseline β†’ workload β†’ post-workload delta

The app only reports real measurements. If the system can't return real data, the API returns 0.0 β€” no fallback estimates or simulations.

Component-level breakdown:

  • Camera β€” per-photo energy measurement with a real camera preview
  • Display β€” brightness curve analysis
  • CPU β€” micro-benchmark workload profiling
  • Network β€” RSSI-to-power correlation

Methodology and research references: docs/latest_power_consumption_research.md.


Troubleshooting

Build fails with "google-services.json missing" Copy the template, fill in values, make sure the package name matches com.teamz.lab.debugger, then sync Gradle.

AdMob shows test ads Create local_config.properties and add your AdMob IDs. Rebuild after.

OAuth client ID mismatch on Google Sign-In Verify the OAuth client ID in local_config.properties ends with .apps.googleusercontent.com and matches Firebase Console for package com.teamz.lab.debugger.

Gradle sync fails Ensure Android Studio Iguana (2024.1.1)+, JDK 8+, and try a clean rebuild:

./gradlew clean
./gradlew --stop

FAQ

Does it require root? No. All monitoring uses standard Android APIs.

Does it work offline? Most features yes β€” device info, health scoring, power tracking, and privacy scans all work without internet. Network speed tests, the AI sharing feature, and Firebase analytics require internet.

Can I export data? Yes. Power consumption experiments support CSV export via Android's share dialog.

What Android versions are supported? Minimum API 24 (Android 7.0). Some features (lock screen widget, runtime notification permission) require API 33+.


Contributing

Contributions welcome. See CONTRIBUTING.md.

  1. Fork the repo
  2. Create a feature branch
  3. Make changes with tests
  4. ./gradlew :app:testDebugUnitTest must pass
  5. Open a PR

Code style: standard Kotlin conventions, meaningful names, KDoc on public APIs, tests for new features.


License

MIT β€” see LICENSE for full text.


About

DeviceGPT is a personal open-source project I started to make Android device internals β€” especially the privacy-related ones β€” understandable to non-technical users. I'm the sole maintainer.

Maintainer: Gkemon (MD Golam Kibria Emon) β€” Senior Android engineer, Dhaka. Published under: Teamz Lab, my personal studio brand. Best way to reach me: Open an Issue or start a Discussion in this repo.


Support the project

About

πŸ€– AI-powered Android phone health monitor β€’ Battery tracker β€’ Privacy scanner β€’ Real-time device monitoring β€’ ChatGPT/Gemini/Claude integration

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Kotlin 99.6%
  • Other 0.4%