# techydruid/droidpurifier architecture

> Architecture diagram of the GitHub repository techydruid/droidpurifier, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/techydruid/droidpurifier
- Repository: https://github.com/techydruid/droidpurifier

## Overview

Droid Purifier is an offline-first Flutter desktop app for conservatively analyzing Android packages over ADB and reviewing or removing them without root. The main workflow is connect and scan, classify packages using device-specific safety facts and policy, select packages manually or through presets, then re-scan before removal with backup, session history, and report support. The README documents these capabilities, but the Flutter sources were not sampled, so internal call ownership is uncertain; the helper’s metadata collection and JSON output are directly visible in its source.

Main entry points: [`lib/adb_service.dart`](https://github.com/techydruid/droidpurifier/blob/main/lib/adb_service.dart) (Batch removal), [`lib/main.dart`](https://github.com/techydruid/droidpurifier/blob/main/lib/main.dart) (Flutter interface), [`helper/app/src/main/java/com/techydruid/droidpurifierhelper/ScanActivity.java`](https://github.com/techydruid/droidpurifier/blob/main/helper/app/src/main/java/com/techydruid/droidpurifierhelper/ScanActivity.java) (Metadata scan helper), [`lib/package_policy.dart`](https://github.com/techydruid/droidpurifier/blob/main/lib/package_policy.dart) (Package safety policy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_desktop["Flutter interface<br/>[main.dart]"]
  node_package_list["Package review<br/>[main.dart]"]
  node_filters["Category and status filters<br/>[main.dart]"]
end

subgraph group_analysis["Device analysis"]
  node_adb["ADB operations<br/>[adb_service.dart]"]
  node_scan_helper["Metadata scan helper<br/>[ScanActivity.java]"]
  node_device_facts["Device safety facts<br/>[adb_service.dart]"]
end

subgraph group_safety["Safety and selection"]
  node_policy["Package safety policy"]
  node_presets["De-Google presets<br/>[main.dart]"]
  node_expert["Expert selection<br/>[main.dart]"]
end

subgraph group_recovery["Removal and recovery"]
  node_remove["Batch removal<br/>[adb_service.dart]"]
  node_backup[("Package backups<br/>[adb_service.dart]")]
  node_sessions[("Removal sessions<br/>[session_store.dart]")]
  node_reports["Exported reports<br/>[adb_service.dart]"]
end

node_user(("Desktop user"))
node_device["Android device"]

node_user -->|"uses"| node_desktop
node_desktop -->|"initiates scans"| node_adb
node_adb -->|"probes packages"| node_device
node_adb -.->|"uses when supported"| node_scan_helper
node_scan_helper -->|"writes metadata"| node_device_facts
node_device_facts -->|"informs classification"| node_policy
node_policy -->|"classifies packages"| node_package_list
node_user -->|"filters packages"| node_filters
node_user -->|"selects preset"| node_presets
node_presets -->|"selects candidates"| node_package_list
node_user -->|"enables mode"| node_expert
node_user -->|"confirms removal"| node_remove
node_remove -->|"re-scans device"| node_adb
node_remove -->|"uninstalls packages"| node_device
node_remove -->|"stores backups"| node_backup
node_remove -->|"records history"| node_sessions
node_remove -->|"exports reports"| node_reports

click node_desktop "https://github.com/techydruid/droidpurifier/blob/main/lib/main.dart"
click node_adb "https://github.com/techydruid/droidpurifier/blob/main/lib/adb_service.dart"
click node_scan_helper "https://github.com/techydruid/droidpurifier/blob/main/helper/app/src/main/java/com/techydruid/droidpurifierhelper/ScanActivity.java"
click node_device_facts "https://github.com/techydruid/droidpurifier/blob/main/lib/adb_service.dart"
click node_policy "https://github.com/techydruid/droidpurifier/blob/main/lib/package_policy.dart"
click node_package_list "https://github.com/techydruid/droidpurifier/blob/main/lib/main.dart"
click node_filters "https://github.com/techydruid/droidpurifier/blob/main/lib/main.dart"
click node_presets "https://github.com/techydruid/droidpurifier/blob/main/lib/main.dart"
click node_expert "https://github.com/techydruid/droidpurifier/blob/main/lib/main.dart"
click node_remove "https://github.com/techydruid/droidpurifier/blob/main/lib/adb_service.dart"
click node_backup "https://github.com/techydruid/droidpurifier/blob/main/lib/adb_service.dart"
click node_sessions "https://github.com/techydruid/droidpurifier/blob/main/lib/session_store.dart"
click node_reports "https://github.com/techydruid/droidpurifier/blob/main/lib/adb_service.dart"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_desktop,node_package_list,node_filters,node_user toneBlue
class node_adb,node_scan_helper,node_device_facts toneAmber
class node_policy,node_presets,node_expert toneMint
class node_remove,node_backup,node_sessions,node_reports toneRose
class node_device toneIndigo
```

## Components

### Desktop app

- [Flutter interface](https://github.com/techydruid/droidpurifier/blob/main/lib/main.dart): `lib/main.dart`
- [Package review](https://github.com/techydruid/droidpurifier/blob/main/lib/main.dart): `lib/main.dart`
- [Category and status filters](https://github.com/techydruid/droidpurifier/blob/main/lib/main.dart): `lib/main.dart`

### Device analysis

- [ADB operations](https://github.com/techydruid/droidpurifier/blob/main/lib/adb_service.dart): `lib/adb_service.dart`
- [Metadata scan helper](https://github.com/techydruid/droidpurifier/blob/main/helper/app/src/main/java/com/techydruid/droidpurifierhelper/ScanActivity.java): `helper/app/src/main/java/com/techydruid/droidpurifierhelper/ScanActivity.java`
- [Device safety facts](https://github.com/techydruid/droidpurifier/blob/main/lib/adb_service.dart): `lib/adb_service.dart`

### Safety and selection

- [Package safety policy](https://github.com/techydruid/droidpurifier/blob/main/lib/package_policy.dart): `lib/package_policy.dart`
- [De-Google presets](https://github.com/techydruid/droidpurifier/blob/main/lib/main.dart): `lib/main.dart`
- [Expert selection](https://github.com/techydruid/droidpurifier/blob/main/lib/main.dart): `lib/main.dart`

### Removal and recovery

- [Batch removal](https://github.com/techydruid/droidpurifier/blob/main/lib/adb_service.dart): `lib/adb_service.dart`
- [Package backups](https://github.com/techydruid/droidpurifier/blob/main/lib/adb_service.dart): `lib/adb_service.dart`
- [Removal sessions](https://github.com/techydruid/droidpurifier/blob/main/lib/session_store.dart): `lib/session_store.dart`
- [Exported reports](https://github.com/techydruid/droidpurifier/blob/main/lib/adb_service.dart): `lib/adb_service.dart`

### Other components

- **Desktop user**
- **Android device**

## Connections

- Desktop user → Flutter interface: uses (evidence: `README.md`)
- Flutter interface → ADB operations: initiates scans (evidence: `README.md`)
- ADB operations → Android device: probes packages (evidence: `README.md`)
- ADB operations → Metadata scan helper: uses when supported
- Metadata scan helper → Device safety facts: writes metadata (evidence: `helper/app/src/main/java/com/techydruid/droidpurifierhelper/ScanActivity.java`)
- Device safety facts → Package safety policy: informs classification (evidence: `README.md`)
- Package safety policy → Package review: classifies packages (evidence: `README.md`)
- Desktop user → Category and status filters: filters packages (evidence: `README.md`)
- Desktop user → De-Google presets: selects preset (evidence: `README.md`)
- De-Google presets → Package review: selects candidates (evidence: `README.md`)
- Desktop user → Expert selection: enables mode (evidence: `README.md`)
- Desktop user → Batch removal: confirms removal (evidence: `README.md`)
- Batch removal → ADB operations: re-scans device (evidence: `README.md`)
- Batch removal → Android device: uninstalls packages (evidence: `README.md`)
- Batch removal → Package backups: stores backups (evidence: `README.md`)
- Batch removal → Removal sessions: records history (evidence: `README.md`)
- Batch removal → Exported reports: exports reports (evidence: `README.md`)
