├── META-INF └── com │ └── google │ └── android │ ├── updater-script │ └── update-binary ├── system └── placeholder ├── common ├── system.prop ├── post-fs-data.sh └── service.sh ├── module.prop ├── .gitattributes ├── README.md └── config.sh /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /system/placeholder: -------------------------------------------------------------------------------- 1 | This file will be deleted in Magisk Manager, it is only a placeholder for git 2 | -------------------------------------------------------------------------------- /common/system.prop: -------------------------------------------------------------------------------- 1 | ro.miui.ui.version.name=V9 2 | ro.miui.ui.version.code=7 3 | ro.miui.version.code_time=1505408400 -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=MiPushFake 2 | name=XiaoMi Push Framework Fake Advanced 3 | version=v2.3 4 | versionCode=5 5 | author=CubeSky 6 | description=A Module to insert miui prop to system. 7 | minMagisk=1400 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Declare files that will always have LF line endings on checkout. 2 | META-INF/** text eol=lf 3 | common/** text eol=lf 4 | module.prop text eol=lf 5 | changelog.txt text eol=lf 6 | 7 | # Denote all files that are truly binary and should not be modified. 8 | system/** binary 9 | -------------------------------------------------------------------------------- /common/post-fs-data.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Please don't hardcode /magisk/modname/... ; instead, please use $MODDIR/... 3 | # This will make your scripts compatible even if Magisk change its mount point in the future 4 | MODDIR=${0%/*} 5 | 6 | # This script will be executed in post-fs-data mode 7 | # More info in the main Magisk thread 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## XiaoMi Push Framework Fake 2 | 3 | This module will add `miui` prop in your `build.prop` to fake your device to `xiaomi`. 4 | 5 | If you want to use XiaoMiPushFramework, please visit [https://github.com/Trumeet/MiPushFramework](https://github.com/Trumeet/MiPushFramework) 6 | 7 | If you want to disable XiaoMiPushFramework, please visit [https://github.com/cubesky/MiPushFrameworkFake](https://github.com/cubesky/MiPushFrameworkFake) -------------------------------------------------------------------------------- /common/service.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Please don't hardcode /magisk/modname/... ; instead, please use $MODDIR/... 3 | # This will make your scripts compatible even if Magisk change its mount point in the future 4 | MODDIR=${0%/*} 5 | 6 | # This script will be executed in late_start service mode 7 | # More info in the main Magisk thread 8 | 9 | resetprop -n ro.miui.ui.version.name V9 10 | resetprop -n ro.miui.ui.version.code 7 11 | resetprop -n ro.miui.version.code_time 1505408400 -------------------------------------------------------------------------------- /config.sh: -------------------------------------------------------------------------------- 1 | ########################################################################################## 2 | # Defines 3 | ########################################################################################## 4 | 5 | # NOTE: This part has to be adjusted to fit your own needs 6 | 7 | # This will be the folder name under /magisk 8 | # This should also be the same as the id in your module.prop to prevent confusion 9 | MODID=MiPushFake 10 | 11 | # Set to true if you need to enable Magic Mount 12 | # Most mods would like it to be enabled 13 | AUTOMOUNT=false 14 | 15 | # Set to true if you need to load system.prop 16 | PROPFILE=true 17 | 18 | # Set to true if you need post-fs-data script 19 | POSTFSDATA=false 20 | 21 | # Set to true if you need late_start service script 22 | LATESTARTSERVICE=true 23 | 24 | ########################################################################################## 25 | # Installation Message 26 | ########################################################################################## 27 | 28 | # Set what you want to show when installing your mod 29 | 30 | print_modname() { 31 | ui_print "*******************************" 32 | ui_print " XiaoMi Push Framework Fake " 33 | ui_print "*******************************" 34 | } 35 | 36 | ########################################################################################## 37 | # Replace list 38 | ########################################################################################## 39 | 40 | # Construct your own list here, it will overwrite the example 41 | # !DO NOT! remove this if you don't need to replace anything, leave it empty as it is now 42 | REPLACE=" 43 | " 44 | 45 | ########################################################################################## 46 | # Permissions 47 | ########################################################################################## 48 | 49 | # NOTE: This part has to be adjusted to fit your own needs 50 | 51 | set_permissions() { 52 | # Default permissions, don't remove them 53 | set_perm_recursive $MODPATH 0 0 0755 0644 54 | } -------------------------------------------------------------------------------- /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | ########################################################################################## 3 | # 4 | # Magisk Module Template Install Script 5 | # by topjohnwu 6 | # 7 | ########################################################################################## 8 | 9 | # Detect whether in boot mode 10 | ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false 11 | $BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true 12 | 13 | # This path should work in any cases 14 | TMPDIR=/dev/tmp 15 | MOUNTPATH=/magisk 16 | IMG=/data/magisk.img 17 | if $BOOTMODE; then 18 | MOUNTPATH=/dev/magisk_merge 19 | IMG=/data/magisk_merge.img 20 | fi 21 | INSTALLER=$TMPDIR/install 22 | MAGISKBIN=/data/magisk 23 | 24 | # Default permissions 25 | umask 022 26 | 27 | ########################################################################################## 28 | # Flashable update-binary preparation 29 | ########################################################################################## 30 | 31 | OUTFD=$2 32 | ZIP=$3 33 | 34 | ui_print() { 35 | if $BOOTMODE; then 36 | echo "$1" 37 | else 38 | echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD 39 | echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD 40 | fi 41 | } 42 | 43 | require_new_magisk() { 44 | ui_print "***********************************" 45 | ui_print "! $MAGISKBIN isn't setup properly!" 46 | ui_print "! Please install Magisk v13.1+!" 47 | ui_print "***********************************" 48 | exit 1 49 | } 50 | 51 | # Mount /data to access MAGISKBIN 52 | mount /data 2>/dev/null 53 | 54 | # MAGISKBIN must exist, binaries and utility functions are placed there 55 | [ -d $MAGISKBIN -a -f $MAGISKBIN/magisk -a -f $MAGISKBIN/util_functions.sh ] || require_new_magisk 56 | 57 | # Load utility fuctions 58 | . $MAGISKBIN/util_functions.sh 59 | [ ! -z $SCRIPT_VERSION -a $SCRIPT_VERSION -ge 1310 ] || require_new_magisk 60 | get_outfd 61 | 62 | rm -rf $TMPDIR 2>/dev/null 63 | mkdir -p $INSTALLER 64 | unzip -o "$ZIP" config.sh -d $INSTALLER 2>/dev/null 65 | 66 | ########################################################################################## 67 | # Prepare 68 | ########################################################################################## 69 | 70 | [ ! -f $INSTALLER/config.sh ] && abort "! Unable to extract zip file!" 71 | 72 | . $INSTALLER/config.sh 73 | 74 | MODPATH=$MOUNTPATH/$MODID 75 | 76 | # Print mod name 77 | print_modname 78 | 79 | # Please leave this message in your flashable zip for credits :) 80 | ui_print "******************************" 81 | ui_print "Powered by Magisk (@topjohnwu)" 82 | ui_print "******************************" 83 | 84 | ui_print "- Mounting /system, /vendor, /data, /cache" 85 | mount -o ro /system 2>/dev/null 86 | mount -o ro /vendor 2>/dev/null 87 | mount /data 2>/dev/null 88 | mount /cache 2>/dev/null 89 | 90 | [ ! -f /data/magisk.img ] && abort "! Magisk is not installed" 91 | $BOOTMODE && ! is_mounted /magisk && abort "! Magisk is not activated!" 92 | [ ! -f /system/build.prop ] && abort "! /system could not be mounted!" 93 | 94 | # Detect version and architecture 95 | api_level_arch_detect 96 | 97 | # You can get the Android API version from $API, the CPU architecture from $ARCH 98 | # Useful if you are creating Android version / platform dependent mods 99 | 100 | ########################################################################################## 101 | # Install 102 | ########################################################################################## 103 | 104 | ui_print "- Extracting module files" 105 | unzip -o "$ZIP" -d $INSTALLER 2>/dev/null 106 | request_size_check $INSTALLER 107 | 108 | # We're going to use magisk binary now, require some recovery fixes 109 | $BOOTMODE || recovery_actions 110 | 111 | if [ -f "$IMG" ]; then 112 | ui_print "- $IMG detected!" 113 | image_size_check $IMG 114 | if [ "$reqSizeM" -gt "$curFreeM" ]; then 115 | newSizeM=$(((reqSizeM + curUsedM) / 32 * 32 + 64)) 116 | ui_print "- Resizing $IMG to ${newSizeM}M" 117 | $MAGISKBIN/magisk --resizeimg $IMG $newSizeM 118 | fi 119 | else 120 | newSizeM=$((reqSizeM / 32 * 32 + 64)); 121 | ui_print "- Creating $IMG with size ${newSizeM}M" 122 | $MAGISKBIN/magisk --createimg $IMG $newSizeM 123 | fi 124 | 125 | ui_print "- Mounting $IMG to $MOUNTPATH" 126 | MAGISKLOOP=`$MAGISKBIN/magisk --mountimg $IMG $MOUNTPATH` 127 | is_mounted $MOUNTPATH || abort"! $IMG mount failed..." 128 | 129 | # Create mod paths 130 | rm -rf $MODPATH 2>/dev/null 131 | mkdir -p $MODPATH 132 | 133 | # Copy files 134 | ui_print "- Copying files" 135 | mv $INSTALLER/system $MODPATH/system 136 | 137 | # Handle replace folders 138 | for TARGET in $REPLACE; do 139 | mktouch $MODPATH$TARGET/.replace 140 | done 141 | 142 | # Auto Mount 143 | $AUTOMOUNT && touch $MODPATH/auto_mount 144 | 145 | # prop files 146 | $PROPFILE && cp -af $INSTALLER/common/system.prop $MODPATH/system.prop 147 | 148 | # Module info 149 | cp -af $INSTALLER/module.prop $MODPATH/module.prop 150 | if $BOOTMODE; then 151 | # Update info for Magisk Manager 152 | mktouch /magisk/$MODID/update 153 | cp -af $INSTALLER/module.prop /magisk/$MODID/module.prop 154 | fi 155 | 156 | # post-fs-data mode scripts 157 | $POSTFSDATA && cp -af $INSTALLER/common/post-fs-data.sh $MODPATH/post-fs-data.sh 158 | 159 | # service mode scripts 160 | $LATESTARTSERVICE && cp -af $INSTALLER/common/service.sh $MODPATH/service.sh 161 | 162 | ui_print "- Setting permissions" 163 | set_permissions 164 | 165 | ########################################################################################## 166 | # Finalizing 167 | ########################################################################################## 168 | 169 | $MAGISKBIN/magisk --umountimg $MOUNTPATH $MAGISKLOOP 170 | rmdir $MOUNTPATH 171 | 172 | # Shrink the image if possible 173 | image_size_check $IMG 174 | newSizeM=$((curUsedM / 32 * 32 + 64)) 175 | if [ $curSizeM -gt $newSizeM ]; then 176 | ui_print "- Shrinking $IMG to ${newSizeM}M" 177 | $MAGISKBIN/magisk --resizeimg $IMG $newSizeM 178 | fi 179 | 180 | $BOOTMODE || recovery_cleanup 181 | 182 | ui_print "- Done" 183 | exit 0 184 | --------------------------------------------------------------------------------