From 6284eea4d00bd8d684490851fdf7e9107e74e787 Mon Sep 17 00:00:00 2001 From: Didgeridoohan Date: Wed, 27 Mar 2019 11:50:00 +0100 Subject: [PATCH] v3.5.0-v49 --- META-INF/com/google/android/update-binary | 2 +- README.md | 80 +- common/post-fs-data.sh | 47 +- common/prints.sh | 44 +- common/propsconf_conf | 34 +- common/propsconf_late | 38 +- common/service.sh | 29 +- common/util_functions.sh | 859 ++++++++++++++++++---- config.sh | 453 +----------- module.prop | 4 +- system/binpath/props | Bin 61375 -> 67484 bytes 11 files changed, 898 insertions(+), 692 deletions(-) diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index 733e61f..ee658be 100755 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -141,7 +141,7 @@ $POSTFSDATA && cp -af $INSTALLER/common/post-fs-data.sh $MODPATH/post-fs-data.sh # service mode scripts $LATESTARTSERVICE && cp -af $INSTALLER/common/service.sh $MODPATH/service.sh -# Module script placement +# Module script installation script_install ui_print "- Setting permissions" diff --git a/README.md b/README.md index 6786e4e..ebe8659 100644 --- a/README.md +++ b/README.md @@ -86,11 +86,11 @@ This might be because your device simply hasn't been certified or that the ROM y To fix this, you can use a known working device fingerprint (`ro.build.fingerprint`), one that has been certified by Google, usually from a stock ROM/firmware/factory image, and replace your device's current fingerprint with this. You can also use a fingerprint from another device, but this will change how your device is perceived. -NOTE: If you're using a fingerprint for an Android build after March 16th 2018 you might have to change the security patch date to one that matches the fingerprint used. You can use the [Custom prop](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config/blob/master/README.md#changeset-custom-prop-values) function of this module to change `ro.build.version.security_patch` to the desired date. If you don't know the security patch date you can try finding it with trial and error. The dates are always either the 1st or the 5th of the month, so try different months one after the other until the CTS profile passes. +NOTE: If you're using a fingerprint for an Android build after March 16th 2018 you might have to change the security patch date to one that matches the fingerprint used. You can use the [Custom prop](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config/blob/master/README.md#changeset-custom-prop-values) function of this module to change `ro.build.version.security_patch` to the desired date. If you don't know the security patch date you can try finding it with trial and error (although it's a much better option to find the actual date from the ROM/firmware/factory image in question). The dates are always either the 1st or the 5th of the month, so try different months one after the other until the CTS profile passes. -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-t3789228) toghether with device details. Please also include the Android security patch date for the factory image/firmware/ROM that the fingerprint comes from. +There are a bunch of tested certified fingerprints available in the module, just in case you can't get a hold of one for your device. For some devices there are several fingerprints available, for different Android versions. When picking a fingerprint you will also have to pick which version you need. 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-t3789228) toghether with device details. Please also include the Android security patch date for the factory image/firmware/ROM that the fingerprint comes from. -After having applied a device fingerprint from the module, whenever that particular print is updated in the included prints list, the chosen fingerprint will be automatically updated when the fingerprints list is. Just reboot to apply the new fingerprint. +After having applied a device fingerprint from the module, whenever that particular print is updated in the included prints list, the chosen fingerprint will be automatically updated when the fingerprints list is. Just reboot to apply the new fingerprint. If there are several fingerprints available for the same device, this option only applies for fingerprints of the same Android version. In that case, if you want to update to a newer version you will have to update the fingerprint manually. If you are using a Treble GSI ROM you can enable the [Use vendor fingerprint](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config/blob/master/README.md#use-vendor-fingerprint-for-treble-gsi-roms) option (for more details, see below) in the `Edit device fingerprint` menu. @@ -172,11 +172,11 @@ In case you can't get the Play Store to report your device as "certified", see [ ## 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-t3789228) 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 ["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. +Just run the `props` command and the list will be updated automatically. Use the -nw option to run the script without updating the list 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 or by running the `props` command with the -f option. If you already have a device fingerprint set by the module, and it has been updated in the current fingerprints list, it will be automatically updated when the prints list gets an update. Just reboot to apply. This function can be turned of in the script settings (see ["Prop script settings"](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config#prop-script-settings) below) -**_Current fingerprints list version - v48_** +**_Current fingerprints list version - v49_** ## Please add support for device X @@ -201,8 +201,9 @@ If you want to simulate a specific device (to get access to device specific apps - ro.build.version.release - ro.build.id - ro.build.version.incremental +- ro.build.version.sdk -By default all props are set when this option is activated, but it is possible to activate and deactivate each prop individually. +By default all props are set when this option is activated, but it is possible to deactivate and activate each prop individually. Whenever a fingerprint is set by the module, the `ro.build.description` prop will be set automatically independently from if the general device simulation option is enabled or not. @@ -257,9 +258,9 @@ If the prop has been removed, the command should return nothing. 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 post-fs-data to late_start service. Running the script in post-fs-data is required for the SafetyNet fix and custom props to work on some ROM/device combinations, and is also more reliable overall. If there are any kind of issues during boot, try changing the boot stage to late_start service instead. Just keep in mind that this might cause setting the build fingerprint to fail. +It's possible to move the execution of the boot script from the default system.prop file to either post-fs-data or late_start service. If there are any kind of issues during boot or that props don't set properly, try changing the boot stage to either post-fs-data or late_start service instead. Just keep in mind that this might cause other issues like the fingerprint not setting properly (if set during late_start service) or that post-fs-data will be interupted by having too many props causing the script to run too slow. -Note: post-fs-data runs earlier than late_start service. +Note: post-fs-data runs earlier than system.prop and late_start service runs after, right at the end of the boot process. ### Script colours This option will disable or enable colours for the `props` script. @@ -268,7 +269,7 @@ This option will disable or enable colours for the `props` script. 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). ### Automatic fingerprint update -Whenever there is an update to the fingerprints list and if you have a fingerprint applied for a device that is on the list, the fingerprint will automatically be updated (if there is an update to that particular fingerprint). +Whenever there is an update to the fingerprints list and if you have a fingerprint applied for a device that is on the list, the fingerprint will automatically be updated (if there is an update to that particular fingerprint). This option will not update a fingerprint to one for a different Android version if there are several fingerprints available for the same device. ## Configuration file You can use a configuration file to set your desired options, rather than running the `props` command. This is particularly useful if you have a large amount of custom props you want to set. Download the [settings file](https://raw.githubusercontent.com/Magisk-Modules-Repo/MagiskHide-Props-Config/master/common/propsconf_conf) or extract it from the module zip ('propsconf_conf' in the common folder), fill in the desired options (follow the instructions in the file), place it /data or /cache (or /data/cache if you're using an A/B device) and reboot. You can also use the configuration file when first installing the module. Just place the file in the root of your internal storage (or one of the other previously mentioned locations) before flashing the module and the installation script will set everything up. @@ -280,7 +281,7 @@ This can also be done directly at the first install (through Manager or recovery **NOTE!** Upon detecting the file, the module installation/boot script will load the configured values into the module and then delete the the configuration file, so keep a copy somewhere if you want to use the same settings later. ### Setting up the module on a clean Magisk/ROM flash -After having made a clean ROM flash, the configuration file can be used to set the module up as you want without even having to boot first. First flash the ROM and Magisk. After that you can place the configuration file (see above) with your desired settings (fingerprint, custom props, etc) in the root of your internal storage, /data or /cache (or /data/cache if you're using an A/B device) and then install the module. This will set the module up just as you want it without having to do anything else. It is also possible to place the configuration file after having installed the module and rebooting (although you can only use /data or /cache as a location for the file). This will set everything up during boot, but it is possible that this won't work an all device/ROM combinations. If you experience issues, let the ROM boot once before setting everything up. +After having made a clean ROM flash, the configuration file can be used to set the module up as you want without even having to boot first. First flash the ROM and Magisk. After that you can place the configuration file (see above) with your desired settings (fingerprint, custom props, etc) in the root of your internal storage (/sdcard), /data or /cache (or /data/cache if you're using an A/B device) and then install the module. This will set the module up just as you want it without having to do anything else. It is also possible to place the configuration file after having installed the module and rebooting (although you can only use /data or /cache as a location for the file, /sdcard will not be mounted in time). This will set everything up during boot, but it is possible that this won't work an all device/ROM combinations. If you experience issues, let the ROM boot once before setting everything up. ## Miscellaneous MagiskHide issues @@ -294,8 +295,8 @@ If you have questions, suggestions or are experiencing some kind of issue, visit ### Known issues - MagiskHide Props Config v2.7.2 and earlier versions won't work on Magisk v18.1-d73127b1(18006) or later, due to internal changes in Magisk. -- Xiaomi devices (MIUI) sometimes have issues passing the ctsProfile check, particularly China releases. Try using [ShellHide](https://forum.xda-developers.com/apps/magisk/magisk-shellhide-t3855616) by @JayminSuthar together with this module. They might work in conjunction to get the device to pass SafetyNet. -- If you're on Android Pie you will have to use Magisk v17.2+. Any version prior to that will not be able to change the required prop values. This is because of a change in Android Pie, and with Magisk v17.2 the resetprop tool was been updated for this change. +- Xiaomi devices (MIUI) sometimes have issues passing the ctsProfile check, particularly China releases. Try using [ShellHide](https://forum.xda-developers.com/apps/magisk/magisk-shellhide-t3855616) by @JayminSuthar together with this module. They might work in conjunction to get the device to pass SafetyNet. This should only be necessary on Magisk releases up to v18.1, due to later versions of Magisk having an updated and improved MagiskHide. +- If you're on Android Pie you will have to use Magisk v17.2+. Any version prior to that will not be able to change the required prop values. This is because of a change in Android Pie, and with Magisk v17.2 the resetprop tool was updated for this change. ### An option is marked as "disabled" A couple of the options in the `props` script will be automatically disabled in some circumstances. These are: @@ -309,7 +310,7 @@ See ["I still can't pass the ctsProfile check"](https://github.com/Magisk-Module Also see ["Props don't seem to set properly"](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config/blob/master/README.md#props-dont-seem-to-set-properly) below. ### I can't pass the basicIntegrity check -This module can only really help with the ctsProfile check, by spoofing the device fingerprint. If you can't pass basicIntegrity, there's probably something else going on with your device. See ["Miscellaneous MagiskHide issues"](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config/blob/master/README.md#miscellaneous-magiskhide-issues) above. +This module can usually only really help with the ctsProfile check, by spoofing the device fingerprint. If you can't pass basicIntegrity, there's probably something else going on with your device, but there is a possibility that changing the device fingerprint can make this pass as well. If you can't get things working, see ["Miscellaneous MagiskHide issues"](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config/blob/master/README.md#miscellaneous-magiskhide-issues) above. ### Props don't seem to set properly If it seems like props you're trying to set with the module don't get set properly (ctsProfile still doesn't pass, custom props don't work, etc), go into the script options and change the boot stage at which the props are being set, or change the boot stage for that particular prop. See ["Boot stage"](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config#boot-stage) or ["Custom prop values"](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config/blob/master/README.md#changeset-custom-prop-values) above. @@ -322,7 +323,7 @@ In case of issues, if you've set a prop value that doesn't work on your device c Place a file named `reset_mhpc` in /cache (or /data/cache on A/B devices) and reboot. -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. +It is possible to use this in combination with the [configuration file](https://github.com/Magisk-Modules-Repo/MagiskHide-Props-Config/blob/master/README.md#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. ### The Play Store is "uncertified" If your device's Play Store reports that the device is "uncertified", this is usually fixed by making sure that you pass SafetyNet and then clearing data for the Play Store (and possibly rebooting). More details in the [Magisk troubleshooting guide](https://www.didgeridoohan.com/magisk/MagiskHide#hn_Device_uncertified_in_Play_storeNetflix_and_other_apps_wont_install_or_doesnt_show_up). @@ -357,6 +358,17 @@ Releases from v2.4.1 are compatible with Magisk v17+. ## Changelog +### v3.5.0 +- Added ro.build.version.sdk to the device simulation props (see the documentation for details). +- Updated editing the device fingerprint feature so that fingerprints for different Android versions can be added to the fingerprints list and the user can pick the desired one when applying a new fingerprint (see the documentation for details). Several fingerprints have been updated with dual fingerprints. +- Updated and optimised when props are set during boot. Uses Magisk's system.prop function by default, rather than post-fs-data, to avoid putting a strain on the system during boot. At what boot stage props are set can of course be completely configured by the user (see the documentation for details). +- Updated the configuration file to match current settings (see the documentation for details). Update your personal files to match. +- Fixed a bug where the props file wouldn't get the proper permissions when using the configuration file on a clean install. +- Fixed a bug where saving the simulation value for ro.build.version.incremental would give a wrong vaule. +- Fixed an infinite loop bug if making an invalid choice when asked to reboot. +- Optimised and cleaned up some code here and there. +- Updated the fingerprints list. Added Asus Zenfone Max Pro M1 and Huawei Honor 8X to the list, and updated Huawei Honor 9, P20 Pro and Xiaomi Mi 8 and Mi Mix 2S. List updated to v49. + ### v3.0.3 - Small update to the query for activating device simulation or not when picking a new fingerprint. - Updated the fingerprints list and added Asus Zenfone Max M1 and the Elephone U Pro to the list, and updated the OnePlus 5. List updated to v44. @@ -577,10 +589,11 @@ Releases from v2.4.1 are compatible with Magisk v17+. ## Current fingerprints list -### List v48 +### List v49 - Asus Zenfone 2 Laser (6.0.1) - Asus Zenfone 4 Max (7.1.1) - Asus Zenfone Max M1 (8.0.0) +- Asus Zenfone Max Pro M1 (8.1.0) - Asus ZenPad S 8.0 (6.0.1) - Elephone U Pro (8.0.0) - Essential PH-1 (9) @@ -596,10 +609,10 @@ Releases from v2.4.1 are compatible with Magisk v17+. - Google Nexus 9 WiFi (7.1.1) - Google Nexus 9 LTE (7.1.1) - Google Nexus 10 (5.1.1) -- Google Pixel (9) -- Google Pixel XL (9) -- Google Pixel 2 (9) -- Google Pixel 2 XL (9) +- Google Pixel (8.1.0 & 9) +- Google Pixel XL (8.1.0 & 9) +- Google Pixel 2 (8.1.0 & 9) +- Google Pixel 2 XL (8.1.0 & 9) - Google Pixel 3 (9) - Google Pixel 3 XL (9) - Google Pixel C (8.1.0) @@ -607,7 +620,8 @@ Releases from v2.4.1 are compatible with Magisk v17+. - HTC U11 (8.0.0) - HTC U12 Plus (8.0.0) - Huawei Honor 6X (8.0.0) -- Huawei Honor 9 (8.0.0) +- Huawei Honor 8X (8.1.0) +- Huawei Honor 9 (8.0.0 & 9) - Huawei Mate 10 (8.0.0) - Huawei Mate 10 Pro (8.0.0) - Huawei Mate 20 Pro (9) @@ -616,7 +630,7 @@ Releases from v2.4.1 are compatible with Magisk v17+. - Huawei P9 Lite (7.0) - Huawei P9 Plus (7.0) - Huawei P20 (9) -- Huawei P20 Pro (8.1.0) +- Huawei P20 Pro (8.1.0 & 9) - LeEco Le Pro3 (6.0.1) - LG G2 BS980 (5.0.2) - LG G4 H812 (6.0) @@ -643,9 +657,9 @@ Releases from v2.4.1 are compatible with Magisk v17+. - OnePlus X (6.0.1) - OnePlus 3 (8.0.0) - OnePlus 3T (8.0.0) -- OnePlus 5 (8.1.0) -- OnePlus 5T (9) -- OnePlus 6 (9) +- OnePlus 5 (8.1.0 & 9) +- OnePlus 5T (8.1.0 & 9) +- OnePlus 6 (8.1.0 & 9) - OnePlus 6T (9) - Razer Phone (8.1.0) - Razer Phone 2 (8.1.0) @@ -687,7 +701,7 @@ Releases from v2.4.1 are compatible with Magisk v17+. - Sony Xperia XZ Premium (8.0.0) - Sony Xperia XZ Premium Dual (8.0.0) - Sony Xperia XZ1 (8.0.0) -- Sony Xperia XZ1 Compact (9) +- Sony Xperia XZ1 Compact (8.0.0 & 9) - Sony Xperia XZ1 Dual (8.0.0) - Sony Xperia XZ2 (8.0.0) - Sony Xperia XZ2 Compact (8.0.0) @@ -708,19 +722,19 @@ Releases from v2.4.1 are compatible with Magisk v17+. - Vodafone Smart Ultra 6 (5.1.1) - Xiaomi Mi 3/4 (6.0.1) - Xiaomi Mi 4C (7.0) -- Xiaomi Mi 5/5 Pro (8.0.0) +- Xiaomi Mi 5/5 Pro (7.0 & 8.0.0) - Xiaomi Mi 5S (7.0) -- Xiaomi Mi 5S Plus (7.0) +- Xiaomi Mi 5S Plus (6.0.1 & 7.0) - Xiaomi Mi 6 (8.0.0) -- Xiaomi Mi 8 (9) -- Xiaomi Mi A1 (9) -- Xiaomi Mi A2 (9) +- Xiaomi Mi 8 (8.1.0 & 9) +- Xiaomi Mi A1 (8.0.0 & 9) +- Xiaomi Mi A2 (8.1.0 & 9) - Xiaomi Mi A2 Lite (9) - Xiaomi Mi Max (6.0.1) - Xiaomi Mi Max 2 (7.1.1) - Xiaomi Mi Mix 2 (8.0.0) -- Xiaomi Mi Mix 2S (9) -- Xiaomi Mi Note 2 (8.0.0) +- Xiaomi Mi Mix 2S (8.0.0 & 9) +- Xiaomi Mi Note 2 (7.0 & 8.0.0) - Xiaomi Mi Pad 4 (8.1.0) - Xiaomi Pocophone F1 (9) - Xiaomi Redmi 3/3 Pro (5.1.1) @@ -737,7 +751,7 @@ Releases from v2.4.1 are compatible with Magisk v17+. - Xiaomi Redmi Note 5A Lite (7.1.2) - Xiaomi Redmi Note 6 Pro (8.1.0) - Xiaomi Redmi Y1 (7.1.2) -- ZTE Axon 7 (8.0.0) +- ZTE Axon 7 (7.1.1 & 8.0.0) - ZTE Blade (6.0.1) - ZTE Nubia Z17 (7.1.1) - Zuk Z2 Pro (7.0) diff --git a/common/post-fs-data.sh b/common/post-fs-data.sh index e845701..9710c41 100644 --- a/common/post-fs-data.sh +++ b/common/post-fs-data.sh @@ -1,15 +1,11 @@ #!/system/bin/sh -# Please don't hardcode /magisk/modname/... ; instead, please use $MODPATH/... -# This will make your scripts compatible even if Magisk change its mount point in the future -MODPATH=${0%/*} - -# This script will be executed in post-fs-data mode -# More info in the main Magisk thread # MagiskHide Props Config # Copyright (c) 2018-2019 Didgeridoohan @ XDA Developers # Licence: MIT +MODPATH=${0%/*} + # Load functions . $MODPATH/util_functions.sh @@ -88,7 +84,22 @@ done log_handler "Default values saved to $LATEFILE." # Check if default file values are safe -orig_safe +replace_fn FILESAFE 0 1 $LATEFILE +for V in $PROPSLIST; do + FILEVALUE=$(resetprop $V) + log_handler "Checking ${V}=${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 + 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 # Loading the new values . $LATEFILE @@ -98,18 +109,30 @@ config_file # Edits prop values if set for post-fs-data echo -e "\n--------------------" >> $LOGFILE 2>&1 log_handler "Editing prop values in post-fs-data mode." -if [ "$OPTIONLATE" == 0 ]; then +if [ "$OPTIONBOOT" == 1 ]; then # ---Setting/Changing fingerprint--- - print_edit + if [ "$PRINTSTAGE" == 0 ]; then + print_edit + fi # ---Setting device simulation props--- - dev_sim_edit + if [ "$SIMSTAGE" == 0 ]; then + dev_sim_edit + fi # ---Setting custom props--- custom_edit "CUSTOMPROPS" fi -# Deleting props -prop_del +# Edit fingerprint if set for post-fs-data +if [ "$OPTIONBOOT" != 1 ] && [ "$PRINTSTAGE" == 1 ]; then + print_edit +fi +# Edit simulation props if set for post-fs-data +if [ "$OPTIONBOOT" != 1 ] && [ "$SIMSTAGE" == 1 ]; then + dev_sim_edit +fi # Edit custom props set for post-fs-data custom_edit "CUSTOMPROPSPOST" +# Deleting props +prop_del echo -e "\n--------------------" >> $LOGFILE 2>&1 # Edits build.prop diff --git a/common/prints.sh b/common/prints.sh index 8e751c5..c565f2c 100644 --- a/common/prints.sh +++ b/common/prints.sh @@ -4,14 +4,15 @@ # Copyright (c) 2018-2019 Didgeridoohan @ XDA Developers # Licence: MIT -PRINTSV=48 -PRINTSTRANSF=260 +PRINTSV=49 +PRINTSTRANSF=350 # Certified fingerprints PRINTSLIST=" Asus Zenfone 2 Laser (6.0.1)=asus/WW_Z00L/ASUS_Z00L_63:6.0.1/MMB29P/WW_user_21.40.1220.2196_20180308:user/release-keys Asus Zenfone 4 Max (7.1.1)=asus/WW_Phone/ASUS_X00HD_4:7.1.1/NMF26F/14.2016.1801.372-20180119:user/release-keys Asus Zenfone Max M1 (8.0.0)=asus/WW_X00PD/ASUS_X00P_4:8.0.0/OPR1.170623.032/15.00.1811.91:user/release-keys__2018-11-05 +Asus Zenfone Max Pro M1 (8.1.0)=asus/RU_X00TD/ASUS_X00T_6:8.1.0/OPM1/15.2016.1902.340-20190216:user/release-keys__2019-02-01 Asus ZenPad S 8.0 (6.0.1)=asus/WW_P01M/P01M_3:6.0.1/MMB29P/WW_P01M-V5.6.0-20170608:user/release-keys Elephone U Pro (8.0.0)=Elephone/U_Pro/U_Pro:8.0.0/Elephone_U_Pro_20180917/09172123:user/release-keys__2018-09-05 Essential PH-1 (9)=essential/mata/mata:9/PQ1A.190105.024/462:user/release-keys__2019-03-05 @@ -27,10 +28,10 @@ Google Nexus 7 2013 LTE (6.0.1)=google/razorg/deb:6.0.1/MOB30X/3036618:user/rele Google Nexus 9 WiFi (7.1.1)=google/volantis/flounder:7.1.1/N9F27M/4333998:user/release-keys Google Nexus 9 LTE (7.1.1)=google/volantisg/flounder_lte:7.1.1/N4F27P/4333386:user/release-keys Google Nexus 10 (5.1.1)=google/mantaray/manta:5.1.1/LMY49J/2640980:user/release-keys -Google Pixel (9)=google/sailfish/sailfish:9/PQ2A.190305.002/5240760:user/release-keys__2019-03-05 -Google Pixel XL (9)=google/marlin/marlin:9/PQ2A.190305.002/5240760:user/release-keys__2019-03-05 -Google Pixel 2 (9)=google/walleye/walleye:9/PQ2A.190305.002/5240760:user/release-keys__2019-03-05 -Google Pixel 2 XL (9)=google/taimen/taimen:9/PQ2A.190305.002/5240760:user/release-keys__2019-03-05 +Google Pixel (8.1.0 & 9)=google/sailfish/sailfish:8.1.0/OPM2.171019.029/4657601:user/release-keys;google/sailfish/sailfish:9/PQ2A.190305.002/5240760:user/release-keys__2019-03-05 +Google Pixel XL (8.1.0 & 9)=google/marlin/marlin:8.1.0/OPM2.171019.029/4657601:user/release-keys;google/marlin/marlin:9/PQ2A.190305.002/5240760:user/release-keys__2019-03-05 +Google Pixel 2 (8.1.0 & 9)=google/walleye/walleye:8.1.0/OPM2.171019.029/4657601:user/release-keys;google/walleye/walleye:9/PQ2A.190305.002/5240760:user/release-keys__2019-03-05 +Google Pixel 2 XL (8.1.0 & 9)=google/taimen/taimen:8.1.0/OPM4.171019.016.B1/4720843:user/release-keys;google/taimen/taimen:9/PQ2A.190305.002/5240760:user/release-keys__2019-03-05 Google Pixel 3 (9)=google/blueline/blueline:9/PQ2A.190305.002/5240760:user/release-keys__2019-03-05 Google Pixel 3 XL (9)=google/crosshatch/crosshatch:9/PQ2A.190305.002/5240760:user/release-keys__2019-03-05 Google Pixel C (8.1.0)=google/ryu/dragon:8.1.0/OPM8.190305.001/5238107:user/release-keys__2019-03-05 @@ -38,7 +39,8 @@ HTC 10 (6.0.1)=htc/HTCOneM10vzw/htc_pmewl:6.0.1/MMB29M/774095.8:user/release-key HTC U11 (8.0.0)=htc/ocndtwl_01405/htc_ocndtwl:8.0.0/OPR6.170623.013/1017190.2:user/release-keys HTC U12 Plus (8.0.0)=htc/imeuhl_00617/htc_imeuhl:8.0.0/OPR1.170623.032/1041457.3:user/release-keys__2018-06-01 Huawei Honor 6X (8.0.0)=HONOR/BLN-AL10/HWBLN-H:8.0.0/HONORBLN-AL10/528(C00):user/release-keys -Huawei Honor 9 (8.0.0)=HONOR/STF-L09/HWSTF:8.0.0/HUAWEISTF-L09/364(C432):user/release-keys +Huawei Honor 8X (8.1.0)=HONOR/JSN-L21RU/HWJSN-H:8.1.0/HONORJSN-L21/101(C10):user/release-keys__2018-10-01 +Huawei Honor 9 (8.0.0 & 9)=HONOR/STF-L09/HWSTF:8.0.0/HUAWEISTF-L09/364(C432):user/release-keys;HONOR/STF-L09/HWSTF:9/HUAWEISTF-L09/157C432R1:user/release-keys__2019-02-01 Huawei Mate 10 (8.0.0)=HUAWEI/ALP-L29/HWALP:8.0.0/HUAWEIALP-L29S/143(C636):user/release-keys__2018-10-01 Huawei Mate 10 Pro (8.0.0)=HUAWEI/BLA-L29/HWBLA:8.0.0/HUAWEIBLA-L29S/137(C432):user/release-keys Huawei Mate 20 Pro (9)=HUAWEI/LYA-L29/HWLYA:9/HUAWEILYA-L29/183AUSC636R1:user/release-keys @@ -47,7 +49,7 @@ Huawei P9 (7.0)=HUAWEI/EVA-L09/HWEVA:7.0/HUAWEIEVA-L09/C432B502:user/release-key Huawei P9 Lite (7.0)=HUAWEI/VNS-L31/HWVNS-H:7.0/HUAWEIVNS-L31/C432B414:user/release-keys__2018-06-01 Huawei P9 Plus (7.0)=HUAWEI/VIE-L09/HWVIE:7.0/HUAWEIVIE-L09/C432B387:user/release-keys__2018-07-01 Huawei P20 (9)=HUAWEI/EML-L29/HWEML:9/HUAWEIEML-L29/197C432R1:user/release-keys__2019-01-01 -Huawei P20 Pro (8.1.0)=HUAWEI/CLT-L29/HWCLT:8.1.0/HUAWEICLT-L29/128(C432):user/release-keys +Huawei P20 Pro (8.1.0 & 9)=HUAWEI/CLT-L29/HWCLT:8.1.0/HUAWEICLT-L29/128(C432):user/release-keys;HUAWEI/CLT-L09/HWCLT:9/HUAWEICLT-L09/203C432R1:user/release-keys__2019-02-01 LeEco Le Pro3 (6.0.1)=LeEco/ZL1_NA/le_zl1:6.0.1/WEXNAOP5802101261S/letv01261206:user/release-keys LG G2 BS980 (5.0.2)=lge/g2_vzw/g2:5.0.2/LRX22G/15046001715f9:user/release-keys LG G4 H812 (6.0)=lge/p1_rgs_ca/p1:6.0/MRA58K/1601215569825:user/release-keys @@ -62,7 +64,7 @@ Motorola Moto E5 Plus (8.0.0)=motorola/hannah_sprint/hannah:8.0.0/OCPS27.91-32-4 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 -Motorola Moto G5S (7.1.1)=motorola/montana/montana:7.1.1/NPPS26.102-49-8/6:user/release-keys +Motorola Moto G5S (7.1.1 & 8.1.0)=motorola/montana/montana:7.1.1/NPPS26.102-49-8/6:user/release-keys Motorola Moto G6 Play (8.0.0)=motorola/jeter_sprint/jeter:8.0.0/OCP27.91-23/23:user/release-keys Motorola Moto X4 (8.0.0)=motorola/payton/payton:8.0.0/OPWS27.57-25-6-10/12:user/release-keys Motorola Moto Z2 Play (8.0.0)=motorola/albus/albus:8.0.0/OPS27.76-12-25/26:user/release-keys @@ -74,9 +76,9 @@ OnePlus 2 (6.0.1)=OnePlus/OnePlus2/OnePlus2:6.0.1/MMB29M/1447858500:user/release OnePlus X (6.0.1)=OnePlus/OnePlus/OnePlus:6.0.1/MMB29M/10281213:user/release-keys OnePlus 3 (8.0.0)=OnePlus/OnePlus3/OnePlus3:8.0.0/OPR1.170623.032/1809142047:user/release-keys__2018-09-01 OnePlus 3T (8.0.0)=OnePlus/OnePlus3/OnePlus3T:8.0.0/OPR1.170623.032/1812060016:user/release-keys__2018-11-01 -OnePlus 5 (9)=OnePlus/OnePlus5/OnePlus5:9/PKQ1.180716.001/1812102249:user/release-keys__2018-12-01 -OnePlus 5T (9)=OnePlus/OnePlus5T/OnePlus5T:9/PKQ1.180716.001/1902221914:user/release-keys__2019-01-01 -OnePlus 6 (9)=OnePlus/OnePlus6/OnePlus6:9/PKQ1.180716.001/1809150000:user/release-keys__2018-09-05 +OnePlus 5 (8.1.0 & 9)=OnePlus/OnePlus5/OnePlus5:8.1.0/OPM1.171019.011/1809241512:user/release-keys__2018-09-01;OnePlus/OnePlus5/OnePlus5:9/PKQ1.180716.001/1812102249:user/release-keys__2018-12-01 +OnePlus 5T (8.1.0 & 9)=OnePlus/OnePlus5T/OnePlus5T:8.1.0/OPM1.171019.011/1809241512:user/release-keys__2018-09-01;OnePlus/OnePlus5T/OnePlus5T:9/PKQ1.180716.001/1902221914:user/release-keys__2019-01-01 +OnePlus 6 (8.1.0 & 9)=OnePlus/OnePlus6/OnePlus6:8.1.0/OPM1.171019.011/06140300:user/release-keys;OnePlus/OnePlus6/OnePlus6:9/PKQ1.180716.001/1809150000:user/release-keys__2018-09-05 OnePlus 6T (9)=OnePlus/OnePlus6T/OnePlus6T:9/PKQ1.180716.001/1901231231:user/release-keys__2019-01-01 Razer Phone (8.1.0)=razer/cheryl/cheryl:8.1.0/OPM1.171019.011-RZR-180803/6033:user/release-keys__2018-07-05 Razer Phone 2 (8.1.0)=razer/cheryl2/aura:8.1.0/O-MR2-RC009-RZR-181124/2009:user/release-keys__2018-10-05 @@ -118,7 +120,7 @@ Sony Xperia XZ Dual (8.0.0)=Sony/F8332/F8332:8.0.0/41.3.A.2.99/1455830589:user/r Sony Xperia XZ Premium (8.0.0)=Sony/G8141/G8141:8.0.0/47.1.A.12.179/1909673090:user/release-keys Sony Xperia XZ Premium Dual (8.0.0)=Sony/G8142/G8142:8.0.0/47.1.A.12.179/1909673090:user/release-keys Sony Xperia XZ1 (8.0.0)=Sony/G8341/G8341:8.0.0/47.1.A.12.179/1909673090:user/release-keys -Sony Xperia XZ1 Compact (9)=Sony/G8441/G8441:9/47.2.A.2.33/3676206253:user/release-keys__2018-11-01 +Sony Xperia XZ1 Compact (8.0.0 & 9)=Sony/G8441/G8441:8.0.0/47.1.A.12.179/1909673090:user/release-keys;Sony/G8441/G8441:9/47.2.A.2.33/3676206253:user/release-keys__2018-11-01 Sony Xperia XZ1 Dual (8.0.0)=Sony/G8342/G8342:8.0.0/47.1.A.12.179/1909673090:user/release-keys Sony Xperia XZ2 (8.0.0)=Sony/H8216/H8216:8.0.0/51.1.A.3.159/620448843:user/release-keys Sony Xperia XZ2 Compact (8.0.0)=Sony/H8314/H8314:8.0.0/51.1.A.3.159/620448843:user/release-keys @@ -139,19 +141,19 @@ Sony Xperia Z5 Premium Dual (7.1.1)=Sony/E6883/E6883:7.1.1/32.4.A.1.54/376107309 Vodafone Smart Ultra 6 (5.1.1)=Vodafone/P839V55/P839V55:5.1.1/LMY47V/20161227.134319.15534:user/release-keys Xiaomi Mi 3/4 (6.0.1)=Xiaomi/cancro/cancro:6.0.1/MMB29M/V9.5.2.0.MXDMIFA:user/release-keys Xiaomi Mi 4C (7.0)=Xiaomi/libra/libra:7.0/NRD90M/V9.6.2.0.NXKCNFD:user/release-keys -Xiaomi Mi 5/5 Pro (8.0.0)=Xiaomi/gemini/gemini:8.0.0/OPR1.170623.032/V9.6.1.0.OAAMIFD:user/release-keys +Xiaomi Mi 5/5 Pro (7.0 & 8.0.0)=Xiaomi/gemini/gemini:7.0/NRD90M/V9.2.1.0.NAAMIEK:user/release-keys;Xiaomi/gemini/gemini:8.0.0/OPR1.170623.032/V9.6.1.0.OAAMIFD:user/release-keys Xiaomi Mi 5S (7.0)=Xiaomi/capricorn/capricorn:7.0/NRD90M/V9.5.4.0.NAGMIFD:user/release-keys -Xiaomi Mi 5S Plus (7.0)=Xiaomi/natrium/natrium:7.0/NRD90M/V9.6.2.0.NBGMIFD:user/release-keys +Xiaomi Mi 5S Plus (6.0.1 & 7.0)=Xiaomi/natrium/natrium:6.0.1/MXB48T/V8.5.2.0.MBGMIED:user/release-keys;Xiaomi/natrium/natrium:7.0/NRD90M/V9.6.2.0.NBGMIFD:user/release-keys Xiaomi Mi 6 (8.0.0)=Xiaomi/sagit/sagit:8.0.0/OPR1.170623.027/V9.2.3.0.OCAMIEK:user/release-keys -Xiaomi Mi 8 (9)=Xiaomi/dipper/dipper:9/PKQ1.180729.001/V10.1.2.0.PEAMIFI:user/release-keys__2018-11-01 -Xiaomi Mi A1 (9)=xiaomi/tissot/tissot_sprout:9/PKQ1.180917.001/V10.0.4.0.PDHMIXM:user/release-keys_2019-01-05 -Xiaomi Mi A2 (9)=xiaomi/jasmine/jasmine_sprout:9/PKQ1.180904.001/V10.0.4.0.PDIMIXM:user/release-keys__2019-02-05 +Xiaomi Mi 8 (8.1.0 & 9)=Xiaomi/dipper/dipper:8.1.0/OPM1.171019.011/V9.5.5.0.OEAMIFA:user/release-keys;Xiaomi/dipper/dipper:9/PKQ1.180729.001/V10.2.3.0.PEAMIXM:user/release-keys__2019-02-01 +Xiaomi Mi A1 (8.0.0 & 9)=xiaomi/tissot/tissot_sprout:8.0.0/OPR1.170623.026/V.9.5.10.0.ODHMIFA:user/release-keys;xiaomi/tissot/tissot_sprout:9/PKQ1.180917.001/V10.0.4.0.PDHMIXM:user/release-keys_2019-01-05 +Xiaomi Mi A2 (8.1.0 & 9)=xiaomi/jasmine/jasmine_sprout:8.1.0/OPM1.171019.011/V9.6.16.0.ODIMIFE:user/release-keys__2018-11-05;xiaomi/jasmine/jasmine_sprout:9/PKQ1.180904.001/V10.0.4.0.PDIMIXM:user/release-keys__2019-02-05 Xiaomi Mi A2 Lite (9)=xiaomi/daisy/daisy_sprout:9/PKQ1.180917.001/V10.0.1.0.PDLMIFJ:user/release-keys__2018-11-05 Xiaomi Mi Max (6.0.1)=Xiaomi/helium/helium:6.0.1/MMB29M/V8.2.3.0.MBDMIDL: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 2 (8.0.0)=Xiaomi/chiron/chiron:8.0.0/OPR1.170623.027/V10.2.2.0.ODEMIXM:user/release-keys__2018-12-01 -Xiaomi Mi Mix 2S (9)=Xiaomi/polaris/polaris:9/PKQ1.180729.001/V10.2.1.0.PDGMIXM:user/release-keys__2018-11-01 -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 Mi Mix 2S (8.0.0 & 9)=Xiaomi/polaris/polaris:8.0.0/OPR1.170623.032/V9.5.19.0.ODGMIFA:user/release-keys;Xiaomi/polaris/polaris:9/PKQ1.180729.001/V10.2.2.0.PDGMIXM:user/release-keys__2019-02-01 +Xiaomi Mi Note 2 (7.0 & 8.0.0)=Xiaomi/scorpio/scorpio:7.0/NRD90M/V9.2.1.0.NADMIEK:user/release-keys;Xiaomi/scorpio/scorpio:8.0.0/OPR1.170623.032/V9.6.1.0.OADCNFD:user/release-keys Xiaomi Mi Pad 4 (8.1.0)=Xiaomi/clover/clover:8.1.0/OPM1.171019.019/V10.1.1.0.ODJCNFI:user/release-keys__2018-10-01 Xiaomi Pocophone F1 (9)=Xiaomi/beryllium/beryllium:9/PKQ1.180729.001/V10.2.3.0.PEJMIXM:user/release-keys__2019-02-05 Xiaomi Redmi 3/3 Pro (5.1.1)=Xiaomi/ido/ido:5.1.1/LMY47V/V9.6.2.0.LAIMIFD:user/release-keys @@ -168,7 +170,7 @@ Xiaomi Redmi Note 5 Pro (8.1.0)=xiaomi/whyred/whyred:8.1.0/OPM1.171019.011/V10.0 Xiaomi Redmi Note 5A Lite (7.1.2)=xiaomi/ugglite/ugglite:7.1.2/N2G47H/V9.1.2.0.NDFMIEI:user/release-keys Xiaomi Redmi Note 6 Pro (8.1.0)=xiaomi/tulip/tulip:8.1.0/OPM1.171019.011/V10.0.5.0.OEKMIFH:user/release-keys__2018-10-01 Xiaomi Redmi Y1 (7.1.2)=xiaomi/ugg/ugg:7.1.2/N2G47H/V9.6.2.0.NDKMIFD:user/release-keys__2018-07-01 -ZTE Axon 7 (8.0.0)=ZTE/P996A01_O/ailsa_ii:8.0.0/OPR1.170623.032/20180815.171922:user/release-keys__2018-07-01 +ZTE Axon 7 (7.1.1 & 8.0.0)=ZTE/P996A01_N/ailsa_ii:7.1.1/NMF26V/20171211.005949:user/release-keys;ZTE/P996A01_O/ailsa_ii:8.0.0/OPR1.170623.032/20180815.171922:user/release-keys__2018-07-01 ZTE Blade (6.0.1)=ZTE/P809A50_MY_MAX/P809A50:6.0.1/MMB29M/20161017.095504: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_conf b/common/propsconf_conf index 6fb5c61..2f08437 100644 --- a/common/propsconf_conf +++ b/common/propsconf_conf @@ -4,12 +4,13 @@ # Copyright (c) 2018-2019 Didgeridoohan @ XDA Developers # Licence: MIT -# Required module version -CONFTRANSF=300 +# Required module version. Do not edit this value! +CONFTRANSF=350 # Device fingerprint CONFFINGERPRINT="" CONFVENDPRINT=false +CONFPRINTBOOT=default # Device simulation CONFDEVSIM=false @@ -20,6 +21,8 @@ CONFRELEASE=true CONFID=true CONFINCREMENTAL=true CONFDESCRIPTION=true +CONFSDK=true +CONFSIMBOOT=default # Edit prop files CONFPROPFILES=false @@ -42,9 +45,10 @@ CONFDELPROPS="" DELPROPOPTION=replace # Module settings -CONFLATE=false +CONFBOOT=default CONFCOLOUR=true CONFWEB=true +CONFUPDATE=true # ================================================================= # ========================== Instructions ========================= @@ -82,15 +86,25 @@ CONFWEB=true # fingerprint for Treble GSI ROMs (so only us this if you're on a Treble GSI ROM). # NOTE! Keep in mind that there is no need to enter a fingerprint in # CONFFINGERPRINT when enabling this option, or setting a security patch date. +# +# CONFPRINTBOOT is by default set to using the module default boot stage for setting props. +# If the setting is changed to "post" or "late", the props will be set during either +# post-fs-data or late_start service mode. This is useful if props don't seem to set +# propely or the module's boot script seems to be causing issues during boot. # CONFDEVSIM and the following CONFBRAND, CONFNAME, CONFDEVICE, CONFRELEASE -# CONFID, CONFINCREMENTAL and CONFDESCRIPTION are used to set a number +# CONFID, CONFINCREMENTAL, CONFDESCRIPTION and CONFSDK are used to set a number # of props to simulate a certain deviced based on the fingerprint used. # CONFDESCRIPTION will automatically be applied if a fingerprint is set # by the module, but the other props will only be set if CONFDEVSIM is # set to true, and the default setting for all props are that they will be # set by the module. If you want to change this, change "true" to "false" # for the applicable variables. +# +# CONFSIMBOOT is by default set to using the module default boot stage for setting props. +# If the setting is changed to "post" or "late", the props will be set during either +# post-fs-data or late_start service mode. This is useful if props don't seem to set +# propely or the module's boot script seems to be causing issues during boot. # CONFPROPFILES should be set to "true" if you want to mask the file # values in build.prop and default.prop. For better root hiding. @@ -140,10 +154,10 @@ CONFWEB=true # This option supersedes the preserve option described above, but only # for the CONFDELPROPS variable. -# CONFLATE is by default set to "false". This loads the boot script during the -# post-fs-data mode. If the setting is changed to "true", the boot script -# will instead be loaded later during boot, in the late_start service mode. This is -# useful if the module's boot script seems to be causing issues during boot. +# CONFBOOT is by default set to using the module system.prop file for most props. +# If the setting is changed to "post" or "late", the props will be set during either +# post-fs-data or late_start service mode. This is useful if props don't seem to set +# propely or the module's boot script seems to be causing issues during boot. # -# CONFCOLOUR and CONFWEB are the options for colour and automatic fingerprints -# list update. See the module documentation for more details. Set to "true" or "false". +# CONFCOLOUR, CONFWEB and CONFUPDATE are the options for scrit colours, automatic fingerprints +# list update and automatic update of the set fingerprint. See the module documentation for more details. Set to "true" or "false". diff --git a/common/propsconf_late b/common/propsconf_late index a51b0fc..fb8ac83 100644 --- a/common/propsconf_late +++ b/common/propsconf_late @@ -10,37 +10,50 @@ # In that case, feel free to delete it. # Script version -SCRIPTV=23 +SCRIPTV=24 SETTRANSF=2 -NOTTRANSF="OPTIONLATE" +NOTTRANSF="" -# Variables -COREPATH=CORE_PLACEHOLDER +# Paths +COREPATHPH=CORE_PLACEHOLDER IMGPATH=$COREPATH/img MODPATH=$IMGPATH/MagiskHidePropsConf -CACHELOC=CACHE_PLACEHOLDER +CACHELOCPH=CACHE_PLACEHOLDER LATELOGFILE=$CACHELOC/propsconf_latefile.log +# Fingerprint FINGERPRINTENB=1 PRINTMODULE=0 PRINTEDIT=0 PRINTVEND=0 +PRINTCHK=0 + +# Simulation DEVSIM=0 + +# Prop files BUILDPROPENB=1 FILESAFE=1 BUILDEDIT=0 DEFAULTEDIT=0 + +# Custom props PROPCOUNT=0 PROPEDIT=0 CUSTOMEDIT=0 DELEDIT=0 -REBOOTCHK=0 -PRINTCHK=0 -OPTIONLATE=0 + +# Boot stages +PRINTSTAGE=0 +SIMSTAGE=0 + +# Script settings +OPTIONBOOT=0 OPTIONCOLOUR=1 OPTIONWEB=1 OPTIONUPDATE=1 +# Device simulation BRANDSET=1 NAMESET=1 DEVICESET=1 @@ -48,7 +61,10 @@ RELEASESET=1 IDSET=1 INCREMENTALSET=1 DESCRIPTIONSET=1 +SDKSET=1 +# Misc +REBOOTCHK=0 CACHEFILES=" propsconf_conf reset_mhpc @@ -72,6 +88,7 @@ ORIGRELEASE="" ORIGID="" ORIGINCREMENTAL="" ORIGDESCRIPTION="" +ORIGSDK="" # ---Module values--- MODULEDEBUGGABLE="" @@ -89,6 +106,7 @@ SIMRELEASE="" SIMID="" SIMINCREMENTAL="" SIMDESCRIPTION="" +SIMSDK="" # ---Custom prop values--- CUSTOMPROPS="" @@ -124,12 +142,12 @@ cleanup() { for ITEM in $CACHEFILES; do if [ -f "$CACHELOC/$ITEM" ]; then echo "Deleting ${ITEM}." >> $LATELOGFILE 2>&1 - rm -f $CACHELOC/$ITEM >> $LATELOGFILE 2>&1 + rm -f $CACHELOC/$ITEM fi done # Suicide. echo "Removing script." >> $LATELOGFILE 2>&1 - rm -f $0 >> $LATELOGFILE 2>&1 + rm -f $0 } # Checks if the module is installed. Deletes itself if it isn't. diff --git a/common/service.sh b/common/service.sh index e821337..bec0aef 100644 --- a/common/service.sh +++ b/common/service.sh @@ -1,19 +1,15 @@ #!/system/bin/sh -# Please don't hardcode /magisk/modname/... ; instead, please use $MODPATH/... -# This will make your scripts compatible even if Magisk change its mount point in the future -MODPATH=${0%/*} - -# This script will be executed in late_start service mode -# More info in the main Magisk thread # MagiskHide Props Config # Copyright (c) 2018-2019 Didgeridoohan @ XDA Developers # Licence: MIT +MODPATH=${0%/*} + # Load functions . $MODPATH/util_functions.sh -if [ "$OPTIONLATE" == 0 ]; then +if [ "$OPTIONBOOT" == 1 ]; then until [ ! -f "$POSTCHKFILE" ]; do sleep 1 done @@ -24,14 +20,26 @@ log_script_chk "Running service.sh module script." # Edits prop values if set for late_start service echo -e "\n--------------------" >> $LOGFILE 2>&1 log_handler "Editing prop values in late_start service mode." -if [ "$OPTIONLATE" == 1 ]; then +if [ "$OPTIONBOOT" == 2 ]; then # ---Setting/Changing fingerprint--- - print_edit + if [ "$PRINTSTAGE" == 0 ]; then + print_edit + fi # ---Setting device simulation props--- - dev_sim_edit + if [ "$SIMSTAGE" == 0 ]; then + dev_sim_edit + fi # ---Setting custom props--- custom_edit "CUSTOMPROPS" fi +# Edit fingerprint if set for late_start service +if [ "$OPTIONBOOT" != 2 ] && [ "$PRINTSTAGE" == 2 ]; then + print_edit +fi +# Edit simulation props if set for late_start service +if [ "$OPTIONBOOT" != 2 ] && [ "$SIMSTAGE" == 2 ]; then + dev_sim_edit +fi # Edit custom props set for late_start service custom_edit "CUSTOMPROPSLATE" # Edit MagiskHide sensitive values @@ -43,7 +51,6 @@ if [ "$PROPEDIT" == 1 ]; then MODULEPROP=$(echo "MODULE${PROP}" | tr '[:lower:]' '[:upper:]') if [ "$(eval "echo \$$REPROP")" == "true" ]; then log_handler "Changing/writing $ITEM." - resetprop -v $ITEM >> $LOGFILE 2>&1 resetprop -nv $ITEM $(eval "echo \$$MODULEPROP") >> $LOGFILE 2>&1 fi done diff --git a/common/util_functions.sh b/common/util_functions.sh index 532c439..582d728 100644 --- a/common/util_functions.sh +++ b/common/util_functions.sh @@ -4,41 +4,137 @@ # Copyright (c) 2018-2019 Didgeridoohan @ XDA Developers # Licence: MIT +# Finding file values +get_file_value() { + if [ -f "$1" ]; then + grep $2 $1 | sed "s|.*${2}||" | sed 's|\"||g' + fi +} + # ======================== Variables ======================== -MODVERSION=VER_PLACEHOLDER +if [ "$INSTFN" ]; then + # Installation (config.sh) + MODVERSION=$(echo $(get_file_value $INSTALLER/module.prop "version=") | sed 's|-.*||') + if [ "$MAGISK_VER_CODE" -ge 17316 ]; then + COREPATH=/sbin/.magisk + else + COREPATH=/sbin/.core + fi + ADBPATH=/data/adb + BIMGPATH=$COREPATH/img + $BOOTMODE && IMGPATH=$BIMGPATH || IMGPATH=$MOUNTPATH + if [ "$MAGISK_VER_CODE" -ge 17316 ]; then + POSTPATH=$ADBPATH/post-fs-data.d + SERVICEPATH=$ADBPATH/service.d + LATEHOLDER=$ADBPATH/service.d/propsconf_late + else + POSTPATH=$IMGPATH/.core/post-fs-data.d + SERVICEPATH=$IMGPATH/.core/service.d + LATEHOLDER=$BIMGPATH/.core/service.d/propsconf_late + fi + POSTFILE=$POSTPATH/propsconf_post + LATEFILE=$SERVICEPATH/propsconf_late + POSTLATEFILE=$POSTPATH/propsconf_late + UPDATELATEFILE=$INSTALLER/common/propsconf_late + MIRRORLOC=/sbin/.magisk/mirror/system + if [ -z $SLOT ]; then + CACHELOC=/cache + else + CACHELOC=/data/cache + fi + LOGFILE=$CACHELOC/propsconf_install.log + UPDATEV=$(get_file_value $UPDATELATEFILE "SCRIPTV=") + UPDATETRANSF=$(get_file_value $UPDATELATEFILE "SETTRANSF=") + NOTTRANSF=$(get_file_value $UPDATELATEFILE "NOTTRANSF=") + SETTINGSLIST=" + FINGERPRINTENB + PRINTMODULE + PRINTEDIT + PRINTVEND + PRINTCHK + DEVSIM + BUILDPROPENB + FILESAFE + BUILDEDIT + DEFAULTEDIT + PROPCOUNT + PROPEDIT + CUSTOMEDIT + DELEDIT + PRINTSTAGE + SIMSTAGE + OPTIONBOOT + OPTIONCOLOUR + OPTIONWEB + OPTIONUPDATE + BRANDSET + NAMESET + DEVICESET + RELEASESET + IDSET + INCREMENTALSET + DESCRIPTIONSET + SDKSET + REBOOTCHK + " + PROPSETTINGSLIST=" + MODULEDEBUGGABLE + MODULESECURE + MODULETYPE + MODULETAGS + MODULESELINUX + MODULEFINGERPRINT + SIMBRAND + SIMNAME + SIMDEVICE + SIMRELEASE + SIMID + SIMINCREMENTAL + SIMDESCRIPTION + SIMSDK + CUSTOMPROPS + CUSTOMPROPSPOST + CUSTOMPROPSLATE + DELETEPROPS + " +else + # Regular + # Placeholder variables + MODVERSIONPH=VER_PLACEHOLDER + LATEFILEPH=LATE_PLACEHOLDER + MIRRORLOCPH=MIRROR_PLACEHOLDER + CACHELOCPH=CACHE_PLACEHOLDER + BINPH=BIN_PLACEHOLDER + + # Log variables + LOGFILE=$CACHELOC/propsconf.log + LASTLOGFILE=$CACHELOC/propsconf_last.log + TMPLOGLOC=$CACHELOC/propslogs + TMPLOGLIST=" + $CACHELOC/magisk.log + $CACHELOC/magisk.log.bak + $CACHELOC/propsconf* + $MIRRORPATH/system/build.prop + $MIRRORPATH/vendor/build.prop + $LATEFILE + " +fi + MIRRORPATH=$COREPATH/mirror -LATEFILE=LATE_PLACEHOLDER -MIRRORLOC=MIRROR_PLACEHOLDER -CACHELOC=CACHE_PLACEHOLDER +SYSTEMFILE=$MODPATH/system.prop POSTCHKFILE=$CACHELOC/propsconf_postchk RUNFILE=$MODPATH/script_check -LOGFILE=$CACHELOC/propsconf.log -LASTLOGFILE=$CACHELOC/propsconf_last.log -TMPLOGLOC=$CACHELOC/propslogs -TMPLOGLIST=" -$CACHELOC/magisk.log -$CACHELOC/magisk.log.bak -/data/adb/magisk_debug.log -$CACHELOC/propsconf* -$MIRRORPATH/system/build.prop -$MIRRORPATH/vendor/build.prop -$LATEFILE -" -CONFFILELST=" -/sdcard/propsconf_conf -/data/propsconf_conf -$CACHELOC/propsconf_conf -" RESETFILE=$CACHELOC/reset_mhpc MAGISKLOC=/data/adb/magisk # Make sure that the terminal app used actually can see resetprop alias resetprop="$MAGISKLOC/magisk resetprop" # Finding installed Busybox if [ -d "$IMGPATH/busybox-ndk" ]; then - BBPATH=$(find $IMGPATH/busybox-ndk -name 'busybox') + BBPATH=$(find $IMGPATH/busybox-ndk -name 'busybox') else BBPATH=$(which busybox) fi +# Fingerprint variables PRINTSLOC=$MODPATH/prints.sh PRINTSTMP=$CACHELOC/prints.sh PRINTSWWW="https://raw.githubusercontent.com/Magisk-Modules-Repo/MagiskHide-Props-Config/master/common/prints.sh" @@ -46,8 +142,25 @@ PRINTSDEV="https://raw.githubusercontent.com/Didgeridoohan/Playground/master/pri PRINTFILES=$MODPATH/printfiles CSTMPRINTS=/sdcard/printslist CSTMFILE=$PRINTFILES/Custom.sh -BIN=BIN_PLACEHOLDER -USNFLIST=USNF_PLACEHOLDER + +# Known modules that edit device fingerprint +USNFLIST=" +xiaomi-safetynet-fix +safetynet-fingerprint-fix +VendingVisa +DeviceSpoofingTool4Magisk +universal-safetynet-fix +samodx-safetyskipper +safetypatcher +petnoires-safetyspoofer +" + +# Configuration file locations +CONFFILELST=" +/sdcard/propsconf_conf +/data/propsconf_conf +$CACHELOC/propsconf_conf +" # MagiskHide props PROPSLIST=" @@ -96,41 +209,68 @@ ro.vendor.build.fingerprint ro.build.description " +# Additional simulation props +ADNSIMPROPS=" +ro.build.version.sdk +" + +# Android API level +APILVL=" +4.2=17 +4.3=18 +4.4=19 +5.0=21 +5.1=22 +6.0=23 +7.0=24 +7.1=25 +8.0=26 +8.1=27 +9=28 +" + # Values props list -VALPROPSLIST=$PROPSLIST$PRINTPARTS$SNPROPS$ADNPROPS +VALPROPSLIST=$PROPSLIST$PRINTPARTS$SNPROPS$ADNPROPS$ADNSIMPROPS # Loading module settings -. $LATEFILE +if [ -z "$INSTFN" ]; then + . $LATEFILE +fi # ======================== General functions ======================== -# Finding file values -get_file_value() { - if [ -f "$1" ]; then - grep $2 $1 | sed "s|.*${2}||" | sed 's|\"||g' - fi -} - # Log functions -# Saves the previous log (if available) and creates a new one -log_start() { - if [ -f "$LOGFILE" ]; then - mv -f $LOGFILE $LASTLOGFILE - fi - touch $LOGFILE - echo "***************************************************" >> $LOGFILE 2>&1 - echo "********* MagiskHide Props Config $MODVERSION ********" >> $LOGFILE 2>&1 - echo "***************** By Didgeridoohan ***************" >> $LOGFILE 2>&1 - echo "***************************************************" >> $LOGFILE 2>&1 - log_script_chk "Log start." -} log_handler() { if [ "$(id -u)" == 0 ] ; then echo "" >> $LOGFILE 2>&1 echo -e "$(date +"%Y-%m-%d %H:%M:%S:%N") - $1" >> $LOGFILE 2>&1 fi } +# Saves the previous log (if available) and creates a new one +log_start() { + if [ -f "$LOGFILE" ]; then + if [ "$INSTFN" ]; then + rm -f $LOGFILE + else + mv -f $LOGFILE $LASTLOGFILE + fi + fi + touch $LOGFILE + echo "***************************************************" >> $LOGFILE 2>&1 + echo "********* MagiskHide Props Config $MODVERSION ********" >> $LOGFILE 2>&1 + echo "***************** By Didgeridoohan ***************" >> $LOGFILE 2>&1 + echo "***************************************************" >> $LOGFILE 2>&1 + if [ "$INSTFN" ]; then + log_handler "Starting module installation script" + else + log_script_chk "Log start." + fi +} log_print() { - echo "$1" + if [ "$INSTFN" ]; then + ui_print "$1" + else + echo "$1" + fi log_handler "$1" } log_script_chk() { @@ -210,10 +350,27 @@ get_device_used() { fi } -# Get Android version with 3 digits for current fingerprint +# Get the list of print version +get_print_versions() { + echo "$1" | sed 's|.*(||' | sed 's|).*||' | sed 's| \& | |g' +} + +# Get Android version with 3 digits for input get_android_version() { + VERTMP=$(echo $1 | sed 's|.||g') + if [ "${#VERTMP}" -lt 3 ]; then + until [ "${#VERTMP}" == 3 ] + do + VERTMP="$(echo ${VERTMP}0)" + done + fi + echo $VERTMP +} + +# Get Android version with 3 digits for current fingerprint +get_android_version_print() { print_parts $1 "var" - VERTMP=$VARRELEASE + VERTMP=$(echo $VARRELEASE | sed 's|.||g') if [ "${#VERTMP}" -lt 3 ]; then until [ "${#VERTMP}" == 3 ] do @@ -235,7 +392,11 @@ get_print_display() { # Replace file values replace_fn() { - sed -i "s|${1}=${2}|${1}=${3}|" $4 + if [ "$5" == "placeholder" ]; then + sed -i "s|${1}PH=${2}|${1}=${3}|" $4 + else + sed -i "s|${1}=${2}|${1}=${3}|" $4 + fi } # Format user files to remove Windows file endings @@ -265,13 +426,17 @@ force_reboot() { # Updates placeholders placeholder_update() { - FILEVALUE=$(get_file_value $1 "$2=") - log_handler "Checking for ${3} in ${1}. Current value is ${FILEVALUE}." - case $FILEVALUE in - *PLACEHOLDER*) replace_fn $2 $3 $4 $1 - log_handler "Placeholder ${3} updated to ${4} in ${1}." - ;; - esac + FILEVALUE=$(get_file_value $1 "${2}PH=") + log_handler "Checking for ${3} in ${1}." + if [ "$FILEVALUE" ]; then + case $FILEVALUE in + *PLACEHOLDER*) replace_fn $2 $3 $4 $1 "placeholder" + log_handler "Placeholder ${3} updated to ${4} in ${1}." + ;; + esac + else + log_handler "No placeholder to update for ${2} in ${1}." + fi } # Check if boot scripts ran during boot @@ -315,28 +480,6 @@ curr_values() { fi } -# Check if original file values are safe -orig_safe() { - replace_fn FILESAFE 0 1 $LATEFILE - for V in $PROPSLIST; do - PROP=$(get_prop_type $V) - FILEPROP=$(echo "CURR${PROP}" | tr '[:lower:]' '[:upper:]') - FILEVALUE=$(eval "echo \$$FILEPROP") - 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 - 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 -} - # Run all value loading functions all_values() { log_handler "Loading values." @@ -351,18 +494,23 @@ after_change() { if [ "$2" == "file" ]; then # Load module settings . $LATEFILE + if [ "$3" == "install" ]; then + MODPATH=$MOUNTPATH/$MODID + fi else # Update the reboot variable reboot_chk # Load all values all_values + # Update the system.prop file + system_prop # Ask to reboot reboot_fn "$1" "$2" fi } # Run after changing props/settings with configuration file -after_change_file() { +after_change_propfile() { # Update the reboot variable reboot_chk # Load all values @@ -377,6 +525,67 @@ reboot_chk() { replace_fn REBOOTCHK 0 1 $LATEFILE } +# Reboot function +reboot_fn() { + INPUT5="" + while true + do + if [ -z "$INPUT5" ]; then + if [ "$2" == "reboot" ] || [ "$2" == "reset-script" ] || [ "$2" == "update" ]; then + REBOOTTXT="" + else + REBOOTTXT="Reboot - " + fi + menu_header "$REBOOTTXT${C}$1${N}" + echo "" + if [ "$2" != "reset-script" ] && [ "$2" != "reboot" ]; then + if [ "$2" == "update" ]; then + echo "The device fingerprint has been updated." + echo "" + fi + echo "Reboot for changes to take effect." + echo "" + fi + echo "Do you want to reboot now (y/n)?" + echo "" + if [ "$2" == "p" ] || [ "$2" == "r" ] || [ "$2" == "reset-script" ]; then + echo -n "Enter ${G}y${N}(es) or ${G}n${N}(o): " + INV1=2 + else + echo -n "Enter ${G}y${N}(es), ${G}n${N}(o) or ${G}e${N}(xit): " + INV1=3 + fi + read -r INPUT5 + fi + case "$INPUT5" in + y|Y) + force_reboot + ;; + n|N) + if [ "$2" == "p" ] || [ "$2" == "r" ] || [ "$2" == "reset-script" ]; then + exit_fn + else + INPUT2="" + INPUT3="" + INPUT4="" + INPUT5="" + INPUT6="" + break + fi + ;; + e|E) + if [ "$2" == "p" ] || [ "$2" == "r" ] || [ "$2" == "reset-script" ]; then + invalid_input $INV1 5 + else + exit_fn + fi + ;; + *) invalid_input $INV1 5 + ;; + esac + done +} + # Reset module reset_fn() { cp -af $MODPATH/propsconf_late $LATEFILE >> $LOGFILE 2>&1 @@ -408,12 +617,14 @@ config_file() { break fi done + if [ "$CONFFILE" ]; then log_handler "Configuration file detected (${CONFFILE})." format_file $CONFFILE # Loads custom variables . $CONFFILE module_v_ctrl + if [ "$CONFTRANSF" -le $VERSIONCMP ]; then # Check if vendor fingerprint is set if [ "$CONFVENDPRINT" == "true" ]; then @@ -432,19 +643,19 @@ config_file() { if [ "$TMPPROP" != "preserve" ]; then if [ "$PROPTYPE" == "ro.build.fingerprint" ]; then if [ "$FINGERPRINTENB" == 1 ]; then - change_print "$PROPTYPE" "$TMPPROP" "file" + change_print "$PROPTYPE" "$TMPPROP" "file" "$1" fi else - change_prop "$PROPTYPE" "$TMPPROP" "file" + change_prop "$PROPTYPE" "$TMPPROP" "file" "$1" fi fi else if [ "$PROPTYPE" == "ro.build.fingerprint" ]; then if [ "$FINGERPRINTENB" == 1 ]; then - reset_print "$PROPTYPE" "file" + reset_print "$PROPTYPE" "file" "$1" fi else - reset_prop "$PROPTYPE" "file" + reset_prop "$PROPTYPE" "file" "$1" fi fi done @@ -461,23 +672,53 @@ config_file() { else TMPVAL=0 fi - change_sim_prop "Device simulation" "$ITEM" "$TMPVAL" "file" + change_sim_prop "Device simulation" "$ITEM" "$TMPVAL" "file" "$1" done fi # Device description if [ "$CONFDESCRIPTION" == "true" ]; then - change_sim_descr "Device simulation" 1 "file" + change_sim_descr "Device simulation" 1 "file" "$1" else - change_sim_descr "Device simulation" 0 "file" + change_sim_descr "Device simulation" 0 "file" "$1" fi fi + # Updates boot options for fingerprint and simulation props + if [ "$PRINTEDIT" == 1 ]; then + if [ "$CONFPRINTBOOT" == "default" ]; then + OPTLCHNG=0 + TMPTXT="default" + elif [ "$CONFPRINTBOOT" == "post" ]; then + OPTLCHNG=1 + TMPTXT="post-fs-data" + elif [ "$CONFPRINTBOOT" == "late" ]; then + OPTLCHNG=2 + TMPTXT="late_start service" + fi + replace_fn PRINTSTAGE $PRINTSTAGE $OPTLCHNG $LATEFILE + log_handler "Fingerprint boot stage is ${TMPTXT}." + fi + if [ "$DEVSIM" == 1 ]; then + if [ "$CONFSIMBOOT" == "default" ]; then + OPTLCHNG=0 + TMPTXT="default" + elif [ "$CONFSIMBOOT" == "post" ]; then + OPTLCHNG=1 + TMPTXT="post-fs-data" + elif [ "$CONFSIMBOOT" == "late" ]; then + OPTLCHNG=2 + TMPTXT="late_start service" + fi + replace_fn SIMSTAGE $SIMSTAGE $OPTLCHNG $LATEFILE + log_handler "Device simulation boot stage is ${TMPTXT}." + fi + # Updates prop file editing if [ "$FILESAFE" == 0 ]; then if [ "$CONFPROPFILES" == "true" ]; then - edit_prop_files "file" "" " (configuration file)" + edit_prop_files "file" "" " (configuration file)" "$1" elif [ "$CONFPROPFILES" == "false" ]; then - reset_prop_files "file" "" " (configuration file)" + reset_prop_files "file" "" " (configuration file)" "$1" fi fi @@ -486,26 +727,26 @@ config_file() { if [ "$CONFPROPS" ] || [ "$CONFPROPSPOST" ] || [ "$CONFPROPSLATE" ]; then if [ "$PROPOPTION" == "add" ] || [ "$PROPOPTION" == "replace" ]; then if [ "$PROPOPTION" == "replace" ]; then - reset_all_custprop "file" + reset_all_custprop "file" "$1" fi if [ "$CONFPROPS" ]; then for ITEM in $CONFPROPS; do - set_custprop "$(get_eq_left "$ITEM")" "$(get_eq_right "$ITEM")" "default" "file" + set_custprop "$(get_eq_left "$ITEM")" "$(get_eq_right "$ITEM")" "default" "file" "$1" done fi if [ "$CONFPROPSPOST" ]; then for ITEM in $CONFPROPSPOST; do - set_custprop "$(get_eq_left "$ITEM")" "$(get_eq_right "$ITEM")" "post" "file" + set_custprop "$(get_eq_left "$ITEM")" "$(get_eq_right "$ITEM")" "post" "file" "$1" done fi if [ "$CONFPROPSLATE" ]; then for ITEM in $CONFPROPSLATE; do - set_custprop "$(get_eq_left "$ITEM")" "$(get_eq_right "$ITEM")" "late" "file" + set_custprop "$(get_eq_left "$ITEM")" "$(get_eq_right "$ITEM")" "late" "file" "$1" done fi fi else - reset_all_custprop "file" + reset_all_custprop "file" "$1" fi fi @@ -514,50 +755,66 @@ config_file() { if [ "$CONFDELPROPS" ]; then if [ "$DELPROPOPTION" == "add" ] || [ "$DELPROPOPTION" == "replace" ]; then if [ "$DELPROPOPTION" == "replace" ]; then - reset_all_delprop "file" + reset_all_delprop "file" "$1" fi for ITEM in $CONFDELPROPS; do - set_delprop "$ITEM" "file" + set_delprop "$ITEM" "file" "$1" done fi else - reset_all_delprop "file" + reset_all_delprop "file" "$1" fi fi # Updates options - if [ "$CONFLATE" == "true" ]; then - OPTLCHNG=1 - TMPTXT="late_start service" - else + # Boot stage + if [ "$CONFBOOT" == "default" ]; then OPTLCHNG=0 + TMPTXT="default" + elif [ "$CONFBOOT" == "post" ]; then + OPTLCHNG=1 TMPTXT="post-fs-data" + elif [ "$CONFBOOT" == "late" ]; then + OPTLCHNG=2 + TMPTXT="late_start service" fi - replace_fn OPTIONLATE $OPTIONLATE $OPTLCHNG $LATEFILE - log_handler "Boot stage is ${TMPTXT}." + replace_fn OPTIONBOOT $OPTIONBOOT $OPTLCHNG $LATEFILE + log_handler "General boot stage is ${TMPTXT}." + # Script colours if [ "$CONFCOLOUR" == "true" ]; then OPTCCHNG=1 else OPTCCHNG=0 fi replace_fn OPTIONCOLOUR $OPTIONCOLOUR $OPTCCHNG $LATEFILE - log_handler "Colour $CONFCOLOUR." + log_handler "Colour is set to $CONFCOLOUR." + # Fingerprints list update if [ "$CONFWEB" == "true" ]; then OPTWCHNG=1 else OPTWCHNG=0 fi replace_fn OPTIONWEB $OPTIONWEB $OPTWCHNG $LATEFILE - log_handler "Automatic fingerprints list update $CONFWEB." + log_handler "Automatic fingerprints list update is set to $CONFWEB." + # Automatic fingerprints update + if [ "$CONFUPDATE" == "true" ]; then + OPTFCHNG=1 + else + OPTFCHNG=0 + fi + replace_fn OPTIONUPDATE $OPTIONUPDATE $OPTFCHNG $LATEFILE + log_handler "Automatic fingerprint update is set to $CONFUPDATE." else log_handler "The configuration file is not compatible with the current module version." fi + # Update the system.prop file + system_prop + # Deletes the configuration file log_handler "Deleting configuration file." rm -f $CONFFILE log_handler "Configuration file import complete." - else log_handler "No configuration file." fi @@ -568,6 +825,261 @@ test_connection() { ping -c 1 -W 1 google.com >> $LOGFILE 2>&1 && CNTTEST="true" || CNTTEST="false" } +# system.prop creation +system_prop() { + rm -f $MODPATH/system.prop + if [ "$OPTIONBOOT" == 0 ]; then + log_handler "Creating system.prop file." + touch $MODPATH/system.prop >> $LOGFILE 2>&1 + echo -e "# This file will be read by resetprop\n\n# MagiskHide Props Config\n# Copyright (c) 2018-2019 Didgeridoohan @ XDA Developers\n# Licence: MIT\n" >> $MODPATH/system.prop + print_edit "$MODPATH/system.prop" + dev_sim_edit "$MODPATH/system.prop" + custom_edit "CUSTOMPROPS" "$MODPATH/system.prop" + fi +} + +# ======================== Installation functions ======================== +# Places various module scripts in their proper places +script_placement() { + if [ -f "$LATEFILE" ]; then + FILEV=$(get_file_value $LATEFILE "SCRIPTV=") + FILETRANSF=$(get_file_value $LATEFILE "SETTRANSF=") + else + FILEV=0 + FILETRANSF=$UPDATETRANSF + fi + log_print "- Installing scripts" + cp -af $INSTALLER/common/util_functions.sh $MODPATH/util_functions.sh >> $LOGFILE 2>&1 + cp -af $INSTALLER/common/prints.sh $MODPATH/prints.sh >> $LOGFILE 2>&1 + cp -af $UPDATELATEFILE $MODPATH/propsconf_late >> $LOGFILE 2>&1 + if [ "$FILEV" ]; then + # New script + if [ "$UPDATEV" -gt "$FILEV" ]; then + # Fresh install + if [ "$FILEV" == 0 ]; then + log_print "- Placing settings script" + # Updated script with a required clearing of settings + elif [ "$UPDATETRANSF" -gt "$FILETRANSF" ] && [ -z "$NOTTRANSF" ]; then + log_print "- Settings cleared (script updated)" + # Updated script + else + log_print "- Script updated" + log_print "- Transferring settings from old script" + # Prop settings + for ITEM in $SETTINGSLIST; do + # Checking if a script update requires some options not to transfer + case "$NOTTRANSF" in + *${ITEM}*) + if [ "$UPDATETRANSF" -gt "$FILETRANSF" ]; then + TRANSFOPT=1 + else + TRANSFOPT=0 + fi + ;; + *) + TRANSFOPT=0 + ;; + esac + if [ "$TRANSFOPT" == 1 ]; then + log_handler "Not transfering settings for ${ITEM}." + else + SOLD=$(get_file_value $LATEFILE "${ITEM}=") + SNEW=$(get_file_value $UPDATELATEFILE "${ITEM}=") + if [ "$SOLD" ] && [ "$SOLD" != "$SNEW" ]; then + log_handler "Setting ${ITEM} from ${SNEW} to ${SOLD}." + sed -i "s|${ITEM}=${SNEW}|${ITEM}=${SOLD}|" $UPDATELATEFILE + fi + fi + done + # Prop values + for ITEM in $PROPSETTINGSLIST; do + SOLD=$(get_file_value $LATEFILE "${ITEM}=") + if [ "$SOLD" ]; then + log_handler "Setting ${ITEM} to ${SOLD}." + sed -i "s|${ITEM}=\"\"|${ITEM}=\"${SOLD}\"|" $UPDATELATEFILE + fi + done + # Prop and file edits + for ITEM in $PROPSLIST; do + ITEM="$(get_prop_type $ITEM)" + REPROP=$(echo "RE${ITEM}" | tr '[:lower:]' '[:upper:]') + SETPROP=$(echo "SET${ITEM}" | tr '[:lower:]' '[:upper:]') + REOLD=$(get_file_value $LATEFILE "${REPROP}=") + SETOLD=$(get_file_value $LATEFILE "${SETPROP}=") + if [ "$REOLD" ] && [ "$REOLD" != "false" ]; then + log_handler "Setting sensitive prop ${ITEM} to ${REOLD}." + sed -i "s/${REPROP}=false/${REPROP}=${REOLD}/" $UPDATELATEFILE + fi + if [ "$SETOLD" ] && [ "$SETOLD" != "false" ]; then + log_handler "Setting file edit ${ITEM} to ${SETOLD}." + sed -i "s/${SETPROP}=false/${SETPROP}=${SETOLD}/" $UPDATELATEFILE + fi + done + fi + log_handler "Setting up late_start settings script." + cp -af $UPDATELATEFILE $LATEFILE >> $LOGFILE 2>&1 + # Downgraded script (flashed old module version) + elif [ "$UPDATEV" -lt "$FILEV" ]; then + log_print "- Settings cleared (script downgraded)" + cp -af $UPDATELATEFILE $LATEFILE >> $LOGFILE 2>&1 + # No update of script + else + log_print "- Module settings preserved" + fi + else + log_print "- Placing settings script" + log_handler "Setting up late_start settings script." + cp -af $UPDATELATEFILE $LATEFILE >> $LOGFILE 2>&1 + fi +} + +# Checks if any other module is using a local copy of build.prop +build_prop_check() { + log_print "- Checking for build.prop conflicts" + for D in $(ls $IMGPATH); do + if [ "$D" != "$MODID" ]; then + if [ -f "$IMGPATH/$D/system/build.prop" ] || [ "$D" == "safetypatcher" ]; then + NAME=$(get_file_value $IMGPATH/$D/module.prop "name=") + ui_print "!" + log_print "! Another module editing build.prop detected!" + log_print "! Module - '$NAME'!" + log_print "! Modification of build.prop disabled!" + ui_print "!" + sed -i 's/BUILDPROPENB=1/BUILDPROPENB=0/' $UPDATELATEFILE + fi + fi + done +} + +# Checks for the Universal SafetyNet Fix module and similar modules editing device fingerprint +usnf_check() { + log_print "- Checking for fingerprint conflicts" + for USNF in $USNFLIST; do + if [ -d "$IMGPATH/$USNF" ]; then + NAME=$(get_file_value $IMGPATH/$USNF/module.prop "name=") + ui_print "!" + log_print "! Module editing fingerprint detected!" + log_print "! Module - '$NAME'!" + log_print "! Fingerprint modification disabled!" + ui_print "!" + sed -i 's/FINGERPRINTENB=1/FINGERPRINTENB=0/' $UPDATELATEFILE + fi + done +} + +# Check for bin/xbin +bin_check() { + $BOOTMODE && BINCHECK=$COREPATH/mirror/system/xbin || BINCHECK=/system/xbin + if [ -d "$BINCHECK" ]; then + BIN=xbin + else + BIN=bin + fi + log_handler "Using /system/$BIN." + mv -f $MODPATH/system/binpath $MODPATH/system/$BIN >> $LOGFILE 2>&1 +} + +# Magisk installation check +install_check() { + if [ ! -d "$SERVICEPATH" ]; then + log_print "- Fresh Magisk installation detected." + log_handler "Creating path for boot script." + mkdir -pv $SERVICEPATH >> $LOGFILE 2>&1 + fi +} + +# Check for late_start service boot script in post-fs-data.d, in case someone's moved it and also delete the old propsconf_post boot script if present +post_check() { + if [ -f "$POSTLATEFILE" ]; then + log_handler "Removing late_start service boot script from post-fs-data.d." + rm -f $POSTLATEFILE + fi + if [ -f "$POSTFILE" ]; then + log_handler "Removing old post-fs-data boot script from post-fs-data.d" + rm -f $POSTFILE + fi + if [ -f "$CACHELOC/propsconf_postfile.log" ]; then + log_handler "Removing old post-fs-data log from /cache." + rm -f $CACHELOC/propsconf_postfile.log + fi +} + +# Update the device simulation variables if a fingerprint is set +devsim_update() { + if [ "$MODULEFINGERPRINT" ]; then + log_handler "Updating device simulation variables." + print_parts $MODULEFINGERPRINT "var" + for ITEM in $PROPSETTINGSLIST; do + case $ITEM in + SIM*) + SUBA="$(get_file_value $LATEFILE "${ITEM}=")" + TMPVAR="$(echo $ITEM | sed 's|SIM|VAR|')" + TMPPROP="$(eval "echo \$$TMPVAR")" + sed -i "s|${ITEM}=\"${SUBA}\"|${ITEM}=\"${TMPPROP}\"|" $LATEFILE + ;; + esac + done + # Reload module settings + load_settings + fi +} + +# Load module settings and reapply the MODPATH variable +load_settings() { + log_handler "Loading/reloading module settings." + if [ -f "$LATEFILE" ]; then + . $LATEFILE + fi + MODPATH=$MOUNTPATH/$MODID +} + +# Installs everything +script_install() { + load_settings + build_prop_check + usnf_check + bin_check + post_check + script_placement + log_print "- Updating placeholders" + placeholder_update $LATEFILE CACHELOC CACHE_PLACEHOLDER "$CACHELOC" + placeholder_update $LATEFILE COREPATH CORE_PLACEHOLDER "$COREPATH" + placeholder_update $MODPATH/util_functions.sh MODVERSION VER_PLACEHOLDER "$MODVERSION" + placeholder_update $MODPATH/util_functions.sh LATEFILE LATE_PLACEHOLDER "$LATEHOLDER" + placeholder_update $MODPATH/util_functions.sh MIRRORLOC MIRROR_PLACEHOLDER "$MIRRORLOC" + placeholder_update $MODPATH/util_functions.sh CACHELOC CACHE_PLACEHOLDER "$CACHELOC" + placeholder_update $MODPATH/util_functions.sh BIN BIN_PLACEHOLDER "$BIN" + placeholder_update $MODPATH/system/$BIN/props LATEFILE LATE_PLACEHOLDER "$LATEHOLDER" + placeholder_update $MODPATH/system/$BIN/props COREPATH CORE_PLACEHOLDER "$COREPATH" + load_settings + devsim_update + print_files + ui_print "" + ui_print "- Make sure to have Busybox installed." + ui_print "- osm0sis' Busybox is recommended." + ui_print "" + # Checks for configuration file + CONFFILE="" + for ITEM in $CONFFILELST; do + if [ -s "$ITEM" ]; then + CONFFILE="$ITEM" + break + fi + done + if [ "$CONFFILE" ]; then + load_settings + ui_print "- Configuration file found." + ui_print "- Installing..." + ui_print "" + config_file "install" + else + load_settings + # Create system.prop in case of no configuration file + system_prop + fi + log_handler "Module installation complete." +} + # ======================== Fingerprint functions ======================== # Set new fingerprint print_edit() { @@ -583,8 +1095,14 @@ print_edit() { fi for ITEM in $PRINTPROPS; do log_handler "Changing/writing $ITEM." - resetprop -v $ITEM >> $LOGFILE 2>&1 - resetprop -nv $ITEM $PRINTCHNG >> $LOGFILE 2>&1 + if [ "$1" ]; then + if [ "$PRINTSTAGE" == 0 ]; then + log_handler "${ITEM}=${PRINTCHNG}" + echo "${ITEM}=${PRINTCHNG}" >> $1 + fi + else + resetprop -nv $ITEM $PRINTCHNG >> $LOGFILE 2>&1 + fi done # Edit security patch date if included if [ "$PRINTVEND" != 1 ]; then @@ -593,8 +1111,14 @@ print_edit() { *__*) if [ "$SECPATCH" ]; then log_handler "Updating security patch date to match fingerprint used." - resetprop -v ro.build.version.security_patch >> $LOGFILE 2>&1 - resetprop -nv ro.build.version.security_patch $SECPATCH >> $LOGFILE 2>&1 + if [ "$1" ]; then + if [ "$PRINTSTAGE" == 0 ]; then + log_handler "ro.build.version.security_patch=${SECPATCH}" + echo "ro.build.version.security_patch=${SECPATCH}" >> $1 + fi + else + resetprop -nv ro.build.version.security_patch $SECPATCH >> $LOGFILE 2>&1 + fi fi ;; esac @@ -603,8 +1127,14 @@ print_edit() { if [ "$DESCRIPTIONSET" == 1 ]; then if [ "$SIMDESCRIPTION" ]; then log_handler "Changing/writing ro.build.description." - resetprop -v ro.build.description >> $LOGFILE 2>&1 - resetprop -nv ro.build.description "$SIMDESCRIPTION" >> $LOGFILE 2>&1 + if [ "$1" ]; then + if [ "$PRINTSTAGE" == 0 ]; then + log_handler "ro.build.description=${SIMDESCRIPTION}" + echo "ro.build.description=${SIMDESCRIPTION}" >> $1 + fi + else + resetprop -nv ro.build.description "$SIMDESCRIPTION" >> $LOGFILE 2>&1 + fi fi else log_handler "Changing/writing ro.build.description is disabled." @@ -614,11 +1144,15 @@ print_edit() { # Create fingerprint files print_files() { - log_print "Creating fingerprint files." - rm -rf $PRINTFILES >> $LOGFILE 2>&1 - mkdir -pv $PRINTFILES >> $LOGFILE 2>&1 + if [ "$INSTFN" ]; then + log_print "- Creating fingerprint files." + else + log_print "Creating fingerprint files." + fi + rm -rf $MODPATH/printfiles >> $LOGFILE 2>&1 + mkdir -pv $MODPATH/printfiles >> $LOGFILE 2>&1 # Loading prints - . $PRINTSLOC + . $MODPATH/prints.sh # Saving manufacturers log_handler "Saving manufacturers." SAVEIFS=$IFS @@ -632,9 +1166,9 @@ print_files() { OEMLIST="$TMPOEMLIST" log_handler "Creating files." for OEM in $OEMLIST; do - echo -e "PRINTSLIST=\"" >> $PRINTFILES/${OEM}\.sh - grep $OEM >> $PRINTFILES/${OEM}\.sh $PRINTSLOC - echo -e "\"" >> $PRINTFILES/${OEM}\.sh + echo -e "PRINTSLIST=\"" >> $MODPATH/printfiles/${OEM}\.sh + grep $OEM >> $MODPATH/printfiles/${OEM}\.sh $MODPATH/prints.sh + echo -e "\"" >> $MODPATH/printfiles/${OEM}\.sh done # Check for updated fingerprint device_print_update "Updating module fingerprint." @@ -652,11 +1186,33 @@ device_print_update() { ;; esac done - log_handler "Checking for updated fingerprint ($TMPDEV)." + case $TMPPRINT in + *\;*) + ITEMCOUNT=1 + ITEMFOUND=0 + TMPVPRINT="$(get_print_versions "$TMPPRINT")" + TMPVCURR="$(get_android_version_print $MODULEFINGERPRINT)" + for ITEM in $TMPVPRINT; do + if [ "$(get_android_version $ITEM)" == "$TMPVCURR" ]; then + ITEMFOUND=1 + break + fi + ITEMCOUNT=$(($ITEMCOUNT+1)) + done + if [ "$ITEMFOUND" == 1 ]; then + TMPPRINT="$(get_eq_right $TMPPRINT | cut -f $ITEMCOUNT -d ';')" + else + TMPPRINT="" + fi + ;; + *) TMPPRINT="$(get_eq_right $TMPPRINT)" + ;; + esac if [ "$TMPDEV" ] && [ "$TMPPRINT" ]; then - if [ "$MODULEFINGERPRINT" != "$(get_eq_right $TMPPRINT))" ]; then + log_handler "Checking for updated fingerprint ($TMPDEV)." + if [ "$MODULEFINGERPRINT" != "$TMPPRINT" ]; then log_handler "$1" - change_print "$1" $(get_eq_right $TMPPRINT) "update" + change_print "$1" "$TMPPRINT" "update" replace_fn PRINTCHK 0 1 $LATEFILE # Load module values . $LATEFILE @@ -744,7 +1300,7 @@ reset_print() { # Clear out device simulation variables print_parts "none" - after_change "$1" "$2" + after_change "$1" "$2" "$3" } # Use fingerprint @@ -765,7 +1321,7 @@ change_print() { NEWFINGERPRINT="" if [ "$DEVSIM" == 1 ]; then - after_change "$1" "$3" + after_change "$1" "$3" "$4" fi } @@ -812,7 +1368,7 @@ print_parts() { TMPVALUE="" TMPPROP=$(get_prop_type $ITEM | tr '[:lower:]' '[:upper:]') if [ $1 != "none" ]; then - TMPVALUE=$(echo $1 | sed 's|\:user\/release-keys||' | cut -f $DLIM1 -d ':' | cut -f $DLIM2 -d '/') + TMPVALUE=$(echo $1 | sed 's|\:user\/release-keys.*||' | cut -f $DLIM1 -d ':' | cut -f $DLIM2 -d '/') eval "VAR${TMPPROP}='$TMPVALUE'" fi DLIM2=$(($DLIM2 + 1)) @@ -827,11 +1383,21 @@ print_parts() { done VARDESCRIPTION="" + VARSDK="" if [ $1 != "none" ]; then VARDESCRIPTION="${VARNAME}-user $VARRELEASE $VARID $VARINCREMENTAL release-keys" + for ITEM in $APILVL; do + case $VARRELEASE in + *$(get_eq_left $ITEM)*) + VARSDK="$(get_eq_right $ITEM)" + break + ;; + esac + done fi if [ "$2" != "var" ]; then replace_fn SIMDESCRIPTION "\"$SIMDESCRIPTION\"" "\"$VARDESCRIPTION\"" $LATEFILE + replace_fn SIMSDK "\"$SIMSDK\"" "\"$VARSDK\"" $LATEFILE fi # Load module values . $LATEFILE @@ -843,21 +1409,27 @@ dev_sim_edit() { if [ "$FINGERPRINTENB" == 1 -o "$PRINTMODULE" == 0 ] && [ "$PRINTEDIT" == 1 ]; then if [ "$DEVSIM" == 1 ]; then log_handler "Editing device simulation props." - for ITEM in $PRINTPARTS; do + TMPPARTS=$PRINTPARTS$ADNSIMPROPS + for ITEM in $TMPPARTS; do TMPPROP=$(get_prop_type $ITEM | tr '[:lower:]' '[:upper:]') TMPENB=$(get_file_value $LATEFILE "${TMPPROP}SET=") TMPVALUE=$(get_file_value $LATEFILE "SIM${TMPPROP}=") if [ "$TMPENB" == 1 ] && [ "$TMPVALUE" ]; then log_handler "Changing/writing $ITEM." - resetprop -v $ITEM >> $LOGFILE 2>&1 - resetprop -nv $ITEM $TMPVALUE >> $LOGFILE 2>&1 + if [ "$1" ]; then + if [ "$SIMSTAGE" == 0 ]; then + log_handler "${ITEM}=${TMPVALUE}" + echo "${ITEM}=${TMPVALUE}" >> $1 + fi + else + resetprop -nv $ITEM $TMPVALUE >> $LOGFILE 2>&1 + fi else log_handler "Changing/writing $ITEM is disabled." fi done fi fi - } # Enable/disable the option @@ -893,7 +1465,7 @@ change_sim_prop() { # Saves new value replace_fn "${TMPPROP}SET" $SUBA $3 $LATEFILE - after_change "$1" "$4" + after_change "$1" "$4" "$5" } # Change if description should be simulated or not @@ -908,7 +1480,7 @@ change_sim_descr() { # Saves new value replace_fn DESCRIPTIONSET $DESCRIPTIONSET $2 $LATEFILE - after_change "$1" "$3" + after_change "$1" "$3" "$4" } # ======================== Props files functions ======================== @@ -930,7 +1502,7 @@ reset_prop_files() { replace_fn DEFAULTEDIT 1 0 $LATEFILE if [ "$1" != "file" ]; then - after_change_file "$1" "$2" + after_change_propfile "$1" "$2" "$4" fi } @@ -989,7 +1561,7 @@ edit_prop_files() { replace_fn DEFAULTEDIT 0 1 $LATEFILE if [ "$1" != "file" ]; then - after_change_file "$1" "$2" + after_change_propfile "$1" "$2" "$4" fi } @@ -1093,7 +1665,7 @@ reset_prop() { replace_fn PROPEDIT 1 0 $LATEFILE fi - after_change "$1" "$2" + after_change "$1" "$2" "$3" } # Use prop value @@ -1118,7 +1690,7 @@ change_prop() { fi replace_fn PROPEDIT 0 1 $LATEFILE - after_change "$1" "$3" + after_change "$1" "$3" "$4" } # Reset all module prop changes @@ -1154,8 +1726,12 @@ custom_edit() { for ITEM in $TMPLST; do log_handler "Changing/writing $(get_eq_left "$ITEM")." TMPITEM=$( echo $(get_eq_right "$ITEM") | sed 's|_sp_| |g') - resetprop -v $(get_eq_left "$ITEM") >> $LOGFILE 2>&1 - resetprop -nv $(get_eq_left "$ITEM") "$TMPITEM" >> $LOGFILE 2>&1 + if [ "$1" == "CUSTOMPROPS" ] && [ "$2" ]; then + log_handler "$(get_eq_left "$ITEM")=${TMPITEM}" + echo "$(get_eq_left "$ITEM")=${TMPITEM}" >> $2 + else + resetprop -nv $(get_eq_left "$ITEM") "$TMPITEM" >> $LOGFILE 2>&1 + fi done fi fi @@ -1200,7 +1776,7 @@ set_custprop() { DLIMTMP=$(($DLIMTMP + 1)) done - after_change "$1" "$4" + after_change "$1" "$4" "$5" fi } @@ -1213,7 +1789,7 @@ reset_all_custprop() { replace_fn CUSTOMPROPSLATE "\"$CUSTOMPROPSLATE\"" "\"\"" $LATEFILE replace_fn CUSTOMEDIT 1 0 $LATEFILE - after_change "Resetting all custom props" "$1" + after_change "Resetting all custom props" "$1" "$2" } # Reset custom prop value @@ -1246,7 +1822,6 @@ prop_del() { for ITEM in $DELETEPROPS; do log_handler "Deleting $ITEM." TMPITEM=$( echo $(get_eq_right "$ITEM") | sed 's|_sp_| |g') - resetprop -v $ITEM >> $LOGFILE 2>&1 case "$ITEM" in persist*) resetprop -pv --delete $ITEM >> $LOGFILE 2>&1 @@ -1269,7 +1844,7 @@ set_delprop() { replace_fn DELETEPROPS "\"$DELETEPROPS\"" "\"$SORTDELPROPS\"" $LATEFILE replace_fn DELEDIT 0 1 $LATEFILE - after_change "Delete $1" "$2" + after_change "Delete $1" "$2" "$3" fi } @@ -1280,7 +1855,7 @@ reset_all_delprop() { replace_fn DELETEPROPS "\"$DELETEPROPS\"" "\"\"" $LATEFILE replace_fn DELEDIT 1 0 $LATEFILE - after_change "Delete $1" "$2" + after_change "Reset all props to delete." "$1" "$2" } # Reset prop to delete @@ -1296,7 +1871,7 @@ reset_delprop() { replace_fn DELEDIT 1 0 $LATEFILE fi - after_change "Delete $1" "$2" + after_change "Reset prop to delete - $1" } # ======================== Log collecting functions ======================== diff --git a/config.sh b/config.sh index 8b4b1fe..aea2910 100644 --- a/config.sh +++ b/config.sh @@ -18,7 +18,6 @@ LATESTARTSERVICE=true ########################################################################################## print_modname() { - MODVERSION=$(echo $(get_file_value $INSTALLER/module.prop "version=") | sed 's|-.*||') ui_print "*******************************" ui_print "MagiskHide Props Config $MODVERSION" ui_print " By Didgeridoohan @XDA" @@ -48,452 +47,6 @@ set_permissions() { # Licence: MIT ########################################################################################## -# Finding file values -get_file_value() { - grep $2 $1 | sed "s|.*$2||" | sed 's|\"||g' -} -# Get left side of = -get_eq_left() { - echo $1 | cut -f 1 -d '=' -} -# Get first word in string -get_first() { - case $1 in - *\ *) echo $1 | sed 's|\ .*||' - ;; - *=*) get_eq_left "$1" - ;; - esac -} - -# Variables -if [ "$MAGISK_VER_CODE" -ge 17316 ]; then - COREPATH=/sbin/.magisk -else - COREPATH=/sbin/.core -fi -ADBPATH=/data/adb -BIMGPATH=$COREPATH/img -$BOOTMODE && IMGPATH=$BIMGPATH || IMGPATH=$MOUNTPATH -if [ "$MAGISK_VER_CODE" -ge 17316 ]; then - POSTPATH=$ADBPATH/post-fs-data.d - SERVICEPATH=$ADBPATH/service.d - LATEHOLDER=$ADBPATH/service.d/propsconf_late -else - POSTPATH=$IMGPATH/.core/post-fs-data.d - SERVICEPATH=$IMGPATH/.core/service.d - LATEHOLDER=$BIMGPATH/.core/service.d/propsconf_late -fi -POSTFILE=$POSTPATH/propsconf_post -LATEFILE=$SERVICEPATH/propsconf_late -POSTLATEFILE=$POSTPATH/propsconf_late -UPDATELATEFILE=$INSTALLER/common/propsconf_late -MIRRORLOC=/sbin/.magisk/mirror/system -if [ -z $SLOT ]; then - CACHELOC=/cache -else - CACHELOC=/data/cache -fi -CONFFILELST=" -$CACHELOC/propsconf_conf -/data/propsconf_conf -/sdcard/propsconf_conf -" -INSTLOG=$CACHELOC/propsconf_install.log -UPDATEV=$(get_file_value $UPDATELATEFILE "SCRIPTV=") -UPDATETRANSF=$(get_file_value $UPDATELATEFILE "SETTRANSF=") -NOTTRANSF=$(get_file_value $UPDATELATEFILE "NOTTRANSF=") -SETTINGSLIST=" -FINGERPRINTENB -PRINTMODULE -PRINTEDIT -PRINTVEND -DEVSIM -BUILDPROPENB -FILESAFE -BUILDEDIT -DEFAULTEDIT -PROPCOUNT -PROPEDIT -CUSTOMEDIT -DELEDIT -REBOOTCHK -PRINTCHK -OPTIONLATE -OPTIONCOLOUR -OPTIONWEB -OPTIONUPDATE -BRANDSET -NAMESET -DEVICESET -RELEASESET -IDSET -INCREMENTALSET -DESCRIPTIONSET -" -PROPSETTINGSLIST=" -MODULEDEBUGGABLE -MODULESECURE -MODULETYPE -MODULETAGS -MODULESELINUX -MODULEFINGERPRINT -SIMBRAND -SIMNAME -SIMDEVICE -SIMRELEASE -SIMID -SIMINCREMENTAL -SIMDESCRIPTION -CUSTOMPROPS -CUSTOMPROPSPOST -CUSTOMPROPSLATE -DELETEPROPS -" -PROPSLIST=" -debuggable -secure -type -tags -selinux -fingerprint -" -USNFLIST="xiaomi-safetynet-fix safetynet-fingerprint-fix VendingVisa DeviceSpoofingTool4Magisk universal-safetynet-fix samodx-safetyskipper safetypatcher petnoires-safetyspoofer" - -# Log functions -log_handler() { - echo "" >> $INSTLOG - echo -e "$(date +"%Y-%m-%d %H:%M:%S:%N") - $1" >> $INSTLOG 2>&1 -} -log_start() { - if [ -f "$INSTLOG" ]; then - rm -f $INSTLOG - fi - touch $INSTLOG - echo "***************************************************" >> $INSTLOG 2>&1 - echo "******** MagiskHide Props Config $MODVERSION ********" >> $INSTLOG 2>&1 - echo "**************** By Didgeridoohan ***************" >> $INSTLOG 2>&1 - echo "***************************************************" >> $INSTLOG 2>&1 - log_handler "Starting module installation script" -} -log_print() { - ui_print "$1" - log_handler "$1" -} - -# Places various module scripts in their proper places -script_placement() { - if [ -f "$LATEFILE" ]; then - FILEV=$(get_file_value $LATEFILE "SCRIPTV=") - FILETRANSF=$(get_file_value $LATEFILE "SETTRANSF=") - else - FILEV=0 - FILETRANSF=$UPDATETRANSF - fi - log_print "- Installing scripts" - cp -af $INSTALLER/common/util_functions.sh $MODPATH/util_functions.sh >> $INSTLOG 2>&1 - cp -af $INSTALLER/common/prints.sh $MODPATH/prints.sh >> $INSTLOG 2>&1 - cp -af $UPDATELATEFILE $MODPATH/propsconf_late >> $INSTLOG 2>&1 - if [ "$FILEV" ]; then - # New script - if [ "$UPDATEV" -gt "$FILEV" ]; then - # Fresh install - if [ "$FILEV" == 0 ]; then - log_print "- Placing settings script" - # Updated script with a required clearing of settings - elif [ "$UPDATETRANSF" -gt "$FILETRANSF" ] && [ -z "$NOTTRANSF" ]; then - log_print "- Settings cleared (script updated)" - # Updated script - else - log_print "- Script updated" - log_print "- Transferring settings from old script" - # Prop settings - for ITEM in $SETTINGSLIST; do - # Checking if a script update requires some options not to transfer - case "$NOTTRANSF" in - *${ITEM}*) - if [ "$UPDATETRANSF" -gt "$FILETRANSF" ]; then - TRANSFOPT=1 - else - TRANSFOPT=0 - fi - ;; - *) - TRANSFOPT=0 - ;; - esac - if [ "$TRANSFOPT" == 1 ]; then - log_handler "Not transfering settings for ${ITEM}." - else - SOLD=$(get_file_value $LATEFILE "${ITEM}=") - SNEW=$(get_file_value $UPDATELATEFILE "${ITEM}=") - if [ "$SOLD" ] && [ "$SOLD" != "$SNEW" ]; then - log_handler "Setting ${ITEM} from ${SNEW} to ${SOLD}." - sed -i "s|${ITEM}=${SNEW}|${ITEM}=${SOLD}|" $UPDATELATEFILE - fi - fi - done - # Prop values - for ITEM in $PROPSETTINGSLIST; do - SOLD=$(get_file_value $LATEFILE "${ITEM}=") - if [ "$SOLD" ]; then - log_handler "Setting ${ITEM} to ${SOLD}." - sed -i "s|${ITEM}=\"\"|${ITEM}=\"${SOLD}\"|" $UPDATELATEFILE - fi - done - # Prop and file edits - for ITEM in $PROPSLIST; do - REPROP=$(echo "RE${ITEM}" | tr '[:lower:]' '[:upper:]') - SETPROP=$(echo "SET${ITEM}" | tr '[:lower:]' '[:upper:]') - REOLD=$(get_file_value $LATEFILE "${REPROP}=") - SETOLD=$(get_file_value $LATEFILE "${SETPROP}=") - if [ "$REOLD" ] && [ "$REOLD" != "false" ]; then - log_handler "Setting sensitive prop ${ITEM} to ${REOLD}." - sed -i "s/${REPROP}=false/${REPROP}=${REOLD}/" $UPDATELATEFILE - fi - if [ "$SETOLD" ] && [ "$SETOLD" != "false" ]; then - log_handler "Setting file edit ${ITEM} to ${SETOLD}." - sed -i "s/${SETPROP}=false/${SETPROP}=${SETOLD}/" $UPDATELATEFILE - fi - done - fi - log_handler "Setting up late_start settings script." - cp -af $UPDATELATEFILE $LATEFILE >> $INSTLOG 2>&1 - # Downgraded script (flashed old module version) - elif [ "$UPDATEV" -lt "$FILEV" ]; then - log_print "- Settings cleared (script downgraded)" - cp -af $UPDATELATEFILE $LATEFILE >> $INSTLOG 2>&1 - # No update of script - else - log_print "- Module settings preserved" - fi - else - log_print "- Placing settings script" - log_handler "Setting up late_start settings script." - cp -af $UPDATELATEFILE $LATEFILE >> $INSTLOG 2>&1 - fi -} - -# Create fingerprint files -print_files() { - log_print "- Creating fingerprint files." - rm -rf $MODPATH/printfiles >> $INSTLOG 2>&1 - mkdir -pv $MODPATH/printfiles >> $INSTLOG 2>&1 - # Loading prints - . $MODPATH/prints.sh - # Saving manufacturers - log_handler "Saving manufacturers" - SAVEIFS=$IFS - IFS=$(echo -en "\n\b") - for ITEM in $PRINTSLIST; do - TMPOEMLIST=$(echo "$OEMLIST $(get_first $ITEM)" | sed 's|^[ \t]*||') - OEMLIST="$TMPOEMLIST" - done - IFS=$SAVEIFS - TMPOEMLIST=$(echo $(printf '%s\n' $OEMLIST | sort -u)) - OEMLIST="$TMPOEMLIST" - log_handler "Creating files" - for OEM in $OEMLIST; do - echo -e "PRINTSLIST=\"" >> $MODPATH/printfiles/${OEM}\.sh - grep $OEM >> $MODPATH/printfiles/${OEM}\.sh $MODPATH/prints.sh - echo -e "\"" >> $MODPATH/printfiles/${OEM}\.sh - done - # Check for updated fingerprint - device_print_update -} - -device_print_update() { - if [ "$OPTIONUPDATE" == 1 ]; then - if [ "$FINGERPRINTENB" == 1 -o "$PRINTMODULE" == 0 ] && [ "$PRINTEDIT" == 1 ] && [ "$MODULEFINGERPRINT" ]; then - TMPDEV="${VARBRAND}\.${VARNAME}\.${VARDEVICE}" - TMPPRINT=$(echo $PRINTSLIST | grep $TMPDEV ) - if [ "$TMPDEV" ] && [ "$TMPPRINT" ]; then - if [ "$(echo $MODULEFINGERPRINT | sed 's|\_\_.*||')" != "$(echo $TMPPRINT | cut -f 2 -d '=' | sed 's|\_\_.*||')" ]; then - log_handler "Updating module fingerprint." - sed -i "s|MODULEFINGERPRINT=$MODULEFINGERPRINT|MODULEFINGERPRINT=$(echo $TMPPRINT | cut -f 2 -d '=')|" $LATEFILE - log_handler "Changing device fingerprint to $(echo $TMPPRINT | cut -f 2 -d '=' | sed 's|\_\_.*||')." - # Reloading module settings - load_settings - fi - fi - fi - fi -} - -# Updates placeholders -placeholder_update() { - FILEVALUE=$(get_file_value $1 "$2=") - log_handler "Checking for ${3} in ${1}. Current value is ${FILEVALUE}." - case $FILEVALUE in - *PLACEHOLDER*) sed -i "s|${2}=${3}|${2}=\"${4}\"|g" $1 - log_handler "Placeholder ${3} updated to ${4} in ${1}." - ;; - esac -} - -# Checks if any other module is using a local copy of build.prop -build_prop_check() { - log_print "- Checking for build.prop conflicts" - for D in $(ls $IMGPATH); do - if [ "$D" != "$MODID" ]; then - if [ -f "$IMGPATH/$D/system/build.prop" ] || [ "$D" == "safetypatcher" ]; then - NAME=$(get_file_value $IMGPATH/$D/module.prop "name=") - ui_print "!" - log_print "! Another module editing build.prop detected!" - log_print "! Module - '$NAME'!" - log_print "! Modification of build.prop disabled!" - ui_print "!" - sed -i 's/BUILDPROPENB=1/BUILDPROPENB=0/' $UPDATELATEFILE - fi - fi - done -} - -# Checks for the Universal SafetyNet Fix module and similar modules editing device fingerprint -usnf_check() { - log_print "- Checking for fingerprint conflicts" - for USNF in $USNFLIST; do - if [ -d "$IMGPATH/$USNF" ]; then - NAME=$(get_file_value $IMGPATH/$USNF/module.prop "name=") - ui_print "!" - log_print "! Module editing fingerprint detected!" - log_print "! Module - '$NAME'!" - log_print "! Fingerprint modification disabled!" - ui_print "!" - sed -i 's/FINGERPRINTENB=1/FINGERPRINTENB=0/' $UPDATELATEFILE - fi - done -} - -# Check for bin/xbin -bin_check() { - $BOOTMODE && BINCHECK=$COREPATH/mirror/system/xbin || BINCHECK=/system/xbin - if [ -d "$BINCHECK" ]; then - BIN=xbin - else - BIN=bin - fi - log_handler "Using /system/$BIN." - mv -f $MODPATH/system/binpath $MODPATH/system/$BIN >> $INSTLOG 2>&1 -} - -# Magisk installation check -install_check() { - if [ ! -d "$SERVICEPATH" ] || [ ! -d "$POSTPATH" ]; then - log_print "- Fresh Magisk installation detected." - log_handler "Creating path for boot script." - mkdir -pv $POSTPATH >> $INSTLOG 2>&1 - mkdir -pv $SERVICEPATH >> $INSTLOG 2>&1 - fi -} - -# Check for late_start service boot script in post-fs-data.d, in case someone's moved it and also delete the old propsconf_post boot script if present -post_check() { - if [ -f "$POSTLATEFILE" ]; then - log_handler "Removing late_start service boot script from post-fs-data.d." - rm -f $POSTLATEFILE - fi - if [ -f "$POSTFILE" ]; then - log_handler "Removing old post-fs-data boot script from post-fs-data.d" - rm -f $POSTFILE - fi - if [ -f "$CACHELOC/propsconf_postfile.log" ]; then - log_handler "Removing old post-fs-data log from /cache." - rm -f $CACHELOC/propsconf_postfile.log - fi -} - -# Save props values from fingerprint parts -print_parts() { - DLIM1=1 - DLIM2=1 - for ITEM in $PROPSETTINGSLIST; do - case $ITEM in - SIMDESCRIPTION) # Do nothing with the description variable - ;; - SIM*) - TMPVAR="$(echo $ITEM | sed 's|SIM||')" - TMPVALUE=$(echo $1 | sed 's|\:user/release-keys.*||' | cut -f $DLIM1 -d ':' | cut -f $DLIM2 -d '/') - eval "VAR${TMPVAR}='$TMPVALUE'" - DLIM2=$(($DLIM2 + 1)) - if [ "$DLIM2" == 4 ]; then - DLIM1=2 - DLIM2=1 - fi - ;; - esac - done - VARDESCRIPTION="${VARNAME}-user $VARRELEASE $VARID $VARINCREMENTAL release-keys" -} - -# Update the device simulation variables if a fingerprint is set -devsim_update() { - if [ "$MODULEFINGERPRINT" ]; then - log_handler "Updating device simulation variables." - print_parts $MODULEFINGERPRINT - for ITEM in $PROPSETTINGSLIST; do - case $ITEM in - SIM*) - SUBA="$(get_file_value $LATEFILE "${ITEM}=")" - TMPVAR="$(echo $ITEM | sed 's|SIM|VAR|')" - TMPPROP="$(eval "echo \$$TMPVAR")" - sed -i "s|${ITEM}=\"${SUBA}\"|${ITEM}=\"${TMPPROP}\"|" $LATEFILE - ;; - esac - done - # Reload module settings - load_settings - fi -} - -# Load module settings and reapply the MODPATH variable -load_settings() { - log_handler "Loading/reloading module settings." - . $LATEFILE - MODPATH=$MOUNTPATH/$MODID -} - -# Installs everything -script_install() { - build_prop_check - usnf_check - bin_check - post_check - script_placement - log_print "- Updating placeholders" - placeholder_update $LATEFILE CACHELOC CACHE_PLACEHOLDER "$CACHELOC" - placeholder_update $LATEFILE COREPATH CORE_PLACEHOLDER "$COREPATH" - placeholder_update $MODPATH/util_functions.sh BIN BIN_PLACEHOLDER "$BIN" - placeholder_update $MODPATH/util_functions.sh USNFLIST USNF_PLACEHOLDER "$USNFLIST" - placeholder_update $MODPATH/util_functions.sh MIRRORLOC MIRROR_PLACEHOLDER "$MIRRORLOC" - placeholder_update $MODPATH/util_functions.sh CACHELOC CACHE_PLACEHOLDER "$CACHELOC" - placeholder_update $MODPATH/util_functions.sh LATEFILE LATE_PLACEHOLDER "$LATEHOLDER" - placeholder_update $MODPATH/util_functions.sh MODVERSION VER_PLACEHOLDER "$MODVERSION" - placeholder_update $MODPATH/system/$BIN/props LATEFILE LATE_PLACEHOLDER "$LATEHOLDER" - placeholder_update $MODPATH/system/$BIN/props COREPATH CORE_PLACEHOLDER "$COREPATH" - load_settings - devsim_update - print_files - ui_print "" - ui_print "- Make sure to have Busybox installed." - ui_print "- osm0sis' Busybox is recommended." - ui_print "" - log_handler "Installation complete." - # Checks for configuration file - CONFFILE="" - for ITEM in $CONFFILELST; do - if [ -s "$ITEM" ]; then - CONFFILE="$ITEM" - break - fi - done - if [ "$CONFFILE" ]; then - . $MODPATH/util_functions.sh - LOGFILE=$INSTLOG - MODPATH=$MOUNTPATH/$MODID - ui_print "- Configuration file found." - ui_print "- Installing..." - ui_print "" - config_file - fi -} +# Load functions and variables +INSTFN=true +. $INSTALLER/common/util_functions.sh diff --git a/module.prop b/module.prop index cf49ba0..dd296e6 100644 --- a/module.prop +++ b/module.prop @@ -1,7 +1,7 @@ id=MagiskHidePropsConf name=MagiskHide Props Config -version=v3.0.3-v48 -versionCode=40 +version=v3.5.0-v49 +versionCode=41 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, and set your own custom props. minMagisk=17000 diff --git a/system/binpath/props b/system/binpath/props index 7a81431e0915a7b25bdcecde8a0fa8c38026c5e7..60cdbf1bc575d7c6df320283b5f5f7337831ad7b 100644 GIT binary patch delta 5180 zcmdT|ZERat8I~PV@49I|nm8t@y`J3O#BpMKcAUf%&s)Bn#Qm_H*vW=UNFDn+F?DU@ zds8~%DC;J{Cask21*C}&wX3!=X`ptO{vvIe0BJClw*O#1Mk{{6m;_Axn1qDJIp^LR zf8=wt2oWi^bM86sdEV!J-{*aun}4YK{<+UwxuMmB;ktHO8y=S$tM2I_TceXc*7s`l zjK_)s!SGbn18sYbNHcr;H7|Q~)sg7nm>=FAHH63f(Wj$67I90%%bf{68Cy(?R&FV{ z%<372Pp6XT7-G5bWFQ!&hgjtEAs3qQB5{Gw;5`goUNZs%D^2}d9PQcS=ns}maK&SQ z`eU^(-?G5K3p(ldjWgBz1%e0J(NH!kB0-GJ^PGCA1H**-T_(xjVykKt3K1(h$!8X4 z=kQj#6W(q$z=wV>*neV%Uz`54XWTzH;-91rP5a<>#~j3OI;8i_zth%~K9U;S{#8}J z($M~Mjm9N8EJIrScFQ`deKH;scuY?q>Oab&6r}?*()C4emz7XMekhz=Dt=-%mrrHH z*;9O8NM$qll#2yd-gppko%6gn%YS7ypPF9~RdZ_wX!v@3EC~qxp$l#w3+G-p)Ox+j zGQAO8`&z(aGq#oO-Ry9UdYBhtaVcnP(yS1mXfTt=XHyBJK-F*JLZ=li=^2WqkHQO# zMtodkaN3VQ=$XOb$YdxmGVNn!2g}?Su$w)s75ntng;bhHVt$d=GYPooY=qz|weZdE zI(Xwkt;Pitea$P;1wPNC82%M_3@VmJ$y8>Z&r_2Eik*t3(y_TTPbuQ#3t7Y_vw57M zDFG$;Q>i#_Lu4V5N+z+TjHtRMl$^*WRmUADOlZhvc#>WW1DAX1S(a1?*C|`a*iiw4 zNg#_*K%I`RLcwB%^Nyxgat%oboDGOmDe$61Ru50M?cZNPEiF5mK61&y#H9leZr8yd zyN<)N-(xtX{$!F_WS{3r@u7|mT9)!MSNHcYe#Dy-Bl+0xX(Vi6S ziI^CpI*AjItfyllKZ_+Wk0q0qfSh4OL59aefnizqxuwHn%Q^C>6Wg)MM5O88_&ll4 z9d-eV6k@B!l~QmD>P>OwNo{TdObJM*(vx-y%}6^`S(}lu{czPB-v(PHmonRBbZv-A zCXk%Qg>!dxQm2Fs?){<*g4b*ImgFNRV*sbr_SrSdvU77X@9`7hdbJgDzwG`T&OEsf zY|w|>e5gEEm{2$x^grcu;+FW=>lUX%zN}#kljn2kSe&0tW>7KZP)TctGw&F|{Hs8aDJf{Emgn(CBB ziA|&##TR&73m1Eu;r1&A_~iUPi61(ru`x;y#**!!%3??PtYdC5l}?mQF4tmY98?vXyqh1E2K`+sZF}?pRC3`;{Kt= z-6i))orhnmBD!xb-czCb!~}fwv(c3@?#rwAzpwaX%VRrL{4$*7g-vk&@ASS1%z(d- zl%yqTZv@%@q1yLXs(sPP?X=#uxz?*j5T}0Hna+FG>AZTLMHo(bGN@XrsJv?%l~*l& zdQ6oHuUev*%F{r_r0Bb6NBXYX`?Sb5(st=q@Ex-OcVmW8)EGBttnfpj5V)Ref*a|& z{Yu;_2Cd@0wkfjjfU(j*RGxC+YT6`yoPJXaGm8z0lo>!941{I%AW^^a6<9=~RnUb^rmdXhDWE1KAuDy^SBix#%mrTS6|9~eoc7F8hGQjMC|7vTfqsZ=0Ichg$4w~}S# NgwyXLY3|(_?%(jeCO-fG delta 1372 zcmb7EZA@EL7|v}=YrFJ=mVS&5dfSy!CM~qH4N~hE&@BkGU01NtEI8mIWDSr~5|cuT zF=lndjPW>05Hl0EWqwS+V@6!mp+Ah9;>HqX$v_w;YM2`Qu|#7sythRL+Y;mbb%PDsQx z{$NAch3;Dg7~dsB=bS8=L73=6bYCC+ENwD7O|;ibn_^546SwuW#5%g;4`zG2TMx$> zHtwP0?M$ac%zhzXWgrj^N5Wo{i3>2%9_Ic;D9wkq(P>0mhveiPN+B_C9K~}bxeXm{ z^uJ7u4`E`lY|U~Cw=!W1Y*Lcp3Wr6FDW?s3jUIQLg(GM9loGuWHJ;dQ#G+jE_`2}! z2i3+N657-r)UH$tYy6E4uXFh4I;A)*I=$b`E!#T4A1}e6%ZkJirTzXs|3~d(M|NS% zX2s~FOq7|Q8xnn^A$+Ev)$EN5kM zZugaV$dofl!TWg*R=omYt2yECFGlugCC-%QL+ILz2G{HO%jIWJoLDF(ad+wwEdHuP zzD$I-_g!%`9;~Ua%2>PFcd#l{6Aae`{2O-P6kA6jxn>~m?lKBCNI32&x3I9hDH( zYXvk03smX3zu9HMw*xYg`e>d)g+)jb7vAGh3?iusd~!iUe*1VuCg6(W4}}W9exznuU1mMlGHXRug%W4y9_660-1H;wdPqT=6IK1@aD9+%KQ~Cc zc-@HLrRVYWvJ`i#G-7iilkCUzye{+0oAXa&)~CY$GR`!8_;f)`)N_AsQ*wl8^SwsV K4r2JR-~10OInHwc