Update to v6.0.2-v132

This commit is contained in:
Didgeridoohan 2021-09-06 19:19:37 +02:00 committed by GitHub
parent 78b998d4fc
commit b022128ffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 195 additions and 237 deletions

View File

@ -290,12 +290,12 @@ You can enter the fingerprint manually in the `Edit device fingerprint` menu in
## Force BASIC key attestation ## Force BASIC key attestation
Google now enforces the use of hardware backed key attestation on devices that has the necessary hardware (all devices that shipped with Android 8+ and even some older devices). Up until mid January 2021 you could work around this by changing the model props to something other than the actual device. This might still be necessary, and can be done with this feature of the module, but you most likely also need to trick keystore further than that. Google now enforces the use of hardware backed key attestation on devices that has the necessary hardware (all devices that shipped with Android 8+ and even some older devices).This can be circumvented by tricking the device into not using the hardware attestation, and it might also be needed to change the prop models (`ro.product.model`) to something other than your devices actual model. This feature can help with that.
@kdrag0n over on XDA Developers have a Magsk module that will trick keystore into thinking that the hardware isn't available and this will then force basic attestation. You can find that module together with details on how it works here: @kdrag0n over on XDA Developers have a Magsk module that will trick keystore into thinking that the hardware isn't available and this will then force basic attestation. You can find that module together with details on how it works here:
https://forum.xda-developers.com/t/magisk-module-universal-safetynet-fix-1-1-0.4217823/ https://forum.xda-developers.com/t/magisk-module-universal-safetynet-fix-1-1-0.4217823/
These two things in combination might be required to pass CTS. The Universal SafetyNet fix not only trickes the keystore into using basic attestation, from v2.1.0 it also changes prop values that might be necessary to trick Google Play Services into letting you pass the CTS profile check, so if you're using that module you most likely will not need to use the Force BASIC key attestation feature of this module.
If you aren't successful in passing CTS by changing the model, you could try using the Xposed (although it is recommended to use LSPosed if you want to have the best chance of passing SafetyNet) module XprivacyLua and restrict Google Play Services. Instructions on how to install LSPosed and XprivacyLua and how to use that module can be found with a simple web search, I won't cover that here. If you aren't successful in passing CTS by changing the model, you could try using the Xposed (although it is recommended to use LSPosed if you want to have the best chance of passing SafetyNet) module XprivacyLua and restrict Google Play Services. Instructions on how to install LSPosed and XprivacyLua and how to use that module can be found with a simple web search, I won't cover that here.
@ -355,7 +355,7 @@ The props in question are:
- ro.vendor.warranty_bit - ro.vendor.warranty_bit
- vendor.boot.vbmeta.device_state - vendor.boot.vbmeta.device_state
There are a few props that will only change if a triggering value is detected, and these are: There are a few props that will only change if a triggering value is detected, and these are (these will always be set in the post-fs-data boot stage):
- ro.bootmode - ro.bootmode
- ro.boot.mode - ro.boot.mode
- vendor.boot.mode - vendor.boot.mode
@ -614,6 +614,12 @@ Releases from v5.4.0 will only install on Magisk v20.4+.
## Changelog ## Changelog
### v6.0.2
- Fix problems when trying to disable/enable sensitive props.
- Fix typo when checking for triggering prop values (meant that props wouldn't set properly during boot).
- Fix UI info for if a sensitive prop has been set by the module or not.
- More optimisations of the new code (but it's by no means optimised).
### v6.0.1 ### v6.0.1
- Quickfix update to make the soft reboot when setting props in the late_start service boot stage an option. It has the potential for causing issues it seems (mainly on Samsung devices apparently). See the documentation for details. - Quickfix update to make the soft reboot when setting props in the late_start service boot stage an option. It has the potential for causing issues it seems (mainly on Samsung devices apparently). See the documentation for details.
- Minor UI fixes and optimisations. - Minor UI fixes and optimisations.

View File

@ -38,25 +38,25 @@ CONFPARTPROPS=true
CONFSIMBOOT=default CONFSIMBOOT=default
# MagiskHide sensitive props # MagiskHide sensitive props
CONFDEBUGGABLE="" CONFDEBUGGABLE=true
CONFSECURE="" CONFSECURE=true
CONFTYPE="" CONFTYPE=true
CONFTAGS="" CONFTAGS=true
CONFBOOTMODE="" CONFBOOTMODE=true
CONFMODE="" CONFMODE=true
CONFVENDORMODE="" CONFVENDORMODE=true
CONFHWC="" CONFHWC=true
CONFHWCOUNTRY="" CONFHWCOUNTRY=true
CONFSTATE="" CONFSTATE=true
CONFVERIFIEDBOOTSTATE="" CONFVERIFIEDBOOTSTATE=true
CONFVENDORVERIFIEDBOOTSTATE="" CONFVENDORVERIFIEDBOOTSTATE=true
CONFLOCKED="" CONFLOCKED=true
CONFVERITYMODE="" CONFVERITYMODE=true
CONFBOOTWARRANTY_BIT="" CONFBOOTWARRANTY_BIT=true
CONFBIT="" CONFBIT=true
CONFVENDORBOOTWARRANTY_BIT="" CONFVENDORBOOTWARRANTY_BIT=true
CONFVENDORWARRANTY_BIT="" CONFVENDORWARRANTY_BIT=true
CONFVENDORDEVICE_STATE="" CONFVENDORDEVICE_STATE=true
# Set custom props # Set custom props
CONFPROPS="" CONFPROPS=""
@ -155,27 +155,12 @@ CONFBACK=false
# post-fs-data or late_start service mode. This is useful if props don't seem to set # post-fs-data or late_start service mode. This is useful if props don't seem to set
# propely or the module's boot script seems to be causing issues during boot. # propely or the module's boot script seems to be causing issues during boot.
# The MagiskHide prop variables can be set as follows # The MagiskHide prop variables, CONFDEBUGGABLE, CONFSECURE, CONFTYPE, CONFBOOTMODE, CONFMODE,
# (note that these props are by default set to the safe value): # CONFVENDORMODE, CONFHWC, CONFHWCOUNTRY, CONFSTATE, CONFVERIFIEDBOOTSTATE, CONFVENDORVERIFIEDBOOTSTATE,
# CONFDEBUGGABLE - 0 or 1 (sensitive value is "1") # CONFLOCKED, CONFVERITYMODE, CONFBOOTWARRANTY_BIT, CONFBIT, CONFVENDORBOOTWARRANTY_BIT,
# CONFSECURE - 0 or 1 (sensitive value is "0") # CONFVENDORWARRANTY_BIT and CONFVENDORDEVICE_STATE can be either enabled or disabled (enabled by default).
# CONFTYPE - user or userdebug (sensitive value is "userdebug") # If set to true, these props will be changed known safe values if found to contain sensitive values.
# CONFTAGS - release-keys or test-keys (sensitive value is "test-keys") # Helps with hiding root.
# CONFBOOTMODE - unknown or recovery (sensitive value is "recovery")
# CONFMODE - unknown or recovery (sensitive value is "recovery")
# CONFVENDORMODE - unknown or recovery (sensitive value is "recovery")
# CONFHWC - GLOBAL or CN (sensitive value is CN)
# CONFHWCOUNTRY - GLOBAL or China (sensitive value is China)
# CONFSTATE - locked or unlocked (sensitive value is unlocked)
# CONFVERIFIEDBOOTSTATE - green or orange (sensitive value is orange)
# CONFVENDORVERIFIEDBOOTSTATE - green or orange (sensitive value is orange)
# CONFLOCKED - 1 or 0 (sensitive value is 0)
# CONFVERITYMODE - enforcing or permissive (sensitive value is permissive)
# CONFBOOTWARRANTY_BIT - 0 or 1 (sensitive value is "1")
# CONFBIT - 0 or 1 (sensitive value is "1")
# CONFVENDORBOOTWARRANTY_BIT - 0 or 1 (sensitive value is "1")
# CONFVENDORWARRANTY_BIT - 0 or 1 (sensitive value is "1")
# CONFVENDORDEVICE_STATE - locked or unlocked (sensitive value is unlocked)
# CONFPROPS should contain any custom props and the value you want the module to set. # CONFPROPS should contain any custom props and the value you want the module to set.
# Any props you've previously edited in build.prop, and more, can be set like this. # Any props you've previously edited in build.prop, and more, can be set like this.

View File

@ -8,9 +8,9 @@
# In that case, feel free to delete it. # In that case, feel free to delete it.
# Script version # Script version
SCRIPTV=39 SCRIPTV=40
SETTRANSF=4 SETTRANSF=5
NOTTRANSF="PROPCOUNT;PROPEDIT;REDEBUGGABLE;RESECURE;RETYPE;RETAGS;REBOOTMODE;REMODE" NOTTRANSF="PROPCOUNT;PROPEDIT;REDEBUGGABLE;RESECURE;RETYPE;RETAGS;REBOOTMODE;REMODE;REVENDORMODE;REHWC;REHWCOUNTRY;RESTATE;REVERIFIEDBOOTSTATE;REVENDORVERIFIEDBOOTSTATE;RELOCKED;REVERITYMODE;REBOOTWARRANTY_BIT;REBIT;REVENDORBOOTWARRANTY_BIT;REVENDORWARRANTY_BIT;REVENDORDEVICE_STATE"
# Fingerprint # Fingerprint
FINGERPRINTENB=1 FINGERPRINTENB=1
@ -43,6 +43,26 @@ PARTPROPSSET=1
PROPCOUNT=19 PROPCOUNT=19
PROPEDIT=1 PROPEDIT=1
PROPBOOT=0 PROPBOOT=0
# Control variables
REDEBUGGABLE=1
RESECURE=1
RETYPE=1
RETAGS=1
REBOOTMODE=1
REMODE=1
REVENDORMODE=1
REHWC=1
REHWCOUNTRY=1
RESTATE=1
REVERIFIEDBOOTSTATE=1
REVENDORVERIFIEDBOOTSTATE=1
RELOCKED=1
REVERITYMODE=1
REBOOTWARRANTY_BIT=1
REBIT=1
REVENDORBOOTWARRANTY_BIT=1
REVENDORWARRANTY_BIT=1
REVENDORDEVICE_STATE=1
# Custom props # Custom props
CUSTOMEDIT=0 CUSTOMEDIT=0
@ -156,24 +176,3 @@ CUSTOMPROPSLIST="$CUSTOMPROPS $CUSTOMPROPSPOST $CUSTOMPROPSLATE $CUSTOMPROPSDELA
# ---Delete prop values--- # ---Delete prop values---
DELETEPROPS="" DELETEPROPS=""
# ---MagiskHide sensitive props---
REDEBUGGABLE=true
RESECURE=true
RETYPE=true
RETAGS=true
REBOOTMODE=true
REMODE=true
REVENDORMODE=true
REHWC=true
REHWCOUNTRY=true
RESTATE=true
REVERIFIEDBOOTSTATE=true
REVENDORVERIFIEDBOOTSTATE=true
RELOCKED=true
REVERITYMODE=true
REBOOTWARRANTY_BIT=true
REBIT=true
REVENDORBOOTWARRANTY_BIT=true
REVENDORWARRANTY_BIT=true
REVENDORDEVICE_STATE=true

View File

@ -1,4 +1,4 @@
#!/system/bin/sh #!/system/bin/sh
# MagiskHide Props Config # MagiskHide Props Config
# Copyright (c) 2018-2021 Didgeridoohan @ XDA Developers # Copyright (c) 2018-2021 Didgeridoohan @ XDA Developers
@ -73,6 +73,25 @@ if [ "$INSTFN" ]; then
PROPCOUNT PROPCOUNT
PROPEDIT PROPEDIT
PROPBOOT PROPBOOT
REDEBUGGABLE
RESECURE
RETYPE
RETAGS
REBOOTMODE
REMODE
REVENDORMODE
REHWC
REHWCOUNTRY
RESTATE
REVERIFIEDBOOTSTATE
REVENDORVERIFIEDBOOTSTATE
RELOCKED
REVERITYMODE
REBOOTWARRANTY_BIT
REBIT
REVENDORBOOTWARRANTY_BIT
REVENDORWARRANTY_BIT
REVENDORDEVICE_STATE
CUSTOMEDIT CUSTOMEDIT
DELEDIT DELEDIT
PRINTSTAGE PRINTSTAGE
@ -231,23 +250,6 @@ ro.vendor.warranty_bit
vendor.boot.vbmeta.device_state vendor.boot.vbmeta.device_state
" "
# Safe values
SAFELIST="
ro.debuggable=0
ro.secure=1
ro.build.type=user
ro.build.tags=release-keys
ro.boot.vbmeta.device_state=locked
ro.boot.verifiedbootstate=green
ro.boot.flash.locked=1
ro.boot.veritymode=enforcing
ro.boot.warranty_bit=0
ro.warranty_bit=0
ro.vendor.boot.warranty_bit=0
ro.vendor.warranty_bit=0
vendor.boot.vbmeta.device_state=locked
"
# Trigger props # Trigger props
TRIGGERPROPS=" TRIGGERPROPS="
ro.bootmode ro.bootmode
@ -257,15 +259,6 @@ ro.boot.hwc
ro.boot.hwcountry ro.boot.hwcountry
" "
# Safe values
TRIGGERSAFELIST="
ro.bootmode=unknown
ro.boot.mode=unknown
vendor.boot.mode=unknown
ro.boot.hwc=GLOBAL
ro.boot.hwcountry=GLOBAL
"
# Triggering values # Triggering values
TRIGGERLIST=" TRIGGERLIST="
ro.bootmode=recovery ro.bootmode=recovery
@ -280,11 +273,6 @@ LATEPROPS="
vendor.boot.verifiedbootstate vendor.boot.verifiedbootstate
" "
# Safe value
LATESAFELIST="
vendor.boot.verifiedbootstate=green
"
# Partitions used for different props # Partitions used for different props
PARTITIONS=" PARTITIONS="
system system
@ -776,7 +764,7 @@ config_file() {
change_print "$PROPTYPE" "$TMPPROP" "file" change_print "$PROPTYPE" "$TMPPROP" "file"
fi fi
else else
change_prop "$PROPTYPE" "$TMPPROP" "file" change_prop "$PROPTYPE" "file"
fi fi
fi fi
else else
@ -1093,7 +1081,7 @@ system_prop() {
fi fi
echo -e "# This file will be read by resetprop\n# MagiskHide Props Config\n# Copyright (c) 2018-2021 Didgeridoohan @ XDA Developers\n# Licence: MIT" > $MODPATH/system.prop echo -e "# This file will be read by resetprop\n# MagiskHide Props Config\n# Copyright (c) 2018-2021 Didgeridoohan @ XDA Developers\n# Licence: MIT" > $MODPATH/system.prop
if [ "$PROPEDIT" == 1 ] && [ "$PROPBOOT" == 0 ]; then if [ "$PROPEDIT" == 1 ] && [ "$PROPBOOT" == 0 ]; then
sensitive_props "$PROPSLIST" "$SAFELIST" "$MODPATH/system.prop" sensitive_props "$PROPSLIST" "$MODPATH/system.prop"
fi fi
if [ "$OPTIONBOOT" == 0 ] && [ "$PRINTSTAGE" == 0 ]; then if [ "$OPTIONBOOT" == 0 ] && [ "$PRINTSTAGE" == 0 ]; then
print_edit "$MODPATH/system.prop" print_edit "$MODPATH/system.prop"
@ -1155,7 +1143,7 @@ settings_placement() {
if [ "$FILEV" == 0 ]; then if [ "$FILEV" == 0 ]; then
log_print "- Placing settings file" log_print "- Placing settings file"
# Updated file with a required clearing of settings # Updated file with a required clearing of settings
elif [ "$UPDATETRANSF" -gt "$FILETRANSF" ] && [ ! "$NOTTRANSF" ]; then elif [ "$UPDATETRANSF" -gt "$FILETRANSF" ] && [ -z "$NOTTRANSF" ]; then
log_handler "Current transfer version - ${FILETRANSF}" log_handler "Current transfer version - ${FILETRANSF}"
log_handler "Update transfer version - ${UPDATETRANSF}" log_handler "Update transfer version - ${UPDATETRANSF}"
log_handler "No settings set to not transfer" log_handler "No settings set to not transfer"
@ -2017,18 +2005,22 @@ change_sim_partprops() {
} }
# ======================== MagiskHide Props functions ======================== # ======================== MagiskHide Props functions ========================
# Populate menu, $1=List of props to go through (with safe values), $2=type of list, $3=check if menu items should be printed or only counted # Populate menu, $1=List of props to go through, $2=type of list, $3=check if menu items should be printed or only counted
magiskhide_props_menu() { magiskhide_props_menu() {
CHKCOUNT=true CHKCOUNT=true
if [ "$3" == "count" ] && [ "$PROPEDIT" == 0 ]; then if [ "$3" == "count" ] && [ "$PROPEDIT" == 0 ]; then
CHKCOUNT=false CHKCOUNT=false
fi fi
if [ "$CHKCOUNT" == "true" ]; then if [ "$CHKCOUNT" == "true" ]; then
ACTIVE="${G} (active)${N}" ACTIVETXT="${G} (active)${N}"
ENABLEDTXT="${G} (enabled, not active)${N}"
for ITEM in $1; do for ITEM in $1; do
PROP=$(get_prop_type $(get_eq_left "$ITEM")) PROP=$(get_prop_type $ITEM)
REVALUE=$(eval "echo \$$(echo "RE${PROP}" | tr '[:lower:]' '[:upper:]')")
CURRVALUE=$(eval "echo \$$(echo "CURR${PROP}" | tr '[:lower:]' '[:upper:]')")
ORIGVALUE=$(eval "echo \$$(echo "ORIG${PROP}" | tr '[:lower:]' '[:upper:]')") ORIGVALUE=$(eval "echo \$$(echo "ORIG${PROP}" | tr '[:lower:]' '[:upper:]')")
if [ "$ORIGVALUE" ] && [ "$(get_eq_right "$ITEM")" != "$ORIGVALUE" ]; then MODULEVALUE=$(eval "echo \$$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]')")
if [ "$ORIGVALUE" ] && [ "$MODULEVALUE" != "$ORIGVALUE" ]; then
CTRLTRIGG=false; CTRLTRIGG=false;
if [ "$2" == "trigger" ]; then if [ "$2" == "trigger" ]; then
magiskhide_trigger "$ITEM" magiskhide_trigger "$ITEM"
@ -2037,21 +2029,28 @@ magiskhide_props_menu() {
if [ "$ITEMCOUNT" == 0 ]; then if [ "$ITEMCOUNT" == 0 ]; then
ITEMCOUNT=1 ITEMCOUNT=1
fi fi
TMPTXT=""
if [ "$2" == "late" ]; then
TMPTXT=" ${C}(Late prop)${N}"
elif [ "$2" == "trigger" ]; then
TMPTXT=" ${C}(Trigger prop)${N}"
fi
if [ "$(eval "echo \$$(echo "RE${PROP}" | tr '[:lower:]' '[:upper:]')")" == "true" ]; then
if [ "$TMPTXT" ]; then
TMPTXT=$TMPTXT$ACTIVE
else
TMPTXT=$ACTIVE
fi
fi
if [ "$3" != "count" ]; then if [ "$3" != "count" ]; then
echo -e "${G}$ITEMCOUNT${N} - $(get_eq_left "$ITEM")$TMPTXT" TMPTXT=""
if [ "$2" == "late" ]; then
TMPTXT=" ${C}(Late prop)${N}"
elif [ "$2" == "trigger" ]; then
TMPTXT=" ${C}(Trigger prop)${N}"
fi
if [ "$REVALUE" == 1 ] && [ "$CURRVALUE" != "$ORIGVALUE" ] && [ "$CURRVALUE" == "$MODULEVALUE" ]; then
if [ "$TMPTXT" ]; then
TMPTXT=$TMPTXT$ACTIVETXT
else
TMPTXT=$ACTIVETXT
fi
elif [ "$REVALUE" == 1 ]; then
if [ "$TMPTXT" ]; then
TMPTXT=$TMPTXT$ENABLEDTXT
else
TMPTXT=$ENABLEDTXT
fi
ENABLEDCOUNT=$(($ENABLEDCOUNT+1))
fi
echo -e "${G}$ITEMCOUNT${N} - ${ITEM}${TMPTXT}"
fi fi
ITEMCOUNT=$(($ITEMCOUNT+1)) ITEMCOUNT=$(($ITEMCOUNT+1))
fi fi
@ -2060,46 +2059,39 @@ magiskhide_props_menu() {
fi fi
} }
# Set sensitive props, $1=List to get props from, $2=List of safe values, $3=Set to "late" if set in late stage, or file name if saving values to a prop file # Set sensitive props, $1=List to get props from, $2=Set to "late" if set in late stage, or file name if saving values to a prop file
sensitive_props() { sensitive_props() {
if [ "$3" == "late" ]; then if [ "$2" == "late" ]; then
log_handler "Changing sensitive props, late" log_handler "Changing sensitive props, late"
else else
log_handler "Changing sensitive props" log_handler "Changing sensitive props"
fi fi
for ITEM in $1; do for ITEM in $1; do
PROP=$(get_prop_type $ITEM) PROP=$(get_prop_type $ITEM)
REPROP=$(echo "RE${PROP}" | tr '[:lower:]' '[:upper:]') REVALUE=$(eval "echo \$$(echo "RE${PROP}" | tr '[:lower:]' '[:upper:]')")
ORIGPROP=$(echo "ORIG${PROP}" | tr '[:lower:]' '[:upper:]') ORIGVALUE=$(eval "echo \$$(echo "ORIG${PROP}" | tr '[:lower:]' '[:upper:]')")
MODULEPROP=$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]') MODULEVALUE=$(eval "echo \$$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]')")
REVALUE=$(eval "echo \$$REPROP") if [ "$REVALUE" == 1 ] && [ "$ORIGVALUE" ]; then
ORIGVALUE=$(eval "echo \$$ORIGPROP")
MODULEVALUE=$(eval "echo \$$MODULEPROP")
if [ "$REVALUE" == "true" ] && [ "$ORIGVALUE" ]; then
CTRLTRIGG=false; CTRLTRIGG=false;
magiskhide_trigger "$ITEM" magiskhide_trigger "$ITEM"
if [ "$CTRLTRIGG" == "true" ]; then if [ "$CTRLTRIGG" == "false" ]; then
for CTRL in $2; do if [ "$MODULEVALUE" == "$ORIGVALUE" ]; then
if [ "$(get_eq_left "$CTRL")" == "$ITEM" ]; then log_handler "Skipping $ITEM, already set to the safe value ($MODULEVALUE)."
if [ "$(get_eq_right "$CTRL")" == "$ORIGVALUE" ]; then else
log_handler "Skipping $ITEM, already set to the safe value." log_handler "Changing/writing $ITEM."
else if [ "$2" ] && [ "$2" != "late" ]; then
log_handler "Changing/writing $ITEM." echo "${ITEM}=$MODULEVALUE" >> $2
if [ "$3" ] && [ "$3" != "late" ]; then else
echo "${ITEM}=$MODULEVALUE" >> $3 resetprop -nv $ITEM "$MODULEVALUE" >> $LOGFILE 2>&1
else if [ "$BOOTSTAGE" == "late" ] && [ "$PROPSOFTBOOT" = 1 ]; then
resetprop -nv $ITEM "$MODULEVALUE" >> $LOGFILE 2>&1 PROPLATE=true
if [ "$BOOTSTAGE" == "late" ] && [ "$PROPSOFTBOOT" = 1 ]; then
PROPLATE=true
fi
fi
fi fi
fi fi
done fi
else else
log_handler "Skipping $ITEM, it is not set to a triggering value." log_handler "Skipping $ITEM, it is not set to a triggering value (set to $ORIGVALUE)."
fi fi
elif [ "$REVALUE" == "true" ] && [ -z "$ORIGVALUE" ]; then elif [ "$REVALUE" == 1 ] && [ -z "$ORIGVALUE" ]; then
log_handler "Skipping $ITEM, does not exist on device." log_handler "Skipping $ITEM, does not exist on device."
else else
log_handler "Skipping $ITEM, not set to change." log_handler "Skipping $ITEM, not set to change."
@ -2110,8 +2102,9 @@ sensitive_props() {
# Check if trigger prop, $1=prop to check # Check if trigger prop, $1=prop to check
magiskhide_trigger() { magiskhide_trigger() {
for TRIGG in $TRIGGERLIST; do for TRIGG in $TRIGGERLIST; do
if [ "$(get_eq_left "$TRIGG")" == "$(get_eq_left "$1")" ]; then if [ "$(get_eq_left "$TRIGG")" == "$1" ]; then
if [ "$(get_eq_right "$TRIGG")" != "$ORIGVALUE" ]; then TRIGGVALUE=$(get_eq_right "$TRIGG")
if [ "$TRIGGVALUE" != "$ORIGVALUE" ]; then
CTRLTRIGG=true; CTRLTRIGG=true;
fi fi
break break
@ -2123,9 +2116,10 @@ magiskhide_trigger() {
safe_props() { safe_props() {
SAFE="" SAFE=""
if [ "$2" ]; then if [ "$2" ]; then
for P in $SAFELIST$TRIGGERSAFELIST$LATESAFELIST; do for P in $PROPSLIST$TRIGGERPROPS$LATEPROPS; do
if [ "$(get_eq_left "$P")" == "$1" ]; then MODULEVALUE=$(eval "echo \$$(echo "MODULE$(get_prop_type $ITEM)" | tr '[:lower:]' '[:upper:]')")
if [ "$2" == "$(get_eq_right "$P")" ]; then if [ "$P" == "$1" ]; then
if [ "$2" == "$MODULEVALUE" ]; then
SAFE=1 SAFE=1
else else
SAFE=0 SAFE=0
@ -2138,12 +2132,13 @@ safe_props() {
# Find what prop value to change to, $1=header, $2=Currently set prop value # Find what prop value to change to, $1=header, $2=Currently set prop value
change_to() { change_to() {
for CHPROP in $SAFELIST$TRIGGERSAFELIST$LATESAFELIST; do for CHPROP in $PROPSLIST$TRIGGERPROPS$LATEPROPS; do
if [ "$(get_eq_left "$CHPROP")" == "$1" ]; then MODULEVALUE=$(eval "echo \$$(echo "MODULE$(get_prop_type $CHPROP)" | tr '[:lower:]' '[:upper:]')")
if [ "$2" != "$(get_eq_right "$CHPROP")" ]; then if [ "$CHPROP" == "$1" ]; then
CHANGE=$(get_eq_right "$CHPROP") if [ "$2" != "$MODULEVALUE" ]; then
CHANGE=$MODULEVALUE
else else
CHANGE=$(eval "echo \$$(echo "ORIG$(get_prop_type $(get_eq_left "$CHPROP"))" | tr '[:lower:]' '[:upper:]')") CHANGE=$(eval "echo \$$(echo "ORIG$(get_prop_type $CHPROP)" | tr '[:lower:]' '[:upper:]')")
fi fi
break break
fi fi
@ -2155,24 +2150,17 @@ reset_prop() {
before_change before_change
# Sets variables # Sets variables
PROP=$(get_prop_type $1) REPROP=$(echo "RE$(get_prop_type $1)" | tr '[:lower:]' '[:upper:]')
MODULEPROP=$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]')
REPROP=$(echo "RE${PROP}" | tr '[:lower:]' '[:upper:]')
SUBA=$(get_file_value $LATEFILE "${MODULEPROP}=")
log_handler "Resetting $1 to default system value." log_handler "Resetting $1 to default system value."
# Saves new module value
replace_fn $MODULEPROP "\"$SUBA\"" "\"\"" $LATEFILE
# Changes prop # Changes prop
replace_fn $REPROP "true" "false" $LATEFILE replace_fn $REPROP 1 0 $LATEFILE
# Updates prop change variable in propsconf_late # Updates prop change variables in propsconf_late
if [ "$SUBA" ]; then if [ "$PROPCOUNT" -gt 0 ]; then
if [ "$PROPCOUNT" -gt 0 ]; then PROPCOUNTP=$(($PROPCOUNT-1))
PROPCOUNTP=$(($PROPCOUNT-1)) replace_fn PROPCOUNT $PROPCOUNT $PROPCOUNTP $LATEFILE
replace_fn PROPCOUNT $PROPCOUNT $PROPCOUNTP $LATEFILE
fi
fi fi
if [ "$PROPCOUNTP" == 0 ]; then if [ "$PROPCOUNTP" == 0 ]; then
replace_fn PROPEDIT 1 0 $LATEFILE replace_fn PROPEDIT 1 0 $LATEFILE
@ -2183,32 +2171,25 @@ reset_prop() {
fi fi
} }
# Use prop value, $1=prop name, $2=new prop value, $3=run option # Use prop value, $1=prop name, $3=run option
change_prop() { change_prop() {
before_change before_change
# Sets variables # Sets variables
PROP=$(get_prop_type $1) REPROP=$(echo "RE$(get_prop_type $1)" | tr '[:lower:]' '[:upper:]')
MODULEPROP=$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]')
REPROP=$(echo "RE${PROP}" | tr '[:lower:]' '[:upper:]')
SUBA=$(get_file_value $LATEFILE "${MODULEPROP}=")
log_handler "Changing $1 to $2." log_handler "Changing $1 to safe value."
# Saves new module value
replace_fn $MODULEPROP "\"$SUBA\"" "\"$2\"" $LATEFILE
# Changes prop # Changes prop
replace_fn $REPROP "false" "true" $LATEFILE replace_fn $REPROP 0 1 $LATEFILE
# Updates prop change variables in propsconf_late # Updates prop change variables in propsconf_late
if [ -z "$SUBA" ]; then PROPCOUNTP=$(($PROPCOUNT+1))
PROPCOUNTP=$(($PROPCOUNT+1)) replace_fn PROPCOUNT $PROPCOUNT $PROPCOUNTP $LATEFILE
replace_fn PROPCOUNT $PROPCOUNT $PROPCOUNTP $LATEFILE
fi
replace_fn PROPEDIT 0 1 $LATEFILE replace_fn PROPEDIT 0 1 $LATEFILE
if [ "$3" != "none" ]; then if [ "$2" != "none" ]; then
after_change "$1" "$3" after_change "$1" "$2"
fi fi
} }
@ -2219,15 +2200,10 @@ reset_prop_all() {
log_handler "Resetting all props to default values." log_handler "Resetting all props to default values."
for PROPTYPE in $PROPSLIST$TRIGGERPROPS$LATEPROPS; do for PROPTYPE in $PROPSLIST$TRIGGERPROPS$LATEPROPS; do
PROP=$(get_prop_type $PROPTYPE) REPROP=$(echo "RE$(get_prop_type $PROPTYPE)" | tr '[:lower:]' '[:upper:]')
MODULEPROP=$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]')
REPROP=$(echo "RE${PROP}" | tr '[:lower:]' '[:upper:]')
SUBA=$(get_file_value $LATEFILE "${MODULEPROP}=")
# Saves new module value
replace_fn $MODULEPROP "\"$SUBA\"" "\"\"" $LATEFILE
# Changes prop # Changes prop
replace_fn $REPROP "true" "false" $LATEFILE replace_fn $REPROP 1 0 $LATEFILE
done done
# Updates prop change variables in propsconf_late # Updates prop change variables in propsconf_late
@ -2513,25 +2489,25 @@ export_settings() {
replace_fn CONFPARTPROPS true $([ $PARTPROPSSET == 0 ] && echo "false" || echo "true") $EXPORTFILE replace_fn CONFPARTPROPS true $([ $PARTPROPSSET == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFSIMBOOT default $([ $SIMSTAGE == 0 ] && echo "default" || $([ $PRINTSTAGE == 1 ] && echo "post" || echo "late")) $EXPORTFILE replace_fn CONFSIMBOOT default $([ $SIMSTAGE == 0 ] && echo "default" || $([ $PRINTSTAGE == 1 ] && echo "post" || echo "late")) $EXPORTFILE
# MagiskHide sensitive props # MagiskHide sensitive props
replace_fn CONFDEBUGGABLE "\"\"" "\"$MODULEDEBUGGABLE\"" $EXPORTFILE replace_fn CONFDEBUGGABLE true $([ $REDEBUGGABLE == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFSECURE "\"\"" "\"$MODULESECURE\"" $EXPORTFILE replace_fn CONFSECURE true $([ $RESECURE == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFTYPE "\"\"" "\"$MODULETYPE\"" $EXPORTFILE replace_fn CONFTYPE true $([ $RETYPE == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFTAGS "\"\"" "\"$MODULETAGS\"" $EXPORTFILE replace_fn CONFTAGS true $([ $RETAGS == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFBOOTMODE "\"\"" "\"$MODULEBOOTMODE\"" $EXPORTFILE replace_fn CONFBOOTMODE true $([ $REBOOTMODE == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFMODE "\"\"" "\"$MODULEMODE\"" $EXPORTFILE replace_fn CONFMODE true $([ $REMODE == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFVENDORMODE "\"\"" "\"$MODULEVENDORMODE\"" $EXPORTFILE replace_fn CONFVENDORMODE true $([ $REVENDORMODE == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFHWC "\"\"" "\"$MODULEHWC\"" $EXPORTFILE replace_fn CONFHWC true $([ $REHWC == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFHWCOUNTRY "\"\"" "\"$MODULEHWCOUNTRY\"" $EXPORTFILE replace_fn CONFHWCOUNTRY true $([ $REHWCOUNTRY == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFDEVICE_STATE "\"\"" "\"$MODULEDEVICE_STATE\"" $EXPORTFILE replace_fn CONFSTATE true $([ $RESTATE == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFVERIFIEDBOOTSTATE "\"\"" "\"$MODULEVERIFIEDBOOTSTATE\"" $EXPORTFILE replace_fn CONFVERIFIEDBOOTSTATE true $([ $REVERIFIEDBOOTSTATE == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFVENDORVERIFIEDBOOTSTATE "\"\"" "\"$MODULEVENDORVERIFIEDBOOTSTATE\"" $EXPORTFILE replace_fn CONFVENDORVERIFIEDBOOTSTATE true $([ $REVENDORVERIFIEDBOOTSTATE == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFLOCKED "\"\"" "\"$MODULELOCKED\"" $EXPORTFILE replace_fn CONFLOCKED true $([ $RELOCKED == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFVERITYMODE "\"\"" "\"$MODULEVERITYMODE\"" $EXPORTFILE replace_fn CONFVERITYMODE true $([ $REVERITYMODE == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFBOOTWARRANTY_BIT "\"\"" "\"$MODULEBOOTWARRANTY_BIT\"" $EXPORTFILE replace_fn CONFBOOTWARRANTY_BIT true $([ $REBOOTWARRANTY_BIT == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFWARRANTY_BIT "\"\"" "\"$MODULEWARRANTY_BIT\"" $EXPORTFILE replace_fn CONFBIT true $([ $REBIT == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFVENDORBOOTWARRANTY_BIT "\"\"" "\"$MODULEVENDORBOOTWARRANTY_BIT\"" $EXPORTFILE replace_fn CONFVENDORBOOTWARRANTY_BIT true $([ $REVENDORBOOTWARRANTY_BIT == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFVENDORWARRANTY_BIT "\"\"" "\"$MODULEVENDORWARRANTY_BIT\"" $EXPORTFILE replace_fn CONFVENDORWARRANTY_BIT true $([ $REVENDORWARRANTY_BIT == 0 ] && echo "false" || echo "true") $EXPORTFILE
replace_fn CONFVENDORDEVICE_STATE "\"\"" "\"$MODULEVENDORDEVICE_STATE\"" $EXPORTFILE replace_fn CONFVENDORDEVICE_STATE true $([ $REVENDORDEVICE_STATE == 0 ] && echo "false" || echo "true") $EXPORTFILE
# Custom props # Custom props
replace_fn CONFPROPS "\"\"" "\"$CUSTOMPROPS\"" $EXPORTFILE replace_fn CONFPROPS "\"\"" "\"$CUSTOMPROPS\"" $EXPORTFILE
replace_fn CONFPROPSPOST "\"\"" "\"$CUSTOMPROPSPOST\"" $EXPORTFILE replace_fn CONFPROPSPOST "\"\"" "\"$CUSTOMPROPSPOST\"" $EXPORTFILE

View File

@ -15,6 +15,11 @@ ui_print " Installing $MODVERSION "
ui_print "************************" ui_print "************************"
ui_print "" ui_print ""
# Remove module directory if it exists on a fresh install
if [ ! -d "$MODULESPATH/MagiskHidePropsConf"] && [ -d "$MHPCPATH" ]; then
rm -rf $MHPCPATH
fi
# Create module directory # Create module directory
mkdir -pv $MHPCPATH mkdir -pv $MHPCPATH

View File

@ -1,6 +1,6 @@
id=MagiskHidePropsConf id=MagiskHidePropsConf
name=MagiskHide Props Config name=MagiskHide Props Config
version=v6.0.1-v132 version=v6.0.2-v132
versionCode=71 versionCode=72
author=Didgeridoohan author=Didgeridoohan
description=Change your device's fingerprint, to pass SafetyNet's CTS Profile check. Set/reset MagiskHide sensitive prop values. Change any prop values easily, and set your own custom props. description=Change your device's fingerprint, to pass SafetyNet's CTS Profile check. Set/reset MagiskHide sensitive prop values. Change any prop values easily, and set your own custom props.

View File

@ -23,15 +23,6 @@
LATEFILEPH=LATE_PLACEHOLDER LATEFILEPH=LATE_PLACEHOLDER
# Sensitive props # Sensitive props
# Safe values
TRIGGERSAFELIST="
ro.bootmode=unknown
ro.boot.mode=unknown
vendor.boot.mode=unknown
ro.boot.hwc=GLOBAL
ro.boot.hwcountry=GLOBAL
"
# Triggering values
TRIGGERLIST=" TRIGGERLIST="
ro.bootmode=recovery ro.bootmode=recovery
ro.boot.mode=recovery ro.boot.mode=recovery
@ -165,24 +156,20 @@
resetprop -v --delete ro.build.selinux >> $LOGFILE 2>&1 resetprop -v --delete ro.build.selinux >> $LOGFILE 2>&1
fi fi
if [ "$PROPEDIT" == 1 ] && [ "$PROPBOOT" == 0 ]; then if [ "$PROPEDIT" == 1 ]; then
# Set trigger props # Set trigger props
for ITEM in $TRIGGERLIST; do for ITEM in $TRIGGERLIST; do
TMPPROP=$(get_eq_left "$ITEM") TMPPROP=$(get_eq_left "$ITEM")
TMPVAL=$(echo $(grep "\[${TMPPROP}\]" "$MHPCPATH/defaultprops") | sed -e "s|.*\]\:\ \[||g;s|\]$||g") TMPVAL=$(echo $(grep "\[${TMPPROP}\]" "$MHPCPATH/defaultprops") | sed -e "s|.*\]\:\ \[||g;s|\]$||g")
REPROP=$(echo "RE$(get_prop_type "$TMPPROP")" | tr '[:lower:]' '[:upper:]') PROP=$(get_prop_type "$TMPPROP")
REVAL=$(get_file_value $LATEFILE "${REPROP}=") REVALUE=$(eval "echo \$$(echo "RE${PROP}" | tr '[:lower:]' '[:upper:]')")
if [ "$REVAL" == "true" ]; then MODULEVALUE=$(eval "echo \$$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]')")
if [ "$REVALUE" == 1 ]; then
if [ "$TMPVAL" == "$(get_eq_right "$ITEM")" ]; then if [ "$TMPVAL" == "$(get_eq_right "$ITEM")" ]; then
log_handler "Changing/writing $TMPPROP." log_handler "Changing/writing $TMPPROP."
for SAFEVAL in $TRIGGERSAFELIST; do resetprop -nv $TMPPROP $MODULEVALUE >> $LOGFILE 2>&1
if [ "$TMPPROP" == "$(get_eq_left "$SAFEVAL")" ]; then
resetprop -nv $(get_eq_left $SAFEVAL) $(get_eq_right $SAFEVAL) >> $LOGFILE 2>&1
break
fi
done
elif [ "$TMPVAL" ]; then elif [ "$TMPVAL" ]; then
log_handler "Skipping $TMPPROP, not set to triggering value." log_handler "Skipping $TMPPROP, not set to triggering value (set to $TMPVAL)."
else else
log_handler "Skipping $TMPPROP, does not exist on device." log_handler "Skipping $TMPPROP, does not exist on device."
fi fi
@ -231,7 +218,7 @@
fi fi
# Edit MagiskHide sensitive props if set for post-fs-data # Edit MagiskHide sensitive props if set for post-fs-data
if [ "$PROPEDIT" == 1 ] && [ "$PROPBOOT" == 1]; then if [ "$PROPEDIT" == 1 ] && [ "$PROPBOOT" == 1]; then
sensitive_props "$PROPSLIST" "$SAFELIST" sensitive_props "$PROPSLIST"
fi fi
# Edit custom props set for post-fs-data # Edit custom props set for post-fs-data
custom_edit "CUSTOMPROPSPOST" custom_edit "CUSTOMPROPSPOST"

View File

@ -109,11 +109,11 @@ fi
if [ "$PROPEDIT" == 1 ]; then if [ "$PROPEDIT" == 1 ]; then
# Edit all sensitive props, if set for late_start service # Edit all sensitive props, if set for late_start service
if [ "$PROPBOOT" == 2]; then if [ "$PROPBOOT" == 2]; then
sensitive_props "$PROPSLIST" "$SAFELIST" sensitive_props "$PROPSLIST"
fi fi
# Edit late senstive props # Edit late senstive props
sensitive_props "$LATEPROPS" "$LATESAFELIST" "late" sensitive_props "$LATEPROPS" "late"
fi fi
# Edit custom props set for late_start service # Edit custom props set for late_start service
@ -127,7 +127,7 @@ if [ "$(getenforce)" == "Permissive" ] || [ "$(getenforce)" == "0" ]; then
chmod 440 /sys/fs/selinux/policy >> $LOGFILE 2>&1 chmod 440 /sys/fs/selinux/policy >> $LOGFILE 2>&1
fi fi
# Do a soft restart if a prop has been set in service.sh # Do a soft restart if the option is active and a prop has been set in service.sh
if [ "$PROPLATE" == "true" ]; then if [ "$PROPLATE" == "true" ]; then
log_handler "Soft rebooting." log_handler "Soft rebooting."
stop stop

Binary file not shown.