github 7723mod/NPatch v1.0.8
v1.0.8 The Patchwork Update

4 hours ago

English

🔧 Patcher Overhaul

  • --injectdex DEX Injection: You can now inject a custom Loader DEX directly at patch time, backed by a dual-layer hidden-API exemption so injected code stays functional on Android 36+ instead of tripping the platform's reflection restrictions.
  • Override targetSdkVersion: Patching can force a specific target SDK, giving you a way around behavior changes that only trigger above a certain SDK level on apps you don't control the manifest of. Exposed identically in the CLI and the Manager UI, so scripted and manual workflows stay in sync.
  • Enable HTTP Cleartext Traffic: A one-click usesCleartextTraffic toggle at patch time, aimed squarely at local debugging and packet-capture setups where you need plaintext HTTP without hand-editing the manifest first.
  • Packaging Pipeline Improvements: The packager now tracks v1/v2/v3 signature schemes and Split APK output together instead of treating them as separate paths, so a patched APK's signing metadata and split structure stay consistent through the whole pipeline rather than drifting apart on edge-case inputs.
  • Robustness Fixes: META-INF signature entries from the original APK now survive the patch step instead of being dropped; Manifest parsing tolerates a wider range of malformed input; output filenames no longer break in non-ASCII locales (#137); and origin.apk caching now uses atomic writes with proper multi-process locking, closing a race that could corrupt the cache under concurrent patch operations (#147).

📱 Manager UX Improvements

  • Direct Re-patching & Source APK Extraction: Re-patching an already-installed app used to mean tracking down the original APK yourself. The manage page now does that step for you — it detects the embedded original inside the installed patch and extracts it automatically before re-patching.
  • Persistent APK Source Selection: The APK you picked as a patch source is now written to persistent storage instead of living only in memory, so it's still there after the patch finishes or if the app gets killed mid-flow — no more re-selecting the same file from scratch.
  • Smart Embedded APK Detection: The Manager now recognizes when a given APK already contains an embedded original or plugin payload and prompts you to extract it, rather than letting you patch on top of a patch by accident.
  • Liquid Glass Bottom Bar: The bottom navigation bar has been rebuilt around SukiSU-Ultra's liquid-glass visual language, with gesture-nav sync, tab-selection contrast, and safe-area insets all tuned to match rather than bolted on separately.
  • Signature Conflict Override Option: The signature-conflict dialog now includes a "Proceed despite risk" option, so you can choose to install over a mismatched signature instead of being hard-blocked when you already understand the trade-off.

🛡️ Loader & Bootstrap Stability

  • ClassLoader Timing Fix: Fixed a ClassNotFoundException on HiltApplication and similar hardened apps, caused by the app's ClassLoader being instantiated before hook deployment had actually finished — the loader now waits for the correct point in the bootstrap sequence instead of racing it.
  • Cached APK Resource Fix: In signature-bypass mode, cached APKs were failing to resolve some resources correctly; resource loading now points at the right underlying APK so packed/hardened apps render as expected.
  • Disconnection Protection: Module scope caching is more resilient now, so if the system kills the Manager process in the background, the host app keeps running normally instead of losing its hook state.
  • fstatat Hook: Added interception for fstatat/fstatat64, so module library paths are excluded from these syscalls the same way they already were for open/read-family calls — closing a detection gap that relied specifically on fstatat.

⚙️ System Integration & Toolchain

  • Remote SDK AAR: A remote-sdk AAR is now published separately, so module developers can pull in NPatch's Manager UI components as a dependency instead of reimplementing that UI themselves.
  • libxposed XposedService: The standard libxposed XposedService interface is now fully implemented in both integrated and standalone Manager modes, so third-party modules built against that interface work without NPatch-specific shims.
  • Installer Fixes: Fixed the FileProvider external cache path, a confirmation intent that wasn't launching correctly, and missing receiver export declarations that newer Android versions reject; also smoothed out the Shizuku-based install flow and fixed a rendering glitch in the install dialog.
  • remote-api Modularization: remote-api now lives in its own submodule repository rather than the main tree, so it can be versioned and released independently without dragging the whole NPatch repo along.

中文

🔧 修補器(Patcher)全面進化

  • --injectdex DEX 注入支援:修補時可直接注入自訂 Loader DEX,並搭配雙層隱藏 API 豁免機制,確保注入的程式碼在 Android 36+ 上不會被平台的反射限制擋下來。
  • 覆寫 targetSdkVersion:修補時可強制指定目標 SDK,讓你能繞過某些只在特定 SDK 版本以上才觸發的行為變更——尤其是對那些你無法直接修改 manifest 的目標應用很有用。CLI 與 Manager UI 提供相同的介面,讓自動化腳本與手動操作行為一致。
  • 啟用 HTTP 明文流量:修補時一鍵開啟 usesCleartextTraffic,專門針對本地調試與抓包場景,不用再手動改 manifest 才能讓明文 HTTP 通過。
  • 打包管線優化:打包器現在會同步追蹤 v1/v2/v3 簽章方案與 Split APK 輸出,而不是把兩者當成獨立路徑處理,避免簽章中繼資料與分割包結構在邊界情況下互相脫節。
  • 容錯性強化:原 APK 的 META-INF 簽章目錄不再於修補過程中被捨棄;Manifest 解析對格式異常的輸入容忍度更高;修正非 ASCII 語言環境下輸出檔名匹配失敗的問題(#137);origin.apk 快取改用原子寫入並加上正確的多進程鎖,修復了並行修補時可能造成快取損毀的競爭條件(#147)。

📱 Manager 使用體驗大幅升級

  • 重新修補與原包提取:過去要重新修補已安裝的應用,得自己想辦法找回原始 APK。現在管理頁會自動偵測已安裝修補包內嵌的原包,並在重新修補前主動提取,這一步不再需要你手動處理。
  • APK 選取來源持久化:選定的修補來源 APK 現在會寫入持久化儲存,而不是只存在於記憶體中——即使修補完成後或應用中途被系統殺掉,下次也不需要重新選取同一個檔案。
  • 內嵌包智慧識別:Manager 現在能識別某個 APK 本身已包含內嵌原包或插件負載,並主動提示提取,避免你不小心對一個已修補的包再次修補。
  • 液態懸浮底欄(Liquid Glass):底部導覽列圍繞 SukiSU-Ultra 的液態玻璃視覺語言重新打造,手勢導覽同步、分頁選中對比度、安全邊距都是整體調校過的結果,而不是各自拼湊上去的效果。
  • 簽名衝突安裝選項:簽名衝突對話框新增「無視風險,繼續安裝」選項——當你已經清楚了解風險所在時,可以選擇在簽名不匹配的情況下仍然安裝,而不是被硬性擋下。

🛡️ Loader 與啟動鏈路穩定性

  • ClassLoader 時序修復:修復了 HiltApplication 等加固應用上出現的 ClassNotFoundException,根因是應用的 ClassLoader 在 Hook 部署真正完成前就被提早實體化——Loader 現在會等到啟動流程中正確的時間點才繼續,而不是與部署過程搶跑。
  • 快取 APK 資源修復:簽名繞過模式下,快取 APK 曾經無法正確解析部分資源;資源載入現在指向正確的底層 APK,加固/封包過的應用能正確渲染。
  • 管理器斷連防護強化:模組範疇快取機制更具韌性——即使系統在背景把 Manager 進程回收掉,宿主應用仍能維持原本的 Hook 狀態繼續正常運作,而不會遺失。
  • fstatat Hook 新增:新增對 fstatat/fstatat64 的攔截,讓模組庫路徑在這兩個系統呼叫上也能被排除,補上了過去僅針對 open/read 系列呼叫防護、卻獨漏 fstatat 的偵測破口。

⚙️ 系統整合與工具鏈

  • 遠端 SDK(remote-sdk):remote-sdk AAR 現在獨立發佈,模組開發者可以直接把 NPatch 的 Manager UI 組件當作依賴項引入,不需要自己重新實作一套介面。
  • libxposed XposedService:在整合模式與獨立 Manager 模式下都完整實現了 libxposed 標準的 XposedService 介面,讓依照該介面開發的第三方模組無需 NPatch 專屬的相容層即可直接運作。
  • 安裝器全面修復:修復 FileProvider 外部快取路徑設定錯誤、無法正確啟動的確認 Intent,以及新版 Android 會拒絕的 Receiver export 宣告缺失問題;同時優化 Shizuku 安裝流程,並修復安裝對話框的渲染異常。
  • remote-api 獨立子模組化:remote-api 現在維護在獨立的子模組倉庫中,而不是留在主倉庫裡,可以獨立版本化與發佈,不必連帶整個 NPatch 倉庫一起走。

Don't miss a new NPatch release

NewReleases is sending notifications on new releases.