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