Skip to content

Architecture

GoldyL edited this page Mar 28, 2026 · 1 revision

Architecture

Module structure

smartycraft-open-launcher/
├── client-config      # Constants, AppConfig, BuildConfig
├── client-core        # Domain models, API services, interfaces
├── client-launcher    # DI wiring, file download, update, launch logic
└── client-ui          # Compose Multiplatform desktop UI

client-config

App-wide constants: server URLs, timeouts, file paths, proxy config.
Generates BuildConfig with version and build time via gmazzo/buildconfig.

client-core

Pure business logic — no UI, no DI framework dependencies.

  • AuthService — login, AES token decryption, SSL error detection
  • ServerRepository — dashboard fetch, launcher hash update cycle
  • SkinRepository — skin/cloak upload
  • HttpClientProvider — thin wrapper that switches between secure/insecure OkHttp client at runtime (SSL bypass support)
  • Domain models: SessionData, FileManifest, SettingsData, etc.

client-launcher

Wires everything together with Koin DI.

  • FileDownloadService — manifest flattening, parallel file download, MD5 verification, extra.zip unpacking
  • LauncherService + GameCommandBuilder — assembles the JVM command line for 1.7.10 / 1.12.2 / 1.21.1 (NeoForge)
  • UpdateService — GitHub releases API, asset detection per OS, SHA256 verification, update scheduling
  • CredentialsManager — AES-256-GCM credential encryption with PBKDF2 key derivation
  • ProfileManager — per-server instance profiles, favorites, last server
  • JavaManagerService — downloads and manages Bellsoft JDK bundles per Minecraft version

client-ui

Compose Multiplatform desktop UI.

  • AppLayout / AppRoot — root composition, window management, auto-login
  • DashboardScreen — server grid, launch control panel
  • RightPanel — login/account panel, news feed
  • TrayManager — dorkbox/SystemTray wrapper, server quick-launch from tray
  • LauncherController — launch pipeline state machine (Idle → Prepare → Downloading → GameRunning)
  • Easter egg: AprilFoolsEngine — active April 1–14, escalating chaos UI

Key design decisions

HttpClientProvider instead of direct HttpClient injection
Repositories receive a provider that resolves the correct client on every call. This allows SSL bypass to take effect immediately without recreating Koin singletons.

JNA version pinning
dorkbox/SystemTray 4.4 performs a hardcoded version check against JNA. JetBrains Runtime 25 bundles JNA 7.x which fails this check. Solution: resolutionStrategy.eachDependency forces JNA to 6.1.6 globally, with 5.18.1 pinned explicitly in client-ui for Windows.

AppImage manual assembly
Compose Multiplatform's built-in Linux packaging produces DEB/RPM. AppImage is assembled manually in CI using jlink for a minimal JRE + appimagetool, with .desktop and AppStream metainfo injected.

GameCommandBuilder version configs
Each supported Minecraft version (1.7.10, 1.12.2, 1.21.1) has an immutable VersionConfig — main class, tweak class, JVM flags, natives dir. NeoForge (1.21.1) requires module path separation (-p) and additional --add-opens flags for Java 21+.

Clone this wiki locally