Skip to content

Releases: Zhanfg/PatchNest-Module

PatchNest v0.4.1-rc2

Choose a tag to compare

@Zhanfg Zhanfg released this 08 Jun 12:16

PatchNest v0.4.1-rc2

🐛 Bug fixes (on-device report 2026-06-08)

  • Boot image detection on A/B slot B: find_boot_image() now searches for boot_b and kern_a (was missing on A/B devices running slot B with empty $SLOT — confirmed on OnePlus PJZ110 / Android 16). Fixes WebUI 错误:找不到 Boot 镜像 error.
  • KSU version field: module.prop::version stripped of v prefix (v0.4.1-rc10.4.1-rc2). KernelSU CN-locale module list parser does not recognize v-prefixed versions as valid SemVer and falls back to "Unknown" for both version and author.
  • Side effect of the above: "未安装" status on the detail page was a downstream consequence of the boot-image detection failure — kpatch hello fails because kpimg was never injected. Auto-resolves once the boot detection fix takes effect.

📦

  • versionCode: 25 → 26
  • version: v0.4.1-rc1 → v0.4.1-rc2

Install / Update

Existing users: re-install this zip in KernelSU → Modules → Install from storage. New users: standard install. WebUI update-check will detect the new version automatically.

v0.4.1-rc1

Choose a tag to compare

@github-actions github-actions released this 08 Jun 10:30

PatchNest Module

v0.4.1-rc2

🔀 Rebrand: KPatch-Next → PatchNest

  • Project renamed from "KPatch-Next" to "PatchNest" across 68 files:
    shell scripts, CI workflows, WebUI (JS/HTML/CSS), 15 locale XMLs,
    docs, tests, module.prop, update.json, version.properties.
  • Data directory changed from /data/adb/kp-next/ to /data/adb/patchnest/.
  • Binary source changed from KernelSU-Next/KPatch-Next to Zhanfg/PatchNest.
  • Module ID changed from KPatch-Next to PatchNest.
  • Variable names updated: KPNDIRPNDIR, VERSION_KPATCH_NEXTVERSION_PATCHNEST.

🔒 Security (post-rename audit)

  • service.sh exclusion grep fixed: grep -F "^$pkgq " was missing
    ^ anchoring with -F (literal match), replaced with grep "^$pkgq ".
  • boot_unpatch.sh inverted patched= logic corrected.
  • compile_kpm.sh uninitialized compile_rc variable fixed.

⚡ Robustness

  • WebView compatibility: Vite build target changed from es2022 to
    ['chrome80', 'es2020'] for Android WebView 80+ support (2020+ devices).
  • Top-level await removed from index.js; uses dynamic import().then().
  • 4 missing i18n keys synced across all 15 locales.
  • CRLF → LF line endings fixed in all module/*.sh scripts.

📦 Build

  • v0.4.1-rc2 zip packaged (1.95 MB, 66/66 validation + 117/117 tests pass).
  • Docker test suite: 41/43 pass (2 expected warnings).
    anti-detect KPM suite is no longer built into the PatchNest module.
  • /data/adb/patchnest/repos.json system override: PatchNest now
    lets a PatchNest fork ship a non-default default repo: drop a
    30+ correctness, security, and robustness fixes accumulated since v0.2.2. Highlights below; full list at #1
  • Zhanfg/PatchNest.
  • 双二进制源: kpimg/kptools 来自 KernelPatch-Public,kpatch 来自 PatchNest
    | Zhanfg/PatchNest-Module | 公开 | 模块发布,CI 自动构建 |

v0.3.0-rc9

Choose a tag to compare

@github-actions github-actions released this 07 Jun 01:12
chore(release): bump to v0.3.0-rc9 (build=23)

Includes the rc8 → rc9 delta:
- packaging: simplified the release job's zip step back to
  'cd MODULE_NAME && zip -r ... .' which matches the original
  build.sh contract. The earlier 'mkdir module && cp -al'
  approach over-engineered the wrapping and would have
  changed the zip's internal layout in a way that the root
  manager might not have expected.

v0.3.0-rc8

Choose a tag to compare

@github-actions github-actions released this 07 Jun 00:54
chore(release): bump to v0.3.0-rc8 (build=22)

The v0.3.0-rc7 tag was already published, so the release job's
check_tag step on rc7's commit would have correctly seen the tag
exists and skipped publishing rc7 again. To actually deliver
the packaging fix to users we need a new tag.

Includes the rc7 → rc8 delta:
- packaging: release job now creates a module/ subdirectory
  inside the zip so Magisk / KernelSU-Next / APatch find
  module/module.prop at the expected path (rc7 was zipping
  flat files which the root manager showed as 'unknown')
- webui=webroot: explicit field so KernelSU-Next / APatch
  know which subdirectory to serve the WebUI from
  (rc7 omitted this and they fell back to the module
  root, which is empty, producing the black-page bug)
- module.prop versionCode 21 → 22

v0.3.0-rc7

Choose a tag to compare

@github-actions github-actions released this 07 Jun 00:28
chore(release): bump to v0.3.0-rc7 (build=21)

Bumps module.prop versionCode 20 → 21 and update.json's
version pointer to v0.3.0-rc7. The release job's check_tag
step sees no existing v0.3.0-rc7 tag and emits need_release
= true, which triggers the release job to run
softprops/action-gh-release@v2 — pushing the tag and
uploading KPatch-Next-Module.zip to the release.

Includes the v0.3.0-rc6 → v0.3.0-rc7 delta:
- ultracode-audit-2026-06-06 round 2: comprehensive P1/P2/P3
  hardening across shell+webui (138 P1, 194 P2, 154 P3
  fixed; 7 pre-existing test failures remain — see
  CHANGELOG.md for the full list).
- APM-style KPM update flow: webui/page/kpm-update.js with
  diff/badge/auto-check + openUrlInstallDialog for direct
  zip-URL installation.
- semver 13-corner-case test suite in utils.test.js.
- New Zhanfg/Kpm-Repo GitHub repository as the canonical
  source of kpm_repo.json (previously only available in
  .audit/worktree/). DEFAULT_REPO_URL in webui/page/kpm_repo.js
  now resolves to the live URL.
- CI: workflow-level contents:read default, setup-ndk pinned
  to commit SHA, locale completeness verified, magiskboot
  treated as optional binary.

Also: documented two follow-up tasks for the maintainer:
  (1) refresh 4 stale SHA256 hashes in version.properties
  (the current ones don't match upstream artifacts), and
  (2) integrate the Kpm-Repo clone-and-build into the
  arm64-test/release jobs to replace the 'for src in
  module/kpms/*.c' loop that no-ops on main (the KPM
  sources live in the standalone Kpm-Repo project now).

v0.3.0-rc6

Choose a tag to compare

@github-actions github-actions released this 06 Jun 19:25
fix(ci): treat magiskboot as optional + grant release job contents:write

- tests/validate_module.js: mark magiskboot as optional in the
  REQUIRED_BINARIES list. The current build can ship without
  magiskboot when boot_patch.sh's Magisk APK download fails
  (e.g. during the SHA-hash refresh window when the pinned
  hash doesn't match upstream). Downstream code in boot_patch.sh
  already handles the magiskboot-missing case for the non-Magisk
  flows (APatch / KernelSU-Next paths don't unpack with
  magiskboot). The validator no longer treats it as a hard
  failure; it just emits an OPTIONAL MISSING warning.

- .github/workflows/build.yaml: add 'permissions: contents: write'
  to the release job (re-adding the override that the workflow-
  level read-only default needs to be paired with). The
  softprops/action-gh-release step in this job is the only
  step in the whole workflow that requires write access; every
  other job stays read-only.

v0.2.4

Choose a tag to compare

@github-actions github-actions released this 06 Jun 00:15

v0.2.4

30+ correctness, security, and robustness fixes accumulated since v0.2.2. Highlights below; full list at #1

🔒 Security

  • Shell injection in user-controlled shell commands: loadModule, cp, kpm_repo.js URL, exclude.js CSV writer, backup.js save path, index.js rehook command. All paths now sanitize input and use escapeShell / sanitizeUrl / single-quoted heredocs.
  • Backup path traversal in save-to-storage: filename is now stripped to basename only; .. rejected.
  • Repo download size cap: --max-filesize 50 MiB on curl to defend against malicious or compromised repos.

🐛 Critical fixes

  • Flash guard precedence bug in boot_patch.sh: the old if [ -b ] || [ -c ] && [ -f ] would silently attempt to flash block-device boot images even when new-boot.img was missing. Now requires both the device to be a block/char device AND new-boot.img to exist.
  • KPM validator silently dropped the first -M <file> argument because prev_flag was empty on iteration 0. Sentinel initialization fixes it; also dropped the bogus b700 big-endian aarch64 check.
  • Compiler exit code masked in compile_kpm.sh: $? read the subsequent [ "$ARCH" = "arm64-v8a" ] test, not the compiler. Explicit compile_rc=$? capture.
  • magiskboot repack exit code misread in boot_patch.sh: $? was reading the next echo, not magiskboot. Replaced with if ! magiskboot ....
  • Subshell-piped while loop in service.sh lost state on exit; replaced with here-doc reader. Also added 5-minute boot_completed timeout to prevent infinite loop on broken ROMs.
  • 5-second infinite loop in status.sh for boot_completed — same fix.
  • find -o precedence bug in install_kpm.sh matched .kpm directories and .bak files. Added explicit -type f \( -o -o \).

⚡ Robustness

  • Rehook switch UI now rolls back on backend failure instead of leaving the toggle out of sync.
  • initInfo shows em-dash instead of literal "undefined" when uname returns empty.
  • tail -200tail -n 200 in log.js (toybox interprets the former as byte offset).
  • status.sh race between cat tmp > file and concurrent readers; replaced with mv. Sed delimiter changed to | so values with / don't break it.
  • status.sh self-cleanup uses readlink -f fallback for realpath (not on all toybox builds).
  • Empty KPM directory no longer makes the for-loop run once against a literal *.kpm string.
  • MAX_CHUNK_SIZE is now initialized via awaited async before uploads can start; no more race.
  • Upload pipes now have 60s/chunk + 120s/combine timeouts and respect AbortSignal so an aborted upload kills orphan base64 pipes.
  • Pull-to-refresh requires single-finger gestures; multi-finger and touchcancel abort cleanly.
  • Load failure preserves the uploaded file in modDir/tmp for inspection and retry.
  • kpmItemMap prunes stale entries on each render so a renamed module doesn't leave a stale listener bound to the old name.
  • 3-click KSUWebUIStandalone redirect fires at most once per session.
  • DEV short-circuit in parseBootimg no longer skips renderKpmList() — dev UI now matches prod.

📦 Build / dependencies

  • kpatch-next pinned to 0.13.5-2 (was latest — non-reproducible builds).
  • pnpm build || pnpm install && pnpm build precedence fix.
  • $ARGS_OPT and $SRC_FILES quoting fixes in install_kpm.sh / compile_kpm.sh.

📋 Misc

  • New KERNELPATCH_FORK_MAINTENANCE.md documenting the relationship with the upstream bmax121/KernelPatch and how to sync.
  • module.bin arm64 test workflow unchanged.

Credits

  • APatch boot scripts (vendored, with our patches).
  • bmax121/KernelPatch upstream.
  • KernelSU-Next/KPatch-Next.

v0.2.3

Choose a tag to compare

@github-actions github-actions released this 05 Jun 11:06
fix: break WebUI circular dependency causing black screen

Root cause: page modules imported from index.js which has top-level
await, causing TDZ (temporal dead zone) errors.

Solution:
- Created constants.js with shared values (modDir, persistDir)
  and pure utilities (escapeShell, linkRedirect, MAX_CHUNK_SIZE)
- Page modules import from constants.js instead of index.js
- constants.js imports kernelsu-alt directly (not circular)
- kpm.js: initInfo imported from index.js (only used in
  DOMContentLoaded handlers, no TDZ risk)

This eliminates the circular dependency chain:
  index.js → page/*.js → index.js (TDZ)
becomes:
  index.js → page/*.js → constants.js (no cycle)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

v0.2.2

Choose a tag to compare

@github-actions github-actions released this 31 May 12:16

KPatch Next Module v0.2.2

基于 KernelPatch 的 Magisk/KernelSU/ReSukiSU/APatch 内核补丁模块。

🌐 多 Root 管理器兼容

  • 自动检测 Magisk / KernelSU / ReSukiSU / APatch
  • WebUI 适配各管理器(KSUWebUIStandalone / 原生 WebUI)
  • Magisk 用户可通过 KSUWebUIStandalone 使用

📦 KPM 用户体验(类 APM)

  • ZIP 一键安装 (module.prop + .kpm/.ko/.o/.c)
  • 事件自动注册 (event=BOOT_COMPLETED)
  • 源码编译 (compile_kpm.sh)
  • KPM 在线仓库浏览器
  • 自动加载 (autoLoad=true)

🔒 崩溃防护

  • 启动计数器:3 次失败 → 安全模式
  • ELF 预加载验证
  • 故障 KPM 黑名单
  • 嵌入式 KPM 早期保护

🕶️ 完整隐藏系统

  • 文件系统隐藏 (可配置 umount)
  • SELinux enforce/上下文隐藏
  • 进程名重命名

🛡️ 内核特性 (KernelPatch fork)

  • App Profile 体系 / SELinux 策略操作
  • KPM 事件系统 / .o/.ko 格式支持
  • 安全模式 / 内核兼容 3.18-6.12+

🖥️ WebUI

  • 日志查看器 / 备份管理 / KPM 仓库
  • 15 种语言完整翻译
  • 白屏修复 + 容错

🏗️ CI

  • 7 类 60+ 项自动化检查
  • 模块包完整性验证
  • 自动发布

下载 KPatch-Next-Module.zip → 在管理器中刷入 → 重启 → WebUI 补丁内核 → 再重启