From c271ca58ad2f6969293f4e349ff7c5ce6a357dd6 Mon Sep 17 00:00:00 2001 From: Didgeridoohan Date: Thu, 26 Jul 2018 11:03:13 +0200 Subject: [PATCH] v2.3.5-v23 --- README.md | 34 ++++++++++++++++++++-------------- common/prints.sh | 5 +++-- common/propsconf_late | 5 +++-- common/propsconf_post | 3 ++- common/util_functions.sh | 38 +++++++++++++++++++++++++++++++------- config.sh | 19 +++++++------------ module.prop | 4 ++-- system/binpath/props | 14 +++++++++----- 8 files changed, 77 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index c6f64f9..c1aac5f 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,8 @@ The current release is always attached to the OP of the [module support thread]( ## Usage -After installing the module and rebooting, run the command `props` (as su) in a terminal emulator (you can find a one on [F-Droid](https://f-droid.org/) or in the [Play Store](https://play.google.com/store/apps)), and follow the instructions to set your desired options. -``` -su -props -``` +After installing the module and rebooting, run the command `props` in a terminal emulator (you can find a one on [F-Droid](https://f-droid.org/) or in the [Play Store](https://play.google.com/store/apps)), and follow the instructions to set your desired options. If you use Termux, you'll have to call su before running the command. + You can also run the command with options. Use -h for details. @@ -48,19 +45,20 @@ You can find the file to download in your device's forum on XDA Developers (eith Once you have the file downloaded, there are several different ways that the fingerprint can be found. In all cases you'll have to access the file somehow, and in most cases it's just a matter of unpackaging it. After that it depends on how the package is constructed. - Sometimes there'll be a build.prop file directly in the zip/package. You'll likely find the fingerprint in there. -- For some devices you'll have to unpackage the system.img to get to the build.prop file. On Windows, you can use something like [this tool](https://forum.xda-developers.com/showpost.php?p +- For some devices you'll have to unpackage the system.img to get to the build.prop file. On Windows, you can use something like [this tool](https://forum.xda-developers.com/showpost.php?p=57742855&postcount=42). You'll also find more info in the [main thread for that post](https://forum.xda-developers.com/android/software-hacking/how-to-conver-lollipop-dat-files-to-t2978952). - Other times you'll find the fingerprint in META-INF\com\google\android\updater-script. Look for "Target:" and you'll likely find the fingerprint there. - Etc... Experiment, the fingerprint will be in there somewhere. Take a look below for an example of what a device fingerprint looks like. ### Custom fingerprints list -You can add your own fingerprint to the list by placing a file, named `printslist`, in the root of your internal storage with the fingerprint. It needs to be formated as follows:`device name +You can add your own fingerprint to the list by placing a file, named `printslist`, in the root of your internal storage with the fingerprint. It needs to be formated as follows: `device name=fingerprint`. Here's an example: ``` -Google Nexus 6 +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, try one or more of 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"](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config/blob/master/README.md#miscellaneous-magiskhide-issues) below. @@ -68,7 +66,7 @@ If you've picked a certified fingerprint from the provided list, or you're using - Try a different fingerprint (pick one from the provided list). - Some ROMs will just not be able to pass the ctsProfile check, if they contain signs of a rooted/modified device that Magisk can't hide. Check in your ROM thread or with the creator/developer. - You might have remnants of previous modifications that trigger SafetyNet on your device. A clean install of your system may be required. -- If you can't get things working, and want help, make sure to provide logs and details. See ["Logs, etc"](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config#logs-etc) below. +- If you can't get things working, and want help, make sure to provide logs and details. See ["Logs"](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config#logs) below. ## Keeping your device "certified" @@ -86,7 +84,7 @@ The fingerprints list will update without the need to update the entire module. 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 ["Prop script settings"](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config#prop-script-settings) below). If you've disabled the this setting you can update the list manually in the `Edit device fingerprint` menu. -**_Current fingerprints list version - v22_** +**_Current fingerprints list version - v23_** ## Improved root hiding - Editing build.prop and default.prop @@ -113,7 +111,7 @@ If you would like to delete a certain prop value from your system, that can be d ## Prop script settings -There are a couple of persistent options that you can set for the props script. These are currently "Boot stage", "Script colours" and "Fingerprints list check". The options are found under "Script settings" when running the props script. The settings menu can also be opened by using the -s option when running the props script (use -h for details). +There are a couple of persistent options that you can set for the `props` script. These are currently "Boot stage", "Script colours" and "Fingerprints list check". The options are found under "Script settings" when running the `props` script. The settings menu can also be opened by using the -s option (use -h for details). ### Boot stage It's possible to move the execution of the boot script from the default late_start service to post-fs-data.d. This is required for the SafetyNet fix and custom props to work on some ROM/device combinations (known: LineageOS 15.1). The reason late_start service is default is that it's best to try to keep the number of scripts running during post-fs-data mode as low as possible, but if late_start service doesn't work, it needs to run in post-fs-data instead. @@ -122,7 +120,7 @@ It's possible to move the execution of the boot script from the default late_sta This option will disable or enable colours for the `props` script. ### Fingerprints list check -This option will disable or enable the automatic updating of the fingerprints list when the `props` 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, or with the -f option when running the props script (use -h for details). +This option will disable or enable the automatic updating of the fingerprints list when the `props` 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, or with the -f option (use -h for details). ## Configuration file @@ -167,7 +165,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. ## Logs -In case of issues, please provide the logs by running the `props` script and selecting the "Collect logs" option (or running the `props` script with the -l command, use -h for details). All the relevant logs, together with the Magisk logs, the stock build.prop file and current prop values will be packaged into a file that'll be stored in the root of the device's internal storage, ready for attaching to a post in the [module support thread](https://forum.xda-developers.com/apps/magisk/module-magiskhide-props-config-t3789228), together with a detailed description of your problem. +In case of issues, please provide the logs by running the `props` script and selecting the "Collect logs" option (or running the `props` script with the -l option, use -h for details). All the relevant logs and module files, together with the Magisk log, the stock build.prop file and current prop values will be packaged into a file that'll be stored in the root of the device's internal storage, ready for attaching to a post in the [module support thread](https://forum.xda-developers.com/apps/magisk/module-magiskhide-props-config-t3789228), together with a detailed description of your problem. The logs will also automatically be saved to the root of the device's internal storage if there's an issue with the module scripts. @@ -186,6 +184,13 @@ If you can't run the `props` script for some reason, the logs are also stored in ## Changelog +### v2.3.5 +- Fixed issue with busybox version detection. +- Fixed the documentation. Some parts had been accidentally deleted. Oops... +- Improved log collecting. +- Added and updated fingerprints for the Xiaomi Mi Note 2 and Redmi Note 5A Lite, list v23. +- Minor improvements here and there. Hopefully I haven't broken something this time... + ### v2.3.4 - Updated for Busybox v1.29.1. Thank you @osm0sis. - Bugfixes. Because I'm blind. @@ -301,7 +306,7 @@ If you can't run the `props` script for some reason, the logs are also stored in ## Current fingerprints list -### List v22  +### List v23 - Asus Zenfone 2 Laser (6.0.1) - Asus ZenPad S 8.0 (6.0.1) - Google Nexus 4 (5.1.1) @@ -405,6 +410,7 @@ If you can't run the `props` script for some reason, the logs are also stored in - Xiaomi Redmi Note 4/4X (7.0) - Xiaomi Redmi Note 5/5 Plus (7.1.2) - Xiaomi Redmi Note 5 Pro (8.1.0) +- Xiaomi Redmi Note 5A Lite (7.1.2) - ZTE Axon 7 (7.1.1) - ZTE Nubia Z17 (7.1.1) - Zuk Z2 Pro (7.0) \ No newline at end of file diff --git a/common/prints.sh b/common/prints.sh index 13a034e..a8341c2 100644 --- a/common/prints.sh +++ b/common/prints.sh @@ -3,7 +3,7 @@ # MagiskHide Props Config # By Didgeridoohan @ XDA Developers -PRINTSV=22 +PRINTSV=23 PRINTSTRANSF=1 PRINTSFILE=/sdcard/printslist @@ -105,7 +105,7 @@ Xiaomi Mi 6 (8.0.0)=Xiaomi/sagit/sagit:8.0.0/OPR1.170623.027/V9.2.3.0.OCAMIEK:us Xiaomi Mi A1 (8.0.0)=xiaomi/tissot/tissot_sprout:8.0.0/OPR1.170623.026/V.9.5.10.0.ODHMIFA:user/release-keys Xiaomi Mi Max 2 (7.1.1)=Xiaomi/oxygen/oxygen:7.1.1/NMF26F/V9.5.4.0.NDDMIFA:user/release-keys Xiaomi Mi Mix 2S (8.0.0)=Xiaomi/polaris/polaris:8.0.0/OPR1.170623.032/V9.5.19.0.ODGMIFA:user/release-keys -Xiaomi Mi Note 2 (7.0)=Xiaomi/scorpio/scorpio:7.0/NRD90M/V9.2.1.0.NADMIEK:user/release-keys +Xiaomi Mi Note 2 (8.0.0)=Xiaomi/scorpio/scorpio:8.0.0/OPR1.170623.032/V9.6.1.0.OADCNFD:user/release-keys Xiaomi Redmi 4 Prime (6.0.1)=Xiaomi/markw/markw:6.0.1/MMB29M/V9.5.3.0.MBEMIFA:user/release-keys Xiaomi Redmi 4X (6.0.1)=Xiaomi/santoni/santoni:6.0.1/MMB29M/V8.5.4.0.MAMCNED:user/release-keys Xiaomi Redmi Note 3 Pro (6.0.1)=Xiaomi/kenzo/kenzo:6.0.1/MMB29M/V8.2.1.0.MHOCNDL:user/release-keys @@ -113,6 +113,7 @@ Xiaomi Redmi Note 3 Pro SE (6.0.1)=Xiaomi/kate/kate:6.0.1/MMB29M/V8.1.3.0.MHRMID Xiaomi Redmi Note 4/4X (7.0)=xiaomi/mido/mido:7.0/NRD90M/V9.2.1.0.NCFMIEK:user/release-keys Xiaomi Redmi Note 5/5 Plus (7.1.2)=xiaomi/vince/vince:7.1.2/N2G47H/V9.5.4.0.NEGMIFA:user/release-keys Xiaomi Redmi Note 5 Pro (8.1.0)=xiaomi/whyred/whyred:8.1.0/OPM1.171019.011/V9.5.6.0.OEIMIFA:user/release-keys +Xiaomi Redmi Note 5A Lite (7.1.2)=xiaomi/ugglite/ugglite:7.1.2/N2G47H/V9.1.2.0.NDFMIEI:user/release-keys ZTE Axon 7 (7.1.1)=ZTE/P996A01_N/ailsa_ii:7.1.1/NMF26V/20171211.005949:user/release-keys ZTE Nubia Z17 (7.1.1)=nubia/NX563J/NX563J:7.1.1/NMF26X/eng.nubia.20171019.101529:user/release-keys Zuk Z2 Pro (7.0)=ZUK/z2_row/z2_row:7.0/NRD90M/2.5.435_170525:user/release-keys diff --git a/common/propsconf_late b/common/propsconf_late index 952e698..85945d6 100644 --- a/common/propsconf_late +++ b/common/propsconf_late @@ -9,11 +9,12 @@ # In that case, feel free to delete it. # Script version -SCRIPTV=11 +SCRIPTV=12 SETTRANSF=1 # Variables -IMGPATH=IMG_PLACEHOLDER +COREPATH=CORE_PLACEHOLDER +IMGPATH=$COREPATH/img MODPATH=$IMGPATH/MagiskHidePropsConf CACHELOC=CACHE_PLACEHOLDER LATELOGFILE=$CACHELOC/propsconf_latefile.log diff --git a/common/propsconf_post b/common/propsconf_post index 236d4c7..c37fcb7 100644 --- a/common/propsconf_post +++ b/common/propsconf_post @@ -9,7 +9,8 @@ # In that case, feel free to delete it. # Variables -IMGPATH=IMG_PLACEHOLDER +COREPATH=CORE_PLACEHOLDER +IMGPATH=$COREPATH/img MODPATH=$IMGPATH/MagiskHidePropsConf POSTLOGFILE=$CACHELOC/propsconf_postfile.log diff --git a/common/util_functions.sh b/common/util_functions.sh index d11787b..cc3199e 100644 --- a/common/util_functions.sh +++ b/common/util_functions.sh @@ -5,6 +5,7 @@ # Variables MODVERSION=VER_PLACEHOLDER +MIRRORPATH=$COREPATH/mirror POSTFILE=$IMGPATH/.core/post-fs-data.d/propsconf_post LATEFILE=$IMGPATH/.core/service.d/propsconf_late SYSTEMLOC=SYSTEM_PLACEHOLDER @@ -19,8 +20,9 @@ $CACHELOC/magisk.log $CACHELOC/magisk.log.bak /data/adb/magisk_debug.log $CACHELOC/propsconf* -/sbin/.core/mirror/system/build.prop -/sbin/.core/mirror/vendor/build.prop +$MIRRORPATH/system/build.prop +$MIRRORPATH/vendor/build.prop +$LATEFILE " CONFFILE=$CACHELOC/propsconf_conf RESETFILE=$CACHELOC/reset_mhpc @@ -126,8 +128,10 @@ log_start() { log_script_chk "Log start." } log_handler() { - echo "" >> $LOGFILE - echo -e "$(date +"%m-%d-%Y %H:%M:%S") - $1" >> $LOGFILE + if [ $(id -u) == 0 ] ; then + echo "" >> $LOGFILE + echo -e "$(date +"%m-%d-%Y %H:%M:%S") - $1" >> $LOGFILE + fi } log_print() { echo "$1" @@ -338,13 +342,17 @@ orig_safe() { PROP=$(get_prop_type $V) FILEPROP=$(echo "CURR${PROP}" | tr '[:lower:]' '[:upper:]') FILEVALUE=$(eval "echo \$$FILEPROP") - log_handler "Checking $FILEPROP=$FILEVALUE" + log_handler "Checking ${FILEPROP}=${FILEVALUE}" safe_props $V $FILEVALUE if [ "$SAFE" == 0 ]; then log_handler "Prop $V set to triggering value in prop file." replace_fn FILESAFE 1 0 $LATEFILE else - log_handler "Prop $V set to \"safe\" value in prop file." + if [ -z "$FILEVALUE" ]; then + log_handler "Could not retrieve value for prop $V." + elif [ "$SAFE" == 1 ]; then + log_handler "Prop $V set to \"safe\" value in prop file." + fi fi done } @@ -969,7 +977,23 @@ collect_logs() { esac cp -af $ITEM ${TMPLOGLOC}/${BPNAME} >> $LOGFILE else - log_handler "$ITEM not available." + case "$ITEM" in + */cache) + if [ "$CACHELOC" == "/cache" ]; then + CACHELOCTMP=/data/cache + else + CACHELOCTMP=/cache + fi + ITEMTPM=$(echo $ITEM | sed 's|$CACHELOC|$CACHELOCTMP|') + if [ -f "$ITEMTPM" ]; then + cp -af $ITEMTPM $TMPLOGLOC >> $LOGFILE + else + log_handler "$ITEM not available." + fi + ;; + *) log_handler "$ITEM not available." + ;; + esac fi done diff --git a/config.sh b/config.sh index 4f44656..4141721 100644 --- a/config.sh +++ b/config.sh @@ -120,7 +120,8 @@ get_file_value() { } # Variables -BIMGPATH=/sbin/.core/img +COREPATH=/sbin/.core +BIMGPATH=$COREPATH/img $BOOTMODE && IMGPATH=$BIMGPATH || IMGPATH=$MOUNTPATH POSTPATH=$IMGPATH/.core/post-fs-data.d SERVICEPATH=$IMGPATH/.core/service.d @@ -146,12 +147,6 @@ else BBARCH=$ARCH fi BBWWWPATH="https://raw.githubusercontent.com/Magisk-Modules-Repo/Busybox-Installer/master/busybox-${BBARCH}" -BBPATH=/data/adb/magisk/busybox -$BOOTMODE && alias grep="$BBPATH grep" -$BOOTMODE && alias sed="$BBPATH sed" -$BOOTMODE && alias tr="$BBPATH tr" -$BOOTMODE && alias ls="$BBPATH ls" -$BOOTMODE && alias wget="$BBPATH wget" SETTINGSLIST=" FINGERPRINTENB PRINTEDIT @@ -321,7 +316,7 @@ usnf_check() { # Check for bin/xbin bin_check() { - $BOOTMODE && BINCHECK=/sbin/.core/mirror/system/xbin || BINCHECK=/system/xbin + $BOOTMODE && BINCHECK=$COREPATH/mirror/system/xbin || BINCHECK=/system/xbin if [ -d "$BINCHECK" ]; then BIN=xbin else @@ -354,7 +349,7 @@ check_bb() { if [ -f "$IMGPATH/$MODID/busybox" ]; then BBV=$($IMGPATH/$MODID/busybox | grep "BusyBox v" | sed 's|.*BusyBox v||' | sed 's|-osm0sis.*||') log_handler "Current/installed busybox - v${BBCURR}/v${BBV}." - if [ "$BBCURR" -le "$BBV" ]; then + if [ "$(echo $BBCURR | sed 's|\.||g')" -le "$(echo $BBV | sed 's|\.||g')" ]; then log_handler "Backing up current busybox." cp -af $IMGPATH/$MODID/busybox $CACHELOC/busybox_post >> $INSTLOG fi @@ -405,8 +400,8 @@ script_install() { placeholder_update $MODPATH/util_functions.sh CACHELOC CACHE_PLACEHOLDER "$CACHELOC" placeholder_update $MODPATH/util_functions.sh MODVERSION VER_PLACEHOLDER "$MODVERSION" placeholder_update $MODPATH/util_functions.sh BBWWWPATH BB_PLACEHOLDER "$BBWWWPATH" - placeholder_update $POSTFILE IMGPATH IMG_PLACEHOLDER "$BIMGPATH" - placeholder_update $LATEFILE IMGPATH IMG_PLACEHOLDER "$BIMGPATH" - placeholder_update $MODPATH/system/$BIN/props IMGPATH IMG_PLACEHOLDER "$BIMGPATH" + placeholder_update $POSTFILE COREPATH CORE_PLACEHOLDER "$COREPATH" + placeholder_update $LATEFILE COREPATH CORE_PLACEHOLDER "$COREPATH" + placeholder_update $MODPATH/system/$BIN/props COREPATH CORE_PLACEHOLDER "$COREPATH" } diff --git a/module.prop b/module.prop index eac1787..91b21cb 100644 --- a/module.prop +++ b/module.prop @@ -1,7 +1,7 @@ id=MagiskHidePropsConf name=MagiskHide Props Config -version=v2.3.4-v22 -versionCode=20 +version=v2.3.5-v23 +versionCode=21 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 b56ba0c..2f32fb6 100644 --- a/system/binpath/props +++ b/system/binpath/props @@ -7,7 +7,8 @@ # ================ Paths and variables ================ # ===================================================== -IMGPATH=IMG_PLACEHOLDER +COREPATH=CORE_PLACEHOLDER +IMGPATH=$COREPATH/img MODPATH=$IMGPATH/MagiskHidePropsConf LATEFILE=$IMGPATH/.core/service.d/propsconf_late @@ -1779,10 +1780,8 @@ reset_everything() { # ==================================================== if [ $(id -u) != 0 ] ; then - log_handler "No superuser access." - menu_header "${C}This script must be run with\n superuser access. Try again.${N}" - echo "" - exit 0 + su -c props "$@" + exit fi # ==================================================== @@ -1822,6 +1821,7 @@ if [ "$ISSUECHK" == 1 ]; then collect_logs "issue" reboot_fn "${ISSUETXT}\n\n If the issue persists after a reboot,\n please report the issue, ${R}with logs!${C}\n\n Logs have automatically been saved\n to your internal storage\n ${R}(propslogs.tar.gz)${C}.\n\n If the automatic collection failed,\n please collect the logs manually.\n\n ${G}See the documentation for details.${N}" "reset-script" fi + # ================================================== # ================= Busybox check ================== # ================================================== @@ -1852,6 +1852,7 @@ all_values case "$1" in -h) + log_handler "Showing help (-h)." menu_header "${C}Help${N}" echo "" echo $(echo $(get_file_value $MODPATH/module.prop "description=") | sed 's|, |,\\n|g' | sed 's|\. |\.\\n|g') @@ -1871,6 +1872,7 @@ case "$1" in echo "See the module readme or the" echo "support thread @ XDA for details." echo "" + log_handler "Exiting... Bye bye.\n\n====================" exit 0 ;; esac @@ -1913,6 +1915,7 @@ if [ "$1" ]; then *bo*|*bj*|*d*|*f*|*l*|*h*|*nc*|*nw*|*p*|*r*|*s*|*t*) # Do nothing ;; *) + log_handler "Invalid option." menu_header "${C}Help${N}" echo "" echo "${R}Invalid option.${N}" @@ -1920,6 +1923,7 @@ if [ "$1" ]; then echo "Try again without options," echo "or use -h for help and details." echo "" + log_handler "Exiting... Bye bye.\n\n====================" exit 0 ;; esac