From 1388fc395ec01cb0acad5d779de0c24d5b7989e1 Mon Sep 17 00:00:00 2001 From: Didgeridoohan Date: Thu, 19 Apr 2018 05:13:40 +0200 Subject: [PATCH] v2.1.0-v8 --- README.md | 25 ++++++++++++++------- common/post-fs-data.sh | 36 ++++++++++++++++++------------ common/prints.sh | 2 ++ common/propsconf_late | 11 +++++----- common/util_functions.sh | 46 +++++++++++++++++++++++++++++++++------ config.sh | 2 +- module.prop | 4 ++-- system/binpath/props | Bin 32165 -> 33938 bytes 8 files changed, 89 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 1297e9c..3cc9369 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ props You can also run the command with options. Use -h for details. -## Spoofing device's fingerprint +## Spoofing device's fingerprint to pass the ctsProfile check If your device can't pass SafetyNet fully, the CTS profile check fails while basic integrity passes, that means MagiskHide is working on your device but Google doesn't recognise your device as being certified. This might be because your device simply hasn't been certified or that the ROM you are using on your device isn't recognised by Google (because it's a custom ROM). @@ -47,9 +47,9 @@ Google Nexus 6=google/shamu/shamu:7.1.1/N8I11B/4171878:user/release-keys ## 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). +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 - v7_** +**_Current fingerprints list version - v8_** ## Improved root hiding - Editing build.prop and default.prop @@ -72,7 +72,7 @@ It's quite easy to change prop values with Magisk. With this module it's even ea ## Prop script settings -There are a couple of persistent options that you can set for the `props` script. These are currently "Colour" and "Fingerprints list check". The colour option disables or enables colours for the script, and the fingerprints list check option disables or enables automatic updating of the fingerprints list when the script starts. If the fingerprints list check is disabled, the list can be manually updated from within the script, under the "Device fingerprint" menu. +There are a couple of persistent options that you can set for the `props` script. These are currently "Colour" and "Fingerprints list check". The colour option disables or enables colours for the script, and the fingerprints list check option disables or enables automatic updating of the fingerprints list when the script starts. If the fingerprints list check is disabled, the list can be manually updated from within the script, under the `Edit device fingerprint` menu. ## Configuration file @@ -87,7 +87,7 @@ Place a file named `reset_mhpc` in /cache (or /data/cache on A/B devices) and re 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. -## Certifying your device +## 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. Magisk, and this module, can help with that. @@ -107,7 +107,7 @@ But first: have you tried turning it off and on again? Toggling MagiskHide off a 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, "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. ## Source @@ -116,10 +116,17 @@ In case of issues, please provide the logs, saved in /cache, "propsconf.log" and ## Credits @topjohnwu @ XDA Developers, for Magisk -@Zackptg5, @veez21 and @jenslody @ XDA Developers, for inspiration +@Zackptg5, @veez21 and @jenslody @ XDA Developers, for help and inspiration ## Changelog +### v2.1.0 +- "Improved hiding" will now also mask the device fingerprint in build.prop. Please disable and reapply to set. +- Fixed colour code issues if running the script with ADB Shell. Huge shout-out to @veez21 over at XDA Developers. +- Fixed typo in A/B device detection. Thank you to @JayminSuthar over at XDA Developers. +- New fingerprints (Samsung Galaxy S4 and Sony Xperia Z3 Tablet Compact), list v8. +- Minor fixes and improvements. + ### v2.0.0 - Added a function for setting your own custom prop values. - Added a function for setting values by configuration file. Useful if you want to make a ROM pass the ctsProfile check out of the box. @@ -150,7 +157,7 @@ In case of issues, please provide the logs, saved in /cache, "propsconf.log" and ## Current fingerprints list -### List v7   +### List v8   - Google Nexus 6 (7.1.1) - Google Pixel (8.1.0) - Google Pixel 2 (P DP1) @@ -168,6 +175,7 @@ In case of issues, please provide the logs, saved in /cache, "propsconf.log" and - Samsung Galaxy Note 3 (7.1.1) - Samsung Galaxy Note 4 (6.0.1) - Samsung Galaxy Note 5 (7.0) +- Samsung Galaxy S4 (5.0.1) - Samsung Galaxy S6 (5.0.2) - Samsung Galaxy S7 (7.0) - Samsung Galaxy S7 Edge (7.0) @@ -177,6 +185,7 @@ In case of issues, please provide the logs, saved in /cache, "propsconf.log" and - Sony Xperia XZ (8.0.0) - Sony Xperia XZ1 Compact (8.0.0) - Sony Xperia Z3 (6.0.1) +- Sony Xperia Z3 Tablet Compact (6.0.1) - Sony Xperia Z5 (7.1.1) - Sony Xperia Z5 Compact (7.1.1) - Sony Xperia Z5 Dual (7.1.1) diff --git a/common/post-fs-data.sh b/common/post-fs-data.sh index f1d31e8..0247cac 100644 --- a/common/post-fs-data.sh +++ b/common/post-fs-data.sh @@ -15,6 +15,10 @@ IMGPATH=$(dirname "$MODPATH") # Load functions . $MODPATH/util_functions.sh +# Clears out the script check file +rm -f $RUNFILE +touch $RUNFILE + # Saves the previous log (if available) and creates a new one if [ -f "$LOGFILE" ]; then mv -f $LOGFILE $LASTLOGFILE @@ -24,7 +28,7 @@ echo "***************************************************" >> $LOGFILE echo "******** MagiskHide Props Config $MODVERSION ********" >> $LOGFILE echo "**************** By Didgeridoohan ***************" >> $LOGFILE echo "***************************************************" >> $LOGFILE -log_handler "Log start." +log_script_chk "Log start." # Check for boot scripts and restore backup if deleted, or if the resetfile is present if [ ! -f "$LATEFILE" ] || [ -f "$RESETFILE" ]; then @@ -124,33 +128,37 @@ if [ "$(get_file_value $LATEFILE "FILESAFE=")" == 0 ]; then log_handler "Stock build.prop copied from /system." # Edits the module copy of build.prop - MODULETYPE=$(get_file_value $LATEFILE "MODULETYPE=") - MODULETAGS=$(get_file_value $LATEFILE "MODULETAGS=") - MODULESELINUX=$(get_file_value $LATEFILE "MODULESELINUX=") + module_values log_handler "Editing build.prop." if [ "$MODULETYPE" ]; then - SEDTYPE=$MODULETYPE + SEDTYPE="$MODULETYPE" else - SEDTYPE=user + 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" + sed -i "s/ro.build.type=$FILETYPE/ro.build.type=$SEDTYPE/" $MODPATH/system/build.prop && log_handler "ro.build.type=$SEDTYPE" fi if [ "$MODULETAGS" ]; then - SEDTAGS=$MODULETAGS + SEDTAGS="$MODULETAGS" else - SEDTAGS=release-keys + 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" + sed -i "s/ro.build.tags=$FILETAGS/ro.build.tags=$SEDTAGS/" $MODPATH/system/build.prop && log_handler "ro.build.tags=$SEDTAGS" fi if [ "$MODULESELINUX" ]; then - SEDSELINUX=$MODULESELINUX + SEDSELINUX="$MODULESELINUX" else - SEDSELINUX=0 + 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" + sed -i "s/ro.build.selinux=$FILESELINUX/ro.build.selinux=$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")" + 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" + done fi else rm -f $MODPATH/system/build.prop @@ -161,4 +169,4 @@ else log_handler "Prop file editing disabled. All values ok." fi -log_handler "post-fs-data.sh finished.\n\n====================" +log_script_chk "post-fs-data.sh finished.\n\n====================" diff --git a/common/prints.sh b/common/prints.sh index 9daaf4c..c42372c 100644 --- a/common/prints.sh +++ b/common/prints.sh @@ -27,6 +27,7 @@ Samsung Galaxy Grand Prime (5.0.2)=samsung/fortuna3gdtvvj/fortuna3gdtv:5.0.2/LRX Samsung Galaxy Note 3 (7.1.1)=samsung/greatltexx/greatlte:7.1.1/NMF26X/N950FXXU1AQHA:user/release-keys Samsung Galaxy Note 4 (6.0.1)=samsung/trltexx/trlte:6.0.1/MMB29M/N910FXXS1DQH9:user/release-keys Samsung Galaxy Note 5 (7.0)=samsung/nobleltejv/noblelte:7.0/NRD90M/N920CXXU3CQH6:user/release-keys +Samsung Galaxy S4 (5.0.1)=samsung/jfltexx/jflte:5.0.1/LRX22C/I9505XXUHPF4:user/release-keys Samsung Galaxy S6 (5.0.2)=samsung/zerofltexx/zeroflte:5.0.2/LRX22G/G920FXXU1AOD4:user/release-keys Samsung Galaxy S7 (7.0)=samsung/heroltexx/herolte:7.0/NRD90M/G930FXXU2DRB6:user/release-keys Samsung Galaxy S7 Edge (7.0)=samsung/hero2ltexx/hero2lte:7.0/NRD90M/G935FXXU2DRB6:user/release-keys @@ -36,6 +37,7 @@ Sony Xperia X Performance (8.0.0)=Sony/F8131/F8131:8.0.0/41.3.A.2.99/1455830589: Sony Xperia XZ (8.0.0)=Sony/F8331/F8331:8.0.0/41.3.A.2.99/1455830589:user/release-keys Sony Xperia XZ1 Compact (8.0.0)=Sony/G8441/G8441:8.0.0/47.1.A.12.119/1601781803:user/release-keys Sony Xperia Z3 (6.0.1)=Sony/D6633/D6633:6.0.1/23.5.A.1.291/2769308465:user/release-keys +Sony Xperia Z3 Tablet Compact (6.0.1)=Sony/SGP621/SGP621:6.0.1/23.5.A.1.291/3706784398:user/release-keys Sony Xperia Z5 (7.1.1)=Sony/E6603/E6603:7.1.1/32.4.A.1.54/3761073091:user/release-keys Sony Xperia Z5 Compact (7.1.1)=Sony/E5823/E5823:7.1.1/32.4.A.1.54/3761073091:user/release-keys Sony Xperia Z5 Dual (7.1.1)=Sony/E6633/E6633:7.1.1/32.4.A.1.54/3761073091:user/release-keys diff --git a/common/propsconf_late b/common/propsconf_late index 9fad973..7315191 100644 --- a/common/propsconf_late +++ b/common/propsconf_late @@ -9,7 +9,7 @@ # In that case, feel free to delete it. # Script version -SCRIPTV=2 +SCRIPTV=3 SETTRANSF=1 # Variables @@ -50,7 +50,7 @@ if [ -d "$MODPATH" ]; then # Load functions . $MODPATH/util_functions.sh - log_handler "Running boot script." + log_script_chk "Running boot script." if [ -f "$MODPATH/disable" ]; then log_handler "Module disabled." @@ -97,6 +97,7 @@ if [ -d "$MODPATH" ]; then SETTYPE=false SETTAGS=false SETSELINUX=false + SETFINGERPRINT=false # ---Setting/Changing props--- # Set/change MagiskHide sensitive props @@ -145,7 +146,7 @@ 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" + sed -i "s/ro.debuggable=$FILEDEBUGGABLE/ro.debuggable=$SEDDEBUGGABLE/" /default.prop && log_handler "ro.debuggable=$SEDDEBUGGABLE" fi if [ "$MODULESECURE" ]; then SEDSECURE="$MODULESECURE" @@ -153,14 +154,14 @@ if [ -d "$MODPATH" ]; then SEDSECURE="1" fi if [ "$SETSECURE" == "true" ]; then - sed -i "s/ro.secure=$FILESECURE/ro.secure=$SEDSECURE/" /default.prop && log_handler "ro.secure" + sed -i "s/ro.secure=$FILESECURE/ro.secure=$SEDSECURE/" /default.prop && log_handler "ro.secure=$SEDSECURE" fi mount -ro remount rootfs / else log_handler "Default.prop editing disabled." fi fi - log_handler "Boot script finished.\n\n==================" + log_script_chk "Boot script finished.\n\n==================" fi else # Cleanup diff --git a/common/util_functions.sh b/common/util_functions.sh index cc367ac..a448221 100644 --- a/common/util_functions.sh +++ b/common/util_functions.sh @@ -8,6 +8,7 @@ MODVERSION=VER_PLACEHOLDER POSTFILE=$IMGPATH/.core/post-fs-data.d/propsconf_post LATEFILE=$IMGPATH/.core/service.d/propsconf_late CACHELOC=CACHE_PLACEHOLDER +RUNFILE=$MODPATH/script_check LOGFILE=$CACHELOC/propsconf.log LASTLOGFILE=$CACHELOC/propsconf_last.log CONFFILE=$CACHELOC/propsconf_conf @@ -55,12 +56,19 @@ log_print() { echo "$1" log_handler "$1" } +log_script_chk() { + log_handler "$1" + echo -e "$(date +"%m-%d-%Y %H:%M:%S") - $1" >> $RUNFILE +} #Divider DIVIDER="${Y}=====================================${N}" # Header menu_header() { + if [ -z "$LOGNAME" ]; then + clear + fi if [ "$MODVERSION" == "VER_PLACEHOLDER" ]; then VERSIONTXT="" else @@ -126,6 +134,17 @@ orig_check() { done } +script_ran_check() { + POSTCHECK=0 + if [ "$(cat $RUNFILE | grep "post-fs-data.sh finished")" ]; then + POSTCHECK=1 + fi + LATECHECK=0 + if [ "$(cat $RUNFILE | grep "Boot script finished")" ]; then + LATECHECK=1 + fi +} + # Currently set values curr_values() { CURRDEBUGGABLE=$(resetprop ro.debuggable) @@ -339,7 +358,9 @@ config_file() { # ======================== Fingerprint functions ======================== # Checks and updates the prints list download_prints() { - clear + if [ -z "$LOGNAME" ]; then + clear + fi menu_header "Updating fingerprints list" echo "" log_print "Checking list version." @@ -366,6 +387,8 @@ download_prints() { fi if [ "$1" == "manual" ]; then sleep 2 + else + sleep 0.5 fi } @@ -408,17 +431,19 @@ change_print() { reset_prop_files() { log_handler "Resetting prop files$3." - # Changes file + # Changes files for PROPTYPE in $PROPSLIST; do log_handler "Disabling prop file editing for '$PROPTYPTE'." PROP=$(get_prop_type $PROPTYPE) FILEPROP=$(echo "FILE$PROP" | tr '[:lower:]' '[:upper:]') SETPROP=$(echo "SET$PROP" | tr '[:lower:]' '[:upper:]') - sed -i "s/$SETPROP=true/$SETPROP=false/" $LATEFILE - sed -i 's/BUILDEDIT=1/BUILDEDIT=0/' $LATEFILE - sed -i 's/DEFAULTEDIT=1/DEFAULTEDIT=0/' $LATEFILE done + # Change fingerprint + sed -i "s/SETFINGERPRINT=true/SETFINGERPRINT=false/" $LATEFILE + # Edit settings variables + sed -i 's/BUILDEDIT=1/BUILDEDIT=0/' $LATEFILE + sed -i 's/DEFAULTEDIT=1/DEFAULTEDIT=0/' $LATEFILE if [ "$1" != "file" ]; then after_change_file "$1" "$2" @@ -436,6 +461,13 @@ edit_prop_files() { ro.debuggable ro.secure " + else + # Checking if the device fingerprint is set by the module + if [ "$(get_file_value $LATEFILE "FINGERPRINTENB=")" == 1 ] && [ "$(get_file_value $LATEFILE "PRINTEDIT=")" == 1 ]; then + if [ "$(cat /system/build.prop | grep "$ORIGFINGERPRINT")" ]; then + sed -i "s/SETFINGERPRINT=false/SETFINGERPRINT=true/" $LATEFILE + fi + fi fi for PROPTYPE in $PROPSLIST; do @@ -467,9 +499,9 @@ edit_prop_files() { else log_handler "Couldn't check safe value for '$PROPTYPE'." fi - sed -i 's/DEFAULTEDIT=0/DEFAULTEDIT=1/' $LATEFILE - sed -i 's/BUILDEDIT=0/BUILDEDIT=1/' $LATEFILE done + sed -i 's/DEFAULTEDIT=0/DEFAULTEDIT=1/' $LATEFILE + sed -i 's/BUILDEDIT=0/BUILDEDIT=1/' $LATEFILE if [ "$1" != "file" ]; then after_change_file "$1" "$2" diff --git a/config.sh b/config.sh index 3785e56..6dc7da6 100644 --- a/config.sh +++ b/config.sh @@ -275,7 +275,7 @@ ab_check() { if [ -z $SLOT ]; then CACHELOC=/cache else - CACHELOC/data/cache + CACHELOC=/data/cache fi } diff --git a/module.prop b/module.prop index edead7f..01bc94c 100644 --- a/module.prop +++ b/module.prop @@ -1,7 +1,7 @@ id=MagiskHidePropsConf name=MagiskHide Props Config -version=v2.0.0-v7 -versionCode=5 +version=v2.1.0-v8 +versionCode=6 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. minMagisk=1500 diff --git a/system/binpath/props b/system/binpath/props index 361e0089e8ff6e68b86a20801b3ad404319b0aa3..c1127679f110f49b0328db1dc51c321b9d311c63 100644 GIT binary patch delta 1900 zcmd5+OKcle6qWOH{0Vg;8i$l7*Tyt)>U?DSSsm*f*#7Al=UpQtdLL%u!2&lDZ7#icyH`6b&3#6W;O5K zckbuhbMJ>+p0zh>KK;xSf~6&xf@o}X;>dVvEFGoP^HM$C<1NONrGY_u z1zlGPVC4vy#Ij^{&g`o~Wpc6!nr_LO3j9xHuWge^wgR%maR%u!VU`fJ3MQyv>s_K? z5gv!TpN@{?bwgVqBIIO|1)7e6L#Zx zM3^nWm@p@s^G9Wopdf@%KOUqv243^9&YZ&^avk()(&FyI$VkNtu^`nC?5lUV$Mwz- zz47=>r=z?x&c(xn!2952&_Bt-Xa*2bwjgVpmX>$o!-AmL!~}`i3Yu+zNEYNQ>BHOJ zFg-hT-A%wpKR8573Gl|BJ^Y(f6WHGWg+9;>>c-?Zi(-D0_D6xP(^%88m>BjBfa1z zIG9ot$ZMjlkh1bk4yg=?BlOZtEz0caEMbGhrBzZohQx8a74+iA4UP2X+@V^!fBw6g zi0SY5@ZHUUF0v5Pze^VbI>l6z)=1n3G8Ou`-+MAr<) z6f09UO`9ZG!=G7Rl&u^n+MLPzj<=Pap)xt6sZ6?>oN{y7%DK0+|IE%m!^_OD{QiX- zt^0q$O)Cwlk_T%in(>_WJ6_Qv_`1F?ru%%`_A7Kd3y5z%kYt6Jaop5*HI|2x8=r;xD5uR5qo0{PyL;4Qal(MC>d)wqu)56bg|#ZpPI@(w`E={?d}e%Y{U9d9GcG sqkddDvTJQB;OS@U;LP8F-#K~NbD!hqm(IH@sO$jmEbXm;Ft)t<7skP`NB{r; delta 869 zcmZ9KZ%7ky7{~cdo!+?!%_U<-$6*Uvq~|STS+;2!sbqg9L16CO&UxV{T+S1v4mZC@_Hu)FiMX{ZNyZ0=gMN)A>+H1;2}o0J@X_IM#(Zs5(y606JM zN@&h1+i>ypU-K&TKns?fxna@;e{P|TboO>dRxTvrSN~;7NobNXsa``VA`G+VqI9X3^*!JVk8w71t;+063!2<7YXoN^tQEMuu70+MvWw;gvR87un=1_ z*$cxnq(T)nO&X1}~T*ZenAKhb%#2Z*l@TGJdnoN`0VS55U6 s?t8Yo7CxjaKs&n~*3;+keC7p#TVtESH}$}tm%*1QFF3