forked from Next-Flip/Momentum-Firmware
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
50,756 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
From 506392a56cc7fe958b4cf16ec44b5dc7ef27f7fb Mon Sep 17 00:00:00 2001 | ||
From: kalicyh <[email protected]> | ||
Date: Tue, 21 Jan 2025 01:05:42 +0800 | ||
Subject: [PATCH 02/16] =?UTF-8?q?=F0=9F=90=8E=20ci(workflows):=20=E6=B7=BB?= | ||
=?UTF-8?q?=E5=8A=A0=E8=87=AA=E5=8A=A8=E5=8C=96=E7=BC=96=E8=AF=91?= | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
--- | ||
.github/workflows/Build_Release.yml | 87 +++++++++++++++++++++++++++++ | ||
1 file changed, 87 insertions(+) | ||
create mode 100644 .github/workflows/Build_Release.yml | ||
|
||
diff --git a/.github/workflows/Build_Release.yml b/.github/workflows/Build_Release.yml | ||
new file mode 100644 | ||
index 000000000..66610d1a8 | ||
--- /dev/null | ||
+++ b/.github/workflows/Build_Release.yml | ||
@@ -0,0 +1,87 @@ | ||
+name: "Build And Release" | ||
+ | ||
+on: | ||
+ push: | ||
+ tags: | ||
+ - "*" | ||
+ | ||
+concurrency: | ||
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
+ cancel-in-progress: true | ||
+ | ||
+env: | ||
+ DEFAULT_TARGET: f7 | ||
+ FBT_GIT_SUBMODULE_SHALLOW: 1 | ||
+ | ||
+jobs: | ||
+ build: | ||
+ permissions: | ||
+ issues: write | ||
+ pull-requests: write | ||
+ runs-on: ubuntu-latest | ||
+ strategy: | ||
+ fail-fast: false | ||
+ matrix: | ||
+ target: [f7] | ||
+ steps: | ||
+ - name: "Checkout code" | ||
+ uses: actions/checkout@v4 | ||
+ with: | ||
+ fetch-depth: 1 | ||
+ ref: ${{ github.event.pull_request.head.sha }} | ||
+ | ||
+ - name: "Get commit details" | ||
+ id: names | ||
+ run: | | ||
+ BUILD_TYPE='DEBUG=0 COMPACT=1' | ||
+ if [[ ${{ github.event_name }} == 'pull_request' ]]; then | ||
+ TYPE="pull" | ||
+ elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then | ||
+ TYPE="tag" | ||
+ else | ||
+ TYPE="other" | ||
+ fi | ||
+ python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE" || cat "${{ github.event_path }}" | ||
+ echo "event_type=$TYPE" >> $GITHUB_OUTPUT | ||
+ echo "FBT_BUILD_TYPE=$BUILD_TYPE" >> $GITHUB_ENV | ||
+ echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV | ||
+ echo "TARGET_HW=$(echo "${{ matrix.target }}" | sed 's/f//')" >> $GITHUB_ENV | ||
+ | ||
+ # - name: "Check API versions for consistency between targets" | ||
+ # run: | | ||
+ # set -e | ||
+ # N_API_HEADER_SIGNATURES=`ls -1 targets/f*/api_symbols.csv | xargs -I {} sh -c "head -n2 {} | md5sum" | sort -u | wc -l` | ||
+ # if [ $N_API_HEADER_SIGNATURES != 1 ] ; then | ||
+ # echo API versions aren\'t matching for available targets. Please update! | ||
+ # echo API versions are: | ||
+ # head -n2 targets/f*/api_symbols.csv | ||
+ # exit 1 | ||
+ # fi | ||
+ | ||
+ - name: "Build the firmware and apps" | ||
+ id: build-fw | ||
+ run: | | ||
+ ./fbt TARGET_HW=$TARGET_HW $FBT_BUILD_TYPE updater_package | ||
+ echo "firmware_api=$(./fbt TARGET_HW=$TARGET_HW get_apiversion)" >> $GITHUB_OUTPUT | ||
+ | ||
+ - name: "Check for uncommitted changes" | ||
+ run: | | ||
+ git diff --exit-code | ||
+ | ||
+ - name: "Upload artifacts to GitHub" | ||
+ uses: actions/upload-artifact@v3 | ||
+ with: | ||
+ path: | | ||
+ dist/${{ env.TARGET }}-*/flipper-z-${{ env.TARGET }}-update-* | ||
+ dist/${{ env.TARGET }}-*/flipper-z-${{ env.TARGET }}-sdk-* | ||
+ | ||
+ - name: "Release" | ||
+ uses: ncipollo/release-action@v1 | ||
+ with: | ||
+ tag: ${{ github.ref_name }} | ||
+ draft: false | ||
+ allowUpdates: true | ||
+ artifacts: | | ||
+ dist/${{ env.TARGET }}-*/flipper-z-${{ env.TARGET }}-update-* | ||
+ dist/${{ env.TARGET }}-*/flipper-z-${{ env.TARGET }}-sdk-* | ||
+ token: ${{ secrets.TOKEN }} | ||
-- | ||
2.39.5 (Apple Git-154) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
From fd6372dbf12c8bf9249c76ecd25be5fa03e7a3d9 Mon Sep 17 00:00:00 2001 | ||
From: kalicyh <[email protected]> | ||
Date: Tue, 21 Jan 2025 01:34:19 +0800 | ||
Subject: [PATCH 15/16] =?UTF-8?q?=F0=9F=93=83=20docs(ReadMe-detail):=20?= | ||
=?UTF-8?q?=E8=A1=A5=E5=85=85=E6=B1=89=E5=8C=96=E6=95=99=E7=A8=8B?= | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
--- | ||
applications/services/gui/README.md | 76 +++++++++++++++++++++++++++++ | ||
1 file changed, 76 insertions(+) | ||
create mode 100644 applications/services/gui/README.md | ||
|
||
diff --git a/applications/services/gui/README.md b/applications/services/gui/README.md | ||
new file mode 100644 | ||
index 000000000..f2edf86f6 | ||
--- /dev/null | ||
+++ b/applications/services/gui/README.md | ||
@@ -0,0 +1,76 @@ | ||
+## 汉化方式 | ||
+ | ||
+### 一、大部分内容汉化 | ||
+ | ||
+#### (1)、生成字库数据 | ||
+ | ||
+利用[u8g2_cn_tools](https://github.com/kalicyh/u8g2_cn_tools) | ||
+ | ||
+#### (2)、挂载字库 | ||
+ | ||
+创建导入的文件`kalicyh_font.h`和`kalicyh_font.c`便于维护 | ||
+ | ||
+修改`canvas.c`文件 | ||
+ | ||
+添加以下代码 | ||
+```C | ||
+#include "kalicyh_font.h" | ||
+canvas_set_custom_u8g2_font(canvas, kalicyh); | ||
+``` | ||
+ | ||
+##### 示例: | ||
+```C | ||
+#include "kalicyh_font.h" | ||
+ | ||
+void canvas_draw_str(Canvas* canvas, int32_t x, int32_t y, const char* str) { | ||
+ canvas_set_custom_u8g2_font(canvas, kalicyh); | ||
+ furi_check(canvas); | ||
+ if(!str) return; | ||
+ x += canvas->offset_x; | ||
+ y += canvas->offset_y; | ||
+ u8g2_DrawUTF8(&canvas->fb, x, y, str); | ||
+} | ||
+``` | ||
+ | ||
+### 二、部分特殊汉化 | ||
+ | ||
+#### 设置内的APP列表 | ||
+ | ||
+修改`Momentum-Firmware\applications\settings`目录内的`*.fam`的`name`字段 | ||
+ | ||
+修改`scripts\fbt\elfmanifest.py`内的`self.name.encode("UTF-8")` | ||
+ | ||
+```PY | ||
+@dataclass | ||
+class ElfManifestV1: | ||
+ stack_size: int | ||
+ app_version: int | ||
+ name: str = "" | ||
+ icon: bytes = field(default=b"") | ||
+ | ||
+ def as_bytes(self): | ||
+ return struct.pack( | ||
+ "<hI32s?32s", | ||
+ self.stack_size, | ||
+ self.app_version, | ||
+ bytes(self.name.encode("UTF-8")), | ||
+ bool(self.icon), | ||
+ self.icon, | ||
+ ) | ||
+``` | ||
+ | ||
+## 正则表达式 | ||
+ | ||
+``` | ||
+"([^\u4e00-\u9fa5"]*)" | ||
+``` | ||
+ | ||
+方便搜索未修改的内容 | ||
+ | ||
+## 目前字库内容 | ||
+ | ||
+中文需要放在符号之前,中文的符号需要放在ABCD之前 | ||
+ | ||
+``` | ||
+一万三上下不与丢个中为主义之乐习书了二于些交产亮仅介他代以仪件份仿休伙会伤伪位住何余作你佳使例供保信值倾停储儿允充先光入全公六关其具内册写军决冷准凑出击分切列删利别到制刻前剥剩剪力功加动助勿包化匹区匿十升协卓单卡却卸厂压原厨发取受变口只可右号吃同名后向否含听启呀告命和品哎商器回因围固图在地圾址坏块垃型域基堆填增声壳处备复外多大天失头夹夺好如始姓字存学安完定实家容密对将小少尝局屏展崩左差已布帮常幕干并序应度延建开异弃式引弹当录形彩影待很得循心必志忘忙快忽态怒性总恢息您情感愤憩成我或战房所扇手打执扩扫扰找投护报拔拟择持挂按损据捷掉接控描提插搜操擦收改攻放效数整文断新方无日旧时明星是显景暂暴更最有期未本机杂束来析果某柠查标栈栏栗样核格框桌档桥检棕榄槽模橄橙次止正此步段母每比气水永池汽没法波注泻洋洪活流测浏海消深添清溃源满激炸照片版牌牙特状率玩环现理生用电画界留略白的监盖盘目看真眠着睡知短码破硬确示禁离秒称移程空窗符等签管箭米类粉粘糕糟系索紧紫繁红级纵线绍经结绕绝统继续维绿缀编置群翻而耗耳背胜能脚自致般色节英苹范获菜蓝蔚藏虚虹行表被装要规视览角解警计认议记许设证试误请读调谢豚贴资超距跟跳踪车轰载较辑输边过运近返这进远连迟退送选透通速造道遥邮部配里重量针钟钥钮锁错键长闪闭问闲间阅阈限除陪随隐隔需震青静面音页项须频题颜额风饱验高黄黑默!,:? | ||
+``` | ||
-- | ||
2.39.5 (Apple Git-154) | ||
|
Oops, something went wrong.