How atidev17/eden-updater works
1. Product shape
- This is a Flutter desktop/mobile updater app for the Eden emulator.
- It is a single UI codebase with platform-specific backends for Windows, Linux, and Android.
2. Entry points and host shells
- lib/main.dart starts the Flutter app.
- Native host projects exist under windows/, linux/, and android/ to launch the Flutter runtime on each target.
- Android has a Kotlin MainActivity plus manifest/resource setup; Windows and Linux use the standard Flutter desktop runner shells.
3. UI layer
- The screens live in lib/screens/.
- updater_screen.dart is the main user-facing screen, with smaller widgets for channel selection, version cards, progress, logs, auto-launch, settings, and warnings.
- UI state is separated into updater_controller.dart and updater_state.dart, so the screen renders state while the controller drives the workflow.
4. Update workflow
- The core flow is: check release source → compare versions → download artifact → extract/install → optionally launch Eden.
- This is orchestrated by lib/services/update_service.dart, which coordinates the specialized services below.
5. Service layer responsibilities
- network/github_api_service.dart talks to GitHub release endpoints to discover stable/nightly versions and assets.
- download/download_service.dart fetches the release payload.
- extraction/extraction_service.dart unpacks downloaded archives.
- installation/installation_service.dart applies files into the Eden install location.
- launcher/launcher_service.dart starts Eden after install/update.
- storage/preferences_service.dart persists user choices such as channel and auto-launch behavior.
6. Platform abstraction boundary
- The repo has a dedicated cross-platform abstraction under lib/core/platform/.
- Interfaces define the capabilities the app needs: file handling, installation, installer invocation, launching, version detection, and update logic.
- platform_factory.dart selects the concrete implementation for the current OS.
7. Platform-specific implementations
- Each supported platform has its own backend in lib/core/platform/implementations/.
- Windows, Linux, and Android each implement file handling, installation service, installer, launcher, update service, and version detector in platform-appropriate ways.
- This is the main architectural boundary that lets the same Flutter UI drive different native installation behaviors.
8. Runtime model and shared domain
- Shared data models such as UpdateInfo, InstallationContext, and PlatformConfig live under lib/models/ and lib/core/platform/models/.
- Shared enums, constants, exceptions, and utility helpers are centralized under lib/core/.
- This keeps version/channel/configuration logic separate from UI and from OS-specific installation code.
9. Operational concerns
- Logging is handled by lib/core/services/logging_service.dart.
- A service locator is present in lib/core/services/service_locator.dart, indicating dependency wiring is centralized rather than spread through widgets.
- Utilities cover command-line parsing, cleanup, file handling, date formatting, and URL launching; these support the updater flow and CLI modes like --auto-launch and --channel.
10. External dependencies and release sources
- The app’s primary external dependency is GitHub Releases.
- The README documents two update channels sourced from different repositories: stable and nightly.
- The updater installs Eden into Documents/Eden/, with separate folders per channel, which is a key data/layout boundary for the installer and launcher.
11. Packaging and delivery
- Distribution is handled by platform scripts: package_windows.ps1, package_linux.sh, and package_android.ps1.
- GitHub Actions in .github/workflows/ automate build and release workflows.
- Platform build files exist for Flutter, Gradle, CMake, and native desktop runners, reflecting a mixed Flutter + native packaging architecture.
12. Test structure
- Tests are concentrated around the platform abstraction and services.
- There are platform-specific tests for Windows, Linux, and Android implementations, plus tests for the platform factory and extraction service.
- This shows the repo’s main risk surface is the OS-specific update/install behavior rather than the UI alone.
Main entry points: update_service.dart Update service · platform_factory.dart Platform factory · platform_factory_test.dart Platform tests · updater_controller.dart Updater controller
Components 23
App shell
Flutter entry, UI, and shared app services
- Main · Starts the app and wires top-level startup.
lib/main.dart - Updater screen · Primary user-facing updater interface.
lib/screens/updater_screen.dart - Updater controller · Coordinates screen state and update workflow triggers.
lib/screens/controllers/updater_controller.dart - Updater state · Immutable view state rendered by the updater screen.
lib/screens/state/updater_state.dart - Update service · Central update workflow: check, compare, download, extract, install, launch.
lib/services/update_service.dart - GitHub API · Discovers stable and nightly releases and their assets.
lib/services/network/github_api_service.dart - Download · Downloads release payloads.
lib/services/download/download_service.dart - Extract · Unpacks downloaded release archives.
lib/services/extraction/extraction_service.dart - Installer · Applies extracted files into the Eden install location.
lib/services/installation/installation_service.dart - Launcher · Starts Eden after install or update.
lib/services/launcher/launcher_service.dart - Preferences · Persists channel, auto-launch, and related user choices.
lib/services/storage/preferences_service.dart
Platform layer
Cross-platform abstractions plus OS-specific implementations
- Platform factory · Selects the concrete backend for the current OS.
lib/core/platform/platform_factory.dart - Platform APIs · Defines file, install, launcher, update, and version capabilities.
lib/core/platform/interfaces/i_platform_update_service.dart - Windows backend · Windows-specific file, install, launcher, update, and version logic.
lib/core/platform/implementations/windows/windows_update_service.dart - Linux backend · Linux-specific file, install, launcher, update, and version logic.
lib/core/platform/implementations/linux/linux_update_service.dart - Android backend · Android-specific file, install, launcher, update, and version logic.
lib/core/platform/implementations/android/android_update_service.dart
Native hosts
Desktop and Android runner shells
- Windows runner · Native desktop host that boots the Flutter runtime on Windows.
windows/runner/main.cpp - Linux runner · Native desktop host that boots the Flutter runtime on Linux.
linux/runner/main.cc - MainActivity · Android host activity and manifest-backed runtime entrypoint.
android/app/src/main/kotlin/com/eden/updater/eden_updater/MainActivity.kt
Delivery
Packaging and release automation
- Packaging · Platform packaging scripts used for distribution builds.
package_windows.ps1 - CI workflows · GitHub Actions build and release pipelines.
.github/workflows/build.yml
Tests
Coverage focused on platform behavior and core services
- Platform tests · Tests for platform factory and Windows, Linux, and Android backends.
test/core/platform/platform_factory_test.dart - Service tests · Tests for core services such as extraction.
test/services/extraction_service_test.dart
Connections 27
- Main → Updater screen: opens · Bootstraps the main UI.
- Updater screen → Updater controller: driven by · Screen delegates interaction and workflow actions to controller.
- Updater controller → Updater state: renders · Controller updates state consumed by the screen.
- Updater controller → Update service: orchestrates · Controller triggers the update workflow.
- Update service → GitHub API: checks releases · Finds available versions and assets.
- Update service → Download: downloads · Fetches the chosen artifact.
- Update service → Extract: extracts · Unpacks downloaded archives.
- Update service → Installer: installs · Applies files into the target install location.
- Update service → Launcher: launches · Optionally starts Eden after update.
- Updater controller → Preferences: reads/writes · Uses persisted channel and auto-launch settings.
- Update service → Platform factory: uses · Resolves OS-specific capabilities through the platform boundary.
- Platform factory → Platform APIs: returns · Contracts for platform capabilities.
- Platform factory → Windows backend: selects · Chooses Windows backend when running on Windows.
- Platform factory → Linux backend: selects · Chooses Linux backend when running on Linux.
- Platform factory → Android backend: selects · Chooses Android backend when running on Android.
- Windows runner → Main: starts · Desktop host launches the Flutter app.
- Linux runner → Main: starts · Desktop host launches the Flutter app.
- MainActivity → Main: starts · Android host launches the Flutter app.
- Packaging → Windows runner: packages · Builds Windows distribution artifacts.
- Packaging → Linux runner: packages · Builds Linux distribution artifacts.
- Packaging → MainActivity: packages · Builds Android distribution artifacts.
- CI workflows → Packaging: automates · CI drives release packaging and publishing.
- Platform tests → Platform factory: verifies · Covers platform selection and backend behavior.
- Platform tests → Windows backend: verifies · Covers Windows-specific behavior.
- Platform tests → Linux backend: verifies · Covers Linux-specific behavior.
- Platform tests → Android backend: verifies · Covers Android-specific behavior.
- Service tests → Extract: verifies · Covers archive extraction behavior.