installation: preserve previous setting

This commit is contained in:
KOWX712 2025-03-05 05:39:30 +08:00
parent 2ec00781e5
commit 70fd04ad6e

View File

@ -61,10 +61,16 @@ if [ -d "/data/adb/modules/MagiskHidePropsConf" ]; then
fi fi
# Preserve previous setting # Preserve previous setting
spoofVending="$(grep -oE '"spoofVendingSdk": [01]' "/data/adb/modules/playintegrityfix/pif.json" | cut -d' ' -f2)" spoofConfig="spoofProvider spoofProps spoofSignature DEBUG"
if [ -n "$spoofVending" ] && [ "$spoofVending" -eq 1 ]; then for config in $spoofConfig; do
sed -i 's/"spoofVendingSdk": 0/"spoofVendingSdk": 1/' "$MODPATH/pif.json" grep -q "$config" "/data/adb/modules/playintegrityfix/pif.json" || continue
if grep -q "\"$config\": true" "/data/adb/modules/playintegrityfix/pif.json"; then
sed -i "s/\"$config\": .*/\"$config\": true,/" "$MODPATH/pif.json"
else
sed -i "s/\"$config\": .*/\"$config\": false,/" "$MODPATH/pif.json"
fi fi
done
sed -i ':a;N;$!ba;s/,\n}/\n}/g' "$MODPATH/pif.json"
# Check custom fingerprint # Check custom fingerprint
if [ -f "/data/adb/pif.json" ]; then if [ -f "/data/adb/pif.json" ]; then