How mutyshwarzkopf-a11y/yggpeerchecker works
Purpose and Entry Point
YggPeerChecker is a native Android utility for importing Yggdrasil peer/SNI host lists, resolving names, and measuring reachability and latency. The application starts in app/src/main/java/com/example/yggpeerchecker/ui/MainActivity.kt; Android packaging, permissions, and activity registration are defined in app/src/main/AndroidManifest.xml.
UI Shell and User Workflows
The UI is organized into three functional areas: checks, list management/viewing, and system settings/logs. app/src/main/java/com/example/yggpeerchecker/ui/checks/ChecksScreen.kt, app/src/main/java/com/example/yggpeerchecker/ui/lists/ListsScreen.kt, and app/src/main/java/com/example/yggpeerchecker/ui/system/SystemScreen.kt are the primary workflow boundaries. Theme selection is application-wide state managed by app/src/main/java/com/example/yggpeerchecker/ui/theme/ThemeManager.kt.
Check Orchestration
ChecksViewModel coordinates user-selected check type, filtering, sorting, concurrency, and displayed results. It consumes persisted hosts, executes probes, and groups output for presentation via app/src/main/java/com/example/yggpeerchecker/data/GroupedHost.kt and app/src/main/java/com/example/yggpeerchecker/ui/checks/GroupedHostCard.kt. Session-scoped UI/check state is represented by app/src/main/java/com/example/yggpeerchecker/data/SessionManager.kt.
Network-Probing Boundary
Probe implementations are isolated under utils, separating Android/UI concerns from network operations. app/src/main/java/com/example/yggpeerchecker/utils/ActiveProber.kt appears to be the central active-check dispatcher, while PingUtil.kt, YggConnectChecker.kt, SniChecker.kt, and TracertUtil.kt implement specific network measurements. Supported peer transport schemes include TCP, TLS, QUIC, WebSocket, and secure WebSocket; the bundled app/libs/yggpeers.aar is a material external Android library dependency likely used for Yggdrasil-peer functionality.
Host Ingestion, Parsing, and DNS
List management imports preset remote sources plus clipboard/file-provided content, then normalizes entries into host records. The parsing boundary is app/src/main/java/com/example/yggpeerchecker/utils/UrlParser.kt; host discovery/representation uses app/src/main/java/com/example/yggpeerchecker/data/DiscoveredPeer.kt. DNS resolution and fallback/“always check resolved IPs” behavior are handled by app/src/main/java/com/example/yggpeerchecker/utils/DnsResolver.kt and app/src/main/java/com/example/yggpeerchecker/utils/NetworkUtil.kt.
Persistence and Repository Layer
Room-style local persistence stores hosts, DNS cache entries, and historical check results. The database root is app/src/main/java/com/example/yggpeerchecker/data/database/AppDatabase.kt, with entities/DAOs such as Host.kt, DnsCache.kt, and CheckResult.kt. app/src/main/java/com/example/yggpeerchecker/data/repository/HostRepository.kt is the principal boundary between ViewModels and storage, enabling list filters, bulk DNS operations, clearing, and retrieval for checking.
Runtime, Infrastructure, and Observability
This is a Kotlin/Gradle Android application targeting Android SDK 34 and requiring JDK 17 for builds; module dependencies and packaging are in app/build.gradle. It relies on device network connectivity, external peer-list endpoints, DNS infrastructure, and target hosts rather than a server-side backend. Persistent application logging is centralized in app/src/main/java/com/example/yggpeerchecker/utils/PersistentLogger.kt and surfaced through app/src/main/java/com/example/yggpeerchecker/ui/system/LogsTab.kt.
Main entry points: UrlParser.kt List import and parsing · HostRepository.kt Host repository · MainActivity.kt Main activity · ChecksScreen.kt Workflow screens
Components 18
Android UI
- Android app manifest · Declares packaging, permissions, and launcher activity.
app/src/main/AndroidManifest.xml - Main activity
app/src/main/java/com/example/yggpeerchecker/ui/MainActivity.kt - Workflow screens · Checks, lists, and system workflows.
app/src/main/java/com/example/yggpeerchecker/ui/checks/ChecksScreen.kt - Theme manager
app/src/main/java/com/example/yggpeerchecker/ui/theme/ThemeManager.kt - Logs tab
app/src/main/java/com/example/yggpeerchecker/ui/system/LogsTab.kt
Check Pipeline
- Checks view model · Coordinates selection, filtering, sorting, concurrency, and results.
- Session manager
app/src/main/java/com/example/yggpeerchecker/data/SessionManager.kt - Grouped check results
app/src/main/java/com/example/yggpeerchecker/data/GroupedHost.kt
Data and Ingestion
- Host repository · Storage boundary for filtering, retrieval, bulk DNS work, and clearing.
app/src/main/java/com/example/yggpeerchecker/data/repository/HostRepository.kt - List import and parsing · Imports preset, clipboard, and file content into host records.
app/src/main/java/com/example/yggpeerchecker/utils/UrlParser.kt - Discovered peer
app/src/main/java/com/example/yggpeerchecker/data/DiscoveredPeer.kt - App database · Stores hosts, DNS cache entries, and historical check results.
app/src/main/java/com/example/yggpeerchecker/data/database/AppDatabase.kt
Network and Observability
- DNS resolver · Applies DNS fallback and resolved-IP checking behavior.
app/src/main/java/com/example/yggpeerchecker/utils/DnsResolver.kt - Active prober · Dispatches selected active network checks.
app/src/main/java/com/example/yggpeerchecker/utils/ActiveProber.kt - Probe implementations · Ping, Ygg connection, SNI, and traceroute checks.
app/src/main/java/com/example/yggpeerchecker/utils/PingUtil.kt - External network · Peer-list endpoints, DNS infrastructure, and target hosts.
- Yggpeers library · Yggdrasil-peer functionality dependency.
app/libs/yggpeers.aar - Persistent logger
app/src/main/java/com/example/yggpeerchecker/utils/PersistentLogger.kt
Connections 20
- Android app manifest → Main activity: launches
- Main activity → Workflow screens: hosts
- Main activity → Theme manager: uses
- Workflow screens → Checks view model: drives checks
- Workflow screens → List import and parsing: imports lists
- Checks view model → Session manager: reads and updates
- Checks view model → Host repository: loads hosts
- Checks view model → Active prober: executes probes
- Checks view model → Grouped check results: groups for display
- List import and parsing → Discovered peer: normalizes into
- List import and parsing → Host repository: persists imports
- List import and parsing → External network: fetches presets
- Host repository → App database: reads and writes
- Host repository → DNS resolver: requests bulk resolution
- DNS resolver → External network: queries DNS
- Active prober → Probe implementations: dispatches to
- Probe implementations → External network: measures targets
- Probe implementations → Yggpeers library: uses
- Active prober → Persistent logger: records activity
- Persistent logger → Logs tab: surfaces logs