A fork of NPatch allowing to patch API 101 plugins (gkms-localify only)
Go to file
NkBe e640da4f57
feat: 引入輕量級 MicroG 支援與 GMS 請求重導向機制
為 NPatch 引入了原生的 MicroG 整合支援,允許修補後的 Google 應用程式(例如 YouTube)在依賴 Google Play 服務的環境下,透過社群版 MicroG(如 ReVanced GmsCore)正常運作。

詳細改動範圍包含:

* ** UI Manager **
  - 於 `NewPatchScreen` 的修補選項清單中,新增「啟用 MicroG 支援」核取方塊與相容性說明。
  - 更新 `NewPatchViewModel`,透過 `Patcher.kt` 將使用者的 `useMicroG` 選擇狀態以 `--useMicroG` 指令列參數的形式,傳遞給底層修補引擎。

* ** Patcher **
  - 於 `NPatch.java` 中新增對 `--useMicroG` 參數的解析邏輯。
  - 擴充 `modifyManifestFile` 邏輯:當啟用 MicroG 支援時,自動讀取目標應用的原始簽名並轉碼為 Hex 格式。
  - 於 `AndroidManifest.xml` 中動態注入 `fake-signature` 的 `<meta-data>` 節點與 `android.permission.FAKE_PACKAGE_SIGNATURE` 權限,以滿足 MicroG 進行簽名欺騙(Signature Spoofing)時的驗證需求。

* ** Patch Loader **
  - 實作 `GmsRedirector.java` 類別,負責在應用程式執行期間動態攔截並重導向 IPC 通訊:
    1. 掛鉤 `Intent.setPackage`、`Intent.setComponent` 與建構子,將所有指向 `com.google.android.gms` 與 GSF 的意圖,強制導向至設備上已安裝的社群版 MicroG 套件(優先支援 `app.revanced.android.gms` 與 `org.microg.gms`)。
    2. 掛鉤 `ContentResolver`,替換帶有 GMS Authority 的 URI。針對真實 GMS 拋出的 `SecurityException`(憑證拒絕存取)實作了智慧攔截與重試機制。
    3. 掛鉤 `PackageManager.getPackageInfo` 實現動態簽名偽裝,使修補後的應用程式將 MicroG 視為官方正版 GMS。
  - 於 `LSPApplication.java` 的 `onLoad` 階段,依據 `PatchConfig` 設定檔動態喚醒並初始化 `GmsRedirector`。

* ** Share **
  - 更新 `PatchConfig.java` 以儲存與傳遞 `useMicroG` 布林值狀態。
  - 於 `Constants.java` 中定義 `REAL_GMS_PACKAGE_NAME` 常數,供各模組統一呼叫。

Co-Authored-By: MrZhongzq <108169409+MrZhongzq@users.noreply.github.com>
2026-03-08 21:53:41 +08:00
.github Update core submodule and simplify CI checkout 2026-02-10 20:18:07 +08:00
apkzlib Core upgrade (#213) 2023-06-29 02:17:00 +08:00
core@62ea99fa35 chore: update core submodule URL to HSSkyBoy repository 2026-03-06 21:31:19 +08:00
gradle Update core and dependencies 2026-02-10 14:32:24 +08:00
jar rename provider2mtprovider 2025-12-03 22:32:53 +08:00
manager feat: 引入輕量級 MicroG 支援與 GMS 請求重導向機制 2026-03-08 21:53:41 +08:00
meta-loader feat(sigbypass): SVC Bypass (ARM64) and OpenAt I/O Redirection 2025-12-22 21:57:33 +08:00
patch feat: 引入輕量級 MicroG 支援與 GMS 請求重導向機制 2026-03-08 21:53:41 +08:00
patch-loader feat: 引入輕量級 MicroG 支援與 GMS 請求重導向機制 2026-03-08 21:53:41 +08:00
share feat: 引入輕量級 MicroG 支援與 GMS 請求重導向機制 2026-03-08 21:53:41 +08:00
.gitattributes Update workflow dependencies (#1) 2024-07-23 16:59:48 +02:00
.gitignore Turn on EXPORT_COMPILE_COMMANDS 2024-05-19 11:54:44 +02:00
.gitmodules chore: update core submodule URL to HSSkyBoy repository 2026-03-06 21:31:19 +08:00
LICENSE Create LICENSE 2021-04-09 11:48:53 +08:00
README.md Refactor:Replace all instances of `lspatch` with `npatch` 2025-12-02 23:42:23 +08:00
build.gradle.kts Remove artificial +4200 offset from coreCommitCount 2026-03-06 23:28:54 +08:00
crowdin.yml [skip ci] Config crowdin 2024-07-24 10:45:10 +02:00
gradle.properties Refactor:Replace all instances of `lspatch` with `npatch` 2025-12-02 23:42:23 +08:00
gradlew Update JingMatrix/LSPosed 2025-03-15 09:22:18 +01:00
gradlew.bat Update gradle for GitHub Action 2024-11-21 10:09:38 +01:00
settings.gradle.kts Update core and dependencies 2026-02-10 14:32:24 +08:00

README.md

Neo LSPatch Framework

Build Crowdin Download Total

Introduction

Rootless implementation of LSPosed framework, integrating Xposed API by inserting dex and so into the target APK.

We sincerely invite you to join our Telegram group to get more information and updates about NPatch.

Supported Versions

Download

For stable releases, please go to Github Releases page For canary build, please check Github Actions Note: debug builds are only available in Github Actions

Usage

  • Through jar
  1. Download npatch.jar
  2. Run java -jar npatch.jar
  • Through manager
  1. Download and install manager.apk on an Android device
  2. Follow the instructions of the manager app

Star Number

Star History Chart

Translation Contributing

You can contribute translation here.

Credits

License

NPatch is licensed under the GNU General Public License v3 (GPL-3) (http://www.gnu.org/copyleft/gpl.html).