2019-02-02 12:37:20 +00:00
|
|
|
#!/system/bin/sh
|
|
|
|
|
|
|
|
# MagiskHide Props Config
|
|
|
|
# Copyright (c) 2018-2019 Didgeridoohan @ XDA Developers
|
|
|
|
# Licence: MIT
|
|
|
|
|
2019-03-27 10:50:00 +00:00
|
|
|
MODPATH=${0%/*}
|
2019-04-02 19:42:29 +00:00
|
|
|
BOOTSTAGE="late"
|
2019-03-27 10:50:00 +00:00
|
|
|
|
2019-02-02 12:37:20 +00:00
|
|
|
# Load functions
|
|
|
|
. $MODPATH/util_functions.sh
|
|
|
|
|
2019-03-27 10:50:00 +00:00
|
|
|
if [ "$OPTIONBOOT" == 1 ]; then
|
2019-02-02 12:37:20 +00:00
|
|
|
until [ ! -f "$POSTCHKFILE" ]; do
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
log_script_chk "Running service.sh module script."
|
|
|
|
|
|
|
|
# Edits prop values if set for late_start service
|
2019-04-02 19:42:29 +00:00
|
|
|
echo -e "\n----------------------------------------" >> $LOGFILE 2>&1
|
2019-02-02 12:37:20 +00:00
|
|
|
log_handler "Editing prop values in late_start service mode."
|
2019-03-27 10:50:00 +00:00
|
|
|
if [ "$OPTIONBOOT" == 2 ]; then
|
2019-02-02 12:37:20 +00:00
|
|
|
# ---Setting/Changing fingerprint---
|
2019-03-27 10:50:00 +00:00
|
|
|
if [ "$PRINTSTAGE" == 0 ]; then
|
|
|
|
print_edit
|
|
|
|
fi
|
2019-04-02 19:42:29 +00:00
|
|
|
# ---Setting/Changing security patch date---
|
|
|
|
if [ "$PATCHSTAGE" == 0 ]; then
|
|
|
|
patch_edit
|
|
|
|
fi
|
2019-02-02 12:37:20 +00:00
|
|
|
# ---Setting device simulation props---
|
2019-03-27 10:50:00 +00:00
|
|
|
if [ "$SIMSTAGE" == 0 ]; then
|
|
|
|
dev_sim_edit
|
|
|
|
fi
|
2019-02-02 12:37:20 +00:00
|
|
|
# ---Setting custom props---
|
|
|
|
custom_edit "CUSTOMPROPS"
|
|
|
|
fi
|
2019-03-27 10:50:00 +00:00
|
|
|
# Edit fingerprint if set for late_start service
|
|
|
|
if [ "$OPTIONBOOT" != 2 ] && [ "$PRINTSTAGE" == 2 ]; then
|
|
|
|
print_edit
|
|
|
|
fi
|
2019-04-02 19:42:29 +00:00
|
|
|
# Edit security patch date if set for late_start service
|
|
|
|
if [ "$OPTIONBOOT" != 2 ] && [ "$PATCHSTAGE" == 2 ]; then
|
|
|
|
patch_edit
|
|
|
|
fi
|
2019-03-27 10:50:00 +00:00
|
|
|
# Edit simulation props if set for late_start service
|
|
|
|
if [ "$OPTIONBOOT" != 2 ] && [ "$SIMSTAGE" == 2 ]; then
|
|
|
|
dev_sim_edit
|
|
|
|
fi
|
2019-02-02 12:37:20 +00:00
|
|
|
# Edit custom props set for late_start service
|
|
|
|
custom_edit "CUSTOMPROPSLATE"
|
|
|
|
# Edit MagiskHide sensitive values
|
|
|
|
if [ "$PROPEDIT" == 1 ]; then
|
|
|
|
log_handler "Changing sensitive props."
|
|
|
|
for ITEM in $PROPSLIST; do
|
|
|
|
PROP=$(get_prop_type $ITEM)
|
|
|
|
REPROP=$(echo "RE${PROP}" | tr '[:lower:]' '[:upper:]')
|
|
|
|
MODULEPROP=$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]')
|
|
|
|
if [ "$(eval "echo \$$REPROP")" == "true" ]; then
|
|
|
|
log_handler "Changing/writing $ITEM."
|
|
|
|
resetprop -nv $ITEM $(eval "echo \$$MODULEPROP") >> $LOGFILE 2>&1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2019-04-02 19:42:29 +00:00
|
|
|
echo -e "\n----------------------------------------" >> $LOGFILE 2>&1
|
2019-02-02 12:37:20 +00:00
|
|
|
|
|
|
|
# ---Edits default.prop---
|
|
|
|
if [ "$DEFAULTEDIT" == 1 ] && [ "$FILESAFE" == 0 ]; then
|
|
|
|
log_handler "Editing default.prop."
|
|
|
|
mount -wo remount rootfs /
|
|
|
|
change_prop_file "default"
|
|
|
|
mount -ro remount rootfs /
|
|
|
|
else
|
|
|
|
log_handler "Default.prop editing disabled."
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Get currently saved values
|
|
|
|
log_handler "Checking current values."
|
|
|
|
curr_values
|
2019-04-02 19:42:29 +00:00
|
|
|
# Check system.prop content
|
|
|
|
system_prop_cont
|
2019-02-02 12:37:20 +00:00
|
|
|
|
|
|
|
log_script_chk "service.sh module script finished.\n\n=================="
|