Merge pull request #103 from osm0sis/custom

custom.pif.json check, use and restore; enable custom branch module updates, and more (custom)
This commit is contained in:
Marcos 2023-11-30 13:27:34 +01:00 committed by GitHub
commit bc1ef14c8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 71 additions and 40 deletions

View File

@ -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. 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. You can't use values from recent devices due them triggering hardware backed attestation.

View File

@ -12,6 +12,8 @@
#define JSON_FILE_PATH "/data/adb/modules/playintegrityfix/pif.json" #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; static std::string FIRST_API_LEVEL, SECURITY_PATCH;
typedef void (*T_Callback)(void *, const char *, const char *, uint32_t); typedef void (*T_Callback)(void *, const char *, const char *, uint32_t);
@ -247,6 +249,8 @@ static void companion(int fd) {
fclose(dex); fclose(dex);
} }
FILE *json = fopen(CUSTOM_JSON_FILE_PATH, "r");
if (!json)
FILE *json = fopen(JSON_FILE_PATH, "r"); FILE *json = fopen(JSON_FILE_PATH, "r");
if (json) { if (json) {

View File

@ -2,10 +2,12 @@ We have a Telegram channel!
If you want to share your knowledge join: If you want to share your knowledge join:
https://t.me/playintegrityfix 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. - Removed custom resetprop.
- Fix JSON parsing.
You can't use pif.json or pif.prop files to spoof custom props. - Less libs size.
- Few code improvements.

View File

@ -3,11 +3,20 @@ if [ "$API" -lt 26 ]; then
abort "!!! You can't use this module on Android < 8.0" abort "!!! You can't use this module on Android < 8.0"
fi fi
# Remove safetynet-fix module if installed # Remove/warn if conflicting modules are installed
if [ -d /data/adb/modules/safetynet-fix ]; then if [ -d /data/adb/modules/safetynet-fix ]; then
touch /data/adb/modules/safetynet-fix/remove touch /data/adb/modules/safetynet-fix/remove
ui_print "- 'safetynet-fix' module will be removed on next reboot" ui_print "- 'safetynet-fix' module will be removed on next reboot"
fi 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 # 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.prop /data/data/com.google.android.gms/pif.prop

View File

@ -1,7 +1,7 @@
id=playintegrityfix id=playintegrityfix
name=Play Integrity Fix name=Play Integrity Fix
version=PROPS-v2.1 version=PROPS-v2.1
versionCode=2001 versionCode=2101
author=chiteroman author=chiteroman
description=Fix CTS profile (SafetyNet) and DEVICE verdict (Play Integrity). description=Fix CTS profile (SafetyNet) and DEVICE verdict (Play Integrity).
updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/custom/update.json

View File

@ -3,7 +3,41 @@ if magisk --denylist status; then
magisk --denylist rm com.google.android.gms magisk --denylist rm com.google.android.gms
fi fi
# Remove safetynet-fix module if installed # Remove conflicting modules if installed
if [ -d /data/adb/modules/safetynet-fix ]; then if [ -d /data/adb/modules/safetynet-fix ]; then
touch /data/adb/modules/safetynet-fix/remove touch /data/adb/modules/safetynet-fix/remove
fi 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

View File

@ -15,33 +15,15 @@ resetprop_if_match() {
[[ "$(resetprop $NAME)" == *"$CONTAINS"* ]] && resetprop $NAME $VALUE [[ "$(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 # Magisk recovery mode
resetprop_if_match ro.bootmode recovery unknown resetprop_if_match ro.bootmode recovery unknown
resetprop_if_match ro.boot.mode recovery unknown resetprop_if_match ro.boot.mode recovery unknown
resetprop_if_match vendor.boot.mode recovery unknown resetprop_if_match vendor.boot.mode recovery unknown
# SELinux # SELinux
if [ -n "$(getprop ro.build.selinux)" ]; then if [ -n "$(resetprop ro.build.selinux)" ]; then
resetprop --delete ro.build.selinux resetprop --delete ro.build.selinux
fi fi
# use toybox to protect *stat* access time reading # use toybox to protect *stat* access time reading
if [ "$(toybox cat /sys/fs/selinux/enforce)" == "0" ]; then if [ "$(toybox cat /sys/fs/selinux/enforce)" == "0" ]; then
chmod 640 /sys/fs/selinux/enforce chmod 640 /sys/fs/selinux/enforce

View File

@ -1,6 +1,6 @@
{ {
"version": "v13.8", "version": "v2.1",
"versionCode": 138, "versionCode": 2101,
"zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v13.8/PlayIntegrityFix_v13.8.zip", "zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/PROPS/PlayIntegrityFix_PROPS-v2.1.zip",
"changelog": "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/changelog.md" "changelog": "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/custom/changelog.md"
} }