Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Didgeridoohan authored Apr 25, 2018
1 parent 8d5ded7 commit 9800304
Show file tree
Hide file tree
Showing 9 changed files with 194 additions and 181 deletions.
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ To fix this, you can use a known working fingerprint (one that has been certifie
There are a few pre-configured certified fingerprints available in the module, just in case you can't get a hold of one for your device. If you have a working fingerprint that could be added to the list, or an updated one for one already on there, please post that in the [module support thread](https://forum.xda-developers.com/apps/magisk/module-magiskhide-props-config-simple-t3765199) toghether with device details.

### Finding a certified fingerprint
The easies way to find a certified fingerprint for your device is to run the getprop command below on a stock ROM/firmware/factory image that fully passes SafetyNet.
If you don't want to use one of the provided fingerprints, the easies way to find a certified fingerprint for your device is to run the getprop command below on a stock ROM/firmware/factory image that fully passes SafetyNet.
```
getprop ro.build.fingerprint
```
Expand All @@ -43,13 +43,20 @@ Here's an example:
Google Nexus 6=google/shamu/shamu:7.1.1/N8I11B/4171878:user/release-keys
```

### I still can't pass the ctsProfile check
If you've picked a certified fingerprint from the provided list, or you're using a fingerprint that you know is certified but still can't pass the ctsProfile check, do the following.
- 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.
- Try a different fingerprint from the provided list.
- 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.
- If you can't get things working, make sure to provide logs. See "Logs, etc" below.


## Current fingerprints list version
The fingerprints list will update without the need to update the entire module. Keep an eye on the [module support thread](https://forum.xda-developers.com/apps/magisk/module-magiskhide-props-config-simple-t3765199) for info.

Just run the `props` command and the list will be updated automatically. Use the -nw option to disable or disable it completely in the script settings (see below). If you've disabled the this setting you can update the list manually in the `Edit device fingerprint` menu.

**_Current fingerprints list version - v9_**
**_Current fingerprints list version - v10_**


## Improved root hiding - Editing build.prop and default.prop
Expand Down Expand Up @@ -103,11 +110,11 @@ If you're having issues passing SafetyNet, getting your device certified, or oth
But first: have you tried turning it off and on again? Toggling MagiskHide off and on usually works if MagiskHide has stopped working after an update of Magisk or your ROM.


## 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.

### 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.
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.


## Source
Expand All @@ -120,6 +127,12 @@ In case of issues, please provide the logs, saved in /cache, "magisk.log", "prop


## Changelog
### v2.1.2
- Detects and edits only existing device fingerprint props.
- Slightly optimised the boot scripts.
- New fingerprint (Motorola Moto E4), list v10.
- Minor updates and improvements.

### v2.1.1
- Fixed transferring custom props between module updates.

Expand Down Expand Up @@ -160,7 +173,7 @@ In case of issues, please provide the logs, saved in /cache, "magisk.log", "prop


## Current fingerprints list
### List v9  
### List v10  
- Google Nexus 4 (5.1.1)
- Google Nexus 5 (6.0.1)
- Google Nexus 6 (7.1.1)
Expand All @@ -175,6 +188,7 @@ In case of issues, please provide the logs, saved in /cache, "magisk.log", "prop
- Google Pixel 2 XL (P DP1)
- HTC 10 (6.0.1)
- Huawei Mate 10 Pro (8.0.0)
- Motorola Moto E4 (7.1.1)
- Motorola Moto G4 (7.0)
- Motorola Moto G5 (7.0)
- Motorola Moto G5 Plus (7.0)
Expand Down
88 changes: 25 additions & 63 deletions common/post-fs-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,75 +34,37 @@ log_script_chk "Log start."
if [ ! -f "$LATEFILE" ] || [ -f "$RESETFILE" ]; then
cp -af $MODPATH/propsconf_late $LATEFILE
chmod 755 $LATEFILE
log_handler "Boot script restored/reset (${LATEFILE})."
fi

# Update placeholders
# Image path
placeholder_update $LATEFILE IMGPATH IMG_PLACEHOLDER $IMGPATH
placeholder_update $MODPATH/system/$BIN/props IMGPATH IMG_PLACEHOLDER $IMGPATH

# Check the reboot variable
if [ "$(get_file_value $LATEFILE "REBOOTCHK=")" == 1 ]; then
sed -i 's/REBOOTCHK=1/REBOOTCHK=0/' $LATEFILE
if [ -f "$RESETFILE" ]; then
RSTTXT="reset"
else
RSTTXT="restored"
fi
log_handler "Boot script $RSTTXT (${LATEFILE})."
fi

# Get the current values saved in propsconf_late
orig_values
latefile_values

# Get default file values
# Get default values
file_values

# Save default file values in propsconf_late
sed -i "s/FILEDEBUGGABLE=\"$LATEFILEDEBUGGABLE\"/FILEDEBUGGABLE=\"$FILEDEBUGGABLE\"/" $LATEFILE
sed -i "s/FILESECURE=\"$LATEFILESECURE\"/FILESECURE=\"$FILESECURE\"/" $LATEFILE
sed -i "s/FILETYPE=\"$LATEFILETYPE\"/FILETYPE=\"$FILETYPE\"/" $LATEFILE
sed -i "s/FILETAGS=\"$LATEFILETAGS\"/FILETAGS=\"$FILETAGS\"/" $LATEFILE
sed -i "s/FILESELINUX=\"$LATEFILESELINUX\"/FILESELINUX=\"$FILESELINUX\"/" $LATEFILE
log_handler "Default file values saved to $LATEFILE."

# Get the default prop values
curr_values
replace_fn FILEDEBUGGABLE "\"$LATEFILEDEBUGGABLE\"" "\"$FILEDEBUGGABLE\"" $LATEFILE
replace_fn FILESECURE "\"$LATEFILESECURE\"" "\"$FILESECURE\"" $LATEFILE
replace_fn FILETYPE "\"$LATEFILETYPE\"" "\"$FILETYPE\"" $LATEFILE
replace_fn FILETAGS "\"$LATEFILETAGS\"" "\"$FILETAGS\"" $LATEFILE
replace_fn FILESELINUX "\"$LATEFILESELINUX\"" "\"$FILESELINUX\"" $LATEFILE
replace_fn FILEFINGERPRINT "\"$LATEFILEFINGERPRINT\"" "\"$FILEFINGERPRINT\"" $LATEFILE
log_handler "Default values saved to $LATEFILE."

# Save default prop values in propsconf_late
sed -i "s/ORIGDEBUGGABLE=\"$ORIGDEBUGGABLE\"/ORIGDEBUGGABLE=\"$CURRDEBUGGABLE\"/" $LATEFILE
sed -i "s/ORIGSECURE=\"$ORIGSECURE\"/ORIGSECURE=\"$CURRSECURE\"/" $LATEFILE
sed -i "s/ORIGTYPE=\"$ORIGTYPE\"/ORIGTYPE=\"$CURRTYPE\"/" $LATEFILE
sed -i "s/ORIGTAGS=\"$ORIGTAGS\"/ORIGTAGS=\"$CURRTAGS\"/" $LATEFILE
sed -i "s/ORIGSELINUX=\"$ORIGSELINUX\"/ORIGSELINUX=\"$CURRSELINUX\"/" $LATEFILE
sed -i "s@ORIGFINGERPRINT=\"$ORIGFINGERPRINT\"@ORIGFINGERPRINT=\"$CURRFINGERPRINT\"@" $LATEFILE
log_handler "Current prop values saved to $LATEFILE."

# Checks for the Universal SafetyNet Fix module and similar modules editing the device fingerprint
PRINTMODULE=false
for USNF in $USNFLIST; do
if [ -d "$IMGPATH/$USNF" ]; then
NAME=$(get_file_value $IMGPATH/$USNF/module.prop "name=")
log_handler "'$NAME' installed (modifies the device fingerprint)."
PRINTMODULE=true
fi
done
if [ "$PRINTMODULE" == "true" ]; then
sed -i 's/FINGERPRINTENB=1/FINGERPRINTENB=0/' $LATEFILE
log_handler "Fingerprint modification disabled."
else
sed -i 's/FINGERPRINTENB=0/FINGERPRINTENB=1/' $LATEFILE
if [ "$(get_file_value $LATEFILE "FINGERPRINTENB=")" == 1 ]; then
log_handler "Fingerprint modification enabled."
else
log_handler "Fingerprint modification disabled."
fi
fi
# Checks for configuration file
config_file

# Check if original file values are safe
orig_safe

# Checks for configuration file
config_file

# Edits build.prop
if [ "$(get_file_value $LATEFILE "FILESAFE=")" == 0 ]; then
log_handler "Checking for conflicting build.prop modules."
# Checks if any other modules are using a local copy of build.prop
BUILDMODULE=false
MODID=$(get_file_value $MODPATH/module.prop "id=")
Expand All @@ -116,9 +78,9 @@ if [ "$(get_file_value $LATEFILE "FILESAFE=")" == 0 ]; then
fi
done
if [ "$BUILDMODULE" == "true" ]; then
sed -i 's/BUILDPROPENB=1/BUILDPROPENB=0/' $LATEFILE
replace_fn BUILDPROPENB 1 0 $LATEFILE
else
sed -i 's/BUILDPROPENB=0/BUILDPROPENB=1/' $LATEFILE
replace_fn BUILDPROPENB 0 1 $LATEFILE
fi

# Copies the stock build.prop to the module. Only if set in propsconf_late.
Expand All @@ -136,28 +98,28 @@ if [ "$(get_file_value $LATEFILE "FILESAFE=")" == 0 ]; then
SEDTYPE="user"
fi
if [ "$(get_file_value $LATEFILE "SETTYPE=")" == "true" ]; then
sed -i "s/ro.build.type=$FILETYPE/ro.build.type=$SEDTYPE/" $MODPATH/system/build.prop && log_handler "ro.build.type=$SEDTYPE"
replace_fn "ro.build.type" $FILETYPE $SEDTYPE $MODPATH/system/build.prop && log_handler "ro.build.type=$SEDTYPE"
fi
if [ "$MODULETAGS" ]; then
SEDTAGS="$MODULETAGS"
else
SEDTAGS="release-keys"
fi
if [ "$(get_file_value $LATEFILE "SETTAGS=")" == "true" ]; then
sed -i "s/ro.build.tags=$FILETAGS/ro.build.tags=$SEDTAGS/" $MODPATH/system/build.prop && log_handler "ro.build.tags=$SEDTAGS"
replace_fn "ro.build.tags" $FILETAGS $SEDTAGS $MODPATH/system/build.prop && log_handler "ro.build.tags=$SEDTAGS"
fi
if [ "$MODULESELINUX" ]; then
SEDSELINUX="$MODULESELINUX"
else
SEDSELINUX="0"
fi
if [ "$(get_file_value $LATEFILE "SETSELINUX=")" == "true" ]; then
sed -i "s/ro.build.selinux=$FILESELINUX/ro.build.selinux=$SEDSELINUX/" $MODPATH/system/build.prop && log_handler "ro.build.selinux=$SEDSELINUX"
replace_fn "ro.build.selinux" $FILESELINUX $SEDSELINUX $MODPATH/system/build.prop && log_handler "ro.build.selinux=$SEDSELINUX"
fi
if [ "$(get_file_value $LATEFILE "SETFINGERPRINT=")" == "true" ] && [ "$MODULEFINGERPRINT" ]; then
PRINTSTMP="$(cat /system/build.prop | grep "$CURRFINGERPRINT")"
if [ "$MODULEFINGERPRINT" ] && [ "$(get_file_value $LATEFILE "SETFINGERPRINT=")" == "true" ]; then
PRINTSTMP="$(cat /system/build.prop | grep "$FILEFINGERPRINT")"
for ITEM in $PRINTSTMP; do
sed -i "s@${ITEM}@$(get_eq_left $ITEM)=${MODULEFINGERPRINT}@" $MODPATH/system/build.prop && log_handler "$(get_eq_left $ITEM)=$MODULEFINGERPRINT"
replace_fn $(get_eq_left $ITEM) $(get_eq_right $ITEM) $MODULEFINGERPRINT $MODPATH/system/build.prop && log_handler "$(get_eq_left $ITEM)=$MODULEFINGERPRINT"
done
fi
else
Expand Down
3 changes: 2 additions & 1 deletion common/prints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# MagiskHide Props Config
# By Didgeridoohan @ XDA Developers

PRINTSV=9
PRINTSV=10
PRINTSTRANSF=1

PRINTSFILE=/sdcard/printslist
Expand All @@ -24,6 +24,7 @@ Google Pixel 2 XL (8.1.0)=google/taimen/taimen:8.1.0/OPM1.171019.013/4474084:use
Google Pixel 2 XL (P DP1)=google/taimen/taimen:P/PPP1.180208.014/4633861:user/release-keys
HTC 10 (6.0.1)=htc/HTCOneM10vzw/htc_pmewl:6.0.1/MMB29M/774095.8:user/release-keys
Huawei Mate 10 Pro (8.0.0)=HUAWEI/BLA-L29/HWBLA:8.0.0/HUAWEIBLA-L29S/137(C432):user/release-keys
Motorola Moto E4 (7.1.1)=motorola/sperry_sprint/sperry:7.1.1/NCQ26.69-64/68:user/release-keys
Motorola Moto G4 (7.0)=motorola/athene/athene:7.0/NPJS25.93-14-13/3:user/release-keys
Motorola Moto G5 (7.0)=motorola/cedric/cedric:7.0/NPPS25.137-15-11/11:user/release-keys
Motorola Moto G5 Plus (7.0)=motorola/potter_n/potter_n:7.0/NPNS25.137-33-11/11:user/release-keys
Expand Down
2 changes: 1 addition & 1 deletion common/propsconf_conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CONFWEB=enabled
#
# 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.
# Add them to the PROPS variable according to the following example:
# Add them to the CONFPROPS variable according to the following example:
# CONFPROPS="
# ro.sf.lcd_density=320
# ro.config.media_vol_steps=30
Expand Down
49 changes: 34 additions & 15 deletions common/propsconf_late
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# In that case, feel free to delete it.

# Script version
SCRIPTV=3
SCRIPTV=4
SETTRANSF=1

# Variables
Expand Down Expand Up @@ -55,6 +55,28 @@ if [ -d "$MODPATH" ]; then
if [ -f "$MODPATH/disable" ]; then
log_handler "Module disabled."
else
# Checks for the Universal SafetyNet Fix module and similar modules editing the device fingerprint
PRINTMODULE=false
for USNF in $USNFLIST; do
if [ -d "$IMGPATH/$USNF" ]; then
NAME=$(get_file_value $IMGPATH/$USNF/module.prop "name=")
log_handler "'$NAME' installed (modifies the device fingerprint)."
PRINTMODULE=true
fi
done
if [ "$PRINTMODULE" == "true" ]; then
replace_fn FINGERPRINTENB 1 0 $LATEFILE
log_handler "Fingerprint modification disabled."
else
replace_fn FINGERPRINTENB 0 1 $LATEFILE
log_handler "Fingerprint modification enabled."
fi

# Check the reboot variable
if [ "$(get_file_value $LATEFILE "REBOOTCHK\=")" == 1 ]; then
replace_fn REBOOTCHK 1 0 $LATEFILE
fi

# ---Original values---
# default.prop
FILEDEBUGGABLE=""
Expand All @@ -63,13 +85,7 @@ if [ -d "$MODPATH" ]; then
FILETYPE=""
FILETAGS=""
FILESELINUX=""
# Prop values
ORIGDEBUGGABLE=""
ORIGSECURE=""
ORIGTYPE=""
ORIGTAGS=""
ORIGSELINUX=""
ORIGFINGERPRINT=""
FILEFINGERPRINT=""

# ---Module values---
MODULEDEBUGGABLE=""
Expand Down Expand Up @@ -120,10 +136,13 @@ if [ -d "$MODPATH" ]; then
fi
fi
# Set new fingerprint
if [ "$FINGERPRINTENB" == 1 ] && [ "$PRINTEDIT" == 1 ]; then
if [ "$FINGERPRINTENB" == 1 -o "$PRINTMODULE" == "false" ] && [ "$PRINTEDIT" == 1 ]; then
log_handler "Changing fingerprint."
resetprop -v ro.build.fingerprint $MODULEFINGERPRINT 2>> $LOGFILE
resetprop -v ro.bootimage.build.fingerprint $MODULEFINGERPRINT 2>> $LOGFILE
PRINTSTMP="$(resetprop | grep "build.fingerprint" | sed 's/\]\:\ /\]/')"
for ITEM in $PRINTSTMP; do
TMPPROP=$(echo $ITEM | sed 's/\]\[.*//' | sed 's/\[//')
resetprop -v $TMPPROP $MODULEFINGERPRINT 2>> $LOGFILE
done
fi

# ---Setting custom props---
Expand All @@ -146,21 +165,21 @@ if [ -d "$MODPATH" ]; then
SEDDEBUGGABLE="0"
fi
if [ "$SETDEBUGGABLE" == "true" ]; then
sed -i "s/ro.debuggable=$FILEDEBUGGABLE/ro.debuggable=$SEDDEBUGGABLE/" /default.prop && log_handler "ro.debuggable=$SEDDEBUGGABLE"
replace_fn "ro.debuggable" $FILEDEBUGGABLE $SEDDEBUGGABLE /default.prop && log_handler "ro.debuggable=$SEDDEBUGGABLE"
fi
if [ "$MODULESECURE" ]; then
SEDSECURE="$MODULESECURE"
else
SEDSECURE="1"
fi
if [ "$SETSECURE" == "true" ]; then
sed -i "s/ro.secure=$FILESECURE/ro.secure=$SEDSECURE/" /default.prop && log_handler "ro.secure=$SEDSECURE"
replace_fn "ro.secure" $FILESECURE $SEDSECURE /default.prop && log_handler "ro.secure=$SEDSECURE"
fi
mount -ro remount rootfs /
else
log_handler "Default.prop editing disabled."
fi
fi
fi
fi
log_script_chk "Boot script finished.\n\n=================="
fi
else
Expand Down
Loading

0 comments on commit 9800304

Please sign in to comment.