This commit is contained in:
Didgeridoohan 2018-04-26 22:40:46 +02:00 committed by GitHub
parent 98003046ca
commit 74a880a2ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 82 additions and 83 deletions

View File

@ -86,14 +86,6 @@ There are a couple of persistent options that you can set for the `props` script
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. 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.
## Device issues because of the module
In case of issues, if you've set a prop value that doesn't work on your device causing it not to boot, etc, don't worry. There are options. You can follow the advice in the [troubleshooting guide](https://www.didgeridoohan.com/magisk/Magisk#hn_Module_causing_issues_Magisk_functionality_bootloop_loss_of_root_etc) to remove or disable the module, or you can use the module's built-in options to reset all module settings to the defaults.
Place a file named `reset_mhpc` in /cache (or /data/cache on A/B devices) and reboot.
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.
## Keeping your device "certified" ## Keeping your device "certified"
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. 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.
@ -101,7 +93,7 @@ Magisk, and this module, can help with that.
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). 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).
If you're having issues getting your device certified, take a look in the troubleshooting guide linked below. If you're having issues getting your device certified, take a look in the Magisk troubleshooting guide linked below.
## Miscellaneous MagiskHide issues ## Miscellaneous MagiskHide issues
@ -113,6 +105,13 @@ But first: have you tried turning it off and on again? Toggling MagiskHide off a
## Issues, support, etc ## Issues, support, etc
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. 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.
### Device issues because of the module
In case of issues, if you've set a prop value that doesn't work on your device causing it not to boot, etc, don't worry. There are options. You can follow the advice in the [Magisk troubleshooting guide](https://www.didgeridoohan.com/magisk/Magisk#hn_Module_causing_issues_Magisk_functionality_bootloop_loss_of_root_etc) to remove or disable the module, or you can use the module's built-in options to reset all module settings to the defaults.
Place a file named `reset_mhpc` in /cache (or /data/cache on A/B devices) and reboot.
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.
### Logs, etc ### Logs, etc
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. 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.
@ -127,6 +126,11 @@ In case of issues, please provide the logs, saved in /cache, "magisk.log", "prop
## Changelog ## Changelog
### v2.1.3
- Reverted the function to only editing existing fingerprint props.
- Optimised setting the different props.
- Minor updates and improvements.
### v2.1.2 ### v2.1.2
- Detects and edits only existing device fingerprint props. - Detects and edits only existing device fingerprint props.
- Slightly optimised the boot scripts. - Slightly optimised the boot scripts.

View File

@ -85,37 +85,31 @@ if [ "$(get_file_value $LATEFILE "FILESAFE=")" == 0 ]; then
# Copies the stock build.prop to the module. Only if set in propsconf_late. # Copies the stock build.prop to the module. Only if set in propsconf_late.
if [ "$(get_file_value $LATEFILE "BUILDPROPENB=")" == 1 ] && [ "$(get_file_value $LATEFILE "BUILDEDIT=")" == 1 ]; then if [ "$(get_file_value $LATEFILE "BUILDPROPENB=")" == 1 ] && [ "$(get_file_value $LATEFILE "BUILDEDIT=")" == 1 ]; then
log_handler "Build.prop editing enabled." cp -f /system/build.prop $MODPATH/system/build.prop
cp /system/build.prop $MODPATH/system/build.prop
log_handler "Stock build.prop copied from /system." log_handler "Stock build.prop copied from /system."
# Edits the module copy of build.prop # Edits the module copy of build.prop
module_values module_values
log_handler "Editing build.prop." log_handler "Editing build.prop."
if [ "$MODULETYPE" ]; then for ITEM in $PROPSLIST; do
SEDTYPE="$MODULETYPE" PROP=$(get_prop_type $ITEM)
else MODULEPROP=$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]')
SEDTYPE="user" FILEPROP=$(echo "FILE${PROP}" | tr '[:lower:]' '[:upper:]')
fi SETPROP=$(echo "SET${PROP}" | tr '[:lower:]' '[:upper:]')
if [ "$(get_file_value $LATEFILE "SETTYPE=")" == "true" ]; then if [ "$(eval "echo \$$MODULEPROP")" ]; then
replace_fn "ro.build.type" $FILETYPE $SEDTYPE $MODPATH/system/build.prop && log_handler "ro.build.type=$SEDTYPE" SEDVAR="$(eval "echo \$$MODULEPROP")"
fi else
if [ "$MODULETAGS" ]; then for P in $SAFELIST; do
SEDTAGS="$MODULETAGS" if [ "$(get_eq_left $P)" == "$ITEM" ]; then
else SEDVAR=$(get_eq_right $P)
SEDTAGS="release-keys" fi
fi done
if [ "$(get_file_value $LATEFILE "SETTAGS=")" == "true" ]; then fi
replace_fn "ro.build.tags" $FILETAGS $SEDTAGS $MODPATH/system/build.prop && log_handler "ro.build.tags=$SEDTAGS" if [ "$(get_file_value $LATEFILE "${SETPROP}=")" == "true" ]; then
fi replace_fn $ITEM $(eval "echo \$$FILEPROP") $SEDVAR $MODPATH/system/build.prop && log_handler "${ITEM}=${SEDVAR}"
if [ "$MODULESELINUX" ]; then fi
SEDSELINUX="$MODULESELINUX" done
else # Fingerprint
SEDSELINUX="0"
fi
if [ "$(get_file_value $LATEFILE "SETSELINUX=")" == "true" ]; then
replace_fn "ro.build.selinux" $FILESELINUX $SEDSELINUX $MODPATH/system/build.prop && log_handler "ro.build.selinux=$SEDSELINUX"
fi
if [ "$MODULEFINGERPRINT" ] && [ "$(get_file_value $LATEFILE "SETFINGERPRINT=")" == "true" ]; then if [ "$MODULEFINGERPRINT" ] && [ "$(get_file_value $LATEFILE "SETFINGERPRINT=")" == "true" ]; then
PRINTSTMP="$(cat /system/build.prop | grep "$FILEFINGERPRINT")" PRINTSTMP="$(cat /system/build.prop | grep "$FILEFINGERPRINT")"
for ITEM in $PRINTSTMP; do for ITEM in $PRINTSTMP; do

View File

@ -9,7 +9,7 @@
# In that case, feel free to delete it. # In that case, feel free to delete it.
# Script version # Script version
SCRIPTV=4 SCRIPTV=5
SETTRANSF=1 SETTRANSF=1
# Variables # Variables
@ -69,7 +69,6 @@ if [ -d "$MODPATH" ]; then
log_handler "Fingerprint modification disabled." log_handler "Fingerprint modification disabled."
else else
replace_fn FINGERPRINTENB 0 1 $LATEFILE replace_fn FINGERPRINTENB 0 1 $LATEFILE
log_handler "Fingerprint modification enabled."
fi fi
# Check the reboot variable # Check the reboot variable
@ -119,44 +118,39 @@ if [ -d "$MODPATH" ]; then
# Set/change MagiskHide sensitive props # Set/change MagiskHide sensitive props
if [ "$PROPEDIT" == 1 ]; then if [ "$PROPEDIT" == 1 ]; then
log_handler "Changing sensitive props." log_handler "Changing sensitive props."
if [ "$REDEBUGGABLE" == "true" ]; then for ITEM in $PROPSLIST; do
resetprop -v ro.debuggable $MODULEDEBUGGABLE 2>> $LOGFILE PROP=$(get_prop_type $ITEM)
fi REPROP=$(echo "RE${PROP}" | tr '[:lower:]' '[:upper:]')
if [ "$RESECURE" == "true" ]; then MODULEPROP=$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]')
resetprop -v ro.secure $MODULESECURE 2>> $LOGFILE if [ "$(eval "echo \$$REPROP")" == "true" ]; then
fi log_handler "Changing/writing $ITEM."
if [ "$RETYPE" == "true" ]; then resetprop -v $ITEM 2>> $LOGFILE
resetprop -v ro.build.type $MODULETYPE 2>> $LOGFILE resetprop -v $ITEM $(eval "echo \$$MODULEPROP") 2>> $LOGFILE
fi fi
if [ "$RETAGS" == "true" ]; then done
resetprop -v ro.build.tags $MODULETAGS 2>> $LOGFILE
fi
if [ "$RESELINUX" == "true" ]; then
resetprop -v ro.build.selinux $MODULESELINUX 2>> $LOGFILE
fi
fi fi
# Set new fingerprint # Set new fingerprint
if [ "$FINGERPRINTENB" == 1 -o "$PRINTMODULE" == "false" ] && [ "$PRINTEDIT" == 1 ]; then if [ "$FINGERPRINTENB" == 1 -o "$PRINTMODULE" == "false" ] && [ "$PRINTEDIT" == 1 ]; then
log_handler "Changing fingerprint." log_handler "Changing fingerprint."
PRINTSTMP="$(resetprop | grep "build.fingerprint" | sed 's/\]\:\ /\]/')" for ITEM in $PRINTPROPS; do
for ITEM in $PRINTSTMP; do log_handler "Changing/writing $ITEM."
TMPPROP=$(echo $ITEM | sed 's/\]\[.*//' | sed 's/\[//') resetprop -v $ITEM 2>> $LOGFILE
resetprop -v $TMPPROP $MODULEFINGERPRINT 2>> $LOGFILE resetprop -v $ITEM $MODULEFINGERPRINT 2>> $LOGFILE
done done
fi fi
# ---Setting custom props--- # ---Setting custom props---
if [ "$CUSTOMEDIT" == 1 ]; then if [ "$CUSTOMEDIT" == 1 ]; then
log_handler "Writing custom props." log_handler "Writing custom props."
for ITEM in $CUSTOMPROPS; do for ITEM in $CUSTOMPROPS; do
log_handler "Writing $(get_eq_left $ITEM)." log_handler "Changing/writing $(get_eq_left $ITEM)."
resetprop -v $(get_eq_left $ITEM) 2>> $LOGFILE
resetprop -v $(get_eq_left $ITEM) $(get_eq_right $ITEM) 2>> $LOGFILE resetprop -v $(get_eq_left $ITEM) $(get_eq_right $ITEM) 2>> $LOGFILE
done done
fi fi
# ---Edits default.prop--- # ---Edits default.prop---
if [ "$DEFAULTEDIT" == 1 ] && [ "$FILESAFE" == 0 ]; then if [ "$DEFAULTEDIT" == 1 ] && [ "$FILESAFE" == 0 ]; then
log_handler "Default.prop editing enabled."
log_handler "Editing default.prop." log_handler "Editing default.prop."
mount -wo remount rootfs / mount -wo remount rootfs /
if [ "$MODULEDEBUGGABLE" ]; then if [ "$MODULEDEBUGGABLE" ]; then

View File

@ -47,9 +47,16 @@ ro.build.tags=release-keys
ro.build.selinux=0 ro.build.selinux=0
" "
# Print props
PRINTPROPS="
ro.build.fingerprint
ro.bootimage.build.fingerprint
ro.vendor.build.fingerprint
"
# Finding file values # Finding file values
get_file_value() { get_file_value() {
cat $1 | grep $2 | sed "s/.*${2}//" | sed 's/\"//g' cat $1 | grep $2 | sed "s@.*${2}@@" | sed 's@\"@@g'
} }
# Logs # Logs
@ -90,23 +97,23 @@ menu_header() {
# Find prop type # Find prop type
get_prop_type() { get_prop_type() {
echo $1 | sed 's/.*\.//' echo $1 | sed 's@.*\.@@'
} }
# Get left side of = # Get left side of =
get_eq_left() { get_eq_left() {
echo $1 | sed 's/=.*//' echo $1 | sed 's@=.*@@'
} }
# Get right side of = # Get right side of =
get_eq_right() { get_eq_right() {
echo $1 | sed 's/.*=//' echo $1 | sed 's@.*=@@'
} }
# Get first word in string # Get first word in string
get_first() { get_first() {
case $1 in case $1 in
*\ *) echo $1 | sed 's/\ .*//' *\ *) echo $1 | sed 's@\ .*@@'
;; ;;
*=*) get_eq_left $1 *=*) get_eq_left $1
;; ;;
@ -165,26 +172,26 @@ curr_values() {
CURRFINGERPRINT=$(resetprop ro.build.fingerprint) CURRFINGERPRINT=$(resetprop ro.build.fingerprint)
if [ -z "$CURRFINGERPRINT" ]; then if [ -z "$CURRFINGERPRINT" ]; then
CURRFINGERPRINT=$(resetprop ro.bootimage.build.fingerprint) CURRFINGERPRINT=$(resetprop ro.bootimage.build.fingerprint)
if [ -z "$CURRFINGERPRINT" ]; then
CURRFINGERPRINT=$(resetprop ro.vendor.build.fingerprint)
fi
fi fi
} }
# Prop file values # Prop file values
file_values() { file_values() {
FILEDEBUGGABLE=$(get_file_value /default.prop "ro.debuggable=") FILEDEBUGGABLE=$(resetprop ro.debuggable)
FILESECURE=$(get_file_value /default.prop "ro.secure=") FILESECURE=$(resetprop ro.secure)
FILETYPE=$(get_file_value /system/build.prop "ro.build.type=") FILETYPE=$(resetprop ro.build.type)
FILETAGS=$(get_file_value /system/build.prop "ro.build.tags=") FILETAGS=$(resetprop ro.build.tags)
FILESELINUX=$(get_file_value /system/build.prop "ro.build.selinux=") FILESELINUX=$(resetprop ro.build.selinux)
FILEFINGERPRINT=$(get_file_value /system/build.prop "ro.build.fingerprint=") FILEFINGERPRINT=$(resetprop ro.build.fingerprint)
if [ -z "$FILEFINGERPRINT" ]; then if [ -z "$FILEFINGERPRINT" ]; then
FILEFINGERPRINT=$(get_file_value /system/build.prop "ro.bootimage.build.fingerprint=") FILEFINGERPRINT=$(resetprop ro.bootimage.build.fingerprint)
if [ -z "$FILEFINGERPRINT" ]; then if [ -z "$FILEFINGERPRINT" ]; then
FILEFINGERPRINT=$(resetprop ro.build.fingerprint) FILEFINGERPRINT=$(resetprop ro.vendor.build.fingerprint)
if [ -z "$FILEFINGERPRINT" ]; then
FILEFINGERPRINT=$(resetprop ro.bootimage.build.fingerprint)
fi
fi fi
fi fi
} }
# Latefile values # Latefile values
@ -652,7 +659,7 @@ reset_prop_all() {
set_custprop() { set_custprop() {
if [ "$2" ]; then if [ "$2" ]; then
CURRCUSTPROPS=$(get_file_value $LATEFILE "CUSTOMPROPS=") CURRCUSTPROPS=$(get_file_value $LATEFILE "CUSTOMPROPS=")
TMPCUSTPROPS=$(echo "$CURRCUSTPROPS ${1}=${2}" | sed 's/^[ \t]*//') TMPCUSTPROPS=$(echo "$CURRCUSTPROPS ${1}=${2}" | sed 's@^[ \t]*@@')
SORTCUSTPROPS=$(echo $(printf '%s\n' $TMPCUSTPROPS | sort -u)) SORTCUSTPROPS=$(echo $(printf '%s\n' $TMPCUSTPROPS | sort -u))
log_handler "Setting custom prop $1." log_handler "Setting custom prop $1."
@ -684,7 +691,7 @@ reset_custprop() {
CURRCUSTPROPS=$(get_file_value $LATEFILE "CUSTOMPROPS=") CURRCUSTPROPS=$(get_file_value $LATEFILE "CUSTOMPROPS=")
log_handler "Resetting custom props $1." log_handler "Resetting custom props $1."
TMPCUSTPROPS=$(echo $CURRCUSTPROPS | sed "s/${1}=${2}//" | tr -s " " | sed 's/^[ \t]*//') TMPCUSTPROPS=$(echo $CURRCUSTPROPS | sed "s@${1}=${2}@@" | tr -s " " | sed 's@^[ \t]*@@')
# Removing all custom props # Removing all custom props
replace_fn CUSTOMPROPS "\"$CURRCUSTPROPS\"" "\"$TMPCUSTPROPS\"" $LATEFILE replace_fn CUSTOMPROPS "\"$CURRCUSTPROPS\"" "\"$TMPCUSTPROPS\"" $LATEFILE

View File

@ -102,7 +102,7 @@ set_permissions() {
# Finding file values # Finding file values
get_file_value() { get_file_value() {
cat $1 | grep $2 | sed "s/.*$2//" | sed 's/\"//g' cat $1 | grep $2 | sed "s@.*$2@@" | sed 's@\"@@g'
} }
# Variables # Variables
@ -286,7 +286,7 @@ script_install() {
placeholder_update $MODPATH/util_functions.sh BIN BIN_PLACEHOLDER "$BIN" placeholder_update $MODPATH/util_functions.sh BIN BIN_PLACEHOLDER "$BIN"
placeholder_update $MODPATH/util_functions.sh USNFLIST USNF_PLACEHOLDER "$USNFLIST" placeholder_update $MODPATH/util_functions.sh USNFLIST USNF_PLACEHOLDER "$USNFLIST"
placeholder_update $MODPATH/util_functions.sh CACHELOC CACHE_PLACEHOLDER "$CACHELOC" placeholder_update $MODPATH/util_functions.sh CACHELOC CACHE_PLACEHOLDER "$CACHELOC"
MODVERSION=$(echo $(get_file_value $MODPATH/module.prop "version=") | sed 's/-.*//') MODVERSION=$(echo $(get_file_value $MODPATH/module.prop "version=") | sed 's@-.*@@')
placeholder_update $MODPATH/util_functions.sh MODVERSION VER_PLACEHOLDER $MODVERSION placeholder_update $MODPATH/util_functions.sh MODVERSION VER_PLACEHOLDER $MODVERSION
placeholder_update $LATEFILE IMGPATH IMG_PLACEHOLDER $BIMGPATH placeholder_update $LATEFILE IMGPATH IMG_PLACEHOLDER $BIMGPATH
placeholder_update $MODPATH/system/$BIN/props IMGPATH IMG_PLACEHOLDER $BIMGPATH placeholder_update $MODPATH/system/$BIN/props IMGPATH IMG_PLACEHOLDER $BIMGPATH

View File

@ -1,7 +1,7 @@
id=MagiskHidePropsConf id=MagiskHidePropsConf
name=MagiskHide Props Config name=MagiskHide Props Config
version=v2.1.2-v10 version=v2.1.3-v10
versionCode=8 versionCode=9
author=Didgeridoohan author=Didgeridoohan
description=Change your device's fingerprint, to pass SafetyNet's CTS Profile check. Edit prop files for better root hiding. Set/reset prop values set by MagiskHide. Change any prop values easily. description=Change your device's fingerprint, to pass SafetyNet's CTS Profile check. Edit prop files for better root hiding. Set/reset prop values set by MagiskHide. Change any prop values easily.
minMagisk=1500 minMagisk=1500

Binary file not shown.