ShizuStore

HyperOS FCM Fix

dingwen07

0.2.3 · GitHub

Download APK
Vendor-specific Android 11+ 1 month ago GPL-3.0
39 ShizuStore
2.8k GitHub
127 Stars
2 MB Size

More about this app

Keeps Google Play services unrestricted on HyperOS so FCM push notifications arrive on time

HyperOS FCM Fix

English | 简体中文 | 繁體中文

HyperOS FCM Fix prevents Xiaomi HyperOS from freezing Google Play services or over-restricting apps that need timely Firebase Cloud Messaging (FCM) notifications. It uses Shizuku's ADB shell identity and does not require root.

Get it on GitHub

Get it on Obtainium

Features

  • Keeps Google Play services (com.google.android.gms) in HyperOS's hidden no-restrictions list (MILLET_NO_RESTRICT_APP) and repairs the entry when PowerKeeper rewrites the list.
  • Disables the known Greezer GMS limiter and restores GMS to its normal runtime allowlist.
  • Offers optional FCM Connection Protection for CN Google Play services builds that may not reconnect promptly.
  • Finds installed third-party FCM apps without requesting QUERY_ALL_PACKAGES.
  • Provides separate Aurogon FCM protection, Auto unstop, HyperOS Autostart, and AOSP battery-optimization controls for each enabled app.
  • Restores protection after reboots, app updates, or Shizuku restarts, and keeps diagnostic records for troubleshooting.

Requirements and setup

The app runs only in the owner profile on a Xiaomi device with HyperOS. Its manifest requires Xiaomi's com.miui.system shared library, so unsupported devices cannot install it. It does not modify PowerKeeper, clear app data, or use root.

  1. Install Shizuku from GitHub Releases, then start it through wireless debugging, ADB, or Sui. The Play Store build of Shizuku may have compatibility issues on Android 16 QPR2.
  2. Install and open HyperOS FCM Fix, then grant its Shizuku permission.
  3. Confirm that Google Play services shows Protection active. GMS is protected automatically and does not appear as an app you need to enable.
  4. Enable only the apps for which timely notifications matter, then review their Aurogon, Auto unstop, Autostart, and battery settings.
  5. Use Apply now after changing several settings or while troubleshooting. After a reboot, restart Shizuku and return to the app to confirm that protection has resumed.

Note

To stop using HyperOS FCM Fix, first set each managed app's HyperOS Autostart to the state you want while the app and its Autostart management switch are still enabled. Then disable every managed app and reboot before uninstalling. Disabling an app removes its Aurogon and Auto unstop rules and returns managed battery optimization to Optimized; the remaining temporary system changes reset after reboot. HyperOS Autostart is the exception and keeps the last applied state.

Tip

Start with AOSP battery optimization set to Optimized. Use Unrestricted only for an app whose notifications remain delayed, because allowing more background activity can increase battery use.

Protection behavior

Google Play services

The core fix preserves all existing entries in Settings.System.MILLET_NO_RESTRICT_APP and appends com.google.android.gms only when it is missing. A Shizuku UserService checks the setting every 30 seconds by default; 60- and 120-second intervals are also available.

Every full FCM protection pass also issues the equivalent of dumpsys greezer IM GMS disable and dumpsys greezer LM add com.google.android.gms. A pass occurs during the fixed recovery job, boot or app-update recovery, Apply now, and configurable periodic policy enforcement. These commands do not run in the 30/60/120-second polling loop. Boot or app update can queue both recovery and stale policy enforcement, so the commands may run twice close together. A failure of either Greezer command is reported as unavailable but does not by itself make WorkManager retry.

The UserService does not hold a wake lock. If Android suspends its process during Doze, polling pauses and resumes when the process can run again, so the selected interval is not exact. A fixed 15-minute WorkManager recovery job re-establishes the monitor and reapplies GMS and Aurogon protection when Shizuku is available; it also runs Auto unstop and, when FCM Connection Protection is enabled, finishes by requesting a GMS reconnect. WorkManager is subject to system scheduling and may run later during Doze.

FCM Connection Protection is a separate, optional workaround for CN GMS builds that may not reconnect promptly. While the UserService is runnable, it checks whether GMS has an established FCM socket on ports 5228–5230 and sends a targeted com.google.android.intent.action.GCM_RECONNECT broadcast when no connection is found or the check is unavailable. The recovery job also sends the broadcast whenever it actually runs. Turning this option off does not disable the MILLET_NO_RESTRICT_APP repair.

Managed apps

The app list contains non-system packages that declare a receiver for com.google.android.c2dm.intent.RECEIVE. Each enabled app has four independent controls:

  • Aurogon FCM protection: permits the FCM Intent through Xiaomi's broadcast control so it can be delivered to the app, including when delivery requires starting the app.
  • Auto unstop (Android 16+): clears FLAG_STOPPED every 15 minutes so the app remains eligible to be started by FCM; it does not launch the app itself.
  • HyperOS Autostart: permits the process start when FCM delivery targets an app with no running process, such as after the process has been killed. In that case it works together with the Aurogon rule. It manages both Xiaomi Autostart AppOps.
  • AOSP battery optimization: mainly lets users suppress an app's background activity while keeping FCM unaffected. It applies Unrestricted, Optimized, or Restricted to the selected Android profiles.

On first enable, Aurogon, Auto unstop, and Autostart management are turned on. WeChat and Telegram are enabled by default and start with battery optimization managed as Optimized; other discovered apps start disabled with battery management off.

Disabling an app removes it from the managed Aurogon and Auto unstop sets while retaining its saved choices. If battery management was enabled, the app is changed to Optimized once. Its Autostart state is left unchanged.

Apply now processes every enabled app. A separate WorkManager job uses the Periodical enforcement frequency setting to reapply managed Autostart and battery policies automatically for every enabled app. Setting it to Off disables this periodic enforcement job, but does not stop GMS protection, the fixed 15-minute GMS and Aurogon recovery job, or Auto unstop.

Autostart and battery policies target the Android profiles selected in the app; the owner and XSpace profiles are selected by default. Android's unrestricted device-idle allowlist is package-wide, so Unrestricted and Optimized changes are not isolated per profile.

Diagnostics

Open Diagnostics at the bottom of the main screen to inspect, refresh, copy, or clear session logs covering Shizuku connections, background jobs, privileged operations, and FCM repairs. The files are stored under /storage/emulated/0/Android/data/net.extrawdw.apps.miuisucks.powerkeeper/files/logs/. Logcat entries use the PowerKeeperFix prefix.

Technical investigation

Build

Open the project in Android Studio and run the app configuration.

Close

How Shizuku is used

Can keep FCM push reliable and manage autostart and battery limits via Shizuku's `IBinder.shellCommand` privileged path.

This is an AI-assisted analysis of Shizuku-related usages in the app's public source code. It is best effort, so it may not catch every single usage.

How this app uses Shizuku

Shizuku is used to run privileged system service commands that keep push notifications working and enforce per-app battery rules on HyperOS and Xiaomi devices. All privileged work runs inside a Shizuku user service that issues fixed system commands.

  • Keep FCM unrestricted: Google Play services is kept in the Millet no-restrict list with the settings get and settings put commands through Shizuku so system power saving does not throttle push.
  • Manage broadcast rules: Xiaomi Aurogon broadcast settings are read and updated with the settings get, settings put and settings delete commands through Shizuku to allow FCM broadcasts for selected apps.
  • Tune GMS limiters: Xiaomi Greezer limiter state is adjusted through Shizuku to disable the explicit GMS limiter and restore the ordinary GMS allowlist.
  • Control autostart behavior: Per-app Xiaomi autostart AppOps are set to allow or ignore with the appops set command through Shizuku for each selected Android user.
  • Control background execution: Per-app background running rules are set to allow or ignore with the appops set command and Doze allowlisting is added or removed with the deviceidle whitelist command through Shizuku.
  • Protect this app: The app applies the same autostart, background and Doze allowlist plus active standby bucket settings to itself with appops set, deviceidle whitelist, activity set-inactive and activity set-standby-bucket through Shizuku.
  • Restart stopped apps: Stopped packages are found with package listing and restarted with the package unstop command through Shizuku for auto unstop.
  • Reconnect push on demand: An FCM reconnect broadcast is sent with the activity broadcast command through Shizuku, including automatic polling that repairs the Millet and Aurogon settings.
  • Support multi-user devices: Installed packages and Android users are discovered with package listing through Shizuku so policies apply to the users selected in the app.

Android APIs or commands used

  • IBinder.shellCommand
  • IBinder.dump
  • Binder.clearCallingIdentity
  • Binder.restoreCallingIdentity
  • appops set
  • appops write-settings
  • deviceidle whitelist
  • activity set-inactive
  • activity set-standby-bucket
  • activity broadcast
  • package list packages
  • package list users
  • package unstop
  • settings get
  • settings put
  • settings delete

Notable details

The app targets Xiaomi and HyperOS devices and skips enforcement on unsupported devices. Policies are reapplied in the background by periodic workers so the system cannot silently revert the FCM and battery settings.

Close

Changelog

What's new for version 0.2.3

Full Changelog: https://github.com/dingwen07/hyperos-fcm-fix/compare/v0.2.2...v0.2.3

What’s new

The app now detects and alerts the user if Xiaomi's proprietary "USB debugging (Security settings)" is not enabled.


更新内容

应用现在会检测并提醒小米专有的“USB 调试(安全设置)”未打开的情况。


更新內容

應用程式現在會偵測並提醒小米專有的「USB 偵錯(安全設定)」未開啟的情況。

Attachments

35df9ae267032386005d5abc942ec2dbbe6827701f09a348939c179ec447cec9  hyperos-fcm-fix_v0.2.3_9.apk
Close

Permissions

6 permissions requested

  • android.permission.RECEIVE_BOOT_COMPLETED
  • android.permission.WAKE_LOCK
  • android.permission.ACCESS_NETWORK_STATE
  • android.permission.FOREGROUND_SERVICE
  • net.extrawdw.apps.miuisucks.powerkeeper.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION
  • moe.shizuku.manager.permission.API_V23
Close