A Kotlin library that wraps commonly used hidden system APIs for Android system applications. It provides a unified, version-aware interface for operations that require platform signature or system privileges.
Requires: platform signature (
platform.jks) +android.uid.systemshared user ID
| Module | Description |
|---|---|
| Launcher | Get/set default launcher, list all launchers |
| Status Bar / Navigation Bar | Disable expand, icons, clock, navigation buttons; switch gesture/3-button mode |
| Device Info | SN, IMEI, MAC, RAM, battery capacity, IP address, root detection |
| Time / Timezone | NTP sync, set system time/timezone, change system language |
| Power Management | Shutdown, reboot, factory reset, screen on/off, sleep/wake |
| DPM (Device Policy) | Activate admin, set Profile/Device Owner, lock screen, password policy, camera/screenshot disable, kiosk mode |
| App Management | Silent install/uninstall (APK & XAPK), hide, freeze/suspend, block uninstall, grant permissions, battery optimization |
| Storage | Mount/unmount volumes, list USB storage, clear app data |
| Network | WiFi config, hotspot control, Ethernet enable/disable, HTTP/global proxy, NFC enable/disable |
| Input Injection | Inject touch, scroll, and key events via IInputManager |
| Sensor Privacy | Toggle microphone/camera kill switch (Android 12–13) |
| System Settings | Read/write Settings.Global/System/Secure |
| Accessibility | Enable/disable accessibility services |
| OTA Update | A/B partition OTA via UpdateEngine with progress callback |
| Bug Report | Trigger system bug report via IActivityManager or BugreportManager |
| USB Management | Grant USB device permission silently, bind default handler app |
| Dream (Screensaver) | Get/set screensaver component, start screensaver |
| Device Type Detection | Detect TV, Wear OS, Android Auto |
| Image Utilities | Convert between Drawable, Bitmap, and ByteArray |
| AppOps / Permissions | Set/check AppOpsManager modes, grant runtime permissions, manage battery optimization |
| OEMConfig | Parse OEMConfig restriction XML entries |
| Feature | API 31 (12) | API 32 (12L) | API 33 (13) | API 34 (14) | API 35 (15) | API 36 (16) |
|---|---|---|---|---|---|---|
| Sensor Privacy (mic/camera toggle) | Yes | Yes | Yes | - | - | - |
| Ethernet enable/disable | Yes (Trackstop/Trackstart) |
Yes | Yes (setEthernetEnabled) |
Yes | Yes | Yes |
| Lock screen (screen-off only, no lock) | - | - | - | Yes | Yes | Yes |
setProfileOwner (4-param) |
- | - | - | Yes | Yes | Yes |
setActiveAdmin (4-param) |
- | - | - | - | - | Yes |
setPackagesSuspendedAsUser (9-param) |
- | - | - | - | Yes | Yes |
NFC via INfcAdapter |
Yes | Yes | Yes | Yes | - | - |
NFC via NfcAdapter reflection |
- | - | - | - | Yes | Yes |
Wireless debugging (IAdbManager) |
Yes | Yes | Yes | Yes | Yes | Yes |
lockNow (2-param) |
Yes | Yes | Yes | - | - | - |
lockNow (3-param, with callerPackage) |
- | - | - | Yes | Yes | Yes |
SystemFunction/
├── SystemFunction_src/ # Full source code of the library and all version-specific modules
│ ├── SystemLib/ # Core library (main entry point, unified API surface)
│ ├── Android12/ # API 31–32 compatibility implementations
│ ├── Android13/ # API 33 compatibility implementations
│ ├── Android14/ # API 34 compatibility implementations
│ ├── Android15/ # API 35 compatibility implementations
│ └── Android16/ # API 36 compatibility implementations
├── SystemLib_repository/ # Pre-built Maven repository (AAR artifacts, ready to consume)
├── API_REFERENCE.md # Full API reference (Chinese)
└── API_REFERENCE_EN.md # Full API reference (English)
The SystemLib_repository directory is a local Maven repository. It contains pre-compiled AAR artifacts for all modules so you can consume the library without building from source.
Available artifacts (all versioned 1.0-<date>):
| Artifact | Group ID | Description |
|---|---|---|
systemlib |
com.android.systemlib |
Core library — main dependency for most projects |
android12 |
com.android.android12 |
API 31–32 compatibility layer |
android13 |
com.android.android13 |
API 33 compatibility layer |
android14 |
com.android.android14 |
API 34 compatibility layer |
android15 |
com.android.android15 |
API 35 compatibility layer |
android16 |
com.android.android16 |
API 36 compatibility layer |
hideapi |
com.android.hideapi |
Hidden API stub jar |
mdmsdk |
com.android.mdmsdk |
MDM SDK |
Typical usage: add
systemlibonly. It already bundles all version-specific modules internally.
The source project is a standard Android multi-module Gradle project. To build and publish locally:
cd SystemFunction_src
./gradlew :SystemLib:publishReleasePublicationToMavenRepositoryThis publishes the updated AARs back into SystemLib_repository.
- Platform signature keystore (
platform.jks) from the device manufacturer - Your app must be signed with the platform key
- Your app must declare
android.uid.systemas shared user ID
dependencyResolutionManagement {
repositories {
maven { url 'https://github.com/h4de5ing/SystemFunction/raw/master/SystemLib_repository' }
// Mirror for users in China
maven { url 'https://gitee.com/lex1992/system-function/raw/master/SystemLib_repository' }
}
}dependencies {
implementation 'com.android.systemlib:systemlib:1.0-20221223'
}android {
signingConfigs {
release {
storeFile file("platform.jks")
storePassword 'android'
keyAlias 'android'
keyPassword 'android'
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:sharedUserId="android.uid.system">
...
</manifest>-keep class com.android.systemlib.** { *; }
System signature: You must obtain platform.jks from your device manufacturer. The APK must be signed with the platform key and installed on the system partition (or pushed via adb install on eng/userdebug builds).
API stability: Most APIs in this library use @UnsupportedAppUsage-annotated or AIDL hidden interfaces. They may change between Android versions. Always test after upgrading the target Android version.
Version-specific modules: Android12.kt through Android16.kt contain implementations that differ per API level. The unified entry point in Syslib.kt / SystemLib.kt dispatches to the correct implementation automatically.
Known limitation: copyDir() in X.kt currently only traverses the directory tree and prints paths — it does not actually copy files. Do not rely on it for file copy operations.
When filing an issue, include:
- Android version and API level (e.g. Android 14 / API 34)
- Device model and ROM variant (if relevant)
- Complete logcat output
- Minimal reproducible code
- Fork the repository
- Create a feature branch
- Commit your changes with a descriptive message
- Push and open a Pull Request