Skip to content

Commit 594e3ec

Browse files
authored
v0.3.6.20181130.7881203 (266)
1 parent fcd3ce9 commit 594e3ec

File tree

12 files changed

+282
-2
lines changed

12 files changed

+282
-2
lines changed
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
#!/sbin/sh
2+
##########################################################################################
3+
#
4+
# Magisk Module Template Install Script
5+
# by topjohnwu
6+
#
7+
##########################################################################################
8+
9+
TMPDIR=/dev/tmp
10+
INSTALLER=$TMPDIR/install
11+
# Always mount under tmp
12+
MOUNTPATH=$TMPDIR/magisk_img
13+
14+
# Default permissions
15+
umask 022
16+
17+
# Initial cleanup
18+
rm -rf $TMPDIR 2>/dev/null
19+
mkdir -p $INSTALLER
20+
21+
# echo before loading util_functions
22+
ui_print() { echo "$1"; }
23+
24+
require_new_magisk() {
25+
ui_print "*******************************"
26+
ui_print " Please install Magisk v17.0+! "
27+
ui_print "*******************************"
28+
exit 1
29+
}
30+
31+
##########################################################################################
32+
# Environment
33+
##########################################################################################
34+
35+
OUTFD=$2
36+
ZIP=$3
37+
38+
mount /data 2>/dev/null
39+
40+
# Load utility functions
41+
if [ -f /data/adb/magisk/util_functions.sh ]; then
42+
. /data/adb/magisk/util_functions.sh
43+
elif [ -f /data/magisk/util_functions.sh ]; then
44+
NVBASE=/data
45+
. /data/magisk/util_functions.sh
46+
else
47+
require_new_magisk
48+
fi
49+
50+
# Use alternative image if in BOOTMODE
51+
$BOOTMODE && IMG=$NVBASE/magisk_merge.img
52+
53+
# Preperation for flashable zips
54+
setup_flashable
55+
56+
# Mount partitions
57+
mount_partitions
58+
59+
# Detect version and architecture
60+
api_level_arch_detect
61+
62+
# You can get the Android API version from $API, the CPU architecture from $ARCH
63+
# Useful if you are creating Android version / platform dependent mods
64+
65+
# Setup busybox and binaries
66+
$BOOTMODE && boot_actions || recovery_actions
67+
68+
##########################################################################################
69+
# Preparation
70+
##########################################################################################
71+
72+
# Extract common files
73+
unzip -o "$ZIP" module.prop config.sh 'common/*' -d $INSTALLER >&2
74+
75+
[ ! -f $INSTALLER/config.sh ] && abort "! Unable to extract zip file!"
76+
# Load configurations
77+
. $INSTALLER/config.sh
78+
79+
# Check architecture
80+
check_architecture
81+
82+
# Check the installed magisk version
83+
MIN_VER=`grep_prop minMagisk $INSTALLER/module.prop`
84+
[ ! -z $MAGISK_VER_CODE -a $MAGISK_VER_CODE -ge $MIN_VER ] || require_new_magisk
85+
MODID=`grep_prop id $INSTALLER/module.prop`
86+
MODPATH=$MOUNTPATH/$MODID
87+
88+
# Print mod name
89+
print_modname
90+
91+
# Please leave this message in your flashable zip for credits :)
92+
ui_print "******************************"
93+
ui_print "Powered by Magisk (@topjohnwu)"
94+
ui_print "******************************"
95+
96+
##########################################################################################
97+
# Install
98+
##########################################################################################
99+
100+
# Get the variable reqSizeM. Use your own method to determine reqSizeM if needed
101+
request_zip_size_check "$ZIP"
102+
103+
# This function will mount $IMG to $MOUNTPATH, and resize the image based on $reqSizeM
104+
mount_magisk_img
105+
106+
# Create mod paths
107+
rm -rf $MODPATH 2>/dev/null
108+
mkdir -p $MODPATH
109+
110+
# Extract files to system. Use your own method if needed
111+
ui_print "- Extracting module files"
112+
unzip -o "$ZIP" 'system/*' -d $MODPATH >&2
113+
114+
# Remove placeholder
115+
rm -f $MODPATH/system/placeholder 2>/dev/null
116+
117+
# Extra copy file function
118+
copy_files
119+
120+
# Handle replace folders
121+
for TARGET in $REPLACE; do
122+
mktouch $MODPATH$TARGET/.replace
123+
done
124+
125+
# Auto Mount
126+
$AUTOMOUNT && touch $MODPATH/auto_mount
127+
128+
# prop files
129+
$PROPFILE && cp -af $INSTALLER/common/system.prop $MODPATH/system.prop
130+
131+
# Module info
132+
cp -af $INSTALLER/module.prop $MODPATH/module.prop
133+
if $BOOTMODE; then
134+
# Update info for Magisk Manager
135+
mktouch /sbin/.core/img/$MODID/update
136+
cp -af $INSTALLER/module.prop /sbin/.core/img/$MODID/module.prop
137+
fi
138+
139+
# post-fs-data mode scripts
140+
$POSTFSDATA && cp -af $INSTALLER/common/post-fs-data.sh $MODPATH/post-fs-data.sh
141+
142+
# service mode scripts
143+
$LATESTARTSERVICE && cp -af $INSTALLER/common/service.sh $MODPATH/service.sh
144+
145+
ui_print "- Setting permissions"
146+
set_permissions
147+
148+
##########################################################################################
149+
# Finalizing
150+
##########################################################################################
151+
152+
# Unmount magisk image and shrink if possible
153+
unmount_magisk_img
154+
155+
$BOOTMODE || recovery_cleanup
156+
rm -rf $TMPDIR
157+
158+
ui_print "- Done"
159+
exit 0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#MAGISK

README.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,41 @@
1-
# MiPushServiceFramework
2-
A Magisk module called MiPushServiceFramework.
1+
# Mi Push Service Framework
2+
Add Mi Push Service Framework into system systemlessly. Change some props to fake miui. Kill official Xiaomi Service Framework. NOT include Push manager. Some features require Riru - Core installed.
3+
4+
## What does this module do
5+
* Add `MIUI` prop in your `build.prop` to fake your device to `XiaoMi`.
6+
* Fake as a `XiaoMi` Device by hook `system_property_get`. (Required Riru Core installed.)
7+
* Add `Push Service Framework` to system systemlessly.
8+
* Disable official `Xiaomi Service Framework` that you can use `Mi Push Service`.
9+
10+
Module will change these props that follow down.
11+
* `ro.miui.ui.version.name` = `V10`
12+
* `ro.miui.ui.version.code` = `8`
13+
* `ro.miui.version.code_time` = `1544025600`
14+
* `ro.fota.oem` = `Xiaomi`
15+
* `ro.miui.internal.storage` = `/sdcard/`
16+
17+
And `__system_property_get` (`android::base::GetProperty` on Pie+) will be hooked and these props will be changed in packages selected in
18+
manager with value map below (Required Riru Core installed.).
19+
* `ro.product.manufacturer` = `Xiaomi`
20+
* `ro.product.brand` = `Xiaomi`
21+
* `ro.product.name` = `Xiaomi`
22+
23+
## Changes log
24+
* v0.3.6.20181130.7881203 (266) [2018/12/13]
25+
-Add MIUI 10 prop to module.
26+
-Update Push Service Framework and priv-app permissions to v0.3.6.20181130.7881203 (266).
27+
28+
## Tips
29+
* Only arm & arm64 devices can install this module.
30+
* Module don't include manager, you can download the current version at [https://github.com/Trumeet/MiPushFramework/releases](https://github.com/Trumeet/MiPushFramework/releases) and install it manually.
31+
* Riru Core is required by some features, please install it in Magisk first. [Download](https://github.com/RikkaApps/Riru/releases)
32+
* If you want to learn more about XiaoMiPushFramework, please visit [https://github.com/Trumeet/MiPushFramework](https://github.com/Trumeet/MiPushFramework).
33+
* If you want to disable XiaoMiPushFramework, please visit [https://github.com/cubesky/MiPushFrameworkFake](https://github.com/cubesky/MiPushFrameworkFake).
34+
35+
## Thanks
36+
* [Trumeet](https://github.com/Trumeet/) - [MiPushFramework](https://github.com/Trumeet/MiPushFramework)
37+
* [cubesky](https://github.com/cubesky/) - [MiPushFake](https://github.com/Magisk-Modules-Repo/MiPushFake)
38+
* [RikkaW](https://github.com/RikkaW/) - [Riru](https://github.com/RikkaApps/Riru)
39+
* [TimothyZhang023](https://github.com/TimothyZhang023/) - [Riru-MiPushFake](https://github.com/TimothyZhang023/Riru-MiPushFake)
40+
* [MlgmXyysd](https://github.com/MlgmXyysd/) - This module.
41+
* Qida - Kill XiaoMi Service Framework (I can't find repo's link, if someone know, please tell me.)

common/service.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/system/bin/sh
2+
MODDIR=${0%/*}
3+
resetprop -n ro.miui.ui.version.name V10
4+
resetprop -n ro.miui.ui.version.code 8
5+
resetprop -n ro.miui.version.code_time 1544025600
6+
resetprop -n ro.miui.internal.storage /sdcard/
7+
resetprop -n ro.fota.oem Xiaomi

common/system.prop

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ro.miui.ui.version.name=V10
2+
ro.miui.ui.version.code=8
3+
ro.miui.version.code_time=1544025600
4+
ro.fota.oem=Xiaomi
5+
ro.miui.internal.storage=/sdcard/

config.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
AUTOMOUNT=false
2+
PROPFILE=true
3+
POSTFSDATA=false
4+
LATESTARTSERVICE=true
5+
print_modname() {
6+
ui_print "*******************************"
7+
ui_print "* Mi Push Service Framework *"
8+
ui_print "*******************************"
9+
ui_print "* 0.3.6.20181130.7881203(266) *"
10+
ui_print "*******************************"
11+
}
12+
REPLACE="
13+
/system/app/XiaomiServiceFramework
14+
"
15+
set_permissions() {
16+
set_perm_recursive $MODPATH 0 0 0755 0644
17+
}
18+
fail() {
19+
echo "$1"
20+
exit 1
21+
}
22+
check_architecture() {
23+
if [[ "$ARCH" != "arm" && "$ARCH" != "arm64" ]]; then
24+
ui_print "- Unsupported platform: $ARCH"
25+
exit 1
26+
else
27+
ui_print "- Device platform: $ARCH"
28+
fi
29+
}
30+
copy_files() {
31+
if [ $IS64BIT = false ]; then
32+
ui_print "- Removing unnecessary files"
33+
rm -rf "$MODPATH/system/lib64"
34+
fi
35+
ui_print "- Extracting extra files"
36+
unzip -o "$ZIP" 'data/*' -d $MODPATH >&2
37+
TARGET="/data/misc/riru/modules"
38+
[ -d $TARGET ] || mkdir -p $TARGET || fail "- Can't mkdir -p $TARGET"
39+
cp -af "$MODPATH$TARGET/." "$TARGET" || fail "- Can't cp -af $MODPATH$TARGET/. $TARGET"
40+
rm -rf $MODPATH/data 2>/dev/null
41+
ui_print "- Files copied"
42+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name=Mi Push Sercice Framework
2+
version=v0.3.6.20181130.7881203
3+
versionCode=266
4+
author=MlgmXyysd
5+
description=Add Mi Push Service Framework into system systemlessly. Change some props to fake miui. Kill official Xiaomi Service Framework. NOT include Push manager. Some features require Riru - Core installed.

module.prop

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
id=MiPushServiceFramework
2+
name=Mi Push Sercice Framework
3+
version=v0.3.6.20181130.7881203
4+
versionCode=266
5+
author=MlgmXyysd
6+
description=Add Mi Push Service Framework into system systemlessly. Change some props to fake miui. Kill official Xiaomi Service Framework. NOT include Push manager. Some features require Riru - Core installed.
7+
minMagisk=17000
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<permissions>
2+
<privapp-permissions package="com.xiaomi.xmsf">
3+
<permission name="com.xiaomi.xmsf.permission.MIPUSH_RECEIVE"/>
4+
<permission name="com.xiaomi.permission.SEND_PUSH"/>
5+
<permission name="top.trumeet.mipush.permissions.WRITE_SETTINGS"/>
6+
<permission name="top.trumeet.mipush.permissions.BIND"/>
7+
<permission name="top.trumeet.mipush.permissions.READ_SETTINGS"/>
8+
<permission name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
9+
<permission name="android.permission.INTERNET"/>
10+
<permission name="android.permission.RECEIVE_BOOT_COMPLETED"/>
11+
<permission name="android.permission.ACCESS_NETWORK_STATE"/>
12+
<permission name="android.permission.GET_ACCOUNTS"/>
13+
<permission name="android.permission.PACKAGE_USAGE_STATS" />
14+
</privapp-permissions>
15+
</permissions>

system/lib/libriru_mipush_fake.so

110 KB
Binary file not shown.

0 commit comments

Comments
 (0)