2020 ota_hash : ${{ steps.get_info.outputs.ota_hash }}
2121 steps :
2222 - name : Checkout repository
23- uses : actions/checkout@v5
23+ uses : actions/checkout@v6
2424 with :
2525 fetch-depth : 1
2626 ref : bot
@@ -34,13 +34,16 @@ jobs:
3434 download https://developer.android.com/about/versions PIXEL_VERSIONS_HTML
3535 download "$(grep -o 'https://developer.android.com/about/versions/.*[0-9]"' PIXEL_VERSIONS_HTML | sort -ru | cut -d\" -f1 | head -n1)" PIXEL_LATEST_HTML
3636 download "https://developer.android.com$(grep -o 'href=".*download-ota.*"' PIXEL_LATEST_HTML | grep 'qpr' | cut -d\" -f2 | head -n1)" PIXEL_OTA_HTML
37+ download https://developer.android.com/topic/generic-system-image/releases PIXEL_GSI_HTML
3738
3839 # Extract device information
3940 grep -A1 'tr id=' PIXEL_OTA_HTML | grep 'td' | sed 's;.*<td>\(.*\)</td>;\1;' > MODEL_LIST
4041 grep -o 'tr id="[^\"]*"' PIXEL_OTA_HTML | awk -F\" '{print $2 "_beta"}' > PRODUCT_LIST
4142 grep 'ota/.*_beta' PIXEL_OTA_HTML | cut -d\" -f2 > OTA_LIST
43+ grep -m1 'corresponding Google Pixel builds' PIXEL_GSI_HTML | grep -o '/versions/.*' | cut -d/ -f3 > RELEASE
4244
43- CURRENT_HASH=$(sha256sum OTA_LIST | cut -d' ' -f1)
45+ # CURRENT_HASH=$(sha256sum OTA_LIST | cut -d' ' -f1)
46+ CURRENT_HASH=$(sha256sum RELEASE | cut -d' ' -f1)
4447 LAST_HASH=$(cat ../HASH || echo '')
4548
4649 if [ "$CURRENT_HASH" == "$LAST_HASH" ] && [ "${{ github.event.inputs.force_update }}" != "true" ]; then
6366
6467 steps :
6568 - name : Checkout repository
66- uses : actions/checkout@v5
69+ uses : actions/checkout@v6
6770 with :
6871 fetch-depth : 1
6972 ref : bot
8285 run : |
8386 model="${{ matrix.model }}"
8487 product="${{ matrix.product }}"
85- ota_link="${{ matrix.ota_link }}"
88+ # ota_link="${{ matrix.ota_link }}"
8689
90+ ##############################################################################################################################
8791 # Download avbtool
8892 # curl -Ls https://android.googlesource.com/platform/external/avb/+/master/avbtool.py?format=TEXT | base64 -d > avbtool.py
8993
@@ -97,9 +101,34 @@ jobs:
97101 # DIGEST=$(avbtool calculate_vbmeta_digest --image vbmeta.img)
98102
99103 # Get other information
100- payload_dumper --metadata --out . "$ota_link"
101- FINGERPRINT=$(grep -am1 'post-build=' metadata | cut -d= -f2)
102- SECURITY_PATCH=$(grep -am1 'security-patch-level=' metadata | cut -d= -f2)
104+ # payload_dumper --metadata --out . "$ota_link"
105+ # FINGERPRINT=$(grep -am1 'post-build=' metadata | cut -d= -f2)
106+ # SECURITY_PATCH=$(grep -am1 'security-patch-level=' metadata | cut -d= -f2)
107+ ##############################################################################################################################
108+
109+ download() { wget -T 20 --no-check-certificate "$1" -O "$2"; }
110+
111+ # Get fingerprint detail
112+ download https://developer.android.com/topic/generic-system-image/releases PIXEL_GSI_HTML
113+ RELEASE="$(grep -m1 'corresponding Google Pixel builds' PIXEL_GSI_HTML | grep -o '/versions/.*' | cut -d/ -f3)"
114+ ID="$(grep -m1 -o 'Build:.*' PIXEL_GSI_HTML | cut -d' ' -f2)"
115+ INCREMENTAL="$(grep -m1 -o "$ID-.*-" PIXEL_GSI_HTML | cut -d- -f2)"
116+
117+ # Get security patch
118+ download https://source.android.com/docs/security/bulletin/pixel PIXEL_SECBULL_HTML
119+ SECURITY_PATCH="$(grep -A15 "$(grep -m1 -o 'Security patch level:.*' PIXEL_GSI_HTML | cut -d' ' -f4-)" PIXEL_SECBULL_HTML | grep -m1 -B1 '</tr>' | grep 'td' | sed 's;.*<td>\(.*\)</td>;\1;')"
120+
121+ DEVICE=$(echo "$product" | sed 's/_beta//')
122+ FINGERPRINT="google/$product/$DEVICE:$RELEASE/$ID/$INCREMENTAL:user/release-keys"
123+
124+ # Validate required fields
125+ required="model product DEVICE RELEASE ID INCREMENTAL SECURITY_PATCH"
126+ for i in $required; do
127+ if [ -z "${!i}" ]; then
128+ echo "Missing $i"
129+ exit 1
130+ fi
131+ done
103132
104133 cat <<EOF > ../${product}.prop
105134 FINGERPRINT=$FINGERPRINT
@@ -120,7 +149,7 @@ jobs:
120149 runs-on : ubuntu-latest
121150 steps :
122151 - name : Checkout repository
123- uses : actions/checkout@v5
152+ uses : actions/checkout@v6
124153 with :
125154 fetch-depth : 1
126155 ref : bot
0 commit comments