From 999ece087b0cd21ce8731de330dc1e837f98a5c6 Mon Sep 17 00:00:00 2001 From: Tesla <43712252+0x11DFE@users.noreply.github.com> Date: Mon, 4 Nov 2024 23:28:06 +0100 Subject: [PATCH] :airplane: action improvements. - Rewritten the logic, Now doesn't include MODEL and PRODUCT list into one but rather builds it from the grep | awk. - Product name should be codename (Google...) - Added inspiration credits (CIT) even though i had planned this feature a while longer before him or Osm0sis... --- README.md | 21 ++++--- magisk_module_files/action.sh | 104 +++++++++++++++------------------- 2 files changed, 59 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index f85001c..077c169 100644 --- a/README.md +++ b/README.md @@ -36,16 +36,21 @@ Effortlessly extract and manage system properties from Pixel OTA updates with th ## ✨ Key Features -- **Automated OTA Acquisition:** Downloads the most recent builds directly from Google's official sources. -- **Seamless Image Extraction:** Supports both factory and OTA images for versatile usage. -- **Build Prop Generation:** Effortlessly converts extracted images into organized build.prop files. +- **Automated OTA Acquisition:** Downloads the latest builds directly from Google's official sources. +- **Seamless Image Extraction:** Extracts system images from both factory images and OTA updates. +- **Build Prop Generation:** Automatically generates `build.prop` files from extracted system images. +- **Magisk Module Features:** + - **`service.sh`:** + - **Safe Mode:** Prevents accidental modification of critical system settings by comparing module properties with existing system values. + - **`action.sh`:** + - **PlayIntegrityFix:** Automatically builds the `PIF.json` configuration when using a Beta OTA. Provides options to download pre-built configurations or crawl Google's OTA pages to generate a list of devices for building the configuration. + - **TrickyStore:** Automatically builds the target app package list and handles broken TEE status. - **GitHub Actions Integration:** - - **Scheduled Workflows:** Configure automated updates, builds, and releases. - - **Duplicate Release Prevention:** Intelligent checks prevent redundant releases. - - **Telegram Notifications:** Stay informed about build processes with timely updates. + - **Scheduled Workflows:** Automate updates, builds, and releases on a schedule. + - **Duplicate Release Prevention:** Prevents redundant releases with intelligent checks. + - **Telegram Notifications:** Receive timely updates about build processes. - **Future Enhancements:** - - **PlayIntegrityFix Integration:** Planned support for enhanced app integrity checks (under development). - - **[Pixel.Features](https://github.com/Pixel-Props/pixel.features/):** Planned support for building Pixel-specific features (under development). + - **[Pixel.Features](https://github.com/Pixel-Props/pixel.features/):** Add support for building Pixel-specific features (currently includes `sysconfigs`). ## 📝 Responsible Usage Guidelines diff --git a/magisk_module_files/action.sh b/magisk_module_files/action.sh index bf4ddac..793506e 100644 --- a/magisk_module_files/action.sh +++ b/magisk_module_files/action.sh @@ -55,23 +55,16 @@ PlayIntegrityFix() { ui_print " - Detected an official version of PlayIntegrityFix, Proceeding Building PIF.json for official version…" # List of properties to include in the PIF.json file - PIF_LIST="MODEL MANUFACTURER DEVICE_INITIAL_SDK_INT FINGERPRINT SECURITY_PATCH" + PIF_LIST="MODEL MANUFACTURER FINGERPRINT SECURITY_PATCH DEVICE_INITIAL_SDK_INT" # Build properties MODEL=$(grep_prop "ro.product.model" "$MODPROP_CONTENT") - # BRAND=$(grep_prop "ro.product.brand" "$MODPROP_CONTENT") MANUFACTURER=$(grep_prop "ro.product.manufacturer" "$MODPROP_CONTENT") - # DEVICE=$(grep_prop "ro.product.product.device" "$MODPROP_CONTENT") - # RELEASE=$(grep_prop "ro.product.build.version.release" "$MODPROP_CONTENT") - # ID=$(grep_prop "ro.product.build.id" "$MODPROP_CONTENT") - # INCREMENTAL=$(grep_prop "ro.build.version.incremental" "$MODPROP_CONTENT") PRODUCT=$(grep_prop "ro.product.product.name" "$MODPROP_CONTENT") - DEVICE_INITIAL_SDK_INT=$(grep_prop "ro.product.first_api_level" "$SYSPROP_CONTENT") - [ -z "$DEVICE_INITIAL_SDK_INT" ] && DEVICE_INITIAL_SDK_INT=$(grep_prop "ro.product.build.version.sdk" "$SYSPROP_CONTENT") FINGERPRINT=$(grep_prop "ro.product.build.fingerprint" "$MODPROP_CONTENT") SECURITY_PATCH=$(grep_prop "ro.vendor.build.security_patch" "$MODPROP_CONTENT") - # TYPE=$(grep_prop "ro.product.build.type" "$MODPROP_CONTENT") - # TAGS=$(grep_prop "ro.product.build.tags" "$MODPROP_CONTENT") + DEVICE_INITIAL_SDK_INT=$(grep_prop "ro.product.first_api_level" "$SYSPROP_CONTENT") + [ -z "$DEVICE_INITIAL_SDK_INT" ] && DEVICE_INITIAL_SDK_INT=$(grep_prop "ro.product.build.version.sdk" "$SYSPROP_CONTENT") fi # Set location of pif.json to of the current working directory @@ -92,17 +85,23 @@ PlayIntegrityFix() { ;; *) ui_print " - Non BETA module detected" - ui_print " - Do you wan't to download the PIF.json from GitHub? (chiteroman/PlayIntegrityFix)" + ui_print " - Download the PIF.json from GitHub? (chiteroman/PlayIntegrityFix)" # Ask whether to download PIF.json from chiteroman's GitHub or build one yourself - volume_key_event_setval "DOWNLOAD_PIF_GITHUB" true false "DOWNLOAD_PIF_GITHUB" + volume_key_event_setval "DOWNLOAD_PIF_GITHUB" true false "ACTION_DOWNLOAD_PIF_GITHUB" + + # TODO: Not sure if i should add support for config.prop here (in case no HW keys present) ? # Either download the PIF.json from chiteroman's GitHub or build one yourself - if boolval "$DOWNLOAD_PIF_GITHUB"; then + if boolval "$ACTION_DOWNLOAD_PIF_GITHUB"; then download_file "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/module/pif.json" "$CWD_PIF" else - # Download Generic System Image (GSI) HTML - ui_print " - Scalping Google's latest Pixel Beta Release…" + # This crawling mechanism was originally inspired by the CIT Project. + # This implementation addresses limitations in the original by providing: + # - A comprehensive device listing with user selection. + # - Enhanced crawling capabilities focused on (Beta) releases. + + ui_print " - Crawling the latest Google Pixel Beta OTA Release…" # Download Generic System Image (GSI) HTML download_file https://developer.android.com/topic/generic-system-image/releases DL_GSI_HTML @@ -111,10 +110,10 @@ PlayIntegrityFix() { RELEASE_DATE="$(date -D '%B %e, %Y' -d "$(grep -m1 -o 'Date:.*' DL_GSI_HTML | cut -d\ -f2-4)" '+%Y-%m-%d')" # Extract the release version from the link closest to the "(Beta)" string - RELEASE_VERSION="$(awk '/\(Beta\)/ {flag=1} /versions/ && flag {print; flag=0}' DL_GSI_HTML | grep -o '/versions/[0-9]*' | sed 's/\/versions\///')" + RELEASE_VERSION="$(awk '/\(Beta\)/ {flag=1} /versions/ && flag {print; flag=0}' DL_GSI_HTML | sed -n 's/.*\/versions\/\([0-9]*\).*/\1/p')" # Extract the build ID from the text closest to the "(Beta)" string - ID="$(awk '/\(Beta\)/ {flag=1} /Build:/ && flag {print; flag=0}' DL_GSI_HTML | grep -o 'Build: [A-Z0-9.]*' | sed 's/Build: //')" + ID="$(awk '/\(Beta\)/ {flag=1} /Build:/ && flag {print; flag=0}' DL_GSI_HTML | sed -n 's/.*Build: \([A-Z0-9.]*\).*/\1/p')" # Extract the incremental value (based on the ID) INCREMENTAL="$(grep -o "$ID-[0-9]*-" DL_GSI_HTML | sed "s/$ID-//g" | sed 's/-//g' | head -n1)" @@ -122,58 +121,47 @@ PlayIntegrityFix() { # Download the OTA Image Download page download_file "https://developer.android.com/about/versions/$RELEASE_VERSION/download-ota" DL_OTA_HTML - # Build lists of supported models and products from the OTA Image Download page - MODEL_LIST="$(grep -A1 'tr id=' DL_OTA_HTML | grep '