diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bc80e3c --- /dev/null +++ b/LICENSE @@ -0,0 +1,33 @@ +Setec Labs Driver Manager License + +Copyright (c) 2026 SetecLabs + +Permission is granted, free of charge, to any person obtaining a copy of +this software and associated files (the "Software"), to use the Software +for personal, non-commercial purposes only. + +The following restrictions apply: + +1. You may NOT redistribute, share, or otherwise distribute the Software + or any portion of it without prior written approval from the copyright + holder. + +2. You may NOT modify, adapt, or create derivative works based on the + Software without prior written approval from the copyright holder. + +3. You may NOT use the Software for any commercial purpose, or incorporate + it into any product or service offered to others, without prior written + approval from the copyright holder. + +4. This license notice must be included in all copies or substantial + portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +For licensing inquiries or approval requests, contact: SetecLabs diff --git a/README.md b/README.md new file mode 100644 index 0000000..a263c2d --- /dev/null +++ b/README.md @@ -0,0 +1,85 @@ +# Setec Labs Driver Manager + +An LSPosed/Xposed module for per-app driver management on Android. Redirect native library loading to custom drivers without modifying system files. + +## How It Works + +Driver Manager hooks into `System.loadLibrary()`, `System.load()`, `Runtime.loadLibrary0()`, and `BaseDexClassLoader.findLibrary()` via Xposed. When a scoped app tries to load a native driver, the hook redirects it to your custom driver file. The stock system drivers are never touched on disk. + +## Features + +- **Per-App Driver Scoping** — Select a driver, then pick which apps use the custom version (LSPosed-style checkbox UI) +- **System-Wide Mode** — Apply a custom driver to all user apps with one toggle +- **Driver Registry** — Auto-scans `/vendor` for GPU, WiFi, Bluetooth, audio, camera, USB, and SDR drivers with SHA256 hashing +- **Multiple Variants** — Keep multiple versions of a driver and switch between them +- **Kernel Module Manager** — Load/unload `.ko` kernel modules, set autoload, check compatibility +- **Driver Protection** — SHA256 baseline integrity checking to detect unauthorized changes to system drivers +- **File Redirect Hooks** — Also intercepts `FileInputStream` for firmware/config file redirection per-app + +## Requirements + +- Android 10+ (API 29+) +- [Vector](https://github.com/JingMatrix/Vector) (LSPosed fork) or compatible Xposed framework +- Root (KernelSU or Magisk) for .ko management and driver scanning + +## Installation + +1. Build the APK or grab a release +2. Install the APK +3. Enable the module in Vector +4. Set the module scope to the apps you want to manage +5. Open Driver Manager and tap the scan button to discover system drivers +6. Enable a driver, add custom variants, and scope apps to use them + +## Building + +``` +./gradlew assembleRelease +``` + +Output: `app/build/outputs/apk/release/app-release.apk` + +## Project Structure + +``` +app/src/main/ +├── assets/xposed_init # Xposed entry point +├── java/com/seteclabs/drivermanager/ +│ ├── xposed/DriverHook.java # Xposed hooks (the core) +│ ├── manager/ +│ │ ├── ScopeManager.java # Per-app scope config +│ │ ├── DriverRegistry.java # Driver discovery + database +│ │ ├── KoManager.java # .ko kernel module management +│ │ ├── ProtectionManager.java # Integrity checking +│ │ └── RootShell.java # Root command execution +│ ├── model/ # Data classes +│ └── ui/ # Activity + Fragments +└── res/ # Layouts, colors, themes +``` + +## Config Location + +``` +/data/local/tmp/driver-manager/ +├── scopes/ # Per-package JSON configs (read by Xposed hook) +├── drivers/ # Custom driver files +├── modules/ # .ko kernel modules +├── backup/ # Driver backups for integrity restore +└── autoload.conf # Modules to load at boot +``` + +## Supported Driver Categories + +| Category | What it scans | +|-----------|---------------| +| GPU | EGL libs, Vulkan ICDs in `/vendor/lib64/egl/`, `/vendor/lib64/hw/` | +| WiFi | BCM/WCN/WLAN firmware in `/vendor/firmware/`, `/vendor/etc/wifi/` | +| Bluetooth | HCD/BT firmware in `/vendor/firmware/`, `/vendor/etc/bluetooth/` | +| Audio | Audio HAL in `/vendor/lib64/hw/` | +| Camera | Camera HAL in `/vendor/lib64/hw/` | +| USB | libusb in `/vendor/lib64/`, `/system/lib64/` | +| SDR | RTL-SDR, HackRF, Airspy libs (Termux) | + +## License + +Free for personal use. Redistribution, modification, or use beyond personal purposes requires approval. See [LICENSE](LICENSE) for full terms. diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 68a11a6..3f58e44 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -19,7 +19,7 @@ android:value="Per-app driver manager: redirect native library loading to custom drivers without modifying system files" /> + android:value="100" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ef99065..8c1933b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,6 @@ - Driver Manager + Setec Labs Driver Manager Drivers Apps Modules diff --git a/app/src/main/resources/META-INF/xposed/java_init.list b/app/src/main/resources/META-INF/xposed/java_init.list new file mode 100644 index 0000000..6e4cdfe --- /dev/null +++ b/app/src/main/resources/META-INF/xposed/java_init.list @@ -0,0 +1 @@ +com.seteclabs.drivermanager.xposed.DriverHook diff --git a/app/src/main/resources/META-INF/xposed/module.prop b/app/src/main/resources/META-INF/xposed/module.prop new file mode 100644 index 0000000..2e0ce92 --- /dev/null +++ b/app/src/main/resources/META-INF/xposed/module.prop @@ -0,0 +1,2 @@ +minApiVersion=93 +targetApiVersion=100 diff --git a/app/src/main/resources/META-INF/xposed/scope.list b/app/src/main/resources/META-INF/xposed/scope.list new file mode 100644 index 0000000..e69de29