Skip to content

Commit d3a5b6c

Browse files
v2.1.4
1 parent 35df7ea commit d3a5b6c

File tree

6 files changed

+178
-117
lines changed

6 files changed

+178
-117
lines changed

README.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,18 @@ If you've picked a certified fingerprint from the provided list, or you're using
4848
- 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.
4949
- Try a different fingerprint from the provided list.
5050
- 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.
51+
- Some ROMs will just not be able to pass the ctsProfile check, if they contain signs of a rooted/modified device that Magisk can't hide.
52+
- If you can't get things working, and want help, make sure to provide logs. See "Logs, etc" below.
53+
54+
55+
## Keeping your device "certified"
56+
If you're using a custom ROM, the chances of it being [perceived as uncertified by Google](https://www.xda-developers.com/google-blocks-gapps-uncertified-devices-custom-rom-whitelist/) are pretty high. If your ROM has a build date later than March 16 2018, this might mean that you can't even log into your Google account or use Gapps without [whitelisting your device with Google](https://www.google.com/android/uncertified/) first.
57+
58+
Magisk, and this module, can help with that.
59+
60+
Before setting up your device, install Magisk, this module and use the configuration file described below to pass the ctsProfile check. This should make your device be perceived as certified by Google and you can log into your Google account and use your device without having to whitelist it. Check [here](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config/blob/master/common/prints.sh) for usable fingerprints (only use the part to the right of the equal sign).
61+
62+
If you're having issues getting your device certified, take a look in the Magisk troubleshooting guide linked below.
5263

5364

5465
## Current fingerprints list version
@@ -86,16 +97,6 @@ There are a couple of persistent options that you can set for the `props` script
8697
You can use a configuration file to set your desired options, rather than running the `props` command. Download the [settings file](https://raw.githubusercontent.com/Magisk-Modules-Repo/MagiskHide-Props-Config/master/common/propsconf_conf) or extract it from the module zip (in the common folder), fill in the desired options (follow the instructions in the file), place it in /cache (or /data/cache if you're using an A/B device) and reboot. This can also be done directly at the first install (through Manager or recovery), before even rebooting your device. Instant settings.
8798

8899

89-
## Keeping your device "certified"
90-
If you're using a custom ROM, the chances of it being [perceived as uncertified by Google](https://www.xda-developers.com/google-blocks-gapps-uncertified-devices-custom-rom-whitelist/) are pretty high. If your ROM has a build date later than March 16 2018, this might mean that you can't even log into your Google account or use Gapps without [whitelisting your device with Google](https://www.google.com/android/uncertified/) first.
91-
92-
Magisk, and this module, can help with that.
93-
94-
Before setting up your device, install Magisk, this module and use the configuration file described above to pass the ctsProfile check. This should make your device be perceived as certified by Google and you can log into your Google account and use your device without having to whitelist it. Check [here](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config/blob/master/common/prints.sh) for usable fingerprints (only use the part to the right of the equal sign).
95-
96-
If you're having issues getting your device certified, take a look in the Magisk troubleshooting guide linked below.
97-
98-
99100
## Miscellaneous MagiskHide issues
100101
If you're having issues passing SafetyNet, getting your device certified, or otherwise getting MagiskHide to work, take a look in the [Magisk and MagiskHide Installation and Troubleshooting Guide](https://www.didgeridoohan.com/magisk). Lots of good info there (if I may say so myself)...
101102

@@ -113,7 +114,9 @@ Place a file named `reset_mhpc` in /cache (or /data/cache on A/B devices) and re
113114
It is possible to use this in combination with the configuration file described above to keep device fingerprint or any other settings intact past the reset. Just make sure to remove any custom props that might have been causing issues from the configuration file.
114115

115116
### Logs, etc
116-
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.
117+
In case of issues, please provide the different log files, found in /cache (or /data/cache for A/B devices), together with a detailed description of your problem. The logs available could include "magisk.log", "propsconf.log", "propsconf_last.log", "propsconf_install.log" and "propsconf_latefile.log" Providing the output from terminal might also be useful.
118+
119+
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 (the only difference is the more verbose logging), so that you can collect the debug log.
117120

118121

119122
## Source
@@ -126,6 +129,13 @@ In case of issues, please provide the logs, saved in /cache, "magisk.log", "prop
126129

127130

128131
## Changelog
132+
### v2.1.4
133+
- Fixed improved hiding.
134+
- Fixed using the configuration file on a clean install.
135+
- Fixed a fault in the AE-35 Unit.
136+
- Improved logging.
137+
- A bunch of optimisations that will probably break stuff.
138+
129139
### v2.1.3
130140
- Reverted the function to only editing existing fingerprint props.
131141
- Optimised setting the different props.

common/post-fs-data.sh

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,8 @@ IMGPATH=$(dirname "$MODPATH")
1919
rm -f $RUNFILE
2020
touch $RUNFILE
2121

22-
# Saves the previous log (if available) and creates a new one
23-
if [ -f "$LOGFILE" ]; then
24-
mv -f $LOGFILE $LASTLOGFILE
25-
fi
26-
touch $LOGFILE
27-
echo "***************************************************" >> $LOGFILE
28-
echo "******** MagiskHide Props Config $MODVERSION ********" >> $LOGFILE
29-
echo "**************** By Didgeridoohan ***************" >> $LOGFILE
30-
echo "***************************************************" >> $LOGFILE
31-
log_script_chk "Log start."
22+
# Start logging
23+
log_start
3224

3325
# Check for boot scripts and restore backup if deleted, or if the resetfile is present
3426
if [ ! -f "$LATEFILE" ] || [ -f "$RESETFILE" ]; then
@@ -56,12 +48,12 @@ replace_fn FILESELINUX "\"$LATEFILESELINUX\"" "\"$FILESELINUX\"" $LATEFILE
5648
replace_fn FILEFINGERPRINT "\"$LATEFILEFINGERPRINT\"" "\"$FILEFINGERPRINT\"" $LATEFILE
5749
log_handler "Default values saved to $LATEFILE."
5850

59-
# Checks for configuration file
60-
config_file
61-
6251
# Check if original file values are safe
6352
orig_safe
6453

54+
# Checks for configuration file
55+
config_file
56+
6557
# Edits build.prop
6658
if [ "$(get_file_value $LATEFILE "FILESAFE=")" == 0 ]; then
6759
log_handler "Checking for conflicting build.prop modules."
@@ -90,25 +82,9 @@ if [ "$(get_file_value $LATEFILE "FILESAFE=")" == 0 ]; then
9082

9183
# Edits the module copy of build.prop
9284
module_values
93-
log_handler "Editing build.prop."
94-
for ITEM in $PROPSLIST; do
95-
PROP=$(get_prop_type $ITEM)
96-
MODULEPROP=$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]')
97-
FILEPROP=$(echo "FILE${PROP}" | tr '[:lower:]' '[:upper:]')
98-
SETPROP=$(echo "SET${PROP}" | tr '[:lower:]' '[:upper:]')
99-
if [ "$(eval "echo \$$MODULEPROP")" ]; then
100-
SEDVAR="$(eval "echo \$$MODULEPROP")"
101-
else
102-
for P in $SAFELIST; do
103-
if [ "$(get_eq_left $P)" == "$ITEM" ]; then
104-
SEDVAR=$(get_eq_right $P)
105-
fi
106-
done
107-
fi
108-
if [ "$(get_file_value $LATEFILE "${SETPROP}=")" == "true" ]; then
109-
replace_fn $ITEM $(eval "echo \$$FILEPROP") $SEDVAR $MODPATH/system/build.prop && log_handler "${ITEM}=${SEDVAR}"
110-
fi
111-
done
85+
log_handler "Editing build.prop."
86+
# ro.build props
87+
change_prop_file "build"
11288
# Fingerprint
11389
if [ "$MODULEFINGERPRINT" ] && [ "$(get_file_value $LATEFILE "SETFINGERPRINT=")" == "true" ]; then
11490
PRINTSTMP="$(cat /system/build.prop | grep "$FILEFINGERPRINT")"

common/propsconf_late

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

1111
# Script version
12-
SCRIPTV=5
12+
SCRIPTV=6
1313
SETTRANSF=1
1414

1515
# Variables
1616
IMGPATH=IMG_PLACEHOLDER
1717
MODPATH=$IMGPATH/MagiskHidePropsConf
18+
CACHELOC=CACHE_PLACEHOLDER
19+
LATELOGFILE=$CACHELOC/propsconf_latefile.log
20+
21+
CACHEFILES="
22+
propsconf.log
23+
propsconf_last.log
24+
propsconf_install.log
25+
propsconf_conf
26+
reset_mhpc
27+
"
1828

1929
FINGERPRINTENB=1
2030
PRINTEDIT=0
@@ -31,19 +41,23 @@ OPTIONWEB=1
3141

3242
# Function to clean up different files after the module has been uninstalled
3343
cleanup() {
34-
CACHELOC=CACHE_PLACEHOLDER
35-
rm -f $CACHELOC/propsconf.log
36-
rm -f $CACHELOC/propsconf_last.log
37-
rm -f $CACHELOC/propsconf_conf
38-
rm -f $CACHELOC/reset_mhpc
44+
echo "Cleaning up files in $CACHELOC." >> $LATELOGFILE
45+
for ITEM in $CACHEFILES; do
46+
if [ -f "$CACHELOC/$ITEM" ]; then
47+
echo "Deleting ${ITEM}." >> $LATELOGFILE
48+
rm -f $CACHELOC/$ITEM
49+
fi
50+
done
3951
# Suicide.
52+
echo "Removing script." >> $LATELOGFILE
4053
rm $0
4154
}
4255

4356
# Checks if the module is installed. Deletes itself if it isn't.
4457
if [ -d "$MODPATH" ]; then
4558
# Checks if the module is set for removal
46-
if [ -f "$MODPATH/remove" ]; then
59+
if [ -f "$MODPATH/remove" ]; then
60+
echo "Module set for removal." >> $LATELOGFILE
4761
# Cleanup
4862
cleanup
4963
else
@@ -53,6 +67,7 @@ if [ -d "$MODPATH" ]; then
5367
log_script_chk "Running boot script."
5468

5569
if [ -f "$MODPATH/disable" ]; then
70+
log_start
5671
log_handler "Module disabled."
5772
else
5873
# Checks for the Universal SafetyNet Fix module and similar modules editing the device fingerprint
@@ -153,30 +168,22 @@ if [ -d "$MODPATH" ]; then
153168
if [ "$DEFAULTEDIT" == 1 ] && [ "$FILESAFE" == 0 ]; then
154169
log_handler "Editing default.prop."
155170
mount -wo remount rootfs /
156-
if [ "$MODULEDEBUGGABLE" ]; then
157-
SEDDEBUGGABLE="$MODULEDEBUGGABLE"
158-
else
159-
SEDDEBUGGABLE="0"
160-
fi
161-
if [ "$SETDEBUGGABLE" == "true" ]; then
162-
replace_fn "ro.debuggable" $FILEDEBUGGABLE $SEDDEBUGGABLE /default.prop && log_handler "ro.debuggable=$SEDDEBUGGABLE"
163-
fi
164-
if [ "$MODULESECURE" ]; then
165-
SEDSECURE="$MODULESECURE"
166-
else
167-
SEDSECURE="1"
168-
fi
169-
if [ "$SETSECURE" == "true" ]; then
170-
replace_fn "ro.secure" $FILESECURE $SEDSECURE /default.prop && log_handler "ro.secure=$SEDSECURE"
171-
fi
171+
change_prop_file "default"
172172
mount -ro remount rootfs /
173173
else
174174
log_handler "Default.prop editing disabled."
175-
fi
175+
fi
176+
fi
177+
# Check if the late_start service log file exists.
178+
if [ -f "$LATELOGFILE" ]; then
179+
log_handler "Removing late_start service log ($LATELOGFILE)."
180+
rm -f $LATELOGFILE
176181
fi
177182
log_script_chk "Boot script finished.\n\n=================="
178183
fi
179184
else
185+
echo "$MODPATH not found." >> $LATELOGFILE
186+
echo "Module no longer installed." >> $LATELOGFILE
180187
# Cleanup
181188
cleanup
182189
fi

common/util_functions.sh

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ get_file_value() {
6060
}
6161

6262
# Logs
63+
# Saves the previous log (if available) and creates a new one
64+
log_start() {
65+
if [ -f "$LOGFILE" ]; then
66+
mv -f $LOGFILE $LASTLOGFILE
67+
fi
68+
touch $LOGFILE
69+
echo "***************************************************" >> $LOGFILE
70+
echo "******** MagiskHide Props Config $MODVERSION ********" >> $LOGFILE
71+
echo "**************** By Didgeridoohan ***************" >> $LOGFILE
72+
echo "***************************************************" >> $LOGFILE
73+
log_script_chk "Log start."
74+
}
6375
log_handler() {
6476
echo "" >> $LOGFILE
6577
echo -e "$(date +"%m-%d-%Y %H:%M:%S") - $1" >> $LOGFILE
@@ -128,10 +140,10 @@ replace_fn() {
128140
# Updates placeholders
129141
placeholder_update() {
130142
FILEVALUE=$(get_file_value $1 "$2=")
131-
log_handler "Checking for '$3' in '$1'. Current value is '$FILEVALUE'."
143+
log_handler "Checking for ${3} in ${1}. Current value is ${FILEVALUE}."
132144
case $FILEVALUE in
133145
*PLACEHOLDER*) replace_fn $2 $3 $4 $1
134-
log_handler "Placeholder '$3' updated to '$4' in '$1'."
146+
log_handler "Placeholder ${3} updated to ${4} in ${1}."
135147
;;
136148
esac
137149
}
@@ -414,7 +426,7 @@ download_prints() {
414426

415427
# Reset the module fingerprint change
416428
reset_print() {
417-
log_handler "Resetting device fingerprint."
429+
log_handler "Resetting device fingerprint to default system value."
418430

419431
SUBA=$(get_file_value $LATEFILE "MODULEFINGERPRINT=")
420432

@@ -492,6 +504,7 @@ edit_prop_files() {
492504
# Checking if the device fingerprint is set by the module
493505
if [ "$(get_file_value $LATEFILE "FINGERPRINTENB=")" == 1 ] && [ "$(get_file_value $LATEFILE "PRINTEDIT=")" == 1 ]; then
494506
if [ "$(cat /system/build.prop | grep "$FILEFINGERPRINT")" ]; then
507+
log_handler "Enabling prop file editing for device fingerprint."
495508
replace_fn SETFINGERPRINT "false" "true" $LATEFILE
496509
fi
497510
fi
@@ -535,6 +548,44 @@ edit_prop_files() {
535548
fi
536549
}
537550

551+
change_prop_file() {
552+
case $1 in
553+
build)
554+
FNLIST="
555+
ro.build.type
556+
ro.build.tags
557+
ro.build.selinux
558+
"
559+
PROPFILELOC=$MODPATH/system/build.prop
560+
;;
561+
default)
562+
FNLIST="
563+
ro.debuggable
564+
ro.secure
565+
"
566+
PROPFILELOC=/default.prop
567+
;;
568+
esac
569+
for ITEM in $FNLIST; do
570+
PROP=$(get_prop_type $ITEM)
571+
MODULEPROP=$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]')
572+
FILEPROP=$(echo "FILE${PROP}" | tr '[:lower:]' '[:upper:]')
573+
SETPROP=$(echo "SET${PROP}" | tr '[:lower:]' '[:upper:]')
574+
if [ "$(eval "echo \$$MODULEPROP")" ]; then
575+
SEDVAR="$(eval "echo \$$MODULEPROP")"
576+
else
577+
for P in $SAFELIST; do
578+
if [ "$(get_eq_left $P)" == "$ITEM" ]; then
579+
SEDVAR=$(get_eq_right $P)
580+
fi
581+
done
582+
fi
583+
if [ "$(get_file_value $LATEFILE "${SETPROP}=")" == "true" ]; then
584+
replace_fn $ITEM $(eval "echo \$$FILEPROP") $SEDVAR $PROPFILELOC && log_handler "${ITEM}=${SEDVAR}"
585+
fi
586+
done
587+
}
588+
538589
# ======================== MagiskHide Props functions ========================
539590
# Check safe values
540591
safe_props() {
@@ -578,7 +629,7 @@ reset_prop() {
578629
REPROP=$(echo "RE${PROP}" | tr '[:lower:]' '[:upper:]')
579630
SUBA=$(get_file_value $LATEFILE "${MODULEPROP}=")
580631

581-
log_handler "Resetting $1 to default value."
632+
log_handler "Resetting $1 to default system value."
582633

583634
# Saves new module value
584635
replace_fn $MODULEPROP "\"$SUBA\"" "\"\"" $LATEFILE

0 commit comments

Comments
 (0)