mirror of
https://git.wownero.com/wowlet/wowlet.git
synced 2024-08-15 01:03:14 +00:00
Compare commits
No commits in common. "master" and "v4.0.0" have entirely different histories.
21 changed files with 671 additions and 401 deletions
|
@ -5,9 +5,9 @@ message(STATUS "Initiating compile using CMake ${CMAKE_VERSION}")
|
|||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
set(VERSION_MAJOR "4")
|
||||
set(VERSION_MINOR "1")
|
||||
set(VERSION_REVISION "1")
|
||||
set(VERSION "beta-8")
|
||||
set(VERSION_MINOR "0")
|
||||
set(VERSION_REVISION "0")
|
||||
set(VERSION "beta-7")
|
||||
|
||||
option(FETCH_DEPS "Download dependencies if they are not found" ON)
|
||||
option(OPENVR "Include OpenVR support")
|
||||
|
@ -30,6 +30,11 @@ set(BUILD_GUI_DEPS ON)
|
|||
set(BUILD_64 ON CACHE BOOL "Build 64-bit binaries")
|
||||
set(INSTALL_VENDORED_LIBUNBOUND ${STATIC})
|
||||
set(USE_SINGLE_BUILDDIR ON)
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(LINUX_ACTIVATION ON)
|
||||
else()
|
||||
set(LINUX_ACTIVATION OFF)
|
||||
endif()
|
||||
|
||||
# Are we in debug mode?
|
||||
set(_CMAKE_BUILD_TYPE "")
|
||||
|
@ -96,6 +101,9 @@ include_directories(${EASYLOGGING_INCLUDE})
|
|||
link_directories(${EASYLOGGING_LIBRARY_DIRS})
|
||||
|
||||
# OpenSSL
|
||||
if(APPLE AND NOT OPENSSL_ROOT_DIR)
|
||||
execute_process(COMMAND brew --prefix openssl OUTPUT_VARIABLE OPENSSL_ROOT_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
find_package(OpenSSL REQUIRED)
|
||||
message(STATUS "OpenSSL: Version ${OPENSSL_VERSION}")
|
||||
message(STATUS "OpenSSL: include dir at ${OPENSSL_INCLUDE_DIR}")
|
||||
|
@ -121,15 +129,20 @@ find_package(wownero-seed CONFIG REQUIRED)
|
|||
if(DEBUG)
|
||||
set(Boost_DEBUG ON)
|
||||
endif()
|
||||
|
||||
if(APPLE AND NOT BOOST_ROOT)
|
||||
execute_process(COMMAND brew --prefix boost OUTPUT_VARIABLE BOOST_ROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
if(MINGW)
|
||||
set(Boost_THREADAPI win32)
|
||||
endif()
|
||||
set(_BOOST_COMPONENTS system filesystem thread date_time chrono regex serialization program_options locale)
|
||||
|
||||
if(APPLE)
|
||||
# atomic is only present/needed on Apple
|
||||
list(APPEND _BOOST_COMPONENTS atomic)
|
||||
endif()
|
||||
find_package(Boost 1.58 REQUIRED COMPONENTS ${_BOOST_COMPONENTS})
|
||||
|
||||
if(UNIX AND NOT ANDROID)
|
||||
if(UNIX AND NOT APPLE AND NOT ANDROID)
|
||||
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
# https://github.com/monero-project/monero-gui/issues/3142#issuecomment-705940446
|
||||
set(CMAKE_SKIP_RPATH ON)
|
||||
|
@ -171,6 +184,25 @@ if(TOR_BIN)
|
|||
# on the buildbot(s) Tor is baked into the image
|
||||
# - linux: See `Dockerfile`
|
||||
# - windows: See `Dockerfile.windows`
|
||||
#
|
||||
# ## MacOS:
|
||||
# we assume the following files are already present in src/assets/exec:
|
||||
# - tor
|
||||
# - libevent-2.1.7.dylib
|
||||
# so copy them beforehand and set TOR_BIN to something random.
|
||||
|
||||
# MacOS, check if required files are present
|
||||
if(APPLE)
|
||||
foreach(fn libevent-2.1.7.dylib tor)
|
||||
set(tor_path "${CMAKE_CURRENT_SOURCE_DIR}/src/assets/exec/${fn}")
|
||||
if (EXISTS "${tor_path}")
|
||||
message(STATUS "Tor found: ${tor_path}")
|
||||
else()
|
||||
message(FATAL_ERROR "TOR_BIN is set, so the following file needs to be present: '${tor_path}'")
|
||||
endif()
|
||||
set(TOR_BIN "${tor_path}")
|
||||
endforeach()
|
||||
else()
|
||||
if(NOT EXISTS "${TOR_BIN}")
|
||||
message(FATAL_ERROR "TOR_BIN is set, but file does not exist: '${TOR_BIN}'")
|
||||
endif()
|
||||
|
@ -184,6 +216,8 @@ if(TOR_BIN)
|
|||
message(FATAL_ERROR "Tor copy failure: ${TOR_COPY_CMD}")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
# get Tor version while we're at it
|
||||
if(NOT TOR_VERSION)
|
||||
execute_process(COMMAND bash -c "${TOR_BIN} --version --quiet | head -n1" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE out RESULT_VARIABLE ret)
|
||||
|
@ -226,6 +260,8 @@ if(MINGW)
|
|||
else()
|
||||
set(ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
set(EXTRA_LIBRARIES "-framework AppKit")
|
||||
elseif(OPENBSD)
|
||||
set(EXTRA_LIBRARIES "")
|
||||
elseif(FREEBSD)
|
||||
|
@ -242,6 +278,14 @@ endif()
|
|||
|
||||
list(APPEND EXTRA_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
|
||||
if(APPLE)
|
||||
include_directories(SYSTEM /usr/include/malloc)
|
||||
if(POLICY CMP0042)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default -std=c++11 -DGTEST_HAS_TR1_TUPLE=0")
|
||||
endif()
|
||||
|
||||
# warnings
|
||||
# @TODO: enable these 2 for migration to Qt 6
|
||||
#add_c_flag_if_supported(-Werror C_SECURITY_FLAGS)
|
||||
|
@ -276,7 +320,12 @@ if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VER
|
|||
endif()
|
||||
|
||||
# linker
|
||||
if (NOT (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU"))
|
||||
if (APPLE)
|
||||
add_linker_flag_if_supported(-Wl,-bind_at_load LD_SECURITY_FLAGS)
|
||||
add_linker_flag_if_supported(-Wl,-dead_strip LD_SECURITY_FLAGS)
|
||||
add_linker_flag_if_supported(-Wl,-dead_strip_dylibs LD_SECURITY_FLAGS)
|
||||
endif()
|
||||
if (NOT APPLE AND NOT (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU"))
|
||||
# Windows binaries die on startup with PIE when compiled with GCC
|
||||
add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS)
|
||||
endif()
|
||||
|
@ -327,6 +376,10 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${C_SECURITY_FLAGS}")
|
|||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${CXX_SECURITY_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS} ${STATIC_FLAGS}")
|
||||
|
||||
if(APPLE)
|
||||
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/contrib/KDMacTouchBar")
|
||||
endif()
|
||||
|
||||
if(OPENVR)
|
||||
# Add contrib/openvr as library
|
||||
add_definitions(-DVR_API_PUBLIC)
|
||||
|
|
13
Dockerfile_macos
Normal file
13
Dockerfile_macos
Normal file
|
@ -0,0 +1,13 @@
|
|||
# this image is used internally for the buildbot
|
||||
FROM ubuntu:20.04
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt clean && apt update
|
||||
RUN apt install -y git build-essential wget curl ngrep unzip file ssh zip
|
||||
|
||||
RUN cat /dev/zero | ssh-keygen -q -N ""
|
||||
|
||||
RUN cat ~/.ssh/id_rsa.pub
|
||||
|
||||
RUN printf "Host *\n StrictHostKeyChecking no" > ~/.ssh/config
|
26
Makefile
26
Makefile
|
@ -73,3 +73,29 @@ windows-mxe-debug: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Debug
|
|||
windows-mxe-debug:
|
||||
cmake -Bbuild $(CMAKEFLAGS)
|
||||
$(MAKE) -Cbuild
|
||||
|
||||
mac: CMAKEFLAGS += -DSTATIC=Off
|
||||
mac: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF)
|
||||
mac: CMAKEFLAGS += -DBUILD_TAG="mac-x64"
|
||||
mac: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Release
|
||||
mac:
|
||||
cmake -Bbuild $(CMAKEFLAGS)
|
||||
$(MAKE) -Cbuild
|
||||
$(MAKE) -Cbuild deploy
|
||||
|
||||
# used for release, covers both intel and M1
|
||||
# 1) assumes a *static* BOOST has been compiled at BOOST_ROOT, see docs/BUILDING.md
|
||||
# 2) assumes a *static* Tor and libevent at src/assets/exec, see docs/BUILDING.md
|
||||
mac-release: CMAKEFLAGS += -DARCH=default
|
||||
mac-release: CMAKEFLAGS += -DCMAKE_OSX_ARCHITECTURES="x86_64"
|
||||
mac-release: CMAKEFLAGS += -DSTATIC=Off
|
||||
mac-release: CMAKEFLAGS += -DTOR_BIN="foo"
|
||||
mac-release: CMAKEFLAGS += -DBUILD_TAG="mac-x64"
|
||||
mac-release: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Release
|
||||
mac-release: CMAKEFLAGS += -DBoost_USE_STATIC_RUNTIME=ON
|
||||
mac-release: CMAKEFLAGS += -DBoost_USE_STATIC_LIBS=ON
|
||||
mac-release: CMAKEFLAGS += -DBOOST_ROOT=/Users/${USER}/build/boost
|
||||
mac-release:
|
||||
cmake -Bbuild $(CMAKEFLAGS)
|
||||
$(MAKE) -Cbuild
|
||||
$(MAKE) -Cbuild deploy
|
||||
|
|
|
@ -2,4 +2,23 @@ if(APPLE OR (WIN32 AND NOT STATIC))
|
|||
add_custom_target(deploy)
|
||||
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
|
||||
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
|
||||
|
||||
if(APPLE AND NOT IOS)
|
||||
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
|
||||
add_custom_command(TARGET deploy
|
||||
POST_BUILD
|
||||
COMMAND "${MACDEPLOYQT_EXECUTABLE}" "$<TARGET_FILE_DIR:wowlet>/../.." -always-overwrite -qmldir="${CMAKE_SOURCE_DIR}"
|
||||
COMMENT "Running macdeployqt..."
|
||||
)
|
||||
|
||||
# workaround for a Qt bug that requires manually adding libqsvg.dylib to bundle
|
||||
find_file(_qt_svg_dylib "libqsvg.dylib" PATHS "${CMAKE_PREFIX_PATH}/plugins/imageformats" NO_DEFAULT_PATH)
|
||||
if(_qt_svg_dylib)
|
||||
add_custom_command(TARGET deploy
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_qt_svg_dylib} $<TARGET_FILE_DIR:wowlet>/../PlugIns/imageformats/
|
||||
COMMENT "Copying libqsvg.dylib"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
|
120
docs/BUILDING.md
120
docs/BUILDING.md
|
@ -69,3 +69,123 @@ docker run --rm -it -v $PWD:/wowlet -w /wowlet wowlet:win sh -c 'make windows ro
|
|||
If you're re-running a build make sure to `rm -rf build/` first.
|
||||
|
||||
The resulting binary can be found in `build/x86_64-w64-mingw32/release/bin/wowlet.exe`.
|
||||
|
||||
# Mac OS
|
||||
|
||||
## method 1 (easiest)
|
||||
|
||||
### 1. Get homebrew
|
||||
|
||||
Get [brew](https://brew.sh) to install the required dependencies.
|
||||
|
||||
```bash
|
||||
HOMEBREW_OPTFLAGS="-march=core2" HOMEBREW_OPTIMIZATION_LEVEL="O0" \
|
||||
brew install boost zmq openssl libpgm miniupnpc libsodium expat libunwind-headers protobuf libgcrypt qrencode ccache cmake pkgconfig git
|
||||
```
|
||||
|
||||
### 2. Compile WOWlet
|
||||
|
||||
```bash
|
||||
CMAKE_PREFIX_PATH=/usr/local/opt/qt5/ make -j4 mac
|
||||
```
|
||||
|
||||
The resulting Mac OS application can be found `build/bin/wowlet.app` and will **not** have Tor embedded.
|
||||
|
||||
Since WOWlet needs Tor, install it, start it, and start at Mac OS boot:
|
||||
```bash
|
||||
brew install tor
|
||||
brew services start tor
|
||||
```
|
||||
|
||||
## method 2 (advanced, intel/m1 release binaries)
|
||||
|
||||
This assumes you have homebrew installed with the packages defined in the previous step ("Get homebrew").
|
||||
|
||||
### 1. Get Qt
|
||||
|
||||
Install Qt `5.15.2` from [the open-source Qt installer](https://www.qt.io/download).
|
||||
|
||||
### 2. Get static Boost
|
||||
|
||||
We'll install boost under `/Users/$USER/build/boost/`
|
||||
|
||||
```bash
|
||||
mkdir -p "/Users/$USER/build/boost"
|
||||
|
||||
wget https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz && \
|
||||
echo "9995e192e68528793755692917f9eb6422f3052a53c5e13ba278a228af6c7acf boost_1_73_0.tar.gz" | sha256sum -c && \
|
||||
tar -xzf boost_1_73_0.tar.gz && \
|
||||
rm boost_1_73_0.tar.gz && \
|
||||
cd boost_1_73_0
|
||||
|
||||
./bootstrap.sh --without-icu
|
||||
./b2 --disable-icu --with-atomic --with-system --with-filesystem --with-thread \
|
||||
--with-date_time --with-chrono --with-regex --with-serialization \
|
||||
--with-program_options --with-locale variant=release link=static \
|
||||
runtime-link=static cxxflags='-std=c++11' install -a --prefix="/Users/$USER/build/boost/"
|
||||
```
|
||||
|
||||
### 3. Get static Tor
|
||||
|
||||
1. Download the official Tor Browser `.dmg`
|
||||
2. Steal `tor.real` and `libevent-2.1.7.dylib` from the `.dmg`
|
||||
3. Place them both in `src/assets/exec/`
|
||||
- `src/assets/exec/tor`
|
||||
- `src/assets/exec/libevent-2.1.7.dylib`
|
||||
|
||||
### 4. Get static Tor
|
||||
|
||||
```bash
|
||||
CMAKE_PREFIX_PATH=/Users/dsc/Qt5.15.2/5.15.2/clang_64 TOR_BIN="foo" make -j10 mac-release
|
||||
```
|
||||
|
||||
Resulting *static* Mac OS package: `build/bin/wowlet.app`
|
||||
|
||||
## method 3 (from source, WIP, does not work yet)
|
||||
|
||||
Download Qt `https://download.qt.io/archive/qt/5.15/5.15.3/single/`, unpack it somewhere.
|
||||
|
||||
Patch Qt 5.15.3 source.
|
||||
|
||||
- Context: [#1](https://github.com/microsoft/vcpkg/pull/21056) [#2](https://code.qt.io/cgit/qt/qtbase.git/diff/?id=dece6f5840463ae2ddf927d65eb1b3680e34a547)
|
||||
|
||||
```
|
||||
diff --git a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
|
||||
index 5d4b6d6a71..cc7193d8b7 100644
|
||||
--- a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
|
||||
+++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <qpa/qplatformgraphicsbuffer.h>
|
||||
#include <private/qcore_mac_p.h>
|
||||
|
||||
+#include <CoreGraphics/CGColorSpace.h>
|
||||
#include <IOSurface/IOSurface.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
```
|
||||
|
||||
Build Qt:
|
||||
|
||||
```bash
|
||||
./configure -prefix $PWD/qtbase -release -opensource -confirm-license -ccache \
|
||||
-no-dbus -no-sql-sqlite -no-use-gold-linker -no-kms \
|
||||
-qt-harfbuzz -qt-libjpeg -qt-libpng -qt-pcre -qt-zlib \
|
||||
-skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d \
|
||||
-skip qtdoc -skip qtquickcontrols -skip qtquickcontrols2 -skip qtspeech -skip qtgamepad \
|
||||
-skip qtlocation -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing -optimize-size \
|
||||
-skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttools \
|
||||
-skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebview \
|
||||
-skip qtwinextras -skip qtx11extras -skip gamepad -skip serialbus -skip location -skip webengine -skip qtdeclarative \
|
||||
-no-feature-cups -no-feature-ftp -no-feature-pdf -no-feature-animation -nomake examples -nomake tests -nomake tools
|
||||
|
||||
./configure -prefix $PWD/qtbase -release -nomake examples -nomake tests -skip qtwebchannel -skip qtpurchasing -skip webengine -skip qtwebview
|
||||
make -j 4
|
||||
```
|
||||
|
||||
Problem: QtQuick does not seem to be compiled, `Qt5QuickConfig.cmake` missing.
|
||||
|
||||
Build:
|
||||
|
||||
```bash
|
||||
CMAKE_PREFIX_PATH=/Users/$USER/Downloads/qt-everywhere-src-5.15.3/qtbase/ make -j4 mac
|
||||
```
|
||||
|
|
|
@ -33,6 +33,13 @@ libzmq3-dev libsodium-dev libhidapi-dev libnorm-dev libusb-1.0-0-dev libpgm-dev
|
|||
libprotobuf-dev protobuf-compiler libgcrypt20-dev libpng-dev
|
||||
```
|
||||
|
||||
## Mac OS
|
||||
|
||||
```bash
|
||||
brew install boost zmq openssl libpgm miniupnpc libsodium expat libunwind-headers \
|
||||
protobuf libgcrypt qrencode ccache cmake pkgconfig git
|
||||
```
|
||||
|
||||
## CMake
|
||||
|
||||
After installing Qt you might have a folder called `/home/$USER/Qt/`. You need to pass this to CMake
|
||||
|
@ -80,6 +87,13 @@ apt install -y tor
|
|||
sudo service tor start
|
||||
```
|
||||
|
||||
#### Mac OS
|
||||
|
||||
```bash
|
||||
brew install tor
|
||||
brew services start tor
|
||||
```
|
||||
|
||||
To skip the wizards and open a wallet directly use `--wallet-file`:
|
||||
|
||||
```bash
|
||||
|
|
|
@ -70,7 +70,11 @@ endif()
|
|||
qt5_add_resources(RESOURCES assets.qrc)
|
||||
|
||||
if(TOR_BIN)
|
||||
if(APPLE)
|
||||
set(ASSETS_TOR "assets_tor_macos.qrc")
|
||||
else()
|
||||
set(ASSETS_TOR "assets_tor.qrc")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(EXECUTABLE_FLAG)
|
||||
|
@ -218,10 +222,12 @@ target_compile_definitions(wowlet
|
|||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
||||
|
||||
if(UNIX)
|
||||
if(UNIX AND NOT APPLE)
|
||||
# https://stackoverflow.com/questions/57766620/cmake-add-library-doesnt-initialize-static-global-variable
|
||||
# so that contrib/monero-seed/src/gf_elem.cpp properly initializes. A better solution is welcome.
|
||||
target_link_libraries(wowlet PUBLIC -Wl,--whole-archive wownero-seed::wownero-seed -Wl,--no-whole-archive)
|
||||
else()
|
||||
target_link_libraries(wowlet PUBLIC wownero-seed::wownero-seed)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
|
@ -240,8 +246,7 @@ target_link_libraries(wowlet PUBLIC
|
|||
${OPENSSL_LIBRARIES}
|
||||
${CMAKE_DL_LIBS}
|
||||
${Iconv_LIBRARIES}
|
||||
${UNBOUND_LIBRARIES}
|
||||
# /usr/local/lib/libunbound.a
|
||||
/usr/local/lib/libunbound.a
|
||||
${EXTRA_LIBRARIES})
|
||||
|
||||
# Link Qt libraries
|
||||
|
@ -326,16 +331,26 @@ if(OPENVR)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(wowlet PUBLIC
|
||||
if(APPLE)
|
||||
target_link_libraries(wowlet PUBLIC
|
||||
KDMacTouchBar
|
||||
)
|
||||
target_include_directories(wowlet
|
||||
PUBLIC ../contrib/KDMacTouchBar)
|
||||
endif()
|
||||
|
||||
if(NOT APPLE)
|
||||
target_link_libraries(wowlet PUBLIC
|
||||
Qt5::QSvgIconPlugin
|
||||
Qt5::QSvgPlugin
|
||||
)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(STATIC)
|
||||
target_link_libraries(wowlet PUBLIC
|
||||
Qt5::QSvgIconPlugin
|
||||
Qt5::QSvgPlugin)
|
||||
if(UNIX)
|
||||
if(UNIX AND NOT APPLE)
|
||||
target_link_libraries(wowlet PUBLIC
|
||||
Qt5::QXcbIntegrationPlugin)
|
||||
endif()
|
||||
|
@ -345,6 +360,10 @@ if(X11_FOUND)
|
|||
target_link_libraries(wowlet PUBLIC ${X11_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
include(Deploy)
|
||||
endif()
|
||||
|
||||
install(TARGETS wowlet
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}
|
||||
)
|
||||
|
|
|
@ -554,10 +554,10 @@ void AppContext::onWSForum(const QJsonArray& forum_data) {
|
|||
for (auto &&entry: forum_data) {
|
||||
auto obj = entry.toObject();
|
||||
auto forumPost = new ForumPost(
|
||||
obj.value("thread").toString(),
|
||||
obj.value("member_name").toString(),
|
||||
obj.value("title").toString(),
|
||||
obj.value("author").toString(),
|
||||
obj.value("permalink").toString(),
|
||||
obj.value("member_name").toString());
|
||||
obj.value("comments").toInt());
|
||||
QSharedPointer<ForumPost> r = QSharedPointer<ForumPost>(forumPost);
|
||||
l.append(r);
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
QString tmpTxDescription;
|
||||
|
||||
// https://git.wownero.com/wowlet/wowlet-backend/
|
||||
QString backendHost = "l3hkasj5nnrh24yzj4acj5dgqlscq56o5xjvvqsftj55fkonqly5aiid.onion";
|
||||
QString backendHost = "6wku2m4zrv6j666crlo7lzofv6ud6enzllyhou3ijeigpukymi37caad.onion";
|
||||
unsigned int backendPort = 80;
|
||||
bool backendTLS = false;
|
||||
QString backendWSUrl;
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
in Conversations::Conversations(), results into `/tmp/results.txt`
|
||||
|
||||
QString fn_wallet_temp = "/tmp/lol";
|
||||
QString fn_wallet_temp_keys = "/tmp/lol.keys";
|
||||
QString fn_results = "/tmp/results.txt";
|
||||
|
||||
QFile f_results(fn_results);
|
||||
f_results.open(QIODevice::Append);
|
||||
|
||||
QTextStream f_results_stream(&f_results);
|
||||
|
||||
QFile f_newseeds("/tmp/new_seeds.txt"); // seeds to test for validness
|
||||
|
||||
int i = 0;
|
||||
int offset = 0;
|
||||
if (f_newseeds.open(QIODevice::ReadOnly))
|
||||
{
|
||||
QTextStream f_newseeds_stream(&f_newseeds);
|
||||
|
||||
while (!f_newseeds_stream.atEnd()) {
|
||||
if(i < offset) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
QFile::remove(fn_wallet_temp);
|
||||
QFile::remove(fn_wallet_temp_keys);
|
||||
|
||||
QString seed = f_newseeds_stream.readLine().trimmed();
|
||||
qWarning() << "[" << QString::number(i) << "]" << seed;
|
||||
|
||||
auto wallet = this->walletManager->recoveryWallet(fn_wallet_temp, "", seed, "", this->networkType, 0, this->kdfRounds);
|
||||
auto wallet_status = wallet->status();
|
||||
|
||||
if(wallet_status == Wallet::Status::Status_Ok) {
|
||||
//QString addr = QString::fromStdString(wallet->address(0, 0));
|
||||
auto addr = wallet->address(0, 0);
|
||||
auto result_line = QString("%1 : %2").arg(addr, seed);
|
||||
qWarning() << result_line;
|
||||
f_results_stream << result_line << "\n";
|
||||
f_results_stream.flush();
|
||||
}
|
||||
|
||||
delete wallet;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
f_results.close();
|
|
@ -169,311 +169,3 @@
|
|||
1601710572:252000
|
||||
1602154921:253500
|
||||
1609825674:279148
|
||||
1609816860:279048
|
||||
1610116800:280048
|
||||
1610420700:281048
|
||||
1610715120:282048
|
||||
1611017160:283048
|
||||
1611314940:284048
|
||||
1611616080:285048
|
||||
1611911760:286048
|
||||
1612211940:287048
|
||||
1612515660:288048
|
||||
1612810500:289048
|
||||
1613115540:290048
|
||||
1613414820:291048
|
||||
1613709300:292048
|
||||
1614008280:293048
|
||||
1614307380:294048
|
||||
1614603060:295048
|
||||
1614902280:296048
|
||||
1615204740:297048
|
||||
1615505100:298048
|
||||
1615807020:299048
|
||||
1616108820:300048
|
||||
1616402280:301048
|
||||
1616706720:302048
|
||||
1617003960:303048
|
||||
1617611100:305048
|
||||
1617911640:306048
|
||||
1618191900:307048
|
||||
1618522560:308048
|
||||
1618816620:309048
|
||||
1619098740:310048
|
||||
1619390520:311048
|
||||
1619695500:312048
|
||||
1619985120:313048
|
||||
1620290220:314048
|
||||
1620586260:315048
|
||||
1620885360:316048
|
||||
1621183620:317048
|
||||
1621482300:318048
|
||||
1621782840:319048
|
||||
1622079960:320048
|
||||
1622380260:321048
|
||||
1622678460:322048
|
||||
1622974380:323048
|
||||
1623269760:324048
|
||||
1623567420:325048
|
||||
1623869820:326048
|
||||
1624167180:327048
|
||||
1624473000:328048
|
||||
1624767600:329048
|
||||
1625065980:330048
|
||||
1625366940:331048
|
||||
1625439000:332048
|
||||
1625706420:333048
|
||||
1626101160:334048
|
||||
1626365940:335048
|
||||
1626660360:336048
|
||||
1626966840:337048
|
||||
1627231740:338048
|
||||
1627541700:339048
|
||||
1627810440:340048
|
||||
1628078820:341048
|
||||
1628406780:342048
|
||||
1628709420:343048
|
||||
1629011100:344048
|
||||
1629283260:345048
|
||||
1629582540:346048
|
||||
1629874620:347048
|
||||
1630168440:348048
|
||||
1630465980:349048
|
||||
1630756800:350048
|
||||
1631060460:351048
|
||||
1631393400:352048
|
||||
1631699460:353048
|
||||
1632012480:354048
|
||||
1632289920:355048
|
||||
1632602820:356048
|
||||
1632923220:357048
|
||||
1633203180:358048
|
||||
1633491000:359048
|
||||
1633811400:360048
|
||||
1634113140:361048
|
||||
1634430300:362048
|
||||
1634722260:363048
|
||||
1635035460:364048
|
||||
1635368760:365048
|
||||
1635639660:366048
|
||||
1635957840:367048
|
||||
1636245240:368048
|
||||
1636535820:369048
|
||||
1636863900:370048
|
||||
1637160360:371048
|
||||
1637457780:372048
|
||||
1637793240:373048
|
||||
1638062460:374048
|
||||
1638407580:375048
|
||||
1638675240:376048
|
||||
1638981360:377048
|
||||
1639273140:378048
|
||||
1639612740:379048
|
||||
1639928760:380048
|
||||
1640242500:381048
|
||||
1640530620:382048
|
||||
1640838000:383048
|
||||
1641136800:384048
|
||||
1641437400:385048
|
||||
1641716040:386048
|
||||
1642030680:387048
|
||||
1642330500:388048
|
||||
1642714260:389048
|
||||
1643040360:390048
|
||||
1643344560:391048
|
||||
1643612040:392048
|
||||
1643913360:393048
|
||||
1644223920:394048
|
||||
1644491820:395048
|
||||
1644794760:396048
|
||||
1645110660:397048
|
||||
1645379400:398048
|
||||
1645693500:399048
|
||||
1645981080:400048
|
||||
1646301360:401048
|
||||
1646576220:402048
|
||||
1646919420:403048
|
||||
1647208320:404048
|
||||
1647506640:405048
|
||||
1647768840:406048
|
||||
1648082520:407048
|
||||
1648391700:408048
|
||||
1648686240:409048
|
||||
1649002860:410048
|
||||
1649282820:411048
|
||||
1649599860:412048
|
||||
1649959980:413048
|
||||
1650248280:414048
|
||||
1650528840:415048
|
||||
1650809340:416048
|
||||
1651118280:417048
|
||||
1651432260:418048
|
||||
1651740360:419048
|
||||
1652031600:420048
|
||||
1652351400:421048
|
||||
1652639520:422048
|
||||
1652954640:423048
|
||||
1653252600:424048
|
||||
1653549840:425048
|
||||
1653862740:426048
|
||||
1654161060:427048
|
||||
1654461900:428048
|
||||
1654782600:429048
|
||||
1655076960:430048
|
||||
1655441820:431048
|
||||
1655740500:432048
|
||||
1656030240:433048
|
||||
1656324720:434048
|
||||
1656624060:435048
|
||||
1656925920:436048
|
||||
1657236840:437048
|
||||
1657526700:438048
|
||||
1657816740:439048
|
||||
1658135940:440048
|
||||
1658434440:441048
|
||||
1658715780:442048
|
||||
1659010080:443048
|
||||
1659318120:444048
|
||||
1659611040:445048
|
||||
1659914940:446048
|
||||
1660204260:447048
|
||||
1660505220:448048
|
||||
1660831740:449048
|
||||
1661114940:450048
|
||||
1661397720:451048
|
||||
1661708760:452048
|
||||
1661997180:453048
|
||||
1662335640:454048
|
||||
1662630120:455048
|
||||
1662908820:456048
|
||||
1663213380:457048
|
||||
1663501140:458048
|
||||
1663832400:459048
|
||||
1664109480:460048
|
||||
1664412600:461048
|
||||
1664724720:462048
|
||||
1665004620:463048
|
||||
1665305460:464048
|
||||
1665600480:465048
|
||||
1665894960:466048
|
||||
1666213620:467048
|
||||
1666527600:468048
|
||||
1666816380:469048
|
||||
1667123160:470048
|
||||
1667427180:471048
|
||||
1667720640:472048
|
||||
1668021000:473048
|
||||
1668334740:474048
|
||||
1668649440:475048
|
||||
1668946680:476048
|
||||
1669247100:477048
|
||||
1669560960:478048
|
||||
1669852800:479048
|
||||
1670164020:480048
|
||||
1670467860:481048
|
||||
1670767440:482048
|
||||
1671063480:483048
|
||||
1671363960:484048
|
||||
1671639900:485048
|
||||
1671950940:486048
|
||||
1672248180:487048
|
||||
1672566480:488048
|
||||
1672859400:489048
|
||||
1673179080:490048
|
||||
1673451120:491048
|
||||
1673759520:492048
|
||||
1674053100:493048
|
||||
1674374100:494048
|
||||
1674658440:495048
|
||||
1674978420:496048
|
||||
1675249380:497048
|
||||
1675559460:498048
|
||||
1675847160:499048
|
||||
1676178900:500048
|
||||
1676463600:501048
|
||||
1676782680:502048
|
||||
1677074640:503048
|
||||
1677385020:504048
|
||||
1677686160:505048
|
||||
1677996420:506048
|
||||
1678277700:507048
|
||||
1678564680:508048
|
||||
1678852920:509048
|
||||
1679178960:510048
|
||||
1679473500:511048
|
||||
1679780220:512048
|
||||
1680075120:513048
|
||||
1680415620:514048
|
||||
1680715500:515048
|
||||
1681014240:516048
|
||||
1681314240:517048
|
||||
1681628940:518048
|
||||
1681919940:519048
|
||||
1682226660:520048
|
||||
1682528460:521048
|
||||
1682838000:522048
|
||||
1683149040:523048
|
||||
1683448680:524048
|
||||
1683750540:525048
|
||||
1684050540:526048
|
||||
1684346940:527048
|
||||
1684659780:528048
|
||||
1684960560:529048
|
||||
1685261880:530048
|
||||
1685565420:531048
|
||||
1685865660:532048
|
||||
1686178020:533048
|
||||
1686480060:534048
|
||||
1686776820:535048
|
||||
1687078860:536048
|
||||
1687379580:537048
|
||||
1687685100:538048
|
||||
1687993320:539048
|
||||
1688293380:540048
|
||||
1688598420:541048
|
||||
1688898120:542048
|
||||
1689208500:543048
|
||||
1689503940:544048
|
||||
1689802800:545048
|
||||
1690109040:546048
|
||||
1690414320:547048
|
||||
1690721280:548048
|
||||
1691025480:549048
|
||||
1691325720:550048
|
||||
1691633940:551048
|
||||
1691931480:552048
|
||||
1692233280:553048
|
||||
1692532620:554048
|
||||
1692843420:555048
|
||||
1693147020:556048
|
||||
1693453140:557048
|
||||
1693749540:558048
|
||||
1694054460:559048
|
||||
1694348940:560048
|
||||
1694661120:561048
|
||||
1694961240:562048
|
||||
1695270600:563048
|
||||
1695572880:564048
|
||||
1695891600:565048
|
||||
1696201200:566048
|
||||
1696506300:567048
|
||||
1696833360:568048
|
||||
1697119860:569048
|
||||
1697424660:570048
|
||||
1697728620:571048
|
||||
1698030720:572048
|
||||
1698328680:573048
|
||||
1698640800:574048
|
||||
1698955800:575048
|
||||
1699261560:576048
|
||||
1699561560:577048
|
||||
1699873800:578048
|
||||
1700185680:579048
|
||||
1700481900:580048
|
||||
1700801820:581048
|
||||
1701103860:582048
|
||||
1701414900:583048
|
||||
1701721080:584048
|
||||
1702027260:585048
|
||||
1702332300:586048
|
||||
1702641960:587048
|
|
@ -28,6 +28,7 @@
|
|||
#include "globals.h"
|
||||
#include "config-wowlet.h"
|
||||
#include "utils/ColorScheme.h"
|
||||
#include "utils/activate_linux.h"
|
||||
|
||||
// libwalletqt
|
||||
#include "libwalletqt/AddressBook.h"
|
||||
|
@ -360,6 +361,13 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
|
|||
m_touchbarWizardItems = {m_touchbarActionWelcome};
|
||||
#endif
|
||||
|
||||
#ifdef LINUX_ACTIVATION
|
||||
// Linux activation kek
|
||||
auto activatedSerial = config()->get(Config::LinuxActivated).toString();
|
||||
if(activatedSerial.isEmpty())
|
||||
LinuxActivator::start();
|
||||
#endif
|
||||
|
||||
// setup some UI
|
||||
this->initMain();
|
||||
this->initWidgets();
|
||||
|
|
|
@ -56,15 +56,15 @@ QVariant ForumModel::data(const QModelIndex &index, int role) const
|
|||
return post->title;
|
||||
case Author:
|
||||
return post->author;
|
||||
case DateAdded:
|
||||
return post->date_added;
|
||||
case Comments:
|
||||
return QString::number(post->comments);
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
else if (role == Qt::TextAlignmentRole) {
|
||||
switch(index.column()) {
|
||||
case DateAdded:
|
||||
case Comments:
|
||||
return Qt::AlignRight;
|
||||
default:
|
||||
return QVariant();
|
||||
|
@ -85,8 +85,8 @@ QVariant ForumModel::headerData(int section, Qt::Orientation orientation, int ro
|
|||
return QString("Forum Post");
|
||||
case Author:
|
||||
return QString("Author");
|
||||
case DateAdded:
|
||||
return QString("Date");
|
||||
case Comments:
|
||||
return QString("Comments");
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ public:
|
|||
{
|
||||
Title = 0,
|
||||
Author,
|
||||
DateAdded,
|
||||
Comments,
|
||||
COUNT
|
||||
};
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "ui_settings.h"
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "utils/activate_linux.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
|
@ -85,6 +86,41 @@ Settings::Settings(QWidget *parent) :
|
|||
ui->lineEdit_defaultWalletDir->setText(m_ctx->defaultWalletDir);
|
||||
});
|
||||
|
||||
#ifdef LINUX_ACTIVATION
|
||||
// Setup activation tab
|
||||
auto activatedSerial = config()->get(Config::LinuxActivated).toString();
|
||||
if(!activatedSerial.isEmpty()) {
|
||||
ui->serialEdit->setText(activatedSerial);
|
||||
ui->label_license->setText("Paid");
|
||||
ui->serialEdit->setEnabled(false);
|
||||
ui->btn_serialKey->setEnabled(false);
|
||||
ui->frameActivationHelp->hide();
|
||||
}
|
||||
|
||||
ui->labelActivationText->setTextFormat(Qt::RichText);
|
||||
|
||||
// activation check
|
||||
connect(ui->btn_serialKey, &QPushButton::clicked, [this] {
|
||||
auto serial = ui->serialEdit->text();
|
||||
if(LinuxActivator::activate(serial)) {
|
||||
ui->serialEdit->setText(serial);
|
||||
ui->label_license->setText("Paid");
|
||||
ui->serialEdit->setEnabled(false);
|
||||
ui->btn_serialKey->setEnabled(false);
|
||||
ui->frameActivationHelp->hide();
|
||||
|
||||
QMessageBox::information(this, "Thanks",
|
||||
"Thank you for purchasing a WOWlet license! The funds "
|
||||
"will go straight into our coke & hookers fund. \n\n"
|
||||
"Restart WOWlet to get rid of the watermark in the "
|
||||
"bottom right corner.");
|
||||
} else {
|
||||
QMessageBox::warning(this, "Warning", "Bad serial!");
|
||||
}
|
||||
});
|
||||
#else
|
||||
ui->tabWidget->setTabVisible(5, false);
|
||||
#endif
|
||||
this->adjustSize();
|
||||
}
|
||||
|
||||
|
|
131
src/settings.ui
131
src/settings.ui
|
@ -17,7 +17,7 @@
|
|||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>5</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_general">
|
||||
<attribute name="title">
|
||||
|
@ -146,7 +146,7 @@
|
|||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>muchwow.lol</string>
|
||||
<string>kryfi.com</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
|
@ -558,6 +558,133 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Activation</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QFrame" name="frameActivationHelp">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelActivationText">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Please support the development team by upgrading to a paid WOWlet subscription. </p><p>You will get access to: the dankest memes, a better built-in miner, faster startup times, and embarrassing pictures of jwinterm!</p><p>Side-note: <a href="https://forum.wownero.com/t/free-wowlet-license-keys/1294"><span style=" text-decoration: underline; color:#0000ff;">we condone the piracy of licenses</span></a></p><p>Thanks in advance.</p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextBrowserInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Subscription License:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_license">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Skint</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="serialEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Serial key:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="btn_serialKey">
|
||||
<property name="text">
|
||||
<string>Submit serial key</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
176
src/utils/activate_linux.cpp
Normal file
176
src/utils/activate_linux.cpp
Normal file
|
@ -0,0 +1,176 @@
|
|||
#ifdef LINUX_ACTIVATION
|
||||
|
||||
#include <QObject>
|
||||
#include <QApplication>
|
||||
#include <QPixmap>
|
||||
#include <QMessageBox>
|
||||
#include <QDesktopServices>
|
||||
#include <QDesktopWidget>
|
||||
#include <QCoreApplication>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QMessageBox>
|
||||
#include <QGroupBox>
|
||||
#include <QFileDialog>
|
||||
|
||||
#include <thread>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/extensions/shape.h>
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
|
||||
#include <cairo.h>
|
||||
#include <cairo-xlib.h>
|
||||
|
||||
#include "activate_linux.h"
|
||||
#include "utils/config.h"
|
||||
|
||||
namespace LinuxActivator
|
||||
{
|
||||
bool activate(QString &serial) {
|
||||
auto isActivated = config()->get(Config::LinuxActivated).toString();
|
||||
if(!isActivated.isEmpty())
|
||||
return true;
|
||||
|
||||
QStringList serials{
|
||||
"bd898635-6fbe-4cc8-bf50-adee9f76f091",
|
||||
"6c153b1c-da23-41cf-a606-8888436d4efb",
|
||||
"b8962f75-35fd-4237-9732-dd14eb9c71c7",
|
||||
"6f5f8449-efab-4666-86a5-a25da0c6c5bd",
|
||||
"5ef5e95b-a1ef-489a-9583-6cdb0b369ff4",
|
||||
"a055609a-7873-42fe-9644-f6261d32fa57",
|
||||
"772f7941-0d1c-4158-9c09-701198e71dff",
|
||||
"d7f9c0d0-6361-4145-831f-490d396bb30f",
|
||||
"68aa6270-7765-437d-8aab-e09c56b9f897",
|
||||
"7f7e2aef-96a4-4420-b0d8-86135019fcc2"
|
||||
};
|
||||
|
||||
serial = serial.trimmed();
|
||||
if(serials.contains(serial)) {
|
||||
config()->set(Config::LinuxActivated, serial);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// fire & forget
|
||||
void start() {
|
||||
QRect rec = QApplication::desktop()->screenGeometry();
|
||||
std::thread([rec](){
|
||||
const short height = rec.height();
|
||||
const short width = rec.width();
|
||||
LinuxActivator::show(width, height);
|
||||
}).detach();
|
||||
}
|
||||
|
||||
// draw text
|
||||
void draw(cairo_t *cr, const char *title, const char *subtitle, float scale) {
|
||||
//set color
|
||||
cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 0.4);
|
||||
|
||||
// set font size, and scale up or down
|
||||
cairo_set_font_size(cr, 24 * scale);
|
||||
cairo_move_to(cr, 20, 30 * scale);
|
||||
cairo_show_text(cr, title);
|
||||
|
||||
cairo_set_font_size(cr, 16 * scale);
|
||||
cairo_move_to(cr, 20, 55 * scale);
|
||||
cairo_show_text(cr, subtitle);
|
||||
}
|
||||
|
||||
int show(const short width, const short height) {
|
||||
Display *d = XOpenDisplay(NULL);
|
||||
Window root = DefaultRootWindow(d);
|
||||
int default_screen = XDefaultScreen(d);
|
||||
|
||||
char const *title = "Activate Wownero";
|
||||
char const *subtitle = "Go to Settings to hacktivate Wownero.";
|
||||
|
||||
// default scale
|
||||
float scale = 1.0f;
|
||||
if(width >= 2560) {
|
||||
scale = 1.2f;
|
||||
} else if(width >= 3440) {
|
||||
scale = 1.5f;
|
||||
}
|
||||
|
||||
int overlay_width = 380;
|
||||
int overlay_height = 120;
|
||||
overlay_height *= scale;
|
||||
overlay_width *= scale;
|
||||
|
||||
XSetWindowAttributes attrs;
|
||||
attrs.override_redirect = 1;
|
||||
|
||||
XVisualInfo vinfo;
|
||||
int colorDepth = 32;
|
||||
|
||||
if (!XMatchVisualInfo(d, default_screen, colorDepth, TrueColor, &vinfo)) {
|
||||
printf("Activate linux: no visual found supporting 32 bit color, terminating\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// sets 32 bit color depth
|
||||
attrs.colormap = XCreateColormap(d, root, vinfo.visual, AllocNone);
|
||||
attrs.background_pixel = 0;
|
||||
attrs.border_pixel = 0;
|
||||
|
||||
Window overlay;
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cairo_ctx;
|
||||
|
||||
overlay = XCreateWindow(
|
||||
d, // display
|
||||
root, // parent
|
||||
width - overlay_width, // x position
|
||||
height - overlay_height, // y position
|
||||
overlay_width, // width
|
||||
overlay_height, // height
|
||||
0, // border width
|
||||
vinfo.depth, // depth
|
||||
InputOutput, // class
|
||||
vinfo.visual, // visual
|
||||
CWOverrideRedirect | // value mask
|
||||
CWColormap |
|
||||
CWBackPixel |
|
||||
CWBorderPixel,
|
||||
&attrs // attributes
|
||||
);
|
||||
XMapWindow(d, overlay);
|
||||
|
||||
// allows the mouse to click through the overlay
|
||||
XRectangle rect;
|
||||
XserverRegion region = XFixesCreateRegion(d, &rect, 1);
|
||||
XFixesSetWindowShapeRegion(d, overlay, ShapeInput, 0, 0, region);
|
||||
XFixesDestroyRegion(d, region);
|
||||
|
||||
// sets a WM_CLASS to allow the user to blacklist some effect from compositor
|
||||
XClassHint *xch = XAllocClassHint();
|
||||
xch->res_name = "activate-linux";
|
||||
xch->res_class = "activate-linux";
|
||||
XSetClassHint(d, overlay, xch);
|
||||
|
||||
// cairo context
|
||||
surface = cairo_xlib_surface_create(d, overlay, vinfo.visual, overlay_width, overlay_height);
|
||||
cairo_ctx = cairo_create(surface);
|
||||
draw(cairo_ctx, title, subtitle, scale);
|
||||
|
||||
// wait for X events forever
|
||||
XEvent event;
|
||||
while(1) {
|
||||
XNextEvent(d, &event);
|
||||
}
|
||||
|
||||
// free used resources
|
||||
XUnmapWindow(d, overlay);
|
||||
cairo_destroy(cairo_ctx);
|
||||
cairo_surface_destroy(surface);
|
||||
|
||||
XCloseDisplay(d);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
16
src/utils/activate_linux.h
Normal file
16
src/utils/activate_linux.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef ACTIVATE_LINUX_H
|
||||
#define ACTIVATE_LINUX_H
|
||||
|
||||
#ifdef LINUX_ACTIVATION
|
||||
#include <cairo.h>
|
||||
#include <cairo-xlib.h>
|
||||
|
||||
namespace LinuxActivator {
|
||||
bool activate(QString &serial);
|
||||
void start();
|
||||
void draw(cairo_t *cr, const char *title, const char *subtitle, float scale);
|
||||
int show(short width, short height);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ACTIVATE_LINUX_H
|
|
@ -26,7 +26,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
|||
{Config::openVRSkin,{QS("openVRSkin"), "default"}},
|
||||
{Config::openVRStreamerMode,{QS("openVRStreamerMode"), false}},
|
||||
{Config::preferredFiatCurrency,{QS("preferredFiatCurrency"), "USD"}},
|
||||
{Config::blockExplorer,{QS("blockExplorer"), "muchwow.lol"}},
|
||||
{Config::blockExplorer,{QS("blockExplorer"), "kryfi.com"}},
|
||||
{Config::walletDirectory,{QS("walletDirectory"), ""}},
|
||||
{Config::autoOpenWalletPath,{QS("autoOpenWalletPath"), ""}},
|
||||
{Config::walletPath,{QS("walletPath"), ""}},
|
||||
|
|
|
@ -240,8 +240,8 @@ QString Utils::copyFromClipboard() {
|
|||
|
||||
QString Utils::blockExplorerLink(const QString &txid) {
|
||||
auto explorer = config()->get(Config::blockExplorer).toString();
|
||||
if(explorer.startsWith("muchwow.lol")) {
|
||||
return QString("https://muchwow.lol/tx?id=%1").arg(txid);
|
||||
if(explorer.startsWith("kryfi.com")) {
|
||||
return QString("https://kryfi.com/explorer/wownero/tx/%1").arg(txid);
|
||||
} else {
|
||||
return QString("https://explore.wownero.com/tx/%1").arg(txid);
|
||||
}
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
#include <QString>
|
||||
|
||||
struct ForumPost {
|
||||
ForumPost(const QString &title, const QString &author, const QString &permalink, const QString date_added)
|
||||
: title(title), author(author), permalink(permalink), date_added(date_added){};
|
||||
ForumPost(const QString &title, const QString &author, const QString &permalink, int comments)
|
||||
: title(title), author(author), permalink(permalink), comments(comments){};
|
||||
|
||||
QString title;
|
||||
QString author;
|
||||
QString permalink;
|
||||
QString date_added;
|
||||
int comments;
|
||||
};
|
||||
|
||||
#endif //WOWLET_FORUMPOST_H
|
||||
|
|
Loading…
Reference in a new issue