NPatch-v1.0.7-762-release.apk
6.5 MB
一、 免后台运行与动态重连机制深度重构
二、 智能检测已修补应用并自适应提取原包
三、 安装器与大型文件打包支持优化
缓存并行准备与零延迟本地秒开
摒弃了传统需等待管理器连接超时才读取本地配置的串行逻辑。修补应用在发起管理器连接的同时,主线程并行解析本地模块缓存。若管理器在后台被系统清理或未能及时响应,应用将以零延迟直接切换至本地模式启动,彻底告别启动白屏、卡顿与以「无模块」状态运行的问题。
动态重连与热重载通道自动复苏
重构底层 Binder 服务绑定,引入原子线程锁(Atomic Switch Lock)屏障。当应用在离线模式启动后,若管理器随后被拉起或手动打开,连接通道将在后台自动建立并无缝切换,实时同步最新模块配置与远端数据,并自动恢复热重载通信通道。
5 分钟连接生命周期保护
后台重连等待机制增加了 5 分钟上限保护。若超时管理器仍未启动,应用将主动释放系统服务连接,避免无休止占用系统 Binder 与 IPC 资源,兼顾续航与系统性能。
Shizuku 守护与全自动唤醒
在授予 Shizuku 权限时,Shell 守护服务可在发现管理器离线时自动将其拉起并同步状态;在未授权 Shizuku 的设备上,应用同样能依靠增强的本地并行缓存机制实现极速稳定的纯免后台运行。
二、 智能检测已修补应用并自适应提取原包
多框架已修补应用智能识别
支持深度识别由 NPatch、LSPatch、FPA 打包的修补应用,以及包含 assets/origin.apk 或内嵌插件的单体 APK。在选择应用界面与修补流程中,能够准确呈现修补状态与标签。
自适应提取内置原包并重新修补
当用户选取已修补的应用或带有内嵌原包的 APK 时,系统将主动弹出提示对话框,建议提取内置的原版 APK 重新进行修补,避免多层外壳嵌套打包导致的应用闪退与兼容性问题;同时支持直接修补外壳 APK 作为备用选项。
智能回退解压支持
重构了原包提取引擎,除匹配各框架标准路径外,新增自动扫描 assets/ 目录下内嵌 APK 的回退检索机制,确保自命名或非标准结构的内嵌原包亦能顺利提取。
三、 安装器与大型文件打包支持优化
解决内嵌 APK 误识别为 App Bundle 问题
优化了安装包格式判定逻辑。对于包含 assets/origin.apk 或内嵌插件的单体独立 APK,不再将其误判为 APKS/XAPK 分卷进行解包;在解析安装包分卷时主动过滤 assets/、res/、lib/、META-INF/ 等内部资源目录,避免打包与安装异常。
大文件与 APKS 高吞吐打包优化
重写了 APKS 生成与文件导出流程,全面采用 64KB 高吞吐缓冲流配合无压缩存储策略,有效杜绝大型游戏与数 GB 级别分卷安装包打包时的内存溢出(OOM)与写入瓶颈。
系统安装超时自动状态回查
为所有系统安装器调用及 Shizuku 会话等待设置了精准的超时机制。当系统广播丢失或超时未响应时,程序将主动向底层包管理器回查目标应用的实际安装与卸载状态,彻底消除安装进度条无限卡死的问题。
👍26❤12🌭3🔥1
❤20🍌1
NPatch-v1.0.7-769-release.apk
6.5 MB
feat(patch): optimize packaging pipeline with v1/v2/v3 signing and split apk sync
- Add full V1 + V2 + V3 signing support in apkzlib and patcher
- Synchronize manifest attributes across split APKs in app bundles
- Fix patched app detection and eliminate false positives on asset plugins
- Optimize XposedLogPrinter with asynchronous bounded queue
- Standardize APKS internal entry naming
👍29❤8🔥3🕊1🍌1👻1😡1
NPatch 的在線倉庫來自于 FunProject 的分發倉庫,再次致謝👍
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegram
FunProject
此为版本更新频道
聊天群组: @QToolC
表情包转换机器人: @QToolHelperBot
聊天群组: @QToolC
表情包转换机器人: @QToolHelperBot
❤18👍3
NPatch-v1.0.7-783-release.apk
8.8 MB
chore: remove Firebase SDK
build: remove unused ProGuard obfuscation dictionary
fix(patch): Optimize split APK determination and inject isSplitRequired
feat(manager): Comprehensive optimization of gesture synchronization, selection contrast, and page safe margins for the liquid floating bottom bar
refactor(patch): Refactor sequential number allocation for --injectdex and dual-layer exemption for hidden APIs in Android 16
fix(loader): Improve cache integrity verification, atomic writing, and multi-process locking mechanism for origin.apk (fix #147)
build: remove unused ProGuard obfuscation dictionary
fix(patch): Optimize split APK determination and inject isSplitRequired
feat(manager): Comprehensive optimization of gesture synchronization, selection contrast, and page safe margins for the liquid floating bottom bar
refactor(patch): Refactor sequential number allocation for --injectdex and dual-layer exemption for hidden APIs in Android 16
fix(loader): Improve cache integrity verification, atomic writing, and multi-process locking mechanism for origin.apk (fix #147)
👍17❤3🔥3
NPatch-v1.0.7-792-release.apk
8.8 MB
在打包端方面,首先實裝了 ABI 感知的 SO 頁面對齊分流機制,將 64 位元架構(arm64-v8a、x86_64)對齊 16KB 以適配 Android 15 規範,32 位元則回退至 4KB 對齊,兼顧規範與安裝包體積。其次調整了 DEX 注入時序,改在複製來源 APK 其餘檔案前優先注入引導 DEX,確保 classes.dex 位於 ZIP 最前端以利系統解析;啟用 --injectdex 時,改由遍歷來源 APK 取得最大序號後遞增命名(classes{N+1}.dex),防止 DEX 排序混亂。此外,內嵌模組加入了基於 LinkedHashSet 的包名去重保護,自動忽略重複傳入的模組;同時移除 Split APK 中多餘的 minSdkVersion 設定,並將 AXML 的布林屬性顯式宣告為 Boolean.TRUE 物件,避免屬性映射異常。
在載入器方面,修復了 disableProfile 在讀取 splitNames 時因未校驗陣列長度與 null 所引發的空指標異常(NPE)。針對簽名繞過情境下原應用可能遺失原生庫的問題,新增了宿主路徑注入機制,透過 context.getPackageCodePath() 取得真實安裝 APK 路徑,並利用反射呼叫 ClassLoader 或 DexPathList 的 addNativePath 將 SO 路徑動態補入載入器。同時,路徑引用統一改由參數顯式傳遞 installedApkPath,避免靜態欄位引發重入問題;快取層面則新增對舊版 cache/native/host 目錄的清理邏輯。最後,在釋放 native bootstrap 檔案後追加了唯讀屬性防止意外篡改,並在 JNI 攔截白名單中忽略 libCrashGuard.so,避免簽名繞過模組與防崩潰組件互相干擾引發死鎖。
在載入器方面,修復了 disableProfile 在讀取 splitNames 時因未校驗陣列長度與 null 所引發的空指標異常(NPE)。針對簽名繞過情境下原應用可能遺失原生庫的問題,新增了宿主路徑注入機制,透過 context.getPackageCodePath() 取得真實安裝 APK 路徑,並利用反射呼叫 ClassLoader 或 DexPathList 的 addNativePath 將 SO 路徑動態補入載入器。同時,路徑引用統一改由參數顯式傳遞 installedApkPath,避免靜態欄位引發重入問題;快取層面則新增對舊版 cache/native/host 目錄的清理邏輯。最後,在釋放 native bootstrap 檔案後追加了唯讀屬性防止意外篡改,並在 JNI 攔截白名單中忽略 libCrashGuard.so,避免簽名繞過模組與防崩潰組件互相干擾引發死鎖。
❤22👍7🎉4🤔2
Forwarded from NPatch
The Patchwork Update has been officially released.
https://github.com/7723mod/NPatch/releases/tag/v1.0.8
https://github.com/7723mod/NPatch/releases/tag/v1.0.8
GitHub
Release v1.0.8 The Patchwork Update · 7723mod/NPatch
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 o...
🔧 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 o...
👍10❤3🔥1🎉1
jar-v1.0.8-813-release.jar
9.5 MB
Benchmark:
測試樣本:Bilibili
打包耗時:~70s ➔ 5s(14x 效能躍升)
核心成果
代碼極致瘦身:淨刪除 14,897 行(106 個檔案,+329 / -15,226)。
依賴單純化:拔除 vendored 的
速度躍升 14x 的背後原因
線性串流管線(消滅中繼 I/O):以
原包零拷貝內嵌(Zero-Copy):
壓縮與簽名解耦:打包完成後交由
簽名 API 收斂:多方案校驗收斂為
測試樣本:Bilibili
v9.13.0(典型 200MB+ 超大型複合 APK)打包耗時:~70s ➔ 5s(14x 效能躍升)
核心成果
代碼極致瘦身:淨刪除 14,897 行(106 個檔案,+329 / -15,226)。
依賴單純化:拔除 vendored 的
apkzlib 與 apksigner submodule,簡化為單一依賴 implementation("top.nkbe:NeoApk:1.0.1"),免除 submodule update。速度躍升 14x 的背後原因
線性串流管線(消滅中繼 I/O):以
ZipFile + ZipMaker 替代舊 ZFile 的隨機讀寫與 LRU 暫存塊機制,徹底抹平大檔案打包時的反覆磁碟寫入。原包零拷貝內嵌(Zero-Copy):
origin.apk 免重新 Deflate 直接透傳封裝,大包內嵌與去簽還原幾乎無計算開銷。壓縮與簽名解耦:打包完成後交由
V2V3SchemeSigner 一次性簽名,杜絕生命週期回呼的耦合等待。簽名 API 收斂:多方案校驗收斂為
ApkSignatureReader.getApkSignatures() 一行呼叫,邏輯更輕、維護更省力。👍27❤8
NPatch-v1.0.8-814-release.apk
6.4 MB
fix: 替換 SDK33 專屬 readAllBytes
InputStream.readAllBytes 僅 SDK33 以上可用,切換為 IOUtils.toByteArray 向下相容
InputStream.readAllBytes 僅 SDK33 以上可用,切換為 IOUtils.toByteArray 向下相容
❤10👍3🔥1
NPatch-v1.0.8-817-release.apk
6.4 MB
fix (manager): Optimize package parsing and repository download
Package parsing: Removed the
Repository download: Changed to atomic writing; first save to a
fix (sigbypass): Fixed crashes caused by ART14+/16 dex writability checks and the issue of SQLite misidentifying read-only databases
After generating the origin.apk cache, directly set it to read-only using chmod 444 to bypass the ART dex writability check from the source; added logic to delete old files to avoid permission errors when overwriting read-only files.
Removed the fstat identity spoofing hook and the corresponding (dev,ino) cache to resolve the bug where inode reuse caused SQLite databases to be incorrectly set as read-only; retained stat series path interception, using only file size information to pass checks. Corresponds to Issue #153 and #155, resolving the "Writable dex file ... is not allowed" crash.
Package parsing: Removed the
GET_SIGNING_CERTIFICATES flag and added a fallback parsing strategy to prevent parsing interruptions caused by APK signature anomalies or malformed Manifests, allowing normal processing of hardened / non-standard APKs.Repository download: Changed to atomic writing; first save to a
.tmp temporary file, then rename and overwrite after the download is complete, preventing corrupted repo.json cache and Gson parsing errors caused by network interruptions.fix (sigbypass): Fixed crashes caused by ART14+/16 dex writability checks and the issue of SQLite misidentifying read-only databases
After generating the origin.apk cache, directly set it to read-only using chmod 444 to bypass the ART dex writability check from the source; added logic to delete old files to avoid permission errors when overwriting read-only files.
Removed the fstat identity spoofing hook and the corresponding (dev,ino) cache to resolve the bug where inode reuse caused SQLite databases to be incorrectly set as read-only; retained stat series path interception, using only file size information to pass checks. Corresponds to Issue #153 and #155, resolving the "Writable dex file ... is not allowed" crash.
❤14👍5🔥1🎉1🍌1
manager-v1.0.8-819-release.apk
6.4 MB
🔨 2 new commits
feat(sigbypass): EXTREME Added new svc hook to prevent inlining bypass, HIGH leveled stability
fix(manager): API 102 module companion binder will not auto-repush after manager is killed
feat(sigbypass): EXTREME Added new svc hook to prevent inlining bypass, HIGH leveled stability
fix(manager): API 102 module companion binder will not auto-repush after manager is killed
👍14❤7🔥1🤔1