diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..6d89050 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..146ab09 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..0ad17cb --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 6d0f324..8d48756 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,11 @@ It injects a classes.dex file to modify few fields in android.os.Build class. Al it creates a hook to modify system properties. The purpose of the module is to avoid a hardware attestation. +## About 'pif.prop' file + +You can modify this file to spoof android.os.Build fields in GMS unstable process and try to pass Device verdict. +You can't use values from recent devices due this devices must use a hardware attestation. + ## Failing BASIC verdict If you are failing basicIntegrity (SafetyNet) or MEETS_BASIC_INTEGRITY (Play Integrity) something is diff --git a/changelog.md b/changelog.md index 46502e2..793ce0f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,11 +1,10 @@ -# v13.1 +# v13.2 -For normal users: -- Custom props! You can edit them in file 'pif.prop' +- Added SECURITY_PATCH field. +- Ignore null and empty fields. -For devs: -- Source code published again. -- Drop support for emulators (x86 and x86_64). -- Use ShadowHook instead Dobby. -- Updated libcxx. -- 'classes.dex' is back to module folder instead hardcoding it in libs. \ No newline at end of file +We have a Telegram channel! +If you want to share your knowledge join: +https://t.me/playintegrityfix + +Also, if Google blacklist the fingerprint (again), you can post your custom pif.prop and I will update the module. \ No newline at end of file diff --git a/module/META-INF/com/google/android/update-binary b/module/META-INF/com/google/android/update-binary new file mode 100644 index 0000000..28b48e5 --- /dev/null +++ b/module/META-INF/com/google/android/update-binary @@ -0,0 +1,33 @@ +#!/sbin/sh + +################# +# Initialization +################# + +umask 022 + +# echo before loading util_functions +ui_print() { echo "$1"; } + +require_new_magisk() { + ui_print "*******************************" + ui_print " Please install Magisk v20.4+! " + ui_print "*******************************" + exit 1 +} + +######################### +# Load util_functions.sh +######################### + +OUTFD=$2 +ZIPFILE=$3 + +mount /data 2>/dev/null + +[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk +. /data/adb/magisk/util_functions.sh +[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk + +install_module +exit 0 diff --git a/module/META-INF/com/google/android/updater-script b/module/META-INF/com/google/android/updater-script new file mode 100644 index 0000000..11d5c96 --- /dev/null +++ b/module/META-INF/com/google/android/updater-script @@ -0,0 +1 @@ +#MAGISK diff --git a/module/customize.sh b/module/customize.sh new file mode 100644 index 0000000..a7330e4 --- /dev/null +++ b/module/customize.sh @@ -0,0 +1,10 @@ +# Android < 8.0 +if [ "$API" -lt 26 ]; then + abort "!!! You can't use this module on Android < 8.0" +fi + +# Check if safetynet-fix is installed +if [ -d "/data/adb/modules/safetynet-fix" ]; then + ui_print "! safetynet-fix module will be removed" + touch "/data/adb/modules/safetynet-fix/remove" +fi \ No newline at end of file diff --git a/module/module.prop b/module/module.prop new file mode 100644 index 0000000..4379871 --- /dev/null +++ b/module/module.prop @@ -0,0 +1,7 @@ +id=playintegrityfix +name=Play Integrity Fix +version=v13.2 +versionCode=132 +author=chiteroman +description=Fix CTS profile (SafetyNet) and DEVICE verdict (Play Integrity). +updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json diff --git a/module/pif.prop b/module/pif.prop new file mode 100644 index 0000000..6d73474 --- /dev/null +++ b/module/pif.prop @@ -0,0 +1,7 @@ +PRODUCT=bullhead +DEVICE=bullhead +MANUFACTURER=Google +BRAND=Google +MODEL=Nexus 5X +FINGERPRINT=google/bullhead/bullhead:8.0.0/OPR6.170623.013/4283548:user/release-keys +SECURITY_PATCH=2018-01-01 \ No newline at end of file diff --git a/module/post-fs-data.sh b/module/post-fs-data.sh new file mode 100644 index 0000000..23b1cab --- /dev/null +++ b/module/post-fs-data.sh @@ -0,0 +1,9 @@ +# Remove Play Services from the Magisk Denylist when set to enforcing. +if magisk --denylist status; then + magisk --denylist rm com.google.android.gms +fi + +# Check if safetynet-fix is installed +if [ -d "/data/adb/modules/safetynet-fix" ]; then + touch "/data/adb/modules/safetynet-fix/remove" +fi \ No newline at end of file diff --git a/module/service.sh b/module/service.sh new file mode 100644 index 0000000..307ea1c --- /dev/null +++ b/module/service.sh @@ -0,0 +1,46 @@ +# Sensitive properties + +maybe_set_prop() { + local prop="$1" + local contains="$2" + local value="$3" + + if [[ "$(getprop "$prop")" == *"$contains"* ]]; then + resetprop "$prop" "$value" + fi +} + +# Magisk recovery mode +maybe_set_prop ro.bootmode recovery unknown +maybe_set_prop ro.boot.mode recovery unknown +maybe_set_prop vendor.boot.mode recovery unknown + +# Hiding SELinux | Permissive status +resetprop --delete ro.build.selinux + +# Hiding SELinux | Use toybox to protect *stat* access time reading +if [[ "$(toybox cat /sys/fs/selinux/enforce)" == "0" ]]; then + chmod 640 /sys/fs/selinux/enforce + chmod 440 /sys/fs/selinux/policy +fi + +# Late props which must be set after boot_completed +{ + until [[ "$(getprop sys.boot_completed)" == "1" ]]; do + sleep 1 + done + + # SafetyNet/Play Integrity | Avoid breaking Realme fingerprint scanners + resetprop ro.boot.flash.locked 1 + + # SafetyNet/Play Integrity | Avoid breaking Oppo fingerprint scanners + resetprop ro.boot.vbmeta.device_state locked + + # SafetyNet/Play Integrity | Avoid breaking OnePlus display modes/fingerprint scanners + resetprop vendor.boot.verifiedbootstate green + + # SafetyNet/Play Integrity | Avoid breaking OnePlus display modes/fingerprint scanners on OOS 12 + resetprop ro.boot.verifiedbootstate green + resetprop ro.boot.veritymode enforcing + resetprop vendor.boot.vbmeta.device_state locked +}& diff --git a/module/system.prop b/module/system.prop new file mode 100644 index 0000000..a1dfa57 --- /dev/null +++ b/module/system.prop @@ -0,0 +1,16 @@ +# RootBeer, Microsoft +ro.build.tags=release-keys + +# Samsung +ro.boot.warranty_bit=0 +ro.vendor.boot.warranty_bit=0 +ro.vendor.warranty_bit=0 +ro.warranty_bit=0 + +# OnePlus +ro.is_ever_orange=0 + +# Other +ro.build.type=user +ro.debuggable=0 +ro.secure=1 diff --git a/update.json b/update.json index 2a86028..774c7f8 100644 --- a/update.json +++ b/update.json @@ -1,6 +1,6 @@ { - "version": "v13.1", - "versionCode": 131, - "zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v13.1/PlayIntegrityFix_v13.1.zip", + "version": "v13.2", + "versionCode": 132, + "zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v13.2/PlayIntegrityFix_v13.2.zip", "changelog": "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/changelog.md" } \ No newline at end of file