diff --git a/.github/workflows/build-module.yml b/.github/workflows/build-module.yml index ccce6f9..ec9e1e2 100644 --- a/.github/workflows/build-module.yml +++ b/.github/workflows/build-module.yml @@ -1,12 +1,11 @@ name: Build Custom Boot Animation Module -# This workflow allows users to: # 1. Fork this repo # 2. Choose a device template OR add custom bootanimation.zip files to the 'upload' folder # 3. Run this workflow manually # 4. Download the ready-to-flash module -run-name: "Build: ${{ inputs.source == 'template' && format('{0}/{1}', inputs.device, inputs.system) || 'upload' }} → ${{ inputs.target_location }}" +run-name: "Build: ${{ inputs.source == 'template' && format('{0}/{1}', inputs.device, inputs.theme) || 'upload' }} > ${{ inputs.target_location }}" on: workflow_dispatch: @@ -26,8 +25,8 @@ on: type: choice options: - 'liuqin' - system: - description: 'System type (only used when source is template)' + theme: + description: 'Theme (only used when source is template)' required: false default: 'HyperOS' type: choice @@ -38,13 +37,12 @@ on: target_location: description: 'Where to place bootanimation files in the module' required: true - default: 'system/product/media' + default: '/product/media' type: choice options: - - 'system/product/media' - - 'system/media' - - 'system/system_ext/media' - - 'system/product/media/theme/default' + - '/product/media' + - '/system/media' + - '/system_ext/media' jobs: build-module: @@ -122,17 +120,17 @@ jobs: echo "Source: $SOURCE" if [ "$SOURCE" = "template" ]; then - # Build template path from device and system inputs + # Build template path from device and theme inputs DEVICE="${{ github.event.inputs.device }}" - SYSTEM="${{ github.event.inputs.system }}" + THEME="${{ github.event.inputs.theme }}" # Use defaults if not specified DEVICE="${DEVICE:-liuqin}" - SYSTEM="${SYSTEM:-HyperOS}" + THEME="${THEME:-HyperOS}" - TEMPLATE_DIR="templates/$DEVICE/$SYSTEM" + TEMPLATE_DIR="templates/$DEVICE/$THEME" - echo "Using template: $DEVICE/$SYSTEM" + echo "Using template: $DEVICE/$THEME" if [ ! -d "$TEMPLATE_DIR" ]; then echo "Error: Template directory not found: $TEMPLATE_DIR" @@ -237,16 +235,21 @@ jobs: # Determine target location (use input or default) TARGET_LOCATION="${{ github.event.inputs.target_location }}" if [ -z "$TARGET_LOCATION" ]; then - TARGET_LOCATION="system/product/media" + TARGET_LOCATION="/product/media" fi + MODULE_TARGET="system$TARGET_LOCATION" + + echo "Target location: $TARGET_LOCATION" + echo "Module path: $MODULE_TARGET" + # Remove all existing media directories to avoid conflicts # Only keep the one we're targeting echo "Cleaning up existing media directories..." MEDIA_DIRS=( "build/module/system/product/media" - "build/module/system/media" + "build/module/system/system/media" "build/module/system/system_ext/media" "build/module/system/product/media/theme/default" ) @@ -254,7 +257,7 @@ jobs: for dir in "${MEDIA_DIRS[@]}"; do if [ -d "$dir" ]; then # Check if this is the target or a parent of the target - TARGET_DIR_FULL="build/module/$TARGET_LOCATION" + TARGET_DIR_FULL="build/module/$MODULE_TARGET" if [[ "$TARGET_DIR_FULL" != "$dir"* ]]; then echo " Removing: $dir" rm -rf "$dir" @@ -262,8 +265,8 @@ jobs: fi done - # Create target directory - TARGET_DIR="build/module/$TARGET_LOCATION" + # Create target directory with system/ prefix for Magisk + TARGET_DIR="build/module/$MODULE_TARGET" mkdir -p "$TARGET_DIR" # Clean any existing bootanimation files from the downloaded module @@ -320,9 +323,13 @@ jobs: MODULE_VERSION="${{ steps.module_info.outputs.module_version }}" # Create a unique zip name with target location indicator - TARGET_SHORT=$(echo "${{ env.target_location }}" | sed 's/system\///g' | tr '/' '-') + # Remove leading slash and convert remaining slashes to dashes + TARGET_SHORT=$(echo "${{ env.target_location }}" | sed 's|^/||' | tr '/' '-') ZIP_NAME="${MODULE_ID}-${MODULE_VERSION}-${TARGET_SHORT}.zip" + # Artifact name without .zip (GitHub adds it automatically on download) + ARTIFACT_NAME="${MODULE_ID}-${MODULE_VERSION}-${TARGET_SHORT}" + # Create ZIP with stored (no compression) mode for bootanimation compatibility echo "Creating ZIP with stored (no compression) mode..." zip -r -0 "../$ZIP_NAME" . -x "*.git*" @@ -331,6 +338,7 @@ jobs: ZIP_SIZE=$(du -h "../$ZIP_NAME" | cut -f1) echo "zip_name=$ZIP_NAME" >> $GITHUB_OUTPUT + echo "artifact_name=$ARTIFACT_NAME" >> $GITHUB_OUTPUT echo "zip_size=$ZIP_SIZE" >> $GITHUB_OUTPUT echo "" @@ -342,8 +350,8 @@ jobs: - name: Upload module artifact uses: actions/upload-artifact@v4 with: - name: ${{ steps.create_zip.outputs.zip_name }} - path: build/${{ steps.create_zip.outputs.zip_name }} + name: ${{ steps.create_zip.outputs.artifact_name }} + path: build/module retention-days: 90 compression-level: 0 @@ -357,8 +365,8 @@ jobs: # Build source description if [ "$SOURCE" = "template" ]; then DEVICE="${{ github.event.inputs.device }}" - SYSTEM="${{ github.event.inputs.system }}" - SOURCE_DESC="template: $DEVICE/$SYSTEM" + THEME="${{ github.event.inputs.theme }}" + SOURCE_DESC="template: $DEVICE/$THEME" else SOURCE_DESC="upload" fi @@ -397,16 +405,14 @@ jobs: 1. Scroll down to the **Artifacts** section below 2. Click on the module ZIP file to download - 3. The download will be a ZIP containing the module ## Installation - 1. Extract the downloaded artifact (if needed) - 2. Flash the module ZIP using: + 1. Flash the downloaded module ZIP using: - **Magisk Manager** → Modules → Install from storage - **KernelSU** → Module → Install - **APatch** → Module → Install - 3. Reboot your device + 2. Reboot your device ## Notes diff --git a/.github/workflows/close-upload-pr.yml b/.github/workflows/close-upload-pr.yml index cbd51e5..efe16c4 100644 --- a/.github/workflows/close-upload-pr.yml +++ b/.github/workflows/close-upload-pr.yml @@ -5,12 +5,15 @@ name: Auto Close Upload PRs on: pull_request_target: + types: [opened] paths: - 'upload/**' jobs: close-pr: runs-on: ubuntu-latest + # Only run for PRs from forks - check if head repo is different from base repo + if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} permissions: pull-requests: write @@ -21,8 +24,11 @@ jobs: script: | const prNumber = context.payload.pull_request.number; const prAuthor = context.payload.pull_request.user.login; + const headRepo = context.payload.pull_request.head.repo.full_name; + const baseRepo = context.payload.pull_request.base.repo.full_name; + + console.log(`Head repo: ${headRepo}, Base repo: ${baseRepo}`); - // Add comment explaining why await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, @@ -44,12 +50,10 @@ jobs: Thank you for your understanding!` }); - // Close the PR await github.rest.pulls.update({ owner: context.repo.owner, repo: context.repo.repo, pull_number: prNumber, state: 'closed' }); - - console.log(`Closed PR #${prNumber} - modifies upload folder`); + console.log(`Closed PR #${prNumber}`); diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index e2d0a07..47fe116 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -1,12 +1,10 @@ name: "NodeJs with Release" # This workflow is for maintainers/developers only -# It packages the module, creates a GitHub release, and updates update.json -# -# Before running: + # 1. Update module/module.prop with the new version -# 2. Edit RELEASE_NOTES.md with your changelog -# 3. Run this workflow +# 2. Edit CHANGELOG.md +# 3. Run run-name: "Release: v${{ inputs.version }} (${{ inputs.release_type }})" @@ -59,7 +57,7 @@ jobs: id: create_zip run: | VERSION="${{ github.event.inputs.version }}" - ZIP_NAME="mipad-custom-boot-$VERSION.zip" + ZIP_NAME="mi-boot-replacer-$VERSION.zip" cd module @@ -92,10 +90,10 @@ jobs: RELEASE_TYPE="${{ github.event.inputs.release_type }}" ZIP_NAME="${{ steps.create_zip.outputs.zip_name }}" - # Check if RELEASE_NOTES.md exists - if [ ! -f "RELEASE_NOTES.md" ]; then - echo "Error: RELEASE_NOTES.md not found!" - echo "Please create RELEASE_NOTES.md with your release notes before running this workflow." + # Check if CHANGELOG.md exists + if [ ! -f "CHANGELOG.md" ]; then + echo "Error: CHANGELOG.md not found!" + echo "Please create CHANGELOG.md with your release notes before running this workflow." exit 1 fi @@ -103,13 +101,13 @@ jobs: PREV_TAG=$(gh release list --repo ${{ github.repository }} --exclude-drafts --limit 1 --json tagName -q '.[0].tagName' 2>/dev/null || echo "") # Copy release notes and append changelog link - cp RELEASE_NOTES.md release_notes.md + cp CHANGELOG.md changelog.md if [ -n "$PREV_TAG" ]; then CHANGELOG_URL="https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${TAG}" - echo "" >> release_notes.md - echo "---" >> release_notes.md - echo "**Full Changelog**: ${CHANGELOG_URL}" >> release_notes.md + echo "" >> changelog.md + echo "---" >> changelog.md + echo "**Full Changelog**: ${CHANGELOG_URL}" >> changelog.md fi # Build release flags @@ -131,7 +129,7 @@ jobs: # Create the release with the ZIP attached gh release create "$TAG" "$ZIP_NAME" \ --title "$TITLE" \ - --notes-file release_notes.md \ + --notes-file changelog.md \ $FLAGS echo "Release created successfully!" @@ -156,8 +154,8 @@ jobs: fi VERSION_NO_V="${{ github.event.inputs.version }}" - ZIP_URL="https://github.com/${{ github.repository }}/releases/latest/download/mipad-custom-boot-${VERSION_NO_V}.zip" - CHANGELOG_URL="https://raw.githubusercontent.com/${{ github.repository }}/main/README.md" + ZIP_URL="https://github.com/${{ github.repository }}/releases/latest/download/mi-boot-replacer-${VERSION_NO_V}.zip" + CHANGELOG_URL="https://raw.githubusercontent.com/${{ github.repository }}/main/CHANGELOG.md" echo "Updating update.json..." echo " Version: $VERSION" diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b0ede21 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,18 @@ +## v1.1.2 + +### Module Rebranding + +- **Renamed to "Xiaomi Boot Animation Replacer" (mi-boot-replacer)** + - The module is no longer limited to tablet devices + - Now supports both phones and tablets + +--- + +## v1.1.1 + +### Bug Fixes + +- **Major Fix: Resolved module installation failure** + - Fixed critical issue that caused the module to fail during installation + - Improved installation script stability and error handling + - Enhanced compatibility with various Magisk/KernelSU/APatch versions diff --git a/README.md b/README.md index d4800eb..354c87a 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,15 @@ -# MiPad Custom Boot Animation +# Xiaomi Custom Boot Animation English | [简体中文](/README_zh-CN.md) ## Introduction -A simple module designed exclusively for tablet devices, replacing the boot animations with custom ones. Unlike phones, tablets often adapt their animations based on device orientation. +A simple module designed to replace the boot animations with custom ones. This module is also compatible with tablets since, in contrast to phones, tablets frequently modify their animations according to the orientation of the device. + +This module utilizes systemless mount to mount the bootanimation files to the specified location, ensuring no modifications are made to the system partition. ## Requirements - Magisk v26.1+ / KernelSU v0.8.0+ / APatch 10568+ -- Android 11+ (API 30+) +- Android 11+ (API 30+) running MIUI/HyperOS + > [!WARNING] > This module is designed for Magisk. KernelSU and APatch are not fully supported and unexpected bugs may occur. @@ -23,18 +26,170 @@ A simple module designed exclusively for tablet devices, replacing the boot anim | Code | Device Name | |------|-------------| +| myron | Redmi K90 Pro Max / POCO F8 Ultra | +| annibale | Redmi K90 / POCO F8 Pro | +| popsicle | Xiaomi 17 Pro Max | +| pandora | Xiaomi 17 Pro | +| pudding | Xiaomi 17 | +| piano | Xiaomi Pad 8 Pro | +| yupei | Xiaomi Pad 8 | +| klimt | Xiaomi 15T Pro | +| goya | Xiaomi 15T | +| organ | Redmi Pad 2 Pro 5G | +| flute | Redmi Pad 2 Pro / POCO Pad M1 | +| dew | Redmi 15C / POCO C85 | +| tornado | Redmi 15C 5G / Redmi 15R 5G | +| kunzite | Redmi Note 15 5G | +| lapis | Redmi Note 15 Pro | +| flourite | Redmi Note 15 Pro+ | +| creek | Redmi 15 4G | +| spring | Redmi Note 15R / Redmi 15 5G / POCO M7 Plus 5G | +| dali | Redmi K80 Ultra | +| bixi | Xiaomi MIX Flip 2 | +| turner | Redmi K Pad / Xiaomi Pad Mini | +| violin | Xiaomi Pad 7S Pro 12.5 | +| taiko | Redmi Pad 2 | +| koto | Redmi Pad 2 4G | +| dijun | Xiaomi 15S Pro | +| jinghu | Xiaomi Pad 7 Ultra | +| luming | Xiaomi Civi 5 Pro | +| onyx | Redmi Turbo 4 Pro / POCO F7 | +| serenity | POCO C71 / Redmi A5 | +| emerald | Redmi Note 14S | +| xuanyuan | Xiaomi 15 Ultra | +| obsidian | Redmi Note 14 Pro 4G | +| tanzanite | Redmi Note 14 4G | +| rodin | Redmi Turbo 4 / POCO X7 Pro | +| miro | Redmi K80 Pro / POCO F7 Ultra | +| zorn | Redmi K80 / POCO F7 Pro | +| warm | POCO C75 5G / Redmi A4 5G | +| haotian | Xiaomi 15 Pro | +| dada | Xiaomi 15 | +| muyu | Xiaomi Pad 7 Pro | +| uke | Xiaomi Pad 7 / POCO Pad X1 | +| degas | Xiaomi 14T | +| amethyst | Redmi Note 14 Pro+ | +| malachite | Redmi Note 14 Pro / POCO X7 | +| beryl | Redmi Note 14 5G / POCO M7 Pro 5G | +| flame | Redmi 14R 5G / POCO M7 5G | +| lake | Redmi 14C / Redmi A3 Pro / POCO C75 | +| flare | Redmi Pad SE 8.7 WiFi | +| spark | Redmi Pad SE 8.7 4G | +| breeze | Redmi 13 5G / Redmi Note 13R / POCO M6 Plus 5G | +| ruyi | Xiaomi MIX Flip | +| goku | Xiaomi MIX Fold 4 | +| rothko | Redmi K70 Ultra / Xiaomi 14T Pro | +| klein | Redmi A3x | +| peridot | Redmi Turbo 3 / POCO F6 | +| ruan | Redmi Pad Pro 5G / POCO Pad 5G | +| dizi | Redmi Pad Pro | +| chenfeng | Xiaomi Civi 4 Pro / Xiaomi 14 Civi | +| blue | Redmi A3 / POCO C61 | +| aurora | Xiaomi 14 Ultra | +| shennong_t | Xiaomi 14 Pro Titanium | +| sheng | Xiaomi Pad 6S Pro 12.4 | +| sapphiren | Redmi Note 13 4G NFC | +| sapphire | Redmi Note 13 4G | +| moon | Redmi 13 / POCO M6 | +| air | Redmi 13R 5G / Redmi 13C 5G | +| duchamp | Redmi K70E / POCO X6 Pro 5G | +| manet | Redmi K70 Pro | +| vermeer | Redmi K70 / POCO F6 Pro | +| gale | Redmi 13C / POCO C65 | +| shennong | Xiaomi 14 Pro | +| houji | Xiaomi 14 | +| aristotle | Xiaomi 13T | +| garnet | Redmi Note 13 Pro 5G / POCO X6 | +| gold | Redmi Note 13 5G / Redmi 13R Pro | +| zircon | Redmi Note 13 Pro+ 5G | +| xun | Redmi Pad SE | +| babylon | Xiaomi MIX Fold 3 | +| corot | Redmi K60 Ultra / Xiaomi 13T Pro | +| yudi | Xiaomi Pad 6 Max | +| sky | Redmi Note 12R / POCO M6 Pro 5G / Redmi 12 5G | +| fire | Redmi 12 | +| pearl | Redmi Note 12T Pro | +| yuechu | Xiaomi Civi 3 | +| sea | Redmi Note 12S | +| ishtar | Xiaomi 13 Ultra | | liuqin | Xiaomi Pad 6 Pro | | pipa | Xiaomi Pad 6 | -| yudi | Xiaomi Pad 6 Max | -| nabu | Xiaomi Pad 5 | -| elish | Xiaomi Pad 5 Pro | -| enuma | Xiaomi Pad 5 Pro 5G | +| sweet_k6a | Redmi Note 12 Pro 4G | +| topaz | Redmi Note 12 4G NFC | +| tapas | Redmi Note 12 4G | +| marble | Redmi Note 12 Turbo / POCO F5 5G | +| water | POCO C51 / Redmi A2 / A2+ | +| earth | Redmi 12C / POCO C55 | +| redwood | Redmi Note 12 Pro Speed / POCO X5 Pro 5G | +| rembrandt | Redmi K60E | +| socrates | Redmi K60 Pro | +| mondrian | Redmi K60 / POCO F5 Pro | +| nuwa | Xiaomi 13 Pro | +| fuxi | Xiaomi 13 | +| moonstone | POCO X5 5G | +| sunstone | Redmi Note 12 5G / Redmi Note 12R Pro | +| ruby | Redmi Note 12 Pro+ | +| plato | Xiaomi 12T | +| yunluo | Redmi Pad | +| ziyi | Xiaomi Civi 2 / Xiaomi 13 Lite | +| ice | POCO C50 / Redmi A1 | +| rosemary_p | POCO M5S | +| rock | POCO M5 / Redmi 11 Prime 4G | | dagu | Xiaomi Pad 5 Pro 12.4 | +| diting | Redmi K50 Ultra / Xiaomi 12T Pro | +| zizhan | Xiaomi MIX Fold 2 | +| mayfly | Xiaomi 12S | +| thor | Xiaomi 12S Ultra | +| unicorn | Xiaomi 12S Pro | +| daumier | Xiaomi 12 Pro Dimensity | +| taoyao | Xiaomi 12 Lite | +| frost | POCO C40 | +| xaga | Redmi Note 11T Pro / Pro+ / POCO X4 GT / Pro / Redmi K50i / Pro | +| zijin | Xiaomi Civi 1S | +| lilac | Redmi Note 10T | +| dandelion | Redmi 10A | +| fog | Redmi 10C | +| rubens | Redmi K50 | +| matisse | Redmi K50 Pro | +| munch | Redmi K40S / POCO F4 | +| viva | Redmi Note 11 Pro | +| lightcm | Redmi Note 11R | +| light | Redmi Note 11E / POCO M4 5G / Redmi 10 Prime+ 5G | +| ingres | Redmi K50 Gaming / POCO F4 GT | +| spesn | Redmi Note 11 NFC | +| spes | Redmi Note 11 | +| veux | Redmi Note 11E Pro / Redmi Note 11 Pro 5G | +| opal | Redmi Note 11S 5G | +| fleur | Redmi Note 11S / POCO M4 Pro 4G | +| zeus | Xiaomi 12 Pro | +| psyche | Xiaomi 12X | +| cupid | Xiaomi 12 | +| evergreen | POCO M4 Pro 5G | +| pissarro | Redmi Note 11 Pro / Pro+ | +| evergo | Redmi Note 11 5G | +| selenes | Redmi Note 11 4G | +| mona | Xiaomi Civi | +| lisa | Xiaomi 11 Lite 5G NE | +| agate | Xiaomi 11T | +| vili | Xiaomi 11T Pro | +| selene | Redmi 10 | +| odin | Xiaomi MIX 4 | +| elish | Xiaomi Pad 5 Pro (WiFi) | +| enuma | Xiaomi Pad 5 Pro (5G) | +| nabu | Xiaomi Pad 5 | +| chopin | Redmi Note 10 Pro (China) / POCO X3 GT | +| camellia | Redmi Note 10 (China) / POCO M3 Pro / Redmi Note 11 SE | +| biloba | Redmi Note 8 (2021) | +| ares | Redmi K40 Gaming / POCO F3 GT | +| cetus | Xiaomi MIX Fold | +| renoir | Xiaomi 11 Lite | +| star | Xiaomi 11 Pro / Ultra | +| courbet | Xiaomi 11 Lite 4G | > [!NOTE] -> This module should work on other tablet models, brands, and systems, but further testing is needed. Feel free to report your results! +> This module should work on other models, brands, and systems, but further testing is needed. Feel free to report your results! ## Installation @@ -63,10 +218,13 @@ You can use GitHub Actions to build a custom boot animation module without any l 3. Click **"Run workflow"** 4. Set **Source** to `template` 5. Select your **Device model** (e.g., `liuqin`) -6. Select the **System type** (e.g., `HyperOS`) +6. Select the **Template** (e.g., `HyperOS`) 7. Select the **Target location** 8. Download the built module from **Artifacts** +> [!NOTE] +> If there is no available template for your device, you must use Method 2 and upload your own bootanimation files. + ### Method 2: Upload Custom Files 1. **Fork** this repository @@ -78,6 +236,9 @@ You can use GitHub Actions to build a custom boot animation module without any l 7. Select the **Target location** 8. Download the built module from **Artifacts** +> [!TIP] +> If your device is a phone, you only need one `bootanimation.zip` file. Multiple animation files are only needed for tablets that change animations based on device orientation. + > [!WARNING] > The `upload/` folder is for personal use in your fork only. Do not submit pull requests with changes to this folder - they will be automatically closed. @@ -85,10 +246,9 @@ You can use GitHub Actions to build a custom boot animation module without any l | Location | Description | |----------|-------------| -| `system/product/media` | Default location (most devices) | -| `system/media` | Legacy location | -| `system/system_ext/media` | System extension media | -| `system/product/media/theme/default` | Theme default location | +| `/product/media` | Default location (most devices) | +| `/system/media` | Legacy location | +| `/system_ext/media` | System extension media | ### File Naming Convention @@ -117,19 +277,18 @@ bootanimation.zip #### desc.txt Format ``` - + ... ``` Example: ``` -1080 1920 60 -c 1 0 part0 -c 0 0 part1 +1880 2880 60 +p 0 5 part0 ``` -- `c` = Play complete (or `p` = play and repeat) +- `c` = play complete, `p` = play and repeat - First number = loop count (0 = infinite) - Second number = pause after loop (in frames) - Path = folder containing the frames @@ -138,7 +297,7 @@ c 0 0 part1 > Bootanimation ZIP files **must** use STORE compression (no compression). The workflow handles this automatically. ## Disclaimer -**Flashing this module may cause your device to bootloop, a bootloop saver module is highly recommended. I am not responsible for any damages caused to your device or data by using this module. Use at your own risk.** +**A bootloop saver module is strongly advised even if there is little possibility that flashing this module would cause your device to bootloop. I am not responsible for any damages caused to your device or data by using this module. Use at your own risk.** ## License This program is free software: you can redistribute it and/or modify diff --git a/README_zh-CN.md b/README_zh-CN.md index 823f697..f2340a9 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -1,8 +1,17 @@ -# 小米平板自定义开机动画 +# 小米自定义开机动画 [English](/README.md) | 简体中文 ## 介绍 -专为平板设备打造的修改开机动画模块。平板与其他设备略有不同,其动画会根据设备的方向而更改。 +一个简单的模块,用于将开机动画替换为自定义动画。此模块也兼容平板设备,因为与手机不同,平板设备通常会根据设备方向调整其动画。 + +此模块使用 systemless 挂载方式将开机动画文件挂载到指定位置,确保不会对系统分区进行任何修改。 + +## 要求 +- Magisk v26.1+ / KernelSU v0.8.0+ / APatch 10568+ +- Android 11+ (API 30+) 运行 MIUI/HyperOS + +> [!WARNING] +> 此模块专为 Magisk 设计。KernelSU 和 APatch 未获得完全支持,可能会出现意外错误。 ## 已测试设备 @@ -17,24 +26,170 @@ | 代码 | 设备名称 | |------|----------| -| liuqin | 小米平板 6 Pro | -| pipa | 小米平板 6 | -| yudi | 小米平板 6 Max | -| nabu | 小米平板 5 | -| elish | 小米平板 5 Pro | -| enuma | 小米平板 5 Pro 5G | -| dagu | 小米平板 5 Pro 12.4 | +| myron | 红米K90 Pro Max / POCO F8 Ultra | +| annibale | 红米K90 / POCO F8 Pro | +| popsicle | 小米17 Pro Max | +| pandora | 小米17 Pro | +| pudding | 小米17 | +| piano | 小米平板8 Pro | +| yupei | 小米平板8 | +| klimt | 小米15T Pro | +| goya | 小米15T | +| organ | 红米平板2 Pro 5G | +| flute | 红米平板2 Pro / POCO Pad M1 | +| dew | 红米15C / POCO C85 | +| tornado | 红米15C 5G / 红米15R 5G | +| kunzite | 红米Note15 5G | +| lapis | 红米Note15 Pro | +| flourite | 红米Note15 Pro+ | +| creek | 红米15 4G | +| spring | 红米Note15R / 红米15 5G / POCO M7 Plus 5G | +| dali | 红米K80 至尊版 | +| bixi | 小米MIX Flip 2 | +| turner | 红米K平板 / 小米平板Mini | +| violin | 小米平板7S Pro 12.5 | +| taiko | 红米平板2 | +| koto | 红米平板2 4G | +| dijun | 小米15S Pro | +| jinghu | 小米平板7 Ultra | +| luming | 小米Civi5 Pro | +| onyx | 红米Turbo 4 Pro / POCO F7 | +| serenity | POCO C71 / 红米A5 | +| emerald | 红米Note 14S | +| xuanyuan | 小米15 Ultra | +| obsidian | 红米Note 14 Pro 4G | +| tanzanite | 红米Note 14 4G | +| rodin | 红米Turbo 4 / POCO X7 Pro | +| miro | 红米K80 Pro / POCO F7 Ultra | +| zorn | 红米K80 / POCO F7 Pro | +| warm | POCO C75 5G / 红米A4 5G | +| haotian | 小米15 Pro | +| dada | 小米15 | +| muyu | 小米平板7 Pro | +| uke | 小米平板7 / POCO Pad X1 | +| degas | 小米14T | +| amethyst | 红米Note14 Pro+ | +| malachite | 红米Note14 Pro / POCO X7 | +| beryl | 红米Note14 5G / POCO M7 Pro 5G | +| flame | 红米14R 5G / POCO M7 5G | +| lake | 红米14C / 红米A3 Pro / POCO C75 | +| flare | 红米平板SE 8.7 WiFi | +| spark | 红米平板SE 8.7 4G | +| breeze | 红米13 5G / 红米Note 13R / POCO M6 Plus 5G | +| ruyi | 小米MIX Flip | +| goku | 小米MIX Fold 4 | +| rothko | 红米K70 至尊版 / 小米14T Pro | +| klein | 红米A3x | +| peridot | 红米Turbo 3 / POCO F6 | +| ruan | 红米平板 Pro 5G / POCO Pad 5G | +| dizi | 红米平板 Pro | +| chenfeng | 小米CIVI 4 Pro / 小米14 Civi | +| blue | 红米A3 / POCO C61 | +| aurora | 小米14 Ultra | +| shennong_t | 小米14 Pro 钛金属版 | +| sheng | 小米平板6S Pro 12.4 | +| sapphiren | 红米Note13 4G NFC | +| sapphire | 红米Note13 4G | +| moon | 红米13 / POCO M6 | +| air | 红米13R 5G / 红米13C 5G | +| duchamp | 红米K70E / POCO X6 Pro 5G | +| manet | 红米K70 Pro | +| vermeer | 红米K70 / POCO F6 Pro | +| gale | 红米13C / POCO C65 | +| shennong | 小米14 Pro | +| houji | 小米14 | +| aristotle | 小米13T | +| garnet | 红米Note13 Pro 5G / POCO X6 | +| gold | 红米Note13 5G / 13R Pro | +| zircon | 红米Note13 Pro+ 5G | +| xun | 红米平板SE | +| babylon | 小米MIX Fold 3 | +| corot | 红米K60 至尊版 / 小米13T Pro | +| yudi | 小米平板6 Max | +| sky | 红米Note12R / POCO M6 Pro 5G / 红米12 5G | +| fire | 红米12 | +| pearl | 红米Note12T Pro | +| yuechu | 小米CIVI3 | +| sea | 红米Note12S | +| ishtar | 小米13 Ultra | +| liuqin | 小米平板6 Pro | +| pipa | 小米平板6 | +| sweet_k6a | 红米Note12 Pro 4G | +| topaz | 红米Note12 4G NFC | +| tapas | 红米Note12 4G | +| marble | 红米Note12 Turbo / POCO F5 5G | +| water | POCO C51 / 红米A2 / A2+ | +| earth | 红米12C / POCO C55 | +| redwood | 红米Note12 Pro 极速版 / POCO X5 Pro 5G | +| rembrandt | 红米K60E | +| socrates | 红米K60 Pro | +| mondrian | 红米K60 / POCO F5 Pro | +| nuwa | 小米13 Pro | +| fuxi | 小米13 | +| moonstone | POCO X5 5G | +| sunstone | 红米Note12 5G / 红米Note12R Pro | +| ruby | 红米Note12 Pro+ | +| plato | 小米12T | +| yunluo | 红米平板 | +| ziyi | 小米CIVI 2 / 小米13 Lite | +| ice | POCO C50 / 红米A1 | +| rosemary_p | POCO M5S | +| rock | POCO M5 / 红米11 Prime 4G | +| dagu | 小米平板5 Pro 12.4 | +| diting | 红米K50 至尊版 / 小米12T Pro | +| zizhan | 小米MIX Fold 2 | +| mayfly | 小米12S | +| thor | 小米12S Ultra | +| unicorn | 小米12S Pro | +| daumier | 小米12 Pro 天玑版 | +| taoyao | 小米12 Lite | +| frost | POCO C40 | +| xaga | 红米Note11T Pro / Pro+ / POCO X4 GT / Pro / 红米K50i / Pro | +| zijin | 小米CIVI 1S | +| lilac | 红米Note 10T | +| dandelion | 红米10A | +| fog | 红米10C | +| rubens | 红米K50 | +| matisse | 红米K50 Pro | +| munch | 红米K40S / POCO F4 | +| viva | 红米Note11 Pro | +| lightcm | 红米Note11R | +| light | 红米Note11E / POCO M4 5G / 红米10 Prime+ 5G | +| ingres | 红米K50 电竞版 / POCO F4 GT | +| spesn | 红米Note11 NFC | +| spes | 红米Note11 | +| veux | 红米Note11E Pro / 红米Note11 Pro 5G | +| opal | 红米Note 11S 5G | +| fleur | 红米Note 11S / POCO M4 Pro 4G | +| zeus | 小米12 Pro | +| psyche | 小米12X | +| cupid | 小米12 | +| evergreen | POCO M4 Pro 5G | +| pissarro | 红米Note11 Pro / Pro+ | +| evergo | 红米Note11 5G | +| selenes | 红米Note11 4G | +| mona | 小米CIVI | +| lisa | 小米11青春活力版 | +| agate | 小米11T | +| vili | 小米11T Pro | +| selene | 红米10 | +| odin | 小米MIX4 | +| elish | 小米平板5 Pro (WiFi) | +| enuma | 小米平板5 Pro (5G) | +| nabu | 小米平板5 | +| chopin | 红米Note 10 Pro (China) / POCO X3 GT | +| camellia | 红米Note 10 (China) / POCO M3 Pro / 红米Note 11 SE | +| biloba | 红米Note 8 (21年款) | +| ares | 红米K40 游戏增强版 / POCO F3 GT | +| cetus | 小米MIX Fold | +| renoir | 小米11 青春版 | +| star | 小米11 Pro / Ultra | +| courbet | 小米11 Lite 4G | > [!NOTE] -> 此模块应该可以在其他平板型号、品牌和系统上运行,但仍需进一步测试。欢迎反馈您的测试结果! - -## 要求 -- Magisk v26.1+ / KernelSU v0.8.0+ / APatch 10568+ -- Android 11+ (API 30+) -> [!WARNING] -> 此模块专为 Magisk 设计。不会为 KernelSU 和 APatch 提供支持,有可能会出现错误。 +> 此模块应该可以在其他型号、品牌和系统上运行,但仍需进一步测试。欢迎反馈您的测试结果! ## 安装 @@ -63,10 +218,13 @@ 3. 点击 **"Run workflow"** 4. 将 **Source** 设置为 `template` 5. 选择您的**设备型号**(例如 `liuqin`) -6. 选择**系统类型**(例如 `HyperOS`) +6. 选择**模板**(例如 `HyperOS`) 7. 选择**目标位置** 8. 从 **Artifacts** 下载构建好的模块 +> [!NOTE] +> 如果没有适用于您设备的模板,您必须使用方法二并上传您自己的开机动画文件。 + ### 方法二:上传自定义文件 1. **Fork** 此仓库 @@ -78,6 +236,9 @@ 7. 选择**目标位置** 8. 从 **Artifacts** 下载构建好的模块 +> [!TIP] +> 如果您的设备是手机,您只需要一个 `bootanimation.zip` 文件。多个动画文件仅适用于会根据设备方向更改动画的平板设备。 + > [!WARNING] > `upload/` 文件夹仅供在您自己的 Fork 中个人使用。请勿提交包含此文件夹更改的 Pull Request,否则将被自动关闭。 @@ -85,10 +246,9 @@ | 位置 | 描述 | |------|------| -| `system/product/media` | 默认位置(大多数设备) | -| `system/media` | 传统位置 | -| `system/system_ext/media` | 系统扩展媒体 | -| `system/product/media/theme/default` | 主题默认位置 | +| `/product/media` | 默认位置(大多数设备) | +| `/system/media` | 传统位置 | +| `/system_ext/media` | 系统扩展媒体 | ### 文件命名规范 @@ -117,19 +277,18 @@ bootanimation.zip #### desc.txt 格式 ``` -<宽度> <高度> <帧率> +<高度> <宽度> <帧率> <类型> <循环次数> <暂停帧数> <路径> ... ``` 示例: ``` -1080 1920 60 -c 1 0 part0 -c 0 0 part1 +1880 2880 60 +p 0 5 part0 ``` -- `c` = 完整播放(或 `p` = 播放并重复) +- `c` = 完整播放, `p` = 播放并重复 - 第一个数字 = 循环次数(0 = 无限) - 第二个数字 = 循环后暂停(以帧为单位) - 路径 = 包含帧的文件夹 @@ -138,7 +297,7 @@ c 0 0 part1 > 开机动画 ZIP 文件**必须**使用 STORE 压缩(无压缩)。工作流程会自动处理此问题。 ## 免责声明 -**刷写此模块可能会导致您的设备进入引导循环,强烈建议使用引导循环保护模块。对于使用此模块对您的设备或数据造成的任何损害,我概不负责。使用风险自负。** +**尽管刷写此模块导致设备进入引导循环的可能性很小,但仍强烈建议使用引导循环保护模块。对于使用此模块对您的设备或数据造成的任何损害,我概不负责。使用风险自负。** ## 许可证 This program is free software: you can redistribute it and/or modify diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md deleted file mode 100644 index 742d641..0000000 --- a/RELEASE_NOTES.md +++ /dev/null @@ -1,20 +0,0 @@ -### New Features - -- **Dynamic boot animation path detection**: The module now automatically detects the bootanimation path from the module structure during installation -- **Interactive location selector**: Added user prompt to select or confirm the boot animation backup location during installation - - Auto-detects from multiple common paths - - Users can cycle through options using volume keys - - Shows warning when changing from pre-configured path - -### Improvements - -- **Smarter path detection**: Installation script checks the module's own structure first, falling back to device detection if not found -- **Better user feedback**: Clearer prompts showing whether the path was detected from the module or from the device - -### Supported Paths - -The module now supports these boot animation locations: -- `/product/media` (default, most common) -- `/system/media` (legacy) -- `/system_ext/media` -- `/product/media/theme/default` diff --git a/module/customize.sh b/module/customize.sh index ba5a5df..819caf6 100644 --- a/module/customize.sh +++ b/module/customize.sh @@ -66,10 +66,8 @@ detect_boot_dir() { module_boot_dir="/product/media" elif [ -f "$MODPATH/system/media/bootanimation.zip" ]; then module_boot_dir="/system/media" - elif [ -f "$MODPATH/system/system_ext/media/bootanimation.zip" ]; then + elif [ -f "$MODPATH/system_ext/media/bootanimation.zip" ]; then module_boot_dir="/system_ext/media" - elif [ -f "$MODPATH/system/product/media/theme/default/bootanimation.zip" ]; then - module_boot_dir="/product/media/theme/default" fi if [ -n "$module_boot_dir" ]; then @@ -83,12 +81,8 @@ detect_boot_dir() { BOOT_DIR="/product/media" elif [ -f "/system/media/bootanimation.zip" ]; then BOOT_DIR="/system/media" - elif [ -f "/system/product/media/bootanimation.zip" ]; then - BOOT_DIR="/system/product/media" elif [ -f "/system_ext/media/bootanimation.zip" ]; then BOOT_DIR="/system_ext/media" - elif [ -f "/product/media/theme/default/bootanimation.zip" ]; then - BOOT_DIR="/product/media/theme/default" else BOOT_DIR="/product/media" fi @@ -103,33 +97,37 @@ select_boot_dir() { ui_print " Volume [-]: Confirm selection" ui_print "*********************************************" - # Available locations - local locations=("/product/media" "/system/media" "/system_ext/media" "/product/media/theme/default") - local descriptions=("Product Media (Default)" "System Media (Legacy)" "System Ext Media" "Theme Default") + # Available locations (3 options) local current_index=0 - local total=${#locations[@]} + local total=3 # Find if detected location matches any option - for i in "${!locations[@]}"; do - if [ "${locations[$i]}" = "$BOOT_DIR" ]; then - current_index=$i - break - fi - done + case "$BOOT_DIR" in + "/product/media") current_index=0 ;; + "/system/media") current_index=1 ;; + "/system_ext/media") current_index=2 ;; + esac while true; do ui_print "" - ui_print " >> ${descriptions[$current_index]}" - ui_print " Path: ${locations[$current_index]}" + case $current_index in + 0) ui_print " >> Product Media (Default)"; ui_print " Path: /product/media" ;; + 1) ui_print " >> System Media (Legacy)"; ui_print " Path: /system/media" ;; + 2) ui_print " >> System Ext Media"; ui_print " Path: /system_ext/media" ;; + esac key_check - if [[ "$keycheck" == "KEY_VOLUMEUP" ]]; then + if [ "$keycheck" = "KEY_VOLUMEUP" ]; then # Next option current_index=$(( (current_index + 1) % total )) else # Confirm selection - BOOT_DIR="${locations[$current_index]}" + case $current_index in + 0) BOOT_DIR="/product/media" ;; + 1) BOOT_DIR="/system/media" ;; + 2) BOOT_DIR="/system_ext/media" ;; + esac ui_print "" ui_print "- Selected: $BOOT_DIR" break diff --git a/module/module.prop b/module/module.prop index 1c240ac..5ce7299 100644 --- a/module/module.prop +++ b/module/module.prop @@ -1,7 +1,7 @@ -id=mipad-custom-boot -name=mipad-custom-boot -version=v1.1.10 -versionCode=110 +id=mi-boot-replacer +name=Xiaomi Boot Animation Replacer +version=v1.1.2 +versionCode=112 author=Veutexus -description=A module that can custom boot animation for tablet devices. (GitHub: https://github.com/G0246/mipad-custom-boot) -updateJson=https://raw.githubusercontent.com/G0246/mipad-custom-boot/main/update.json +description=A module that can custom boot animation for Xiaomi devices. (GitHub: https://github.com/G0246) +updateJson=https://raw.githubusercontent.com/G0246/mi-boot-replacer/main/update.json diff --git a/templates/liuqin/MIUI/bootanimation.zip b/templates/liuqin/MIUI/bootanimation.zip index fd33be8..e0f7691 100644 Binary files a/templates/liuqin/MIUI/bootanimation.zip and b/templates/liuqin/MIUI/bootanimation.zip differ diff --git a/templates/liuqin/MIUI/bootanimation01.zip b/templates/liuqin/MIUI/bootanimation01.zip index 094b4ab..3669947 100644 Binary files a/templates/liuqin/MIUI/bootanimation01.zip and b/templates/liuqin/MIUI/bootanimation01.zip differ diff --git a/templates/liuqin/MIUI/bootanimation02.zip b/templates/liuqin/MIUI/bootanimation02.zip index e057866..6bf70eb 100644 Binary files a/templates/liuqin/MIUI/bootanimation02.zip and b/templates/liuqin/MIUI/bootanimation02.zip differ diff --git a/templates/liuqin/MIUI/bootanimation03.zip b/templates/liuqin/MIUI/bootanimation03.zip index 262c71d..c50a9d3 100644 Binary files a/templates/liuqin/MIUI/bootanimation03.zip and b/templates/liuqin/MIUI/bootanimation03.zip differ diff --git a/templates/liuqin/MIUI/bootanimation04.zip b/templates/liuqin/MIUI/bootanimation04.zip index b42ce65..276dd54 100644 Binary files a/templates/liuqin/MIUI/bootanimation04.zip and b/templates/liuqin/MIUI/bootanimation04.zip differ diff --git a/templates/liuqin/MIUI_inverted/bootanimation.zip b/templates/liuqin/MIUI_inverted/bootanimation.zip index 41c4cfb..75e14f4 100644 Binary files a/templates/liuqin/MIUI_inverted/bootanimation.zip and b/templates/liuqin/MIUI_inverted/bootanimation.zip differ diff --git a/templates/liuqin/MIUI_inverted/bootanimation01.zip b/templates/liuqin/MIUI_inverted/bootanimation01.zip index addd2e5..b264e01 100644 Binary files a/templates/liuqin/MIUI_inverted/bootanimation01.zip and b/templates/liuqin/MIUI_inverted/bootanimation01.zip differ diff --git a/templates/liuqin/MIUI_inverted/bootanimation02.zip b/templates/liuqin/MIUI_inverted/bootanimation02.zip index 59d2d4c..b450297 100644 Binary files a/templates/liuqin/MIUI_inverted/bootanimation02.zip and b/templates/liuqin/MIUI_inverted/bootanimation02.zip differ diff --git a/templates/liuqin/MIUI_inverted/bootanimation03.zip b/templates/liuqin/MIUI_inverted/bootanimation03.zip index 1aa7562..515ec0e 100644 Binary files a/templates/liuqin/MIUI_inverted/bootanimation03.zip and b/templates/liuqin/MIUI_inverted/bootanimation03.zip differ diff --git a/templates/liuqin/MIUI_inverted/bootanimation04.zip b/templates/liuqin/MIUI_inverted/bootanimation04.zip index 9e9d9c7..54b9e64 100644 Binary files a/templates/liuqin/MIUI_inverted/bootanimation04.zip and b/templates/liuqin/MIUI_inverted/bootanimation04.zip differ diff --git a/update.json b/update.json index 0acd12b..ee52525 100644 --- a/update.json +++ b/update.json @@ -1,6 +1,6 @@ { - "version": "v1.1.0", - "versionCode": 110, - "zipUrl": "https://github.com/G0246/mipad-custom-boot/releases/latest/download/mipad-custom-boot-1.1.0.zip", - "changelog": "https://raw.githubusercontent.com/G0246/mipad-custom-boot/main/README.md" + "version": "v1.1.2", + "versionCode": 112, + "zipUrl": "https://github.com/G0246/mi-boot-replacer/releases/latest/download/mi-boot-replacer-1.1.2.zip", + "changelog": "https://raw.githubusercontent.com/G0246/mi-boot-replacer/main/README.md" } diff --git a/upload/.gitkeep b/upload/.gitkeep index 6e88d03..e69de29 100644 --- a/upload/.gitkeep +++ b/upload/.gitkeep @@ -1,27 +0,0 @@ -# Upload Folder - -Place your custom `bootanimation.zip` files here to build a module with your own animations. - -## WARNING - -**DO NOT submit pull requests with changes to this folder!** - -The `upload/` folder is for **personal use in your own fork only**. Any PR that modifies this folder will be automatically closed. - -## How to Use - -1. **Fork** this repository to your own account -2. Add your bootanimation files to this folder in your fork -3. Commit and push your changes to your fork -4. Go to **Actions** → **Build Custom Boot Animation Module** in your fork -5. Select `upload` as the source -6. Choose the target location -7. Run the workflow -8. Download the built module from Artifacts - -## File Naming - -- `bootanimation.zip` - Main boot animation -- `bootanimation01.zip` - Alternative 1 (e.g., different rotation) -- `bootanimation02.zip` - Alternative 2 -- ... and so on