Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ jobs:
git clone https://github.com/tamlok/macdeployqtfix.git macdeployqtfix --depth=1
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
id: cache-qt
uses: actions/cache@v1 # not v2!
Expand Down
2 changes: 1 addition & 1 deletion src/CPackMacDeployQt.cmake.in
Original file line number Diff line number Diff line change
@@ -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}
)
execute_process(COMMAND "${MACDEPLOYQT_EXECUTABLE}" ${CMAKE_CURRENT_BINARY_DIR}/VNote.app -dmg
Expand Down
25 changes: 14 additions & 11 deletions src/utils/widgetutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <QPushButton>
#include <QSplitter>
#include <QFormLayout>
#include <QFileInfo>

#include <core/global.h>
#include <widgets/messageboxhelper.h>
Expand Down Expand Up @@ -78,19 +79,21 @@ QSize WidgetUtils::availableScreenSize(QWidget *p_widget)
void WidgetUtils::openUrlByDesktop(const QUrl &p_url)
{
const auto scheme = p_url.scheme();
if (scheme != "http" && scheme != "https") {
// 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;
}
if (scheme == "http" || scheme == "https" ||
(p_url.isLocalFile() && QFileInfo(p_url.toLocalFile()).isDir())) {
QDesktopServices::openUrl(p_url);
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,
Expand Down
Loading