Skip to content

Commit

Permalink
Update parse.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Lutra-Fs authored Oct 27, 2024
1 parent fd934d0 commit 5ca8135
Showing 1 changed file with 3 additions and 31 deletions.
34 changes: 3 additions & 31 deletions util/parse.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

echo ''
echo '-------------------------------------'
echo 'Parsing data ......'
Expand Down Expand Up @@ -30,39 +29,12 @@ do
XML_FILE="./tmp/checker/${i}.xml"
RESULT_FILE="./tmp/parse/${i}-result.info"

# # Extract version - look between <manifest and </manifest>
# VERSION=$(extract_value "$XML_FILE" "<manifest" "</manifest>" "version")

# # Extract URLs - look between <urls and </urls>
# URL1=$(sed -n '/<urls/,/<\/urls>/p' "$XML_FILE" | \
# sed -n '/edgedl\.me\.gvt1\.com/ {
# s/.*codebase="https:\/\/edgedl\.me\.gvt1\.com\///
# s/".*//
# p
# }' | head -1)

# URL2=$(sed -n '/<urls/,/<\/urls>/p' "$XML_FILE" | \
# sed -n '/dl\.google\.com/ {
# s/.*codebase="https:\/\/dl\.google\.com\///
# s/".*//
# p
# }' | head -1)

# # Extract installer - look between <actions and </actions>
# INSTALLER=$(extract_value "$XML_FILE" "<actions" "</actions>" "run")

# # Extract SHA256 - look between <packages and </packages>
# SHA256=$(extract_value "$XML_FILE" "<packages" "</packages>" "hash_sha256")

# # Extract size - look between <packages and </packages>
# SIZE=$(extract_value "$XML_FILE" "<packages" "</packages>" "size")

# Extract version - simpler pattern
VERSION=$(sed -n 's/.*manifest version="\([^"]*\)".*/\1/p' "$XML_FILE")

# Extract URLs - simpler patterns
URL1=$(sed -n 's/.*codebase="https:\/\/edgedl\.me\.gvt1\.com\/\([^"]*\)".*/\1/p' "$XML_FILE" | head -1)
URL2=$(sed -n 's/.*codebase="https:\/\/dl\.google\.com\/\([^"]*\)".*/\1/p' "$XML_FILE" | head -1)
# Extract URLs - with complete base URLs
URL1=$(sed -n 's/.*codebase="\(https:\/\/edgedl\.me\.gvt1\.com\/[^"]*\)".*/\1/p' "$XML_FILE" | head -1)
URL2=$(sed -n 's/.*codebase="\(https:\/\/dl\.google\.com\/[^"]*\)".*/\1/p' "$XML_FILE" | head -1)

# Extract installer name - simpler pattern
INSTALLER=$(sed -n 's/.*run="\([^"]*\)".*/\1/p' "$XML_FILE" | head -1)
Expand Down

0 comments on commit 5ca8135

Please sign in to comment.