diff --git a/README.md b/README.md index 51036f6..bf777bf 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,9 @@ It injects a classes.dex file to modify a few fields in the android.os.Build cla The purpose of the module is to avoid a hardware attestation. -## About 'pif.json' file +## About 'custom.pif.json' file -You can modify this file in the module directory to spoof custom values to the GMS unstable process. +You can create this file in the module directory to spoof custom values to the GMS unstable process. It will be used instead of the included pif.json. You can't use values from recent devices due them triggering hardware backed attestation. diff --git a/app/src/main/cpp/main.cpp b/app/src/main/cpp/main.cpp index f9f596e..70ee610 100644 --- a/app/src/main/cpp/main.cpp +++ b/app/src/main/cpp/main.cpp @@ -12,6 +12,8 @@ #define JSON_FILE_PATH "/data/adb/modules/playintegrityfix/pif.json" +#define CUSTOM_JSON_FILE_PATH "/data/adb/modules/playintegrityfix/custom.pif.json" + static std::string FIRST_API_LEVEL, SECURITY_PATCH; typedef void (*T_Callback)(void *, const char *, const char *, uint32_t); @@ -247,7 +249,9 @@ static void companion(int fd) { fclose(dex); } - FILE *json = fopen(JSON_FILE_PATH, "r"); + FILE *json = fopen(CUSTOM_JSON_FILE_PATH, "r"); + if (!json) + FILE *json = fopen(JSON_FILE_PATH, "r"); if (json) { fseek(json, 0, SEEK_END); diff --git a/changelog.md b/changelog.md index 26e921f..8bf2c56 100644 --- a/changelog.md +++ b/changelog.md @@ -2,10 +2,12 @@ We have a Telegram channel! If you want to share your knowledge join: https://t.me/playintegrityfix -# v13.8 +# CUSTOM SPOOF v2.1 -Google banned old fingerprints :( +DO NOT USE THIS BUILD IF YOU AREN'T A DEVELOPER, ALWAYS USE LATEST STABLE. +THIS BUILD IS JUST FOR TESTING PURPOSES. -This build has hardcoded the fix into Zygisk native libs like v13.0. - -You can't use pif.json or pif.prop files to spoof custom props. \ No newline at end of file +- Removed custom resetprop. +- Fix JSON parsing. +- Less libs size. +- Few code improvements. diff --git a/module/customize.sh b/module/customize.sh index 091ef0f..0b02fdf 100644 --- a/module/customize.sh +++ b/module/customize.sh @@ -3,12 +3,21 @@ if [ "$API" -lt 26 ]; then abort "!!! You can't use this module on Android < 8.0" fi -# Remove safetynet-fix module if installed +# Remove/warn if conflicting modules are installed if [ -d /data/adb/modules/safetynet-fix ]; then touch /data/adb/modules/safetynet-fix/remove ui_print "- 'safetynet-fix' module will be removed on next reboot" fi +if [ -d /data/adb/modules/MagiskHidePropsConf ]; then + ui_print "- Warning, 'MagiskHidePropsConf' module may cause issues with PIF" +fi + +# Copy any custom.pif.json to updated module +if [ -f /data/adb/modules/playintegrityfix/custom.pif.json ]; then + ui_print "- Restoring custom.pif.json" + cp -af /data/adb/modules/playintegrityfix/custom.pif.json $MODPATH/custom.pif.json +fi # Clean up any leftover files from previous deprecated methods rm -f /data/data/com.google.android.gms/cache/pif.prop /data/data/com.google.android.gms/pif.prop -rm -f /data/data/com.google.android.gms/cache/pif.json /data/data/com.google.android.gms/pif.json \ No newline at end of file +rm -f /data/data/com.google.android.gms/cache/pif.json /data/data/com.google.android.gms/pif.json diff --git a/module/module.prop b/module/module.prop index 70ffaef..0503971 100644 --- a/module/module.prop +++ b/module/module.prop @@ -1,7 +1,7 @@ id=playintegrityfix name=Play Integrity Fix version=PROPS-v2.1 -versionCode=2001 +versionCode=2101 author=chiteroman description=Fix CTS profile (SafetyNet) and DEVICE verdict (Play Integrity). -updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json \ No newline at end of file +updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/custom/update.json diff --git a/module/post-fs-data.sh b/module/post-fs-data.sh index 39911d7..f19aae2 100644 --- a/module/post-fs-data.sh +++ b/module/post-fs-data.sh @@ -3,7 +3,41 @@ if magisk --denylist status; then magisk --denylist rm com.google.android.gms fi -# Remove safetynet-fix module if installed +# Remove conflicting modules if installed if [ -d /data/adb/modules/safetynet-fix ]; then touch /data/adb/modules/safetynet-fix/remove -fi \ No newline at end of file +fi + +# Conditional early sensitive properties + +resetprop_if_diff() { + local NAME=$1 + local EXPECTED=$2 + local CURRENT=$(resetprop $NAME) + + [ -z "$CURRENT" ] || [ "$CURRENT" == "$EXPECTED" ] || resetprop $NAME $EXPECTED +} +resetprop_if_match() { + local NAME=$1 + local CONTAINS=$2 + local VALUE=$3 + + [[ "$(resetprop $NAME)" == *"$CONTAINS"* ]] && resetprop $NAME $VALUE +} + +# RootBeer, Microsoft +resetprop_if_diff ro.build.tags release-keys + +# Samsung +resetprop_if_diff ro.boot.warranty_bit 0 +resetprop_if_diff ro.vendor.boot.warranty_bit 0 +resetprop_if_diff ro.vendor.warranty_bit 0 +resetprop_if_diff ro.warranty_bit 0 + +# OnePlus +resetprop_if_diff ro.is_ever_orange 0 + +# Other +resetprop_if_diff ro.build.type user +resetprop_if_diff ro.debuggable 0 +resetprop_if_diff ro.secure 1 diff --git a/module/service.sh b/module/service.sh index 279ec51..5cf3d4b 100644 --- a/module/service.sh +++ b/module/service.sh @@ -15,33 +15,15 @@ resetprop_if_match() { [[ "$(resetprop $NAME)" == *"$CONTAINS"* ]] && resetprop $NAME $VALUE } -# RootBeer, Microsoft -resetprop_if_diff ro.build.tags release-keys - -# Samsung -resetprop_if_diff ro.boot.warranty_bit 0 -resetprop_if_diff ro.vendor.boot.warranty_bit 0 -resetprop_if_diff ro.vendor.warranty_bit 0 -resetprop_if_diff ro.warranty_bit 0 - -# OnePlus -resetprop_if_diff ro.is_ever_orange 0 - -# Other -resetprop_if_diff ro.build.type user -resetprop_if_diff ro.debuggable 0 -resetprop_if_diff ro.secure 1 - # Magisk recovery mode resetprop_if_match ro.bootmode recovery unknown resetprop_if_match ro.boot.mode recovery unknown resetprop_if_match vendor.boot.mode recovery unknown # SELinux -if [ -n "$(getprop ro.build.selinux)" ]; then - resetprop --delete ro.build.selinux +if [ -n "$(resetprop ro.build.selinux)" ]; then + resetprop --delete ro.build.selinux fi - # use toybox to protect *stat* access time reading if [ "$(toybox cat /sys/fs/selinux/enforce)" == "0" ]; then chmod 640 /sys/fs/selinux/enforce @@ -68,4 +50,4 @@ fi resetprop_if_diff ro.boot.verifiedbootstate green resetprop_if_diff ro.boot.veritymode enforcing resetprop_if_diff vendor.boot.vbmeta.device_state locked -}& \ No newline at end of file +}& diff --git a/update.json b/update.json index 6e4bb71..f39cd59 100644 --- a/update.json +++ b/update.json @@ -1,6 +1,6 @@ { - "version": "v13.8", - "versionCode": 138, - "zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v13.8/PlayIntegrityFix_v13.8.zip", - "changelog": "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/changelog.md" -} \ No newline at end of file + "version": "v2.1", + "versionCode": 2101, + "zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/PROPS/PlayIntegrityFix_PROPS-v2.1.zip", + "changelog": "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/custom/changelog.md" +}