Skip to content

Commit 65347b5

Browse files
v7
add system.prop fix app crash when debug
1 parent a4b8c1d commit 65347b5

File tree

8 files changed

+29
-8
lines changed

8 files changed

+29
-8
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ MiPushFramework with value map below
1515
* `ro.product.brand` -> `Xiaomi`
1616
* `ro.product.name` -> `Xiaomi`
1717

18+
also we add some prop inspired by [MiPushFake](https://github.com/Magisk-Modules-Repo/MiPushFake)
19+
1820

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ android {
2222

2323
task zip(type: Exec) {
2424
workingDir '..'
25-
commandLine 'sh', 'build.sh', project.name, 'v6'
25+
commandLine 'sh', 'build.sh', project.name, 'v7'
2626
}

build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ function copy_files {
88

99
cp $MODULE_NAME/template_override/config.sh $TMP_DIR_MAGISK
1010
cp $MODULE_NAME/template_override/module.prop $TMP_DIR_MAGISK
11+
cp -r $MODULE_NAME/template_override/common $TMP_DIR_MAGISK
1112
}

jni/main/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ __attribute__((visibility("default"))) int nativeForkAndSpecializePost(JNIEnv *e
102102
if (env) {
103103
LOGI("inject android.os.Build for %s ", package_name);
104104

105-
jclass build_class = env->FindClass("android.os.Build");
105+
jclass build_class = env->FindClass("android/os/Build");
106106
jfieldID brand_id = env->GetStaticFieldID(build_class, "BRAND", "Ljava/lang/String;");
107107
jfieldID manufacturer_id = env->GetStaticFieldID(build_class, "MANUFACTURER", "Ljava/lang/String;");
108108
jfieldID product_id = env->GetStaticFieldID(build_class, "PRODUCT", "Ljava/lang/String;");

template_override/common/service.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
resetprop -n ro.miui.ui.version.name V9
9+
resetprop -n ro.miui.ui.version.code 7
10+
resetprop -n ro.miui.version.code_time 1505408400
11+
resetprop -n ro.miui.internal.storage /sdcard/

template_override/common/system.prop

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file will be read by resetprop
2+
# Example: Change dpi
3+
# ro.sf.lcd_density=320
4+
ro.miui.ui.version.name=V9
5+
ro.miui.ui.version.code=7
6+
ro.miui.version.code_time=1505408400
7+
ro.miui.internal.storage=/sdcard/

template_override/module.prop

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
id=mipush_fake
22
name=Riru - MiPushFakeModule
3-
version=v6
4-
versionCode=6
3+
version=v7
4+
versionCode=7
55
author=Timothy
66
description=Fake as XiaoMI device by hook system_property_get. Require Riru - Core installed.
7-
minMagisk=1500
7+
minMagisk=17000

template_override/riru_module.prop

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Riru - MiPushFakeModule
2-
version=v6
3-
versionCode=6
2+
version=v7
3+
versionCode=7
44
author=Timothy
5-
description=Fake as XiaoMI device by hook system_property_get. Require Riru - Core installed.
5+
description=Fake as XiaoMI device by hook system_property_get. Require Riru-Core v9+ installed.

0 commit comments

Comments
 (0)