Skip to content

How it Works

hxgohxrr edited this page May 27, 2026 · 1 revision

Overview

EnmaPatcher patches the game by replacing files inside the installed APK. The entire process runs on-device without root.

Pipeline

On startup, EnmaPatcher checks whether `jp.co.level5.yws1` is installed using Android PackageManager. If not found, the Patch button is disabled. The app downloads `enmapatcher.cfg.json` from the configured GitHub repository. If it exists, the `appName` field is read and shown in the main screen. All other fields are ignored. Every file in the repository tree is downloaded. Each file path in the repo corresponds to an internal path inside the APK. EnmaPatcher finds the installed game APK via PackageManager. It first checks split APKs for an asset pack, then falls back to the base APK. The app opens the APK as a ZIP file and writes a new APK. For each entry, if a downloaded patch file matches that path, the patch file is used instead of the original. New files not in the original APK are appended at the end. The patched APK is signed using v1 JAR signing (JAR Manifest + PKCS7 signature). A keypair is generated automatically on first run and stored in the app's private files directory. The same keypair is reused on subsequent patches. The signed APK is saved to the app cache. Tap **Install APK **to launch the system installer, or **Share APK** to send it to another app.

Data flow

GitHub repo
    ├── enmapatcher.cfg.json   (optional — appName only)
    └── patch files            (downloaded by path)
            |
            v
    EnmaPatcherEngine
            |
            ├── locates installed APK via PackageManager
            ├── merges patch files into APK (ZIP replace)
            ├── patches app name in resources.arsc (if appName set)
            └── signs with v1 JAR signature
            |
            v
    Output APK  →  system installer / share

Permissions

Permission Reason
INTERNET Download patch files and config from GitHub
QUERY_ALL_PACKAGES Detect whether the game is installed
REQUEST_INSTALL_PACKAGES Launch the APK installer

Clone this wiki locally