Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
ONEUI-7 committed Nov 14, 2024
1 parent eb65f3d commit f4b64dc
Show file tree
Hide file tree
Showing 19 changed files with 1,119 additions and 1,079 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- main
workflow_dispatch:
env:
VERSION: '8.5.1'
VERSION: '9.0.0'
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -33,20 +33,24 @@ jobs:
prerelease: false
body: |
## 更新内容
### 新的功能
01. 修复了一个问题,该问题导致 ext 分区在特定情况下提取 selinux 上下文时报错。
02. 更新了菜单样式。
03. 新的英文翻译,应该能够正确工作了。
04.修复一个问题,该问题导致提取 ext 分区 selinux 上下文内容时产生了无效字符。
5.由于某些 ext4 文件比较特别,对 ext4 的提取进行了调整,现在采用 debugfs 提取,需要 root
1. **ext 分区文件的提取更换**:现在提取 ext 分区文件时需要 ROOT 权限。
2. **ext4 打包方式更新**:ext4 文件的打包方式已更改为使用 `mke2fs` 和 `e2fsdroid`,仅支持 Android 10 及更高版本。
3. **super.img 打包添加加载动画**:在打包 `super.img` 时新增了加载动画。
4. **不再支持 ext 和 f2fs 稀疏格式打包**:已移除对 ext 和 f2fs 稀疏格式的打包支持。
5. **更新逻辑分离**:将 SELinux 配置与上下文内容的更新逻辑从打包逻辑中分离,便于代码阅读和维护。
6. **其他优化**:进行了一些特性优化,以提高性能和可用性。
## Release Notes
### New Features
01. Fixed a problem that caused an error when extracting selinux context for ext partitions in some cases.
02. Updated menu style.
03. New English translation, should work properly.
04. Fixed a problem that caused invalid characters to be generated when extracting selinux context for ext partitions.
5. Because some ext4 files are special, the extraction of ext4 has been adjusted. Now debugfs is used for extraction, which requires root
1. **Extracting ext partition files now requires ROOT permissions**: The extraction of ext partition files has been updated and now requires ROOT access.
2. **ext4 packaging update**: The packaging method for ext4 partitions has been changed to use `mke2fs` and `e2fsdroid`, and is now supported only on Android 10 and higher.
3. **Loading animation for super.img packaging**: A loading animation has been added when packaging `super.img`.
4. **No longer supporting ext and f2fs sparse format packaging**: Support for packing ext and f2fs sparse formats has been removed.
5. **Separation of SELinux configuration and context update logic**: The logic for updating SELinux configurations and contexts has been separated from the packaging logic for better readability and maintenance.
6. **Other optimizations**: Several feature optimizations have been made to improve performance and usability.
- name: Archive project
run: zip -r UY-Sct_${{ env.VERSION }}.zip .
Expand Down
54 changes: 33 additions & 21 deletions resources/languages/start_cn.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
#!/bin/bash
function keep_clean {
find "$(dirname "$0")" -type f -name "*Zone.Identifier*" -exec rm -rf {} \;
}

# 引入各个模块
source "$(dirname "$0")/resources/module_codes/recognize_file_type.sh"
source "$(dirname "$0")/resources/module_codes/switch_languages.sh"
source "$(dirname "$0")/resources/module_codes/cn/extract.sh"
source "$(dirname "$0")/resources/module_codes/cn/make_super.sh"
source "$(dirname "$0")/resources/module_codes/cn/make_img.sh"
source "$(dirname "$0")/resources/module_codes/cn/rebuild_rom.sh"
for script in "$(dirname "$0")/resources/module_codes/cn"/*.sh \
"$(dirname "$0")/resources/module_codes/general"/*.sh; do
source "$script"
done
source "$(dirname "$0")/resources/my_tools/nice_rom/NiceRom.sh"

# 定义工具和工作目录的路径
TOOL_DIR="$(dirname "$0")/resources/my_tools"
WORK_DIR="$(dirname "$0")/my_workspaces"

# 定义当前工作域
current_workspace=""

function show_main_menu {
clear
echo -e "\033[38;2;135;206;235m"
echo -e " "
echo -e " ──────────────── "
echo -e " "
echo -e " 盾牌座 UY "
echo -e " "
echo -e " ──────────────── "
echo -e " ──────────────────────────"
echo -e " "
echo -e " 盾牌座 UY "
echo -e " "
echo -e " ──────────────────────────"
tput sgr0
echo -e "\n [01] 选择工作域\n"
echo -e " [02] 建立工作域\n"
Expand All @@ -32,15 +31,16 @@ function show_main_menu {
echo -e " [05] 退出程序\n"
echo -n " 请选择一个操作:"
}

# 显示工作域菜单的函数
function show_workspace_menu {
echo -e "\033[38;2;135;206;235m"
echo -e " "
echo -e " ──────────────── "
echo -e " "
echo -e " 工作域 "
echo -e " "
echo -e " ──────────────── "
echo -e " ────────────────────────"
echo -e " "
echo -e " 工作域 "
echo -e " "
echo -e " ────────────────────────"
tput sgr0
echo -e "\n [01] 分区文件提取\n"
echo -e " [02] 分区文件打包\n"
Expand All @@ -51,6 +51,7 @@ function show_workspace_menu {
echo -e " [07] 退出程序\n"
echo -n " 请选择一个操作:"
}

function create_workspace {
while true; do
echo ""
Expand All @@ -61,7 +62,7 @@ function create_workspace {
echo -e "\n 你没有进行有效的输入。"
continue
fi
if echo "$workspace" | grep -Pvq "^[a-zA-Z0-9_\-\.\,\;\[\]\{\}\(\)\@\#\$\%\^\&\*\+\=\!\<\>\?\/\~\`\|\p{Han}\s]*$"; then
if echo "$workspace" | grep -Pvq "^[a-zA-Z0-9_\-\.\p{Han}\s]*$"; then
clear
echo -e "\n 不允许的工作域名称。"
else
Expand All @@ -80,6 +81,7 @@ function create_workspace {
fi
done
}

function select_workspace {
local workspaces=("$WORK_DIR"/*)
if [ -z "$(ls -A "$WORK_DIR")" ]; then
Expand All @@ -88,6 +90,7 @@ function select_workspace {
read -n 1
return
fi

while true; do
echo -e "\n"
echo -e " 以下是所有可用的工作域:\n"
Expand Down Expand Up @@ -120,13 +123,15 @@ function select_workspace {
fi
done
}

function delete_workspace {
if [ -z "$(ls -A "$WORK_DIR")" ]; then
echo -e "\n"
echo -n " 没有工作域可删除,按任意键返回。"
read -n 1
return
fi

while true; do
echo -e "\n"
echo -e " 以下是所有工作域:\n"
Expand All @@ -146,6 +151,7 @@ function delete_workspace {
workspace=$(ls -d "$WORK_DIR"/* | sed -n "${choice}p")
if [ -d "$workspace" ]; then
rm -rf "$workspace"
find "$TOOL_DIR/boot_editor" -mindepth 1 ! -regex '^'"$TOOL_DIR/boot_editor"'/\(aosp\|bbootimg\|src\|tools\|gradlew\)\(/.*\)?$' -exec rm -rf {} \; 2>/dev/null
echo " 工作域 $(basename "$workspace") 已删除。"
echo -n " 按任意键返回主菜单..."
read -n 1
Expand All @@ -160,6 +166,7 @@ function delete_workspace {
fi
done
}

# 在工作域菜单的函数中添加新功能
function workspace_menu {
while true; do
Expand Down Expand Up @@ -203,14 +210,19 @@ function workspace_menu {
esac
done
}

function one_click_modify {
pushd . >/dev/null
local workspace_path=$(realpath "$WORK_DIR/$current_workspace")
echo -e "\n"
add_path "$workspace_path"
popd
}
# 主循环

function keep_clean {
find "$(dirname "$0")" -type f -name "*Zone.Identifier*" -exec rm -rf {} \;
}

while true; do
clear
keep_clean
Expand Down
Loading

0 comments on commit f4b64dc

Please sign in to comment.