├── version ├── module ├── webroot │ └── .placeholder ├── system │ └── bin │ │ └── .placeholder ├── META-INF │ └── com │ │ └── google │ │ └── android │ │ ├── updater-script │ │ └── update-binary ├── module.prop ├── cleanup.sh ├── uninstall.sh ├── action.sh ├── verify.sh └── service.sh ├── .github ├── scripts │ ├── .shellcheckrc │ ├── gen_sha256sum.sh │ ├── telegram_bot.sh │ └── compile_zip.sh ├── ISSUE_TEMPLATE │ ├── custom.yml │ ├── feature_request.yml │ └── bug_report.yml └── workflows │ ├── deploy-website.yml │ └── build.yml ├── .gitignore ├── webui ├── src │ ├── public │ │ ├── icon.webp │ │ ├── encore_happy.avif │ │ ├── encore_sleeping.avif │ │ └── config.json │ ├── scripts │ │ ├── block_copy.js │ │ └── language.js │ ├── locales │ │ ├── languages.json │ │ └── strings │ │ │ ├── zh_CN.json │ │ │ ├── ko.json │ │ │ ├── ja.json │ │ │ ├── ar.json │ │ │ ├── uk.json │ │ │ ├── jv.json │ │ │ ├── vi.json │ │ │ ├── en.json │ │ │ ├── pt_BR.json │ │ │ ├── id.json │ │ │ ├── ru.json │ │ │ ├── es.json │ │ │ └── tr.json │ └── styles │ │ └── index.css ├── vite.config.js ├── package.json ├── .gitignore └── tailwind.config.js ├── website ├── docs │ ├── public │ │ ├── logo.avif │ │ ├── logo.webp │ │ ├── favicon.png │ │ ├── ogp │ │ │ └── default.webp │ │ ├── android-crhome.png │ │ ├── apple-touch-icon.png │ │ ├── Screenshot_20250520-161223_MMRL.avif │ │ ├── robots.txt │ │ └── api │ │ │ └── update.json │ ├── .vitepress │ │ ├── theme │ │ │ ├── index.js │ │ │ └── custom.css │ │ └── config.mjs │ ├── download │ │ ├── version │ │ │ ├── 1.8.md │ │ │ ├── 2.0.md │ │ │ ├── 3.1.md │ │ │ ├── 1.5.md │ │ │ ├── 2.7.md │ │ │ ├── 3.0.md │ │ │ ├── 2.3.md │ │ │ ├── 2.4.md │ │ │ ├── 4.1.md │ │ │ ├── 4.5.md │ │ │ ├── 1.6.md │ │ │ ├── 1.7.md │ │ │ ├── 3.7.md │ │ │ ├── 2.2.md │ │ │ ├── 4.0.md │ │ │ ├── 4.4.md │ │ │ ├── 4.2.md │ │ │ ├── 3.9.md │ │ │ ├── 2.6.md │ │ │ ├── 2.8.md │ │ │ ├── 4.3.md │ │ │ ├── 2.1.md │ │ │ ├── 3.4.md │ │ │ ├── 3.2.md │ │ │ ├── 3.5.md │ │ │ ├── 3.8.md │ │ │ ├── 3.6.md │ │ │ └── 3.3.md │ │ └── index.md │ ├── index.md │ └── guide │ │ ├── addon.md │ │ ├── webui-and-configuration.md │ │ ├── what-is-encore-tweaks.md │ │ └── faq.md ├── package.json └── .gitignore ├── jni ├── Application.mk ├── src │ ├── Android.mk │ ├── Dumpsys │ │ ├── Android.mk │ │ └── Dumpsys.hpp │ ├── EncoreCLI │ │ ├── Android.mk │ │ ├── EncoreCLI.hpp │ │ └── EncoreCLI.cpp │ ├── GameRegistry │ │ ├── Android.mk │ │ └── GameRegistry.hpp │ ├── EncoreConfig │ │ ├── Android.mk │ │ ├── EncoreConfig.hpp │ │ ├── InotifyHandler.cpp │ │ └── EncoreConfigStore.hpp │ └── EncoreUtility │ │ ├── Android.mk │ │ ├── ProcessUtility.cpp │ │ ├── FileUtility.cpp │ │ ├── MiscUtility.cpp │ │ ├── EncoreUtility.hpp │ │ └── Profiler.cpp ├── README.md ├── Android.mk ├── include │ ├── Encore.hpp │ ├── Write2File.hpp │ ├── ShellUtility.hpp │ ├── ModuleProperty.hpp │ ├── PIDTracker.hpp │ └── EncoreLog.hpp └── .clang-format ├── .gitmodules ├── changelog.md ├── docs ├── README_zh-CN.md └── README_id-ID.md ├── README.md ├── scripts └── encore_utility.sh └── NOTICE.md /version: -------------------------------------------------------------------------------- 1 | 4.6 2 | -------------------------------------------------------------------------------- /module/webroot/.placeholder: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /module/system/bin/.placeholder: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/scripts/.shellcheckrc: -------------------------------------------------------------------------------- 1 | shell=bash 2 | -------------------------------------------------------------------------------- /module/META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.zip 2 | obj/ 3 | libs/ 4 | .idea/ 5 | .vscode/ 6 | -------------------------------------------------------------------------------- /webui/src/public/icon.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rem01Gaming/encore/HEAD/webui/src/public/icon.webp -------------------------------------------------------------------------------- /website/docs/public/logo.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rem01Gaming/encore/HEAD/website/docs/public/logo.avif -------------------------------------------------------------------------------- /website/docs/public/logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rem01Gaming/encore/HEAD/website/docs/public/logo.webp -------------------------------------------------------------------------------- /website/docs/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rem01Gaming/encore/HEAD/website/docs/public/favicon.png -------------------------------------------------------------------------------- /jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := all 2 | APP_STL := c++_static 3 | APP_OPTIM := release 4 | APP_PLATFORM := android-24 5 | -------------------------------------------------------------------------------- /webui/src/public/encore_happy.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rem01Gaming/encore/HEAD/webui/src/public/encore_happy.avif -------------------------------------------------------------------------------- /website/docs/public/ogp/default.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rem01Gaming/encore/HEAD/website/docs/public/ogp/default.webp -------------------------------------------------------------------------------- /webui/src/public/encore_sleeping.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rem01Gaming/encore/HEAD/webui/src/public/encore_sleeping.avif -------------------------------------------------------------------------------- /website/docs/public/android-crhome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rem01Gaming/encore/HEAD/website/docs/public/android-crhome.png -------------------------------------------------------------------------------- /website/docs/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rem01Gaming/encore/HEAD/website/docs/public/apple-touch-icon.png -------------------------------------------------------------------------------- /website/docs/.vitepress/theme/index.js: -------------------------------------------------------------------------------- 1 | import DefaultTheme from 'vitepress/theme' 2 | import './custom.css' 3 | 4 | export default DefaultTheme 5 | -------------------------------------------------------------------------------- /webui/src/public/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "backHandler": false, 3 | "exitConfirm": false, 4 | "title": "Encore Tweaks", 5 | "icon": "icon.webp" 6 | } -------------------------------------------------------------------------------- /website/docs/public/Screenshot_20250520-161223_MMRL.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rem01Gaming/encore/HEAD/website/docs/public/Screenshot_20250520-161223_MMRL.avif -------------------------------------------------------------------------------- /website/docs/public/robots.txt: -------------------------------------------------------------------------------- 1 | # Hi! are you a robot? 2 | 3 | User-agent: * 4 | Disallow: /download/version/* 5 | Allow: / 6 | 7 | Sitemap: https://encore.rem01gaming.dev/sitemap.xml 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "jni/external/spdlog"] 2 | path = jni/external/spdlog 3 | url = https://github.com/gabime/spdlog.git 4 | [submodule "jni/external/rapidjson"] 5 | path = jni/external/rapidjson 6 | url = https://github.com/Tencent/rapidjson.git 7 | -------------------------------------------------------------------------------- /website/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "vitepress": "^1.6.4" 4 | }, 5 | "scripts": { 6 | "dev": "vitepress dev docs", 7 | "build": "vitepress build docs", 8 | "preview": "vitepress preview docs" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /jni/src/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | include $(LOCAL_PATH)/Dumpsys/Android.mk $(LOCAL_PATH)/EncoreCLI/Android.mk $(LOCAL_PATH)/GameRegistry/Android.mk $(LOCAL_PATH)/EncoreConfig/Android.mk $(LOCAL_PATH)/EncoreUtility/Android.mk 6 | -------------------------------------------------------------------------------- /.github/scripts/gen_sha256sum.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | generate_checksum() { 4 | sha256sum "$1" | awk '{print $1}' >"$1.sha256" 5 | echo "Generated checksum for: $1" 6 | } 7 | 8 | find "$1" -type f | while IFS= read -r file; do 9 | generate_checksum "$file" 10 | done 11 | -------------------------------------------------------------------------------- /module/module.prop: -------------------------------------------------------------------------------- 1 | id=encore 2 | name=Encore Tweaks 3 | version= 4 | versionCode= 5 | author=Rem01Gaming 6 | description=Special performance module for your Device. 7 | updateJson=https://encore.rem01gaming.dev/api/update.json 8 | banner=https://encore.rem01gaming.dev/ogp/default.webp 9 | -------------------------------------------------------------------------------- /webui/src/scripts/block_copy.js: -------------------------------------------------------------------------------- 1 | function killCopy(e){ 2 | return false; 3 | } 4 | 5 | function reEnable(){ 6 | return true; 7 | } 8 | 9 | document.onselectstart=new Function ("return false"); 10 | if (window.sidebar){ 11 | document.onmousedown=killCopy; 12 | document.onclick=reEnable; 13 | } 14 | -------------------------------------------------------------------------------- /module/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # shellcheck disable=SC2016 3 | 4 | MODULE_DIR="/data/adb/modules/encore" 5 | THIS_SCRIPT="/data/adb/service.d/.encore_cleanup.sh" 6 | 7 | if [ ! -d "$MODULE_DIR/disable" ]; then 8 | cat "$MODULE_DIR/module.prop.orig" >"$MODULE_DIR/module.prop" 9 | rm -f "$THIS_SCRIPT" 10 | fi 11 | -------------------------------------------------------------------------------- /website/docs/public/api/update.json: -------------------------------------------------------------------------------- 1 | { 2 | "versionCode": 1080, 3 | "version": "4.6 (1080-2fa4940-release)", 4 | "zipUrl": "https://github.com/Rem01Gaming/encore/releases/download/4.6/encore-4.6-1080-2fa4940-release.zip", 5 | "changelog": "https://raw.githubusercontent.com/Rem01Gaming/encore/refs/heads/main/changelog.md" 6 | } 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.yml: -------------------------------------------------------------------------------- 1 | name: Custom issue template 2 | description: WARNING! If you are reporting a bug but use this template, the issue will be closed directly. 3 | title: '[Custom]' 4 | body: 5 | - type: textarea 6 | id: description 7 | attributes: 8 | label: "Describe your problem." 9 | validations: 10 | required: true 11 | 12 | -------------------------------------------------------------------------------- /webui/src/locales/languages.json: -------------------------------------------------------------------------------- 1 | { 2 | "ar": "العربية", 3 | "en": "English", 4 | "es": "Español", 5 | "id": "Bahasa Indonesia", 6 | "pt_BR": "Português (Brasil)", 7 | "ru": "Русский", 8 | "uk": "Українська", 9 | "ja": "日本語", 10 | "jv": "Basa Jawa", 11 | "vi": "Tiếng Việt", 12 | "zh_CN": "简体中文", 13 | "tr": "Türkçe", 14 | "ko": "한국어" 15 | } 16 | -------------------------------------------------------------------------------- /jni/src/Dumpsys/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | ROOT_PATH := $(call my-dir)/../.. 3 | 4 | include $(CLEAR_VARS) 5 | LOCAL_MODULE := Dumpsys 6 | 7 | LOCAL_SRC_FILES := Dumpsys.cpp 8 | 9 | LOCAL_C_INCLUDES := $(ROOT_PATH)/include 10 | 11 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 12 | 13 | LOCAL_CPPFLAGS += -fexceptions -std=c++23 -O0 14 | LOCAL_CPPFLAGS += -Wpedantic -Wall -Wextra -Werror -Wformat -Wuninitialized 15 | 16 | include $(BUILD_STATIC_LIBRARY) 17 | -------------------------------------------------------------------------------- /jni/src/EncoreCLI/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | ROOT_PATH := $(call my-dir)/../.. 3 | 4 | include $(CLEAR_VARS) 5 | LOCAL_MODULE := EncoreCLI 6 | 7 | LOCAL_SRC_FILES := EncoreCLI.cpp 8 | 9 | LOCAL_STATIC_LIBRARIES := GameRegistry 10 | 11 | LOCAL_C_INCLUDES := \ 12 | $(ROOT_PATH)/include \ 13 | $(ROOT_PATH)/external/spdlog/include 14 | 15 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 16 | 17 | LOCAL_CPPFLAGS += -fexceptions -std=c++23 -O0 18 | LOCAL_CPPFLAGS += -Wpedantic -Wall -Wextra -Werror -Wformat -Wuninitialized 19 | 20 | include $(BUILD_STATIC_LIBRARY) 21 | -------------------------------------------------------------------------------- /module/META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | umask 022 3 | ui_print() { echo "$1"; } 4 | require_new_magisk() { 5 | ui_print "*******************************" 6 | ui_print " Please install Magisk v20.4+! " 7 | ui_print "*******************************" 8 | exit 1 9 | } 10 | OUTFD=$2 11 | ZIPFILE=$3 12 | mount /data 2>/dev/null 13 | if ! [ -f /data/adb/magisk/util_functions.sh ]; then 14 | require_new_magisk 15 | fi 16 | . /data/adb/magisk/util_functions.sh 17 | if [ $MAGISK_VER_CODE -lt 20400 ]; then 18 | require_new_magisk 19 | fi 20 | install_module 21 | exit 0 -------------------------------------------------------------------------------- /jni/src/GameRegistry/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | ROOT_PATH := $(call my-dir)/../.. 3 | 4 | include $(CLEAR_VARS) 5 | LOCAL_MODULE := GameRegistry 6 | 7 | LOCAL_SRC_FILES := GameRegistry.cpp 8 | 9 | LOCAL_C_INCLUDES := \ 10 | $(ROOT_PATH)/include \ 11 | $(ROOT_PATH)/external/rapidjson/include \ 12 | $(ROOT_PATH)/external/spdlog/include 13 | 14 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 15 | 16 | LOCAL_CPPFLAGS += -fexceptions -std=c++23 -O0 17 | LOCAL_CPPFLAGS += -Wpedantic -Wall -Wextra -Werror -Wformat -Wuninitialized 18 | 19 | include $(BUILD_STATIC_LIBRARY) 20 | -------------------------------------------------------------------------------- /webui/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite" 2 | import mkcert from "vite-plugin-mkcert"; 3 | import tailwind from "tailwindcss"; 4 | import autoprefixer from "autoprefixer"; 5 | import { ViteMinifyPlugin } from 'vite-plugin-minify'; 6 | 7 | export default defineConfig({ 8 | root: './src', 9 | plugins: [ 10 | ViteMinifyPlugin({}), 11 | mkcert(), 12 | ], 13 | server : { 14 | https: true, 15 | proxy: {}, 16 | }, 17 | css: { 18 | postcss: { 19 | plugins: [tailwind, autoprefixer], 20 | } 21 | }, 22 | build: { 23 | outDir: '../dist', 24 | }, 25 | }) 26 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | ## Encore Tweaks 4.6 2 | 3 | **Thanks for using Encore Tweaks!** 4 | 5 | Your continued support keeps this project going. If you enjoy the improvements and want to see more features in the future, [consider supporting the developer with a small donation](https://t.me/rem01schannel/670). Every bit helps! 6 | 7 | ### Changelog 8 | 9 | - Refactor and design changes on the WebUI 10 | - Implement WebUI X API for file read/write 11 | - WebUI translation updates 12 | - Exposes Encore's logging system to other processes/module 13 | - Add sanity check for dumpsys 14 | - Other misc changes and optimizations 15 | -------------------------------------------------------------------------------- /jni/README.md: -------------------------------------------------------------------------------- 1 | # Encore Tweaks Daemon 2 | 3 | Before you digging into this code thinking this is some kind of scheduling module like Uperf, it's not. Encore Tweaks is a profile-style performance module, it simply applies performance tweaks as profiles and do not dinamically control the scheduling and frequencies. 4 | 5 | Encore Tweaks works by using information such as: 6 | - Currently running app (window focussed) 7 | - Screen state, whenever it's awake or not and... 8 | - Battery saver state (yes the ones on your qs) 9 | 10 | ## Workflow diagram 11 | 12 | ![Workflow diagram of Encore Tweaks daemon](./diagram.svg) 13 | -------------------------------------------------------------------------------- /webui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "encore-tweaks", 3 | "version": "1.0.0", 4 | "author": "Rem01Gaming", 5 | "license": "Apache-2.0", 6 | "type": "module", 7 | "scripts": { 8 | "dev": "vite", 9 | "build": "vite build --emptyOutDir" 10 | }, 11 | "devDependencies": { 12 | "autoprefixer": "^10.4.21", 13 | "daisyui": "^4.12.24", 14 | "postcss": "^8.5.6", 15 | "svgo": "^3.3.2", 16 | "tailwindcss": "^3.4.18", 17 | "vite": "^6.3.6", 18 | "vite-plugin-minify": "^2.1.0", 19 | "vite-plugin-mkcert": "^1.17.8" 20 | }, 21 | "dependencies": { 22 | "kernelsu": "^1.0.6" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /website/docs/download/version/1.8.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 1.8 7 | 8 | ## Changelog 9 | - **[HOTFIX]** Fix DRAM and CPU Bus frequency scaling for some Snapdragon devices 10 | - Add encore logo on shell notification 11 | 12 | ## Download 13 | - [Download](https://en.shrinke.me/MTq5m) 14 | - [Download (Alternative link)](https://sfl.gl/BRQMZ) 15 | - [Telegram Channel](https://rem01schannel.t.me) 16 | 17 | ::: tip Support our project 18 | Please consider support our project by not sharing direct module file 19 | ::: 20 | -------------------------------------------------------------------------------- /.github/scripts/telegram_bot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | msg="*$TITLE* 4 | \\#ci\\_$VERSION 5 | \`\`\` 6 | $COMMIT_MESSAGE 7 | \`\`\` 8 | [Commit]($COMMIT_URL) 9 | [Workflow run]($RUN_URL) 10 | " 11 | 12 | file="$1" 13 | thumbnail="$GITHUB_WORKSPACE/website/docs/public/logo.webp" 14 | 15 | if [ ! -f "$file" ]; then 16 | echo "error: File not found" >&2 17 | exit 1 18 | fi 19 | 20 | curl -s "https://api.telegram.org/bot$BOT_TOKEN/sendDocument" \ 21 | -F document=@"$file" \ 22 | -F chat_id="$CHAT_ID" \ 23 | -F "disable_web_page_preview=true" \ 24 | -F "parse_mode=markdownv2" \ 25 | -F thumb=@"$thumbnail" \ 26 | -F caption="$msg" 27 | -------------------------------------------------------------------------------- /jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE := encored 5 | 6 | LOCAL_C_INCLUDES := \ 7 | $(LOCAL_PATH)/include \ 8 | $(LOCAL_PATH)/external/rapidjson/include \ 9 | $(LOCAL_PATH)/external/spdlog/include 10 | 11 | LOCAL_STATIC_LIBRARIES := Dumpsys EncoreCLI GameRegistry EncoreConfig EncoreUtility 12 | 13 | LOCAL_SRC_FILES := Main.cpp 14 | 15 | LOCAL_CPPFLAGS += -fexceptions -std=c++23 -O0 -flto 16 | LOCAL_CPPFLAGS += -Wpedantic -Wall -Wextra -Werror -Wformat -Wuninitialized 17 | 18 | LOCAL_LDFLAGS += -flto 19 | 20 | include $(BUILD_EXECUTABLE) 21 | 22 | include $(LOCAL_PATH)/src/Android.mk 23 | -------------------------------------------------------------------------------- /webui/src/styles/index.css: -------------------------------------------------------------------------------- 1 | @import url('https://mui.kernelsu.org/internal/insets.css'); 2 | @import url('https://mui.kernelsu.org/internal/colors.css'); 3 | 4 | @tailwind base; 5 | @tailwind components; 6 | @tailwind utilities; 7 | 8 | .root_layout { 9 | padding-top: var(--window-inset-top, 0px); 10 | padding-bottom: var(--window-inset-bottom, 0px); 11 | } 12 | 13 | .card_border { 14 | border: 1px solid color-mix(in srgb, var(--outline) 12%, transparent); 15 | } 16 | 17 | html.modal-open { 18 | overflow: hidden; 19 | } 20 | 21 | #language_selection { 22 | max-height: 300px; 23 | overflow-y: auto; 24 | padding-right: 10px; 25 | } 26 | -------------------------------------------------------------------------------- /jni/src/EncoreConfig/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | ROOT_PATH := $(call my-dir)/../.. 3 | 4 | include $(CLEAR_VARS) 5 | 6 | LOCAL_MODULE := EncoreConfig 7 | LOCAL_SRC_FILES := InotifyHandler.cpp EncoreConfigStore.cpp 8 | 9 | LOCAL_STATIC_LIBRARIES := GameRegistry 10 | 11 | LOCAL_C_INCLUDES := \ 12 | $(ROOT_PATH)/include \ 13 | $(ROOT_PATH)/external/rapidjson/include \ 14 | $(ROOT_PATH)/external/spdlog/include 15 | 16 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 17 | 18 | LOCAL_CPPFLAGS += -fexceptions -std=c++23 -O0 19 | LOCAL_CPPFLAGS += -Wpedantic -Wall -Wextra -Werror -Wformat -Wuninitialized 20 | 21 | include $(BUILD_STATIC_LIBRARY) 22 | -------------------------------------------------------------------------------- /website/docs/download/version/2.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 2.0 7 | 8 | ## Changelog 9 | - Fix random game boosting by Mobile Legends: Bang Bang 10 | - Logs more useful info 11 | - Kill more logger service (via Kill Logger on WebUI) 12 | - Clicking Encore on WebUI now will open this website 13 | 14 | ## Download 15 | - [Download](https://en.shrinke.me/zL7ft) 16 | - [Download (Alternative link)](https://sfl.gl/ht8yJ) 17 | - [Telegram Channel](https://rem01schannel.t.me) 18 | 19 | ::: tip Support our project 20 | Please consider support our project by not sharing direct module file 21 | ::: 22 | -------------------------------------------------------------------------------- /jni/src/EncoreUtility/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | ROOT_PATH := $(call my-dir)/../.. 3 | 4 | include $(CLEAR_VARS) 5 | LOCAL_MODULE := EncoreUtility 6 | 7 | LOCAL_C_INCLUDES := \ 8 | $(ROOT_PATH)/include \ 9 | $(ROOT_PATH)/external/rapidjson/include \ 10 | $(ROOT_PATH)/external/spdlog/include 11 | 12 | LOCAL_SRC_FILES := \ 13 | FileUtility.cpp \ 14 | MiscUtility.cpp \ 15 | ProcessUtility.cpp \ 16 | Profiler.cpp 17 | 18 | LOCAL_STATIC_LIBRARIES := EncoreConfig 19 | 20 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 21 | 22 | LOCAL_CPPFLAGS += -fexceptions -std=c++23 -O0 23 | LOCAL_CPPFLAGS += -Wpedantic -Wall -Wextra -Werror -Wformat -Wuninitialized 24 | 25 | include $(BUILD_STATIC_LIBRARY) 26 | -------------------------------------------------------------------------------- /website/docs/download/version/3.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 3.1 7 | 8 | ## Changelog 9 | - **HOTFIX**: Fix system instability on MediaTek devices when powersave mode activated. 10 | - This version is hotfix from previous version, please read [previous version changelog](/download/version/3.0). 11 | 12 | ## Download 13 | - [Download](https://shrinkme.ink/azk97zDr) 14 | - [Download (Alternative link)](https://sfl.gl/hHwU0yud) 15 | - [Telegram Channel](https://rem01schannel.t.me) 16 | 17 | ::: tip Support our project 18 | Please consider support our project by not sharing direct module file 19 | ::: 20 | -------------------------------------------------------------------------------- /website/docs/download/version/1.5.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 1.5 7 | 8 | ## Changelog 9 | - Fix performance issues on some devices due to bad I/O scheduler implementation 10 | - Mediatek: Stop enabling/disabling PPM entierly 11 | - Mediatek: Disable PPM Policy `PPM_POLICY_PWR_THRO` and `PPM_POLICY_THERMAL` 12 | - Use GPU Extension Device (GED) to tweak Mediatek's GPU frequency 13 | 14 | ## Download 15 | - [Download](https://en.shrinke.me/ghWUW8sH) 16 | - [Download (Alternative link)](https://sfl.gl/LWl3oz) 17 | - [Telegram Channel](https://rem01schannel.t.me) 18 | 19 | ::: tip Support our project 20 | Please consider support our project by not sharing direct module file 21 | ::: 22 | -------------------------------------------------------------------------------- /website/docs/download/version/2.7.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 2.7 7 | 8 | ## Changelog 9 | - Instantly change governor on setting changes depending on current profile 10 | - Introduce DND on Gameplay feature 11 | - Skip mount on KSU/AP to prevent root detection 12 | - Improve WebUI error handling 13 | - Fix Unisoc SoC detection 14 | - Fix visual bug on daemon status 15 | - Other misc optimizations 16 | 17 | ## Download 18 | - [Download](https://shrinkme.ink/HmNq) 19 | - [Download (Alternative link)](https://sfl.gl/YYGIXB) 20 | - [Telegram Channel](https://rem01schannel.t.me) 21 | 22 | ::: tip Support our project 23 | Please consider support our project by not sharing direct module file 24 | ::: 25 | -------------------------------------------------------------------------------- /jni/src/EncoreConfig/EncoreConfig.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | bool init_file_watcher(InotifyWatcher &watcher); 22 | -------------------------------------------------------------------------------- /website/docs/download/version/3.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 3.0 7 | 8 | ## Changelog 9 | - Handle race condition on `set_priority()` call 10 | - Remove toast notification due to causing game freeze and crash on performance profile execution 11 | - PID checking without creating file descriptor 12 | - Revert MediaTek's PPM related changes 13 | - Revert Cgroups implementation 14 | - Other misc optimizations 15 | 16 | ## Download 17 | - [Download](https://shrinkme.ink/9BfyMSI) 18 | - [Download (Alternative link)](https://sfl.gl/Mgmbvz) 19 | - [Telegram Channel](https://rem01schannel.t.me) 20 | 21 | ::: tip Support our project 22 | Please consider support our project by not sharing direct module file 23 | ::: 24 | -------------------------------------------------------------------------------- /website/docs/download/version/2.3.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 2.3 7 | 8 | ## Changelog 9 | - Incorporated fixes on version 2.2 10 | - Simplify fetch PID logic 11 | - Fix possible syntax error on I/O tweaks 12 | - MediaTek: Simplify PPM policies settings logic 13 | - MediaTek: Disable more logging service (via kill logger feature) 14 | - MediaTek: Let Encore control anything without FPSGO 15 | - Other misc optimization and changes 16 | 17 | ## Download 18 | - [Download](https://shrinkme.ink/lGNW4F56) 19 | - [Download (Alternative link)](https://sfl.gl/pR8DnKp) 20 | - [Telegram Channel](https://rem01schannel.t.me) 21 | 22 | ::: tip Support our project 23 | Please consider support our project by not sharing direct module file 24 | ::: 25 | -------------------------------------------------------------------------------- /website/docs/download/version/2.4.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 2.4 7 | 8 | ## Changelog 9 | - Fix service stopped due to bad fetch PID logic for `com.mobile.legends:UnityKillsMe` 10 | - Fix some weird issues when kill logger enabled 11 | - Fix some tweaks may not apply correctly 12 | - No longer bundling KSU WebUI APK 13 | - Versioning scheme changes 14 | - webui: Introduce MMRL window safe area insets 15 | - Other misc optimizations 16 | 17 | ## Download 18 | - [Download](https://shrinkme.ink/siAtnS) 19 | - [Download (Alternative link)](https://sfl.gl/DS5co) 20 | - [Telegram Channel](https://rem01schannel.t.me) 21 | 22 | ::: tip Support our project 23 | Please consider support our project by not sharing direct module file 24 | ::: 25 | -------------------------------------------------------------------------------- /website/docs/download/version/4.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 4.1 7 | 8 | ## Changelog 9 | - Fix CPU governor defaulted as performance 10 | - Fix overheating after startup 11 | - Expose game information through /dev/encore_game_info 12 | - Reintroduce cpu_dcvs tweaks (LLCC, L3 and DDR) 13 | - Add more TCP congestion algo to use 14 | - Other misc changes and optimizations 15 | 16 | ## Download 17 | - [Download](https://github.com/Rem01Gaming/encore/releases/tag/4.1) 18 | - [Download (Alternative link)](https://dl.rem01gaming.dev/releases/encore/4.1/encore-4.1-862-cc92fbc-release.zip) 19 | - [Telegram Channel](https://rem01schannel.t.me) 20 | 21 | ::: tip Support our project 22 | Please consider support our project by not sharing direct module file 23 | ::: 24 | -------------------------------------------------------------------------------- /website/docs/download/version/4.5.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 4.5 7 | 8 | ## Changelog 9 | 10 | - Fix root detection issue on module files 11 | - Mitigate buggy thermal throttling on post-startup in old MediaTek devices 12 | - Fix random reboot and performance dip on some devices 13 | - Add module banner for KernelSU Next 14 | - Add option to create WebUI shortcut 15 | - Add back DDR tweaks for Exynos and Tensor devices 16 | - Remove MMRL from action redirect WebUI 17 | - Shrink module size even more 18 | 19 | ## Download 20 | - [Download](https://github.com/Rem01Gaming/encore/releases/tag/4.5) 21 | - [Telegram Channel](https://rem01schannel.t.me) 22 | 23 | ::: tip Support our project 24 | Please consider support our project by not sharing direct module file 25 | ::: 26 | -------------------------------------------------------------------------------- /website/docs/download/version/1.6.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 1.6 7 | 8 | ## Changelog 9 | - Fix GPU Frequencies on some Mediatek devices 10 | - Mediatek: Disable PPM Policy `PPM_POLICY_PWR_THRO` and `PPM_POLICY_THERMAL` only on performance profile 11 | - Disable more debugging and tracing 12 | - Add option to change performance profile CPU Governor in WebUI 13 | - Enable battery_saver module on powersave profile (if your kernel have it) 14 | - Fix crashes on some devices 15 | 16 | ## Download 17 | - [Download](https://en.shrinke.me/GW9faY) 18 | - [Download (Alternative link)](https://sfl.gl/ClSBX) 19 | - [Telegram Channel](https://rem01schannel.t.me) 20 | 21 | ::: tip Support our project 22 | Please consider support our project by not sharing direct module file 23 | ::: 24 | -------------------------------------------------------------------------------- /website/docs/download/version/1.7.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 1.7 7 | 8 | ## Changelog 9 | - Fix CPU Frequency lock on newer Mediatek devices 10 | - Kill `statsd` together with `logd` and `traced` 11 | - Fine tune I/O tweaks for performance profiles 12 | - Fine tune `vm.vfs_cache_pressure` value 13 | - Disable unnecessary printk logging 14 | - Incrase `read_ahead_kb` value on performance profile 15 | - module: customize.sh: Simplify installation process 16 | - module: Introduce `verify.sh` for flashable integrity checkup 17 | 18 | ## Download 19 | - [Download](https://en.shrinke.me/E2GiKQu) 20 | - [Download (Alternative link)](https://sfl.gl/o6pX3) 21 | - [Telegram Channel](https://rem01schannel.t.me) 22 | 23 | ::: tip Support our project 24 | Please consider support our project by not sharing direct module file 25 | ::: 26 | -------------------------------------------------------------------------------- /website/docs/download/version/3.7.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 3.7 7 | 8 | ## Changelog 9 | - Fix compatibility with ROMs with buggy mksh shell implementation (Non compliance or out-of-date). 10 | - Revert previous powersave tweaks due to buggy mksh implementation on some ROMs. 11 | - Fix unable to fetch PID errors. 12 | - Misc changes and optimizations. 13 | 14 | ## Checksums 15 | - **MD5**: `83353ed0f1b649a5ef752f7a726bb04e` 16 | - **SHA1**: `d8ee95884380b602736de746e59e2e2d521e34e3` 17 | - **SHA256**: `4f0f1e528cb0e029ecf82ba7dc7b77dbb4bac2abaefece20fcb63eda01a255c8` 18 | 19 | ## Download 20 | - [Download](https://safefileku.com/download/niwtVI271MMZlzcP) 21 | - [Telegram Channel](https://rem01schannel.t.me) 22 | 23 | ::: tip Support our project 24 | Please consider support our project by not sharing direct module file 25 | ::: 26 | -------------------------------------------------------------------------------- /jni/src/EncoreUtility/ProcessUtility.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "EncoreUtility.hpp" 18 | 19 | uid_t get_uid_by_package_name(const std::string& package_name) { 20 | struct stat st{}; 21 | 22 | if (stat(("/data/data/" + package_name).c_str(), &st) != 0) { 23 | return 0; 24 | } 25 | 26 | return st.st_uid; 27 | } 28 | -------------------------------------------------------------------------------- /website/docs/download/version/2.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 2.2 7 | 8 | ## Changelog 9 | - Add action script to open WebUI (Magisk only) 10 | - Daemonize service 11 | - Service code refactor for performance 12 | - Fix daemon error "unable to fetch PID" 13 | - Fix service cannot fetch low_power state 14 | - Update Gamelist (**430+ Games listed**) 15 | - Tweak I/O parameter for low latency workloads 16 | - Add support for X86 and RISCV CPUs 17 | - Notify user on every profile changes 18 | - Handle case when 'default_gov' is performance 19 | - Other misc optimization and changes 20 | 21 | ## Download 22 | - [Download](https://shrinkme.ink/FpUg0) 23 | - [Download (Alternative link)](https://sfl.gl/8D0r) 24 | - [Telegram Channel](https://rem01schannel.t.me) 25 | 26 | ::: tip Support our project 27 | Please consider support our project by not sharing direct module file 28 | ::: 29 | -------------------------------------------------------------------------------- /website/docs/download/version/4.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 4.0 7 | 8 | ## Changelog 9 | - Drop mksh shell due buggy behavior on some devices. 10 | - Introduce MediaTek DDR boost tweak. 11 | - Skip CPU scaling tweaks entierly when PPM node exists. 12 | - Handle write conflict on logging system properly. 13 | - Other misc changes and optimizations. 14 | 15 | ## Checksums 16 | - **MD5**: `f8b42a3bf61fdd5b9ffb3ddbd2702fb9` 17 | - **SHA1**: `98354012f04ca9e0abca861a9736005d533127cc` 18 | - **SHA256**: `f77b40ea35a9f20208139ce3021b711209d09de253c0e6db9936594291618f04` 19 | 20 | ## Download 21 | - [Download](https://shrinkme.ink/563Hoa) 22 | - [Download (Alternative link)](https://safefileku.com/download/sWewuedrvgHHLIPB) 23 | - [Telegram Channel](https://rem01schannel.t.me) 24 | 25 | ::: tip Support our project 26 | Please consider support our project by not sharing direct module file 27 | ::: 28 | -------------------------------------------------------------------------------- /website/docs/download/version/4.4.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 4.4 7 | 8 | ## Changelog 9 | 10 | - Fix UI lags in normal mode on certain older MediaTek devices 11 | - Revert startup tweak (post-fs-data) to mitigate bootloops on some devices 12 | - Introduced Device Mitigation to fix certain device specific bugs 13 | - Allow MMC to UFSHC to run on lower frequency on Lite Mode 14 | - Better and more accurate SoC recognition 15 | - Update Mandarin WebUI translation 16 | - Reduces module size to ~190kB 17 | - Disable Oplus CPU limit 18 | - Refactor and de-spaghetti the profiler code 19 | - Other misc changes and optimizations 20 | 21 | ## Download 22 | - [Download](https://github.com/Rem01Gaming/encore/releases/tag/4.4) 23 | - [Telegram Channel](https://rem01schannel.t.me) 24 | 25 | ::: tip Support our project 26 | Please consider support our project by not sharing direct module file 27 | ::: 28 | -------------------------------------------------------------------------------- /website/docs/download/version/4.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 4.2 7 | 8 | ## Changelog 9 | 10 | - Disable MTK PBM on performance profile 11 | - Update Vietnamese and Polish WebUI translation 12 | - Use `energy_step` for default CPU governor candidate 13 | - Remove unnecessary file creation on late_start service 14 | - Workaround for game freezes in Xiaomi peridot 15 | - Globally disable `iostats` and `add_random` 16 | - Reduce `nr_requests` to 32 on performance profile 17 | - Other misc changes and optimizations 18 | 19 | ## Download 20 | - [Download](https://github.com/Rem01Gaming/encore/releases/tag/4.2) 21 | - [Download (Alternative link)](https://dl.rem01gaming.dev/releases/encore/4.2/encore-4.2-899-84bbcb5-release.zip) 22 | - [Telegram Channel](https://rem01schannel.t.me) 23 | 24 | ::: tip Support our project 25 | Please consider support our project by not sharing direct module file 26 | ::: 27 | -------------------------------------------------------------------------------- /module/uninstall.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2024-2025 Rem01Gaming 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | rm -rf /data/adb/.config/encore 18 | rm -f /data/adb/service.d/.encore_cleanup.sh 19 | 20 | need_gone="encored encore_profiler encore_utility encore_log" 21 | manager_paths="/data/adb/ap/bin /data/adb/ksu/bin" 22 | 23 | for dir in $manager_paths; do 24 | [ -d "$dir" ] && { 25 | for bin in $need_gone; do 26 | rm "$dir/$bin" 27 | done 28 | } 29 | done 30 | -------------------------------------------------------------------------------- /website/docs/download/version/3.9.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 3.9 7 | 8 | ## Changelog 9 | - Fix performance issues on some Snapdragon devices. 10 | - Revert powersave profile tweaks (again). 11 | 12 | ::: info Hotfix release 13 | This version is a hotfix to the prior release. 14 | for additional information, see the [previous release changelog](/download/version/3.8). 15 | ::: 16 | 17 | ## Checksums 18 | - **MD5**: `111f3a798ca6f5b7fa35d5586b5e5061` 19 | - **SHA1**: `f502b21846b067555ee309f2b933c57a0c78336e` 20 | - **SHA256**: `51e78d3b608596281121f760b51dbf5f67ff10416d7dedc23ad8a314dfc4735c` 21 | 22 | ## Download 23 | - [Download](https://shrinkme.ink/daEPA) 24 | - [Download (Alternative link)](https://safefileku.com/download/JP6XADge6N4Xr166) 25 | - [Telegram Channel](https://rem01schannel.t.me) 26 | 27 | ::: tip Support our project 28 | Please consider support our project by not sharing direct module file 29 | ::: 30 | -------------------------------------------------------------------------------- /website/docs/download/version/2.6.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 2.6 7 | 8 | ## Changelog 9 | - WebUI redesign with dynamic material you theme (dynamic theme only available on MMRL) 10 | - Handle MMRL _no-js-api_ permission 11 | - Migrate WebUI from parcel to vite 12 | - Initial support for Nvidia Tegra 13 | - Improve SoC recognition for Intel and Exynos 14 | - Disable _split lock mitigations_ (X86 only) 15 | - Introduced bypass charging feature (experimental) 16 | - Fix lag and screen glitches on newer MediaTek Dimensity devices when powersave profile enabled 17 | - Fix kernel panic on some devices 18 | - Disable Oppo/Realme cpustats 19 | 20 | ## Download 21 | - [Download](https://shrinkme.ink/TpEUd) 22 | - [Download (Alternative link)](https://sfl.gl/ZTuy) 23 | - [Telegram Channel](https://rem01schannel.t.me) 24 | 25 | ::: tip Support our project 26 | Please consider support our project by not sharing direct module file 27 | ::: 28 | -------------------------------------------------------------------------------- /website/docs/download/version/2.8.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 2.8 7 | 8 | ## Changelog 9 | - Fix inaccessible `encore_utility` error on WebUI 10 | - Print WebUI stderr on a modal 11 | - Migrate prioritization logic to Cgroups cpuctl & schedtune 12 | - Fix throttling issues on legacy MediaTek devices with PPM 13 | - Disable more PPM policies 14 | - Using `PPM_POLICY_USER_LIMIT` for CPU frequency changes 15 | - Fix SoC recognition for latest Exynos devices 16 | - Using the latest Android NDK for daemon build (r28) 17 | - JavaScript and profiler code refactor 18 | - Drop bypass charging feature due unexpected behavior across devices 19 | 20 | ## Download 21 | - [Download](https://shrinkme.ink/STZJV) 22 | - [Download (Alternative link)](https://sfl.gl/OVnzZvfu) 23 | - [Telegram Channel](https://rem01schannel.t.me) 24 | 25 | ::: tip Support our project 26 | Please consider support our project by not sharing direct module file 27 | ::: 28 | -------------------------------------------------------------------------------- /website/docs/download/version/4.3.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 4.3 7 | 8 | ## Changelog 9 | 10 | - Introducing Lite Mode 11 | - Improve SoC recognition logic 12 | - Revert MTK PBM implementation due random reboot issue 13 | - Fix system instability in some Snapdragon devices 14 | - Fix SoC recognition on some Google Tensor devices 15 | - Fix Monet color theme in the latest MMRL build 16 | - Update default WebUI color theme to "purpleish" 17 | - Disable GED KPI on performance profile 18 | - Drop kill logger feature 19 | - Other misc changes and optimizations 20 | 21 | ## Download 22 | - [Download](https://github.com/Rem01Gaming/encore/releases/tag/4.3) 23 | - [Download (Alternative link)](https://dl.rem01gaming.dev/releases/encore/4.3/encore-4.3-933-36f8bbc-release.zip) 24 | - [Telegram Channel](https://rem01schannel.t.me) 25 | 26 | ::: tip Support our project 27 | Please consider support our project by not sharing direct module file 28 | ::: 29 | -------------------------------------------------------------------------------- /jni/src/EncoreCLI/EncoreCLI.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | 22 | struct CliCommand { 23 | std::string name; 24 | std::string description; 25 | std::string usage; 26 | int min_args; 27 | int max_args; 28 | int (*handler)(const std::vector &args); 29 | }; 30 | 31 | void cli_usage(const char *program_name); 32 | void cli_usage_command(const CliCommand &cmd); 33 | int encore_cli(int argc, char *argv[]); 34 | -------------------------------------------------------------------------------- /website/docs/download/version/2.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 2.1 7 | 8 | ## Changelog 9 | - Fix random game boosting by **Mobile Legends: Bang Bang** (again) 10 | - **Fix CPU frequency lock on Mediatek G99 and Dimensity series and possibly other chipset** 11 | - Introduce unity fix 12 | - Add option to change Powersave CPU Governor on WebUI 13 | - Disable OnePlus opchain 14 | - Update Gamelist (**400+ Games listed**) 15 | - Use bbr2 TCP congestion if available 16 | - Specifically target internal and external storage partition for I/O Tweak 17 | - Increase I/O Read Ahead to 312KB on Performance profile for more throughput 18 | - Disable I/O add_random 19 | - Other misc optimization and changes 20 | - License change to Apache License 2.0 21 | 22 | ## Download 23 | - [Download](https://shrinkme.ink/s7yL5W) 24 | - [Download (Alternative link)](https://sfl.gl/auCiIWF6) 25 | - [Telegram Channel](https://rem01schannel.t.me) 26 | 27 | ::: tip Support our project 28 | Please consider support our project by not sharing direct module file 29 | ::: 30 | -------------------------------------------------------------------------------- /website/docs/download/version/3.4.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 3.4 7 | 8 | ## Changelog 9 | - Massive project refactor and restructure 10 | - Added DRAM/Memory and CPU bus tweak for Exynos and Google Tensor 11 | - Disable PPM policy `SYS_BOOST` only on performance profile due causing weird CPU freq behavior on Redmi K40 Gaming 12 | - Optimize devfreq frequency functions 13 | - Remember WebUI language choice by user 14 | - Avoid repeated branch prediction miss on screen state and low battery fetch function 15 | - Don't stop playback media on DND mode due keyevent difference on each devices 16 | - Fix infinite loop due bad logic on gamestart check 17 | - Fix screen flicker and delay on Xiaomi Topaz and other Snapdragon devices 18 | - Fix random reboot on Realme 5i (again) 19 | - Fix random boost caused by Moba Legends (MLBB India version) 20 | 21 | ## Download 22 | - [Download](https://safefileku.com/download/qRbEXQwK1K8g290j) 23 | - [Telegram Channel](https://rem01schannel.t.me) 24 | 25 | ::: tip Support our project 26 | Please consider support our project by not sharing direct module file 27 | ::: 28 | -------------------------------------------------------------------------------- /website/docs/download/version/3.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 3.2 7 | 8 | ## Changelog 9 | - Daemon code refactoring and optimizations 10 | - Optimize shell script execution to reduce overhead 11 | - Use Toybox for the pidof routine 12 | - Place gamelist and log file to tmpfs for faster access 13 | - Make sure only one instance runs at the same time 14 | - Improve daemon logging system 15 | - Fix random reboot on Realme 5i and other Snapdragon devices 16 | - Fix rare bug where module.prop breaks after reboot 17 | - Set default screenstate after too many failures 18 | - Add WebUI translation in 24 languages 19 | - Silence spammy SU granted toast notification on WebUI 20 | - Request KSU JavaScript API permission on MMRL 21 | - Directly grant root access from KernelSU via prctl 22 | - Other misc optimization and adjustment 23 | 24 | ## Download 25 | - [Download](https://shrinkme.ink/DGeu2Yt) 26 | - [Download (Alternative link)](https://sfl.gl/BjxAotB) 27 | - [Telegram Channel](https://rem01schannel.t.me) 28 | 29 | ::: tip Support our project 30 | Please consider support our project by not sharing direct module file 31 | ::: 32 | -------------------------------------------------------------------------------- /website/docs/download/version/3.5.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 3.5 7 | 8 | ## Changelog 9 | - Remove error-fallback `dumpsys` command for screenstate fetching due massive overhead. 10 | - Implement error fallback for batery saver state fetcher. 11 | - Fix shellcheck warnings for the project's shell script. 12 | - Minimize use of the `cat` command (UUOC). 13 | - Search for more default CPU governor candidates if device's default is `performance`. 14 | - Revert touch boost implementation. 15 | - Fix lag and touch delay in Xiaomi Ginkgo and other Xiaomi devices. 16 | - Update translation for Mandarin, Japanese, Arabic and German. 17 | - Drop "Restart Daemon" button due constant misuses and bugs associated. 18 | 19 | ## Checksums 20 | - **MD5**: `2a765884e4a77dda6fb2978d2302b90d` 21 | - **SHA1**: `6fecca242622036bf723d9d00438cac1a94bf813` 22 | - **SHA256**: `b2a32b7c5e58bdcbbb9dbd7fb265887fe2052f23a56f6118df53d134ca9a24cb` 23 | 24 | ## Download 25 | - [Download](https://safefileku.com/download/WpcTvu7DgaymBdcQ) 26 | - [Telegram Channel](https://rem01schannel.t.me) 27 | 28 | ::: tip Support our project 29 | Please consider support our project by not sharing direct module file 30 | ::: 31 | -------------------------------------------------------------------------------- /website/docs/download/version/3.8.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 3.8 7 | 8 | ## Changelog 9 | - Ship our own mksh shell for compatibility across different devices and ROMs. 10 | - Fix screen blackout in powersave profile on Xiaomi Redwood and certain Snapdragon devices. 11 | - "Nerf" powersave profile, reduces device frequency to 50% (DVFS) instead of lowest frequency to reduce lags. 12 | - Add back DDR and Buses powersave tweaks. 13 | - Fix encore profiler stuck to perfomance on [Magic Chess](https://play.google.com/store/apps/details?id=com.mobilechess.gp). 14 | - Handle possible race condition on logging system. 15 | - Initial support for incoming Encore Addon. 16 | - Misc changes and optimizations. 17 | 18 | ## Checksums 19 | - **MD5**: `e1164dc21e42cf3b45be6419ad0eb35a` 20 | - **SHA1**: `279f4bde8cfb8468d6423f99aa3d6e0e04ae6df8` 21 | - **SHA256**: `09d07a1f80fc77c7965f55fdb32ee9356dc38c506f2d9f6be062f6c14ba8acce` 22 | 23 | ## Download 24 | - [Download](https://shrinkme.ink/rBbEYR) 25 | - [Download (Alternative link)](https://safefileku.com/download/NbKSRCWTOVxJkaZC) 26 | - [Telegram Channel](https://rem01schannel.t.me) 27 | 28 | ::: tip Support our project 29 | Please consider support our project by not sharing direct module file 30 | ::: 31 | -------------------------------------------------------------------------------- /website/docs/download/version/3.6.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 3.6 7 | 8 | ## Changelog 9 | - Using native code "pgrep" implementation. 10 | - Make boot up faster. 11 | - Drop disable CPU core on powersave profile due device specific bug on Realme 5i and Infinix GT 10 Pro. 12 | - "Nerf" powersave profile, reduces device frequency to 50% (DVFS) instead of lowest frequency to reduce lags. 13 | - Add back DDR and Buses powersave tweaks. 14 | - Customizable MediaTek PPM policies via `/data/encore/ppm_policies_mediatek`. 15 | - Code refactor and optimizations. 16 | - Fix kernel panic and freeze on some devices while powersave profile enabled. 17 | - Fix typo causing integrity check unhandled error. 18 | - Fix performance dip on some MediaTek devices. 19 | - Other misc changes and optimizations. 20 | 21 | ## Checksums 22 | - **MD5**: `7dbd2062be56f5ef46eb45b9b5a7afa3` 23 | - **SHA1**: `e761f4858fc130be42e7b89d35820cf1ec7aacf3` 24 | - **SHA256**: `3df6d3761fea4733ef45f8b995b12a50bd0000c83c25506f4579da636c62f496` 25 | 26 | ## Download 27 | - [Download](https://safefileku.com/download/H7shilh4st4pBZjB) 28 | - [Telegram Channel](https://rem01schannel.t.me) 29 | 30 | ::: tip Support our project 31 | Please consider support our project by not sharing direct module file 32 | ::: 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: "Suggest an idea for this project" 3 | title: "[FEATURE]" 4 | labels: ["feature"] 5 | body: 6 | - type: markdown 7 | id: feature-info 8 | attributes: 9 | value: "## Feature Infomation" 10 | - type: textarea 11 | id: feature-main 12 | validations: 13 | required: true 14 | attributes: 15 | label: "Is your feature request related to a problem? Please describe." 16 | description: "A clear and concise description of what the problem is." 17 | placeholder: "I'm always frustrated when [...]" 18 | - type: textarea 19 | id: feature-solution 20 | validations: 21 | required: true 22 | attributes: 23 | label: "Describe the solution you'd like." 24 | description: "A clear and concise description of what you want to happen." 25 | - type: textarea 26 | id: feature-describe 27 | validations: 28 | required: true 29 | attributes: 30 | label: "Describe alternatives you've considered." 31 | description: "A clear and concise description of any alternative solutions or features you've considered." 32 | - type: textarea 33 | id: feature-extra 34 | validations: 35 | required: false 36 | attributes: 37 | label: "Additional context" 38 | description: "Add any other context or screenshots about the feature request here." 39 | 40 | -------------------------------------------------------------------------------- /website/docs/download/version/3.3.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download" 3 | description: "Download the latest version of Encore Tweaks Magisk Module here" 4 | --- 5 | 6 | # Encore Tweaks 3.3 7 | 8 | ## Changelog 9 | - Migrate daemon code to C23 standard 10 | - Daemon code refactoring and optimizations 11 | - Memory management improvement for daemon 12 | - Implement branch prediction optimization for daemon 13 | - Workaround for inexact process name PID fetch 14 | - Change GPU and DRAM frequency without touching governor 15 | - Disable touchboost in the powersave profile to save more power 16 | - Fix Pojav Launcher can't be boosted by daemon due to the inexact process name 17 | - Fix invalid frequency value settings for non MediaTek GPUs, causing low frequency to be set in performance profile 18 | - Fix random boost caused by Mobile Legends: Bang Bang (Huawei version) 19 | - Make sure new game session gets boosted when the old one killed 20 | - Force off FPSGO on performance profile 21 | - Lock value for CPU freq policies to make sure frequencies are static 22 | - Tweak more nodes of Snapdragon DRAM, CPU Bus and GPU Bus 23 | - Disable PPM policy `SYS_BOOST` by default to prevent buggy CPU freq behavior on some MediaTek devices 24 | 25 | 26 | ## Download 27 | - [Download](https://safefileku.com/download/JzsGXs12mmFqQfuL) 28 | - [Telegram Channel](https://rem01schannel.t.me) 29 | 30 | ::: tip Support our project 31 | Please consider support our project by not sharing direct module file 32 | ::: 33 | -------------------------------------------------------------------------------- /module/action.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2024-2025 Rem01Gaming 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | if [ -n "$MMRL" ]; then 18 | echo "- This action script is NOT intended to run on MMRL..." 19 | echo "- Please open Encore Tweaks WebUI by clicking the module card." 20 | exit 0 21 | fi 22 | 23 | if [ -n "$MAGISKTMP" ]; then 24 | pm path io.github.a13e300.ksuwebui >/dev/null 2>&1 && { 25 | echo "- Launching WebUI in KSUWebUIStandalone..." 26 | am start -n "io.github.a13e300.ksuwebui/.WebUIActivity" -e id "encore" 27 | exit 0 28 | } 29 | pm path com.dergoogler.mmrl.webuix >/dev/null 2>&1 && { 30 | echo "- Launching WebUI in WebUI X..." 31 | am start -n "com.dergoogler.mmrl.webuix/.ui.activity.webui.WebUIActivity" -e MOD_ID "encore" 32 | exit 0 33 | } 34 | fi 35 | 36 | echo "! Install KsuWebUI for WebUI access" 37 | sleep 2 38 | am start -a android.intent.action.VIEW -d https://github.com/5ec1cff/KsuWebUIStandalone/releases 39 | exit 0 40 | -------------------------------------------------------------------------------- /jni/include/Encore.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | #define NOTIFY_TITLE "Encore Tweaks" 22 | #define LOG_TAG "EncoreTweaks" 23 | 24 | #define CONFIG_DIR "/data/adb/.config/encore" 25 | #define MODPATH "/data/adb/modules/encore" 26 | 27 | #define LOCK_FILE CONFIG_DIR "/.lock" 28 | #define LOG_FILE CONFIG_DIR "/encore.log" 29 | #define PROFILE_MODE CONFIG_DIR "/current_profile" 30 | #define GAME_INFO CONFIG_DIR "/gameinfo" 31 | #define CONFIG_FILE CONFIG_DIR "/config.json" 32 | #define DEFAULT_CPU_GOV CONFIG_DIR "/default_cpu_gov" 33 | #define ENCORE_GAMELIST CONFIG_DIR "/gamelist.json" 34 | 35 | #define MODULE_PROP MODPATH "/module.prop" 36 | #define MODULE_UPDATE MODPATH "/update" 37 | 38 | enum EncoreProfileMode : char { 39 | PERFCOMMON, 40 | PERFORMANCE_PROFILE, 41 | BALANCE_PROFILE, 42 | POWERSAVE_PROFILE 43 | }; 44 | 45 | struct EncoreGameList { 46 | std::string package_name; 47 | bool lite_mode; 48 | bool enable_dnd; 49 | }; 50 | -------------------------------------------------------------------------------- /jni/include/Write2File.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | 22 | /** 23 | * @brief Writes formatted content to a file, truncating it if it exists. 24 | * 25 | * This function formats a string using the provided arguments and writes it to the specified file. 26 | * The file is always truncated before writing. No file locking is performed. 27 | * @tparam Args The types of the arguments for formatting. 28 | * @param filename The path to the file to write to. 29 | * @param args The arguments to format into the string. 30 | * @return true if the write operation was successful, false otherwise. 31 | */ 32 | template 33 | bool write2file(const std::string &filename, Args &&...args) { 34 | std::ostringstream oss; 35 | (oss << ... << std::forward(args)); 36 | 37 | std::ofstream file(filename, std::ios::trunc); 38 | if (!file.is_open()) { 39 | return false; 40 | } 41 | 42 | file << oss.str(); 43 | return file.good(); 44 | } 45 | -------------------------------------------------------------------------------- /webui/src/locales/strings/zh_CN.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "module": "Encore Tweaks", 4 | "profile": "当前配置", 5 | "kernel": "内核", 6 | "chipset": "芯片组", 7 | "androidSDK": "Android SDK" 8 | }, 9 | "settings": { 10 | "title": "设置", 11 | "dnd_gameplay": "游戏勿扰模式", 12 | "lite_mode": "轻量模式", 13 | "device_mitigation": "设备兼容模式", 14 | "default_cpu_gov": "默认 CPU 调速器", 15 | "powersave_cpu_gov": "省电 CPU 调速器", 16 | "cpu_governor_title": "CPU调速器" 17 | }, 18 | "actions": { 19 | "title": "操作", 20 | "edit_gamelist": "编辑游戏列表", 21 | "create_shortcut": "创建快捷方式", 22 | "save_logs": "保存模块日志" 23 | }, 24 | "support": { 25 | "title": "支持我", 26 | "description": "Encore Tweaks 永久免费,若您愿意,可通过捐赠支持开发。" 27 | }, 28 | "modal": { 29 | "dnd_title": "勿扰模式", 30 | "dnd_desc": "在玩游戏时启用勿扰模式,限制通知和电话的干扰,让您可以专心享受游戏。", 31 | "lite_mode_title": "轻量模式", 32 | "lite_mode_desc": "此选项通过允许CPU和其他组件以较低频率运行(而非持续最高频率),减少游戏过程中的过热和功耗,但可能影响整体游戏性能。", 33 | "device_mitigation_title": "设备兼容模式", 34 | "device_mitigation_desc": "通过应用特定的调整来修复某些设备特有的问题,提升兼容性与稳定性。除非设备在关闭该选项后出现问题,否则建议保持该选项关闭。", 35 | "edit_gamelist_title": "编辑游戏列表", 36 | "edit_gamelist_desc": "启动列表中的游戏或应用时,将自动应用性能配置。", 37 | "save_changes": "保存更改", 38 | "cancel_changes": "取消更改", 39 | "save_log_fail": "无法保存日志", 40 | "unauthorized_mod_title": "检测到未经授权的修改", 41 | "unauthorized_mod_desc": "该模块可能已被第三方修改。为了您的安全,请从Encore Tweaks官方网站下载官方版本。", 42 | "log_saved_desc": "日志已保存至 {0}。", 43 | "log_saved_title": "模块日志已保存" 44 | }, 45 | "toast": { 46 | "reboot_to_apply": "重启设备使变更应用。", 47 | "has_shortcut": "快捷方式已存在", 48 | "gamelist_save_success": "游戏列表已成功保存" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /.github/scripts/compile_zip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | # shellcheck disable=SC2035 3 | 4 | if [ -z "$GITHUB_WORKSPACE" ]; then 5 | echo "This script should only run on GitHub action!" >&2 6 | exit 1 7 | fi 8 | 9 | # Make sure we're on right directory 10 | cd "$GITHUB_WORKSPACE" || { 11 | echo "Unable to cd to GITHUB_WORKSPACE" >&2 12 | exit 1 13 | } 14 | 15 | # Put critical files and folders here 16 | need_integrity=( 17 | "module/system/bin" 18 | "module/libs" 19 | "module/META-INF" 20 | "module/service.sh" 21 | "module/uninstall.sh" 22 | "module/action.sh" 23 | "module/cleanup.sh" 24 | "module/module.prop" 25 | "module/gamelist.txt" 26 | ) 27 | 28 | # Version info 29 | version="$(cat version)" 30 | version_code="$(git rev-list HEAD --count)" 31 | release_code="$(git rev-list HEAD --count)-$(git rev-parse --short HEAD)-release" 32 | sed -i "s/version=.*/version=$version ($release_code)/" module/module.prop 33 | sed -i "s/versionCode=.*/versionCode=$version_code/" module/module.prop 34 | 35 | # Copy module files 36 | cp -r ./libs module 37 | cp -r ./scripts/* module/system/bin 38 | cp gamelist.txt module 39 | cp LICENSE module 40 | cp NOTICE.md module 41 | 42 | # Remove .sh extension from scripts 43 | find module/system/bin -maxdepth 1 -type f -name "*.sh" -exec sh -c 'mv -- "$0" "${0%.sh}"' {} \; 44 | 45 | # Parse version info to module prop 46 | zipName="encore-$version-$release_code.zip" 47 | echo "zipName=$zipName" >>"$GITHUB_OUTPUT" 48 | 49 | # Generate sha256sum for integrity checkup 50 | for file in "${need_integrity[@]}"; do 51 | bash .github/scripts/gen_sha256sum.sh "$file" 52 | done 53 | 54 | # Zip the file 55 | cd ./module || { 56 | echo "Unable to cd to ./module" >&2 57 | exit 1 58 | } 59 | 60 | zip -r9 ../"$zipName" * -x *placeholder* *.map .shellcheckrc 61 | zip -z ../"$zipName" < 20 | 21 | bool create_lock_file(void) { 22 | int fd = open(LOCK_FILE, O_WRONLY | O_CREAT, 0644); 23 | if (fd == -1) { 24 | perror("open"); 25 | return false; 26 | } 27 | 28 | if (flock(fd, LOCK_EX | LOCK_NB) == -1) { 29 | close(fd); 30 | return false; 31 | } 32 | 33 | return true; 34 | } 35 | 36 | bool check_dumpsys_sanity(void) { 37 | FILE* file = fopen("/system/bin/dumpsys", "rb"); 38 | int ch; 39 | if (!file) { 40 | fprintf(stderr, "/system/bin/dumpsys: %s\n", strerror(errno)); 41 | LOGC("/system/bin/dumpsys: {}", strerror(errno)); 42 | goto insane; 43 | } 44 | 45 | ch = fgetc(file); 46 | if (ch == EOF) { 47 | if (feof(file)) { 48 | fprintf(stderr, "/system/bin/dumpsys was tampered by kill logger module\n"); 49 | LOGC("/system/bin/dumpsys was tampered by kill logger module"); 50 | goto insane; 51 | } 52 | 53 | fprintf(stderr, "/system/bin/dumpsys: %s\n", strerror(errno)); 54 | LOGC("/system/bin/dumpsys: {}", strerror(errno)); 55 | goto insane; 56 | } 57 | 58 | fclose(file); 59 | return true; 60 | 61 | insane: 62 | fclose(file); 63 | return false; 64 | } 65 | -------------------------------------------------------------------------------- /jni/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: LLVM 3 | Language: Cpp 4 | AccessModifierOffset: -4 5 | AlignAfterOpenBracket: AlwaysBreak 6 | AlignConsecutiveAssignments: false 7 | AlignConsecutiveDeclarations: false 8 | AlignEscapedNewlines: Right 9 | AlignOperands: true 10 | AlignTrailingComments: true 11 | AllowAllArgumentsOnNextLine: true 12 | AllowAllConstructorInitializersOnNextLine: true 13 | AllowAllParametersOfDeclarationOnNextLine: true 14 | AllowShortBlocksOnASingleLine: Empty 15 | AllowShortCaseLabelsOnASingleLine: true 16 | AllowShortFunctionsOnASingleLine: None 17 | AllowShortIfStatementsOnASingleLine: Always 18 | AllowShortLoopsOnASingleLine: true 19 | AlwaysBreakAfterReturnType: None 20 | AlwaysBreakBeforeMultilineStrings: true 21 | AlwaysBreakTemplateDeclarations: Yes 22 | BinPackArguments: true 23 | BinPackParameters: true 24 | BreakBeforeBraces: Attach 25 | BreakBeforeTernaryOperators: false 26 | BreakConstructorInitializers: BeforeComma 27 | ColumnLimit: 100 28 | CompactNamespaces: false 29 | ConstructorInitializerIndentWidth: 4 30 | ContinuationIndentWidth: 4 31 | Cpp11BracedListStyle: true 32 | DerivePointerAlignment: false 33 | FixNamespaceComments: true 34 | IndentCaseLabels: true 35 | IndentPPDirectives: BeforeHash 36 | IndentWidth: 4 37 | KeepEmptyLinesAtTheStartOfBlocks: false 38 | MaxEmptyLinesToKeep: 1 39 | NamespaceIndentation: None 40 | PointerAlignment: Right 41 | ReflowComments: Never 42 | SortIncludes: CaseSensitive 43 | SortUsingDeclarations: true 44 | SpaceAfterCStyleCast: false 45 | SpaceAfterLogicalNot: false 46 | SpaceAfterTemplateKeyword: true 47 | SpaceBeforeAssignmentOperators: true 48 | SpaceBeforeCpp11BracedList: false 49 | SpaceBeforeInheritanceColon: true 50 | SpaceBeforeParens: ControlStatements 51 | SpaceBeforeRangeBasedForLoopColon: true 52 | SpaceInEmptyParentheses: false 53 | SpacesInAngles: false 54 | SpacesInContainerLiterals: false 55 | SpacesInCStyleCastParentheses: false 56 | SpacesInParentheses: false 57 | SpacesInSquareBrackets: false 58 | Standard: Latest 59 | TabWidth: 4 60 | UseTab: Never 61 | -------------------------------------------------------------------------------- /website/docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Encore Tweaks" 3 | titleTemplate: Special performance module for your device 4 | description: "Encore Tweaks is a performace Magisk module featuring advanced App Monitoring, universal SoC support, and a WebUI for seamless configuration. It's reliable, free and open source." 5 | layout: home 6 | 7 | hero: 8 | name: Encore Tweaks 9 | text: Special performance module for your device 10 | tagline: "A no-nonsense performance module" 11 | image: 12 | src: /logo.avif 13 | alt: Encore Tweaks 14 | actions: 15 | - theme: brand 16 | text: What is Encore Tweaks? 17 | link: /guide/what-is-encore-tweaks 18 | - theme: alt 19 | text: Download Now 20 | link: /download 21 | - theme: alt 22 | text: View on GitHub 23 | link: https://github.com/Rem01Gaming/encore 24 | 25 | features: 26 | - icon: 🤖 27 | title: Fully Automatic Performance Optimization 28 | details: Encore Tweaks intelligently monitors apps and applies the optimal performance profile automatically, ensuring a smooth experience without manual configuration. 29 | - icon: 🔋 30 | title: Battery-Friendly Performance 31 | details: Encore Tweaks only activates performance scripts during gaming sessions, preserving battery life for everyday use. 32 | - icon: 📱 33 | title: Universal SoC Compatibility 34 | details: Encore Tweaks are compatible with any Android device, no matter how weird it is. 35 | - icon: 🚀 36 | title: Game-First Resource Allocation 37 | details: Encore Tweaks prioritizes gaming performance by allocating maximum CPU and I/O resources, ensuring lag-free gameplay. 38 | - icon: 🌐 39 | title: Integrated WebUI for Easy Configuration 40 | details: Encore Tweaks is the first performance module to feature a WebUI, allowing users to configure settings and manage operations with ease. 41 | - icon: 🤗 42 | title: Safe and Reliable 43 | details: With zero reported incidents of bootloops or bricked devices, Encore Tweaks is a trusted solution for performance optimization. 44 | -------------------------------------------------------------------------------- /webui/src/locales/strings/ko.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "module": "Encore Tweaks", 4 | "profile": "현재 프로필", 5 | "kernel": "커널", 6 | "chipset": "칩셋", 7 | "androidSDK": "안드로이드 SDK" 8 | }, 9 | "settings": { 10 | "title": "설정", 11 | "cpu_governor_title": "CPU 성능 모드", 12 | "dnd_gameplay": "게임 중 방해금지", 13 | "lite_mode": "라이트 모드", 14 | "device_mitigation": "디바이스 최적화", 15 | "default_cpu_gov": "기본 성능 모드", 16 | "powersave_cpu_gov": "절전 모드" 17 | }, 18 | "actions": { 19 | "title": "작업", 20 | "edit_gamelist": "게임 목록 편집", 21 | "create_shortcut": "웹 UI 바로가기 만들기", 22 | "save_logs": "모듈 로그 저장" 23 | }, 24 | "support": { 25 | "title": "후원하기", 26 | "description": "Encore Tweaks는 언제나 무료로 제공됩니다. 하지만 후원을 통해 관심과 감사의 마음을 표현할 수 있습니다." 27 | }, 28 | "toast": { 29 | "reboot_to_apply": "변경 사항 적용을 위해 기기를 재부팅하세요.", 30 | "has_shortcut": "바로가기가 이미 존재합니다.", 31 | "gamelist_save_success": "게임 목록이 성공적으로 저장되었습니다." 32 | }, 33 | "modal": { 34 | "dnd_title": "방해금지 모드", 35 | "dnd_desc": "게임 플레이 중 방해금지를 활성화합니다. 알림과 전화로 인한 방해를 최소화하여 게임에 집중할 수 있습니다.", 36 | "lite_mode_title": "라이트 모드", 37 | "lite_mode_desc": "이 옵션은 CPU와 다른 부품이 항상 최고 속도로 작동하지 않고 낮은 Hz로 동작하게 하여, 과열과 전력 소모를 줄입니다. 다만 전체 게임 성능에는 영향을 줄 수 있습니다.", 38 | "device_mitigation_title": "디바이스 최적화", 39 | "device_mitigation_desc": "특정 기기에서 발생할 수 있는 문제를 완화하고 호환성과 안정성을 높이기 위해 일부 조정을 적용합니다. 기기에서 문제가 발생할 때만 활성화하세요.", 40 | "unauthorized_mod_title": "허가되지 않은 수정 감지", 41 | "unauthorized_mod_desc": "이 모듈은 타인에 의해 수정되었을 수 있습니다. 보안을 위해 공식 Encore Tweaks 웹사이트에서 정식 버전을 다운로드하세요.", 42 | "edit_gamelist_title": "게임 목록 편집", 43 | "edit_gamelist_desc": "여기에 등록된 게임이나 앱을 실행하면 해당 성능 프로필이 자동으로 적용됩니다.", 44 | "save_changes": "변경 사항 저장", 45 | "cancel_changes": "변경 취소", 46 | "save_log_fail": "로그를 저장할 수 없습니다", 47 | "log_saved_title": "모듈 로그 저장 완료", 48 | "log_saved_desc": "로그가 {0}에 저장되었습니다." 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /webui/src/locales/strings/ja.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "module": "Encore Tweaks", 4 | "profile": "現在のプロファイル", 5 | "kernel": "カーネル", 6 | "chipset": "チップセット", 7 | "androidSDK": "Android SDK" 8 | }, 9 | "settings": { 10 | "title": "設定", 11 | "dnd_gameplay": "ゲームプレイ時にサイレントモード", 12 | "lite_mode": "ライトモード", 13 | "device_mitigation": "デバイス軽減", 14 | "default_cpu_gov": "デフォルトの CPU ガバナー", 15 | "powersave_cpu_gov": "省電力 CPU ガバナー" 16 | }, 17 | "actions": { 18 | "title": "アクション", 19 | "edit_gamelist": "ゲームリストを編集", 20 | "create_shortcut": "WebUI ショートカットを作成", 21 | "save_logs": "モジュールログを保存" 22 | }, 23 | "support": { 24 | "title": "サポートする", 25 | "description": "Encore Tweaks は無償で提供しています。これからもずっとです。ですが、寄付をすることで開発者への貢献に繋がります。" 26 | }, 27 | "modal": { 28 | "dnd_title": "サイレントモード", 29 | "dnd_desc": "ゲームのプレイ時にサイレントモードを有効化することで、通知や通話による阻害を抑制します。邪魔をされずにお気に入りのゲームをプレイすることができます。", 30 | "lite_mode_title": "ライトモード", 31 | "lite_mode_desc": "この設定は、ゲームのプレイ時の発熱と消費電力を抑えるために CPU やその他のコンポーネントを最高周波数で常に動作させずに、低い周波数で動作できるようにします。ゲームの全体的なパフォーマンスに影響を与える可能性があります。", 32 | "device_mitigation_title": "デバイスの問題を軽減", 33 | "device_mitigation_desc": "互換性と信頼性を高めるために特定の調整を適用することで、デバイス固有の不具合を軽減します。デバイスの電源を OFF にしたときに問題が発生しない限り、この機能は無効にしておいてください。", 34 | "edit_gamelist_title": "ゲームリストを編集", 35 | "edit_gamelist_desc": "ここにリストされたゲームやアプリを起動すると、パフォーマンスプロファイルが有効化されます。", 36 | "save_changes": "変更を保存", 37 | "cancel_changes": "変更をキャンセル", 38 | "unauthorized_mod_title": "不正な変更が検出されました", 39 | "unauthorized_mod_desc": "このモジュールは第三者によって改変されている可能性があります。安全性の確保のため、Encore Tweaks の公式ウェブサイトから公式バージョンをダウンロードしてください。", 40 | "save_log_fail": "ログを保存できません", 41 | "log_saved_desc": "ログは「{0}」に保存されました。", 42 | "log_saved_title": "モジュールのログを保存しました" 43 | }, 44 | "toast": { 45 | "reboot_to_apply": "変更を適用するにはデバイスを再起動してください。", 46 | "has_shortcut": "ショートカットは既に存在します。", 47 | "gamelist_save_success": "ゲームリストが正常に保存されました。" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /module/verify.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2024-2025 Rem01Gaming 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | TMPDIR_FOR_VERIFY="$TMPDIR/.vunzip" 18 | mkdir "$TMPDIR_FOR_VERIFY" 19 | 20 | abort_verify() { 21 | ui_print "*********************************************************" 22 | ui_print "! $1" 23 | ui_print "! Installation aborted. The module may be corrupted." 24 | ui_print "! Please re-download and try again." 25 | abort "*********************************************************" 26 | } 27 | 28 | # extract 29 | extract() { 30 | zip=$1 31 | file=$2 32 | dir=$3 33 | 34 | file_path="$dir/$file" 35 | hash_path="$TMPDIR_FOR_VERIFY/$file.sha256" 36 | 37 | unzip -o "$zip" "$file" -d "$dir" >&2 38 | [ -f "$file_path" ] || abort_verify "$file does not exists" 39 | 40 | unzip -o "$zip" "$file.sha256" -d "$TMPDIR_FOR_VERIFY" >&2 41 | [ -f "$hash_path" ] || abort_verify "Missing checksum for $file" 42 | 43 | (echo "$(cat "$hash_path") $file_path" | sha256sum -c -s -) || abort_verify "Checksum mismatch for $file" 44 | # ui_print "- Verified $file" >&1 45 | } 46 | 47 | file="META-INF/com/google/android/update-binary" 48 | file_path="$TMPDIR_FOR_VERIFY/$file" 49 | hash_path="$file_path.sha256" 50 | unzip -o "$ZIPFILE" "META-INF/com/google/android/*" -d "$TMPDIR_FOR_VERIFY" >&2 51 | [ -f "$file_path" ] || abort_verify "$file does not exists" 52 | if [ -f "$hash_path" ]; then 53 | (echo "$(cat "$hash_path") $file_path" | sha256sum -c -s -) || abort_verify "Checksum mismatch for $file" 54 | # ui_print "- Verified $file" >&1 55 | else 56 | ui_print "- Download from Magisk app" 57 | fi 58 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | description: Create a report to help us improve Encore Tweaks 3 | title: "[BUG]" 4 | labels: ["bug"] 5 | 6 | body: 7 | - type: checkboxes 8 | attributes: 9 | label: Please check before submitting an issue 10 | options: 11 | - label: I have searched the issues and haven't found anything relevant 12 | required: true 13 | 14 | - label: I will upload bugreport file in Encore Tweaks WebUI - Save Module Log 15 | required: true 16 | 17 | - label: I know how to reproduce the issue which may not be specific to my device 18 | required: false 19 | 20 | 21 | - type: textarea 22 | attributes: 23 | label: Describe the bug 24 | description: A clear and concise description of what the bug is 25 | validations: 26 | required: true 27 | 28 | 29 | - type: textarea 30 | attributes: 31 | label: To Reproduce 32 | description: Steps to reproduce the behaviour 33 | placeholder: | 34 | - 1. Go to '...' 35 | - 2. Click on '....' 36 | - 3. Scroll down to '....' 37 | - 4. See error 38 | 39 | 40 | - type: textarea 41 | attributes: 42 | label: Expected behavior 43 | description: A clear and concise description of what you expected to happen. 44 | 45 | 46 | - type: textarea 47 | attributes: 48 | label: Screenshots 49 | description: If applicable, add screenshots to help explain your problem. 50 | 51 | 52 | - type: textarea 53 | attributes: 54 | label: Logs 55 | description: If applicable, add crash or any other logs to help us figure out the problem. 56 | 57 | 58 | - type: textarea 59 | attributes: 60 | label: Device info 61 | value: | 62 | - Device: 63 | - OS Version: 64 | - Encore Tweaks Version: 65 | - Kernel Version: 66 | validations: 67 | required: true 68 | 69 | 70 | - type: textarea 71 | attributes: 72 | label: Additional context 73 | description: Add any other context about the problem here. 74 | -------------------------------------------------------------------------------- /docs/README_zh-CN.md: -------------------------------------------------------------------------------- 1 |

Encore Tweaks 标志

2 | 3 |

4 | 加入我们的 Telegram 频道 5 | 总下载量 6 | 最新稳定版本 7 | 许可证 8 |

9 | 10 | ## 关于 Encore Tweaks 11 | [English](/README.md) | [Bahasa Indonesia](/docs/README_id-ID.md) | [简体中文](/docs/README_zh-CN.md) 12 | 13 | **Encore Tweaks** 是一个动态的 Magisk 模块,旨在最大化您设备的游戏性能,同时在日常使用中智能地节省电池电量。非常适合那些要求流畅游戏体验而又不牺牲日常可用性的玩家! 14 | 15 | 有关此项目的更多信息,请访问 [Encore Tweaks 官方网站](https://encore.rem01gaming.dev/) 16 | 17 | ## 支持的 Root 管理器 18 | - [APatch](https://github.com/bmax121/APatch) 19 | - [KernelSU](https://github.com/tiann/KernelSU) 20 | - [Magisk](https://github.com/topjohnwu/Magisk) ([无 WebUI](https://github.com/topjohnwu/Magisk/issues/8609#event-15568590949)👀) 21 | 22 | ## 也支持在 23 | - [KsuWebUI](https://github.com/5ec1cff/KsuWebUIStandalone) ▶ 🌐 24 | - [MMRL](https://github.com/DerGoogler/MMRL) ▶ 🌐 25 | 26 | ## 资源 27 | - [常见问题解答](https://encore.rem01gaming.dev/guide/faq.html) - 常见问题解答 28 | - [配置指南](https://encore.rem01gaming.dev/guide/webui-and-configuration.html) - 如何配置 WebUI 29 | - [下载](https://encore.rem01gaming.dev/download) - 获取最新版本 30 | 31 | ## 社区与支持 32 | - [Telegram 频道](https://t.me/rem01schannel) - 了解最新公告 33 | - [报告问题](https://github.com/rem01gaming/encore/issues) - 发现了 bug?告诉我们! 34 | - [贡献代码](https://github.com/rem01gaming/encore/pulls) - 通过拉取请求提交改进 35 | 36 | ## 许可证 37 | Encore Tweaks 是根据 [Apache-2.0 许可证](https://www.apache.org/licenses/LICENSE-2.0) 开源的软件。 38 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build Encore Zip 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | -main 7 | workflow_dispatch: 8 | push: 9 | branches: 10 | - main 11 | paths: 12 | - '.github/workflows/build.yml' 13 | - '.github/scripts/**' 14 | - 'jni/**' 15 | - 'scripts/**' 16 | - 'module/**' 17 | - 'webui/**' 18 | - 'gamelist.txt' 19 | - 'version' 20 | 21 | # Allow only one concurrent build workflows 22 | concurrency: 23 | group: build 24 | cancel-in-progress: true 25 | 26 | jobs: 27 | build: 28 | name: Build Flashable Zip 29 | runs-on: ubuntu-latest 30 | steps: 31 | - name: Checkout 32 | uses: actions/checkout@v4.2.2 33 | with: 34 | fetch-depth: 0 35 | submodules: true 36 | 37 | - name: NDK Setup 38 | uses: nttld/setup-ndk@v1.5.0 39 | with: 40 | ndk-version: r29 41 | 42 | - name: Setup Bun 43 | uses: oven-sh/setup-bun@v2.0.2 44 | 45 | - name: Build Encore JNI 46 | run: ndk-build -j$(nproc --all) 47 | 48 | - name: Build WebUI 49 | working-directory: ./webui 50 | run: | 51 | bun install 52 | bun run build 53 | cp -r ./dist/* ../module/webroot 54 | 55 | - name: Compile Flashable Zip 56 | id: compileZip 57 | run: bash .github/scripts/compile_zip.sh 58 | 59 | - name: Upload Build Artifact 60 | uses: actions/upload-artifact@v4.6.2 61 | with: 62 | name: encore-build 63 | path: ${{ steps.compileZip.outputs.zipName }} 64 | 65 | - name: Upload To Telegram 66 | env: 67 | CHAT_ID: ${{ secrets.CHAT_ID }} 68 | BOT_TOKEN: ${{ secrets.BOT_TOKEN }} 69 | COMMIT_MESSAGE: ${{ github.event.head_commit.message }} 70 | COMMIT_URL: ${{ github.event.head_commit.url }} 71 | RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} 72 | TITLE: Encore Tweaks 73 | run: | 74 | if [ ! -z "${{ secrets.CHAT_ID }}" ] && [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then 75 | export VERSION=$(git rev-list --count HEAD) 76 | bash .github/scripts/telegram_bot.sh ${{ steps.compileZip.outputs.zipName }} 77 | else 78 | echo "Telegram bot token or chatid is undefined, please add it to repository secrets!" 79 | exit 1 80 | fi 81 | -------------------------------------------------------------------------------- /website/docs/guide/addon.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Encore Tweaks Addon" 3 | description: "Explore the Encore Tweaks Addon for dynamic performance optimization, API integration, and seamless module collaboration." 4 | --- 5 | 6 | # Encore Tweaks Addon 7 | 8 | In addition to applying various performance tweaks dinamically, Encore Tweaks also provide API for other modules to interact and work together as profile changes. 9 | 10 | Other module can watch current profile on Encore Tweaks and then apply their own tweaks as it changes, ultimately working together with Encore Tweaks as an Add-on. 11 | 12 | ::: tip 13 | If you find that the existing API doesn't meet your needs or is inconvenient to use, you're welcome to give us suggestions [here](https://github.com/Rem01Gaming/encore/issues)! 14 | ::: 15 | 16 | ::: tip Note 17 | All features are supported starting on Encore Tweaks 4.5 unless noted. 18 | ::: 19 | 20 | ## File Interface 21 | 22 | ### `/data/adb/.config/encore/current_profile` 23 | 24 | **Description**: Contains the current performance profile state as a numeric value 25 | 26 | **Possible Values**: 27 | 28 | | Value | Profile Mode | Description | 29 | |-------|-----------------|--------------------------------------------| 30 | | 0 | Perfcommon | Common performance optimization on startup | 31 | | 1 | Performance | Performance mode | 32 | | 2 | Normal | Default operating mode | 33 | | 3 | PowerSave | Battery saving mode | 34 | 35 | ### `/data/adb/.config/encore/gameinfo` 36 | 37 | **Description**: Contains active game session information when games from the Encore Tweaks gamelist are running 38 | 39 | **Format**: 40 | ``` 41 | 42 | ``` 43 | 44 | **Special Values**: 45 | - `NULL 0 0` when no game is active 46 | 47 | ## Logging System 48 | 49 | Encore Tweaks records events and errors in `/data/adb/.config/encore/encore.log` using a format similar to logcat. While consolidating logs is advantageous for debugging purposes, it poses challenges for other addons due to potential write conflicts and format discrepancies. 50 | 51 | With the release of Encore Tweaks 4.6, Encore has provided a straightforward method for addons to log their information through `encore_log`. 52 | 53 | ``` 54 | Usage: encore_log 55 | Levels: 0=DEBUG, 1=INFO, 2=WARN, 3=ERROR, 4=FATAL 56 | 57 | Example: 58 | encore_log MyAddon 0 Hello World! 59 | 60 | To see if the info successfully logged, run 'encore_utility logcat' or use Encore Tweaks WebUI. 61 | ``` 62 | -------------------------------------------------------------------------------- /webui/src/locales/strings/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "module": "Encore Tweaks", 4 | "profile": "الملف الشخصي الحالي", 5 | "kernel": "النواة", 6 | "chipset": "مجموعة الشرائح", 7 | "androidSDK": "Android SDK" 8 | }, 9 | "modal": { 10 | "dnd_title": "عدم الإزعاج", 11 | "dnd_desc": "تفعيل وضع عدم الإزعاج أثناء اللعب. يحد من مقاطعات الإشعارات والمكالمات، مما يسمح لك باللعب بدون تشتيت.", 12 | "lite_mode_title": "وضع Lite", 13 | "lite_mode_desc": "يقلل هذا الخيار من ارتفاع درجة الحرارة واستهلاك الطاقة أثناء اللعب، من خلال السماح لوحدة المعالجة المركزية والمكونات الأخرى بالعمل بتردد أقل بدلاً من التشغيل المستمر على أعلى تردد. قد يؤثر ذلك على أداء اللعبة بشكل عام.", 14 | "device_mitigation_title": "تخفيف الجهاز", 15 | "device_mitigation_desc": "يعالج بعض الأخطاء الخاصة بالجهاز من خلال تطبيق تعديلات لتحسين التوافق والموثوقية. يُرجى إبقاء هذه الميزة معطلة إلا إذا واجه جهازك مشاكل عند إيقاف التشغيل.", 16 | "edit_gamelist_title": "تحرير قائمة الألعاب", 17 | "edit_gamelist_desc": "سيتم تنشيط ملف الأداء عند تشغيل أي من الألعاب والتطبيقات المدرجة هنا.", 18 | "save_changes": "حفظ التغييرات", 19 | "cancel_changes": "إلغاء التغييرات", 20 | "unauthorized_mod_title": "تم كشف تعديلات غير مصرح بها", 21 | "unauthorized_mod_desc": "تلك الإضافة قد يكون تم التعديل فيها من طرف ثالث. من أجل حمايتك قم بتحميل النسخة الرسمية من موقع Encore Tweaks الرسمي.", 22 | "save_log_fail": "فشل في حفظ السجلات", 23 | "log_saved_title": "تم حفظ سجلات الإضافة", 24 | "log_saved_desc": "تم حقظ السجلات في {0}." 25 | }, 26 | "settings": { 27 | "title": "الإعدادات", 28 | "dnd_gameplay": "عدم الإزعاج أثناء اللعب", 29 | "lite_mode": "وضع Lite", 30 | "device_mitigation": "تخفيف الجهاز", 31 | "default_cpu_gov": "المنظم الافتراضي للمعالج", 32 | "powersave_cpu_gov": "منظم توفير الطاقة للمعالج", 33 | "cpu_governor_title": "مدير المعالج" 34 | }, 35 | "actions": { 36 | "title": "الإجراءات", 37 | "edit_gamelist": "تحرير قائمة الألعاب", 38 | "create_shortcut": "إنشاء اختصار WebUI", 39 | "save_logs": "حفظ سجلات الوحدة" 40 | }, 41 | "support": { 42 | "title": "ادعمني", 43 | "description": "Encore Tweaks مجاني وسيبقى دائمًا مجانيًا. لكن يمكنك إظهار دعمك من خلال التبرع." 44 | }, 45 | "toast": { 46 | "reboot_to_apply": "قم بإعادة تشغيل جهازك لتطبيق التغييرات.", 47 | "has_shortcut": "الإختصار موجود بالفعل.", 48 | "gamelist_save_success": "تم حفظ قائمة الألعاب." 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /jni/src/EncoreUtility/MiscUtility.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "EncoreUtility.hpp" 18 | 19 | #include 20 | #include 21 | 22 | void set_do_not_disturb(bool do_not_disturb) { 23 | if (do_not_disturb) { 24 | system("cmd notification set_dnd priority"); 25 | } else { 26 | system("cmd notification set_dnd off"); 27 | } 28 | } 29 | 30 | void notify(const char *message) { 31 | pid_t pid = fork(); 32 | 33 | if (pid == 0) { 34 | if (setgid(2000) != 0 || setuid(2000) != 0) { 35 | _exit(126); 36 | } 37 | 38 | const char *args[] = {"cmd", "notification", "post", "-t", 39 | NOTIFY_TITLE, LOG_TAG, message, NULL}; 40 | 41 | execvp("/system/bin/cmd", (char *const *)args); 42 | _exit(127); 43 | } else if (pid > 0) { 44 | int status; 45 | waitpid(pid, &status, 0); 46 | 47 | if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) [[unlikely]] { 48 | LOGE_TAG("Notify", "Push notification failed with status: {}", WEXITSTATUS(status)); 49 | } 50 | } else { 51 | LOGE_TAG("Notify", "fork failed: {}", strerror(errno)); 52 | } 53 | } 54 | 55 | void is_kanged(void) { 56 | std::vector module_properties; 57 | 58 | try { 59 | ModuleProperty::Get(MODULE_PROP, module_properties); 60 | 61 | for (const auto &property : module_properties) { 62 | if (property.key == "name" && property.value != "Encore Tweaks") { 63 | goto doorprize; 64 | } 65 | 66 | if (property.key == "author" && property.value != "Rem01Gaming") { 67 | goto doorprize; 68 | } 69 | } 70 | } catch (const std::exception &e) { 71 | LOGE_TAG("ModuleProperty", "{}", e.what()); 72 | } 73 | 74 | return; 75 | 76 | doorprize: 77 | LOGC("Module modified by 3rd party, exiting"); 78 | notify("Trying to rename me?"); 79 | exit(EXIT_FAILURE); 80 | } 81 | -------------------------------------------------------------------------------- /module/service.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2024-2025 Rem01Gaming 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | MODDIR=$(dirname "$0") 18 | MODULE_CONFIG="/data/adb/.config/encore" 19 | CLEANUP_SCRIPT="/data/adb/service.d/.encore_cleanup.sh" 20 | CPUFREQ="/sys/devices/system/cpu/cpu0/cpufreq" 21 | 22 | # Clear old logs 23 | rm -f "$MODULE_CONFIG/encore.log" 24 | 25 | # Parse Governor to use 26 | chmod 644 "$CPUFREQ/scaling_governor" 27 | default_gov=$(cat "$CPUFREQ/scaling_governor") 28 | echo "$default_gov" >$MODULE_CONFIG/default_cpu_gov 29 | 30 | # Create cleanup script 31 | [ ! -f "$CLEANUP_SCRIPT" ] && { 32 | mkdir -p "$(dirname $CLEANUP_SCRIPT)" 33 | cp "$MODDIR/cleanup.sh" "$CLEANUP_SCRIPT" 34 | chmod +x "$CLEANUP_SCRIPT" 35 | } 36 | 37 | # Wait until boot completed 38 | while [ -z "$(getprop sys.boot_completed)" ]; do 39 | sleep 40 40 | done 41 | 42 | # Handle case when 'default_gov' is performance 43 | # Skip this routine if custom_default_cpu_gov is defined 44 | default_gov_preferred_array=" 45 | scx 46 | schedhorizon 47 | walt 48 | sched_pixel 49 | sugov_ext 50 | uag 51 | schedplus 52 | energy_step 53 | schedutil 54 | interactive 55 | conservative 56 | powersave 57 | " 58 | 59 | if [ "$default_gov" == "performance" ] && [ ! -f $MODULE_CONFIG/custom_default_cpu_gov ]; then 60 | for gov in $default_gov_preferred_array; do 61 | grep -q "$gov" "$CPUFREQ/scaling_available_governors" && { 62 | echo "$gov" >$MODULE_CONFIG/default_cpu_gov 63 | default_gov="$gov" 64 | break 65 | } 66 | done 67 | fi 68 | 69 | # Revert to normal CPU governor 70 | custom_gov="$MODULE_CONFIG/custom_default_cpu_gov" 71 | [ -f "$custom_gov" ] && default_gov=$(cat "$custom_gov") 72 | echo "$default_gov" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 73 | [ ! -f $MODULE_CONFIG/powersave_cpu_gov ] && echo "$default_gov" >$MODULE_CONFIG/powersave_cpu_gov 74 | 75 | # Mitigate buggy thermal throttling on post-startup 76 | # in old MediaTek devices. 77 | ENABLE_PPM="/proc/ppm/enabled" 78 | if [ -f "$ENABLE_PPM" ]; then 79 | echo 0 >"$ENABLE_PPM" 80 | sleep 1 81 | echo 1 >"$ENABLE_PPM" 82 | fi 83 | 84 | # Start Encore Daemon 85 | encored daemon 86 | -------------------------------------------------------------------------------- /webui/src/locales/strings/uk.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "profile": "Поточний профіль", 4 | "kernel": "Ядро", 5 | "chipset": "Чипсет" 6 | }, 7 | "settings": { 8 | "title": "Налаштування", 9 | "cpu_governor_title": "Регулятор частоти ЦП", 10 | "dnd_gameplay": "«Не турбувати» під час гри", 11 | "lite_mode": "Спрощений режим", 12 | "device_mitigation": "Зменшення навантаження пристрою", 13 | "default_cpu_gov": "Типовий регулятор частоти ЦП", 14 | "powersave_cpu_gov": "Енергозберігаючий регулятор ЦП" 15 | }, 16 | "actions": { 17 | "title": "Дії", 18 | "edit_gamelist": "Редагувати список ігор", 19 | "create_shortcut": "Створити ярлик вебінтерфейсу", 20 | "save_logs": "Зберегти журнали модуля" 21 | }, 22 | "support": { 23 | "title": "Підтримати мене", 24 | "description": "Encore Tweaks є і завжди буде безкоштовним для всіх. Проте ви можете підтримати проєкт, зробивши пожертву." 25 | }, 26 | "toast": { 27 | "reboot_to_apply": "Перезавантажте пристрій, щоб застосувати зміни.", 28 | "has_shortcut": "Ярлик уже існує.", 29 | "gamelist_save_success": "Список ігор успішно збережено." 30 | }, 31 | "modal": { 32 | "dnd_title": "Не турбувати", 33 | "dnd_desc": "Увімкнути режим «Не турбувати» під час ігор. Обмежує сповіщення та виклики, щоб ніщо не відволікало від гри.", 34 | "lite_mode_title": "Спрощений режим", 35 | "lite_mode_desc": "Ця опція зменшує перегрів і споживання енергії під час ігор, дозволяючи процесору та іншим компонентам працювати на нижчих частотах замість постійно максимальних. Це вплине на загальну продуктивність гри.", 36 | "device_mitigation_title": "Обхід проблем пристрою", 37 | "device_mitigation_desc": "Пом’якшує специфічні для пристрою помилки за допомогою налаштувань для підвищення сумісності та надійності. Залишайте цю функцію вимкненою, якщо при її вимкненні проблем не виникає.", 38 | "unauthorized_mod_title": "Виявлено несанкціоновану модифікацію", 39 | "unauthorized_mod_desc": "Модуль міг бути змінений сторонньою особою. З міркувань безпеки завантажте офіційну версію з офіційного сайту Encore Tweaks.", 40 | "edit_gamelist_title": "Редагувати список ігор", 41 | "edit_gamelist_desc": "Профіль продуктивності буде активовано під час запуску будь-якої з перелічених тут ігор або застосунків.", 42 | "save_changes": "Зберегти зміни", 43 | "cancel_changes": "Скасувати зміни", 44 | "save_log_fail": "Не вдалося зберегти журнали", 45 | "log_saved_title": "Журнали модуля збережено", 46 | "log_saved_desc": "Журнали збережено у {0}." 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /webui/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | .pnpm-debug.log* 9 | 10 | # Diagnostic reports (https://nodejs.org/api/report.html) 11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (https://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # Snowpack dependency directory (https://snowpack.dev/) 46 | web_modules/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Optional stylelint cache 58 | .stylelintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variable files 76 | .env 77 | .env.development.local 78 | .env.test.local 79 | .env.production.local 80 | .env.local 81 | 82 | # parcel-bundler cache (https://parceljs.org/) 83 | .cache 84 | .parcel-cache 85 | 86 | # Next.js build output 87 | .next 88 | out 89 | 90 | # Nuxt.js build / generate output 91 | .nuxt 92 | dist 93 | 94 | # Gatsby files 95 | .cache/ 96 | # Comment in the public line in if your project uses Gatsby and not Next.js 97 | # https://nextjs.org/blog/next-9-1#public-directory-support 98 | # public 99 | 100 | # vuepress build output 101 | .vuepress/dist 102 | 103 | # vuepress v2.x temp and cache directory 104 | .temp 105 | .cache 106 | 107 | # Docusaurus cache and generated files 108 | .docusaurus 109 | 110 | # Serverless directories 111 | .serverless/ 112 | 113 | # FuseBox cache 114 | .fusebox/ 115 | 116 | # DynamoDB Local files 117 | .dynamodb/ 118 | 119 | # TernJS port file 120 | .tern-port 121 | 122 | # Stores VSCode versions used for testing VSCode extensions 123 | .vscode-test 124 | 125 | # yarn v2 126 | .yarn/cache 127 | .yarn/unplugged 128 | .yarn/build-state.yml 129 | .yarn/install-state.gz 130 | .pnp.* 131 | -------------------------------------------------------------------------------- /webui/src/locales/strings/jv.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "module": "Encore Tweaks", 4 | "profile": "Profil Saiki", 5 | "kernel": "Kernel", 6 | "chipset": "Chipset", 7 | "androidSDK": "Android SDK" 8 | }, 9 | "modal": { 10 | "dnd_title": "Mode Hening", 11 | "dnd_desc": "Aktifake mode hening nalika dolanan game. Ngalang-alangi notifikasi lan telpon supaya sampeyan bisa fokus dolanan tanpa gangguan.", 12 | "lite_mode_title": "Mode Lite", 13 | "lite_mode_desc": "Opsi iki bakal nyuda overheating lan konsumsi daya sajrone game kanthi ngidini CPU lan komponen liyane bisa mlaku kanthi frekuensi sing luwih murah tinimbang terus-terusan ing frekuensi paling dhuwur, iki bakal mengaruhi kinerja game sakabèhé.", 14 | "device_mitigation_title": "Mitigasi Piranti", 15 | "device_mitigation_desc": "Ngilangi sawetara bug khusus piranti kanthi ngetrapake pangaturan tartamtu kanggo nambah kompatibilitas lan linuwih, tetepake fitur iki dipateni kajaba piranti sampeyan ngalami masalah nalika dipateni.", 16 | "edit_gamelist_title": "Sunting Dhaptar Game", 17 | "edit_gamelist_desc": "Profil kinerja bakal diaktifake nalika game utawa aplikasi sing kadhaptar ing kene dibukak.", 18 | "save_changes": "Simpen Owahan", 19 | "cancel_changes": "Batalake Owahan", 20 | "unauthorized_mod_title": "Modifikasi tanpa wewenang dideteksi", 21 | "unauthorized_mod_desc": "Modul iki bisa uga wis diowahi dening pihak katelu. Kanggo keamanan sampeyan, mangga download versi resmi saka situs web Encore Tweaks resmi.", 22 | "save_log_fail": "Ora bisa nyimpen log", 23 | "log_saved_title": "Log Modul Disimpen", 24 | "log_saved_desc": "Log disimpen ing {0}." 25 | }, 26 | "actions": { 27 | "title": "Tindakan", 28 | "edit_gamelist": "Sunting Dhaptar Game", 29 | "create_shortcut": "Gawe Pintasan WebUI", 30 | "save_logs": "Simpen Log Modul" 31 | }, 32 | "support": { 33 | "description": "Encore Tweaks gratis lan bakal tetep gratis kanggo sapa wae. Nanging, sampeyan bisa nuduhake rasa peduli kanthi nyumbang.", 34 | "title": "Dukung Aku" 35 | }, 36 | "settings": { 37 | "title": "Setelan", 38 | "dnd_gameplay": "DND Nalika Main", 39 | "lite_mode": "Mode Lite", 40 | "device_mitigation": "Mitigasi Piranti", 41 | "default_cpu_gov": "Governor CPU Gawan", 42 | "powersave_cpu_gov": "Governor CPU Irit Daya", 43 | "cpu_governor_title": "CPU Governor" 44 | }, 45 | "toast": { 46 | "has_shortcut": "Pintasan wis ana.", 47 | "reboot_to_apply": "Reboot piranti kanggo ngetrapake owah-owahan.", 48 | "gamelist_save_success": "Dhaptar game kasil disimpen." 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /webui/src/locales/strings/vi.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "module": "Encore Tweaks", 4 | "kernel": "Kernel", 5 | "profile": "Cấu hình hiện tại", 6 | "chipset": "Chipset", 7 | "androidSDK": "Android SDK" 8 | }, 9 | "modal": { 10 | "dnd_title": "Không làm phiền", 11 | "dnd_desc": "Bật chế độ không làm phiền khi chơi game. Hạn chế thông báo và cuộc gọi để bạn có thể chơi mà không bị gián đoạn.", 12 | "lite_mode_title": "Chế độ Lite", 13 | "lite_mode_desc": "Tùy chọn này giúp giảm nhiệt và tiết kiệm năng lượng trong khi chơi game bằng cách cho phép CPU và các thành phần khác hoạt động ở tần số thấp hơn thay vì luôn ở tần số cao nhất. Điều này có thể ảnh hưởng đến hiệu suất tổng thể của trò chơi.", 14 | "device_mitigation_title": "Sửa lỗi thiết bị", 15 | "device_mitigation_desc": "Sửa một số lỗi của một số thiết bị đặc biệt bằng cách chỉnh vài cài đặt để tăng độ tương thích và tin cậy. Giữ tùy chọn này tắt trừ phi thiết bị của bạn gặp vấn đề.", 16 | "edit_gamelist_title": "Chỉnh sửa danh sách trò chơi", 17 | "edit_gamelist_desc": "Cấu hình hiệu suất sẽ được kích hoạt khi bất kỳ trò chơi hoặc ứng dụng nào trong danh sách này được mở.", 18 | "save_changes": "Lưu thay đổi", 19 | "cancel_changes": "Hủy thay đổi", 20 | "unauthorized_mod_title": "Đã phát hiện can thiệp bên ngoài", 21 | "save_log_fail": "Không thể lưu nhật kí", 22 | "unauthorized_mod_desc": "Module này có thể đã bị chỉnh sửa bởi một bên thứ ba. Vì an toàn của bạn, hãy tải bản chính thức từ trang web chính thức của Encore Tweaks.", 23 | "log_saved_desc": "Nhật kí được lưu tại {0}.", 24 | "log_saved_title": "Nhật ký của module đã được lưu" 25 | }, 26 | "actions": { 27 | "title": "Hành động", 28 | "edit_gamelist": "Chỉnh sửa danh sách trò chơi", 29 | "create_shortcut": "Tạo lối tắt WebUI", 30 | "save_logs": "Lưu nhật ký module" 31 | }, 32 | "settings": { 33 | "title": "Cài đặt", 34 | "dnd_gameplay": "DND khi chơi game", 35 | "lite_mode": "Chế độ Lite", 36 | "device_mitigation": "Sửa lỗi thiết bị", 37 | "default_cpu_gov": "Bộ điều chỉnh CPU mặc định", 38 | "powersave_cpu_gov": "Bộ điều chỉnh CPU tiết kiệm năng lượng", 39 | "cpu_governor_title": "Cơ chế tốc độ CPU" 40 | }, 41 | "support": { 42 | "description": "Encore Tweaks luôn miễn phí cho tất cả mọi người. Tuy nhiên, bạn có thể ủng hộ tôi bằng cách quyên góp.", 43 | "title": "Hỗ trợ tôi" 44 | }, 45 | "toast": { 46 | "reboot_to_apply": "Khởi động lại thiết bị để áp dụng các thay đổi.", 47 | "has_shortcut": "Lối tắt đã tồn tại.", 48 | "gamelist_save_success": "Đã lưu gamelist thành công." 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /webui/src/locales/strings/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "module": "Encore Tweaks", 4 | "profile": "Current Profile", 5 | "kernel": "Kernel", 6 | "chipset": "Chipset", 7 | "androidSDK": "Android SDK" 8 | }, 9 | "settings": { 10 | "title": "Settings", 11 | "cpu_governor_title": "CPU Governor", 12 | "dnd_gameplay": "DND on Gameplay", 13 | "lite_mode": "Lite Mode", 14 | "device_mitigation": "Device Mitigation", 15 | "default_cpu_gov": "Default CPU Governor", 16 | "powersave_cpu_gov": "Powersave CPU Governor" 17 | }, 18 | "actions": { 19 | "title": "Actions", 20 | "edit_gamelist": "Edit Gamelist", 21 | "create_shortcut": "Create WebUI Shortcut", 22 | "save_logs": "Save Module Logs" 23 | }, 24 | "support": { 25 | "title": "Support Me", 26 | "description": "Encore Tweaks is, and always will be, free for you, and everyone. You can however show me that you care by making a donation." 27 | }, 28 | "toast": { 29 | "reboot_to_apply": "Reboot your device to apply changes.", 30 | "has_shortcut": "Shortcut already exists.", 31 | "gamelist_save_success": "Gamelist saved successfully." 32 | }, 33 | "modal": { 34 | "dnd_title": "Do Not Disturb", 35 | "dnd_desc": "Enable do not disturb mode when playing games. Limits interruptions from notifications and calls, allowing you to play your favorite games without any distraction.", 36 | "lite_mode_title": "Lite Mode", 37 | "lite_mode_desc": "This option will reduces overheating and power consumption during gameplay by allowing CPU and other components to run at lower frequency rather than constantly at the highest frequency, this will affect overall game performance.", 38 | "device_mitigation_title": "Device Mitigation", 39 | "device_mitigation_desc": "Mitigate some device specific bugs by applying certain adjustments to enhance compatibility and reliability, keep this feature disabled unless your device experiences problems when it is switched off.", 40 | "unauthorized_mod_title": "Unauthorized modification detected", 41 | "unauthorized_mod_desc": "This module may have been modified by a third party. For your security, please download the official version from the official Encore Tweaks website.", 42 | "edit_gamelist_title": "Edit Gamelist", 43 | "edit_gamelist_desc": "The performance profile will be activated when any of the games and apps listed here are launched.", 44 | "save_changes": "Save Changes", 45 | "cancel_changes": "Cancel Changes", 46 | "save_log_fail": "Unable to save logs", 47 | "log_saved_title": "Module Logs Saved", 48 | "log_saved_desc": "Logs saved at {0}." 49 | } 50 | } -------------------------------------------------------------------------------- /docs/README_id-ID.md: -------------------------------------------------------------------------------- 1 |

Logo Encore Tweaks

2 | 3 |

4 | Subscribe Saluran Telegram Kami 5 | Jumlah Unduhan 6 | Versi Stabil Terbaru 7 | Lisensi 8 |

9 | 10 | ## Tentang Encore Tweaks 11 | [English](/README.md) | [Bahasa Indonesia](/docs/README_id-ID.md) | [简体中文](/docs/README_zh-CN.md) 12 | 13 | **Encore Tweaks** adalah modul Magisk dinamis yang dirancang untuk memaksimalkan performa gaming perangkat Anda sekaligus menghemat daya tahan baterai selama penggunaan sehari-hari. Sempurna untuk para gamer yang menginginkan gameplay yang mulus tanpa mengorbankan kegunaan sehari-hari! 14 | 15 | Info lebih lanjut tentang project ini di [Situs web resmi Encore Tweaks](https://encore.rem01gaming.dev/) 16 | 17 | ## Manajer Root yang Didukung 18 | 19 | - [APatch](https://github.com/bmax121/APatch) 20 | - [KernelSU](https://github.com/tiann/KernelSU) 21 | - [Magisk](https://github.com/topjohnwu/Magisk) ([no WebUI](https://github.com/topjohnwu/Magisk/issues/8609#event-15568590949)👀) 22 | 23 | ### Juga Didukung di 24 | 25 | - [KsuWebUI](https://github.com/5ec1cff/KsuWebUIStandalone) ▶ 🌐 26 | - [MMRL](https://github.com/DerGoogler/MMRL) ▶ 🌐 27 | 28 | ## Sumber Informasi 29 | 30 | - [FAQ](https://encore.rem01gaming.dev/guide/faq.html) - Pertanyaan umum terjawab 31 | - [Panduan Konfigurasi](https://encore.rem01gaming.dev/guide/webui-and-configuration.html) - Cara mengonfigurasi WebUI 32 | - [Download](https://encore.rem01gaming.dev/download) - Dapatkan versi terbaru 33 | 34 | ## Komunitas & Dukungan 35 | 36 | - [Telegram Channel](https://t.me/rem01schannel) - Tetap update dengan pengumuman 37 | - [Report Issues](https://github.com/rem01gaming/encore/issues) - Menemukan bug? Beri tahu kami! 38 | - [Contribute](https://github.com/rem01gaming/encore/pulls) - Kirimkan perbaikan melalui PR 39 | 40 | ## Lisensi 41 | 42 | Encore Tweaks adalah perangkat lunak open source yang dilisensikan di bawah [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0). 43 | -------------------------------------------------------------------------------- /website/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | .pnpm-debug.log* 9 | 10 | # Diagnostic reports (https://nodejs.org/api/report.html) 11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (https://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # Snowpack dependency directory (https://snowpack.dev/) 46 | web_modules/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Optional stylelint cache 58 | .stylelintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variable files 76 | .env 77 | .env.development.local 78 | .env.test.local 79 | .env.production.local 80 | .env.local 81 | 82 | # parcel-bundler cache (https://parceljs.org/) 83 | .cache 84 | .parcel-cache 85 | 86 | # Next.js build output 87 | .next 88 | out 89 | 90 | # Nuxt.js build / generate output 91 | .nuxt 92 | dist 93 | 94 | # Gatsby files 95 | .cache/ 96 | # Comment in the public line in if your project uses Gatsby and not Next.js 97 | # https://nextjs.org/blog/next-9-1#public-directory-support 98 | # public 99 | 100 | # vuepress build output 101 | .vuepress/dist 102 | 103 | # vuepress v2.x temp and cache directory 104 | .temp 105 | .cache 106 | 107 | # Docusaurus cache and generated files 108 | .docusaurus 109 | 110 | # Serverless directories 111 | .serverless/ 112 | 113 | # FuseBox cache 114 | .fusebox/ 115 | 116 | # DynamoDB Local files 117 | .dynamodb/ 118 | 119 | # TernJS port file 120 | .tern-port 121 | 122 | # Stores VSCode versions used for testing VSCode extensions 123 | .vscode-test 124 | 125 | # yarn v2 126 | .yarn/cache 127 | .yarn/unplugged 128 | .yarn/build-state.yml 129 | .yarn/install-state.gz 130 | .pnp.* 131 | 132 | # tailwindcss output 133 | src/output.css 134 | 135 | # vitepress 136 | docs/.vitepress/cache 137 | docs/.vitepress/dist 138 | -------------------------------------------------------------------------------- /webui/src/locales/strings/pt_BR.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "module": "Encore Tweaks", 4 | "profile": "Perfil Atual", 5 | "kernel": "Kernel", 6 | "chipset": "Chipset", 7 | "androidSDK": "Android SDK" 8 | }, 9 | "settings": { 10 | "title": "Configurações", 11 | "dnd_gameplay": "Não perturbar no jogo", 12 | "lite_mode": "Modo lite", 13 | "device_mitigation": "Mitigação de dispositivo", 14 | "default_cpu_gov": "Governador padrão da CPU", 15 | "powersave_cpu_gov": "Governador de CPU economia de energia", 16 | "cpu_governor_title": "Governador de CPU" 17 | }, 18 | "actions": { 19 | "title": "Ações", 20 | "edit_gamelist": "Editar lista de jogos", 21 | "create_shortcut": "Criar atalho do WebUI", 22 | "save_logs": "Gravar logs do módulo" 23 | }, 24 | "support": { 25 | "title": "Apoie-me", 26 | "description": "O Encore Tweaks é e sempre será gratuito para si e todos. No entanto, pode demonstrar o seu apoio fazendo uma doação." 27 | }, 28 | "modal": { 29 | "dnd_title": "Não perturbar", 30 | "dnd_desc": "Ativar o modo 'Não Perturbe' ao jogar. Isso limita interrupções de notificações e chamadas, permitindo que jogue sem distrações.", 31 | "lite_mode_title": "Modo lite", 32 | "lite_mode_desc": "Esta opção reduz o superaquecimento e o consumo de energia durante os jogos, permitindo que a CPU e outros componentes operem numa frequência mais baixa em vez de manterem a frequência máxima constantemente. Isto afetará o desempenho geral do jogo.", 33 | "device_mitigation_title": "Mitigação de dispositivo", 34 | "device_mitigation_desc": "Mitiga alguns bugs específicos de dispositivos aplicando ajustes para melhorar a compatibilidade e a confiabilidade. Mantenha esta função desativada, a menos que o seu dispositivo apresente problemas ao desligar.", 35 | "edit_gamelist_title": "Editar lista de jogos", 36 | "edit_gamelist_desc": "O perfil de desempenho será ativado quando qualquer um dos jogos e apps listadas aqui for iniciado.", 37 | "save_changes": "Gravar alterações", 38 | "cancel_changes": "Cancelar alterações", 39 | "unauthorized_mod_title": "Modificação não autorizada detetada", 40 | "unauthorized_mod_desc": "Este módulo pode ter sido modificado por outrem. Para a sua segurança, descarregue a versão oficial através do site Encore Tweaks.", 41 | "save_log_fail": "Não foi possível gravar os logs", 42 | "log_saved_desc": "Logs gravados em {0}.", 43 | "log_saved_title": "Registos gravados" 44 | }, 45 | "toast": { 46 | "reboot_to_apply": "Reinicie o seu aparelho para aplicar as mudanças.", 47 | "has_shortcut": "Atalho já existe.", 48 | "gamelist_save_success": "Gamelist gravada com sucesso." 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /webui/src/locales/strings/id.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "module": "Encore Tweaks", 4 | "profile": "Profil saat ini", 5 | "kernel": "Kernel", 6 | "chipset": "Chipset", 7 | "androidSDK": "Android SDK" 8 | }, 9 | "settings": { 10 | "title": "Pengaturan", 11 | "cpu_governor_title": "CPU Governor", 12 | "dnd_gameplay": "DND Saat Bermain", 13 | "lite_mode": "Mode Lite", 14 | "device_mitigation": "Mitigasi Perangkat", 15 | "default_cpu_gov": "CPU Governor Default", 16 | "powersave_cpu_gov": "CPU Governor Hemat Daya" 17 | }, 18 | "actions": { 19 | "title": "Aksi", 20 | "edit_gamelist": "Edit Daftar Permainan", 21 | "create_shortcut": "Buat Pintasan WebUI", 22 | "save_logs": "Simpan Log Modul" 23 | }, 24 | "support": { 25 | "title": "Dukung Saya", 26 | "description": "Encore Tweaks akan selalu gratis untuk semua orang. Namun Anda dapat menunjukkan kepedulian Anda dengan memberikan donasi." 27 | }, 28 | "toast": { 29 | "has_shortcut": "Pintasan sudah ada.", 30 | "gamelist_save_success": "Daftar permainan berhasil disimpan.", 31 | "reboot_to_apply": "Reboot perangkat Anda untuk menerapkan perubahan." 32 | }, 33 | "modal": { 34 | "dnd_title": "Mode Jangan Ganggu", 35 | "dnd_desc": "Aktifkan mode jangan ganggu saat bermain game. Batasi gangguan dari notifikasi dan panggilan, sehingga Anda dapat memainkan game favorit tanpa gangguan apa pun.", 36 | "lite_mode_title": "Mode Lite", 37 | "lite_mode_desc": "Pilihan ini akan mengurangi panas berlebih dan konsumsi daya selama bermain game dengan memungkinkan CPU dan komponen lainnya berjalan pada frekuensi yang lebih daripada terus-menerus pada frekuensi tertinggi. Ini akan memengaruhi performa game secara keseluruhan.", 38 | "device_mitigation_title": "Mitigasi Perangkat", 39 | "device_mitigation_desc": "Memitigasi beberapa bug khusus perangkat dengan menerapkan penyesuaian tertentu untuk meningkatkan kompatibilitas dan keandalan, tetap nonaktifkan fitur ini kecuali jika perangkat Anda mengalami masalah saat dimatikan.", 40 | "edit_gamelist_title": "Edit Daftar Permainan", 41 | "edit_gamelist_desc": "Profil kinerja akan diaktifkan ketika salah satu permainan dan aplikasi yang tercantum di sini diluncurkan.", 42 | "save_changes": "Simpan Perubahan", 43 | "cancel_changes": "Batalkan Perubahan", 44 | "unauthorized_mod_desc": "Modul ini mungkin telah dimodifikasi oleh pihak ketiga. Demi keamanan Anda, silakan unduh versi resmi dari situs web resmi Encore Tweaks.", 45 | "save_log_fail": "Tidak dapat menyimpan log", 46 | "unauthorized_mod_title": "Modifikasi tidak sah terdeteksi", 47 | "log_saved_title": "Log Modul Disimpan", 48 | "log_saved_desc": "Log disimpan di {0}." 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /jni/src/Dumpsys/Dumpsys.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | struct RecentAppList { 29 | std::string package_name; 30 | bool visible; 31 | }; 32 | 33 | struct DumpsysWindowDisplays { 34 | bool screen_awake; 35 | std::vector recent_app; 36 | }; 37 | 38 | struct DumpsysPower { 39 | bool screen_awake; 40 | bool is_plugged; 41 | bool battery_saver; 42 | bool battery_saver_sticky; 43 | }; 44 | 45 | namespace Dumpsys { 46 | 47 | /** 48 | * @brief Retrieves window display information by parsing `dumpsys window displays`. 49 | * 50 | * This function executes `dumpsys window displays` and parses its output to determine 51 | * the screen's awake state and a list of recent applications. 52 | * 53 | * @param result A reference to a DumpsysWindowDisplays struct to store the parsed information. 54 | * @throws std::runtime_error if popen fails or if required information cannot be found in the dumpsys output. 55 | */ 56 | void WindowDisplays(DumpsysWindowDisplays &result); 57 | 58 | /** 59 | * @brief Retrieves power-related information by parsing `dumpsys power`. 60 | * 61 | * This function executes `dumpsys power` and parses its output to determine 62 | * the screen's awake state, whether the device is plugged in, and the status 63 | * of battery saver modes. 64 | * 65 | * @param result A reference to a DumpsysPower struct to store the parsed information. 66 | * @throws std::runtime_error if popen fails or if required information cannot be found in the dumpsys output. 67 | */ 68 | void Power(DumpsysPower &result); 69 | 70 | /** 71 | * @brief Gets the Process ID (PID) of an application by its package name. 72 | * 73 | * This function executes `dumpsys activity top` and searches for the line 74 | * corresponding to the given package name to extract its PID. 75 | * 76 | * @param package_name The package name of the application to find. 77 | * @return The PID of the application if found. 78 | * @throws std::runtime_error if popen fails, the package is not found, or the PID cannot be extracted. 79 | */ 80 | pid_t GetAppPID(const std::string &package_name); 81 | 82 | } // namespace Dumpsys 83 | -------------------------------------------------------------------------------- /webui/src/locales/strings/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "module": "Encore Tweaks", 4 | "profile": "Текущий профиль", 5 | "kernel": "Ядро", 6 | "chipset": "Чипсет", 7 | "androidSDK": "Android SDK" 8 | }, 9 | "settings": { 10 | "title": "Настройки", 11 | "dnd_gameplay": "DND в геймплее", 12 | "lite_mode": "Режим Lite", 13 | "device_mitigation": "Смягчение проблем устройства", 14 | "default_cpu_gov": "CPU Governor по умолчанию", 15 | "powersave_cpu_gov": "Энергосберегающий CPU Governor", 16 | "cpu_governor_title": "Управление процессором" 17 | }, 18 | "actions": { 19 | "title": "Действия", 20 | "edit_gamelist": "Редактировать список игр", 21 | "create_shortcut": "Создать ярлык WebUI", 22 | "save_logs": "Сохранить логи модуля" 23 | }, 24 | "support": { 25 | "title": "Поддержите меня", 26 | "description": "Encore Tweaks всегда был и будет бесплатным для вас и для всех. Однако вы можете показать свою поддержку, сделав пожертвование." 27 | }, 28 | "modal": { 29 | "dnd_title": "Не беспокоить", 30 | "dnd_desc": "Включает режим «Не беспокоить» во время игры, что ограничивает прерывания от уведомлений и звонков, позволяя вам наслаждаться любимыми играми без отвлекающих факторов.", 31 | "lite_mode_title": "Режим Lite", 32 | "lite_mode_desc": "Эта опция снижает перегрев и энергопотребление во время игры, позволяя процессору и другим компонентам работать на более низкой частоте, а не постоянно на максимальной. Это может повлиять на общую производительность игры.", 33 | "device_mitigation_title": "Смягчение проблем устройства", 34 | "device_mitigation_desc": "Устраняет некоторые ошибки, специфичные для устройства, применяя определённые настройки для улучшения совместимости и надежности. Оставьте эту функцию выключенной, если ваше устройство не испытывает проблем при выключении.", 35 | "edit_gamelist_title": "Редактировать список игр", 36 | "edit_gamelist_desc": "Профиль производительности будет активирован при запуске любой из указанных игр и приложений.", 37 | "save_changes": "Сохранить изменения", 38 | "cancel_changes": "Отменить изменения", 39 | "unauthorized_mod_title": "Обнаружена несанкционированная модификация", 40 | "unauthorized_mod_desc": "Этот модуль мог быть изменен третьей стороной. Для вашей безопасности, пожалуйста, загрузите официальную версию с официального сайта Encore Tweaks.", 41 | "log_saved_title": "Сохранение журналов модулей", 42 | "log_saved_desc": "Журналы сохраняются по адресу {0}.", 43 | "save_log_fail": "Невозможно сохранить логи" 44 | }, 45 | "toast": { 46 | "reboot_to_apply": "Перезагрузите своё устройство, чтобы изменения вступили в силу.", 47 | "has_shortcut": "Ярлык уже существует.", 48 | "gamelist_save_success": "Список игр успешно сохранен." 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /webui/src/locales/strings/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "chipset": "Chipset", 4 | "profile": "Perfil Actual", 5 | "module": "Encore Tweaks", 6 | "kernel": "Núcleo del sistema", 7 | "androidSDK": "Android SDK" 8 | }, 9 | "settings": { 10 | "device_mitigation": "Mitigación de Dispositivo", 11 | "lite_mode": "Modo Lite", 12 | "default_cpu_gov": "Gobernador de CPU Predeterminado", 13 | "title": "Configuraciones", 14 | "dnd_gameplay": "No Molestar en juegos", 15 | "powersave_cpu_gov": "Gobernador de CPU para Ahorro de Batería", 16 | "cpu_governor_title": "Gobernador de CPU" 17 | }, 18 | "modal": { 19 | "lite_mode_title": "Modo Lite", 20 | "dnd_title": "No Molestar", 21 | "device_mitigation_title": "Mitigación de dispositivo", 22 | "edit_gamelist_desc": "El perfil de rendimiento se activará cuando se inicie cualquiera de los juegos y aplicaciones listados aquí.", 23 | "save_changes": "Guardar Cambios", 24 | "cancel_changes": "Cancelar Cambios", 25 | "edit_gamelist_title": "Modificar lista de juegos", 26 | "dnd_desc": "Activa el modo No Molestar mientras juegas. Limita las interrupciones de notificaciones y llamadas, permitiéndote jugar a tus juegos favoritos sin distracciones.", 27 | "lite_mode_desc": "Esta opción reducirá el sobrecalentamiento y el consumo de energía durante el juego al permitir que la CPU y otros componentes funcionen a una frecuencia más baja en lugar de frecuencia altas constantemente; esto afectará el rendimiento general de los juegos.", 28 | "device_mitigation_desc": "Mitiga algunos errores específicos del dispositivo aplicando ciertos ajustes para mejorar la compatibilidad y confiabilidad. Mantén esta función deshabilitada a menos que tu dispositivo experimente problemas cuando esté apagado.", 29 | "save_log_fail": "No se pudieron guardar los registros", 30 | "unauthorized_mod_title": "Modificación no autorizada detectada", 31 | "unauthorized_mod_desc": "Este módulo pudo haber sido modificado por un tercero. Por tu seguridad, descarga la versión oficial del sitio web oficial de Encore Tweaks.", 32 | "log_saved_desc": "Registros guardados en {0}.", 33 | "log_saved_title": "Registros del módulo guardados" 34 | }, 35 | "actions": { 36 | "edit_gamelist": "Modificar Lista de Juegos", 37 | "title": "Acciones", 38 | "save_logs": "Guardar Registros de Módulo", 39 | "create_shortcut": "Crear Atajo para WebUI" 40 | }, 41 | "support": { 42 | "description": "Encore Tweaks es, y siempre será, gratuito para ti y para todos. Sin embargo, puedes mostrar interés haciendo una donación.", 43 | "title": "Apóyame" 44 | }, 45 | "toast": { 46 | "has_shortcut": "Ya existe un atajo.", 47 | "gamelist_save_success": "Lista de juegos guardada satisfactoriamente.", 48 | "reboot_to_apply": "Reinicia tu dispositivo para aplicar los cambios." 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /website/docs/guide/webui-and-configuration.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "WebUI Configuration Guide" 3 | description: "Learn how to configure Encore Tweaks settings via Module WebUI for optimized performance on Android devices." 4 | --- 5 | 6 | # Module WebUI and Configuration 7 | 8 | The **Encore Tweaks** module offers a variety of performance-tuning settings accessible through the [Module WebUI](https://kernelsu.org/guide/module-webui.html)—a feature of **KernelSU** that allows modules to build interactive HTML, CSS, and JavaScript interfaces. This WebUI makes it easy for users to configure Encore Tweaks without needing to manually edit configuration files. 9 | 10 | While **KernelSU** and **APatch** support WebUI natively in their managers, **Magisk** does not. If you're using Magisk, you can still access the WebUI using the [KSU WebUI APK](https://t.me/rem01schannel/636) or [WebUI X](https://play.google.com/store/apps/details?id=com.dergoogler.mmrl.wx). 11 | 12 | ::: details Preview of Encore Tweaks WebUI 13 | ![Encore Tweaks WebUI](/Screenshot_20250520-161223_MMRL.avif) 14 | ::: 15 | 16 | ## Configuration Options 17 | 18 | ### Kill Logger 19 | Stops system logging services to reduce background activity and performance overhead. 20 | 21 | ::: tip Deprecated 22 | This feature has been removed in version 4.3 and later due to root detection issues. 23 | ::: 24 | 25 | ::: warning 26 | Do **NOT** enable this if you're debugging ROMs or apps. It disables system logging entirely, which may cause issues with apps that rely on `logd`. 27 | ::: 28 | 29 | ### DND on Gameplay 30 | Automatically enables **Do Not Disturb** mode while gaming to block notifications and interruptions, ensuring an uninterrupted experience. 31 | 32 | ### Device Mitigation 33 | Mitigate some device specific bugs by applying certain adjustments to enhance compatibility and reliability, keep this feature disabled unless your device experiences problems when it is switched off. 34 | 35 | ### Lite Mode 36 | This setting will minimize overheating and reduce power usage while gaming by allowing the CPU and other parts to operate at lower frequencies instead of always running at peak performance; however, this choice will impact the overall performance of the game. 37 | 38 | ### Default CPU Governor 39 | Sets the CPU governor used in the **Normal** profile. The governor determines how the CPU scales frequency based on system load, affecting both power efficiency and performance. 40 | 41 | ### Powersave CPU Governor 42 | Defines the CPU governor for the **Powersave** profile, optimized for battery life. If not explicitly set, it will use the default CPU governor. 43 | 44 | ### Edit Gamelist 45 | Allows you to manage a list of games and performance-demanding apps. When any listed app is launched, Encore Tweaks automatically switches to the **Performance** profile. 46 | 47 | ### Create WebUI Shortcut 48 | Allows you to create a shortcut to Encore Tweaks WebUI, WebUI X is required. 49 | 50 | ### Save Logs 51 | Stores Encore daemon logs in internal storage for troubleshooting purposes. These logs can help diagnose issues or confirm profile behavior. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Encore Tweaks Logo

2 | 3 |

4 | Join Our Telegram Channel 5 | Total Downloads 6 | Latest Stable Version 7 | License 8 |

9 | 10 | ## About Encore Tweaks 11 | [English](/README.md) | [Bahasa Indonesia](/docs/README_id-ID.md) | [简体中文](/docs/README_zh-CN.md) 12 | 13 | **Encore Tweaks** is a dynamic Magisk module designed to maximize your device's gaming performance while intelligently preserving battery life during everyday use. Perfect for gamers who demand smooth gameplay without compromising daily usability! 14 | 15 | More info about this project on [Official Encore Tweaks website](https://encore.rem01gaming.dev/) 16 | 17 | ## Supported Root Managers 18 | 19 | - [APatch](https://github.com/bmax121/APatch) 20 | - [KernelSU](https://github.com/tiann/KernelSU) 21 | - [Magisk](https://github.com/topjohnwu/Magisk) ([no WebUI](https://github.com/topjohnwu/Magisk/issues/8609#event-15568590949)👀) 22 | 23 | ### Also Supported on 24 | 25 | - [KsuWebUI](https://github.com/5ec1cff/KsuWebUIStandalone) ▶ 🌐 26 | - [MMRL](https://github.com/DerGoogler/MMRL) ▶ 🌐 27 | 28 | ## Resources 29 | 30 | - [FAQ](https://encore.rem01gaming.dev/guide/faq.html) - Common questions answered 31 | - [Configuration Guide](https://encore.rem01gaming.dev/guide/webui-and-configuration.html) - How to configure the WebUI 32 | - [Download](https://encore.rem01gaming.dev/download) - Get the latest version 33 | 34 | ## Community & Support 35 | 36 | - [Telegram Channel](https://t.me/rem01schannel) - Stay updated with announcements 37 | - [Report Issues](https://github.com/rem01gaming/encore/issues) - Found a bug? Let us know! 38 | - [Contribute](https://github.com/rem01gaming/encore/pulls) - Submit improvements via PR 39 | 40 | ## Translation 41 | 42 | Interested in translating Encore Tweaks? We use Weblate to crowdsource translations, so anyone can create an account and contribute! 43 | 44 | Visit our translation project [here](https://hosted.weblate.org/projects/encore-tweaks/). 45 | 46 | ### Translation status 47 | 48 | ![Weblate translation status](https://hosted.weblate.org/widget/encore-tweaks/webui/horizontal-auto.svg) 49 | 50 | ## License 51 | 52 | Encore Tweaks is open-sourced software licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0). 53 | -------------------------------------------------------------------------------- /jni/src/EncoreUtility/EncoreUtility.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | /** 29 | * @brief Creates and locks a file to ensure single instance execution. 30 | * 31 | * Attempts to create a lock file and acquire an exclusive, non-blocking lock on it. 32 | * @return true if the lock file was created and locked successfully, false otherwise. 33 | */ 34 | bool create_lock_file(void); 35 | 36 | /** 37 | * @brief Checks if the /system/bin/dumpsys executable is sane. 38 | * 39 | * This function performs a basic sanity check on the dumpsys binary to ensure it has not been 40 | * tampered with (e.g., emptied by a kill logger module). 41 | * @return true if the dumpsys binary appears to be sane, false otherwise. 42 | */ 43 | bool check_dumpsys_sanity(void); 44 | 45 | /** 46 | * @brief Retrieves the UID of a given package name by checking its data directory. 47 | * 48 | * @param package_name The package name of the application (e.g., "com.termux"). 49 | * @return The UID of the package if found, otherwise 0. 50 | */ 51 | uid_t get_uid_by_package_name(const std::string& package_name); 52 | 53 | /** 54 | * @brief Posts a notification via shell. 55 | * 56 | * @param message The message content of the notification. 57 | * @note It is only intended for use in an Android environment. 58 | */ 59 | void notify(const char* message); 60 | 61 | /** 62 | * @brief Sets the do not disturb mode via shell. 63 | * 64 | * @param do_not_disturb True to enable DND mode, false to disable. 65 | * @note It is only intended for use in an Android environment. 66 | */ 67 | void set_do_not_disturb(bool do_not_disturb); 68 | 69 | /** 70 | * @brief Verifies the module's integrity. 71 | * 72 | * This function checks the `module.prop` file for specific 'name' and 'author' 73 | * fields to ensure the module has not been modified or redistributed by 74 | * unauthorized third parties. If the check fails, it logs a critical error, 75 | * sends a notification, and terminates the program. 76 | */ 77 | void is_kanged(void); 78 | 79 | /** 80 | * @brief Sets all environment variables for the profiler 81 | * @param lite_mode Whether lite mode is enabled from gameregistry 82 | */ 83 | void set_profiler_env_vars(bool lite_mode); 84 | 85 | void run_perfcommon(void); 86 | void apply_performance_profile(bool lite_mode, std::string game_pkg, pid_t game_pid); 87 | void apply_balance_profile(); 88 | void apply_powersave_profile(); 89 | -------------------------------------------------------------------------------- /webui/src/locales/strings/tr.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "module": "Encore Tweaks", 4 | "profile": "Geçerli Profil", 5 | "kernel": "Çekirdek", 6 | "chipset": "Yonga Seti", 7 | "androidSDK": "Android SDK" 8 | }, 9 | "settings": { 10 | "title": "Ayarlar", 11 | "dnd_gameplay": "Oyun Sırasında Rahatsız Etme", 12 | "lite_mode": "Hafif Mod", 13 | "device_mitigation": "Cihaz Düzeltme", 14 | "default_cpu_gov": "Varsayılan CPU Yöneticisi", 15 | "powersave_cpu_gov": "Güç Tasarrufu CPU Yöneticisi", 16 | "cpu_governor_title": "CPU Denetleyici" 17 | }, 18 | "actions": { 19 | "title": "Eylemler", 20 | "edit_gamelist": "Oyun Listesini Düzenle", 21 | "create_shortcut": "WebUI Kısayolu Oluştur", 22 | "save_logs": "Modül Günlüklerini Kaydet" 23 | }, 24 | "support": { 25 | "title": "Beni Destekle", 26 | "description": "Encore Tweaks, sizler ve herkes için her zaman ücretsizdir ve ücretsiz kalacaktır. Ancak, bir bağış yaparak bana destek olduğunuzu gösterebilirsiniz." 27 | }, 28 | "toast": { 29 | "reboot_to_apply": "Değişiklikleri uygulamak için cihazınızı yeniden başlatın.", 30 | "has_shortcut": "Kısayol zaten mevcut.", 31 | "gamelist_save_success": "Oyun listesi başarıyla kaydedildi." 32 | }, 33 | "modal": { 34 | "dnd_title": "Rahatsız Etme", 35 | "dnd_desc": "Oyun oynarken rahatsız etmeme modunu etkinleştirin. Bildirimler ve aramalar nedeniyle kesintileri sınırlandırarak favori oyunlarınızı dikkatiniz dağılmadan oynayabilirsiniz.", 36 | "lite_mode_title": "Hafif Mod", 37 | "lite_mode_desc": "Bu seçenek, oyun sırasında aşırı ısınmayı ve güç tüketimini azaltmak için CPU ve diğer bileşenlerin sürekli en yüksek frekansta çalışmak yerine daha düşük frekansta çalışmasını sağlar. Bu, genel oyun performansını etkileyebilir.", 38 | "device_mitigation_title": "Cihaz Düzeltme", 39 | "device_mitigation_desc": "Bazı cihazlara özgü hataları azaltmak için belirli düzenlemeler uygulayarak uyumluluğu ve güvenilirliği artırır. Cihazınız kapalıyken sorun yaşamadıkça bu özelliği devre dışı bırakın.", 40 | "shortcut_unavailable_title": "Kısayol Kullanılamıyor", 41 | "shortcut_unavailable_desc": "WebUI kısayol API'si yalnızca WebUI X motorunda kullanılabilir. Lütfen MMRL veya KernelSU Next gibi WebUI X destekli bir yönetici kullanın.", 42 | "unauthorized_mod_title": "Yetkisiz Değişiklik Tespit Edildi", 43 | "unauthorized_mod_desc": "Bu modül, üçüncü bir taraf tarafından değiştirilmiş olabilir. Güvenliğiniz için lütfen resmi Encore Tweaks web sitesinden resmi sürümü indirin.", 44 | "edit_gamelist_title": "Oyun Listesini Düzenle", 45 | "edit_gamelist_desc": "Burada listelenen oyunlar veya uygulamalar başlatıldığında performans profili etkinleştirilecektir.", 46 | "save_changes": "Değişiklikleri Kaydet", 47 | "cancel_changes": "Değişiklikleri İptal Et", 48 | "gamelist_fetch_fail": "Oyun listesi alınamadı", 49 | "gamelist_save_fail": "Oyun listesi kaydedilemedi", 50 | "save_log_fail": "Günlükler kaydedilemedi", 51 | "log_saved_desc": "Günlükler {0} konumuna kaydedildi.", 52 | "log_saved_title": "Modül Günlükleri Kaydedildi" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /jni/src/GameRegistry/GameRegistry.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include "Encore.hpp" 26 | #include "EncoreLog.hpp" 27 | 28 | class GameRegistry { 29 | private: 30 | std::unordered_map game_packages_; 31 | mutable std::shared_mutex mutex_; 32 | 33 | public: 34 | /** 35 | * @brief Loads game list from JSON file 36 | * @param filename Path to the JSON file 37 | * @return True if successful, false otherwise 38 | */ 39 | bool load_from_json(const std::string &filename); 40 | 41 | /** 42 | * @brief Populates game list from base file and saves as JSON 43 | * @param gamelist Output JSON file path 44 | * @param baselist Input base file path 45 | * @return True if successful, false otherwise 46 | */ 47 | static bool populate_from_base(const std::string &gamelist, const std::string &baselist); 48 | 49 | /** 50 | * @brief Updates the game registry with new game list data 51 | * @param new_list The new list of games to register 52 | */ 53 | void update_gamelist(const std::vector &new_list); 54 | 55 | /** 56 | * @brief Finds a game by package name 57 | * @param package_name The package name to search for 58 | * @return Optional containing the game if found, empty if not found 59 | */ 60 | std::optional find_game(const std::string &package_name) const; 61 | 62 | /** 63 | * @brief Finds a game by package name (pointer version for performance) 64 | * @param package_name The package name to search for 65 | * @return Pointer to the game if found, nullptr if not found 66 | */ 67 | const EncoreGameList *find_game_ptr(const std::string &package_name) const; 68 | 69 | /** 70 | * @brief Checks if a package is registered as a game 71 | * @param package_name The package name to check 72 | * @return True if the package is a registered game 73 | */ 74 | bool is_game_registered(const std::string &package_name) const; 75 | 76 | /** 77 | * @brief Gets the number of registered games 78 | * @return The number of games in the registry 79 | */ 80 | size_t size() const; 81 | 82 | /** 83 | * @brief Gets all registered game package names 84 | * @return Vector of all package names 85 | */ 86 | std::vector get_all_package_names() const; 87 | 88 | private: 89 | /** 90 | * @brief Validates a game entry before adding to registry 91 | * @param game The game entry to validate 92 | * @return True if the entry is valid 93 | */ 94 | bool validate_game_entry(const EncoreGameList &game) const; 95 | }; 96 | 97 | extern GameRegistry game_registry; 98 | -------------------------------------------------------------------------------- /jni/include/ShellUtility.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | /** 27 | * @brief Opens a process by creating a pipe, forking, and invoking execvp. 28 | * 29 | * This function is a replacement for `popen` that directly takes a vector of strings 30 | * as arguments, avoiding the need for shell interpretation. This is safer as it 31 | * prevents shell injection vulnerabilities. The function creates a pipe, forks the 32 | * process, and in the child process, executes the command specified by `args`. 33 | * The standard output of the child process is redirected to the pipe. The parent 34 | * process receives a `FILE*` stream to read from the child's standard output. 35 | * 36 | * @param args A vector of strings where the first element is the command to execute 37 | * and subsequent elements are its arguments. 38 | * @return A `std::unique_ptr` that wraps the file stream 39 | * for reading the child's stdout. The file is automatically closed when the 40 | * unique_ptr goes out of scope. Returns a null-holding unique_ptr on failure. 41 | */ 42 | inline std::unique_ptr popen_direct(const std::vector &args) { 43 | int pipefd[2]; 44 | if (pipe(pipefd) == -1) { 45 | return {nullptr, fclose}; 46 | } 47 | 48 | pid_t pid = fork(); 49 | if (pid == -1) { 50 | close(pipefd[0]); 51 | close(pipefd[1]); 52 | return {nullptr, fclose}; 53 | } 54 | 55 | if (pid == 0) { // Child 56 | close(pipefd[0]); 57 | dup2(pipefd[1], STDOUT_FILENO); 58 | close(pipefd[1]); 59 | 60 | std::vector cargs; 61 | for (const auto &arg : args) { 62 | cargs.push_back(const_cast(arg.c_str())); 63 | } 64 | cargs.push_back(nullptr); 65 | 66 | execvp(cargs[0], cargs.data()); 67 | _exit(127); 68 | } else { // Parent 69 | close(pipefd[1]); 70 | return {fdopen(pipefd[0], "r"), fclose}; 71 | } 72 | } 73 | 74 | /** 75 | * @brief Executes a shell command with formatted arguments. 76 | * 77 | * This function is a wrapper around the standard `system()` call, providing `printf`-like 78 | * formatting for constructing the command string. 79 | * 80 | * @param format A format string as you would use with `printf`. 81 | * @param ... Additional arguments to be formatted into the command string. 82 | * @return The return value of the `system()` call. 83 | */ 84 | inline int systemv(const char* format, ...) { 85 | char command[512]; 86 | va_list args; 87 | va_start(args, format); 88 | vsnprintf(command, sizeof(command), format, args); 89 | va_end(args); 90 | return system(command); 91 | } 92 | -------------------------------------------------------------------------------- /jni/src/EncoreConfig/InotifyHandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "EncoreConfig.hpp" 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | enum WatchContext { 25 | WATCH_CONTEXT_GAMELIST, 26 | WATCH_CONTEXT_CONFIG, 27 | }; 28 | 29 | void on_json_modified( 30 | const struct inotify_event *event, const std::string &path, int context, 31 | void *additional_data) { 32 | (void)additional_data; 33 | 34 | auto OnGamelistModified = [&](const std::string &path) -> void { 35 | LOGD_TAG("InotifyHandler", "Callback OnGamelistModified reached"); 36 | game_registry.load_from_json(path); 37 | }; 38 | 39 | auto OnConfigModified = [&](const std::string &path) -> void { 40 | LOGD_TAG("InotifyHandler", "Callback OnConfigModified reached"); 41 | 42 | if (!config_store.reload()) { 43 | LOGW_TAG("InotifyHandler", "Failed to reload config from {}", path); 44 | return; 45 | } 46 | 47 | // Apply new log level 48 | auto prefs = config_store.get_preferences(); 49 | EncoreLog::set_log_level(prefs.log_level); 50 | }; 51 | 52 | // After the JSON was closed for writing 53 | if (event->mask & IN_CLOSE_WRITE) { 54 | switch (context) { 55 | case WATCH_CONTEXT_GAMELIST: OnGamelistModified(path); break; 56 | case WATCH_CONTEXT_CONFIG: OnConfigModified(path); break; 57 | default: break; 58 | } 59 | } 60 | } 61 | 62 | bool init_file_watcher(InotifyWatcher &watcher) { 63 | try { 64 | // Initialize config store first 65 | if (!config_store.load_config()) { 66 | LOGE_TAG("EncoreConfig", "Failed to load config file"); 67 | return false; 68 | } 69 | 70 | // Apply log level from config 71 | auto prefs = config_store.get_preferences(); 72 | EncoreLog::set_log_level(prefs.log_level); 73 | 74 | // Set up file watchers 75 | InotifyWatcher::WatchReference gamelist_ref{ 76 | ENCORE_GAMELIST, on_json_modified, WATCH_CONTEXT_GAMELIST, nullptr}; 77 | 78 | InotifyWatcher::WatchReference config_ref{ 79 | CONFIG_FILE, on_json_modified, WATCH_CONTEXT_CONFIG, nullptr}; 80 | 81 | if (!watcher.addFile(gamelist_ref)) { 82 | LOGE_TAG("InotifyWatcher", "Failed to add gamelist watch"); 83 | return false; 84 | } 85 | 86 | if (!watcher.addFile(config_ref)) { 87 | LOGE_TAG("InotifyWatcher", "Failed to add config watch"); 88 | return false; 89 | } 90 | 91 | watcher.start(); 92 | return true; 93 | } catch (const std::runtime_error &e) { 94 | std::string error_msg = e.what(); 95 | LOGE_TAG("InotifyWatcher", "{}", error_msg); 96 | return false; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /webui/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: ["./src/**/*.{html,js,ts,jsx,tsx}"], 4 | theme: { 5 | extend: { 6 | colors: { 7 | /* App Base Colors */ 8 | "primary": "var(--primary, #ffb0ccff)", 9 | "on-primary": "var(--onPrimary, #541d35ff)", 10 | "primary-container": "var(--primaryContainer, #6f334bff)", 11 | "on-primary-container": "var(--onPrimaryContainer, #ffd9e4ff)", 12 | "inverse-primary": "var(--inversePrimary, #8b4a63ff)", 13 | "secondary": "var(--secondary, #e2bdc8ff)", 14 | "on-secondary": "var(--onSecondary, #422932ff)", 15 | "secondary-container": "var(--secondaryContainer, #5a3f48ff)", 16 | "on-secondary-container": "var(--onSecondaryContainer, #ffd9e4ff)", 17 | "tertiary": "var(--tertiary, #f0bc95ff)", 18 | "on-tertiary": "var(--onTertiary, #48290dff)", 19 | "tertiary-container": "var(--tertiaryContainer, #623f21ff)", 20 | "on-tertiary-container": "var(--onTertiaryContainer, #ffdcc4ff)", 21 | "background": "var(--background, #1c1014ff)", 22 | "on-background": "var(--onBackground, #f2dde2ff)", 23 | "surface": "var(--surface, #1c1014ff)", 24 | "tonal-surface": "var(--tonalSurface, #28181dff)", 25 | "on-surface": "var(--onSurface, #f2dde2ff)", 26 | "surface-variant": "var(--surfaceVariant, #514347ff)", 27 | "on-surface-variant": "var(--onSurfaceVariant, #d5c2c6ff)", 28 | "surface-tint": "var(--surfaceTint, #ffb0ccff)", 29 | "inverse-surface": "var(--inverseSurface, #f2dde2ff)", 30 | "inverse-on-surface": "var(--inverseOnSurface, #392d31ff)", 31 | "error": "var(--error, #f2b8b5ff)", 32 | "on-error": "var(--onError, #601410ff)", 33 | "error-container": "var(--errorContainer, #8c1d18ff)", 34 | "on-error-container": "var(--onErrorContainer, #f9dedcff)", 35 | "outline": "var(--outline, #9d8c91ff)", 36 | "outline-variant": "var(--outlineVariant, #514347ff)", 37 | "scrim": "var(--scrim, #000000ff)", 38 | 39 | "surface-bright": "var(--surfaceBright, #433639ff)", 40 | "surface-dim": "var(--surfaceDim, #1c1014ff)", 41 | "surface-container": "var(--surfaceContainer, #281c20ff)", 42 | "surface-container-high": "var(--surfaceContainerHigh, #33272aff)", 43 | "surface-container-highest": "var(--surfaceContainerHighest, #3e3135ff)", 44 | "surface-container-low": "var(--surfaceContainerLow, #23191cff)", 45 | "surface-container-lowest": "var(--surfaceContainerLowest, #18090fff)", 46 | 47 | /* Filled Tonal Button Colors */ 48 | "filled-tonal-button-content-color": "var(--filledTonalButtonContentColor, #ffd9e4ff)", 49 | "filled-tonal-button-container-color": "var(--filledTonalButtonContainerColor, #5a3f48ff)", 50 | "filled-tonal-button-disabled-content-color": "var(--filledTonalButtonDisabledContentColor, #f2dde261)", 51 | "filled-tonal-button-disabled-container-color": "var(--filledTonalButtonDisabledContainerColor, #f2dde21f)", 52 | 53 | /* Filled Card Colors */ 54 | "filled-card-content-color": "var(--filledCardContentColor, #f2dde2ff)", 55 | "filled-card-container-color": "var(--filledCardContainerColor, #3e3135ff)", 56 | "filled-card-disabled-content-color": "var(--filledCardDisabledContentColor, #f2dde261)", 57 | "filled-card-disabled-container-color": "var(--filledCardDisabledContainerColor, #45383cff)", 58 | }, 59 | }, 60 | }, 61 | plugins: [require("daisyui")], 62 | }; 63 | -------------------------------------------------------------------------------- /website/docs/guide/what-is-encore-tweaks.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "What is Encore Tweaks?" 3 | description: "Encore Tweaks is an performance Magisk module designed to boost device performance for gaming while preserving battery life during regular use." 4 | --- 5 | 6 | # What is Encore Tweaks? 7 | Encore Tweaks is a Magisk Module created to enhance device performance during gaming sessions, while keeping battery life optimized for normal use. With **fully automatic performance profiles** and **wide compatibility** across various SoCs, Encore Tweaks adapts dynamically to boost your device's performance when it matters most. 8 | 9 | ## Why Encore Tweaks? 10 | 11 | ### Automatic Performance Profiles 12 | No need to manually adjust performance settings; Encore Tweaks automatically switches profiles based on app usage, allowing you to focus on what matters. 13 | 14 | ### Battery-Friendly Performance 15 | Encore Tweaks only activates performance scripts during gaming sessions, preserving battery life for everyday use. Encore Tweaks also can cut your power consumption on battery saver mode. 16 | 17 | ### It Works Everywhere 18 | Encore Tweaks are compatible with any Android device, no matter how weird it is. Supporting Snapdragon, MediaTek, Exynos, Google Tensor, Tegra, and even Unisoc, with custom optimizations tailored for each. 19 | 20 | ### Game-First Resource Allocation 21 | Encore Tweaks prioritizes gaming performance by allocating maximum CPU and I/O resources, ensuring lag-free gameplay. 22 | 23 | ### Safe and Reliable 24 | Zero brick or bootloop related incidents was reported from the beginning of release, Encore Tweaks also have been tested in multiple devices to ensure its reliability across different devices. 25 | 26 | ## How Encore Tweaks Works 27 | Encore Tweaks works like a automated profiling system, it's dynamically adjusts your device's performance based on real-time data, such as the currently running app, screen state (awake or not), and battery saver mode. Using this information, it seamlessly switches between different profiles to optimize performance or save power as needed. 28 | 29 | ### Profiles Overview 30 | 31 | #### Performance Profile 32 | - **Activation**: Automatically enabled when an app or game listed in the **Gamelist** is launched and screen was awake. 33 | - **Purpose**: Ensures maximum responsiveness and stability during intensive tasks. Sets **CPU**, **GPU**, and **DRAM** frequencies to their highest frequency and prioritizes **CPU** and **I/O** resources for Game to minimize lag and jitter. 34 | 35 | --- 36 | 37 | #### Powersave Profile 38 | - **Activation**: Automatically enabled when the device is in **Battery Saver Mode** (except while charging). 39 | - **Purpose**: Maximizes power efficiency for extended battery life, limits non-essential component frequencies to their lowest frequency. 40 | 41 | --- 42 | 43 | #### Normal Profile 44 | - **Activation**: Applied when neither Performance nor Powersave conditions are met. 45 | - **Purpose**: Allows the device to operate under default system behavior without any special tweaks. 46 | 47 | ## Installation 48 | 1. [Download Encore Tweaks](/download) from the official page. 49 | 2. Flash it via **Magisk/KernelSU/APatch**. 50 | 3. Reboot your device, and you're ready to go! 51 | 52 | ## Configuration 53 | Encore Tweaks provides a user-friendly WebUI for managing settings and adjusting preferences. For details, visit the [Module WebUI and Configuration Guide](/guide/webui-and-configuration). 54 | 55 | ## FAQ 56 | Have a question? Check out our [FAQ page](/guide/faq). If you still have questions, join our Telegram Group [@rem01shideout](https://t.me/rem01shideout). 57 | -------------------------------------------------------------------------------- /website/docs/guide/faq.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Frequently Asked Questions" 3 | description: "Answers to frequently asked questions about Encore Tweaks, covering device compatibility, configuration, activation, and troubleshooting." 4 | --- 5 | 6 | # Frequently Asked Questions 7 | 8 | Find answers to common questions about using Encore Tweaks, including setup, supported devices, troubleshooting, and more. 9 | 10 | ## Does Encore Tweaks support my device? 11 | Encore Tweaks is compatible with a wide range of devices, including those using Mediatek, Snapdragon, Google Tensor, Exynos, Tegra, and Unisoc chipsets. Even if your device doesn't use one of these chipsets, you may still be able to use Encore Tweaks. 12 | 13 | ## Where's the Encore Tweaks app? 14 | Encore Tweaks never had an App for UI configuration, you maybe meant the [Module WebUI](/guide/webui-and-configuration). 15 | 16 | ## How I can change the performance profile manually? 17 | For now, Encore Tweaks doesn't have manual profile selection. however Encore Tweaks service will change performance profile automatically for you so you don't have to tune anything. 18 | 19 | ## Do Encore Tweaks impact battery life? 20 | While playing game Encore Tweaks will comsume more power, but on normal usage this module will not consume more power. you can also cut your power consumption by using powersave profile by Encore Tweaks (with enabling battery saver mode). 21 | 22 | ## How can I configure Encore Tweaks? 23 | Encore Tweaks offers a user-friendly WebUI for adjusting settings and preferences. For detailed instructions, check out the [Module WebUI and Configuration Guide](/guide/webui-and-configuration). 24 | 25 | ## How do I activate Encore Tweaks? 26 | Encore Tweaks automatically runs on boot, so you don't need to start it manually. 27 | 28 | ## Is Encore Tweaks a scheduler module similar to Uperf? 29 | No, Encore Tweaks works in more traditional way compared to Uperf, it's never meant to be a scheduler such as Uperf and Tritium nor integrated with Scene and other managers. 30 | 31 | ## Does Encore Tweaks require a BusyBox module? 32 | No, Encore Tweaks does not require a BusyBox module. 33 | 34 | ## Why I can't open Encore Tweaks WebUI? (only showing white page or inoperable) 35 | This mainly caused by your ROM WebView version is too old, to fix this [update your WebView](https://play.google.com/store/apps/details?id=com.google.android.webview) to the latest version. 36 | 37 | ## Why are some games randomly boosting even when they’re closed? 38 | Some games attend to run on background hence causing random boosts. to prevent random boosts, force stop the affected games and restrict them from running in the background. If needed, you can also remove them from gamelist. 39 | 40 | ## How can I access WebUI? 41 | - **KernelSU or APatch Users**: Click "open" in the module card to access the WebUI. 42 | - **Magisk Users**: Native WebUI support isn't available in Magisk. Use [KSU WebUI APK](https://t.me/rem01schannel/636) or [MMRL](https://github.com/DerGoogler/MMRL) to access the WebUI if needed. 43 | 44 | ## What should I do if I find a bug or issue in Encore Tweaks? 45 | Report any issues or bugs [here](https://github.com/Rem01Gaming/encore/issues). 46 | 47 | ## Can I use Encore Tweaks with other performance modules? 48 | We do not recommend using Encore Tweaks alongside other performance modules, as they are likely to conflict. This includes modules like YAKT, Magnetar, RiProG AI, Mtkfest, and Mtkvest. However, Thermal Killer and Thermal mod modules can be safely used alongside Encore Tweaks. 49 | 50 | ## How can I add games to the Gamelist? 51 | You can add games to the Gamelist via the WebUI, you can find the guide [here](/guide/webui-and-configuration). 52 | -------------------------------------------------------------------------------- /jni/include/ModuleProperty.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | struct ModuleProperties { 26 | std::string key; 27 | std::string value; 28 | }; 29 | 30 | namespace ModuleProperty { 31 | 32 | /** 33 | * @brief Reads all properties from module.prop file 34 | * 35 | * @param path The path to the module.prop file 36 | * @param result Vector of ModuleProperties, which will be filled with the key-value pairs from module.prop 37 | * @throws std::runtime_error If R/W operation failed 38 | */ 39 | inline void Get(const std::string &path, std::vector &result) { 40 | result.clear(); 41 | 42 | std::ifstream in(path); 43 | if (!in.is_open()) { 44 | throw std::system_error( 45 | errno, std::generic_category(), "Failed to open module.prop file: " + path); 46 | } 47 | 48 | std::string line; 49 | while (std::getline(in, line)) { 50 | if (line.empty() || line[0] == '#') continue; 51 | 52 | size_t pos = line.find('='); 53 | if (pos != std::string::npos) { 54 | std::string key = line.substr(0, pos); 55 | std::string value = line.substr(pos + 1); 56 | result.push_back({key, value}); 57 | } 58 | } 59 | 60 | in.close(); 61 | } 62 | 63 | /** 64 | * @brief Changes module.prop based on the provided data 65 | * 66 | * @param path The path to the module.prop file 67 | * @param data A vector of ModuleProperties containing the key-value pairs to be changed in module.prop 68 | * @throws std::runtime_error If R/W operation failed 69 | * @note This function will only change the values of the keys specified in the data vector, leaving others intact 70 | */ 71 | inline void Change(const std::string &path, const std::vector &data) { 72 | namespace fs = std::filesystem; 73 | 74 | std::map props; 75 | 76 | if (fs::exists(path)) { 77 | std::ifstream in(path); 78 | if (in.is_open()) { 79 | std::string line; 80 | while (std::getline(in, line)) { 81 | if (line.empty() || line[0] == '#') continue; 82 | if (size_t pos = line.find('='); pos != std::string::npos) { 83 | props[line.substr(0, pos)] = line.substr(pos + 1); 84 | } 85 | } 86 | in.close(); 87 | } 88 | } 89 | 90 | for (const auto &p : data) { 91 | props[p.key] = p.value; 92 | } 93 | 94 | std::ofstream out(path, std::ios::trunc); 95 | if (!out) { 96 | throw std::system_error( 97 | errno, std::generic_category(), "Failed to open module.prop for writing: " + path); 98 | } 99 | 100 | for (const auto &[k, v] : props) { 101 | out << k << "=" << v << '\n'; 102 | } 103 | 104 | out.close(); 105 | if (!out.good()) { 106 | throw std::runtime_error("Error writing to module.prop: " + path); 107 | } 108 | } 109 | 110 | } // namespace ModuleProperty 111 | -------------------------------------------------------------------------------- /scripts/encore_utility.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # Copyright (C) 2024-2025 Rem01Gaming 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # shellcheck disable=SC2317,SC3006,SC3018,SC3034,SC3057,SC3037 19 | 20 | # Config dir 21 | MODULE_CONFIG="/data/adb/.config/encore" 22 | 23 | change_cpu_gov() { 24 | chmod 644 /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 25 | echo "$1" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 26 | chmod 444 /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 27 | } 28 | 29 | set_dnd() { 30 | case $1 in 31 | # Turn off DND mode 32 | 0) cmd notification set_dnd off ;; 33 | # Turn on DND mode 34 | 1) cmd notification set_dnd priority ;; 35 | esac 36 | } 37 | 38 | save_logs() { 39 | [ ! -d /sdcard/Download ] && mkdir /sdcard/Download 40 | log_file="/sdcard/Download/encore_bugreport_$(date +"%Y-%m-%d_%H_%M").txt" 41 | SOC="Unknown" 42 | 43 | case $(<$MODULE_CONFIG/soc_recognition) in 44 | 1) SOC="MediaTek" ;; 45 | 2) SOC="Snapdragon" ;; 46 | 3) SOC="Exynos" ;; 47 | 4) SOC="Unisoc" ;; 48 | 5) SOC="Tensor" ;; 49 | 6) SOC="Intel" ;; 50 | 7) SOC="Tegra" ;; 51 | 8) SOC="Kirin" ;; 52 | esac 53 | 54 | echo "$log_file" 55 | cat <"$log_file" 56 | ***************************************************** 57 | Encore Tweaks Log 58 | 59 | Module Version: $(awk -F'=' '/version=/ {print $2}' /data/adb/modules/encore/module.prop) 60 | Chipset: $SOC $(getprop ro.board.platform) 61 | Fingerprint: $(getprop ro.build.fingerprint) 62 | Android SDK: $(getprop ro.build.version.sdk) 63 | Kernel: $(uname -r -m) 64 | ***************************************************** 65 | 66 | $(<$MODULE_CONFIG/encore.log) 67 | EOF 68 | } 69 | 70 | logcat() { 71 | # Clear screen 72 | echo -ne "\e[H\e[2J\e[3J" 73 | 74 | # Trap CTRL+C and exit gracefully 75 | trap 'echo -ne "\e[H\e[2J\e[3J"; exit 0' INT 76 | 77 | # Detect SoC 78 | SOC="Unknown" 79 | case $(<$MODULE_CONFIG/soc_recognition) in 80 | 1) SOC="MediaTek" ;; 81 | 2) SOC="Snapdragon" ;; 82 | 3) SOC="Exynos" ;; 83 | 4) SOC="Unisoc" ;; 84 | 5) SOC="Tensor" ;; 85 | 6) SOC="Intel" ;; 86 | 7) SOC="Tegra" ;; 87 | 8) SOC="Kirin" ;; 88 | esac 89 | 90 | # Header 91 | echo -e "\e[1;36m┌────────────────────────────────────────────┐" 92 | echo -e "│ \e[1;37mEncore Tweaks Log Viewer\e[1;36m │" 93 | echo -e "└────────────────────────────────────────────┘\e[0m" 94 | 95 | # Info block 96 | echo -e " 97 | \e[1;32mModule Version:\e[0m $(awk -F'=' '/version=/ {print $2}' /data/adb/modules/encore/module.prop) 98 | \e[1;32mChipset:\e[0m $SOC $(getprop ro.board.platform) 99 | \e[1;32mFingerprint:\e[0m $(getprop ro.build.fingerprint) 100 | \e[1;32mAndroid SDK:\e[0m $(getprop ro.build.version.sdk) 101 | \e[1;32mKernel:\e[0m $(uname -r -m) 102 | 103 | \e[1;33m[Log Stream Started — press CTRL+C to exit]\e[0m 104 | " 105 | 106 | # Tail log 107 | tail -f $MODULE_CONFIG/encore.log | while read -r line; do 108 | timestamp="${line:0:23}" 109 | level_char=$(echo "$line" | awk '{print $3}') 110 | msg="${line:24}" 111 | 112 | # Set color based on level 113 | case "$level_char" in 114 | W) level_color="\e[1;33m" ;; # Yellow 115 | E) level_color="\e[1;31m" ;; # Red 116 | F) level_color="\e[1;31m" ;; # Red 117 | *) level_color="\e[0m" ;; # Default 118 | esac 119 | 120 | echo -e "\e[1;32m$timestamp\e[0m ${level_color}${msg}\e[0m" 121 | done 122 | } 123 | 124 | # shellcheck disable=SC2068 125 | $@ 126 | -------------------------------------------------------------------------------- /website/docs/.vitepress/theme/custom.css: -------------------------------------------------------------------------------- 1 | :root{ 2 | --vp-home-hero-image-background-image: linear-gradient( 3 | -45deg, 4 | #f6c1d5 50%, 5 | #cdb4f4 50% 6 | ); 7 | --vp-home-hero-image-filter: blur(50px); 8 | } 9 | 10 | html.dark { 11 | color-scheme: dark; 12 | } 13 | 14 | html.light { 15 | color-scheme: light; 16 | } 17 | 18 | html { 19 | scroll-behavior: smooth; 20 | } 21 | 22 | .vp-doc h2 { 23 | border: none; 24 | margin-top: 10px; 25 | } 26 | 27 | .vp-doc h2:first-child { 28 | border-top: 1px; 29 | } 30 | 31 | 32 | 33 | .VPLocalNav { 34 | padding-top: 0 !important; 35 | margin-top: var(--vp-layout-top-height); 36 | } 37 | 38 | .reached-top { 39 | top: var(--vp-layout-top-height) !important; 40 | } 41 | 42 | .banner ~ .reached-top { 43 | top: 0px !important; 44 | } 45 | 46 | .VPNav { 47 | transition: 48 | background-color 0.5s, 49 | top 0.35s ease-out !important; 50 | } 51 | 52 | #app a:focus-visible, 53 | #app button:focus-visible, 54 | #app input[type='checkbox']:focus-visible { 55 | --at-apply: outline-1 outline-primary ring-2 ring-primary; 56 | } 57 | 58 | 59 | .VPSidebar::-webkit-scrollbar { 60 | background: transparent; 61 | height: 8px; 62 | width: 8px; 63 | margin-right: 8px; 64 | } 65 | 66 | 67 | #app > div > div.VPLocalNav > div > div > div.outline { 68 | outline-style: none !important; 69 | } 70 | 71 | .vp-doc .color-swatch { 72 | display: inline-block; 73 | width: 0.85em; 74 | height: 0.85em; 75 | min-width: 12px; 76 | min-height: 12px; 77 | font-size: inherit; 78 | border: 0; 79 | border-radius: 2px; 80 | margin: 0 3px 0 6px; 81 | cursor: pointer; 82 | } 83 | 84 | 85 | 86 | .medium-zoom-overlay { 87 | z-index: 20; 88 | } 89 | 90 | .medium-zoom-image { 91 | z-index: 21; 92 | } 93 | 94 | @keyframes slide-enter { 95 | 0% { 96 | transform: translateY(10px); 97 | opacity: 0; 98 | } 99 | 100 | to { 101 | transform: translateY(0); 102 | opacity: 100; 103 | } 104 | } 105 | 106 | @media (prefers-reduced-motion: no-preference) { 107 | html:not(.no-sliding) [slide-enter], 108 | html:not(.no-sliding) .slide-enter, 109 | html:not(.no-sliding) .main > div > *, 110 | html:not(.no-sliding) #VPContent > div > div.VPFeatures.VPHomeFeatures > *, 111 | html:not(.no-sliding) .TeamPage > *, 112 | html:not(.no-sliding) .VPHomeHero > * { 113 | --enter-stage: 0; 114 | --enter-step: 90ms; 115 | --enter-initial: 0ms; 116 | animation: slide-enter 1s both 1; 117 | animation-delay: calc( 118 | var(--enter-initial) + var(--enter-stage) * var(--enter-step) 119 | ); 120 | } 121 | 122 | .main > div > *:nth-child(1) { 123 | --enter-stage: 1; 124 | } 125 | .main > div > *:nth-child(2) { 126 | --enter-stage: 2; 127 | } 128 | .main > div > *:nth-child(3) { 129 | --enter-stage: 3; 130 | } 131 | .main > div > *:nth-child(4) { 132 | --enter-stage: 4; 133 | } 134 | .main > div > *:nth-child(5) { 135 | --enter-stage: 5; 136 | } 137 | .main > div > *:nth-child(6) { 138 | --enter-stage: 6; 139 | } 140 | .main > div > *:nth-child(7) { 141 | --enter-stage: 7; 142 | } 143 | .main > div > *:nth-child(8) { 144 | --enter-stage: 8; 145 | } 146 | .main > div > *:nth-child(9) { 147 | --enter-stage: 9; 148 | } 149 | .main > div > *:nth-child(10) { 150 | --enter-stage: 10; 151 | } 152 | .main > div > *:nth-child(11) { 153 | --enter-stage: 11; 154 | } 155 | .main > div > *:nth-child(12) { 156 | --enter-stage: 12; 157 | } 158 | .main > div > *:nth-child(13) { 159 | --enter-stage: 13; 160 | } 161 | .main > div > *:nth-child(14) { 162 | --enter-stage: 14; 163 | } 164 | .main > div > *:nth-child(15) { 165 | --enter-stage: 15; 166 | } 167 | .main > div > *:nth-child(16) { 168 | --enter-stage: 16; 169 | } 170 | .main > div > *:nth-child(17) { 171 | --enter-stage: 17; 172 | } 173 | .main > div > *:nth-child(18) { 174 | --enter-stage: 18; 175 | } 176 | .main > div > *:nth-child(19) { 177 | --enter-stage: 19; 178 | } 179 | .main > div > *:nth-child(20) { 180 | --enter-stage: 20; 181 | } 182 | } 183 | -------------------------------------------------------------------------------- /jni/src/EncoreUtility/Profiler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | #include "EncoreConfigStore.hpp" 21 | #include "EncoreUtility.hpp" 22 | 23 | void set_profiler_env_vars() { 24 | auto device_mitigation = config_store.get_device_mitigation(); 25 | 26 | // Clear all existing _ENCORE_* environment variables 27 | extern char **environ; 28 | for (char **env = environ; *env; ++env) { 29 | std::string env_str(*env); 30 | if (env_str.find("ENCORE_") == 0) { 31 | // Extract the variable name (up to '=') 32 | size_t eq_pos = env_str.find('='); 33 | if (eq_pos != std::string::npos) { 34 | std::string var_name = env_str.substr(0, eq_pos); 35 | unsetenv(var_name.c_str()); 36 | } 37 | } 38 | } 39 | 40 | // Set device mitigation variables 41 | if (device_mitigation.enable && !device_mitigation.items.empty()) { 42 | setenv("ENCORE_MITIGATION_ENABLED", "1", 1); 43 | 44 | // Set environment variable for each mitigation item 45 | for (const auto &item : device_mitigation.items) { 46 | std::string env_var = "ENCORE_" + item; 47 | std::transform(env_var.begin(), env_var.end(), env_var.begin(), [](unsigned char c) { 48 | // Convert to uppercase and replace non-alphanumeric characters with underscores 49 | if (!std::isalnum(c) && c != '_') return '_'; 50 | return static_cast(std::toupper(c)); 51 | }); 52 | 53 | setenv(env_var.c_str(), "1", 1); 54 | LOGD_TAG("Profiler", "Set mitigation env var: {}", env_var); 55 | } 56 | } 57 | 58 | // Set CPU Governor variables 59 | EncoreConfigStore::CPUGovernor cpu_governor_preference = config_store.get_cpu_governor(); 60 | setenv("ENCORE_BALANCED_CPUGOV", cpu_governor_preference.balance.c_str(), 1); 61 | setenv("ENCORE_POWERSAVE_CPUGOV", cpu_governor_preference.powersave.c_str(), 1); 62 | } 63 | 64 | void run_perfcommon(void) { 65 | set_profiler_env_vars(); 66 | 67 | if (system("encore_profiler perfcommon")) { 68 | LOGE("Unable to execute profiler changes to perfcommon"); 69 | } 70 | } 71 | 72 | void apply_performance_profile(bool lite_mode, std::string game_pkg, pid_t game_pid) { 73 | is_kanged(); 74 | set_profiler_env_vars(); 75 | 76 | uid_t game_uid = get_uid_by_package_name(game_pkg); 77 | write2file(GAME_INFO, game_pkg, " ", game_pid, " ", game_uid, "\n"); 78 | write2file(PROFILE_MODE, static_cast(PERFORMANCE_PROFILE), "\n"); 79 | 80 | if (lite_mode) { 81 | if (system("encore_profiler performance_lite") != 0) { 82 | LOGE("Unable to execute profiler changes to performance_lite"); 83 | } 84 | 85 | return; 86 | } 87 | 88 | if (system("encore_profiler performance") != 0) { 89 | LOGE("Unable to execute profiler changes to performance"); 90 | } 91 | } 92 | 93 | void apply_balance_profile() { 94 | is_kanged(); 95 | set_profiler_env_vars(); 96 | 97 | write2file(GAME_INFO, "NULL 0 0\n"); 98 | write2file(PROFILE_MODE, static_cast(BALANCE_PROFILE), "\n"); 99 | 100 | if (system("encore_profiler balance") != 0) { 101 | LOGE("Unable to execute profiler changes to balance"); 102 | } 103 | } 104 | 105 | void apply_powersave_profile() { 106 | is_kanged(); 107 | set_profiler_env_vars(); 108 | 109 | write2file(GAME_INFO, "NULL 0 0\n"); 110 | write2file(PROFILE_MODE, static_cast(POWERSAVE_PROFILE), "\n"); 111 | 112 | if (system("encore_profiler powersave") != 0) { 113 | LOGE("Unable to execute profiler changes to powersave"); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /jni/src/EncoreConfig/EncoreConfigStore.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | #include "Encore.hpp" 28 | #include "EncoreLog.hpp" 29 | 30 | class EncoreConfigStore { 31 | public: 32 | struct Preferences { 33 | bool enforce_lite_mode = false; 34 | int log_level = 3; 35 | }; 36 | 37 | struct DeviceMitigation { 38 | bool enable = false; 39 | std::unordered_set items; 40 | }; 41 | 42 | struct CPUGovernor { 43 | std::string balance; 44 | std::string powersave; 45 | }; 46 | 47 | struct ConfigData { 48 | Preferences preferences; 49 | DeviceMitigation device_mitigation; 50 | CPUGovernor cpu_governor; 51 | }; 52 | 53 | /** 54 | * @brief Get singleton instance 55 | */ 56 | static EncoreConfigStore &get_instance() { 57 | static EncoreConfigStore instance; 58 | return instance; 59 | } 60 | 61 | /** 62 | * @brief Load configuration from file 63 | * @param config_path Path to config file (defaults to CONFIG_FILE) 64 | * @return true if loaded successfully, false otherwise 65 | */ 66 | bool load_config(const std::string &config_path = CONFIG_FILE); 67 | 68 | /** 69 | * @brief Save current configuration to file 70 | * @param config_path Optional custom path, uses loaded path by default 71 | * @return true if saved successfully, false otherwise 72 | */ 73 | bool save_config(const std::string &config_path = CONFIG_FILE); 74 | 75 | /** 76 | * @brief Get current configuration 77 | */ 78 | ConfigData get_config() const; 79 | 80 | /** 81 | * @brief Get preferences 82 | */ 83 | Preferences get_preferences() const; 84 | 85 | /** 86 | * @brief Get device mitigation settings 87 | */ 88 | DeviceMitigation get_device_mitigation() const; 89 | 90 | /** 91 | * @brief Get CPU governor settings 92 | */ 93 | CPUGovernor get_cpu_governor() const; 94 | 95 | /** 96 | * @brief Check if a specific mitigation item is enabled 97 | */ 98 | bool is_mitigation_enabled(const std::string &item) const; 99 | 100 | /** 101 | * @brief Update preferences 102 | */ 103 | void set_preferences(const Preferences &prefs); 104 | 105 | /** 106 | * @brief Update device mitigation 107 | */ 108 | void set_device_mitigation(const DeviceMitigation &mitigation); 109 | 110 | /** 111 | * @brief Update CPU governor settings 112 | */ 113 | void set_cpu_governor(const CPUGovernor &governor); 114 | 115 | /** 116 | * @brief Reload configuration from disk 117 | */ 118 | std::string get_config_path() const; 119 | 120 | /** 121 | * @brief Reload configuration from disk 122 | */ 123 | bool reload(); 124 | 125 | private: 126 | EncoreConfigStore() = default; 127 | ~EncoreConfigStore() = default; 128 | 129 | EncoreConfigStore(const EncoreConfigStore &) = delete; 130 | EncoreConfigStore &operator=(const EncoreConfigStore &) = delete; 131 | 132 | /** 133 | * @brief Read default CPU governor from file 134 | */ 135 | std::string read_default_cpu_governor() const; 136 | 137 | /** 138 | * @brief Create default configuration file 139 | */ 140 | bool create_default_config(); 141 | 142 | /** 143 | * @brief Parse JSON document into config structure 144 | */ 145 | bool parse_config(const rapidjson::Document &doc); 146 | 147 | mutable std::mutex mutex_; 148 | ConfigData config_; 149 | std::string config_path_ = CONFIG_FILE; 150 | }; 151 | 152 | #define config_store EncoreConfigStore::get_instance() 153 | -------------------------------------------------------------------------------- /jni/include/PIDTracker.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | /** 26 | * @class PIDTracker 27 | * @brief A class to track the status of a PID in a background thread. 28 | * 29 | * This class continuously monitors a given PID to check if the process is still running. 30 | * It automatically invalidates the PID when the process terminates. 31 | */ 32 | class PIDTracker { 33 | private: 34 | /// Loop interval when there's no PID is being tracked. 35 | static constexpr auto LOOP_INTERVAL_IDLE = std::chrono::milliseconds(300); 36 | /// Loop interval when there's PID is being tracked. 37 | static constexpr auto LOOP_INTERVAL_BUSY = std::chrono::milliseconds(20); 38 | 39 | /// The current process ID being tracked. 40 | std::atomic current_pid{0}; 41 | /// Flag to signal the tracking thread to stop. 42 | std::atomic stop_requested{false}; 43 | /// Flag indicating whether the current PID is considered valid. 44 | std::atomic pid_valid{false}; 45 | /// The background thread that performs the tracking. 46 | std::thread tracking_thread; 47 | 48 | /** 49 | * @brief Checks if a process with the given PID is running. 50 | * @param pid The process ID to check. 51 | * @return True if the process is running, false otherwise. 52 | */ 53 | bool is_pid_running(pid_t pid) { 54 | return kill(pid, 0) == 0; 55 | } 56 | 57 | /** 58 | * @brief The main loop for the background tracking thread. 59 | * 60 | * This loop periodically checks the status of the `current_pid`. 61 | * Marking PID as invalid as soon as the process terminates. 62 | */ 63 | void tracking_loop() { 64 | pthread_setname_np(pthread_self(), "PIDTracker"); 65 | 66 | while (!stop_requested.load(std::memory_order_acquire)) { 67 | pid_t pid = current_pid.load(std::memory_order_acquire); 68 | 69 | if (pid == 0) { 70 | std::this_thread::sleep_for(LOOP_INTERVAL_IDLE); 71 | continue; 72 | } 73 | 74 | if (is_pid_running(pid)) { 75 | std::this_thread::sleep_for(LOOP_INTERVAL_BUSY); 76 | continue; 77 | } 78 | 79 | if (current_pid.compare_exchange_strong(pid, 0, std::memory_order_acq_rel)) { 80 | pid_valid.store(false, std::memory_order_release); 81 | LOGD_TAG("PIDTracker", "PID {} terminated", pid); 82 | } 83 | } 84 | } 85 | 86 | public: 87 | /** 88 | * @brief Constructs a PIDTracker and starts the background tracking thread. 89 | */ 90 | PIDTracker() { 91 | tracking_thread = std::thread(&PIDTracker::tracking_loop, this); 92 | } 93 | 94 | /** 95 | * @brief Destroys the PIDTracker, signals the tracking thread to stop. 96 | */ 97 | ~PIDTracker() { 98 | stop_requested.store(true, std::memory_order_release); 99 | if (tracking_thread.joinable()) { 100 | tracking_thread.join(); 101 | } 102 | } 103 | 104 | /** 105 | * @brief Sets the process ID to be tracked. 106 | * 107 | * @param pid The new process ID to track. If pid <= 0, no action is taken. 108 | */ 109 | void set_pid(pid_t pid) { 110 | if (pid > 0) { 111 | current_pid.store(pid, std::memory_order_release); 112 | pid_valid.store(true, std::memory_order_release); 113 | } 114 | } 115 | 116 | /** 117 | * @brief Checks if the currently tracked PID is considered valid and running. 118 | * @return True if the PID is valid and non-zero, false otherwise. 119 | */ 120 | bool is_valid() { 121 | return pid_valid.load(std::memory_order_acquire) && 122 | current_pid.load(std::memory_order_acquire) != 0; 123 | } 124 | 125 | /** 126 | * @brief Gets the current process ID being tracked. 127 | * @return The current PID, or 0 if no PID is being tracked or it has terminated. 128 | */ 129 | pid_t get_current_pid() { 130 | return current_pid.load(std::memory_order_acquire); 131 | } 132 | 133 | /** 134 | * @brief Manually invalidates the current PID. 135 | * 136 | * This stops tracking the current PID and marks it as invalid. 137 | */ 138 | void invalidate() { 139 | current_pid.store(0, std::memory_order_release); 140 | pid_valid.store(false, std::memory_order_release); 141 | } 142 | }; 143 | -------------------------------------------------------------------------------- /NOTICE.md: -------------------------------------------------------------------------------- 1 | # Third Party Notices 2 | 3 | This project, Encore Tweaks, incorporates code from the following open source projects. 4 | 5 | ## Apache License 2.0 6 | This project, Encore Tweaks, is licensed under the Apache License, Version 2.0. 7 | 8 | Copyright (C) 2024-2025 Rem01Gaming 9 | 10 | Licensed under the Apache License, Version 2.0 (the "License"); 11 | you may not use this project except in compliance with the License. 12 | You may obtain a copy of the License at 13 | 14 | http://www.apache.org/licenses/LICENSE-2.0 15 | 16 | Unless required by applicable law or agreed to in writing, software 17 | distributed under the License is distributed on an "AS IS" BASIS, 18 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | See the License for the specific language governing permissions and 20 | limitations under the License. 21 | 22 | --- 23 | 24 | The following third-party components are used in this project: 25 | 26 | ## KTweak (BSD 2-Clause License) 27 | **Component:** Base functionality derived from KTweak 28 | 29 | Copyright (c) 2022, Tyler Nijmeh 30 | 31 | Redistribution and use in source and binary forms, with or without 32 | modification, are permitted provided that the following conditions are met: 33 | 34 | 1. Redistributions of source code must retain the above copyright notice, this 35 | list of conditions and the following disclaimer. 36 | 37 | 2. Redistributions in binary form must reproduce the above copyright notice, 38 | this list of conditions and the following disclaimer in the documentation 39 | and/or other materials provided with the distribution. 40 | 41 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 42 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 44 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 45 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 47 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 48 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 49 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 50 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51 | 52 | ## RapidJSON (MIT License) 53 | **Component:** JSON parsing 54 | 55 | Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip 56 | 57 | Permission is hereby granted, free of charge, to any person obtaining a copy 58 | of this software and associated documentation files (the "Software"), to deal 59 | in the Software without restriction, including without limitation the rights 60 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 61 | copies of the Software, and to permit persons to whom the Software is 62 | furnished to do so, subject to the following conditions: 63 | 64 | The above copyright notice and this permission notice shall be included in all 65 | copies or substantial portions of the Software. 66 | 67 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 68 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 69 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 70 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 71 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 72 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 73 | SOFTWARE. 74 | 75 | ### RapidJSON Dependencies: 76 | - **msinttypes** (BSD License) - Copyright (c) 2006-2013 Alexander Chemeris 77 | - **json.org & JSON_checker** (JSON License) - Copyright (c) 2002 JSON.org 78 | 79 | ## spdlog (MIT License) 80 | **Component:** Logging functionality 81 | 82 | Copyright (c) 2016 Gabi Melman 83 | 84 | Permission is hereby granted, free of charge, to any person obtaining a copy 85 | of this software and associated documentation files (the "Software"), to deal 86 | in the Software without restriction, including without limitation the rights 87 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 88 | copies of the Software, and to permit persons to whom the Software is 89 | furnished to do so, subject to the following conditions: 90 | 91 | The above copyright notice and this permission notice shall be included in 92 | all copies or substantial portions of the Software. 93 | 94 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 95 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 96 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 97 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 98 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 99 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 100 | THE SOFTWARE. 101 | 102 | ### spdlog Dependencies: 103 | - **fmt library** (MIT License) - Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors 104 | 105 | --- 106 | 107 | This file must be included with all distributions of Encore Tweaks. 108 | -------------------------------------------------------------------------------- /jni/include/EncoreLog.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include "Encore.hpp" 24 | 25 | namespace EncoreLog { 26 | 27 | /// Global logger instance 28 | inline std::shared_ptr g_logger; 29 | 30 | /** 31 | * @brief Initialize the logging system 32 | * 33 | * @param log_path Path to the log file (defaults to LOG_FILE) 34 | * 35 | * @details Creates a basic file logger with the pattern "YYYY-MM-DD HH:MM:SS.mmm L message" 36 | * 37 | * @note If initialization fails, the program will exit with EXIT_FAILURE. 38 | */ 39 | inline void init(const std::string &log_path = LOG_FILE) { 40 | try { 41 | g_logger = spdlog::basic_logger_mt("Encore", log_path); 42 | g_logger->set_pattern("%Y-%m-%d %H:%M:%S.%e %L %v"); 43 | g_logger->set_level(spdlog::level::trace); 44 | g_logger->flush_on(spdlog::level::info); 45 | } catch (const spdlog::spdlog_ex &ex) { 46 | fprintf(stderr, "EncoreLog init failed: %s\n", ex.what()); 47 | exit(EXIT_FAILURE); 48 | } 49 | } 50 | 51 | /** 52 | * @brief Get the logger instance 53 | * 54 | * @return std::shared_ptr Shared pointer to the logger 55 | * 56 | * @details If the logger hasn't been initialized yet, it will be initialized 57 | * with default parameters before being returned. 58 | */ 59 | inline std::shared_ptr get() { 60 | if (!g_logger) init(); 61 | return g_logger; 62 | } 63 | 64 | } // namespace EncoreLog 65 | 66 | #define LOGT_TAG(TAG, ...) \ 67 | EncoreLog::get()->log( \ 68 | spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, spdlog::level::trace, "{}: {}", \ 69 | TAG, fmt::format(__VA_ARGS__)) 70 | 71 | #define LOGD_TAG(TAG, ...) \ 72 | EncoreLog::get()->log( \ 73 | spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, spdlog::level::debug, "{}: {}", \ 74 | TAG, fmt::format(__VA_ARGS__)) 75 | 76 | #define LOGI_TAG(TAG, ...) \ 77 | EncoreLog::get()->log( \ 78 | spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, spdlog::level::info, "{}: {}", \ 79 | TAG, fmt::format(__VA_ARGS__)) 80 | 81 | #define LOGW_TAG(TAG, ...) \ 82 | EncoreLog::get()->log( \ 83 | spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, spdlog::level::warn, "{}: {}", \ 84 | TAG, fmt::format(__VA_ARGS__)) 85 | 86 | #define LOGE_TAG(TAG, ...) \ 87 | EncoreLog::get()->log( \ 88 | spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, spdlog::level::err, "{}: {}", \ 89 | TAG, fmt::format(__VA_ARGS__)) 90 | 91 | #define LOGC_TAG(TAG, ...) \ 92 | EncoreLog::get()->log( \ 93 | spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, spdlog::level::critical, \ 94 | "{}: {}", TAG, fmt::format(__VA_ARGS__)) 95 | 96 | #define LOGT(...) LOGT_TAG(LOG_TAG, __VA_ARGS__) 97 | #define LOGD(...) LOGD_TAG(LOG_TAG, __VA_ARGS__) 98 | #define LOGI(...) LOGI_TAG(LOG_TAG, __VA_ARGS__) 99 | #define LOGW(...) LOGW_TAG(LOG_TAG, __VA_ARGS__) 100 | #define LOGE(...) LOGE_TAG(LOG_TAG, __VA_ARGS__) 101 | #define LOGC(...) LOGC_TAG(LOG_TAG, __VA_ARGS__) 102 | 103 | namespace EncoreLog { 104 | 105 | /** 106 | * @brief Set the log level 107 | * 108 | * @param level Log level (0-5) 109 | * 110 | * @note If an invalid level is provided, it defaults to info. 111 | */ 112 | inline void set_log_level(int level) { 113 | static int prev_level = 3; 114 | spdlog::level::level_enum spdlog_level; 115 | 116 | if (prev_level == level) { 117 | return; 118 | } 119 | 120 | switch (level) { 121 | case 0: spdlog_level = spdlog::level::critical; break; 122 | case 1: spdlog_level = spdlog::level::err; break; 123 | case 2: spdlog_level = spdlog::level::warn; break; 124 | case 3: spdlog_level = spdlog::level::info; break; 125 | case 4: spdlog_level = spdlog::level::debug; break; 126 | case 5: spdlog_level = spdlog::level::trace; break; 127 | default: spdlog_level = spdlog::level::info; break; 128 | } 129 | 130 | prev_level = level; 131 | auto logger = get(); 132 | logger->set_level(spdlog_level); 133 | LOGI_TAG("EncoreLog", "Log level changed to {}", spdlog::level::to_string_view(spdlog_level)); 134 | } 135 | 136 | } // namespace EncoreLog 137 | -------------------------------------------------------------------------------- /website/docs/.vitepress/config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitepress' 2 | 3 | // https://vitepress.dev/reference/site-config 4 | export default defineConfig({ 5 | title: "Encore Tweaks", 6 | lang: "en-US", 7 | ignoreDeadLinks: true, 8 | cleanUrls: true, 9 | 10 | sitemap: { 11 | hostname: 'https://encore.rem01gaming.dev' 12 | }, 13 | 14 | head: [ 15 | ['link', { rel: "icon", type: "image/png", href: "/favicon.png", sizes: "64x64"}], 16 | ['link', { rel: "icon", type: "image/png", href: "/android-chrome.png", sizes: "192x192"}], 17 | ['link', { rel: "apple-touch-icon", type: "image/png", href: "/apple-touch-icon.png", sizes: "180x180"}], 18 | ['meta', { name: "hostname", content: "encore.rem01gaming.dev"}], 19 | ['meta', { name: "expected-hostname", content: "encore.rem01gaming.dev"}], 20 | ['meta', { name: "keywords", content: "Encore Tweaks, Tweak, Magisk Module, apk, module, performance module, Gaming, Android, Module magisk, gaming performance" }], 21 | ['meta', { property: "og:type", content: "website"}], 22 | ['meta', { property: "og:locale", content: "en-US"}], 23 | ['meta', { property: "og:site_name", content: "Encore Tweaks"}], 24 | ['meta', { property: "twitter:card", content: "summary_large_image"}], 25 | 26 | // Google Analytics 27 | [ 28 | 'script', 29 | { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-1962PRCX05' } 30 | ], 31 | [ 32 | 'script', 33 | {}, 34 | `window.dataLayer = window.dataLayer || []; 35 | function gtag(){dataLayer.push(arguments);} 36 | gtag('js', new Date()); 37 | gtag('config', 'G-1962PRCX05');` 38 | ] 39 | ], 40 | 41 | transformPageData(pageData) { 42 | // Dynamic elements (keep these unless moved to frontmatter) 43 | const canonicalUrl = `${this.sitemap.hostname}/${pageData.relativePath}` 44 | .replace(/index\.md$/, '') 45 | .replace(/\.md$/, ''); 46 | const ogImage = pageData.frontmatter.ogp 47 | ? `${this.sitemap.hostname}${pageData.frontmatter.ogp}` 48 | : `${this.sitemap.hostname}/ogp/default.webp`; 49 | 50 | pageData.frontmatter.head ??= []; 51 | 52 | // Add dynamic meta tags 53 | pageData.frontmatter.head.push( 54 | ['link', { rel: "canonical", href: canonicalUrl }], 55 | ['meta', { property: "og:title", content: pageData.frontmatter.layout === 'home' ? pageData.title : `${pageData.title} | Encore Tweaks` }], 56 | ['meta', { property: "og:url", content: canonicalUrl }], 57 | ['meta', { property: "og:image", content: ogImage }], 58 | ['meta', { property: "og:description", content: pageData.description }], 59 | ['meta', { property: "twitter:image", content: ogImage }], 60 | ['meta', { property: "twitter:title", content: pageData.frontmatter.layout === 'home' ? pageData.title : `${pageData.title} | Encore Tweaks` }], 61 | ['meta', { property: "twitter:description", content: pageData.description }] 62 | ); 63 | 64 | // Structured data (homepage only) 65 | if (pageData.relativePath === 'index.md') { 66 | pageData.frontmatter.head.push([ 67 | 'script', 68 | { type: "application/ld+json" }, 69 | JSON.stringify({ 70 | "@context": "https://schema.org", 71 | "@type": "WebSite", 72 | "name": "Encore Tweaks", 73 | "alternateName": "Encore Tweak", 74 | "url": "https://encore.rem01gaming.dev/" 75 | }) 76 | ]); 77 | } 78 | }, 79 | 80 | themeConfig: { 81 | nav: [ 82 | { text: 'Guide', link: '/guide/what-is-encore-tweaks' }, 83 | { 84 | text: 'Donate', 85 | items: [ 86 | { text: 'Saweria', link: 'https://saweria.co/Rem01Gaming' }, 87 | { text: 'Sociabuzz', link: 'https://sociabuzz.com/Rem01Gaming' } 88 | ] 89 | }, 90 | { text: 'Download', link: '/download' } 91 | ], 92 | 93 | sidebar: [ 94 | { 95 | text: 'Guide', 96 | items: [ 97 | { text: 'What is Encore Tweaks?', link: '/guide/what-is-encore-tweaks' }, 98 | { text: 'Module WebUI and Configuration', link: '/guide/webui-and-configuration' }, 99 | { text: 'Encore Tweaks Addon', link: '/guide/addon' }, 100 | { text: 'FAQ', link: '/guide/faq' } 101 | ] 102 | }, 103 | { 104 | text: 'Donate', 105 | items: [ 106 | { text: 'Saweria', link: 'https://saweria.co/Rem01Gaming' }, 107 | { text: 'Buymeacoffee', link: 'https://www.buymeacoffee.com/Rem01Gaming' } 108 | ] 109 | }, 110 | { text: 'Download', link: '/download' } 111 | ], 112 | 113 | search: { 114 | provider: "local", 115 | options: { 116 | locales: { 117 | root: { 118 | translations: { 119 | button: { 120 | buttonText: "Search Documents", 121 | buttonAriaLabel: "Search Documents", 122 | }, 123 | modal: { 124 | noResultsText: "No results could be found", 125 | resetButtonTitle: "Clear the search criteria", 126 | footer: { 127 | selectText: "option", 128 | navigateText: "switchover", 129 | }, 130 | }, 131 | }, 132 | }, 133 | }, 134 | }, 135 | }, 136 | 137 | footer: { 138 | message: 'Released under the Apache License 2.0.', 139 | copyright: 'Copyright © 2024-present Rem01Gaming' 140 | }, 141 | 142 | editLink: { 143 | pattern: 'https://github.com/Rem01Gaming/encore/edit/main/website/docs/:path', 144 | text: 'Edit this page in GitHub' 145 | }, 146 | 147 | socialLinks: [ 148 | { icon: 'github', link: 'https://github.com/Rem01Gaming/encore', ariaLabel: 'GitHub' } 149 | ] 150 | } 151 | }) 152 | -------------------------------------------------------------------------------- /webui/src/scripts/language.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import enTranslations from '../locales/strings/en.json'; 18 | import languages from '../locales/languages.json'; 19 | 20 | // Cache for translations 21 | const cachedEnglishTranslations = enTranslations; 22 | let currentTranslations = null; 23 | 24 | // Dynamic imports for non-English translations 25 | const translationModules = import.meta.glob( 26 | '../locales/strings/!(en).json', // Exclude en.json from dynamic imports 27 | { eager: false } 28 | ); 29 | 30 | // Synchronous translation lookup 31 | // This function also will parse args from it's input 32 | function getTranslationSync(key, ...args) { 33 | const keys = key.split('.'); 34 | let value = null; 35 | 36 | // First try current language 37 | if (currentTranslations) { 38 | value = currentTranslations; 39 | for (const k of keys) { 40 | value = value?.[k]; 41 | if (!value) break; 42 | } 43 | } 44 | 45 | // If not found in current language, fallback to English 46 | if (!value) { 47 | value = cachedEnglishTranslations; 48 | for (const k of keys) { 49 | value = value?.[k]; 50 | if (!value) break; 51 | } 52 | } 53 | 54 | // Return key if no translation found in either language 55 | if (!value) return key; 56 | 57 | // Handle placeholder replacement 58 | if (args.length > 0 && typeof value === 'string') { 59 | return value.replace(/\{(\d+)\}/g, (match, index) => { 60 | const idx = parseInt(index); 61 | return args[idx] !== undefined ? args[idx] : match; 62 | }); 63 | } 64 | 65 | return value; 66 | } 67 | 68 | // Expose to global scope 69 | window.getTranslation = getTranslationSync; 70 | 71 | async function loadTranslations(lang) { 72 | // Use static import for English 73 | if (lang === 'en') return cachedEnglishTranslations; 74 | 75 | const filePath = `../locales/strings/${lang}.json`; 76 | 77 | if (translationModules[filePath]) { 78 | try { 79 | const module = await translationModules[filePath](); 80 | return module.default; 81 | } catch (error) { 82 | console.error(`Failed to load ${lang} translations:`, error); 83 | return cachedEnglishTranslations; 84 | } 85 | } else { 86 | console.warn(`No translation file for ${lang}, falling back to English`); 87 | return cachedEnglishTranslations; 88 | } 89 | } 90 | 91 | function applyTranslations(translations) { 92 | // Update current translations reference 93 | currentTranslations = translations; 94 | 95 | document.querySelectorAll('[data-i18n]').forEach(el => { 96 | const key = el.getAttribute('data-i18n'); 97 | const translation = getTranslationSync(key); 98 | el.textContent = translation; 99 | }); 100 | } 101 | 102 | async function initI18n() { 103 | const languageBtn = document.getElementById('language_btn'); 104 | const languageModal = document.getElementById('language_modal'); 105 | const languageSelection = document.getElementById('language_selection'); 106 | 107 | if (!languageBtn || !languageModal || !languageSelection) return; 108 | 109 | try { 110 | // Merge languages with English as default 111 | const allLanguages = { en: "English", ...languages }; 112 | 113 | // Populate language selection modal 114 | languageSelection.innerHTML = ''; 115 | for (const [code, name] of Object.entries(allLanguages)) { 116 | const button = document.createElement('button'); 117 | button.textContent = name; 118 | button.dataset.lang = code; 119 | button.className = 'btn btn-block bg-primary hover:bg-primary text-on-primary py-1'; 120 | languageSelection.appendChild(button); 121 | } 122 | 123 | // Determine initial language 124 | const savedLang = localStorage.getItem('selectedLanguage'); 125 | const browserLangs = [ 126 | ...(navigator.languages || []), 127 | navigator.language, 128 | navigator.userLanguage 129 | ].filter(Boolean); 130 | 131 | let lang = savedLang || 'en'; 132 | if (!savedLang) { 133 | for (const browserLang of browserLangs) { 134 | const normalizedLang = browserLang.toLowerCase().replace(/_/g, '-'); 135 | if (allLanguages[normalizedLang]) { 136 | lang = normalizedLang; 137 | break; 138 | } 139 | const baseLang = normalizedLang.split('-')[0]; 140 | if (allLanguages[baseLang]) { 141 | lang = baseLang; 142 | break; 143 | } 144 | } 145 | } 146 | 147 | currentTranslations = await loadTranslations(lang); 148 | applyTranslations(currentTranslations); 149 | 150 | // Handle settings button click 151 | languageBtn.addEventListener('click', () => { 152 | document.documentElement.classList.add('modal-open'); 153 | language_modal.showModal(); 154 | }); 155 | 156 | // Handle language selection 157 | languageSelection.addEventListener('click', async (e) => { 158 | if (e.target.tagName === 'BUTTON') { 159 | const newLang = e.target.dataset.lang; 160 | if (newLang) { 161 | const oldTranslations = currentTranslations; 162 | try { 163 | currentTranslations = await loadTranslations(newLang); 164 | applyTranslations(currentTranslations); 165 | localStorage.setItem('selectedLanguage', newLang); 166 | languageModal.close(); 167 | } catch (error) { 168 | currentTranslations = oldTranslations; 169 | console.error('Language switch failed:', error); 170 | } 171 | } 172 | } 173 | }); 174 | 175 | } catch (error) { 176 | console.error('i18n initialization failed:', error); 177 | } 178 | } 179 | 180 | // Initialize immediately if DOM is ready, otherwise wait 181 | if (document.readyState !== 'loading') { 182 | initI18n(); 183 | } else { 184 | document.addEventListener('DOMContentLoaded', initI18n); 185 | } -------------------------------------------------------------------------------- /jni/src/EncoreCLI/EncoreCLI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Rem01Gaming 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include "EncoreCLI.hpp" 25 | 26 | #include 27 | #include 28 | 29 | std::string get_module_version() { 30 | std::ifstream prop_file(MODULE_PROP); 31 | std::string line; 32 | std::string version = "unknown"; 33 | 34 | if (!prop_file.is_open()) { 35 | std::cerr << "\033[33mERROR:\033[0m Could not open " << MODULE_PROP << std::endl; 36 | return version; 37 | } 38 | 39 | while (std::getline(prop_file, line)) { 40 | if (line.find("version=") == 0) { 41 | // Remove "version=" prefix 42 | version = line.substr(8); 43 | 44 | // Remove quotes if present 45 | if (!version.empty() && version.front() == '"' && version.back() == '"') { 46 | version = version.substr(1, version.length() - 2); 47 | } 48 | 49 | break; 50 | } 51 | } 52 | 53 | prop_file.close(); 54 | return version; 55 | } 56 | 57 | int version_handler(const std::vector &args) { 58 | (void)args; 59 | 60 | std::string module_version = get_module_version(); 61 | std::cout << "Encore Tweaks " << module_version << std::endl; 62 | std::cout << "Built on " << __TIME__ << " " << __DATE__ << std::endl; 63 | return EXIT_SUCCESS; 64 | } 65 | 66 | int setup_gamelist_handler(const std::vector &args) { 67 | bool success = GameRegistry::populate_from_base(ENCORE_GAMELIST, args[0]); 68 | if (!success) { 69 | std::cerr << "\033[31mERROR:\033[0m Failed to setup gamelist from " << args[0] << std::endl; 70 | return EXIT_FAILURE; 71 | } 72 | 73 | return EXIT_SUCCESS; 74 | } 75 | 76 | int check_gamelist_handler(const std::vector &args) { 77 | (void)args; 78 | 79 | if (access(ENCORE_GAMELIST, F_OK) != 0) { 80 | std::cout << "\033[33mERROR:\033[0m " << ENCORE_GAMELIST << " does not exist" << std::endl; 81 | return EXIT_FAILURE; 82 | } 83 | 84 | GameRegistry registry; 85 | if (!registry.load_from_json(ENCORE_GAMELIST)) { 86 | std::cerr << "\033[31mERROR:\033[0m Failed to parse " << ENCORE_GAMELIST << std::endl; 87 | return EXIT_FAILURE; 88 | } 89 | 90 | std::cerr << ENCORE_GAMELIST << " is valid" << std::endl; 91 | std::cerr << "Registered games: " << registry.size() << std::endl; 92 | return EXIT_SUCCESS; 93 | } 94 | 95 | int daemon_handler(const std::vector &args) { 96 | (void)args; 97 | 98 | // This will be implemented in Main.cpp 99 | extern int run_daemon(); 100 | return run_daemon(); 101 | } 102 | 103 | // clang-format off 104 | std::vector commands = { 105 | { 106 | "daemon", 107 | "Start Encore Tweaks daemon", 108 | "daemon", 109 | 0, 110 | 0, 111 | daemon_handler 112 | }, 113 | { 114 | "setup_gamelist", 115 | "Setup initial gamelist from base file", 116 | "setup_gamelist ", 117 | 1, 118 | 1, 119 | setup_gamelist_handler 120 | }, 121 | { 122 | "check_gamelist", 123 | "Validate gamelist file", 124 | "check_gamelist", 125 | 0, 126 | 0, 127 | check_gamelist_handler 128 | }, 129 | { 130 | "version", 131 | "Show version information", 132 | "version", 133 | 0, 134 | 0, 135 | version_handler 136 | }, 137 | }; 138 | // clang-format on 139 | 140 | void cli_usage(const char *program_name) { 141 | std::cout << "Encore Tweaks CLI" << std::endl << std::endl; 142 | std::cout << "Usage: " << program_name << " " << std::endl << std::endl; 143 | std::cout << "Commands:" << std::endl; 144 | 145 | for (const auto &cmd : commands) { 146 | printf(" %-20s %s\n", cmd.name.c_str(), cmd.description.c_str()); 147 | } 148 | 149 | std::cout << std::endl << "Options:" << std::endl; 150 | std::cout << " -h, --help Show this help message" << std::endl; 151 | std::cout << " -V, --version Show version information" << std::endl; 152 | std::cout << std::endl << "Run '" << program_name << " --help' for more information on a command." << std::endl; 153 | } 154 | 155 | void cli_usage_command(const CliCommand &cmd) { 156 | std::cout << "Usage: encored " << cmd.usage << std::endl << std::endl; 157 | std::cout << cmd.description << std::endl; 158 | } 159 | 160 | int encore_cli(int argc, char *argv[]) { 161 | const char *program_name = argv[0]; 162 | 163 | if (argc == 1) { 164 | cli_usage(program_name); 165 | return EXIT_FAILURE; 166 | } 167 | 168 | std::string command = argv[1]; 169 | std::vector args; 170 | 171 | for (int i = 2; i < argc; i++) { 172 | args.push_back(argv[i]); 173 | } 174 | 175 | if (command == "-h" || command == "--help") { 176 | cli_usage(program_name); 177 | return EXIT_SUCCESS; 178 | } 179 | 180 | if (command == "-V" || command == "--version") { 181 | return version_handler({}); 182 | } 183 | 184 | if (args.size() == 1 && (args[0] == "-h" || args[0] == "--help")) { 185 | for (const auto &cmd : commands) { 186 | if (cmd.name != command) continue; 187 | cli_usage_command(cmd); 188 | return EXIT_SUCCESS; 189 | } 190 | 191 | std::cerr << "\033[31mERROR:\033[0m Unknown command: " << command << std::endl; 192 | return EXIT_FAILURE; 193 | } 194 | 195 | for (const auto &cmd : commands) { 196 | if (cmd.name == command) { 197 | size_t min_args = static_cast(cmd.min_args); 198 | size_t max_args = static_cast(cmd.max_args); 199 | 200 | if (args.size() < min_args || args.size() > max_args) { 201 | std::cerr << "\033[31mERROR:\033[0m Invalid number of arguments for '" << command << "'" << std::endl; 202 | cli_usage_command(cmd); 203 | return EXIT_FAILURE; 204 | } 205 | 206 | return cmd.handler(args); 207 | } 208 | } 209 | 210 | std::cerr << "\033[31mERROR:\033[0m Unknown command: " << command << std::endl; 211 | std::cerr << "See '" << program_name << " --help' for available commands." << std::endl; 212 | return EXIT_FAILURE; 213 | } 214 | --------------------------------------------------------------------------------