DOCUMENTATION · V1.2.3 "MICROSOFT PATCH"

Full Documentation

Every file, every subsystem. A complete technical read-through of FractalLauncher — the Python + pywebview Minecraft launcher by TheExtreme_Ray, built with safety as a top priority.

PYTHON + PYWEBVIEW  ·  61-METHOD BRIDGE  ·  OPEN SOURCE

VANILLAFABRICFORGEQUILTNEOFORGEMICROSOFT OAUTHOFFLINE SKINSMODRINTHCEREBRAS AI20 THEMES7 LANGUAGES
SECTION 01

What it is

FractalLauncher v1.2.3 ("Microsoft Patch") is a feature-rich custom Minecraft launcher for Windows. Its backend is a Python package (launcher/) and its UI is a single self-contained 119 KB HTML file (assets/ui.html) rendered inside a native window by pywebview (Microsoft Edge WebView2). The Python and JavaScript sides talk over pywebview's js_api bridge: JS calls a 61-method API object, and Python pushes events back as DOM CustomEvents.

Feature highlights:

  • Vanilla + all mod loaders — Fabric, Forge, Quilt, NeoForge (installer jars fetched & run automatically)
  • Microsoft login — full Xbox OAuth2 flow (authorization-code + PKCE, Prism Launcher's public Azure client ID)
  • Offline mode — with a full local Yggdrasil / authlib-injector skin server so offline skins actually work
  • Multiple profiles & accounts — each profile owns its version, loader, RAM, JVM args, game dir, resolution
  • 3D skin viewer — skinview3d (three.js) with cape support and 25 cape presets
  • Modrinth browser — search/install mods, shaders and resource packs with dependency resolution and update checks
  • Servers — curated server list + custom servers with real Server-List-Ping latency checks
  • Screenshots editor, backups, diagnostics, console — canvas crop/blur/draw; zip backups of saves; Mesa3D opengl32.dll conflict detector
  • AI-generated themes — type a description, a Cerebras LLM invents a palette
  • 7 languages — en, fr, es, pt, de + novelty Pirate & Darija
  • Performance tuning baked in — Aikar's G1GC flag set, ABOVE_NORMAL process priority, pre-launch asset cache audit, shipped mod-config presets

⚠ Architectural note: an older CustomTkinter desktop UI used to exist as launcher/app.py, but that file is gone. Every fallback path in main.py, bootstrap.py and pyoxidizer.bzl that references launcher.app is dead code that would crash if ever executed. The webview UI is the only real UI.

SECTION 02

Entry points (root *.py)

FileRole
main.py
167 lines
Primary dev entry. Writes first-run ~/.FractalLauncher/config.json (auto-detects jdk/**/javaw.exe and Authlib/Authlib.jar at any depth), then starts a pywebview window loading assets/ui.html with API as js_api (1200×720, min 900×580, background #0d0f13). Fallback chain on failure: auto-pip install pywebview and retry → CustomTkinter UI (broken — launcher.app missing).
main_webview.py
113 lines
Near-duplicate of main.py's webview path (adds a first_launch flag, frameless=False). No CTK fallback. Essentially superseded by main.py.
bootstrap.py
282 lines
PyInstaller exe entry point. Handles the frozen environment (sys._MEIPASS vs cx_Freeze's exe-dir), pip-installs missing deps when not frozen (minecraft-launcher-lib, Pillow, requests, cryptography), checks the WebView2 runtime in the registry (HKLM/HKCU\Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}), writes first-run config relative to the exe dir, logs diagnostics to ~/.FractalLauncher/launcher.log, then starts the same pywebview window.

All three copy-paste the same config-bootstrap logic (bundled Java/Authlib detection) rather than sharing it.

Other root files

FileRole
run.batRuns python main.py with an error-pause wrapper.
requirements.txtcustomtkinter, minecraft-launcher-lib>=6.4, Pillow, requests, cryptography, pywebview>=4.0.
README.mdoutdated Describes setup_and_run.py and launcher/app.py — neither exists.
BUILD_INSTRUCTIONS.mdoutdated Claims Nuitka is the default builder and mentions a cloudflared.exe auto-download that was removed from the code.
SECTION 03

launcher/ — the core package

3.1 webview_bridge.py (1,518 lines) — the JS↔Python API

class API (line 65) is exposed to JavaScript as window.pywebview.api and has 61 public methods. Every method is synchronous (pywebview marshals calls onto worker threads) and follows one return convention:

# success
{ "ok": True,  ...payload }

# failure
{ "ok": False, "error": msg }

Bridge mechanics

  • JS → Python: the UI never touches pywebview.api directly; it caches the handle on pywebviewready and funnels everything through a generic dispatcher:
    async function call(method, ...args) {
      const api = getApi();
      if (!api) return { ok: false, error: 'API not ready' };
      try { return await api[method](...args); } catch (e) { ... }
    }
    56 of the 61 methods are invoked this way from ui.html.
  • Python → JS: a single mechanism — _push(event, data) (line 94) calls window.evaluate_js("window.dispatchEvent(new CustomEvent(...))"). This is the only evaluate_js usage in the entire codebase.
  • Async → sync adapters: callback-style backend functions are converted into blocking returns using threading.Event with timeouts (search 25 s, mod install 10 s, download up to 60 s).
  • Path safety: _safe_path() (line 20) does basename + os.path.realpath prefix checks for every file-delete/edit operation.

Events pushed Python → JS

EventWhen
launch_state{state:"launching"|"stopped"|"error", code, error}
console_lineEvery game log line + exit banner
console_clearConsole cleared
install_progress{frac, speed, eta, downloaded, total…} during installs
assets_cachePre-launch shared-cache audit report
microsoft_login_success / microsoft_login_errorOAuth flow result
mod_download_progressMod file download progress
mods_list_updatedAfter install/delete/toggle of a mod
dependency_installingdead event pushed but never listened to in JS

API methods, grouped by feature area

AreaMethods
Profilesget_profiles, get_active_profile, set_active_profile, create_profile, delete_profile, update_profile (camelCase→snake_case key map), edit_jvm_notepad (round-trips JVM args through notepad.exe, blocks ≤300 s)
Accounts / skins / capesget_accounts, get_active_account, add_offline_account, start_microsoft_login, set_active_account, delete_account, set_skin, cache_skin_from_url, set_cape, clear_cape, get_cape_presets
Launch / consolelaunch (line 403 — full flow, see §7), get_console_log, clear_console, kill_game (terminate / SIGTERM), check_assets unused by UI
Mods / shaders / resource packssearch_content, search_mods, get_installed_mods, toggle_mod (.disabled rename), delete_mod, install_mod (returns top-10 compatible versions), download_mod_version (auto-installs required + optional Modrinth deps), get_profile_game_dir, get_installed_content / delete_content unused
Serversget_servers, add_server, ping_server (hand-rolled Minecraft Server List Ping: varint packet, protocol 47, TCP, measures ms)
Settingsget_settings, save_settings, get_version_list, get_first_launch / complete_first_launch unused
AI themesget_custom_themes, get_cerebras_key_status, set_cerebras_key, generate_custom_theme, open_theme_instructions, save_theme_to_file, import_custom_theme
Native dialogsbrowse_file, browse_folder, open_folder
Diagnosticsrun_diagnostics — Java/authlib presence, mod count, Mesa3D opengl32.dll detector ("may cause 7 FPS! Delete it."), OS + RAM info
Screenshots / backupsget_screenshots, save_edited_screenshot (base64 PNG), backup_now (zips profile saves/ → ~/.FractalLauncher/backups/), get_backups, delete_backup
Fontsget_font_presets, get_uploaded_fonts, upload_font, delete_font

3.2 game.py (1,135 lines) — install & launch engine

  • Downloads: fully delegated to minecraft-launcher-lib (SHA-1 verified, internal ThreadPool). This module adds a global requests.Session retry monkey-patch (_install_requests_retry, line 17 — 5× exponential backoff, because mll's stream=True breaks mid-iteration where request-level patching can't help), a 5-minute version-manifest cache, 3-attempt retries on install_version / install_mod_loader, and check_assets_cache() (line 240) — a pre-launch cache audit (merges inheritsFrom parents, respects library rules, dedupes asset hashes) that drives the "Shared cache" UI.
  • build_launch_options() (line 908):
    • -Xmx = -Xms = profile RAM (heap never grows)
    • Full Aikar's G1GC flag set: +UseG1GC, +DisableExplicitGC, +AlwaysPreTouch, G1NewSizePercent=30, G1MaxNewSizePercent=40, G1HeapRegionSize=16M, G1ReservePercent=20, G1HeapWastePercent=5, G1MixedGCCountTarget=4, MaxGCPauseMillis=200, InitiatingHeapOccupancyPercent=15, G1MixedGCLiveThresholdPercent=90, G1RSetUpdatingPauseTimePercent=5, SurvivorRatio=32, +PerfDisableSharedMem, MaxTenuringThreshold=1 + string dedup / OptimizeStringConcat / compressedOops
    • LWJGL software-OpenGL fallback & FML ignore-cert flags (prevents old-LWJGL "Pixel format not accelerated" crashes)
    • -javaagent:Authlib.jar=http://127.0.0.1:<port> inserted as the first JVM arg when a skin server port exists
    • Optional custom resolution; user JVM args from the profile; executablePath from config.java_path
  • Mod loaders (install_mod_loader, line 414): Fabric & Quilt via their official installer jars (maven.fabricmc.net / maven.quiltmc.org), Forge by unzipping the installer and executing its install-profile processors, NeoForge via --install-client — all run with the bundled Java, 3 retries.
  • Offline-account skin server (_SkinServer, lines 566–890): a complete local Yggdrasil / authlib-injector HTTP server on 127.0.0.1:<ephemeral> implementing / metadata (skinDomains + signaturePublickey), /skin & /cape PNGs, session/minecraft/hasJoined & /profile, and authserver/authenticate|refresh|validate|join. Textures are signed with a per-launch 4096-bit RSA keypair (SHA1withRSA / PKCS1v15) — exactly what authlib-injector expects.
  • Process launch (launch_game, line 1001): clears MC's assets/skins + assets/avatars cache so old accounts can't bleed through; starts Popen with stdout=PIPE, stderr=STDOUT, Windows ABOVE_NORMAL_PRIORITY_CLASS (0x8000) plus an extra SetPriorityClass(ABOVE_NORMAL) boost; streams stdout line-by-line to the UI via on_log; non-daemon thread so log draining finishes with the process; stops the skin server in finally.

⚠ "Hide launcher on game start" is not implemented. The hide_launcher_on_game setting is created, saved and read into settings.hideOnGame — but nothing ever hides or minimizes the window. It is currently inert.

3.3 auth.py (203 lines) — Microsoft OAuth

  • Flow: authorization-code + PKCE (not device-code). CLIENT_ID = "c36a9fb6-4f2a-41ff-90bd-ae7cc92031eb" — Prism Launcher's public Azure client ID (no Azure setup needed). Redirect: http://localhost:9876.
  • Steps: mll.microsoft_account.get_secure_login_data() → local one-shot HTTPServer on port 9876 (validates OAuth state for CSRF) → webbrowser.open(login_url) → wait ≤300 s → complete_login() performs the full internal chain: login.live.com token → Xbox Live user authenticate → XSTS authorize → api.minecraftservices.com/login_with_xbox → entitlements → profile.
  • Refresh: refresh_microsoft_token() wraps mll; triggered before every launch; failures are swallowed so launch continues with the stale token.
  • Skin helpers: _fetch_skin_url() (sessionserver textures property → base64 → skin URL) and fetch_skin_url_by_username() for offline-account previews.
  • No authlib-injector logic here — that lives in game.py (§3.2).

3.4 profiles.py (196 lines) — data model

  • @dataclass Account: id, username, auth_type (microsoft/offline), uuid, access_token, refresh_token, skin_url, skin_path, skin_model (default/slim), cape_path.
  • @dataclass Profile: id, name, version, mod_loader, mod_loader_version, account_id, ram_mb, jvm_args, game_dir, resolution_w/h, fullscreen.
  • ProfileManager persists both to ~/.FractalLauncher/profiles.json with atomic writes (tmp file + os.replace). The loader is schema-tolerant: it filters each entry to the dataclass's known fields, so older files missing new fields load fine (defaults apply) and unknown keys are dropped — that is the entire "migration" system.
  • Offline accounts get a stable fake UUID: uuid3(NAMESPACE_DNS, username), token "offline".
  • Removing an account also removes all profiles bound to it.
  • security Tokens are stored in plaintext — no keyring, no DPAPI, no encryption.

3.5 mods.py (501 lines) — Modrinth-only mod manager

  • API: https://api.modrinth.com/v2 with UA FractalLauncher/1.0 (contact@FractalLauncher.dev), 3× retry with linear backoff. No CurseForge integration and no modpack (.mrpack) support anywhere.
  • Search uses facets (project_type:mod|shader|resourcepack + MC version + loader via _LOADER_MAP); versions endpoint filtered by game_versions/loaders; downloads are streamed 64 KB chunks with progress and partial-file cleanup.
  • Dependency resolver (fetch_mod_dependencies): pulls the latest matching version's dependencies array, keeps required + optional, resolves names via /v2/project/{id}.
  • Update checker (heuristic): derives a slug from the installed filename, compares latest primary file name.
  • Mods live in each profile's own <game_dir>/mods/; enable/disable is a .disabled rename; deletes are path-traversal-guarded (_sanitize_filename + realpath prefix check).

3.6 theme.py (476 lines) + theme.py.backup

  • 20 built-in themes: Lunar (default), Cyber, Forest, Eclipse, Sun, Amber, Nebula, Matrix, Glass, Dark, Ocean, Crimson, Aurora, Grid, Abyss, Green, Pink, Onyx, Ice, Gold.
  • Each theme dict carries both full CustomTkinter keys (BG_DARK, ACCENT, TEXT_PRIMARY…) and an 11-key webview schema (bg, panel, card, accent, tp, ts, tm, ok, warn, err) that maps directly onto CSS custom properties in ui.html.
  • _set_globals(theme) injects a preset into the module's globals (the CTk live-retheme mechanism); _build_ctk_theme(theme) derives a CTk appearance dict at runtime.
  • theme.py.backup is the pre-redesign 7-theme version (Lunar-blue palette, includes the only light theme, "Slate Light"). It is imported nowhere — a dormant snapshot.

3.7 ai_theme.py (455 lines) — Cerebras LLM theme generator

  • A real LLM client, not procedural: POST https://api.cerebras.ai/v1/chat/completions (model discovery via /v1/models). Preferred models: llama3.1-8b → llama-3.3-70b → qwen-3-32b → … with automatic re-resolution and one retry if a model 404s.
  • User types "cyberpunk city at night" → system prompt demands raw JSON of exactly 18 hex keys (CTk schema) or 11 keys (webview schema) → response is fence-tolerant JSON-extracted, validated (^#[0-9a-fA-F]{6}$), missing/invalid keys filled from defaults, saved as "AI: <first 40 chars of prompt>".
  • API key deliberately stored separate from config.json: plaintext ~/.FractalLauncher/cerebras_api_key.txt. Generated themes persist to custom_themes.json / custom_themes_web.json.
  • Spoofs a Chrome User-Agent to bypass Cloudflare bot-blocking on the Cerebras API; explicit error handling for 401 / 403-Cloudflare-1010 / 404 / timeouts.

__init__.py contains only a comment — the package exports nothing; consumers import submodules directly.

SECTION 04

assets/ — the frontend

4.1 ui.html (2,417 lines, 119 KB)

100% vanilla JS + hand-written CSS — no framework, no CDN, no build step, no modules. CSS custom properties on :root (--bg, --panel, --card, --accent, --tp, --ts, --tm, --ok, --warn, --err, --border, --r, --t) are the theming engine; previewTheme() writes them onto document.documentElement.style.

Pages (14)

PageContent
pg-homeHero banner with particle canvas, loader badge, profile/account/RAM/status, install progress, profile selector, big Launch button, action cards, Recent Activity
pg-profiles / pg-accountsProfile & account lists + create/add modals
pg-skins3D skinview3d preview (WalkingAnimation, auto-rotate), upload dropzone, Classic/Slim toggle, Cape browse/presets/remove, Save to Account
pg-mods / pg-shaders / pg-resourcepacksInstalled list (left) + Modrinth search/browse with 20-per-page pagination (right), version-picker install modal with progress
pg-serversCurated builtin list (Hypixel, CubeCraft, 2b2t, Wynncraft, …) + custom servers, async latency pings, Copy IP
pg-hostingLAN/tunnel hosting guide — orphaned no nav item points to it
pg-screenshotsGrid → canvas editor modal with Crop/Blur/Draw tools
pg-backups / pg-diagnosticsBackup Now + list; Run Checks (Java, authlib, Mesa3D, RAM)
pg-consoleLog output with heuristic level coloring, Copy Log / Logs Folder / Kill Game / Clear, install progress bar
pg-settings2-column grid: language, theme (20 presets + AI custom themes + import/export base64 short codes), fonts (presets + uploads), mc dir, hide toggle, RAM slider 1024–16384, java path, authlib path, About, Save Settings

Integration details

  • All backend calls go through call('method', …) → await window.pywebview.api.method(...).
  • Python→JS events: listeners for launch_state, console_line, console_clear, install_progress, assets_cache, microsoft_login_success/error, mod_download_progress, mods_list_updated.
  • Bridge-ready lifecycle: pywebviewready handler + a 50 ms poller fallback in case the event fired before listeners attached.
  • SoundFX (lines 799–1008): a full Web Audio API synthesizer for click/pop/nav/launch/success/error sounds, wired to a global click delegation. Secret: press Ctrl+S twice quickly to mute/unmute.
  • Scroll-position saver via MutationObserver that also monkey-patches window.goto.
  • branding bug: <title> and the status bar say "ExtremeLauncher" while i18n strings and the Python window title say FractalLauncher.

4.2 i18n.js (366 lines)

One flat global I18N object, ~175–184 snake_case keys per language, no namespaces/plurals/interpolation. 7 languages: en, fr, es, pt, de, pirate 🏴‍☠️ ("Set Sail!", "Grog Allocation") and darija 🇲🇦 (Moroccan Arabic in Latin script). Switching is instant via applyLanguage(lang) which re-texts every [data-i18n] element; persistence happens only on Save Settings. About 77 keys are actually wired in the HTML; roughly half of each dictionary is unused, and the username key referenced in markup is missing from all seven dictionaries.

4.3 lib/skinview3d.bundle.js

Vendored skinview3d v3.4.2 (jsDelivr/Terser minified, embeds three.js r156), exposing the global skinview3d namespace. Used only on the Skins page.

4.4 Other assets

  • capes/*.png — 25 cape presets (Minecon 2012/2013/2015/2016, cherryblossom, coppercape, glass, portal, nightsky, TikTok, Twitch, "silly cat", …) served by get_cape_presets as file:/// images in the Cape Library grid.
  • logo.ico (230 KB) — app icon used by all build scripts.
  • CUSTOM_THEMES_SETUP.txt — help doc for the Cerebras flow (get a free key at cloud.cerebras.ai → Set API Key button or the plaintext key file → generate), opened by the Settings "Instructions" button.
SECTION 05

Build & packaging pipeline

Four build generations coexist; only the PyInstaller path has produced artifacts (the 32 MB dist/FractalLauncher.exe is present).

File(s)StrategyStatus
build_pyinstaller.py
FractalLauncher.spec
PyInstaller onefile from bootstrap.py: --collect-all for webview/PIL/cryptography/minecraft-launcher-lib, bundles assets/ (jdk & Authlib ship beside the exe), icon assets/logo.ico, UPX on, no console. current produced dist/FractalLauncher.exe (32,250,557 bytes) and the build/FractalLauncher/ work dir
build_msi.py
nsis/installer.nsi
Generates an NSIS script → makensis → per-user Setup.exe bundling exe + jdk + authlib + assets, with Start-Menu/Desktop shortcuts and Add/Remove Programs registry keys. stale the checked-in .nsi hardcodes old absolute paths E:\EL\FractalLauncher_full_fixed_v3\… and a lowercase authlib\ folder that is actually named Authlib\
build.py 3-step: PyInstaller → stage Authlib/config/jdk (+optional cloudflared.exe) → cx_Freeze bdist_msi using a dummy stub exe that just re-launches the real one; per-user %LOCALAPPDATA%\FractalLauncher install, no admin rights. alternate references nonexistent assets/icon.ico (only logo.ico exists)
build_pyoxidizer.py
pyoxidizer.bzl
PyOxidizer packaging of bootstrap.py + embedded assets. broken run_eval imports launcher.app (missing)
build_installer.bat Orchestrates build_pyinstaller.py → build_msi.py (NSIS). helper
SECTION 06

Bundled runtime data

FolderContents
jdk/ A full Oracle JDK 25.0.2 LTS for Windows x86_64 (JAVA_RUNTIME_VERSION=25.0.2+10-LTS-69) — not a trimmed JRE: includes jmods, javac, javadoc, jconsole, Graal compiler modules. Auto-discovered by all entry points (walks the tree for javaw.exe) and written into config.json → java_path.
Authlib/ Authlib.jar — the authlib-injector Java agent. Injected as -javaagent:Authlib.jar=http://127.0.0.1:<port> so the game talks to the launcher's local Yggdrasil server for offline skins. Path stored in config.json → authlib_injector_path.
config/ A pre-tuned .minecraft/config snapshot for performance mods: sodium-mixins.properties & lithium.properties (default notices), modernfix-mixins.properties (4.3 KB of mixin toggles), entityculling.json (tick culling, nametags-through-walls, whitelists for Botania/Create/Alex's Caves/Quark/BetterEnd), trender.json, transition.json.
⚠ No launcher code ever copies these into a game directory — only the MSI stages them. They are a "drop into .minecraft" optimization pack; the perf mods themselves (sodium/lithium/modernfix jars) are not auto-installed.
logs/ Actual runtime artifacts from playing this workspace's game dir (FML client logs, rotated *.log.gz, latest.log, debug.log). Not source code.
build/, dist/, __pycache__/ PyInstaller work products (PKG/PYZ/toc files, xref HTML) and stale bytecode for Python 3.12/3.13/3.14. Regenerable; not source.

User data lives outside the repo in ~/.FractalLauncher/: config.json, profiles.json, cerebras_api_key.txt, custom_themes.json / custom_themes_web.json, skins/, backups/, fonts/, launcher.log.

SECTION 07

How a launch actually flows

  1. main.py / bootstrap.py write first-run config (bundled java + authlib paths, defaults), then start the pywebview window; on loaded → API.attach(pm, window) prefetches the version manifest (5-min cache).
  2. ui.html fires pywebviewready → loads settings, custom themes, fonts → applies saved theme/language/font → loadHome().
  3. User presses Launch → call('launch') → API.launch() (bridge line 403):
    • re-entrancy guard; profile & account checks;
    • refresh Microsoft token if applicable (result written back via update_account_tokens);
    • push launch_state{launching};
    • resolve the installed version id through a 3-step search (name contains base+loader → exact profile.version → directory scan with inheritsFrom fallback);
    • push assets_cache + start install_progress tracking (sliding-window speed/ETA);
    • if missing: install vanilla (and then the mod loader) with 3× retries;
  4. game.launch_game():
    • clear MC skin/avatar caches;
    • offline account → boot _SkinServer (RSA keypair, health-check), set authlib_base_url = http://127.0.0.1:<port>;
    • build options (Aikar G1GC, authlib agent first, resolution, custom java) → mll.command.get_minecraft_command() → Popen with ABOVE_NORMAL priority;
    • stream stdout line-by-line → console_line events;
  5. On exit: launch_state{stopped, code}; skin server stopped in finally. The UI can re-fetch the whole buffer via get_console_log() or kill a running game via kill_game().
SECTION 08

External services contacted

ServiceEndpointsPurpose
Mojanglaunchermeta.mojang.com (version manifest), libraries.minecraft.net, resources.download.minecraft.net, sessionserver.mojang.com, api.mojang.comVersions, libraries, assets (all SHA-1 verified), skins/profiles
Microsoft / Xbox / Minecraft Serviceslogin.microsoftonline.com, login.live.com, user.auth.xboxlive.com, xsts.auth.xboxlive.com, api.minecraftservices.comOAuth login + token refresh + profile (via minecraft-launcher-lib)
Fabricmeta.fabricmc.net, maven.fabricmc.netLoader metadata + installer jar
Quiltmeta.quiltmc.org, maven.quiltmc.orgLoader metadata + installer jar
Forgemaven.minecraftforge.netInstaller jar + processors
NeoForgemaven.neoforged.netInstaller jar
Modrinthapi.modrinth.com/v2 (+ CDN download URLs)Mods/shaders/resourcepacks search, versions, dependencies, downloads
Cerebrasapi.cerebras.ai/v1/chat/completions, /v1/modelsAI theme generation
Loopback only127.0.0.1:9876 (OAuth redirect), 127.0.0.1:<ephemeral> (Yggdrasil skin server), raw TCP ping to game servers on :25565, UDP probe of 8.8.8.8:80 for LAN-IP discoveryLocal flows

The Cloudflare tunnel (cloudflared.exe) that once exposed the skin server publicly was removed — only build-script staging and unused tunnel_proc variables remain.

SECTION 09

Where data & secrets live

DataLocationProtection
Accounts (incl. Microsoft access + refresh tokens), profiles~/.FractalLauncher/profiles.jsonplaintext
Launcher config (java_path, authlib_injector_path, default_mc_dir, theme, servers, hide_launcher_on_game)~/.FractalLauncher/config.jsonplaintext
Cerebras AI API key~/.FractalLauncher/cerebras_api_key.txtplaintext
Custom AI themes~/.FractalLauncher/custom_themes.json, custom_themes_web.json—
Skins / backups / fonts / launcher log~/.FractalLauncher/{skins,backups,fonts}/, launcher.log—

No OS keychain, DPAPI, or Fernet/AES anywhere — the only use of the cryptography package is RSA texture-signing in game.py.

SECTION 10

Notable issues & bugs found

  1. Settings corruption (functional bug). save_settings writes the JS payload verbatim, which uses camelCase keys (javaPath, authlibPath, defaultMcDir, hideOnGame), but every reader expects snake_case (java_path, authlib_injector_path, default_mc_dir, hide_launcher_on_game). After the user saves settings once from the UI, Java/authlib/custom-game-dir preferences silently stop being honored. Additionally, save_settings overwrites config.json wholesale with only the 8 settings keys — wiping pre-existing servers, first_launch, etc.
  2. hideOnGame is inert — saved, read into settings, never used to hide/minimize anything.
  3. launcher/app.py is missing — the CTK fallbacks in main.py, bootstrap.py and pyoxidizer.bzl would crash if reached.
  4. pg-hosting is unreachable — no sidebar item, no goto('hosting').
  5. Branding mismatch — <title> and status bar say "ExtremeLauncher" (and the sidebar logo "EL") while everything else says FractalLauncher.
  6. Secrets in plaintext — MS tokens in profiles.json, Cerebras key in its own text file.
  7. Dead code: 5 unused bridge methods (check_assets, get_installed_content, delete_content, get_first_launch, complete_first_launch), duplicate _do_launch definition (bridge lines 494 & 500), unused _DownloadTracker / IncompleteReadException / _get_authlib_jvm_arg in game.py, dead dependency_installing event, restoreConsole() never called, theme.py.backup, leftover tunnel_proc variables.
  8. Stale build inputs — nsis/installer.nsi hardcodes E:\EL\FractalLauncher_full_fixed_v3\…; build.py references nonexistent assets/icon.ico; README/BUILD_INSTRUCTIONS describe nonexistent files (setup_and_run.py, Nuitka default, cloudflared auto-download).
  9. Config folder never applied — the shipped config/ optimization presets are only staged by the MSI; no launcher code copies them into a game dir, and no perf-mod jars are auto-installed.
  10. i18n gaps — the username key used in markup is missing from all 7 dictionaries; roughly half of each dictionary is unused; sidebar/mod/server/console strings are untranslated.
  11. _push() escaping only replaces ' — mostly safe because payloads are json.dumps-ed first, but it is the only sanitization before evaluate_js.
SECTION 11

Complete file map

FractalLauncherOptimizable/
├── main.py                  # Primary entry: config bootstrap + pywebview UI (fallback: CTK — broken)
├── main_webview.py          # Duplicate webview-only entry (superseded by main.py)
├── bootstrap.py             # PyInstaller exe entry: dep install, WebView2 check, logging, UI start
├── run.bat                  # python main.py with error pause
├── requirements.txt         # customtkinter, mll>=6.4, Pillow, requests, cryptography, pywebview>=4.0
├── README.md                # Outdated overview
├── BUILD_INSTRUCTIONS.md    # Outdated build docs (mentions Nuitka / cloudflared)
│
├── build_pyinstaller.py     # [CURRENT] PyInstaller onefile build → dist/FractalLauncher.exe
├── FractalLauncher.spec     # PyInstaller spec (collect-all webview/PIL/cryptography/mll)
├── build_msi.py             # NSIS installer generator (stale absolute paths in output)
├── nsis/installer.nsi       # Generated NSIS script (stale: E:\EL\... paths)
├── build.py                 # PyInstaller → stage → cx_Freeze bdist_msi (per-user, no admin)
├── build_pyoxidizer.py      # PyOxidizer build (broken: imports launcher.app)
├── pyoxidizer.bzl           # PyOxidizer config (broken run_eval)
├── build_installer.bat      # Orchestrates PyInstaller → NSIS
│
├── launcher/                # Python backend package
│   ├── __init__.py          # Comment only — no exports
│   ├── webview_bridge.py    # class API — 61-method JS bridge (1,518 lines)
│   ├── game.py              # Install/launch engine, G1GC tuning, local Yggdrasil server (1,135 lines)
│   ├── auth.py              # Microsoft OAuth2+PKCE via minecraft-launcher-lib
│   ├── profiles.py          # Account/Profile dataclasses + ProfileManager (profiles.json)
│   ├── mods.py              # Modrinth search/install/deps/updates for mods, shaders, packs
│   ├── theme.py             # 20 themes (CTk + webview schemas), _set_globals, _build_ctk_theme
│   ├── theme.py.backup      # Dormant pre-redesign 7-theme snapshot
│   └── ai_theme.py          # Cerebras LLM theme generator (plaintext key file)
│
├── assets/                  # Frontend (bundled into the exe)
│   ├── ui.html              # 2,417-line vanilla-JS launcher UI (14 pages, 8 modals)
│   ├── i18n.js              # 7-language translation dict (incl. pirate & darija)
│   ├── lib/skinview3d.bundle.js  # skinview3d v3.4.2 (embeds three.js r156)
│   ├── capes/*.png          # 25 cape preset images
│   ├── logo.ico             # App icon
│   └── CUSTOM_THEMES_SETUP.txt    # Cerebras API-key setup guide
│
├── jdk/                     # Bundled Oracle JDK 25.0.2 LTS (x86_64 Windows, full JDK)
├── Authlib/Authlib.jar      # authlib-injector agent for offline skins
├── config/                  # Shipped perf-mod configs (sodium/lithium/modernfix/entityculling/…)
│                            #   ⚠ never auto-applied by the launcher
├── logs/                    # Runtime game logs (not source)
├── build/                   # PyInstaller work artifacts (regenerable)
├── dist/FractalLauncher.exe # Built launcher, 32.2 MB
└── __pycache__/             # Stale bytecode (py3.12/3.13/3.14)

TL;DR — pywebview hosts a vanilla-JS HTML app; a 61-method Python API object does everything (Microsoft OAuth via Prism's client ID, Modrinth browsing, launches via minecraft-launcher-lib with Aikar GC tuning and ABOVE_NORMAL priority, a local Yggdrasil server + authlib-injector for offline skins, Cerebras-powered AI themes); state lives in ~/.FractalLauncher/*.json (plaintext); distribution is a 32 MB PyInstaller onefile exe + bundled Oracle JDK 25 + authlib jar, installable via NSIS or cx_Freeze MSI — with an "optimization" mod-config folder that is shipped but never auto-applied.