# rem01gaming/encore architecture

> Architecture diagram of the GitHub repository rem01gaming/encore, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rem01gaming/encore
- Repository: https://github.com/rem01gaming/encore

## Overview

Encore Tweaks is a rooted Android gaming-performance module with a native daemon, a configurable WebUI, and a zygote/JNI hook component. The principal workflow is users configure game and device settings in the WebUI; the daemon monitors configuration and system state, then selects performance or power-saving behavior. The tree and excerpts establish key UI, watcher, and Binder-monitor links, but do not expose the full configuration-to-profile path or zygote wiring, so those relationships are omitted.

Main entry points: [`jni/InotifyHandler.cpp`](https://github.com/rem01gaming/encore/blob/main/jni/InotifyHandler.cpp) (File event handler), [`webui/src/main.js`](https://github.com/rem01gaming/encore/blob/main/webui/src/main.js) (WebUI bootstrap), [`jni/base/BinderMonitor/BinderMonitor.cpp`](https://github.com/rem01gaming/encore/blob/main/jni/base/BinderMonitor/BinderMonitor.cpp) (Binder monitor), [`jni/Main.cpp`](https://github.com/rem01gaming/encore/blob/main/jni/Main.cpp) (Profile daemon)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web configuration"]
  node_webui["WebUI bootstrap<br/>[main.js]"]
  node_app["App shell<br/>[App.vue]"]
  node_routes["Page routes<br/>[index.js]"]
  node_game_views["Game controls"]
  node_settings_views["Device settings"]
  node_ui_stores["UI state stores"]
  node_kernelsu["Root bridge<br/>[KernelSU.js]"]
end

subgraph group_daemon["Runtime daemon"]
  node_daemon_main["Profile daemon<br/>[Main.cpp]"]
  node_config_store[("Config store")]
  node_mitigation_store[("Mitigation store")]
  node_watch_handler["File event handler<br/>[InotifyHandler.cpp]"]
  node_watcher["Inotify watcher<br/>[InotifyWatcher.cpp]"]
  node_game_registry["Game registry<br/>[GameRegistry.cpp]"]
  node_profiler["Profiler<br/>[Profiler.cpp]"]
  node_device_info["Device information<br/>[DeviceInfo.cpp]"]
end

subgraph group_system["Android integration"]
  node_binder_monitor["Binder monitor<br/>[BinderMonitor.cpp]"]
  node_binder_ndk["Binder NDK<br/>[BinderNDK.cpp]"]
end

subgraph group_zygote["Zygote hooks"]
  node_java_hooker["Java hook engine<br/>[JavaHooker.java]"]
  node_zygote_entry["Zygote entry<br/>[Main.cpp]"]
  node_jni_helper["JNI utilities<br/>[JniHelper.hpp]"]
end

node_user(("Device user"))
node_android_services["Android services"]

node_user -->|"configures"| node_webui
node_webui -->|"mounts"| node_app
node_app -->|"renders"| node_routes
node_user -.->|"manages games"| node_game_views
node_user -.->|"sets preferences"| node_settings_views
node_game_views -.->|"uses state"| node_ui_stores
node_settings_views -.->|"uses state"| node_ui_stores
node_webui -->|"checks root"| node_kernelsu
node_daemon_main -->|"initializes"| node_binder_monitor
node_binder_monitor -->|"queries"| node_android_services
node_binder_monitor -->|"uses Binder API"| node_binder_ndk
node_daemon_main -.->|"configures watching"| node_watch_handler
node_watch_handler -->|"registers watches"| node_watcher
node_watch_handler -->|"reloads games"| node_game_registry
node_watch_handler -->|"reloads config"| node_config_store
node_watch_handler -->|"reloads mitigation"| node_mitigation_store
node_zygote_entry -.->|"loads hooks"| node_java_hooker
node_java_hooker -.->|"uses JNI"| node_jni_helper

click node_webui "https://github.com/rem01gaming/encore/blob/main/webui/src/main.js"
click node_app "https://github.com/rem01gaming/encore/blob/main/webui/src/App.vue"
click node_routes "https://github.com/rem01gaming/encore/blob/main/webui/src/router/index.js"
click node_game_views "https://github.com/rem01gaming/encore/tree/main/webui/src/views"
click node_settings_views "https://github.com/rem01gaming/encore/tree/main/webui/src/views"
click node_ui_stores "https://github.com/rem01gaming/encore/tree/main/webui/src/stores"
click node_kernelsu "https://github.com/rem01gaming/encore/blob/main/webui/src/helpers/KernelSU.js"
click node_daemon_main "https://github.com/rem01gaming/encore/blob/main/jni/Main.cpp"
click node_config_store "https://github.com/rem01gaming/encore/blob/main/jni/EncoreConfigStore.cpp"
click node_mitigation_store "https://github.com/rem01gaming/encore/blob/main/jni/DeviceMitigationStore.cpp"
click node_watch_handler "https://github.com/rem01gaming/encore/blob/main/jni/InotifyHandler.cpp"
click node_watcher "https://github.com/rem01gaming/encore/blob/main/jni/base/InotifyWatcher/InotifyWatcher.cpp"
click node_game_registry "https://github.com/rem01gaming/encore/blob/main/jni/base/GameRegistry/GameRegistry.cpp"
click node_profiler "https://github.com/rem01gaming/encore/blob/main/jni/Profiler.cpp"
click node_device_info "https://github.com/rem01gaming/encore/blob/main/jni/base/DeviceInfo/DeviceInfo.cpp"
click node_binder_monitor "https://github.com/rem01gaming/encore/blob/main/jni/base/BinderMonitor/BinderMonitor.cpp"
click node_binder_ndk "https://github.com/rem01gaming/encore/blob/main/jni/base/BinderNDK/BinderNDK.cpp"
click node_java_hooker "https://github.com/rem01gaming/encore/blob/main/zygote/app/src/main/java/com/rem01gaming/encore/JavaHooker.java"
click node_zygote_entry "https://github.com/rem01gaming/encore/blob/main/zygote/app/src/main/cpp/Main.cpp"
click node_jni_helper "https://github.com/rem01gaming/encore/blob/main/zygote/app/src/main/cpp/external/jnihelper/include/JniHelper.hpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webui,node_app,node_routes,node_game_views,node_settings_views,node_ui_stores,node_kernelsu,node_user toneBlue
class node_daemon_main,node_config_store,node_mitigation_store,node_watch_handler,node_watcher,node_game_registry,node_profiler,node_device_info toneAmber
class node_binder_monitor,node_binder_ndk toneMint
class node_java_hooker,node_zygote_entry,node_jni_helper toneRose
class node_android_services toneIndigo
```

## Components

### Web configuration

- [WebUI bootstrap](https://github.com/rem01gaming/encore/blob/main/webui/src/main.js): `webui/src/main.js`
- [App shell](https://github.com/rem01gaming/encore/blob/main/webui/src/App.vue): `webui/src/App.vue`
- [Page routes](https://github.com/rem01gaming/encore/blob/main/webui/src/router/index.js): `webui/src/router/index.js`
- [Game controls](https://github.com/rem01gaming/encore/tree/main/webui/src/views): `webui/src/views`
- [Device settings](https://github.com/rem01gaming/encore/tree/main/webui/src/views): `webui/src/views`
- [UI state stores](https://github.com/rem01gaming/encore/tree/main/webui/src/stores): `webui/src/stores`
- [Root bridge](https://github.com/rem01gaming/encore/blob/main/webui/src/helpers/KernelSU.js): `webui/src/helpers/KernelSU.js`

### Runtime daemon

- [Profile daemon](https://github.com/rem01gaming/encore/blob/main/jni/Main.cpp): `jni/Main.cpp`
- [Config store](https://github.com/rem01gaming/encore/blob/main/jni/EncoreConfigStore.cpp): `jni/EncoreConfigStore.cpp`
- [Mitigation store](https://github.com/rem01gaming/encore/blob/main/jni/DeviceMitigationStore.cpp): `jni/DeviceMitigationStore.cpp`
- [File event handler](https://github.com/rem01gaming/encore/blob/main/jni/InotifyHandler.cpp): `jni/InotifyHandler.cpp`
- [Inotify watcher](https://github.com/rem01gaming/encore/blob/main/jni/base/InotifyWatcher/InotifyWatcher.cpp): `jni/base/InotifyWatcher/InotifyWatcher.cpp`
- [Game registry](https://github.com/rem01gaming/encore/blob/main/jni/base/GameRegistry/GameRegistry.cpp): `jni/base/GameRegistry/GameRegistry.cpp`
- [Profiler](https://github.com/rem01gaming/encore/blob/main/jni/Profiler.cpp): `jni/Profiler.cpp`
- [Device information](https://github.com/rem01gaming/encore/blob/main/jni/base/DeviceInfo/DeviceInfo.cpp): `jni/base/DeviceInfo/DeviceInfo.cpp`

### Android integration

- [Binder monitor](https://github.com/rem01gaming/encore/blob/main/jni/base/BinderMonitor/BinderMonitor.cpp): `jni/base/BinderMonitor/BinderMonitor.cpp`
- [Binder NDK](https://github.com/rem01gaming/encore/blob/main/jni/base/BinderNDK/BinderNDK.cpp): `jni/base/BinderNDK/BinderNDK.cpp`

### Zygote hooks

- [Java hook engine](https://github.com/rem01gaming/encore/blob/main/zygote/app/src/main/java/com/rem01gaming/encore/JavaHooker.java): `zygote/app/src/main/java/com/rem01gaming/encore/JavaHooker.java`
- [Zygote entry](https://github.com/rem01gaming/encore/blob/main/zygote/app/src/main/cpp/Main.cpp): `zygote/app/src/main/cpp/Main.cpp`
- [JNI utilities](https://github.com/rem01gaming/encore/blob/main/zygote/app/src/main/cpp/external/jnihelper/include/JniHelper.hpp): `zygote/app/src/main/cpp/external/jnihelper/include/JniHelper.hpp`

### Other components

- **Device user**
- **Android services**

## Connections

- Device user → WebUI bootstrap: configures (evidence: `README.md`)
- WebUI bootstrap → App shell: mounts (evidence: `webui/src/main.js`)
- App shell → Page routes: renders (evidence: `webui/src/App.vue`)
- Device user → Game controls: manages games (evidence: `README.md`)
- Device user → Device settings: sets preferences (evidence: `README.md`)
- Game controls → UI state stores: uses state
- Device settings → UI state stores: uses state
- WebUI bootstrap → Root bridge: checks root (evidence: `webui/src/main.js`)
- Profile daemon → Binder monitor: initializes (evidence: `jni/Main.cpp`)
- Binder monitor → Android services: queries (evidence: `jni/base/BinderMonitor/BinderMonitor.cpp`)
- Binder monitor → Binder NDK: uses Binder API (evidence: `jni/base/BinderMonitor/BinderMonitor.cpp`)
- Profile daemon → File event handler: configures watching
- File event handler → Inotify watcher: registers watches (evidence: `jni/InotifyHandler.cpp`)
- File event handler → Game registry: reloads games (evidence: `jni/InotifyHandler.cpp`)
- File event handler → Config store: reloads config (evidence: `jni/InotifyHandler.cpp`)
- File event handler → Mitigation store: reloads mitigation (evidence: `jni/InotifyHandler.cpp`)
- Zygote entry → Java hook engine: loads hooks
- Java hook engine → JNI utilities: uses JNI
