One-Click Universal Android APK Patcher
HSPatcher is a standalone Android app that patches any APK with a comprehensive suite of runtime modifications — no root, no PC, no Xposed required.
- One-click patching — Select APK → Patch → Install
- Split APK support — Automatically merges
.apks/.xapk/.apkmbundles - APK extraction — Extract APKs from installed apps directly
- Universal signing — v1 + v2 + v3 APK signatures via Google's apksig library
- Manifest injection — Injects debug activities, permissions, and network security config
| Module | Description |
|---|---|
| HSPatchConfig | Central configuration singleton with settings persistence |
| ProfileManager | Multi-device-profile system with export/import |
| DeviceSpoofer | Full device fingerprint spoofing (Android ID, IMEI, model, etc.) |
| SSLBypass | SSL certificate pinning bypass (TrustManager + OkHttp) |
| SignatureBypass | APK signature verification bypass via IPackageManager proxy |
| ScreenshotEnabler | Removes FLAG_SECURE from all windows (screenshots/recording) |
| NetworkLogger | HTTP/HTTPS traffic logging to logcat |
| NetworkInterceptor | Deep network stack hooks (ProxySelector, ResponseCache) |
| ActivityTracker | Activity lifecycle tracking for debugging |
| DebugNotification | Persistent notification with quick access to debug panel |
- Embedded Frida gadget (arm64 + arm32) with comprehensive script:
- SSL Pinning Bypass — TrustManagerImpl, OkHttp3, HttpsURLConnection
- Signature Verification — Runtime PackageManager hooks
- Anti-Piracy Removal — License checker, installer spoof, root/debug detection
- Screenshot Enablement — Window.setFlags and SurfaceView.setSecure bypass
- Network Monitoring — URL, OkHttp, WebView, Socket traffic capture
- In-app debug panel accessible via notification
- Live log viewers with filtering
- Network traffic monitor with capture/export
- File explorer for app internals
- Profile management (create, save, load, import, export)
- Device fingerprint controls
- Android SDK — Build tools 36.1.0, Platform android-36
- PowerShell 7+ (
pwsh) - Java 17+ (JDK)
- Frida gadgets (optional) — Place
libgadget.sofor arm64-v8a/armeabi-v7a
- apksig 8.7.3 — APK signing
- ARSCLib 1.3.8 — Split APK merging
# Full clean build
pwsh -ExecutionPolicy Bypass -File build.ps1 -Clean
# Output: build/HSPatcher.apk- aapt2 — Compile & link resources
- javac — Compile Java sources
- d8 — DEX conversion
- Package — APK assembly with assets (extra.zip, frida_gadgets.zip)
- zipalign — Optimize APK alignment
- apksigner — Sign with v1+v2+v3
HSPatcher/
├── AndroidManifest.xml # App manifest
├── build.ps1 # Build script
├── src/ # Java source code
│ └── in/startv/hspatcher/
│ ├── MainActivity.java # Main UI + install flow
│ ├── PatchEngine.java # Core patching pipeline
│ ├── ManifestPatcher.java # Binary AXML manifest injection
│ ├── HSPatchInjector.java # DEX/smali injector
│ ├── ApksMerger.java # Split APK merger
│ ├── AppListActivity.java # Installed app browser
│ ├── AppExtractor.java # APK extraction
│ ├── CertBuilder.java # Self-signed cert generator
│ └── HspFileProvider.java # Content provider for APK install
├── res/ # Android resources
├── assets/
│ ├── extra.zip # Packed smali patch modules
│ └── frida/ # Frida gadget config + script
├── libs/ # Build dependencies
│ ├── apksig-8.7.3.jar
│ └── ARSCLib-1.3.8.jar
└── patches/ # Smali patch source files
├── smali/in/startv/hotstar/ # 66 smali module files
└── res/xml/ # Network security config
The smali modules in patches/ are injected into every patched APK. To modify:
- Edit files in
patches/smali/in/startv/hotstar/ - Repack:
Compress-Archive -Path patches/smali, patches/res -DestinationPath assets/extra.zip -Force - Rebuild:
pwsh -ExecutionPolicy Bypass -File build.ps1 -Clean
HSPatcher includes a robust install flow:
- Permission check — Requests "Install from unknown sources" if not granted
- Signature verification — Compares patched APK signature with installed version
- Mismatch handling — Offers to uninstall existing app if signatures differ
- Dual install method — FileProvider content URI (primary) + PackageInstaller session (fallback)
This project is for educational and research purposes only. Use responsibly.
