Skip to content

Commit bfad087

Browse files
authored
Merge pull request #5 from zjw2017/main
feat: 瘦身模块
2 parents a432b79 + 07d338a commit bfad087

9 files changed

Lines changed: 27 additions & 52 deletions

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/batch-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
bash ./build.sh --rom "${{ matrix.rom }}" \
5757
--url "$url"
5858
- name: 📦 上传构建产物
59-
uses: actions/upload-artifact@v4
59+
uses: actions/upload-artifact@v4.6.2
6060
with:
6161
name: "${{ matrix.device }}-${{ matrix.rom }}"
6262
path: tmp/release/
@@ -66,7 +66,7 @@ jobs:
6666
needs: build
6767
steps:
6868
- name: ⬇️ 下载所有构建产物
69-
uses: actions/download-artifact@v4.3.0
69+
uses: actions/download-artifact@v5.0.0
7070
with:
7171
path: combined-artifacts
7272

@@ -94,7 +94,7 @@ jobs:
9494
done
9595
9696
- name: 📦 上传总构建产物
97-
uses: actions/upload-artifact@v4
97+
uses: actions/upload-artifact@v4.6.2
9898
with:
9999
name: batch-build-artifacts-${{ github.run_id }}-${{ steps.datetime.outputs.datetime }}
100100
path: combined-artifacts/

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: 🧾 克隆仓库
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4.2.2
2020

2121
- name: 🛠 安装依赖
2222
run: |
@@ -29,7 +29,7 @@ jobs:
2929
--url "${{ github.event.inputs.url }}"
3030
3131
- name: 📦 上传构建产物
32-
uses: actions/upload-artifact@v4
32+
uses: actions/upload-artifact@v4.6.2
3333
with:
3434
name: "${{ github.event.inputs.rom }}"
3535
path: tmp/release/

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@
8989

9090
点击右上角 **Run workflow**,填写以下参数启动构建:
9191

92-
| 参数名 | 示例 | 说明 |
93-
| --------- | -------------------------------------------- | ----------------- |
94-
| `rom` | `OS2.0.202.0.VOZCNXM` | ROM 版本号 |
95-
| `url` | `https://bigota.d.miui.com/xxx/miui_xxx.zip` | 官方 ROM 下载链接 |
92+
| 参数名 | 示例 | 说明 |
93+
| ------ | -------------------------------------------- | ----------------- |
94+
| `rom` | `OS2.0.202.0.VOZCNXM` | ROM 版本号 |
95+
| `url` | `https://bigota.d.miui.com/xxx/miui_xxx.zip` | 官方 ROM 下载链接 |
9696

9797
📥 ROM 下载推荐:[https://hyperos.fans/](https://hyperos.fans/)
9898

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ done
4343
# 检查必须参数
4444
if [[ -z "$input_rom_version" || -z "$input_rom_url" ]]; then
4545
echo "❌ 错误:必须提供 --rom 和 --url 参数。" >&2
46-
echo "用法:bash ./build.sh --rom <ROM_VERSION> --url <ROM_URL>" >&2
46+
echo "用法:bash ./$0 --rom <ROM_VERSION> --url <ROM_URL>" >&2
4747
exit 1
4848
fi
4949

module_src/customize.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# shellcheck disable=SC2148,SC2034,SC1091,SC2059
22
SKIPUNZIP=0
3-
. "$MODPATH"/util_functions.sh
43
magisk_path=/data/adb/modules/
54
module_id=$(grep_prop id "$MODPATH/module.prop")
65

@@ -10,10 +9,12 @@ add_props() {
109
echo "$line" >>"$MODPATH/system.prop"
1110
}
1211

13-
add_post_fs_data() {
14-
local line="$1"
15-
# shellcheck disable=SC2059
16-
printf "\n$line\n" >>"$MODPATH/post-fs-data.sh"
12+
grep_prop() {
13+
local REGEX="s/^$1=//p"
14+
shift
15+
local FILES=$@
16+
[ -z "$FILES" ] && FILES='/system/build.prop'
17+
cat $FILES 2>/dev/null | dos2unix | sed -n "$REGEX" | head -n 1
1718
}
1819

1920
key_check() {

module_src/post-fs-data.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# shellcheck disable=SC2148,SC1091
22
MODDIR=${0%/*}
3-
. "$MODDIR/util_functions.sh"
43

54
prop_file="/mi_ext/etc/build.prop"
65
module_prop="$MODDIR/module.prop"

module_src/service.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

module_src/util_functions.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)