Skip to content

Commit 9800304

Browse files
Add files via upload
1 parent 8d5ded7 commit 9800304

File tree

9 files changed

+194
-181
lines changed

9 files changed

+194
-181
lines changed

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ To fix this, you can use a known working fingerprint (one that has been certifie
3030
There are a few pre-configured certified fingerprints available in the module, just in case you can't get a hold of one for your device. If you have a working fingerprint that could be added to the list, or an updated one for one already on there, please post that in the [module support thread](https://forum.xda-developers.com/apps/magisk/module-magiskhide-props-config-simple-t3765199) toghether with device details.
3131

3232
### Finding a certified fingerprint
33-
The easies way to find a certified fingerprint for your device is to run the getprop command below on a stock ROM/firmware/factory image that fully passes SafetyNet.
33+
If you don't want to use one of the provided fingerprints, the easies way to find a certified fingerprint for your device is to run the getprop command below on a stock ROM/firmware/factory image that fully passes SafetyNet.
3434
```
3535
getprop ro.build.fingerprint
3636
```
@@ -43,13 +43,20 @@ Here's an example:
4343
Google Nexus 6=google/shamu/shamu:7.1.1/N8I11B/4171878:user/release-keys
4444
```
4545

46+
### I still can't pass the ctsProfile check
47+
If you've picked a certified fingerprint from the provided list, or you're using a fingerprint that you know is certified but still can't pass the ctsProfile check, do the following.
48+
- First, do you pass basicIntegrity? If you don't, there's something else going on that this module can't help you with. Take a look under "Miscellaneous MagiskHide issues" below.
49+
- Try a different fingerprint from the provided list.
50+
- Make sure you don't have any remnants from previous root methods that may interfere with the SafetyNet check. A clean install of your system may be required.
51+
- If you can't get things working, make sure to provide logs. See "Logs, etc" below.
52+
4653

4754
## Current fingerprints list version
4855
The fingerprints list will update without the need to update the entire module. Keep an eye on the [module support thread](https://forum.xda-developers.com/apps/magisk/module-magiskhide-props-config-simple-t3765199) for info.
4956

5057
Just run the `props` command and the list will be updated automatically. Use the -nw option to disable or disable it completely in the script settings (see below). If you've disabled the this setting you can update the list manually in the `Edit device fingerprint` menu.
5158

52-
**_Current fingerprints list version - v9_**
59+
**_Current fingerprints list version - v10_**
5360

5461

5562
## Improved root hiding - Editing build.prop and default.prop
@@ -103,11 +110,11 @@ If you're having issues passing SafetyNet, getting your device certified, or oth
103110
But first: have you tried turning it off and on again? Toggling MagiskHide off and on usually works if MagiskHide has stopped working after an update of Magisk or your ROM.
104111

105112

106-
## Support, etc
113+
## Issues, support, etc
107114
If you have questions, suggestions or are experiencing some kind of issue, visit the [module support thread](https://forum.xda-developers.com/apps/magisk/module-magiskhide-props-config-simple-t3765199) @ XDA.
108115

109116
### Logs, etc
110-
In case of issues, please provide the logs, saved in /cache, "magisk.log", "propsconf.log" and "propsconf_last.log", together with a detailed description of your problem. Providing the output from terminal might also be useful.
117+
In case of issues, please provide the logs, saved in /cache, "magisk.log", "propsconf.log" and "propsconf_last.log", together with a detailed description of your problem. Providing the output from terminal might also be useful. If you have the latest beta release of Magisk installed, the "magisk_debug.log" is also useful. If there's no new beta released, there's always a beta version of the latest stable Magisk release, so that you can collect the debug log.
111118

112119

113120
## Source
@@ -120,6 +127,12 @@ In case of issues, please provide the logs, saved in /cache, "magisk.log", "prop
120127

121128

122129
## Changelog
130+
### v2.1.2
131+
- Detects and edits only existing device fingerprint props.
132+
- Slightly optimised the boot scripts.
133+
- New fingerprint (Motorola Moto E4), list v10.
134+
- Minor updates and improvements.
135+
123136
### v2.1.1
124137
- Fixed transferring custom props between module updates.
125138

@@ -160,7 +173,7 @@ In case of issues, please provide the logs, saved in /cache, "magisk.log", "prop
160173

161174

162175
## Current fingerprints list
163-
### List v9  
176+
### List v10  
164177
- Google Nexus 4 (5.1.1)
165178
- Google Nexus 5 (6.0.1)
166179
- Google Nexus 6 (7.1.1)
@@ -175,6 +188,7 @@ In case of issues, please provide the logs, saved in /cache, "magisk.log", "prop
175188
- Google Pixel 2 XL (P DP1)
176189
- HTC 10 (6.0.1)
177190
- Huawei Mate 10 Pro (8.0.0)
191+
- Motorola Moto E4 (7.1.1)
178192
- Motorola Moto G4 (7.0)
179193
- Motorola Moto G5 (7.0)
180194
- Motorola Moto G5 Plus (7.0)

common/post-fs-data.sh

Lines changed: 25 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -34,75 +34,37 @@ log_script_chk "Log start."
3434
if [ ! -f "$LATEFILE" ] || [ -f "$RESETFILE" ]; then
3535
cp -af $MODPATH/propsconf_late $LATEFILE
3636
chmod 755 $LATEFILE
37-
log_handler "Boot script restored/reset (${LATEFILE})."
38-
fi
39-
40-
# Update placeholders
41-
# Image path
42-
placeholder_update $LATEFILE IMGPATH IMG_PLACEHOLDER $IMGPATH
43-
placeholder_update $MODPATH/system/$BIN/props IMGPATH IMG_PLACEHOLDER $IMGPATH
44-
45-
# Check the reboot variable
46-
if [ "$(get_file_value $LATEFILE "REBOOTCHK=")" == 1 ]; then
47-
sed -i 's/REBOOTCHK=1/REBOOTCHK=0/' $LATEFILE
37+
if [ -f "$RESETFILE" ]; then
38+
RSTTXT="reset"
39+
else
40+
RSTTXT="restored"
41+
fi
42+
log_handler "Boot script $RSTTXT (${LATEFILE})."
4843
fi
4944

5045
# Get the current values saved in propsconf_late
51-
orig_values
5246
latefile_values
53-
54-
# Get default file values
47+
# Get default values
5548
file_values
5649

5750
# Save default file values in propsconf_late
58-
sed -i "s/FILEDEBUGGABLE=\"$LATEFILEDEBUGGABLE\"/FILEDEBUGGABLE=\"$FILEDEBUGGABLE\"/" $LATEFILE
59-
sed -i "s/FILESECURE=\"$LATEFILESECURE\"/FILESECURE=\"$FILESECURE\"/" $LATEFILE
60-
sed -i "s/FILETYPE=\"$LATEFILETYPE\"/FILETYPE=\"$FILETYPE\"/" $LATEFILE
61-
sed -i "s/FILETAGS=\"$LATEFILETAGS\"/FILETAGS=\"$FILETAGS\"/" $LATEFILE
62-
sed -i "s/FILESELINUX=\"$LATEFILESELINUX\"/FILESELINUX=\"$FILESELINUX\"/" $LATEFILE
63-
log_handler "Default file values saved to $LATEFILE."
64-
65-
# Get the default prop values
66-
curr_values
51+
replace_fn FILEDEBUGGABLE "\"$LATEFILEDEBUGGABLE\"" "\"$FILEDEBUGGABLE\"" $LATEFILE
52+
replace_fn FILESECURE "\"$LATEFILESECURE\"" "\"$FILESECURE\"" $LATEFILE
53+
replace_fn FILETYPE "\"$LATEFILETYPE\"" "\"$FILETYPE\"" $LATEFILE
54+
replace_fn FILETAGS "\"$LATEFILETAGS\"" "\"$FILETAGS\"" $LATEFILE
55+
replace_fn FILESELINUX "\"$LATEFILESELINUX\"" "\"$FILESELINUX\"" $LATEFILE
56+
replace_fn FILEFINGERPRINT "\"$LATEFILEFINGERPRINT\"" "\"$FILEFINGERPRINT\"" $LATEFILE
57+
log_handler "Default values saved to $LATEFILE."
6758

68-
# Save default prop values in propsconf_late
69-
sed -i "s/ORIGDEBUGGABLE=\"$ORIGDEBUGGABLE\"/ORIGDEBUGGABLE=\"$CURRDEBUGGABLE\"/" $LATEFILE
70-
sed -i "s/ORIGSECURE=\"$ORIGSECURE\"/ORIGSECURE=\"$CURRSECURE\"/" $LATEFILE
71-
sed -i "s/ORIGTYPE=\"$ORIGTYPE\"/ORIGTYPE=\"$CURRTYPE\"/" $LATEFILE
72-
sed -i "s/ORIGTAGS=\"$ORIGTAGS\"/ORIGTAGS=\"$CURRTAGS\"/" $LATEFILE
73-
sed -i "s/ORIGSELINUX=\"$ORIGSELINUX\"/ORIGSELINUX=\"$CURRSELINUX\"/" $LATEFILE
74-
sed -i "s@ORIGFINGERPRINT=\"$ORIGFINGERPRINT\"@ORIGFINGERPRINT=\"$CURRFINGERPRINT\"@" $LATEFILE
75-
log_handler "Current prop values saved to $LATEFILE."
76-
77-
# Checks for the Universal SafetyNet Fix module and similar modules editing the device fingerprint
78-
PRINTMODULE=false
79-
for USNF in $USNFLIST; do
80-
if [ -d "$IMGPATH/$USNF" ]; then
81-
NAME=$(get_file_value $IMGPATH/$USNF/module.prop "name=")
82-
log_handler "'$NAME' installed (modifies the device fingerprint)."
83-
PRINTMODULE=true
84-
fi
85-
done
86-
if [ "$PRINTMODULE" == "true" ]; then
87-
sed -i 's/FINGERPRINTENB=1/FINGERPRINTENB=0/' $LATEFILE
88-
log_handler "Fingerprint modification disabled."
89-
else
90-
sed -i 's/FINGERPRINTENB=0/FINGERPRINTENB=1/' $LATEFILE
91-
if [ "$(get_file_value $LATEFILE "FINGERPRINTENB=")" == 1 ]; then
92-
log_handler "Fingerprint modification enabled."
93-
else
94-
log_handler "Fingerprint modification disabled."
95-
fi
96-
fi
59+
# Checks for configuration file
60+
config_file
9761

9862
# Check if original file values are safe
9963
orig_safe
10064

101-
# Checks for configuration file
102-
config_file
103-
10465
# Edits build.prop
10566
if [ "$(get_file_value $LATEFILE "FILESAFE=")" == 0 ]; then
67+
log_handler "Checking for conflicting build.prop modules."
10668
# Checks if any other modules are using a local copy of build.prop
10769
BUILDMODULE=false
10870
MODID=$(get_file_value $MODPATH/module.prop "id=")
@@ -116,9 +78,9 @@ if [ "$(get_file_value $LATEFILE "FILESAFE=")" == 0 ]; then
11678
fi
11779
done
11880
if [ "$BUILDMODULE" == "true" ]; then
119-
sed -i 's/BUILDPROPENB=1/BUILDPROPENB=0/' $LATEFILE
81+
replace_fn BUILDPROPENB 1 0 $LATEFILE
12082
else
121-
sed -i 's/BUILDPROPENB=0/BUILDPROPENB=1/' $LATEFILE
83+
replace_fn BUILDPROPENB 0 1 $LATEFILE
12284
fi
12385

12486
# Copies the stock build.prop to the module. Only if set in propsconf_late.
@@ -136,28 +98,28 @@ if [ "$(get_file_value $LATEFILE "FILESAFE=")" == 0 ]; then
13698
SEDTYPE="user"
13799
fi
138100
if [ "$(get_file_value $LATEFILE "SETTYPE=")" == "true" ]; then
139-
sed -i "s/ro.build.type=$FILETYPE/ro.build.type=$SEDTYPE/" $MODPATH/system/build.prop && log_handler "ro.build.type=$SEDTYPE"
101+
replace_fn "ro.build.type" $FILETYPE $SEDTYPE $MODPATH/system/build.prop && log_handler "ro.build.type=$SEDTYPE"
140102
fi
141103
if [ "$MODULETAGS" ]; then
142104
SEDTAGS="$MODULETAGS"
143105
else
144106
SEDTAGS="release-keys"
145107
fi
146108
if [ "$(get_file_value $LATEFILE "SETTAGS=")" == "true" ]; then
147-
sed -i "s/ro.build.tags=$FILETAGS/ro.build.tags=$SEDTAGS/" $MODPATH/system/build.prop && log_handler "ro.build.tags=$SEDTAGS"
109+
replace_fn "ro.build.tags" $FILETAGS $SEDTAGS $MODPATH/system/build.prop && log_handler "ro.build.tags=$SEDTAGS"
148110
fi
149111
if [ "$MODULESELINUX" ]; then
150112
SEDSELINUX="$MODULESELINUX"
151113
else
152114
SEDSELINUX="0"
153115
fi
154116
if [ "$(get_file_value $LATEFILE "SETSELINUX=")" == "true" ]; then
155-
sed -i "s/ro.build.selinux=$FILESELINUX/ro.build.selinux=$SEDSELINUX/" $MODPATH/system/build.prop && log_handler "ro.build.selinux=$SEDSELINUX"
117+
replace_fn "ro.build.selinux" $FILESELINUX $SEDSELINUX $MODPATH/system/build.prop && log_handler "ro.build.selinux=$SEDSELINUX"
156118
fi
157-
if [ "$(get_file_value $LATEFILE "SETFINGERPRINT=")" == "true" ] && [ "$MODULEFINGERPRINT" ]; then
158-
PRINTSTMP="$(cat /system/build.prop | grep "$CURRFINGERPRINT")"
119+
if [ "$MODULEFINGERPRINT" ] && [ "$(get_file_value $LATEFILE "SETFINGERPRINT=")" == "true" ]; then
120+
PRINTSTMP="$(cat /system/build.prop | grep "$FILEFINGERPRINT")"
159121
for ITEM in $PRINTSTMP; do
160-
sed -i "s@${ITEM}@$(get_eq_left $ITEM)=${MODULEFINGERPRINT}@" $MODPATH/system/build.prop && log_handler "$(get_eq_left $ITEM)=$MODULEFINGERPRINT"
122+
replace_fn $(get_eq_left $ITEM) $(get_eq_right $ITEM) $MODULEFINGERPRINT $MODPATH/system/build.prop && log_handler "$(get_eq_left $ITEM)=$MODULEFINGERPRINT"
161123
done
162124
fi
163125
else

common/prints.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# MagiskHide Props Config
44
# By Didgeridoohan @ XDA Developers
55

6-
PRINTSV=9
6+
PRINTSV=10
77
PRINTSTRANSF=1
88

99
PRINTSFILE=/sdcard/printslist
@@ -24,6 +24,7 @@ Google Pixel 2 XL (8.1.0)=google/taimen/taimen:8.1.0/OPM1.171019.013/4474084:use
2424
Google Pixel 2 XL (P DP1)=google/taimen/taimen:P/PPP1.180208.014/4633861:user/release-keys
2525
HTC 10 (6.0.1)=htc/HTCOneM10vzw/htc_pmewl:6.0.1/MMB29M/774095.8:user/release-keys
2626
Huawei Mate 10 Pro (8.0.0)=HUAWEI/BLA-L29/HWBLA:8.0.0/HUAWEIBLA-L29S/137(C432):user/release-keys
27+
Motorola Moto E4 (7.1.1)=motorola/sperry_sprint/sperry:7.1.1/NCQ26.69-64/68:user/release-keys
2728
Motorola Moto G4 (7.0)=motorola/athene/athene:7.0/NPJS25.93-14-13/3:user/release-keys
2829
Motorola Moto G5 (7.0)=motorola/cedric/cedric:7.0/NPPS25.137-15-11/11:user/release-keys
2930
Motorola Moto G5 Plus (7.0)=motorola/potter_n/potter_n:7.0/NPNS25.137-33-11/11:user/release-keys

common/propsconf_conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ CONFWEB=enabled
4040
#
4141
# CONFPROPS should contain any custom props and the value you want the module to set.
4242
# Any props you've previously edited in build.prop, and more, can be set like this.
43-
# Add them to the PROPS variable according to the following example:
43+
# Add them to the CONFPROPS variable according to the following example:
4444
# CONFPROPS="
4545
# ro.sf.lcd_density=320
4646
# ro.config.media_vol_steps=30

common/propsconf_late

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# In that case, feel free to delete it.
1010

1111
# Script version
12-
SCRIPTV=3
12+
SCRIPTV=4
1313
SETTRANSF=1
1414

1515
# Variables
@@ -55,6 +55,28 @@ if [ -d "$MODPATH" ]; then
5555
if [ -f "$MODPATH/disable" ]; then
5656
log_handler "Module disabled."
5757
else
58+
# Checks for the Universal SafetyNet Fix module and similar modules editing the device fingerprint
59+
PRINTMODULE=false
60+
for USNF in $USNFLIST; do
61+
if [ -d "$IMGPATH/$USNF" ]; then
62+
NAME=$(get_file_value $IMGPATH/$USNF/module.prop "name=")
63+
log_handler "'$NAME' installed (modifies the device fingerprint)."
64+
PRINTMODULE=true
65+
fi
66+
done
67+
if [ "$PRINTMODULE" == "true" ]; then
68+
replace_fn FINGERPRINTENB 1 0 $LATEFILE
69+
log_handler "Fingerprint modification disabled."
70+
else
71+
replace_fn FINGERPRINTENB 0 1 $LATEFILE
72+
log_handler "Fingerprint modification enabled."
73+
fi
74+
75+
# Check the reboot variable
76+
if [ "$(get_file_value $LATEFILE "REBOOTCHK\=")" == 1 ]; then
77+
replace_fn REBOOTCHK 1 0 $LATEFILE
78+
fi
79+
5880
# ---Original values---
5981
# default.prop
6082
FILEDEBUGGABLE=""
@@ -63,13 +85,7 @@ if [ -d "$MODPATH" ]; then
6385
FILETYPE=""
6486
FILETAGS=""
6587
FILESELINUX=""
66-
# Prop values
67-
ORIGDEBUGGABLE=""
68-
ORIGSECURE=""
69-
ORIGTYPE=""
70-
ORIGTAGS=""
71-
ORIGSELINUX=""
72-
ORIGFINGERPRINT=""
88+
FILEFINGERPRINT=""
7389

7490
# ---Module values---
7591
MODULEDEBUGGABLE=""
@@ -120,10 +136,13 @@ if [ -d "$MODPATH" ]; then
120136
fi
121137
fi
122138
# Set new fingerprint
123-
if [ "$FINGERPRINTENB" == 1 ] && [ "$PRINTEDIT" == 1 ]; then
139+
if [ "$FINGERPRINTENB" == 1 -o "$PRINTMODULE" == "false" ] && [ "$PRINTEDIT" == 1 ]; then
124140
log_handler "Changing fingerprint."
125-
resetprop -v ro.build.fingerprint $MODULEFINGERPRINT 2>> $LOGFILE
126-
resetprop -v ro.bootimage.build.fingerprint $MODULEFINGERPRINT 2>> $LOGFILE
141+
PRINTSTMP="$(resetprop | grep "build.fingerprint" | sed 's/\]\:\ /\]/')"
142+
for ITEM in $PRINTSTMP; do
143+
TMPPROP=$(echo $ITEM | sed 's/\]\[.*//' | sed 's/\[//')
144+
resetprop -v $TMPPROP $MODULEFINGERPRINT 2>> $LOGFILE
145+
done
127146
fi
128147

129148
# ---Setting custom props---
@@ -146,21 +165,21 @@ if [ -d "$MODPATH" ]; then
146165
SEDDEBUGGABLE="0"
147166
fi
148167
if [ "$SETDEBUGGABLE" == "true" ]; then
149-
sed -i "s/ro.debuggable=$FILEDEBUGGABLE/ro.debuggable=$SEDDEBUGGABLE/" /default.prop && log_handler "ro.debuggable=$SEDDEBUGGABLE"
168+
replace_fn "ro.debuggable" $FILEDEBUGGABLE $SEDDEBUGGABLE /default.prop && log_handler "ro.debuggable=$SEDDEBUGGABLE"
150169
fi
151170
if [ "$MODULESECURE" ]; then
152171
SEDSECURE="$MODULESECURE"
153172
else
154173
SEDSECURE="1"
155174
fi
156175
if [ "$SETSECURE" == "true" ]; then
157-
sed -i "s/ro.secure=$FILESECURE/ro.secure=$SEDSECURE/" /default.prop && log_handler "ro.secure=$SEDSECURE"
176+
replace_fn "ro.secure" $FILESECURE $SEDSECURE /default.prop && log_handler "ro.secure=$SEDSECURE"
158177
fi
159178
mount -ro remount rootfs /
160179
else
161180
log_handler "Default.prop editing disabled."
162-
fi
163-
fi
181+
fi
182+
fi
164183
log_script_chk "Boot script finished.\n\n=================="
165184
fi
166185
else

0 commit comments

Comments
 (0)