MagiskHidePropsConf/common/propsconf_late
Didgeridoohan 27c62203a2
v3.0.0-v42
2019-02-02 13:37:20 +01:00

148 lines
2.7 KiB
Bash

#!/system/bin/sh
# MagiskHide Props Config
# Copyright (c) 2018-2019 Didgeridoohan @ XDA Developers
# Licence: MIT
# This is the settings file for the Magisk module "MagiskHide Props Config" By Didgeridoohan @ XDA Developers.
# DO NOT DELETE!
# Unless: If you don't have the module installed something has gone horribly wrong and this file is an orphan.
# In that case, feel free to delete it.
# Script version
SCRIPTV=22
SETTRANSF=2
NOTTRANSF="OPTIONLATE"
# Variables
COREPATH=CORE_PLACEHOLDER
IMGPATH=$COREPATH/img
MODPATH=$IMGPATH/MagiskHidePropsConf
CACHELOC=CACHE_PLACEHOLDER
LATELOGFILE=$CACHELOC/propsconf_latefile.log
FINGERPRINTENB=1
PRINTMODULE=0
PRINTEDIT=0
PRINTVEND=0
DEVSIM=0
BUILDPROPENB=1
FILESAFE=1
BUILDEDIT=0
DEFAULTEDIT=0
PROPCOUNT=0
PROPEDIT=0
CUSTOMEDIT=0
DELEDIT=0
REBOOTCHK=0
PRINTCHK=0
OPTIONLATE=0
OPTIONCOLOUR=1
OPTIONWEB=1
OPTIONUPDATE=1
BRANDSET=1
NAMESET=1
DEVICESET=1
RELEASESET=1
IDSET=1
INCREMENTALSET=1
DESCRIPTIONSET=1
CACHEFILES="
propsconf_conf
reset_mhpc
"
# ---Original values---
# default.prop
ORIGDEBUGGABLE=""
ORIGSECURE=""
# build.prop
ORIGTYPE=""
ORIGTAGS=""
ORIGSELINUX=""
ORIGFINGERPRINT=""
ORIGVENDPRINT=""
ORIGPATCH=""
ORIGBRAND=""
ORIGNAME=""
ORIGDEVICE=""
ORIGRELEASE=""
ORIGID=""
ORIGINCREMENTAL=""
ORIGDESCRIPTION=""
# ---Module values---
MODULEDEBUGGABLE=""
MODULESECURE=""
MODULETYPE=""
MODULETAGS=""
MODULESELINUX=""
MODULEFINGERPRINT=""
# ---Device simulation values---
SIMBRAND=""
SIMNAME=""
SIMDEVICE=""
SIMRELEASE=""
SIMID=""
SIMINCREMENTAL=""
SIMDESCRIPTION=""
# ---Custom prop values---
CUSTOMPROPS=""
CUSTOMPROPSPOST=""
CUSTOMPROPSLATE=""
# ---Delete prop values---
DELETEPROPS=""
# ---MagiskHide sensitive props---
REDEBUGGABLE=false
RESECURE=false
RETYPE=false
RETAGS=false
RESELINUX=false
# ---Editing default.prop---
SETDEBUGGABLE=false
SETSECURE=false
# ---Editing build.prop---
SETTYPE=false
SETTAGS=false
SETSELINUX=false
SETFINGERPRINT=false
rm -f $LATELOGFILE
# Function to clean up some files after the module has been uninstalled
cleanup() {
echo "Cleaning up files in $CACHELOC." >> $LATELOGFILE 2>&1
for ITEM in $CACHEFILES; do
if [ -f "$CACHELOC/$ITEM" ]; then
echo "Deleting ${ITEM}." >> $LATELOGFILE 2>&1
rm -f $CACHELOC/$ITEM >> $LATELOGFILE 2>&1
fi
done
# Suicide.
echo "Removing script." >> $LATELOGFILE 2>&1
rm -f $0 >> $LATELOGFILE 2>&1
}
# Checks if the module is installed. Deletes itself if it isn't.
if [ -d "$MODPATH" ]; then
# Checks if the module is set for removal
if [ -f "$MODPATH/remove" ]; then
echo "Module set for removal." >> $LATELOGFILE 2>&1
# Cleanup
cleanup
fi
else
echo "$MODPATH not found." >> $LATELOGFILE 2>&1
echo "Module no longer installed." >> $LATELOGFILE 2>&1
# Cleanup
cleanup
fi