Compare commits

...

2 Commits

11 changed files with 34 additions and 59 deletions

View File

@ -55,19 +55,19 @@ jobs:
# 先删除所有dSYM文件减少包的体积 # 先删除所有dSYM文件减少包的体积
sudo find /Users/runner/work/RibbonUI/Qt/6.5.3/macos/qml -name "*.dSYM" | xargs rm -r sudo find /Users/runner/work/RibbonUI/Qt/6.5.3/macos/qml -name "*.dSYM" | xargs rm -r
# 拷贝依赖 # 拷贝依赖
sudo macdeployqt /Users/runner/work/ProtocolParser/ProtocolParser/build/app_source/${targetName}.app -qmldir=. -verbose=1 -dmg sudo macdeployqt /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.zip name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.zip
path: /Users/runner/work/ProtocolParser/ProtocolParser/build/app_source/${{ env.targetName }}.dmg path: /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${{ env.targetName }}.dmg
- name: uploadRelease - name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /Users/runner/work/ProtocolParser/ProtocolParser/build/app_source/${{ env.targetName }}.dmg file: /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${{ env.targetName }}.dmg
asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_shared.dmg asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_shared.dmg
tag: ${{ github.ref }} tag: ${{ github.ref }}
overwrite: true overwrite: true

View File

@ -55,19 +55,19 @@ jobs:
# 先删除所有dSYM文件减少包的体积 # 先删除所有dSYM文件减少包的体积
sudo find /Users/runner/work/RibbonUI/Qt/6.5.3/macos/qml -name "*.dSYM" | xargs rm -r sudo find /Users/runner/work/RibbonUI/Qt/6.5.3/macos/qml -name "*.dSYM" | xargs rm -r
# 拷贝依赖 # 拷贝依赖
macdeployqt /Users/runner/work/ProtocolParser/ProtocolParser/build/app_source/${targetName}.app -qmldir=. -verbose=1 -dmg macdeployqt /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_static.zip name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_static.zip
path: /Users/runner/work/ProtocolParser/ProtocolParser/build/app_source/${{ env.targetName }}.dmg path: /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${{ env.targetName }}.dmg
- name: uploadRelease - name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /Users/runner/work/ProtocolParser/ProtocolParser/build/app_source/${{ env.targetName }}.dmg file: /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${{ env.targetName }}.dmg
asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.dmg asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.dmg
tag: ${{ github.ref }} tag: ${{ github.ref }}
overwrite: true overwrite: true

View File

@ -71,7 +71,7 @@ jobs:
# make sure Qt plugin finds QML sources so it can deploy the imported files # make sure Qt plugin finds QML sources so it can deploy the imported files
export QML_SOURCES_PATHS=./ export QML_SOURCES_PATHS=./
# 拷贝依赖 # 拷贝依赖
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/ProtocolParser/ProtocolParser/build/app_source/${targetName} --appdir /home/runner/work/ProtocolParser/ProtocolParser/build/app_source/ linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/ProtocolParser/ProtocolParser/build/app/release/${targetName} --appdir /home/runner/work/ProtocolParser/ProtocolParser/build/app/release/
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.AppImage mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.AppImage
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2

View File

@ -71,7 +71,7 @@ jobs:
# make sure Qt plugin finds QML sources so it can deploy the imported files # make sure Qt plugin finds QML sources so it can deploy the imported files
export QML_SOURCES_PATHS=./ export QML_SOURCES_PATHS=./
# 拷贝依赖 # 拷贝依赖
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/ProtocolParser/ProtocolParser/build/app_source/${targetName} --appdir /home/runner/work/ProtocolParser/ProtocolParser/build/app_source/ linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/ProtocolParser/ProtocolParser/build/app/release/${targetName} --appdir /home/runner/work/ProtocolParser/ProtocolParser/build/app/release/
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.AppImage mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.AppImage
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2

2
3rdparty/RibbonUI vendored

@ -1 +1 @@
Subproject commit bca8bafa5ee0dbe39b8f887fb4096ef39886aa92 Subproject commit b56ab042b49e1ad72242d79153edc74fd4f3bc3c

View File

@ -31,6 +31,12 @@ set(
INCLUDE_DIRECTORIES(dlln3x include) INCLUDE_DIRECTORIES(dlln3x include)
add_subdirectory(sm_crypto) add_subdirectory(sm_crypto)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/app/debug)
else()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/app/release)
endif()
if (WIN32) if (WIN32)
set(app_icon_resource_windows resources/icon.rc) set(app_icon_resource_windows resources/icon.rc)
qt_add_executable(${PROJECT_NAME} qt_add_executable(${PROJECT_NAME}
@ -48,7 +54,7 @@ if (WIN32)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy COMMAND ${CMAKE_COMMAND} -E copy
${DLL_FILES} ${DLL_FILES}
"${CMAKE_BINARY_DIR}${PATH_SEPARATOR}app_source" ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
) )
elseif(APPLE) elseif(APPLE)
set(MACOSX_BUNDLE_ICON_FILE AppIcon) set(MACOSX_BUNDLE_ICON_FILE AppIcon)

View File

@ -163,6 +163,8 @@ public:
void load_package(QList<uint8_t>& buf) { load_package(buf.constData(), buf.size()); }; void load_package(QList<uint8_t>& buf) { load_package(buf.constData(), buf.size()); };
void load_package(const uint8_t* buf, uint8_t length) void load_package(const uint8_t* buf, uint8_t length)
{ {
if (length < 7) // len < 7 means pkg is corrupted
return;
_packed_data.clear(); _packed_data.clear();
for (uint8_t i = 0; i < length; i++) { for (uint8_t i = 0; i < length; i++) {
_package.append(buf[i]); _package.append(buf[i]);

View File

@ -143,12 +143,8 @@ Item{
{ {
deny.push(ZigBeeParser.wait_queue[list.current_index]) deny.push(ZigBeeParser.wait_queue[list.current_index])
ZigBeeParser.deny_list = deny ZigBeeParser.deny_list = deny
for (var i = 0; i < ZigBeeParser.wait_queue.length; i++) data = ZigBeeParser.wait_queue
{ data.splice(list.current_index,1)
if (i === list.current_index)
continue
data.push(ZigBeeParser.wait_queue[i])
}
ZigBeeParser.wait_queue = data ZigBeeParser.wait_queue = data
break break
} }
@ -156,12 +152,8 @@ Item{
{ {
deny.push(ZigBeeParser.allow_list[list.current_index]) deny.push(ZigBeeParser.allow_list[list.current_index])
ZigBeeParser.deny_list = deny ZigBeeParser.deny_list = deny
for (let i = 0; i < ZigBeeParser.allow_list.length; i++) data = ZigBeeParser.allow_list
{ data.splice(list.current_index,1)
if (i === list.current_index)
continue
data.push(ZigBeeParser.allow_list[i])
}
ZigBeeParser.allow_list = data ZigBeeParser.allow_list = data
break break
} }
@ -170,13 +162,8 @@ Item{
let allow = ZigBeeParser.allow_list let allow = ZigBeeParser.allow_list
allow.push(ZigBeeParser.deny_list[list.current_index]) allow.push(ZigBeeParser.deny_list[list.current_index])
ZigBeeParser.allow_list = allow ZigBeeParser.allow_list = allow
let data = [] data = ZigBeeParser.deny_list
for (let i = 0; i < ZigBeeParser.deny_list.length; i++) data.splice(list.current_index,1)
{
if (i === list.current_index)
continue
data.push(ZigBeeParser.deny_list[i])
}
ZigBeeParser.deny_list = data ZigBeeParser.deny_list = data
break break
} }
@ -196,37 +183,22 @@ Item{
let allow = ZigBeeParser.allow_list let allow = ZigBeeParser.allow_list
allow.push(ZigBeeParser.wait_queue[list.current_index]) allow.push(ZigBeeParser.wait_queue[list.current_index])
ZigBeeParser.allow_list = allow ZigBeeParser.allow_list = allow
var data = [] var data = ZigBeeParser.wait_queue
for (var i = 0; i < ZigBeeParser.wait_queue.length; i++) data.splice(list.current_index,1)
{
if (i === list.current_index)
continue
data.push(ZigBeeParser.wait_queue[i])
}
ZigBeeParser.wait_queue = data ZigBeeParser.wait_queue = data
break break
} }
case 1: case 1:
{ {
let data = [] let data = ZigBeeParser.allow_list
for (let i = 0; i < ZigBeeParser.allow_list.length; i++) data.splice(list.current_index,1)
{
if (i === list.current_index)
continue
data.push(ZigBeeParser.allow_list[i])
}
ZigBeeParser.allow_list = data ZigBeeParser.allow_list = data
break break
} }
case 2: case 2:
{ {
let data = [] let data = ZigBeeParser.deny_list
for (let i = 0; i < ZigBeeParser.deny_list.length; i++) data.splice(list.current_index,1)
{
if (i === list.current_index)
continue
data.push(ZigBeeParser.deny_list[i])
}
ZigBeeParser.deny_list = data ZigBeeParser.deny_list = data
break break
} }

View File

@ -111,13 +111,8 @@ Item {
text: qsTr("删除") text: qsTr("删除")
enabled: list.has_selected enabled: list.has_selected
onClicked: { onClicked: {
let data = [] let data = ZigBeeParser.pre_hmac_verify_key
for (let i = 0; i < ZigBeeParser.pre_hmac_verify_key.length; i++) data.splice(list.current_index,1)
{
if (i === list.current_index)
continue
data.push(ZigBeeParser.pre_hmac_verify_key[i])
}
ZigBeeParser.pre_hmac_verify_key = data ZigBeeParser.pre_hmac_verify_key = data
} }
} }

View File

@ -17,7 +17,7 @@ function Main() {
New-Item -ItemType Directory $archiveName New-Item -ItemType Directory $archiveName
# 拷贝exe # 拷贝exe
Copy-Item D:\a\ProtocolParser\ProtocolParser\build\app_source\* $archiveName\ -Force -Recurse | Out-Null Copy-Item D:\a\ProtocolParser\ProtocolParser\build\app\release\* $archiveName\ -Force -Recurse | Out-Null
# 拷贝依赖 # 拷贝依赖
windeployqt --qmldir . --plugindir $archiveName\plugins --no-translations --compiler-runtime $archiveName\$targetName windeployqt --qmldir . --plugindir $archiveName\plugins --no-translations --compiler-runtime $archiveName\$targetName
# 删除不必要的文件 # 删除不必要的文件

View File

@ -27,7 +27,7 @@ function Main() {
New-Item -ItemType Directory $archiveName New-Item -ItemType Directory $archiveName
# 拷贝exe # 拷贝exe
Copy-Item D:\a\ProtocolParser\ProtocolParser\build\app_source\* $archiveName\ -Force -Recurse | Out-Null Copy-Item D:\a\ProtocolParser\ProtocolParser\build\app\release\* $archiveName\ -Force -Recurse | Out-Null
# 拷贝依赖 # 拷贝依赖
windeployqt --qmldir . --plugindir $archiveName\plugins --no-translations --compiler-runtime $archiveName\$targetName windeployqt --qmldir . --plugindir $archiveName\plugins --no-translations --compiler-runtime $archiveName\$targetName
# 删除不必要的文件 # 删除不必要的文件