The CN Notification Fix addresses notification delays on MIUI China ROM devices by patching the IS_INTERNATIONAL_BUILD boolean checks to always return true.
- Android 15: Fully Implemented
- Android 16: Fully Implemented
China ROM versions of MIUI implement aggressive background restrictions and notification delays based on the IS_INTERNATIONAL_BUILD flag. When this flag returns false (indicating a China ROM), the system applies various limitations that cause:
- Delayed push notifications
- Background app restrictions
- Notification delivery issues
- Message receipt delays
This patch modifies the IS_INTERNATIONAL_BUILD checks to always return true, effectively making the system treat the ROM as an international build for notification processing purposes.
- File: miui-services.jar
- Location: /system_ext/framework/miui-services.jar
Class: com.android.server.am.BroadcastQueueModernStubImpl
Pattern:
# Before
sget-boolean v2, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z
# After
const/4 v2, 0x1Class: com.android.server.am.ActivityManagerServiceImpl
Locations: 2 occurrences with different registers
Pattern 1:
# Before
sget-boolean v1, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z
# After
const/4 v1, 0x1Pattern 2:
# Before
sget-boolean v4, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z
# After
const/4 v4, 0x1Class: com.android.server.am.ProcessManagerService
Pattern:
# Before
sget-boolean v0, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z
# After
const/4 v0, 0x1Class: com.android.server.am.ProcessSceneCleaner
Android 15:
# Before
sget-boolean v0, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z
# After
const/4 v0, 0x1Android 16:
# Before
sget-boolean v4, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z
# After
const/4 v0, 0x1Note: Android 16 changes the register from v4 to v0.
Android 15:
./scripts/patcher_a15.sh 35 xiaomi 1.0.0 --cn-notification-fixAndroid 16:
./scripts/patcher_a16.sh 36 xiaomi 1.0.0 --cn-notification-fixCombined with signature bypass:
./scripts/patcher_a15.sh 35 xiaomi 1.0.0 \
--disable-signature-verification \
--cn-notification-fixEfficient (miui-services only):
./scripts/patcher_a15.sh 35 xiaomi 1.0.0 \
--miui-services \
--cn-notification-fix- GitHub Actions: Enable "CN notification fix" checkbox
- Web Interface: Check "CN Notification Fix" option
- Telegram Bot: Toggle CN notification fix button
- MIUI-based ROM (China variant)
- miui-services.jar present in ROM
- Android 15 or Android 16
After patching, verify the changes:
# Decompile patched JAR
apktool d miui-services_patched.jar -o verify
# Check if IS_INTERNATIONAL_BUILD was replaced
grep -r "IS_INTERNATIONAL_BUILD" verify/
# Should return no results if successful
# Check for const/4 replacements
grep -r "const/4 v[0124], 0x1" verify/ | \
grep -E "(BroadcastQueue|ActivityManager|ProcessManager|ProcessScene)"Issue: Warning messages about classes not being found
Solution: This is normal if your ROM doesn't include all classes. The patcher will skip missing classes gracefully.
Possible Causes:
- Module not installed correctly
- Device not rebooted after installation
- ROM is not a China variant
- ROM version doesn't have these classes
Solution:
- Verify module is active in root manager
- Reboot device
- Check logcat for any errors
- Verify using MIUI China ROM variant
Possible Causes:
- Wrong Android version patcher used
- ROM already patched or modified
- ROM is international build (patch not needed)
Solution:
- Verify Android version matches patcher
- Use unmodified ROM JARs
- Check if using China ROM variant
- This feature is MIUI-specific and has no effect on non-MIUI ROMs
- The patch only affects notification timing, not app permissions
- Combines safely with other features
- No framework.jar or services.jar changes needed
- FEATURE_SYSTEM.md - Overall feature system
- USAGE.md - Complete usage guide
- CHANGELOG.md - Version history