LeviLaunchroid Documentation

repository·main·Indexed 19 days ago

https://github.com/liteldev/levilaunchroid

Documentation for LeviLauncher, a lightweight open-source Android launcher for Minecraft: Bedrock Edition. It features APK import for installation-free launching, multi-version management, Xbox account switching, and a native C++ modding API. The API supports native .so module loading, a typed configuration system via ConfigFile, function detouring with a Hook API, and touch/key/mouse event handling through the Input API.

Tokens
15K
Snippets
39
Records
74
Agent score
65%

What's inside LeviLaunchroid

  1. Overview of LeviLauncher features

    main

    LeviLauncher is a lightweight Android launcher for Minecraft: Bedrock Edition (MCBE) that provides:

    • APK Import & Installation-Free Launching: Run your official Minecraft APK directly without system installation.
    • SO Module Loading: Load external native .so modules to enhance features or performance.
    • Multi-Version Management: Manage multiple Minecraft versions with complete isolation of configurations and data.
    • Xbox Account Management: Seamlessly switch between multiple Xbox accounts.
    • Resource Pack & World Management: Built-in tools to import, export, and back up resource packs and worlds.
  2. Overview of LeviLauncher

    main
    LeviLauncher is a lightweight Android launcher designed for legitimate Minecraft Bedrock Edition players. It provides a workflow for importing official Minecraft installations, managing isolated game versions, switching between multiple Xbox accounts, and organizing game content like worlds and resource packs. It also provides a Preloader API for developers to extend the game with native modules.
  3. Key features of LeviLauncher

    main

    LeviLauncher provides several core capabilities for managing Minecraft Bedrock on Android:

    • Official game support: Requires the official Google Play version of Minecraft.
    • Version isolation: Allows keeping multiple game versions and their associated data separated.
    • Content management: Tools to import, export, back up, and organize worlds, resource packs, and launcher data.
    • Account switching: Support for managing and switching between multiple Xbox accounts before launching the game.
    • Quick Launch: Support for URI actions to open specific Minecraft screens, connect to servers, or load worlds faster.
    • Native mod support: A Preloader API for developers to load native .so modules, receive input callbacks, install hooks, and apply patches.
  4. Use Quick Launch for direct game actions

    main

    The Quick Launch feature utilizes Minecraft URI actions to bypass standard menus and jump directly into specific workflows. Supported actions include:

    • Opening specific game screens
    • Connecting to a server
    • Adding a new server
    • Joining a Realm
    • Loading a local world
    • Executing commands
  5. Minecraft requirements and version support

    main

    LeviLauncher requires the official Minecraft Bedrock Edition app installed via Google Play.

    Key Constraints:

    • License: The launcher does not provide a Minecraft license; you must own the game.
    • Minimum Version: The app currently rejects Minecraft versions older than 1.21.80.
    • Installation Source: Minecraft must be installed from an official source. If it is installed from an unsupported source or is too old, the launcher may fail to start the game.
  6. How ConfigFile load and update behavior works

    main

    The ConfigFile<T>::load() method performs a merge between your C++ defaults and the existing JSON file on disk:

    1. Initialization: Starts with the C++ default values defined in your struct.
    2. Merging: Merges existing JSON values into that default layout.
    3. Missing Files: If no config file exists, one is created automatically.
    4. New Fields: If you add a field to your C++ struct, it is added to the JSON with the C++ default.
    5. Preservation: Existing user values are kept if they can be successfully deserialized.
    6. Version Reset: The version field is always forced back to the C++ default value.
    7. Normalization: Malformed or incomplete files are normalized and written back to disk. Unknown keys in the JSON that do not exist in the C++ struct are removed.
  7. C++ Native Mod Lifecycle and API Overview

    main

    This example demonstrates the recommended patterns for creating a native C++ mod in LeviLaunchroid. Key components include:

    • Lifecycle Registration: Use PL_REGISTER_MOD to bind a C++ lifecycle object.
    • Self-Reference: Access the current mod instance using ll::mod::NativeMod::current(), typically cached as mSelf.
    • Typed Configuration: Use pl::config::ConfigFile<T> to handle JSON-based configuration with type safety. This allows for easy persistence of settings.
    • Mod Menu Integration: Use pl::modmenu::ModuleBuilder to register modules that appear in the in-game Mod Menu.
    • HUD Button Integration: Use pl::modmenu::ButtonBuilder to register external HUD buttons. These buttons can be customized with various icon formats and sizes:
      • .pngIcon(...) for PNG files.
      • .webpIcon(...) for WebP files.
      • .svgIcon(...) for SVG files (often used with accent style presets).
      • .sizeScale(width, height) to adjust the keycap surface size (e.g., .sizeScale(2.0f, 1.0f) for wider buttons).

    Manifest Configuration

    For native mods, the manifest.json must use type: preload-native and specify the correct entry point (the compiled .so file).

  8. Choose and Launch a Minecraft Version

    main

    Once the launcher and Minecraft are installed, follow these steps to start the game:

    1. Open LeviLauncher.
    2. Navigate to the version or instance screen.
    3. Select the specific Minecraft version you wish to run.
    4. Version Isolation: If you are launching an imported version and want to keep its data separate from your main installation, ensure you enable version isolation.
    5. Return to the launch screen and press Launch.

    Troubleshooting: If the launch fails, open the launch log from the failure screen to identify the reported reason before modifying your settings.

  9. Cleanup Mod Menu UI elements

    main

    If your UI elements (modules, buttons, or overlays) are temporary or should only exist while the mod is enabled, you must clean them up in your disable() lifecycle method. Use the following functions:

    • pl::modmenu::unregisterModule()
    • pl::modmenu::unregisterButton()