Skip to content

Usage ​

NPatch provides two artifacts:

  • jar-v<verName>-<verCode>-release.jar — Cross-platform patching tool, pure Java, runs on Windows / macOS / Linux
  • manager-v<verName>-<verCode>-release.apk — Android Manager app, only needed for Local mode

Both are typically released together. Read What is NPatch first to understand the two modes, then come back here.

Download ​

  • Stable: GitHub Releases
  • Canary builds: Test versions released by developers, available on the Telegram channel
  • Debug builds: Debugging versions, available only on GitHub Actions
  • Official channel: Telegram

Filename Format ​

Release filenames look like:

jar-v<verName>-<verCode>-release.jar
manager-v<verName>-<verCode>-release.apk

Pattern: <artifact>-v<verName>-<verCode>-<variant>.{jar,apk}

  • verName — Version name (e.g., 1.0.5)
  • verCode — Version code (e.g., 639)
  • variant — Build type: release (stable) or debug (Actions only)

Requirements ​

ItemRequirement
Patching tool runtimeJava
PlatformWindows / macOS / Linux
Android versionPatched apps require Android 9 (API 28)+

Two Ways to Patch ​

Install the current manager-v<verName>-<verCode>-release.apk on your device, select the app to patch from the UI, and install the result directly — all on-device. This is the recommended approach for most users. The Manager UI defaults to High (2) signature bypass.

See Manager & Shizuku for more.

Option 2: Using the jar ​

Best for batch patching, automation, or CI. Feed the target APK to the jar, get <original>-<NPatch versionCode>-npatched.apk or <original>-npatched.apks.

bash
java -jar jar-v<verName>-<verCode>-release.jar [options] <apks...>

Minimal example (Local mode; the CLI defaults to Basic signature bypass):

bash
java -jar jar-v<verName>-<verCode>-release.jar --manager target.apk

Patching Split APKs / App Bundles (pass base and all split apks together):

bash
java -jar jar-v<verName>-<verCode>-release.jar --manager base.apk split_config.arm64_v8a.apk split_config.zh.apk

Integrated mode (embed one or more modules):

bash
java -jar jar-v<verName>-<verCode>-release.jar --embed module1.apk --embed module2.apk target.apk

Replace <verName> and <verCode> in the examples with the version you downloaded.

Packaging & Split APKs (APKS) Support ​

NPatch natively supports both standalone APKs and multi-split Split APKs / APKS / App Bundles:

  • Standalone APK: Directly produces a patched, ready-to-install standalone APK.
  • Split APKs / APKS:
    • Automatically identifies base.apk alongside all configuration splits (ABI, locale, screen density).
    • When changing package name (-p), overriding versionCode (-r / --allowdown), or modifying targetSdkVersion, NPatch automatically synchronizes all split manifests with the base APK to prevent package installer verification errors.
    • Split APKs are resigned and realigned without redundant core package nesting, maintaining a minimal archive size.
    • Standardized .apks archives are generated (internally structured as base.apk and split_*.apk), fully compatible with system installers, InstallLion, SAI, Shizuku, and third-party tools.

CLI Options ​

Corresponds to @Parameter declarations in top.nkbe.npatch.patch.NPatch.

OptionDescriptionDefault
<apks>APK paths to patch (positional, at least one; can pass base and all split APKs)—
-h, --helpShow help—
-o, --outputOutput directory. (current dir)
-f, --forceOverwrite existing outputoff
-p, --newpackagePatch with a new package name (synchronized across splits)unchanged
-d, --debuggableMark app as debuggableoff
-l, --sigbypasslvSignature bypass level 0–5 (see below)1
--injectdexInject loader Dex (needed for isolated processes, e.g., browser renderers)off
--providerInject file picker (from MT Manager) to manage data directory filesoff
--installerSourceSet installer source string—
--useMicroGEnable MicroG support, redirect GMS calls to community MicroGoff
--outputLogWrite Legacy and API 101/102 module API logs, framework logs, and uncaught Java/Kotlin crashes asynchronously to the Media directory (non-blocking)on
--hidelibsReduce basic environment-detection signals by sanitizing ART and sensitive system-library visibilityoff
-k, --keystoreCustom keystore: path storePass alias aliasPass—
-npa, --npatch-keystoreUse built-in NPatch keystore—
-fpa, --fpa-keystoreUse built-in FPA keystore—
--managerEnable Local mode (mutually exclusive with --embed)—
-r, --allowdownSet output versionCode to 1, allowing future downgrades (synchronized across splits)off
--versioncodeSet the replacement versionCode used with --allowdown1
-v, --verboseVerbose packaging logoff
-m, --embedEnable Integrated mode with specified module APK, repeatable (mutually exclusive with --manager)—

Mutual Exclusion Rules ​

Enforced at CLI parse time:

  • --manager and --embed cannot be used together
  • -k cannot be used with -npa or -fpa
  • -npa and -fpa cannot be used together
  • Extreme (3), Seccomp (4), and Stealth (5) require --manager; Integrated mode caps sigbypass at High (2)

Signature Bypass Levels ​

From NPatch's official UI descriptions:

LevelNameDescriptionAvailable in Integrated
0NoneNo processingYes
1BasicAdds Java IO and Native openat/openat64 redirection so signature-related file reads access the original APKYes
2HighBased on Basic, restores original AppComponentFactory and hooks getPackageArchiveInfo, hasSigningCertificate, etc.Yes
3ExtremeBased on High, hooks PackageInfo(Parcel) constructor to override Binder deserialization of signature infoNo (requires --manager)
4SeccompEnables seccomp v2 filtering and trusted thread file redirection on ARM64, based on FunPatchApp's approachNo (requires --manager)
5StealthUses xhook to redirect app-native-library GOT/PLT entries while retaining PackageInfo signature spoofingNo (requires --manager)

In practice: start with 1, escalate if needed. Higher levels aren't always better — some apps behave worse at higher levels.

Installing Patched APKs / APKS ​

Since signatures differ, you must uninstall the original app first. Make sure you've backed up your data.

WARNING

Uninstalling removes app data. Back up important data from the original app first, or use ADB backup.

Local Mode: Next Steps ​

  1. Install manager-v*-release.apk (package top.nkbe.npatch, if not already installed)
  2. Install the patched APK or APKS
  3. Open the Manager, find the app, add Xposed modules to its scope
  4. Launch the app — modules take effect

Integrated Mode: Next Steps ​

Install the patched APK / APKS and you're done. Modules are already at assets/npatch/modules/<package>.apk. To change modules, re-patch.

Signature Schemes & Custom Keystore ​

NPatch implements full V1 (JAR Signing) + V2 (APK Signature Scheme v2) + V3 (APK Signature Scheme v3) signing schemes, dynamically resolving the target application's real minSdkVersion (auto-adaptive minSdk 21+), ensuring complete compatibility across Android OS releases and installation engines.

By default the built-in keystore is used (falls back to -npa). To use your own:

bash
java -jar jar-v<verName>-<verCode>-release.jar -k mykey.jks storePass myalias aliasPass --manager target.apk

Four positional arguments: keystore path, store password, alias, alias password. Internally loaded as BKS format with V1 + V2 + V3 signing enabled.

The Manager also has custom keystore settings where you can verify keystore type, password, and alias.

Having Issues? ​

See FAQ, or ask on Telegram.

NPatch Official Documentation