Skip to content

Xposed-Modules-Repo/org.pysh.janus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

Janus

Janus

Xiaomi Rear Screen Enhancement LSPosed Module

English | 简体中文

Android LSPosed Kotlin License


Unlock the full potential of your Xiaomi rear screen

Introduction

Janus is an LSPosed module for Xiaomi phones with a rear screen, designed to enhance the rear screen experience. By hooking com.xiaomi.subscreencenter, it bypasses various system restrictions on the rear screen.

Features

Music Whitelist Unlock Remove rear screen music app whitelist restrictions, manage whitelist per app
Live Wallpaper Anti-Interrupt Prevent live wallpaper from pausing or resetting when rear screen is covered
Lock Wallpaper Switching Block long-press gesture on rear screen wallpaper to prevent accidental changes
Custom Rear Wallpaper Video Replace AI-generated wallpaper video with your own, with loop playback toggle and backup/restore
Rear Screen DPI Adjustment Customize rear screen display density for better small-screen experience
Rear Screen Keep Alive Foreground service periodically sends key events to prevent auto-sleep
Screen Casting Settings Screen casting rotation control, keep rear screen on during casting
Smart Assistant Custom Cards Import and manage custom MAML cards for the Smart Assistant panel, with drag-and-drop reordering, per-card enable/disable, priority and refresh interval settings
Custom Music Card Replace the stock music card template with a custom MAML template, with optional lyric scrolling patch
Lyric Hook Rules Per-app lyric hook rules via JSON rule engine. Import community-provided rules to display timed lyrics (TTML/LRC) from any music app on the rear screen
Telemetry Blocking Intercept DailyTrackReceiver to block data reporting
Quick Switch Quick settings tile for one-tap casting to rear screen
Hide Launcher Icon Hide app icon from launcher, open via LSPosed module manager

Prerequisites

  1. Device must have an unlocked Bootloader and Root access
  2. Install LSPosed framework
  3. Enable Janus module in LSPosed, select scope com.xiaomi.subscreencenter
  4. Open Janus app and configure features as needed
  5. Restart the scope or reboot the device for hooks to take effect

Note

Keep alive, DPI adjustment, task migration and other features require Root access.

Scope

App Name Package Name
Rear Display com.xiaomi.subscreencenter

Tip

Additional scopes (e.g. music apps for lyric hooks) are added dynamically via requestScope() when importing hook rules.

Building

# Debug build
./gradlew assembleDebug

# Release build (with ProGuard/R8 obfuscation + resource shrinking)
./gradlew assembleRelease

# Clean build artifacts
./gradlew clean
Build Environment
Requirement Version
JDK 17+
Android SDK compileSdk 36
Kotlin 2.3.20
Compose BOM 2025.03.01

Project Structure

Janus is split into four Gradle modules to keep the Xposed hook surface free of UI/AndroidX dependencies and to make the rule contract independently testable on pure JVM.

janus/
├── hook-api/           # Pure Kotlin (java-library) — engine contracts
│   └── org/pysh/janus/hookapi/
│       ├── HookRule.kt       # Rule / HookTarget / HookAction JSON model
│       ├── CardInfo.kt       # Card data contract shared by UI + hook
│       └── ConfigSource.kt   # Abstract K/V config (no SharedPreferences)
│
├── hook/               # Android library — runs inside the hooked host
│   ├── META-INF/xposed/      # module.prop / scope.list / java_init.list
│   │                         # (module.prop generated from version catalog)
│   ├── consumer-rules.pro    # R8 keeps for HookEntry + libxposed API
│   └── org/pysh/janus/hook/
│       ├── HookEntry.kt      # libxposed 101 XposedModule entry point
│       ├── engine/           # RuleEngine, RuleLoader, ActionExecutor
│       ├── engine/engines/   # Whitelist, SystemCard, CardInjection,
│       │                       WallpaperKeepAlive
│       └── config/           # SharedPreferencesConfigSource (RemotePrefs)
│
├── core/               # Android library — UI-side utilities
│   └── org/pysh/janus/core/util/  # DisplayUtils, JanusPaths, RootUtils...
│
└── app/                # Android application — UI / Service / Receiver
    └── org/pysh/janus/
        ├── JanusApplication.kt   # XposedService binding (manager side)
        ├── ui/                   # Compose + MIUIX pages
        ├── data/                 # WhitelistManager, CardManager, etc.
        ├── service/ receiver/ util/
        └── MainActivity.kt

Key properties:

  • Module version is a single source of truth in gradle/libs.versions.toml (moduleVersion / moduleVersionCode). It reaches META-INF/xposed/module.prop via a generated Gradle task and the runtime boot log via BuildConfig.MODULE_VERSION.
  • :hook is the only module carrying META-INF/xposed/ — the :app APK consumes :hook as a library, so the hook classes and metadata are merged into the final APK while the Gradle dependency graph keeps Compose/MIUIX out of the hook classpath.
  • Engines depend on ConfigSource, not SharedPreferences, so they can be unit-tested on pure JVM via ./gradlew :hook-api:test without Robolectric.
  • libxposed API 101 (io.github.libxposed:api) is the only hook framework dependency; no EdXposed/legacy de.robv.android.xposed imports.

Support

If you find this project helpful, consider supporting the development on Afdian.

Acknowledgements

Janus uses content from the following open-source projects. Thanks to the developers of these projects.

License

This project is licensed under the GPL-3.0 license.

About

小米后屏增强 LSPosed 模块 / Xiaomi rear screen enhancement LSPosed module

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors