├── files ├── manifest.txt ├── frame_0.png ├── dolphin │ ├── L1_Noanim_128x50 │ │ ├── frame_0.png │ │ └── meta.txt │ └── manifest.txt ├── meta.txt └── setting_user.txt ├── tools ├── histogram_sub.py ├── bitstream-from-sub.py └── create_sub.py ├── README.md └── .github └── workflows ├── RogueMasterRefactors.yml ├── plugins.yml ├── MomentumCN.yml ├── Momentum.yml ├── RogueMaster.yml ├── Xtreme.yml └── Unleashed.yml /files/manifest.txt: -------------------------------------------------------------------------------- 1 | Filetype: Flipper Animation Manifest 2 | Version: 1 3 | -------------------------------------------------------------------------------- /files/frame_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cokyrain/FlipperZeroFirmware/HEAD/files/frame_0.png -------------------------------------------------------------------------------- /files/dolphin/L1_Noanim_128x50/frame_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cokyrain/FlipperZeroFirmware/HEAD/files/dolphin/L1_Noanim_128x50/frame_0.png -------------------------------------------------------------------------------- /files/dolphin/manifest.txt: -------------------------------------------------------------------------------- 1 | Filetype: Flipper Animation Manifest 2 | Version: 1 3 | 4 | Name: L1_Noanim_128x50 5 | Min butthurt: 0 6 | Max butthurt: 0 7 | Min level: 1 8 | Max level: 30 9 | Weight: 3 10 | -------------------------------------------------------------------------------- /files/meta.txt: -------------------------------------------------------------------------------- 1 | Filetype: Flipper Animation 2 | Version: 1 3 | 4 | Width: 128 5 | Height: 50 6 | Passive frames: 1 7 | Active frames: 0 8 | Frames order: 0 9 | Active cycles: 0 10 | Frame rate: 1 11 | Duration: 3600 12 | Active cooldown: 0 13 | 14 | Bubble slots: 0 15 | -------------------------------------------------------------------------------- /files/dolphin/L1_Noanim_128x50/meta.txt: -------------------------------------------------------------------------------- 1 | Filetype: Flipper Animation 2 | Version: 1 3 | 4 | Width: 128 5 | Height: 50 6 | Passive frames: 1 7 | Active frames: 0 8 | Frames order: 0 9 | Active cycles: 0 10 | Frame rate: 1 11 | Duration: 3600 12 | Active cooldown: 0 13 | 14 | Bubble slots: 0 15 | -------------------------------------------------------------------------------- /tools/histogram_sub.py: -------------------------------------------------------------------------------- 1 | import re 2 | import sys 3 | import pandas as pd 4 | import matplotlib.pyplot as plt 5 | 6 | filename = sys.argv[1] 7 | 8 | segs = [] 9 | with open(filename, 'r') as f: 10 | for line in f: 11 | m = re.match(r'RAW_Data:\s*([-0-9 ]+)\s*$', line) 12 | if m: 13 | segs.extend(abs(int(seg)) for seg in m[1].split(r' ')) 14 | 15 | series = pd.Series(segs) 16 | 17 | # Get rid of outliers 18 | series = series[series < 5000] 19 | 20 | series.plot.hist(bins=100) 21 | plt.show() 22 | -------------------------------------------------------------------------------- /tools/bitstream-from-sub.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Find the raw bitstring from a captured Flipper RAW .sub file. 4 | # Must provide the bitlength in ms, and the allowable error which can be tolerated. 5 | 6 | import re 7 | import sys 8 | import math 9 | 10 | filename = sys.argv[1] 11 | 12 | bitlen = 400 13 | allowable_error = 60 14 | minseg = bitlen - allowable_error 15 | 16 | def normalize(seg): 17 | aseg = abs(seg) 18 | if aseg < minseg: 19 | return 'x' 20 | n = aseg // bitlen * bitlen 21 | if abs(aseg - n) <= allowable_error: 22 | return int(math.copysign(n, seg)) 23 | n += bitlen 24 | if abs(aseg - n) <= allowable_error: 25 | return int(math.copysign(n, seg)) 26 | return 'x' 27 | 28 | segs = [] 29 | with open(filename, 'r') as f: 30 | for line in f: 31 | m = re.match(r'RAW_Data:\s*([-0-9 ]+)\s*$', line) 32 | if m: 33 | segs.extend([normalize(int(seg)) for seg in m[1].strip().split(r' ')]) 34 | 35 | full = [] 36 | for seg in segs: 37 | if seg == 'x': 38 | full.append(seg) 39 | elif seg > 0: 40 | full.extend('1' * (seg // bitlen)) 41 | elif seg < 0: 42 | full.extend('0' * (-seg // bitlen)) 43 | full = ''.join(full) 44 | 45 | print('Full bitstring:') 46 | print(full) 47 | 48 | def longest_repeated_contiguous_substring(s): 49 | return max(re.findall(r'(.+)\1', s), key=len) 50 | 51 | lrs = longest_repeated_contiguous_substring(full) 52 | 53 | def shortest_repeat(s): 54 | while m := re.fullmatch(r'(.+)\1', s): 55 | s = m[1] 56 | return s 57 | 58 | print('Shortest repeating contiguous substring:') 59 | print(shortest_repeat(lrs)) 60 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Auto Compile Firmware for Flipper Zero 2 | 3 | Thanks to:
4 | | [RogueMaster](https://github.com/RogueMaster/flipperzero-firmware-wPlugins) | [Momentum](https://github.com/Next-Flip/Momentum-Firmware) | [Unleashed](https://github.com/DarkFlippers/unleashed-firmware) | [Mntm中文](https://github.com/kalicyh/Momentum-Firmware)| 5 | | --------------- | --------------- | --------------- | --------------- | 6 | | ![GitHub last commit](https://img.shields.io/github/last-commit/RogueMaster/flipperzero-firmware-wPlugins?label) | ![GitHub last commit](https://img.shields.io/github/last-commit/Next-Flip/Momentum-Firmware?label) | ![GitHub last commit](https://img.shields.io/github/last-commit/DarkFlippers/unleashed-firmware?label) | ![GitHub last commit](https://img.shields.io/github/last-commit/kalicyh/Momentum-Firmware?label) | 7 | | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/cokyrain/FlipperZeroFirmware/RogueMaster.yml?label) | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/cokyrain/FlipperZeroFirmware/Momentum.yml?label) | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/cokyrain/FlipperZeroFirmware/Unleashed.yml?label) | Pause | 8 | 9 | Auto update Firmware, keep up with source code changes, Enjoy it! 10 | 11 | ---- 12 | ## More collective : 13 | - [Flipper Maker](https://flippermaker.github.io/) 14 | - [flipper_toolbox](https://github.com/evilpete/flipper_toolbox) 15 | - [ClassicConverter](https://github.com/equipter/ClassicConverter) 16 | - [SUB Plotters](https://github.com/ShotokanZH/flipper_sub_plotters_comparers) 17 | - [awesome-flipperzero](https://github.com/djsime1/awesome-flipperzero) 18 | - [UberGuidoZ/Flipper-IRDB](https://github.com/UberGuidoZ/Flipper-IRDB) 19 | - [UberGuidoZ/Flipper](https://github.com/UberGuidoZ/Flipper) 20 | - [logickworkshop/Flipper-IRDB](https://github.com/logickworkshop/Flipper-IRDB) 21 | - [Gioman101/FlipperAmiibo](https://github.com/Gioman101/FlipperAmiibo) 22 | 23 | 24 | ---- 25 | ## Stargazers over time 26 | [![Stargazers over time](https://starchart.cc/cokyrain/FlipperZeroFirmware.svg?variant=adaptive)](https://starchart.cc/cokyrain/FlipperZeroFirmware) 27 | ---- 28 | 29 | 30 | -------------------------------------------------------------------------------- /files/setting_user.txt: -------------------------------------------------------------------------------- 1 | Filetype: Flipper SubGhz Setting File 2 | Version: 1 3 | 4 | # Add Standard frequencies for your region 5 | Add_standard_frequencies: true 6 | 7 | # Default Frequency: used as default for "Read" and "Read Raw" 8 | Default_frequency: 431500000 9 | 10 | # Frequencies used for "Read", "Read Raw" and "Frequency Analyzer" 11 | #Frequency: 432800000 12 | 13 | 14 | # Frequencies used for hopping mode (keep this list small or flipper will miss signal) 15 | Hopper_frequency: 310000000 16 | Hopper_frequency: 315000000 17 | Hopper_frequency: 350000000 18 | Hopper_frequency: 390000000 19 | Hopper_frequency: 418000000 20 | Hopper_frequency: 430000000 21 | Hopper_frequency: 430500000 22 | Hopper_frequency: 431500000 23 | Hopper_frequency: 432800000 24 | Hopper_frequency: 433920000 25 | 26 | 27 | # Custom preset examples 28 | # format for CC1101 "Custom_preset_data:" XX YY XX YY .. 00 00 ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ, where: XX-register, YY - register data, 00 00 - end load register, ZZ - 8 byte Pa table register 29 | #Custom_preset_name: AM_1 30 | #Custom_preset_module: CC1101 31 | #Custom_preset_data: 02 0D 03 07 08 32 0B 06 14 00 13 00 12 30 11 32 10 17 18 18 19 18 1D 91 1C 00 1B 07 20 FB 22 11 21 B6 00 00 00 C0 00 00 00 00 00 00 32 | #Custom_preset_name: AM_2 33 | #Custom_preset_module: CC1101 34 | #Custom_preset_data: 02 0D 03 07 08 32 0B 06 14 00 13 00 12 30 11 32 10 17 18 18 19 18 1D 91 1C 00 1B 07 20 FB 22 11 21 B6 00 00 00 C0 00 00 00 00 00 00 35 | 36 | # Custom presets added in Unleashed FW 37 | # -- Some presets from forum.flipperzero.one -- 38 | #2-FSK 200khz BW / 135kHz Filter/ 12.69Khz Deviation + Ramping 39 | Custom_preset_name: FSK12k 40 | Custom_preset_module: CC1101 41 | Custom_preset_data: 02 0D 03 47 08 32 0B 06 15 30 14 00 13 00 12 00 11 32 10 A7 18 18 19 1D 1D 92 1C 00 1B 04 20 FB 22 17 21 B6 00 00 00 12 0E 34 60 C5 C1 C0 42 | 43 | #2-FSK 200khz BW / 135kHz Filter/ 15.86Khz Deviation + Ramping 44 | Custom_preset_name: FSK15k 45 | Custom_preset_module: CC1101 46 | Custom_preset_data: 02 0D 03 47 08 32 0B 06 15 32 14 00 13 00 12 00 11 32 10 A7 18 18 19 1D 1D 92 1C 00 1B 04 20 FB 22 17 21 B6 00 00 00 12 0E 34 60 C5 C1 C0 47 | 48 | #2-FSK 200khz BW / 135kHz Filter/ 25.39Khz Deviation + Ramping 49 | Custom_preset_name: FSK25k 50 | Custom_preset_module: CC1101 51 | Custom_preset_data: 02 0D 03 47 08 32 0B 06 15 40 14 00 13 00 12 00 11 32 10 A7 18 18 19 1D 1D 92 1C 00 1B 04 20 FB 22 17 21 B6 00 00 00 12 0E 34 60 C5 C1 C0 52 | 53 | #2-FSK 200khz BW / 135kHz Filter/ 31.73Khz Deviation + Ramping 54 | Custom_preset_name: FSK31k 55 | Custom_preset_module: CC1101 56 | Custom_preset_data: 02 0D 03 47 08 32 0B 06 15 42 14 00 13 00 12 00 11 32 10 A7 18 18 19 1D 1D 92 1C 00 1B 04 20 FB 22 17 21 B6 00 00 00 12 0E 34 60 C5 C1 C0 57 | 58 | #2-FSK 200khz BW / 135kHz Filter/ 34.91Khz Deviation + Ramping 59 | Custom_preset_name: FSK34k 60 | Custom_preset_module: CC1101 61 | Custom_preset_data: 02 0D 03 47 08 32 0B 06 15 43 14 00 13 00 12 00 11 32 10 A7 18 18 19 1D 1D 92 1C 00 1B 04 20 FB 22 17 21 B6 00 00 00 12 0E 34 60 C5 C1 C0 62 | 63 | #2-FSK 200khz BW / 135kHz Filter/ 38.08Khz Deviation + Ramping 64 | Custom_preset_name: FSK38k 65 | Custom_preset_module: CC1101 66 | Custom_preset_data: 02 0D 03 47 08 32 0B 06 15 44 14 00 13 00 12 00 11 32 10 A7 18 18 19 1D 1D 92 1C 00 1B 04 20 FB 22 17 21 B6 00 00 00 12 0E 34 60 C5 C1 C0 67 | 68 | Custom_preset_name: FM95 69 | Custom_preset_module: CC1101 70 | Custom_preset_data: 02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 83 10 67 15 24 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00 71 | 72 | # FM 15KHz preset 73 | Custom_preset_name: FM150 74 | Custom_preset_module: CC1101 75 | Custom_preset_data: 02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 83 10 67 15 31 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00 76 | 77 | Custom_preset_name: AM1 78 | Custom_preset_module: CC1101 79 | Custom_preset_data: 02 0D 03 07 08 32 0B 06 14 00 13 00 12 30 11 32 10 17 18 18 19 18 1D 91 1C 00 1B 07 20 FB 22 11 21 B6 00 00 00 C0 00 00 00 00 00 00 80 | 81 | Custom_preset_name: AMQ 82 | Custom_preset_module: CC1101 83 | Custom_preset_data: 02 0D 03 07 08 32 0B 06 14 00 13 00 12 30 11 22 10 1C 18 18 19 18 1D 91 1C 00 1B 07 20 FB 22 11 21 B6 00 00 00 C0 00 00 00 00 00 00 84 | 85 | Custom_preset_name: FuriHal 86 | Custom_preset_module: CC1101 87 | Custom_preset_data: 02 0D 03 47 08 32 0B 06 14 00 13 00 12 30 11 83 10 1B 18 18 19 18 1D 91 1C 00 1B 07 20 FB 22 11 21 B6 00 00 00 C0 00 00 00 00 00 00 88 | 89 | Custom_preset_name: Pagers 90 | Custom_preset_module: CC1101 91 | Custom_preset_data: 02 0D 07 04 08 32 0B 06 10 64 11 93 12 0C 13 02 14 00 15 15 18 18 19 16 1B 07 1C 00 1D 91 20 FB 21 56 22 10 00 00 C0 00 00 00 00 00 00 00 92 | 93 | # -- Other presets -- 94 | # Honda Presets 95 | Custom_preset_name: Honda1 96 | Custom_preset_module: CC1101 97 | # G2 G3 G4 D L0 L1 L2 98 | Custom_preset_data: 02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 36 10 69 15 32 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00 99 | 100 | Custom_preset_name: Honda2 101 | Custom_preset_module: CC1101 102 | # G2 G3 G4 D L0 L1 L2 103 | Custom_preset_data: 02 0D 0B 06 08 32 07 04 14 00 13 02 12 07 11 36 10 E9 15 32 18 18 19 16 1D 92 1C 40 1B 03 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00 104 | -------------------------------------------------------------------------------- /.github/workflows/RogueMasterRefactors.yml: -------------------------------------------------------------------------------- 1 | # Build Flipper Zero Firmware using GitHub Actions 2 | name: Build RogueMasterRefactors 3 | 4 | on: 5 | repository_dispatch: 6 | workflow_dispatch: 7 | inputs: 8 | anim: 9 | required: false 10 | default: 'NoAnim' 11 | type: choice 12 | description: Need Anim ? 13 | options: 14 | - 'NoAnim' 15 | - 'Anim' 16 | # schedule: 17 | # - cron: '35 3,23,5-13/4 * * ?' 18 | env: 19 | REPO_URL: https://github.com/RogueMaster/flipperzero-firmware-wPlugins.git 20 | Branch: refactors 21 | GIT_NAME: RogueMaster 22 | 23 | permissions: 24 | contents: write 25 | 26 | jobs: 27 | build: 28 | runs-on: ubuntu-latest 29 | steps: 30 | 31 | - name: 检查项目分支 32 | uses: actions/checkout@v3 33 | 34 | - name: 编译环境 35 | env: 36 | DEBIAN_FRONTEND: noninteractive 37 | run: | 38 | sudo timedatectl set-timezone "Asia/Shanghai" 39 | sudo mkdir -p /workdir 40 | sudo chown $USER:$GROUPS /workdir 41 | echo "FILE_TIME=$(date "+%Y%m%d-%H%M")" >> $GITHUB_ENV 42 | echo "FILE_DATE=$(date "+%Y%m%d")" >> $GITHUB_ENV 43 | echo "TIME_HOUR=$(date "+%k")" >> $GITHUB_ENV 44 | echo "FILE_NAME=$GIT_NAME-$Branch" >> $GITHUB_ENV 45 | 46 | - name: 下载固件源码 47 | id: download 48 | working-directory: /workdir 49 | run: | 50 | df -hT $PWD 51 | git clone -b $Branch $REPO_URL 52 | ln -sf /workdir/flipperzero-firmware-wPlugins $GITHUB_WORKSPACE/Flipper 53 | echo "status=success" >> $GITHUB_OUTPUT 54 | 55 | - name: 默认配置 56 | id: setting 57 | if: steps.download.outputs.status == 'success' && !cancelled() 58 | run: | 59 | sed -i 's/power_limit = 12/power_limit = 12/g' Flipper/targets/f7/furi_hal/furi_hal_region.c 60 | sed -i 's/false/true/g' Flipper/applications/main/subghz/resources/subghz/assets/extend_range.txt 61 | cp ./files/setting_user.txt Flipper/applications/main/subghz/resources/subghz/assets/ 62 | sed -i 's/430000000/430000000,430500000/g' Flipper/lib/subghz/subghz_setting.c 63 | sed -i 's/431500000/431500000,432800000/g' Flipper/lib/subghz/subghz_setting.c 64 | sed -i 's/430000000/430000000,430500000/g' Flipper/applications/main/subghz/views/subghz_frequency_analyzer.c 65 | sed -i 's/431500000/431500000,432800000/g' Flipper/applications/main/subghz/views/subghz_frequency_analyzer.c 66 | echo "status=success" >> $GITHUB_OUTPUT 67 | 68 | - name: 清理Anim 69 | id: clean 70 | if: ${{ env.TIME_HOUR }}!=6 && github.event.inputs.anim != 'Anim' && !cancelled() 71 | run: | 72 | shopt -s extglob 73 | cp ./files/meta.txt Flipper/assets/dolphin/internal/wrenchathome_F0Pattern_128x64/ 74 | rm -rf Flipper/assets/dolphin/internal/wrenchathome_F0Pattern_128x64/*.png 75 | cp ./files/frame_0.png Flipper/assets/dolphin/internal/wrenchathome_F0Pattern_128x64/ 76 | rm -rf Flipper/assets/dolphin/external/* 77 | cp ./files/manifest.txt Flipper/assets/dolphin/external/ 78 | echo "FILE_NAME=$GIT_NAME-$Branch-NoAnim" >> $GITHUB_ENV 79 | 80 | - name: 编译固件 81 | id: compile 82 | if: steps.setting.outputs.status == 'success' && !cancelled() 83 | run: | 84 | cd Flipper/ 85 | ./fbt updater_package 86 | echo "status=success" >> $GITHUB_OUTPUT 87 | 88 | - name: 检查磁盘使用情况 89 | if: steps.compile.outputs.status == 'success' && !cancelled() 90 | run: df -hT 91 | 92 | - name: 组织文件 93 | id: organize 94 | if: steps.compile.outputs.status == 'success' && !cancelled() 95 | run: | 96 | cd Flipper/dist/f7-C/ 97 | rm -rf *.tgz 98 | mv f7-update-* "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 99 | tar -czf "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}.tgz" "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 100 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 101 | echo "status=success" >> $GITHUB_OUTPUT 102 | 103 | - name: 上传固件目录 104 | uses: actions/upload-artifact@main 105 | if: steps.organize.outputs.status == 'success' && !cancelled() 106 | with: 107 | name: ${{ env.FILE_NAME }}-${{ env.FILE_TIME }} 108 | path: ${{ env.FIRMWARE }} 109 | 110 | - name: 生成ReleaseTag 111 | id: tag 112 | if: steps.organize.outputs.status == 'success' && !cancelled() 113 | run: | 114 | echo "release_tag=${{ env.FILE_DATE }}-${{ env.GIT_NAME }}" >> $GITHUB_OUTPUT 115 | touch release.txt 116 | echo "[源码来源]($REPO_URL)" >> release.txt 117 | echo "status=success" >> $GITHUB_OUTPUT 118 | 119 | - name: 上传固件到Release 120 | uses: softprops/action-gh-release@v1 121 | if: steps.tag.outputs.status == 'success' && !cancelled() 122 | env: 123 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 124 | with: 125 | name: ${{ env.FILE_DATE }}_${{ env.GIT_NAME }} 126 | tag_name: ${{ steps.tag.outputs.release_tag }} 127 | body_path: release.txt 128 | files: ${{ env.FIRMWARE }}/*.tgz 129 | 130 | - name: Delete releases and workflows runs 131 | uses: ophub/delete-releases-workflows@main 132 | with: 133 | delete_releases: true 134 | delete_tags: true 135 | releases_keep_latest: 300 136 | delete_workflows: true 137 | workflows_keep_day: 300 138 | gh_token: ${{ secrets.GH_TOKEN }} 139 | -------------------------------------------------------------------------------- /.github/workflows/plugins.yml: -------------------------------------------------------------------------------- 1 | # Build Flipper Zero Firmware using GitHub Actions 2 | name: Build Plugins 3 | 4 | on: 5 | repository_dispatch: 6 | workflow_dispatch: 7 | schedule: 8 | - cron: 25 23 * * * 9 | 10 | env: 11 | GITHUB_URL: https://github.com/ 12 | REPO_URL: UberGuidoZ/Flipper 13 | REPO_URL2: logickworkshop/Flipper-IRDB 14 | UPLOAD_RELEASE: true 15 | GIT_NAME: Plugins 16 | 17 | permissions: 18 | contents: write 19 | 20 | jobs: 21 | build: 22 | runs-on: ubuntu-latest 23 | steps: 24 | 25 | - name: 检查库更新情况 26 | id: checknew 27 | run: | 28 | curl https://api.github.com/repos/$REPO_URL/commits > index.json 29 | commits_time=$(cat index.json | grep "date" | sed -n "2p" | sed 's/ \"date\": \"//g' | sed 's/\"//g' | sed 's/T/ /g' | sed 's/Z//g') 30 | commits_time8=$(date +"%Y-%m-%d %H:%M:%S" -d "@$(($(date +%s -d "$commits_time")+28800))") 31 | echo $(date +"%Y-%m-%d %H:%M:%S") $(date +%s) 32 | echo $commits_time $(date +%s -d "$commits_time") 33 | echo $(($(date +%s) - $(date +%s -d "$commits_time"))) 34 | if [ $(($(date +%s) - $(date +%s -d "$commits_time"))) -le 86400 ] 35 | then 36 | echo "CODE_TIME=$commits_time" >> $GITHUB_ENV 37 | echo "CODE_TIME8=$commits_time8" >> $GITHUB_ENV 38 | echo "status=success" >> $GITHUB_OUTPUT 39 | else 40 | echo "No Update" 41 | fi 42 | 43 | - name: 检查项目分支 44 | id: check 45 | if: steps.checknew.outputs.status == 'success' && !cancelled() 46 | uses: actions/checkout@v4 47 | 48 | - name: 编译环境 49 | id: environment 50 | if: steps.checknew.outputs.status == 'success' && !cancelled() 51 | env: 52 | DEBIAN_FRONTEND: noninteractive 53 | run: | 54 | sudo timedatectl set-timezone "Asia/Shanghai" 55 | sudo mkdir -p /workdir 56 | sudo chown $USER:$GROUPS /workdir 57 | echo "FILE_TIME=$(date "+%Y%m%d-%H%M")" >> $GITHUB_ENV 58 | echo "FILE_DATE=$(date "+%Y%m%d")" >> $GITHUB_ENV 59 | echo "FILE_MONTH=$(date "+%Y%m")" >> $GITHUB_ENV 60 | echo "TIME_HOUR=$(date "+%k")" >> $GITHUB_ENV 61 | echo "GIT_NAME=$GIT_NAME" >> $GITHUB_ENV 62 | 63 | - name: 下载源码 64 | id: download 65 | if: steps.checknew.outputs.status == 'success' && !cancelled() 66 | working-directory: /workdir 67 | run: | 68 | df -hT $PWD 69 | git clone --recursive $GITHUB_URL/$REPO_URL 70 | ln -sf /workdir/Flipper $GITHUB_WORKSPACE/Flipper 71 | echo "status=success" >> $GITHUB_OUTPUT 72 | 73 | - name: 清理无用文件 74 | id: clean 75 | if: steps.download.outputs.status == 'success' && !cancelled() 76 | run: | 77 | shopt -s extglob 78 | rm -rf Flipper/Dolphin_Level 79 | rm -rf Flipper/Firmware_Options 80 | rm -rf Flipper/FlipperZero_Dimensions 81 | rm -rf Flipper/Graphics 82 | rm -rf Flipper/wetox_scripts 83 | rm -rf Flipper/Wifi_DevBoard 84 | rm -rf Flipper/flipper_toolbox 85 | rm -rf Flipper/Wav_Player 86 | rm -rf Flipper/Music_Player 87 | rm -rf Flipper/Sub-GHz/Restaurant_Pagers/Pagger-Generator 88 | rm -rf Flipper/GPIO 89 | rm -rf Flipper/Hardware_Troubleshooting 90 | rm -rf Flipper/Infrared/ir_remote 91 | rm -rf Flipper/Applications/Official/DEV_FW/source 92 | rm -rf Flipper/BadUSB/BadUSB-FalsePhilosopher/Misc 93 | cd Flipper/ 94 | find . -type f -name "" -size 0c | xargs -n 1 rm -f 95 | find . -type f -name '.github' -exec rm -rf {} \; 96 | find . -type f -name '.gitignore' -exec rm -rf {} \; 97 | find . -type f -name '.gitmodules' -exec rm -rf {} \; 98 | find . -type f -name 'LICENSE' -exec rm -rf {} \; 99 | find . -type f -name '*.md' -exec rm -rf {} \; 100 | find . -type f -name '*.pdf' -exec rm -rf {} \; 101 | find . -type f -name '*.jpg' -exec rm -rf {} \; 102 | find . -type f -name '*.mov' -exec rm -rf {} \; 103 | find . -type f -name '*.mp4' -exec rm -rf {} \; 104 | find . -type f -name '*.zip' -exec rm -rf {} \; 105 | find . -type f -name '*.png' -exec rm -rf {} \; 106 | find . -type f -name '*.git' -exec rm -rf {} \; 107 | find . -type f -name '*.yml' -exec rm -rf {} \; 108 | echo "status=success" >>$GITHUB_OUTPUT 109 | 110 | - name: 检查磁盘使用情况 111 | if: (!cancelled()) 112 | run: df -hT 113 | 114 | - name: 组织文件 115 | id: organize 116 | if: steps.clean.outputs.status == 'success' && !cancelled() 117 | run: | 118 | cd Flipper/ 119 | zip -r "${{ env.GIT_NAME }}-${{ env.FILE_TIME }}.zip" ./* 120 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 121 | echo "status=success" >> $GITHUB_OUTPUT 122 | 123 | - name: 生成ReleaseTag 124 | id: tag 125 | if: env.UPLOAD_RELEASE == 'true' && steps.organize.outputs.status == 'success' && !cancelled() 126 | run: | 127 | echo "release_tag=${{ env.FILE_MONTH }}-${{ env.GIT_NAME }}" >>$GITHUB_OUTPUT 128 | touch release.txt 129 | echo "[源码来源]($GITHUB_URL/$REPO_URL)" >> release.txt 130 | echo "status=success" >> $GITHUB_OUTPUT 131 | 132 | - name: 上传固件到Release 133 | uses: softprops/action-gh-release@v1 134 | if: steps.tag.outputs.status == 'success' && !cancelled() 135 | env: 136 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 137 | with: 138 | name: ${{ env.FILE_DATE }}_${{ env.GIT_NAME }} 139 | tag_name: ${{ steps.tag.outputs.release_tag }} 140 | body_path: release.txt 141 | files: ${{ env.FIRMWARE }}/*.zip 142 | 143 | - name: 删除旧的releases和workflows runs 144 | uses: ophub/delete-releases-workflows@main 145 | if: steps.tag.outputs.status == 'success' && !cancelled() 146 | with: 147 | delete_releases: true 148 | delete_tags: true 149 | releases_keep_latest: 3000 150 | delete_workflows: true 151 | workflows_keep_day: 365 152 | gh_token: ${{ secrets.GH_TOKEN }} 153 | -------------------------------------------------------------------------------- /.github/workflows/MomentumCN.yml: -------------------------------------------------------------------------------- 1 | name: Build MomentumCN 2 | 3 | on: 4 | repository_dispatch: 5 | workflow_dispatch: 6 | inputs: 7 | anim: 8 | required: false 9 | default: 'NoAnim' 10 | type: choice 11 | description: Need Anim ? 12 | options: 13 | - 'NoAnim' 14 | - 'Anim' 15 | # schedule: 16 | # - cron: '35 3-23/4 * * ?' 17 | 18 | env: 19 | GITHUB_URL: https://github.com/ 20 | REPO_URL: kalicyh/Momentum-Firmware 21 | GIT_NAME: MomentumCN 22 | 23 | permissions: 24 | contents: write 25 | 26 | jobs: 27 | build: 28 | runs-on: ubuntu-latest 29 | steps: 30 | 31 | - name: 检查库更新情况 32 | id: checknew 33 | run: | 34 | curl https://api.github.com/repos/$REPO_URL/commits > index.json 35 | commits_time=$(cat index.json | grep "\"date\"" | sed -n "2p" | sed 's/ \"date\": \"//g' | sed 's/Z\"//g' | sed 's/T/ /g') 36 | commits_time8=$(date +"%Y-%m-%d %H:%M:%S" -d "@$(($(date +%s -d "$commits_time")+28800))") 37 | echo $(date +"%Y-%m-%d %H:%M:%S") $(date +%s) 38 | echo $commits_time $(date +%s -d "$commits_time") 39 | echo $(($(date +%s) - $(date +%s -d "$commits_time"))) 40 | if [ $(($(date +%s) - $(date +%s -d "$commits_time"))) -le 14400 ] 41 | then 42 | echo "CODE_TIME=$commits_time" >> $GITHUB_ENV 43 | echo "CODE_TIME8=$commits_time8" >> $GITHUB_ENV 44 | echo "status=success" >> $GITHUB_OUTPUT 45 | else 46 | echo "No Update" 47 | fi 48 | 49 | - name: 检查项目分支 50 | id: check 51 | if: steps.checknew.outputs.status == 'success' && !cancelled() 52 | uses: actions/checkout@v4 53 | 54 | - name: 编译环境 55 | id: environment 56 | if: steps.checknew.outputs.status == 'success' && !cancelled() 57 | env: 58 | DEBIAN_FRONTEND: noninteractive 59 | run: | 60 | sudo timedatectl set-timezone "Asia/Shanghai" 61 | sudo mkdir -p /workdir 62 | sudo chown $USER:$GROUPS /workdir 63 | echo "FILE_TIME=$(date "+%Y%m%d-%H%M")" >> $GITHUB_ENV 64 | echo "FILE_DATE=$(date "+%Y%m%d")" >> $GITHUB_ENV 65 | echo "FILE_MONTH=$(date "+%Y%m")" >> $GITHUB_ENV 66 | echo "TIME_HOUR=$(date "+%k")" >> $GITHUB_ENV 67 | echo "FILE_NAME=$GIT_NAME" >> $GITHUB_ENV 68 | 69 | - name: 下载固件源码 70 | id: download 71 | working-directory: /workdir 72 | if: steps.checknew.outputs.status == 'success' && !cancelled() 73 | run: | 74 | df -hT $PWD 75 | git clone $GITHUB_URL/$REPO_URL 76 | ln -sf /workdir/Momentum-Firmware $GITHUB_WORKSPACE/Flipper 77 | echo "status=success" >> $GITHUB_OUTPUT 78 | 79 | - name: 默认配置 80 | id: setting 81 | if: steps.download.outputs.status == 'success' && !cancelled() 82 | run: | 83 | sed -i 's/power_limit = 12/power_limit = 12/g' Flipper/targets/f7/furi_hal/furi_hal_region.c 84 | #sed -i 's/false/true/g' Flipper/applications/main/subghz/resources/subghz/assets/extend_range.txt 85 | #cp ./files/setting_user.txt Flipper/applications/main/subghz/resources/subghz/assets/ 86 | #sed -i 's/430000000/430000000,430500000/g' Flipper/lib/subghz/subghz_setting.c 87 | sed -i 's/431500000/431500000,432800000/g' Flipper/lib/subghz/subghz_setting.c 88 | #sed -i 's/430000000/430000000,430500000/g' Flipper/applications/main/subghz/views/subghz_frequency_analyzer.c 89 | sed -i 's/431500000/431500000,432800000/g' Flipper/applications/main/subghz/views/subghz_frequency_analyzer.c 90 | echo "status=success" >> $GITHUB_OUTPUT 91 | 92 | - name: 清理Anim 93 | id: clean 94 | if: steps.setting.outputs.status == 'success' && github.event.inputs.anim != 'Anim' && !cancelled() 95 | run: | 96 | shopt -s extglob 97 | rm -rf Flipper/assets/dolphin/external/* 98 | cp -r ./files/dolphin/. Flipper/assets/dolphin/external 99 | echo "FILE_NAME=$GIT_NAME-NoAnim" >> $GITHUB_ENV 100 | 101 | - name: 编译固件 102 | id: compile 103 | if: steps.setting.outputs.status == 'success' && !cancelled() 104 | run: | 105 | cd Flipper/ 106 | ./fbt updater_package 107 | echo "status=success" >> $GITHUB_OUTPUT 108 | 109 | - name: 检查磁盘使用情况 110 | if: steps.compile.outputs.status == 'success' && !cancelled() 111 | run: df -hT 112 | 113 | - name: 组织文件 114 | id: organize 115 | if: steps.compile.outputs.status == 'success' && !cancelled() 116 | run: | 117 | cd Flipper/dist/f7-C/ 118 | rm -rf *.tgz 119 | mv f7-update-* "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 120 | tar -czf "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}.tgz" "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 121 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 122 | echo "status=success" >> $GITHUB_OUTPUT 123 | 124 | - name: 上传固件目录 125 | uses: actions/upload-artifact@main 126 | if: steps.organize.outputs.status == 'success' && !cancelled() 127 | with: 128 | name: ${{ env.FILE_NAME }}-${{ env.FILE_TIME }} 129 | path: ${{ env.FIRMWARE }} 130 | 131 | - name: 上传Release 132 | id: release 133 | if: steps.organize.outputs.status == 'success' && !cancelled() 134 | uses: ncipollo/release-action@v1 135 | with: 136 | name: ${{ env.FILE_DATE }}_${{ env.GIT_NAME }} 137 | allowUpdates: true 138 | tag: ${{ env.FILE_DATE }}-${{ env.GIT_NAME }} 139 | commit: main 140 | token: ${{ secrets.GITHUB_TOKEN }} 141 | body: | 142 | #### ${{ env.GIT_NAME }} 固件更新: 143 | - 源码仓库:[${{ env.REPO_URL }}](${{ env.GITHUB_URL }}/${{ env.REPO_URL }}) 144 | - 北京时间:${{ env.CODE_TIME8 }} 145 | - UTC时间:${{ env.CODE_TIME }} 146 | artifacts: ${{ env.FIRMWARE }}/*.tgz 147 | 148 | - name: 删除旧的releases和workflows runs 149 | uses: ophub/delete-releases-workflows@main 150 | if: steps.release.outputs.status == 'success' && !cancelled() 151 | with: 152 | delete_releases: true 153 | delete_tags: true 154 | releases_keep_latest: 3000 155 | delete_workflows: true 156 | workflows_keep_day: 365 157 | gh_token: ${{ secrets.GH_TOKEN }} 158 | -------------------------------------------------------------------------------- /.github/workflows/Momentum.yml: -------------------------------------------------------------------------------- 1 | name: Build Momentum 2 | 3 | on: 4 | repository_dispatch: 5 | workflow_dispatch: 6 | inputs: 7 | anim: 8 | required: false 9 | default: 'NoAnim' 10 | type: choice 11 | description: Need Anim ? 12 | options: 13 | - 'NoAnim' 14 | - 'Anim' 15 | schedule: 16 | - cron: '35 3-23/4 * * ?' 17 | 18 | env: 19 | GITHUB_URL: https://github.com/ 20 | REPO_URL: Next-Flip/Momentum-Firmware 21 | GIT_NAME: Momentum 22 | 23 | permissions: 24 | contents: write 25 | 26 | jobs: 27 | build: 28 | runs-on: ubuntu-latest 29 | steps: 30 | 31 | - name: 检查库更新情况 32 | id: checknew 33 | env: 34 | RUNWAY: ${{ github.event_name == 'workflow_dispatch' && 864000 || 0 }} 35 | run: | 36 | curl https://api.github.com/repos/$REPO_URL/commits > index.json 37 | commits_time=$(cat index.json | grep "\"date\"" | sed -n "2p" | sed 's/ \"date\": \"//g' | sed 's/Z\"//g' | sed 's/T/ /g') 38 | commits_time8=$(date +"%Y-%m-%d %H:%M:%S" -d "@$(($(date +%s -d "$commits_time")+28800))") 39 | echo $(date +"%Y-%m-%d %H:%M:%S") $(date +%s) 40 | echo $commits_time $(date +%s -d "$commits_time") 41 | echo $(($(date +%s) - $(date +%s -d "$commits_time"))) 42 | if [ $(($(date +%s) - $(date +%s -d "$commits_time") - RUNWAY)) -le 14400 ] 43 | then 44 | echo "CODE_TIME=$commits_time" >> $GITHUB_ENV 45 | echo "CODE_TIME8=$commits_time8" >> $GITHUB_ENV 46 | echo "status=success" >> $GITHUB_OUTPUT 47 | else 48 | echo "No Update" 49 | fi 50 | 51 | - name: 检查项目分支 52 | id: check 53 | if: steps.checknew.outputs.status == 'success' && !cancelled() 54 | uses: actions/checkout@v4 55 | 56 | - name: 编译环境 57 | id: environment 58 | if: steps.checknew.outputs.status == 'success' && !cancelled() 59 | env: 60 | DEBIAN_FRONTEND: noninteractive 61 | run: | 62 | sudo timedatectl set-timezone "Asia/Shanghai" 63 | sudo mkdir -p /workdir 64 | sudo chown $USER:$GROUPS /workdir 65 | echo "FILE_TIME=$(date "+%Y%m%d-%H%M")" >> $GITHUB_ENV 66 | echo "FILE_DATE=$(date "+%Y%m%d")" >> $GITHUB_ENV 67 | echo "FILE_MONTH=$(date "+%Y%m")" >> $GITHUB_ENV 68 | echo "TIME_HOUR=$(date "+%k")" >> $GITHUB_ENV 69 | echo "FILE_NAME=$GIT_NAME" >> $GITHUB_ENV 70 | 71 | - name: 下载固件源码 72 | id: download 73 | working-directory: /workdir 74 | if: steps.checknew.outputs.status == 'success' && !cancelled() 75 | run: | 76 | df -hT $PWD 77 | git clone $GITHUB_URL/$REPO_URL 78 | ln -sf /workdir/Momentum-Firmware $GITHUB_WORKSPACE/Flipper 79 | echo "status=success" >> $GITHUB_OUTPUT 80 | 81 | - name: 默认配置 82 | id: setting 83 | if: steps.download.outputs.status == 'success' && !cancelled() 84 | run: | 85 | sed -i 's/power_limit = 12/power_limit = 12/g' Flipper/targets/f7/furi_hal/furi_hal_region.c 86 | #sed -i 's/false/true/g' Flipper/applications/main/subghz/resources/subghz/assets/extend_range.txt 87 | #cp ./files/setting_user.txt Flipper/applications/main/subghz/resources/subghz/assets/ 88 | #sed -i 's/430000000/430000000,430500000/g' Flipper/lib/subghz/subghz_setting.c 89 | sed -i 's/431500000/431500000,432800000/g' Flipper/lib/subghz/subghz_setting.c 90 | #sed -i 's/430000000/430000000,430500000/g' Flipper/applications/main/subghz/views/subghz_frequency_analyzer.c 91 | sed -i 's/431500000/431500000,432800000/g' Flipper/applications/main/subghz/views/subghz_frequency_analyzer.c 92 | echo "status=success" >> $GITHUB_OUTPUT 93 | 94 | - name: 清理Anim 95 | id: clean 96 | if: steps.setting.outputs.status == 'success' && github.event.inputs.anim != 'Anim' && !cancelled() 97 | run: | 98 | shopt -s extglob 99 | rm -rf Flipper/assets/dolphin/external/* 100 | cp -r ./files/dolphin/. Flipper/assets/dolphin/external 101 | echo "FILE_NAME=$GIT_NAME-NoAnim" >> $GITHUB_ENV 102 | 103 | - name: 编译固件 104 | id: compile 105 | if: steps.setting.outputs.status == 'success' && !cancelled() 106 | run: | 107 | cd Flipper/ 108 | ./fbt updater_package 109 | echo "status=success" >> $GITHUB_OUTPUT 110 | 111 | - name: 检查磁盘使用情况 112 | if: steps.compile.outputs.status == 'success' && !cancelled() 113 | run: df -hT 114 | 115 | - name: 组织文件 116 | id: organize 117 | if: steps.compile.outputs.status == 'success' && !cancelled() 118 | run: | 119 | cd Flipper/dist/f7-C/ 120 | rm -rf *.tgz *.zip 121 | mv f7-update-* "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 122 | tar -czf "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}.tgz" "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 123 | rm -rf ${{ env.FILE_NAME }}-${{ env.FILE_TIME }} 124 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 125 | echo "status=success" >> $GITHUB_OUTPUT 126 | 127 | - name: 上传固件目录 128 | uses: actions/upload-artifact@main 129 | if: steps.organize.outputs.status == 'success' && !cancelled() 130 | with: 131 | name: ${{ env.FILE_NAME }}-${{ env.FILE_TIME }} 132 | path: ${{ env.FIRMWARE }} 133 | 134 | - name: 上传Release 135 | id: release 136 | if: steps.organize.outputs.status == 'success' && !cancelled() 137 | uses: ncipollo/release-action@v1 138 | with: 139 | name: ${{ env.FILE_DATE }}_${{ env.GIT_NAME }} 140 | allowUpdates: true 141 | tag: ${{ env.FILE_DATE }}-${{ env.GIT_NAME }} 142 | commit: main 143 | token: ${{ secrets.GITHUB_TOKEN }} 144 | body: | 145 | #### ${{ env.GIT_NAME }} 固件更新: 146 | - 源码仓库:[${{ env.REPO_URL }}](${{ env.GITHUB_URL }}/${{ env.REPO_URL }}) 147 | - 北京时间:${{ env.CODE_TIME8 }} 148 | - UTC时间:${{ env.CODE_TIME }} 149 | artifacts: ${{ env.FIRMWARE }}/*.tgz 150 | 151 | - name: 删除旧的releases和workflows runs 152 | uses: ophub/delete-releases-workflows@main 153 | if: steps.organize.outputs.status == 'success' && !cancelled() 154 | with: 155 | delete_releases: true 156 | delete_tags: true 157 | releases_keep_latest: 3000 158 | delete_workflows: true 159 | workflows_keep_day: 365 160 | gh_token: ${{ secrets.GH_TOKEN }} 161 | -------------------------------------------------------------------------------- /tools/create_sub.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 https://gist.github.com/jinschoi/f39dbd82e4e3d99d32ab6a9b8dfc2f55 2 | 3 | from typing import Iterable, Union, Any 4 | 5 | # freq: frequency in Hz 6 | # zerolen: length of space bit in μs 7 | # onelen: length of mark bit in μs 8 | # repeats: number of times to repeat sequence 9 | # pause: time to wait in μs between sequences 10 | # bits: string of ones and zeros to represent sequence 11 | 12 | def gen_sub(freq, zerolen, onelen, repeats, pause, bits): 13 | res = f"""Filetype: Flipper SubGhz RAW File 14 | Version: 1 15 | Frequency: {freq} 16 | Preset: FuriHalSubGhzPresetOok650Async 17 | Protocol: RAW 18 | """ 19 | if pause == 0: 20 | # Pause must be non-zero. 21 | pause = zerolen 22 | 23 | data = [] 24 | prevbit = None 25 | prevbitlen = 0 26 | for bit in bits: 27 | if prevbit and prevbit != bit: 28 | data.append(prevbitlen) 29 | prevbitlen = 0 30 | 31 | if bit == '1': 32 | prevbitlen += onelen 33 | else: 34 | prevbitlen -= zerolen 35 | 36 | prevbit = bit 37 | 38 | if prevbit == '1': 39 | data.append(prevbitlen) 40 | data.append(-pause) 41 | else: 42 | data.append(prevbitlen - pause) 43 | 44 | datalines = [] 45 | for i in range(0, len(data), 512): 46 | batch = [str(n) for n in data[i:i+512]] 47 | datalines.append(f'RAW_Data: {" ".join(batch)}') 48 | res += '\n'.join(datalines) 49 | 50 | return res 51 | 52 | # From Wikipedia 53 | def de_bruijn(k: Union[Iterable[Any], int], n: int) -> str: 54 | """de Bruijn sequence for alphabet k 55 | and subsequences of length n. 56 | """ 57 | # Two kinds of alphabet input: an integer expands 58 | # to a list of integers as the alphabet.. 59 | if isinstance(k, int): 60 | alphabet = list(map(str, range(k))) 61 | else: 62 | # While any sort of list becomes used as it is 63 | alphabet = k 64 | k = len(k) 65 | 66 | a = [0] * k * n 67 | sequence = [] 68 | 69 | def db(t, p): 70 | if t > n: 71 | if n % p == 0: 72 | sequence.extend(a[1 : p + 1]) 73 | else: 74 | a[t] = a[t - p] 75 | db(t + 1, p) 76 | for j in range(a[t - p] + 1, k): 77 | a[t] = j 78 | db(t + 1, t) 79 | 80 | db(1, 1) 81 | return "".join(alphabet[i] for i in sequence) 82 | 83 | def debruijn(freq, zerolen, onelen, encoding, bitlen, alphabet=2): 84 | def encode(bit): 85 | return encoding[bit] 86 | return gen_sub(freq, zerolen, onelen, 1, 0, ''.join(encode(b) for b in de_bruijn(alphabet, bitlen))) 87 | 88 | TOUCH_TUNES_COMMANDS = {'On_Off': 0x78, 89 | 'Pause': 0x32, #0xB3, 90 | 'P1': 0x70, #0xF1, 91 | 'P2_Edit_Queue': 0x60, 92 | 'P3_Skip': 0xCA, 93 | 'F1_Restart': 0x20, 94 | 'F2_Key': 0xA0, 95 | 'F3_Mic_A_Mute': 0x30, 96 | 'F4_Mic_B_Mute': 0xB0, 97 | 'Mic_Vol_Plus_Up_Arrow': 0xF2, 98 | 'Mic_Vol_Minus_Down_Arrow': 0x80, 99 | 'A_Left_Arrow': 0x84, 100 | 'B_Right_Arrow': 0xC4, 101 | 'OK': 0x44, #0xDD, 102 | 'Music_Vol_Zone_1Up': 0xD0, #0xF4, 103 | 'Music_Vol_Zone_1Down': 0x50, 104 | 'Music_Vol_Zone_2Up': 0x90, #0xF6, 105 | 'Music_Vol_Zone_2Down': 0x10, 106 | 'Music_Vol_Zone_3Up': 0xC0, #0xFC, 107 | 'Music_Vol_Zone_3Down': 0x40, 108 | '1': 0xF0, 109 | '2': 0x08, 110 | '3': 0x88, 111 | '4': 0x48, 112 | '5': 0xC8, 113 | '6': 0x28, 114 | '7': 0xA8, 115 | '8': 0x68, 116 | '9': 0xE8, 117 | '0': 0x98, 118 | 'Music_Karaoke(*)': 0x18, 119 | 'Lock_Queue(#)': 0x58} 120 | 121 | def encode_touchtunes(command, pin=0x00): 122 | #Syncword 123 | frame = 0x5D 124 | 125 | #PIN 126 | for bit in range(8): 127 | frame <<= 1 128 | if pin&(1< index.json 37 | commits_time=$(cat index.json | grep "\"date\"" | sed -n "2p" | sed 's/ \"date\": \"//g' | sed 's/Z\"//g' | sed 's/T/ /g') 38 | commits_time8=$(date +"%Y-%m-%d %H:%M:%S" -d "@$(($(date +%s -d "$commits_time")+28800))") 39 | echo $(date +"%Y-%m-%d %H:%M:%S") $(date +%s) 40 | echo $commits_time $(date +%s -d "$commits_time") 41 | echo $(($(date +%s) - $(date +%s -d "$commits_time"))) 42 | if [ $(($(date +%s) - $(date +%s -d "$commits_time") - RUNWAY)) -le 14400 ] 43 | then 44 | echo "CODE_TIME=$commits_time" >> $GITHUB_ENV 45 | echo "CODE_TIME8=$commits_time8" >> $GITHUB_ENV 46 | echo "status=success" >> $GITHUB_OUTPUT 47 | else 48 | echo "No Update" 49 | fi 50 | 51 | - name: 检查项目分支 52 | id: check 53 | if: steps.checknew.outputs.status == 'success' && !cancelled() 54 | uses: actions/checkout@v4 55 | 56 | - name: 编译环境 57 | id: environment 58 | if: steps.checknew.outputs.status == 'success' && !cancelled() 59 | env: 60 | DEBIAN_FRONTEND: noninteractive 61 | run: | 62 | sudo timedatectl set-timezone "Asia/Shanghai" 63 | sudo mkdir -p /workdir 64 | sudo chown $USER:$GROUPS /workdir 65 | echo "FILE_TIME=$(date "+%Y%m%d-%H%M")" >> $GITHUB_ENV 66 | echo "FILE_DATE=$(date "+%Y%m%d")" >> $GITHUB_ENV 67 | echo "FILE_MONTH=$(date "+%Y%m")" >> $GITHUB_ENV 68 | echo "TIME_HOUR=$(date "+%k")" >> $GITHUB_ENV 69 | echo "FILE_NAME=$GIT_NAME" >> $GITHUB_ENV 70 | 71 | - name: 下载固件源码 72 | id: download 73 | working-directory: /workdir 74 | if: steps.checknew.outputs.status == 'success' && !cancelled() 75 | run: | 76 | df -hT $PWD 77 | git clone $GITHUB_URL/$REPO_URL 78 | ln -sf /workdir/flipperzero-firmware-wPlugins $GITHUB_WORKSPACE/Flipper 79 | echo "status=success" >> $GITHUB_OUTPUT 80 | 81 | - name: 默认配置 82 | id: setting 83 | if: steps.download.outputs.status == 'success' && !cancelled() 84 | run: | 85 | sed -i 's/power_limit = 12/power_limit = 12/g' Flipper/targets/f7/furi_hal/furi_hal_region.c 86 | sed -i 's/false/true/g' Flipper/applications/main/subghz/resources/subghz/assets/extend_range.txt 87 | cp ./files/setting_user.txt Flipper/applications/main/subghz/resources/subghz/assets/ 88 | #sed -i 's/430000000/430000000,430500000/g' Flipper/lib/subghz/subghz_setting.c 89 | sed -i 's/431500000/431500000,432800000/g' Flipper/lib/subghz/subghz_setting.c 90 | sed -i 's/430000000/430000000,430500000/g' Flipper/applications/main/subghz/views/subghz_frequency_analyzer.c 91 | sed -i 's/431500000/431500000,432800000/g' Flipper/applications/main/subghz/views/subghz_frequency_analyzer.c 92 | echo "status=success" >> $GITHUB_OUTPUT 93 | 94 | - name: 清理Anim 95 | id: clean 96 | if: steps.setting.outputs.status == 'success' && github.event.inputs.anim != 'Anim' && !cancelled() 97 | run: | 98 | shopt -s extglob 99 | cp ./files/meta.txt Flipper/assets/dolphin/internal/wrenchathome_F0Pattern_128x64/ 100 | rm -rf Flipper/assets/dolphin/internal/wrenchathome_F0Pattern_128x64/*.png 101 | cp ./files/frame_0.png Flipper/assets/dolphin/internal/wrenchathome_F0Pattern_128x64/ 102 | rm -rf Flipper/assets/dolphin/external/* 103 | rm -rf Flipper/assets/resources/dolphin/* 104 | cp ./files/manifest.txt Flipper/assets/dolphin/external/ 105 | echo "FILE_NAME=$GIT_NAME-NoAnim" >> $GITHUB_ENV 106 | 107 | - name: 编译固件 108 | id: compile 109 | if: steps.setting.outputs.status == 'success' && !cancelled() 110 | run: | 111 | cd Flipper/ 112 | ./fbt updater_package 113 | echo "status=success" >> $GITHUB_OUTPUT 114 | 115 | - name: 检查磁盘使用情况 116 | if: steps.compile.outputs.status == 'success' && !cancelled() 117 | run: df -hT 118 | 119 | - name: 组织文件 120 | id: organize 121 | if: steps.compile.outputs.status == 'success' && !cancelled() 122 | run: | 123 | cd Flipper/dist/f7-C/ 124 | rm -rf *.tgz *.zip 125 | mv f7-update-* "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 126 | tar -czf "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}.tgz" "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 127 | rm -rf ${{ env.FILE_NAME }}-${{ env.FILE_TIME }} 128 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 129 | echo "status=success" >> $GITHUB_OUTPUT 130 | 131 | - name: 上传固件目录 132 | uses: actions/upload-artifact@main 133 | if: steps.organize.outputs.status == 'success' && !cancelled() 134 | with: 135 | name: ${{ env.FILE_NAME }}-${{ env.FILE_TIME }} 136 | path: ${{ env.FIRMWARE }} 137 | 138 | - name: 上传Release 139 | id: release 140 | if: steps.organize.outputs.status == 'success' && !cancelled() 141 | uses: ncipollo/release-action@v1 142 | with: 143 | name: ${{ env.FILE_DATE }}_${{ env.GIT_NAME }} 144 | allowUpdates: true 145 | tag: ${{ env.FILE_DATE }}-${{ env.GIT_NAME }} 146 | commit: main 147 | token: ${{ secrets.GITHUB_TOKEN }} 148 | body: | 149 | #### ${{ env.GIT_NAME }} 固件更新: 150 | - 源码仓库:[${{ env.REPO_URL }}](${{ env.GITHUB_URL }}/${{ env.REPO_URL }}) 151 | - 北京时间:${{ env.CODE_TIME8 }} 152 | - UTC时间:${{ env.CODE_TIME }} 153 | artifacts: ${{ env.FIRMWARE }}/*.tgz 154 | 155 | - name: 删除旧的releases和workflows runs 156 | uses: ophub/delete-releases-workflows@main 157 | if: steps.organize.outputs.status == 'success' && !cancelled() 158 | with: 159 | delete_releases: true 160 | delete_tags: true 161 | releases_keep_latest: 3000 162 | delete_workflows: true 163 | workflows_keep_day: 365 164 | gh_token: ${{ secrets.GH_TOKEN }} 165 | -------------------------------------------------------------------------------- /.github/workflows/Xtreme.yml: -------------------------------------------------------------------------------- 1 | # Build Flipper Zero Firmware using GitHub Actions 2 | name: Build Xtreme 3 | 4 | on: 5 | repository_dispatch: 6 | workflow_dispatch: 7 | inputs: 8 | anim: 9 | required: false 10 | default: 'NoAnim' 11 | type: choice 12 | description: Need Anim ? 13 | options: 14 | - 'NoAnim' 15 | - 'Anim' 16 | #schedule: 17 | # - cron: '35 3-23/4 * * ?' 18 | 19 | env: 20 | GITHUB_URL: https://github.com/ 21 | REPO_URL: Flipper-XFW/Xtreme-Firmware 22 | GIT_NAME: Xtreme 23 | 24 | permissions: 25 | contents: write 26 | 27 | jobs: 28 | build: 29 | runs-on: ubuntu-latest 30 | steps: 31 | 32 | - name: 检查库更新情况 33 | id: checknew 34 | run: | 35 | curl https://api.github.com/repos/$REPO_URL/commits > index.json 36 | commits_time=$(cat index.json | grep "date" | sed -n "2p" | sed 's/ \"date\": \"//g' | sed 's/\"//g' | sed 's/T/ /g' | sed 's/Z//g') 37 | commits_time8=$(date +"%Y-%m-%d %H:%M:%S" -d "@$(($(date +%s -d "$commits_time")+28800))") 38 | echo $(date +"%Y-%m-%d %H:%M:%S") $(date +%s) 39 | echo $commits_time $(date +%s -d "$commits_time") 40 | echo $(($(date +%s) - $(date +%s -d "$commits_time"))) 41 | if [ $(($(date +%s) - $(date +%s -d "$commits_time"))) -le 14400 ] 42 | then 43 | echo "CODE_TIME=$commits_time" >> $GITHUB_ENV 44 | echo "CODE_TIME8=$commits_time8" >> $GITHUB_ENV 45 | echo "status=success" >> $GITHUB_OUTPUT 46 | else 47 | echo "No Update" 48 | fi 49 | 50 | - name: 检查项目分支 51 | id: check 52 | if: steps.checknew.outputs.status == 'success' && !cancelled() 53 | uses: actions/checkout@v4 54 | 55 | - name: 编译环境 56 | id: environment 57 | if: steps.checknew.outputs.status == 'success' && !cancelled() 58 | env: 59 | DEBIAN_FRONTEND: noninteractive 60 | run: | 61 | sudo timedatectl set-timezone "Asia/Shanghai" 62 | sudo mkdir -p /workdir 63 | sudo chown $USER:$GROUPS /workdir 64 | echo "FILE_TIME=$(date "+%Y%m%d-%H%M")" >> $GITHUB_ENV 65 | echo "FILE_DATE=$(date "+%Y%m%d")" >> $GITHUB_ENV 66 | echo "FILE_MONTH=$(date "+%Y%m")" >> $GITHUB_ENV 67 | echo "TIME_HOUR=$(date "+%k")" >> $GITHUB_ENV 68 | echo "FILE_NAME=$GIT_NAME" >> $GITHUB_ENV 69 | 70 | - name: 下载固件源码 71 | id: download 72 | if: steps.checknew.outputs.status == 'success' && !cancelled() 73 | working-directory: /workdir 74 | run: | 75 | df -hT $PWD 76 | git clone --recursive $GITHUB_URL/$REPO_URL 77 | ln -sf /workdir/Xtreme-Firmware $GITHUB_WORKSPACE/Flipper 78 | echo "status=success" >> $GITHUB_OUTPUT 79 | 80 | - name: 默认配置 81 | id: setting 82 | if: steps.download.outputs.status == 'success' && !cancelled() 83 | run: | 84 | sed -i 's/power_limit = 12/power_limit = 12/g' Flipper/targets/f7/furi_hal/furi_hal_region.c 85 | sed -i 's/430000000/430000000,430500000/g' Flipper/lib/subghz/subghz_setting.c 86 | sed -i 's/431500000/431500000,432800000/g' Flipper/lib/subghz/subghz_setting.c 87 | sed -i 's/430000000/430000000,430500000/g' Flipper/applications/main/subghz/views/subghz_frequency_analyzer.c 88 | sed -i 's/431500000/431500000,432800000/g' Flipper/applications/main/subghz/views/subghz_frequency_analyzer.c 89 | echo "status=success" >> $GITHUB_OUTPUT 90 | 91 | - name: 清理Anim 92 | if: steps.setting.outputs.status == 'success' && github.event.inputs.anim != 'Anim' && !cancelled() 93 | id: clean 94 | run: | 95 | shopt -s extglob 96 | rm -rf Flipper/assets/packs/WatchDogs/Icons 97 | rm -rf Flipper/assets/packs/WatchDogs/Anims/!("manifest.txt") 98 | sed -i '1,2!d' Flipper/assets/packs/WatchDogs/Anims/manifest.txt 99 | rm -rf Flipper/assets/dolphin/external/!("L1_Furippa1_128x64"|"manifest.txt") 100 | sed -i '1,9!d' Flipper/assets/dolphin/external/manifest.txt 101 | sed -i 's/L1_Waves_128x50/L1_Furippa1_128x64/g' Flipper/assets/dolphin/external/manifest.txt 102 | rm -rf Flipper/assets/dolphin/external/L1_Furippa1_128x64/* 103 | cp ./files/meta.txt Flipper/assets/dolphin/external/L1_Furippa1_128x64/ 104 | cp ./files/frame_0.png Flipper/assets/dolphin/external/L1_Furippa1_128x64/ 105 | echo "FILE_NAME=$GIT_NAME-NoAnim" >> $GITHUB_ENV 106 | 107 | - name: 清理SD 108 | if: steps.setting.outputs.status == 'success' && !cancelled() 109 | id: cleanSD 110 | run: | 111 | rm -rf Flipper/assets/resources/wav_player 112 | rm -rf Flipper/assets/resources/music_player 113 | echo "status=success" >> $GITHUB_OUTPUT 114 | 115 | - name: 编译固件 116 | id: compile 117 | if: steps.cleanSD.outputs.status == 'success' && !cancelled() 118 | run: | 119 | cd Flipper/ 120 | ./fbt updater_package 121 | echo "FILE_TIME=$(date "+%Y%m%d-%H%M")" >> $GITHUB_ENV 122 | echo "FILE_DATE=$(date "+%Y%m%d")" >> $GITHUB_ENV 123 | echo "GIT_NAME=$GIT_NAME" >> $GITHUB_ENV 124 | echo "status=success" >> $GITHUB_OUTPUT 125 | 126 | - name: 检查磁盘使用情况 127 | if: steps.compile.outputs.status == 'success' && !cancelled() 128 | run: df -hT 129 | 130 | - name: 组织文件 131 | id: organize 132 | if: steps.compile.outputs.status == 'success' && !cancelled() 133 | run: | 134 | cd Flipper/dist/f7-C/ 135 | rm -rf *.tgz 136 | mv f7-update-* "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 137 | tar --delete asset_packs -vf ${{ env.FILE_NAME }}-${{ env.FILE_TIME }}/resources.tar 138 | tar -czf "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}.tgz" "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 139 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 140 | echo "status=success" >> $GITHUB_OUTPUT 141 | 142 | - name: 上传固件目录 143 | uses: actions/upload-artifact@main 144 | if: steps.organize.outputs.status == 'success' && !cancelled() 145 | with: 146 | name: ${{ env.GIT_NAME }}-${{ env.FILE_TIME }} 147 | path: ${{ env.FIRMWARE }} 148 | 149 | - name: 上传固件目录 150 | uses: actions/upload-artifact@main 151 | if: steps.organize.outputs.status == 'success' && !cancelled() 152 | with: 153 | name: ${{ env.FILE_NAME }}-${{ env.FILE_TIME }} 154 | path: ${{ env.FIRMWARE }} 155 | 156 | - name: 上传Release 157 | id: release 158 | if: steps.organize.outputs.status == 'success' && !cancelled() 159 | uses: ncipollo/release-action@v1 160 | with: 161 | name: ${{ env.FILE_DATE }}_${{ env.GIT_NAME }} 162 | allowUpdates: true 163 | tag: ${{ env.FILE_DATE }}-${{ env.GIT_NAME }} 164 | commit: main 165 | token: ${{ secrets.GITHUB_TOKEN }} 166 | body: | 167 | #### ${{ env.GIT_NAME }} 固件更新: 168 | - 源码仓库:[${{ env.REPO_URL }}](${{ env.GITHUB_URL }}/${{ env.REPO_URL }}) 169 | - 北京时间:${{ env.CODE_TIME8 }} 170 | - UTC时间:${{ env.CODE_TIME }} 171 | artifacts: ${{ env.FIRMWARE }}/*.tgz 172 | 173 | - name: 删除旧的releases和workflows runs 174 | uses: ophub/delete-releases-workflows@main 175 | if: steps.release.outputs.status == 'success' && !cancelled() 176 | with: 177 | delete_releases: true 178 | delete_tags: true 179 | releases_keep_latest: 3000 180 | delete_workflows: true 181 | workflows_keep_day: 365 182 | gh_token: ${{ secrets.GH_TOKEN }} 183 | -------------------------------------------------------------------------------- /.github/workflows/Unleashed.yml: -------------------------------------------------------------------------------- 1 | name: Build Unleashed 2 | 3 | on: 4 | repository_dispatch: 5 | workflow_dispatch: 6 | inputs: 7 | anim: 8 | required: false 9 | default: 'NoAnim' 10 | type: choice 11 | description: Need Anim ? 12 | options: 13 | - 'NoAnim' 14 | - 'Anim' 15 | schedule: 16 | - cron: '35 3-23/4 * * ?' 17 | 18 | env: 19 | GITHUB_URL: https://github.com/ 20 | REPO_URL: DarkFlippers/unleashed-firmware 21 | GIT_NAME: Unleashed 22 | 23 | permissions: 24 | contents: write 25 | 26 | jobs: 27 | build: 28 | runs-on: ubuntu-latest 29 | steps: 30 | 31 | - name: 检查库更新情况 32 | id: checknew 33 | env: 34 | RUNWAY: ${{ github.event_name == 'workflow_dispatch' && 864000 || 0 }} 35 | run: | 36 | curl https://api.github.com/repos/$REPO_URL/commits > index.json 37 | commits_time=$(cat index.json | grep "\"date\"" | sed -n "2p" | sed 's/ \"date\": \"//g' | sed 's/\"//g' | sed 's/T/ /g' | sed 's/Z//g') 38 | commits_time8=$(date +"%Y-%m-%d %H:%M:%S" -d "@$(($(date +%s -d "$commits_time")+28800))") 39 | echo $(date +"%Y-%m-%d %H:%M:%S") $(date +%s) 40 | echo $commits_time $(date +%s -d "$commits_time") 41 | echo $(($(date +%s) - $(date +%s -d "$commits_time"))) 42 | if [ $(($(date +%s) - $(date +%s -d "$commits_time") - RUNWAY)) -le 14400 ] 43 | then 44 | echo "CODE_TIME=$commits_time" >> $GITHUB_ENV 45 | echo "CODE_TIME8=$commits_time8" >> $GITHUB_ENV 46 | echo "status=success" >> $GITHUB_OUTPUT 47 | else 48 | echo "No Update" 49 | fi 50 | 51 | - name: 检查项目分支 52 | id: check 53 | if: steps.checknew.outputs.status == 'success' && !cancelled() 54 | uses: actions/checkout@v4 55 | 56 | - name: 编译环境 57 | id: environment 58 | if: steps.checknew.outputs.status == 'success' && !cancelled() 59 | env: 60 | DEBIAN_FRONTEND: noninteractive 61 | run: | 62 | sudo timedatectl set-timezone "Asia/Shanghai" 63 | sudo mkdir -p /workdir 64 | sudo chown $USER:$GROUPS /workdir 65 | echo "FILE_TIME=$(date "+%Y%m%d-%H%M")" >> $GITHUB_ENV 66 | echo "FILE_DATE=$(date "+%Y%m%d")" >> $GITHUB_ENV 67 | echo "FILE_MONTH=$(date "+%Y%m")" >> $GITHUB_ENV 68 | echo "TIME_HOUR=$(date "+%k")" >> $GITHUB_ENV 69 | echo "FILE_NAME=$GIT_NAME" >> $GITHUB_ENV 70 | 71 | - name: 下载固件源码 72 | id: download 73 | if: steps.checknew.outputs.status == 'success' && !cancelled() 74 | working-directory: /workdir 75 | run: | 76 | df -hT $PWD 77 | git clone --recursive $GITHUB_URL/$REPO_URL 78 | ln -sf /workdir/unleashed-firmware $GITHUB_WORKSPACE/Flipper 79 | echo "status=success" >> $GITHUB_OUTPUT 80 | 81 | - name: 默认配置 82 | id: setting 83 | if: steps.download.outputs.status == 'success' && !cancelled() 84 | run: | 85 | sed -i 's/false/true/g' Flipper/applications/main/subghz/resources/subghz/assets/dangerous_settings 86 | cp ./files/setting_user.txt Flipper/applications/main/subghz/resources/subghz/assets/ 87 | sed -i 's/430000000/430000000,430500000/g' Flipper/lib/subghz/subghz_setting.c 88 | sed -i 's/431500000/431500000,432800000/g' Flipper/lib/subghz/subghz_setting.c 89 | sed -i 's/430000000/430000000,430500000/g' Flipper/applications/main/subghz/views/subghz_frequency_analyzer.c 90 | sed -i 's/431500000/431500000,432800000/g' Flipper/applications/main/subghz/views/subghz_frequency_analyzer.c 91 | echo "status=success" >> $GITHUB_OUTPUT 92 | 93 | - name: 清理Anim 94 | id: clean 95 | if: steps.setting.outputs.status == 'success' && github.event.inputs.anim != 'Anim' && !cancelled() 96 | run: | 97 | shopt -s extglob 98 | cp ./files/meta.txt Flipper/assets/dolphin/internal/L1_Tv_128x47/ 99 | rm Flipper/assets/dolphin/internal/L1_Tv_128x47/*.png 100 | cp ./files/frame_0.png Flipper/assets/dolphin/internal/L1_Tv_128x47/ 101 | rm -rf Flipper/assets/dolphin/external/!("manifest.txt") 102 | sed -i '1,2!d' Flipper/assets/dolphin/external/manifest.txt 103 | echo "FILE_NAME=$GIT_NAME-NoAnim" >> $GITHUB_ENV 104 | 105 | - name: 编译固件 106 | id: compile 107 | if: steps.setting.outputs.status == 'success' && !cancelled() 108 | run: | 109 | cd Flipper/ 110 | ./fbt COMPACT=1 DEBUG=0 updater_package 111 | #./fbt updater_package 112 | echo "status=success" >> $GITHUB_OUTPUT 113 | 114 | - name: 检查磁盘使用情况 115 | if: (!cancelled()) 116 | run: df -hT 117 | 118 | - name: 组织文件 119 | id: organize 120 | if: steps.compile.outputs.status == 'success' && !cancelled() 121 | run: | 122 | #cd Flipper/dist/f7-D/ 123 | cd Flipper/dist/f7-C/ 124 | #----------- 125 | #下载插件包文件 126 | wget -c https://github.com/xMasterX/all-the-plugins/releases/latest/download/all-the-apps-extra.tgz 127 | wget -c https://github.com/xMasterX/all-the-plugins/releases/latest/download/all-the-apps-base.tgz 128 | #解压插件包文件 129 | tar zxf all-the-apps-extra.tgz 130 | tar zxf all-the-apps-base.tgz 131 | #更改目录名称 132 | mv ./base_pack_build/artifacts-base ./base_pack_build/apps 133 | mv ./extra_pack_build/artifacts-extra ./extra_pack_build/apps 134 | #复制到上级目录 135 | cp -rf ./base_pack_build/* ./ 136 | rm -rf ./base_pack_build 137 | cp -rf ./extra_pack_build/* ./ 138 | rm -rf ./extra_pack_build 139 | ls 140 | #复制有用文件 141 | #mv flipper-z-f7-update-* "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 142 | mv f7-update-* "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 143 | #mkdir "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 144 | #清理无用文件 145 | rm -rf *.tgz 146 | rm -r *.zip 147 | rm -r ${{ env.FILE_NAME }}-${{ env.FILE_TIME }}/*.ths 148 | #追加apps和apps_data目录 149 | tar -rvf ${{ env.FILE_NAME }}-${{ env.FILE_TIME }}/resources.tar apps apps_data 150 | #压缩文件 151 | tar -czf "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}.tgz" "${{ env.FILE_NAME }}-${{ env.FILE_TIME }}" 152 | #清理文件夹 153 | rm -rf ${{ env.FILE_NAME }}-${{ env.FILE_TIME }} apps apps_data 154 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 155 | echo "status=success" >> $GITHUB_OUTPUT 156 | 157 | - name: 上传固件目录 158 | uses: actions/upload-artifact@main 159 | if: steps.organize.outputs.status == 'success' && !cancelled() 160 | with: 161 | name: ${{ env.FILE_NAME }}-${{ env.FILE_TIME }} 162 | path: ${{ env.FIRMWARE }} 163 | 164 | - name: 上传Release 165 | id: release 166 | if: steps.organize.outputs.status == 'success' && !cancelled() 167 | uses: ncipollo/release-action@v1 168 | with: 169 | name: ${{ env.FILE_DATE }}_${{ env.GIT_NAME }} 170 | allowUpdates: true 171 | tag: ${{ env.FILE_DATE }}-${{ env.GIT_NAME }} 172 | commit: main 173 | token: ${{ secrets.GITHUB_TOKEN }} 174 | body: | 175 | #### ${{ env.GIT_NAME }} 固件更新: 176 | - 源码仓库:[${{ env.REPO_URL }}](${{ env.GITHUB_URL }}/${{ env.REPO_URL }}) 177 | - 北京时间:${{ env.CODE_TIME8 }} 178 | - UTC时间:${{ env.CODE_TIME }} 179 | artifacts: ${{ env.FIRMWARE }}/*.tgz 180 | 181 | - name: 删除旧的releases和workflows runs 182 | uses: ophub/delete-releases-workflows@main 183 | if: steps.organize.outputs.status == 'success' && !cancelled() 184 | with: 185 | delete_releases: true 186 | delete_tags: true 187 | releases_keep_latest: 3000 188 | delete_workflows: true 189 | workflows_keep_day: 365 190 | gh_token: ${{ secrets.GH_TOKEN }} 191 | --------------------------------------------------------------------------------