codesign --remove-signature will cause broken binary (#2530)

* codesign --remove-signature will cause broken binary

* fix
This commit is contained in:
Le Tan 2024-07-19 19:44:24 +08:00 committed by GitHub
parent 78de724757
commit a7600fa7f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 12 deletions

View File

@ -72,6 +72,13 @@ jobs:
git clone https://github.com/tamlok/macdeployqtfix.git macdeployqtfix --depth=1 git clone https://github.com/tamlok/macdeployqtfix.git macdeployqtfix --depth=1
working-directory: ${{runner.workspace}} working-directory: ${{runner.workspace}}
- name: Install optool
run: |
wget --no-verbose https://github.com/alexzielenski/optool/releases/download/0.1/optool.zip
unzip ./optool.zip
sudo ln -s ./optool /usr/local/bin/optool
working-directory: ${{runner.workspace}}
- name: Cache Qt - name: Cache Qt
id: cache-qt id: cache-qt
uses: actions/cache@v1 # not v2! uses: actions/cache@v1 # not v2!

View File

@ -1,4 +1,4 @@
execute_process(COMMAND "codesign" --remove-signature ${CMAKE_CURRENT_BINARY_DIR}/VNote.app execute_process(COMMAND "optool" strip -t ${CMAKE_CURRENT_BINARY_DIR}/VNote.app
WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY} WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}
) )
execute_process(COMMAND "${MACDEPLOYQT_EXECUTABLE}" ${CMAKE_CURRENT_BINARY_DIR}/VNote.app -dmg execute_process(COMMAND "${MACDEPLOYQT_EXECUTABLE}" ${CMAKE_CURRENT_BINARY_DIR}/VNote.app -dmg

View File

@ -25,6 +25,7 @@
#include <QPushButton> #include <QPushButton>
#include <QSplitter> #include <QSplitter>
#include <QFormLayout> #include <QFormLayout>
#include <QFileInfo>
#include <core/global.h> #include <core/global.h>
#include <widgets/messageboxhelper.h> #include <widgets/messageboxhelper.h>
@ -78,19 +79,21 @@ QSize WidgetUtils::availableScreenSize(QWidget *p_widget)
void WidgetUtils::openUrlByDesktop(const QUrl &p_url) void WidgetUtils::openUrlByDesktop(const QUrl &p_url)
{ {
const auto scheme = p_url.scheme(); const auto scheme = p_url.scheme();
if (scheme != "http" && scheme != "https") { if (scheme == "http" || scheme == "https" ||
// Prompt for user. (p_url.isLocalFile() && QFileInfo(p_url.toLocalFile()).isDir())) {
int ret = MessageBoxHelper::questionYesNo(MessageBoxHelper::Warning, QDesktopServices::openUrl(p_url);
MainWindow::tr("Are you sure to open link (%1)?").arg(p_url.toString()), return;
MainWindow::tr("Malicious link might do harm to your device."),
QString(),
nullptr);
if (ret == QMessageBox::No) {
return;
}
} }
QDesktopServices::openUrl(p_url); // Prompt for user.
int ret = MessageBoxHelper::questionYesNo(MessageBoxHelper::Warning,
MainWindow::tr("Are you sure to open link (%1)?").arg(p_url.toString()),
MainWindow::tr("Malicious link might do harm to your device."),
QString(),
nullptr);
if (ret == QMessageBox::No) {
return;
}
} }
bool WidgetUtils::processKeyEventLikeVi(QWidget *p_widget, bool WidgetUtils::processKeyEventLikeVi(QWidget *p_widget,