action: update to inject pif.json format

This commit is contained in:
KOWX712 2025-03-05 05:18:35 +08:00
parent 7aea0da641
commit d8548d8a5b

View File

@ -99,10 +99,14 @@ sdk_version="${sdk_version:-25}"
echo "Device SDK version: $sdk_version" echo "Device SDK version: $sdk_version"
# Preserve previous setting # Preserve previous setting
spoofVending="$(grep -oE '"spoofVendingSdk": [01]' "$MODDIR/pif.json" | cut -d' ' -f2)" spoofConfig="spoofProvider spoofProps spoofSignature DEBUG"
if [ -z "$spoofVending" ] || [ "$spoofVending" != 1 ]; then for config in $spoofConfig; do
spoofVending=0 if grep -q "\"$config\": true" "$MODDIR/pif.json"; then
fi eval "$config=true"
else
eval "$config=false"
fi
done
echo "- Dumping values to pif.json ..." echo "- Dumping values to pif.json ..."
cat <<EOF | tee pif.json cat <<EOF | tee pif.json
@ -112,7 +116,10 @@ cat <<EOF | tee pif.json
"MODEL": "$MODEL", "MODEL": "$MODEL",
"SECURITY_PATCH": "$SECURITY_PATCH", "SECURITY_PATCH": "$SECURITY_PATCH",
"DEVICE_INITIAL_SDK_INT": $sdk_version, "DEVICE_INITIAL_SDK_INT": $sdk_version,
"spoofVendingSdk": $spoofVending "spoofProvider": $spoofProvider,
"spoofProps": $spoofProps,
"spoofSignature": $spoofSignature,
"DEBUG": $DEBUG
} }
EOF EOF