Skip to content

Commit 4d512b9

Browse files
author
oneui
committed
up
1 parent 1b66e50 commit 4d512b9

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- main
66
workflow_dispatch:
77
env:
8-
VERSION: '12.1.0' # Update version number to 12
8+
VERSION: '12.2.0' # Update version number to 12
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
@@ -39,6 +39,7 @@ jobs:
3939
2. **vbmeta 校验移除改进,现在,在小米 14 之后的任何小米机型必须修改 vbmeta,否则会不开机,在之前只需 fastboot 刷入时禁用即可,现在在小米新机型中不再有任何效果**
4040
3. **移除应用大部分修改为基于包名**
4141
4. **修改 apk 的功能已被隐藏,由于 apktool 不修复,你只能手动通过 MT 管理器修改 apk,但是你可以参考这些修改的代码,它们还在,只是不调用**
42+
5. ext4 格式打包现在默认会保持原始大小了,如果你原本镜像提取从ext格式提取,那么便会保留原始大小,同时再次打包ext4时优先采取原始大小,如果没有,则动态计算
4243
4344
## Release Notes
4445
@@ -47,6 +48,7 @@ jobs:
4748
2. **Improvement in vbmeta verification removal: Now, for any Xiaomi model after Xiaomi 14, vbmeta must be modified; otherwise, it will not boot. Previously, it was sufficient to disable it during fastboot flashing, but this is no longer effective on new Xiaomi models.**
4849
3. **Most application removals have been modified to be based on package names.**
4950
4. **The functionality to modify APKs has been hidden. Due to the lack of fixes in apktool, you can only manually modify APKs using MT Manager. However, you can refer to the modification codes, which are still present but not invoked.**
51+
5. The ext4 format packaging now retains the original size by default. If you originally extracted the image from the ext format, the original size will be retained. At the same time, the original size will be given priority when packaging ext4 again. If not, it will be dynamically calculated
5052
5153
- name: Archive project
5254
run: zip -r UY-Sct_${{ env.VERSION }}.zip .

resources/module_codes/cn/extract.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ function extract_single_img {
6767
ext)
6868
echo "正在提取分区 ${single_file_name},请稍等..."
6969
PYTHONDONTWRITEBYTECODE=1 python3 "$TOOL_DIR/ext4_info_get.py" "$single_file" "$WORK_DIR/$current_workspace/Extracted-files/config"
70+
partition_size=$(stat -c%s "$single_file")
71+
72+
mkdir -p "$WORK_DIR/$current_workspace/Extracted-files/config"
73+
echo "$partition_size" > "$WORK_DIR/$current_workspace/Extracted-files/config/original_${base_name}_size_for_ext4"
7074

7175
mkdir -p "$WORK_DIR/$current_workspace/Extracted-files/${base_name}"
7276

resources/module_codes/cn/make_img.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ function package_single_partition {
5555
fs_type="ext4"
5656
mke2fs_tool_path="$(dirname "$0")/resources/my_tools/mke2fs"
5757
e2fsdroid_tool_path="$(dirname "$0")/resources/my_tools/e2fsdroid"
58-
size=$(du -sb "$dir" | cut -f1)
59-
60-
if [ "$size" -lt $((1 * 1024 * 1024)) ]; then
61-
size=$((15 * 1024 * 1024))
58+
size_file="$WORK_DIR/$current_workspace/Extracted-files/config/original_$(basename "$dir")_size_for_ext4"
59+
60+
if [ -f "$size_file" ]; then
61+
size=$(cat "$size_file")
6262
else
63-
size=$((size * 101 / 100 + 4 * 1024 * 1024))
63+
size=$(du -sb "$dir" | cut -f1)
64+
size=$((size * 102 / 100))
6465
fi
6566

6667
echo "正在打包分区 $(basename "$dir") ..."

resources/module_codes/en/extract.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ function extract_single_img {
6060
ext)
6161
echo "Extracting partition ${single_file_name}, please wait..."
6262
PYTHONDONTWRITEBYTECODE=1 python3 "$TOOL_DIR/ext4_info_get.py" "$single_file" "$WORK_DIR/$current_workspace/Extracted-files/config"
63+
partition_size=$(stat -c%s "$single_file")
64+
65+
mkdir -p "$WORK_DIR/$current_workspace/Extracted-files/config"
66+
echo "$partition_size" > "$WORK_DIR/$current_workspace/Extracted-files/config/original_${base_name}_size_for_ext4"
6367
mkdir -p "$WORK_DIR/$current_workspace/Extracted-files/${base_name}"
6468
echo "rdump / \"$WORK_DIR/${current_workspace}/Extracted-files/${base_name}\"" | sudo debugfs "$single_file" >/dev/null 2>&1
6569
sudo chmod -R a+rwx "$WORK_DIR/$current_workspace/Extracted-files/${base_name}"

resources/module_codes/en/make_img.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ function package_single_partition {
5555
fs_type="ext4"
5656
mke2fs_tool_path="$(dirname "$0")/resources/my_tools/mke2fs"
5757
e2fsdroid_tool_path="$(dirname "$0")/resources/my_tools/e2fsdroid"
58-
size=$(du -sb "$dir" | cut -f1)
59-
60-
if [ "$size" -lt $((1 * 1024 * 1024)) ]; then
61-
size=$((15 * 1024 * 1024))
58+
size_file="$WORK_DIR/$current_workspace/Extracted-files/config/original_$(basename "$dir")_size_for_ext4"
59+
60+
if [ -f "$size_file" ]; then
61+
size=$(cat "$size_file")
6262
else
63-
size=$((size * 101 / 100 + 4 * 1024 * 1024))
63+
size=$(du -sb "$dir" | cut -f1)
64+
size=$((size * 102 / 100))
6465
fi
6566

6667
echo "Packing partition $(basename "$dir") ..."

0 commit comments

Comments
 (0)