NPatch is a rootless Xposed framework based on LSPosed. It injects Xposed modules into target APKs without requiring root access, enabling module functionality through APK patching.
- Android 16 (API 36) Support - Fixed XResources class loading crash on Android 16's strict boot classloader namespace
- Split APK Support - Handles Google Play split APKs (XAPK/APKS) with automatic re-signing
- 16KB ELF Alignment - Proper page alignment for Android 15+ compatibility
- MicroG Integration - Built-in GMS redirect for Google apps (YouTube, YouTube Music, etc.)
- Keep-Alive Service - Persistent notification prevents system from killing the manager
- Log Viewer - Built-in log viewer with time/level filtering and export
- Installer Source Tracking - Tags patched apps with their original distribution source
- Min: Android 8.1 (API 27)
- Max: Android 16 (API 36) - tested on Samsung Galaxy S25 Ultra
- Stable releases: GitHub Releases
- CI builds: GitHub Actions
- Install
NPatch-vX.X.X.apkon your Android device - Grant storage permissions
- Select an app to patch (from storage or installed apps)
- Configure patch options and start patching
- Install the patched APK
java -jar npatch.jar -o output_dir --manager --sigbypasslv 2 \
--outputLog --provider --force \
-k keystore.jks password alias aliasPassword \
target.apk [split1.apk split2.apk ...]- Install NPatch GMS (renamed MicroG)
- Sign in with your Google account in NPatch GMS
- When patching, enable "Use NPatch GMS" checkbox
- The patched app will use NPatch GMS instead of real Google Play Services
NPatch Manager (org.lsposed.npatch)
├── Patcher - APK modification engine
│ ├── Manifest modification (AppComponentFactory, permissions)
│ ├── DEX injection (meta-loader, provider)
│ ├── Split APK merging & re-signing
│ ├── 16KB .so alignment
│ └── Signature bypass (levels 0-3)
├── Patch Loader (injected into target app)
│ ├── LSPAppComponentFactoryStub - Bootstrap entry point
│ ├── LSPApplication - Xposed initialization
│ ├── LSPLoader - Module loading (XResources reflection fix)
│ ├── SigBypass - Signature verification bypass
│ └── GmsRedirector - Runtime GMS→MicroG redirect
├── Manager UI
│ ├── Home - Device & framework info
│ ├── Manage - Patched app management
│ ├── Repo - Module repository
│ ├── Logs - LSPosed/NPatch log viewer
│ ├── MicroG - Google account management
│ └── Settings - Configuration
└── Services
├── KeepAliveService - Foreground notification
├── ModuleService - Module binder for patched apps
├── ConfigProvider - Module scope provider
└── ManagerService - Manager binder service
NPatch includes critical fixes for Android 16 compatibility:
-
XResources ClassNotFoundException -
android.content.res.XResourcesfails class resolution on Android 16 due to strict boot classloader namespace delegation. Fixed by using reflection inLSPLoader.javato avoid compile-time type references. -
16KB Page Alignment - Android 15+ requires ELF files (.so) to be aligned on 16KB boundaries. Fixed alignment from 4096 to 16384 bytes in the patcher.
-
DexFile API Deprecation -
dalvik.system.DexFileconstructor restricted on Android 14+. Replaced with reflection-based instantiation.
For Google apps that require Play Services authentication:
- GmsRedirector hooks Intent, ContentResolver, and PackageManager calls inside the patched app
- Redirects GMS IPC from
com.google.android.gmstoorg.lsposed.npatch.gms - Catches SecurityException from real GMS and retries with MicroG
- Adds
fake-signaturemanifest metadata for MicroG trust - Our NPatch GMS is a modified MicroG that trusts all callers unconditionally
- LSPosed - Core Xposed framework
- LSPatch - Original project NPatch is forked from
- LSPosed-Irena - Android 15+ LSPosed fork
- ReVanced GmsCore - MicroG base for NPatch GMS
- MicroG - Open-source Google Play Services replacement
- Xpatch - Original fork source
- Apkzlib - APK repacking library
- 7723mod/NPatch - Upstream NPatch project
- Claude (Anthropic) - AI-assisted development for Android 16 fixes, MicroG integration, split APK support, and manager features
NPatch is licensed under the GNU General Public License v3 (GPL-3) (http://www.gnu.org/copyleft/gpl.html).