Skip to content

Commit

Permalink
Fixes and updates to naming scheme
Browse files Browse the repository at this point in the history
We moving to Device Codename and Build ID for the file name and added build description information within release info.
This is also an attempt at fixing the PIF looping true the whole checks.
  • Loading branch information
0x11DFE committed Mar 7, 2024
1 parent 32ae367 commit 767edf8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build-on-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
id: check_build_id
run: |
BASENAME="${{ steps.extract_and_build.outputs.module_base_name }}"
BUILD_ID=${{ steps.extract_and_build.outputs.device_build_id }}
BUILD_ID="${{ steps.extract_and_build.outputs.device_build_id }}"
EXISTING_RELEASE_NOTES=$(curl --silent "https://api.github.com/repos/$GITHUB_REPOSITORY/releases" | jq '.[].body')
if echo "$EXISTING_RELEASE_NOTES" | grep -q "${BASENAME}_${BUILD_ID}"; then
echo "BUILD_EXISTS=true" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -98,17 +98,19 @@ jobs:
- File name: `${{ steps.extract_and_build.outputs.module_base_name }}.zip`
- File hash (SHA256): `${{ steps.extract_and_build.outputs.module_hash }}`
#### Firmware
- Build Description: ${{ steps.extract_and_build.outputs.device_build_description }}
- Android Version: `${{ steps.extract_and_build.outputs.device_build_android_version }}`
- Build ID: `${{ steps.extract_and_build.outputs.device_build_id }}`
- Android version: `${{ steps.extract_and_build.outputs.device_build_android_version }}`
- Security patch: `${{ steps.extract_and_build.outputs.device_build_security_patch }}`
- Security Patch: `${{ steps.extract_and_build.outputs.device_build_security_patch }}`
if: steps.check_build_id.outputs.BUILD_EXISTS == 'false'

- name: Send to Telegram
run: |
{
echo '${{ steps.extract_and_build.outputs.device_name }} - ${{ steps.extract_and_build.outputs.device_codename }}';
echo 'Build Description: ${{ steps.extract_and_build.outputs.device_build_description }}'
echo 'Build ID: ${{ steps.extract_and_build.outputs.device_build_id }}';
echo 'Security Patch: ${{ steps.extract_and_build.outputs.device_build_security_patch }}';
echo 'BUILD ID: ${{ steps.extract_and_build.outputs.device_build_id }}';
} > .tg_caption
curl -X POST "https://api.telegram.org/bot${{ secrets.BOT_TOKEN }}/sendDocument" \
Expand Down
2 changes: 2 additions & 0 deletions build_magisk_module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ system_prop_path="$dir/system.prop"
device_name=$(grep_prop "ro.product.model" "$system_prop_path")
device_build_id=$(grep_prop "ro.build.id" "$system_prop_path")
device_codename=$(grep_prop "ro.product.vendor.name" "$system_prop_path")
device_build_description=$(grep_prop "ro.build.description" "$system_prop_path")
device_build_android_version=$(grep_prop "ro.vendor.build.version.release" "$system_prop_path")
device_build_security_patch=$(grep_prop "ro.vendor.build.security_patch" "$system_prop_path")
device_codename=${device_codename^}
Expand Down Expand Up @@ -52,6 +53,7 @@ if [ -n "$GITHUB_OUTPUT" ]; then
echo "device_name=$device_name"
echo "device_codename=$device_codename"
echo "device_build_id=$device_build_id"
echo "device_build_description=$device_build_description"
echo "device_build_android_version=$device_build_android_version"
echo "device_build_security_patch=$device_build_security_patch"
} >>"$GITHUB_OUTPUT"
Expand Down
25 changes: 14 additions & 11 deletions magisk_module_files/pif.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ PIF_SDK=$(grep_prop "ro.build.version.sdk" "$MODPATH_SYSTEM_PROP")
# Set ENABLE_PIF_SPOOF to false by default
ENABLE_PIF_SPOOF=false

# Loop true each PIF dirs
for PIF_DIR in $PIF_DIRS; do
# Check if the device name is beta or if ENABLE_PIF_SPOOF is set to true
if [[ "$PIF_PRODUCT" == *_beta ]] || [ "$ENABLE_PIF_SPOOF" = "true" ]; then
# Check if the device name is beta or if ENABLE_PIF_SPOOF is set to true
if [[ "$PIF_PRODUCT" == *_beta ]] || [ "$ENABLE_PIF_SPOOF" = "true" ]; then

NEW_PIF=$(
cat <<EOF
NEW_PIF=$(
cat <<EOF
{
"BUILD_ID": "$PIF_BUILD_ID",
"PRODUCT": "$PIF_PRODUCT",
Expand All @@ -43,8 +41,10 @@ for PIF_DIR in $PIF_DIRS; do
"_comment": "https://t.me/PixelProps",
}
EOF
)
)

# Loop true each PIF dirs
for PIF_DIR in $PIF_DIRS; do
# Compare new PIF with existing PIF file
if echo "$NEW_PIF" | cmp - "$PIF_DIR" >/dev/null; then
ui_print " - No changes detected in PlayIntegrityFix file."
Expand All @@ -69,9 +69,12 @@ EOF
# Open the guide for fixing new generation assistant and possibly more...
nohup am start -a android.intent.action.VIEW -d https://t.me/PixelProps/157 >/dev/null 2>&1 &
fi
else
ui_print " - PlayIntegritySpoof does not met device or is disabled."
done
else
ui_print " - PlayIntegritySpoof does not met device or is disabled."

# Loop true each PIF dirs
for PIF_DIR in $PIF_DIRS; do
# If has backup restore it
[ -f "${PIF_DIR}.old" ] && mv "${PIF_DIR}.old" "$PIF_DIR"

Expand All @@ -80,5 +83,5 @@ EOF
ui_print " -+ Missing $PIF_DIR, Downloading stable one for you."
wget -O -q --show-progress "$PIF_DIR" "https://raw.githubusercontent.com/x1337cn/AutoPIF-Next/main/pif.json"
fi
fi
done
done
fi

0 comments on commit 767edf8

Please sign in to comment.