Complete rewrite from KernelSU shell scripts to LSPosed module using modern libxposed API. Hooks Android's hidden Wi-Fi Display framework to enable native Miracast support on Android 12+ devices. - Framework resource hooks (config_enableWifiDisplay) - WifiDisplayStatus feature state override - System feature and permission injection - Settings Cast UI integration - Quick Settings tile - Settings activity with device-specific options
Miracast Enabler
An LSPosed/Xposed module that unlocks native Miracast (Wi-Fi Display) on Android 12+ devices where it has been hidden by the OEM.
Android still ships the full Miracast/WFD protocol stack in the framework — WifiDisplayAdapter, WifiDisplayController, RemoteDisplay, and all supporting classes. OEMs simply disable it via a config flag and hide it behind the Chromecast-only Cast UI. This module hooks the framework to re-enable it, giving you native Miracast with zero custom streaming code.
Features
- Native Wi-Fi Display — uses Android's built-in Miracast stack, not a custom implementation
- Quick Settings tile — scan for and connect to Miracast receivers from the notification shade
- Framework hooks — forces
config_enableWifiDisplayandconfig_wifiDisplaySupportsProtectedBuffersto true at the resource level - Cast UI integration — unhides WFD routes in Settings > Cast so Miracast sinks appear alongside Chromecast devices
- Permission grants — automatically grants
CONFIGURE_WIFI_DISPLAYandCONTROL_WIFI_DISPLAYto the module - Feature injection — forces
android.software.wifi_displaysystem feature to report as available - Foldable support — display source selector for Pixel Fold, Pixel 9 Pro Fold, and Pixel 10 Pro Fold
- Settings app — configure resolution, HDCP, GPU composition, Wi-Fi concurrency
Requirements
- Android 12+ (API 31+)
- LSPosed or LSPosed-IT installed and active
- Root (KernelSU, Magisk, or APatch)
- Wi-Fi Direct capable hardware (most modern phones)
Installation
- Install the APK
- Open LSPosed manager
- Enable "Miracast Enabler" module
- Set scope to:
System Framework,System UI,Settings - Reboot
- Add the Miracast tile to Quick Settings, or go to Settings > Connected devices > Cast
Supported Devices
Primarily tested on Pixel devices with Tensor SoCs:
| Device | Codename | SoC | Status |
|---|---|---|---|
| Pixel 10 Pro Fold | rango | Tensor G5 | Primary target |
| Pixel 9 Pro Fold | comet/cometl | Tensor G4 | Supported |
| Pixel Fold | felix | Tensor G2 | Supported |
| Pixel 9 series | caiman/komodo/tokay/blazer | Tensor G4 | Supported |
| Pixel 10 series | laguna platform | Tensor G5 | Supported |
| Other Android 12+ | — | — | Should work if WFD classes exist in framework |
Configuration
Open the Miracast Enabler app to access settings:
| Setting | Description | Default |
|---|---|---|
| Resolution | Max output resolution (auto, 720p, 1080p @ 30/60fps) | 1080p 30fps |
| HDCP | Content protection (disable for better compatibility) | Off |
| Display source | Inner/outer display on foldables | Inner |
| GPU composition | Fix black/green screen on Tensor devices | On |
| Single-channel concurrency | Prevent Wi-Fi latency spikes during cast | Off |
How It Works
The module hooks into four processes:
-
System Server (
android) — hooksResources.getBoolean()to force Wi-Fi Display config flags true, hookshasSystemFeature()to report WFD support, hooksWifiDisplayStatus.getFeatureState()to returnFEATURE_STATE_ON, and grants WFD permissions to the module package. -
Settings (
com.android.settings) — hooksWifiDisplayStatus.getFeatureState()andWifiDisplayPreferenceController.getAvailabilityStatus()so the Wi-Fi Display section appears in Cast preferences. -
SystemUI (
com.android.systemui) — provides the Quick Settings tile for scanning and connecting. -
App process — the settings activity reads/writes
SharedPreferenceswhich the hooks consume viaXSharedPreferences.
Building
# Requires Android SDK with API 34 and build-tools 34.0.0
echo "sdk.dir=/path/to/android-sdk" > local.properties
./gradlew assembleRelease
Output APK: app/build/outputs/apk/release/app-release.apk
Troubleshooting
Miracast option doesn't appear after reboot
- Verify the module is enabled in LSPosed with correct scope
- Check LSPosed logs for "MiracastEnabler" entries
- Some ROMs may need a second reboot after first activation
Black or green screen during cast
- Enable "Force GPU composition" in module settings
- This is a known issue on Tensor SoCs where the HWC doesn't handle virtual display layers
Connection drops or high latency
- Enable "Single-channel concurrency" to prevent the Wi-Fi chip from splitting STA and P2P across bands
- Move closer to the Miracast receiver
- Ensure no heavy Wi-Fi traffic on the same network
No Miracast receivers found
- Ensure the receiver is in pairing/discovery mode
- Check that Wi-Fi Direct is not disabled by MDM or device policy
- Verify Wi-Fi is on and connected
License
MIT