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

Qt 6.8 -> release-v4.47.0 #3207

Merged
merged 4 commits into from
Mar 3, 2025
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
2 changes: 1 addition & 1 deletion .containerversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
27
28
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
name: BitBoxApp-linux-${{github.sha}}.rpm
if-no-files-found: error
macos:
runs-on: macos-13
runs-on: macos-14
outputs:
artifact-url: ${{ steps.upload.outputs.artifact-url }}
steps:
Expand All @@ -151,9 +151,9 @@ jobs:
# qtwebengine is for rendering the frontend.
run: |
pip install aqtinstall
aqt install-qt mac desktop 6.2.4 --modules qtpositioning qtserialport qtwebchannel qtwebengine --outputdir ~/Qt
echo "$HOME/Qt/6.2.4/macos/bin" >> $GITHUB_PATH
echo "$HOME/Qt/6.2.4/macos/libexec" >> $GITHUB_PATH
aqt install-qt mac desktop 6.8.2 --modules qtpositioning qtserialport qtwebchannel qtwebengine --outputdir ~/Qt
echo "$HOME/Qt/6.8.2/macos/bin" >> $GITHUB_PATH
echo "$HOME/Qt/6.8.2/macos/libexec" >> $GITHUB_PATH
- name: Build macOS app
run: >
./scripts/github-ci.sh qt-osx;
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
make gomobileinit
(cd $GOPATH/$GO_SRC_DIR; make ios)
windows:
runs-on: windows-2019
runs-on: windows-2022
outputs:
artifact-url: ${{ steps.upload.outputs.artifact-url }}
defaults:
Expand All @@ -227,16 +227,16 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.2'
version: '6.8.2'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
arch: 'win64_msvc2022_64'
modules: 'qtwebengine qtwebchannel qtpositioning'
- name: Link Visual Studio editions
# This is needed due to our build expecting the Community edition, but Enterprise being pre-installed
shell: cmd
run: |
mklink /J "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
mklink /J "C:\Program Files\Microsoft Visual Studio\2022\Community" "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
- name: Build Windows app
run: |
make qt-windows
Expand Down Expand Up @@ -289,8 +289,7 @@ jobs:
**Oh no! [${{ steps.vars.outputs.git_sha_short }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) failed to build.**
See [run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.
bitbox02-simulator:
# This is a separate job because the simulator runs on Ubuntu 22.04+, while the
# Docker CI image is still on Ubuntu 20.04 (the min supported version for BitBoxApp).
# This is a separate job because the simulator platform requirements are independent of our CI image Ubuntu version.
runs-on: ubuntu-22.04
steps:
- name: Clone the repo
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## Unreleased
- Reduced support for BitBox01
- Fix a bug that would prevent the app to perform firmware upgrade when offline.

# 4.47.0
- Bundle BitBox02 firmware version v9.22.0
Expand All @@ -21,6 +23,7 @@
- Create desktop shortcut by default on Windows during installation
- Migrate from deprecated Walletconnect web3wallet to Reown, add Sepolia, Arbitrum, Base, and Optimism to supported chains
- Added BTC Direct buy option
- Upgraded to Qt 6.8.2, dropping support for macOS 11 and Ubuntu 20.04.

# 4.46.3
- Fix camera access on linux
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
FROM thyrlian/android-sdk:4.0 as android

FROM ubuntu:20.04
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND noninteractive

Expand All @@ -30,6 +30,6 @@ ENV PATH $GOROOT/bin:$GOPATH/bin:$PATH
ADD Makefile /tmp/
RUN make -C /tmp/ envinit

ENV PATH /opt/qt6/6.2.4/gcc_64/bin:/opt/qt6/6.2.4/gcc_64/libexec:$PATH
ENV PATH /opt/qt6/6.8.2/gcc_64/bin:/opt/qt6/6.8.2/gcc_64/libexec:$PATH

CMD ["bash"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ To build the app or run the development workflow, the following dependencies nee
- [Go](https://golang.org/doc/install) version 1.23
- [Node.js](https://nodejs.org/) version 20.x
- [NPM](https://docs.npmjs.com/about-npm-versions) version 10.x or newer
- [Qt](https://www.qt.io) version 6.2.4
- [Qt](https://www.qt.io) version 6.8.2
- install Qt for your platform, including the WebEngine component

## Build the BitBoxApp
Expand Down
48 changes: 0 additions & 48 deletions appveyor.yml

This file was deleted.

18 changes: 9 additions & 9 deletions docs/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ platforms should be viable for development, building, and use of the BitBox
Wallet application.

* Debian: 11 bullseye or newer
* Ubuntu: 20.04+
* Ubuntu: 22.04+
* Fedora: 36+
* MacOS: 10.15+
* MacOS: 12+
* Windows: Windows 10+

## Debian, Ubuntu, and Fedora GNU/Linux with Docker
Expand Down Expand Up @@ -39,15 +39,15 @@ brew install [email protected]
brew install create-dmg
# Install Qt. Can also use the official installer.
pip install aqtinstall
aqt list-qt mac desktop --arch 6.2.4
aqt install-qt mac desktop 6.2.4 --modules qtpositioning qtserialport qtwebchannel qtwebengine --outputdir ~/Qt
aqt list-qt mac desktop --arch 6.8.2
aqt install-qt mac desktop 6.8.2 --modules qtpositioning qtserialport qtwebchannel qtwebengine --outputdir ~/Qt
```

Make sure you have `qt@6/bin`, `qt@6/libexec`, `[email protected]/bin` and `go/bin` in your PATH, i.e. add to your `.zshrc`:

```bash
export PATH="$PATH:$HOME/Qt/6.2.4/macos/bin"
export PATH="$PATH:$HOME/Qt/6.2.4/macos/libexec"
export PATH="$PATH:$HOME/Qt/6.8.2/macos/bin"
export PATH="$PATH:$HOME/Qt/6.8.2/macos/libexec"
export PATH="$PATH:/usr/local/opt/[email protected]/bin"
export PATH="$PATH:$HOME/go/bin"
```
Expand Down Expand Up @@ -81,10 +81,10 @@ xcrun altool --list-providers --username "APPLE_ID" --password "PASSWORD"

## Windows

The build requires `Microsoft Visual Studio 2019 Community Edition`, with the `MSVC v142 - VS 2019 C++ x64/x86 build tools (Latest)`
The build requires `Microsoft Visual Studio 2022 Community Edition`, with the `MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)`
individual component.

It also requires `mingw-w64`, `bash` (e.g. `git-bash`), `make`,`go 1.23`, `node@20`, `QT 5.15.2` with `qtwebengine`, `nsis`
It also requires `mingw-w64`, `bash` (e.g. `git-bash`), `make`,`go 1.23`, `node@20`, `QT 6.8.2` with `qtwebengine`, `nsis`
and possibly other tools.

Some of the tools are easy to install with `choco`:
Expand All @@ -98,7 +98,7 @@ Add a system environment variable `MINGW_BIN` pointing to the bin directory of m
(e.g. `/c/MinGW/bin` or `/c/Program Files/Git/mingw64/bin`).

Add to the system environment variable `PATH`:
- Location of `qmake`, e.g. `C:\Qt\5.15.2\msvc2019_64\bin`
- Location of `qmake`, e.g. `C:\Qt\6.8.2\msvc2022_64\bin`
- Location of nsis, e.g. `C:\Program Files (x86)\NSIS\Bin`

Build the QT frontend for Windows: `make qt-windows`
Expand Down
2 changes: 1 addition & 1 deletion frontends/qt/BitBox.pro
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ win32 {
#QMAKE_LFLAGS += -Wl,--nxcompat
#QMAKE_LFLAGS += -Wl,--dynamicbase
} else {
QMAKE_CXXFLAGS += -std=c++11
QMAKE_CXXFLAGS += -std=c++17
LIBS += -L$$PWD/server -lserver
QMAKE_CXXFLAGS += $$CFORTIFY
QMAKE_CXXFLAGS += $$CSTACK
Expand Down
3 changes: 3 additions & 0 deletions frontends/qt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ linux:
# The list of related plugins was found by: `find $(qmake -query QT_INSTALL_PLUGINS) | grep wayland`
-extra-plugins=platforms/libqwayland-generic.so,platforms/libqwayland-egl.so,wayland-graphics-integration-client,wayland-decoration-client,wayland-shell-integration
cp /usr/lib/x86_64-linux-gnu/nss/* build/linux-tmp/lib
# See https://github.com/probonopd/linuxdeployqt/issues/554#issuecomment-1761834180
cp "$(shell qmake -query QT_INSTALL_DATA)/resources/v8_context_snapshot.bin" build/linux-tmp/resources
cp -aR resources/linux build/tmp-deb
cp resources/linux/usr/share/applications/bitbox.desktop build/linux-tmp
cp resources/linux/usr/share/icons/hicolor/128x128/apps/bitbox.png build/linux-tmp
Expand All @@ -59,6 +61,7 @@ osx:
mkdir build/osx
mv build/BitBox.app build/osx/
cp resources/MacOS/Info.plist build/osx/BitBox.app/Contents/
mkdir -p build/osx/BitBox.app/Contents/Resources
cp resources/MacOS/icon.icns build/osx/BitBox.app/Contents/Resources/
cd build/osx/ && macdeployqt BitBox.app
cp server/libserver.so build/osx/BitBox.app/Contents/Frameworks
Expand Down
18 changes: 9 additions & 9 deletions frontends/qt/compile_windows.bat
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
:: Compiles the Qt app. Part of `make windows`, which also compiles/bundles the deps

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
cd build
qmake ..\BitBox.pro
nmake
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\msvcp140.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\msvcp140_1.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\msvcp140_2.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\msvcp140_atomic_wait.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\msvcp140_codecvt_ids.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\vccorlib140.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\vcruntime140.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\vcruntime140_1.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\msvcp140.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\msvcp140_1.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\msvcp140_2.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\msvcp140_atomic_wait.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\msvcp140_codecvt_ids.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\vccorlib140.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\vcruntime140.dll" windows\
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\vcruntime140_1.dll" windows\
30 changes: 10 additions & 20 deletions frontends/qt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@ class WebEnginePage : public QWebEnginePage {
WebEnginePage(QObject* parent) : QWebEnginePage(parent) {}

QWebEnginePage* createWindow(QWebEnginePage::WebWindowType type) {
Q_UNUSED(type);
return externalPage;
}

virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID)
{
// Log frontend console messages to the Go log.txt.
Q_UNUSED(level);
QString formattedMsg = QString("msg: %1; line %2; source: %3").arg(message).arg(lineNumber).arg(sourceID);
goLog(formattedMsg.toUtf8().constData());
}
Expand Down Expand Up @@ -185,8 +187,8 @@ class RequestInterceptor : public QWebEngineUrlRequestInterceptor {
// We treat the exchange pages specially because we need to allow exchange
// widgets to load in an iframe as well as let them open external links
// in a browser.
bool onExchangePage = currentUrl.contains(QRegularExpression(QString("^%1:/index\.html\#/exchange/.*$").arg(scheme)));
bool onBitsurancePage = currentUrl.contains(QRegularExpression(QString("^%1:/index\.html\#/bitsurance/.*$").arg(scheme)));
bool onExchangePage = currentUrl.contains(QRegularExpression(QString(R"(^%1:/index\.html\#/exchange/.*$)").arg(scheme)));
bool onBitsurancePage = currentUrl.contains(QRegularExpression(QString(R"(^%1:/index\.html\#/bitsurance/.*$)").arg(scheme)));
if (onExchangePage || onBitsurancePage) {
if (info.firstPartyUrl().toString() == info.requestUrl().toString()) {
// Ignore requests for certain file types (e.g., .js, .css) Somehow Moonpay loads
Expand Down Expand Up @@ -265,9 +267,6 @@ class WebEngineView : public QWebEngineView {

int main(int argc, char *argv[])
{
// Enable auto HiDPI scaling to correctly manage scale factor on bigger screens
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

// Make `@media (prefers-color-scheme: light/dark)` CSS rules work.
// See https://github.com/qutebrowser/qutebrowser/issues/5915#issuecomment-737115530
// This might only be needed for Qt 5.15.2, should revisit this when updating Qt.
Expand Down Expand Up @@ -379,11 +378,7 @@ int main(int argc, char *argv[])
preferredLocale = uiLangs.first();
}

QThread workerThread;
webClass = new WebClass();
// Run client queries in a separate thread to not block the UI.
webClass->moveToThread(&workerThread);
workerThread.start();

serve(
// cppHeapFree
Expand Down Expand Up @@ -440,17 +435,13 @@ int main(int argc, char *argv[])

QObject::connect(
view->page(),
&QWebEnginePage::featurePermissionRequested,
[&](const QUrl& securityOrigin, QWebEnginePage::Feature feature) {
if (feature == QWebEnginePage::MediaVideoCapture) {
// Allow video capture for QR code scanning.
view->page()->setFeaturePermission(
securityOrigin,
feature,
QWebEnginePage::PermissionGrantedByUser);
&QWebEnginePage::permissionRequested,
[&](QWebEnginePermission permission) {
// Allow video capture for QR code scanning.
if (permission.permissionType() == QWebEnginePermission::PermissionType::MediaVideoCapture) {
permission.grant();
}
});

QWebChannel channel;
channel.registerObject("backend", webClass);
view->page()->setWebChannel(&channel);
Expand Down Expand Up @@ -480,8 +471,6 @@ int main(int argc, char *argv[])
delete view;
view = nullptr;
webClassMutex.unlock();
workerThread.quit();
workerThread.wait();
});

#if defined(_WIN32)
Expand All @@ -503,6 +492,7 @@ int main(int argc, char *argv[])
&a,
&SingleApplication::receivedMessage,
[&](int instanceId, QByteArray message) {
Q_UNUSED(instanceId)
QString arg = QString::fromUtf8(message);
qDebug() << "Received arg from secondary instance:" << arg;
handleURI(arg.toUtf8().constData());
Expand Down
1 change: 1 addition & 0 deletions frontends/web/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"ignorePatterns": ["src/utils/qwebchannel.js"],
"settings": {
"react": {
"version": "detect"
Expand Down
Loading
Loading