41 Commits

Author SHA1 Message Date
dsc ee3713b16b Merge pull request 'Bump version to v2.1.0 and fix compile' (#75) from dsc/wowlet:bump-version3 into master 1 month ago
dsc ae39e71061 Bump version to v2.1.0 and fix compile 1 month ago
dsc 7e5cac9fa3 Merge pull request 'Improve QR code detection for VR' (#73) from dsc/wowlet:improve-qr-code-detection into master 1 month ago
dsc b61b2b1630 Improve QR code detection 1 month ago
wowario 1b1d1db14d Merge pull request 'Failsafe kill feature' (#72) from dsc/wowlet:killme into master 1 month ago
dsc 81ec0183ea Failsafe kill feature; to be used in case of an exploit against wowlet and/or a bug that results in loss of funds 1 month ago
wowario f5046cea54 Merge pull request 'Custom SuchWow donation tip amount' (#71) from dsc/wowlet:suchwow-custom-donation-amount into master 1 month ago
dsc 624f13b2d9 Custom SuchWow donation tip amount 1 month ago
wowario 0d502f0e45 Merge pull request 'Warn when there is a new version available' (#70) from dsc/wowlet:warn-on-outdated-version into master 1 month ago
dsc 6549ca4e1d Warn when there is a new version available 1 month ago
dsc 37578dde7b Merge pull request 'add imgs to assets list' (#65) from wowario/wowlet:banner1 into master 1 month ago
wowario 225ae1233e
add imgs to assets list 1 month ago
wowario d8cb29c4d4 Merge pull request 'Forum post widget showing latest from forum.wownero.com' (#64) from dsc/wowlet:forum-posts-homewidget into master 1 month ago
wowario 502785f233 Merge pull request 'New header image for about dialog' (#63) from dsc/wowlet:image-about-page into master 1 month ago
wowario e3cf87906b Merge pull request 'Fix config option reddit' (#62) from dsc/wowlet:fix-settings-reddit into master 1 month ago
wowario 5c3821007d Merge pull request 'Optionally (only) hide fiat balance' (#61) from dsc/wowlet:hide-fiat-balance into master 1 month ago
dsc c02e084dcf Forum post widget showing latest from forum.wownero.com 1 month ago
dsc 85d4e0ac6d New header image for about dialog 1 month ago
dsc fbca9c9340 Fix config option reddit 1 month ago
dsc d9d0ac1830 Optionally (only) hide fiat balance 1 month ago
wowario 3adb2a6fe7 Merge pull request 'Show random banner on each Wizard window spawn' (#58) from dsc/wowlet:random-banner into master 1 month ago
wowario 742ad82b88 Merge pull request 'Redesigned icon by cisme' (#59) from dsc/wowlet:redesigned-icon into master 1 month ago
dsc a1ce8f866a Merge pull request 'mo imgs' (#60) from wowario/wowlet:banners into master 1 month ago
wowario 24e8942ac5
mo imgs 1 month ago
dsc 3163d68e9e Show random banner on each Wizard window spawn 1 month ago
dsc a6e1a6877f Redesigned icon by cisme 1 month ago
wowario ac1ed1873a Merge pull request 'Include Satoshi ticker, include Monero ticker, and introduce 24h pct change for WOW' (#57) from dsc/wowlet:refactor-tickers into master 1 month ago
dsc 2ccefe0883 Include Satoshi ticker, include Monero ticker, and introduce 24h pct change for WOW 1 month ago
wowario 06f09e1f2e Merge pull request 'Fixes connect bug (via context menu) for custom nodes' (#56) from dsc/wowlet:connect-bug into master 2 months ago
dsc c3e9fbb25a Fixes connect bug (via context menu) for custom nodes 2 months ago
wowario 096b28318c Merge pull request 'SuchWow improvements' (#55) from dsc/wowlet:suchwow-improvements into master 2 months ago
wowario 562d071c62 Merge pull request 'Detect wakeup from hibernate, re-establish websocket connection' (#54) from dsc/wowlet:hibernate-timer into master 2 months ago
dsc 474d4b1994 - only download thumbnails for the overview. Download the large format images later - when requesting to view the image. This saves bandwidth. 2 months ago
dsc 49b55768f7 Detect wakeup from hibernate, re-establish websocket connection 2 months ago
dsc 640a4d72e0 Merge pull request 'Update .deb builder and include XMRig functionality by default on Linux' (#53) from dsc/wowlet:update-deb-and-xmrig into master 2 months ago
dsc 0e37f97aa2 Update .deb builder and including XMRig functionality by default for Linux 2 months ago
dsc 499ad4a3aa Merge pull request 'Android app proof-of-concept' (#48) from dsc/wowlet:android into master 2 months ago
dsc 8b5bdc4c6a Initial Android app proof-of-concept 2 months ago
dsc cfee938516 Prepare Wowlet codebase for an Android app 2 months ago
dsc c024323eab Prepare CMake for Android deployment and development 2 months ago
dsc a2ad4692a3 Dockerfile for Android compiles. Most of this work is done by xiphon of the Monero GUI team. 2 months ago
  1. 45
      CMakeLists.txt
  2. 245
      Dockerfile.android
  3. 2
      Makefile
  4. 1
      cmake/config-wowlet.h.cmake
  5. 12
      contrib/debian/build-deb.sh
  6. BIN
      contrib/debian/changelog.gz
  7. 2
      contrib/debian/control
  8. 8
      docs/BUILDING.md
  9. 4
      docs/HACKING.md
  10. 84
      src/CMakeLists.txt
  11. 176
      src/appcontext.cpp
  12. 21
      src/appcontext.h
  13. 49
      src/assets.qrc
  14. BIN
      src/assets/images/credits.jpg
  15. BIN
      src/assets/images/pls_update.jpg
  16. BIN
      src/assets/images/welcome/wow100.png
  17. BIN
      src/assets/images/welcome/wow101.png
  18. BIN
      src/assets/images/welcome/wow102.png
  19. BIN
      src/assets/images/welcome/wow103.png
  20. BIN
      src/assets/images/welcome/wow104.png
  21. BIN
      src/assets/images/welcome/wow105.png
  22. BIN
      src/assets/images/welcome/wow106.png
  23. BIN
      src/assets/images/welcome/wow107.png
  24. BIN
      src/assets/images/welcome/wow108.png
  25. BIN
      src/assets/images/welcome/wow109.png
  26. BIN
      src/assets/images/welcome/wow110.png
  27. BIN
      src/assets/images/welcome/wow111.png
  28. BIN
      src/assets/images/welcome/wow112.png
  29. BIN
      src/assets/images/welcome/wow113.png
  30. BIN
      src/assets/images/welcome/wow114.png
  31. BIN
      src/assets/images/welcome/wow115.png
  32. BIN
      src/assets/images/welcome/wow116.png
  33. BIN
      src/assets/images/welcome/wow117.png
  34. BIN
      src/assets/images/welcome/wow118.png
  35. BIN
      src/assets/images/welcome/wow119.png
  36. BIN
      src/assets/images/welcome/wow120.png
  37. BIN
      src/assets/images/welcome/wow121.png
  38. BIN
      src/assets/images/welcome/wow122.png
  39. BIN
      src/assets/images/welcome/wow123.png
  40. BIN
      src/assets/images/welcome/wow77.png
  41. BIN
      src/assets/images/welcome/wow78.png
  42. BIN
      src/assets/images/welcome/wow79.png
  43. BIN
      src/assets/images/welcome/wow80.png
  44. BIN
      src/assets/images/welcome/wow81.png
  45. BIN
      src/assets/images/welcome/wow82.png
  46. BIN
      src/assets/images/welcome/wow83.png
  47. BIN
      src/assets/images/welcome/wow84.png
  48. BIN
      src/assets/images/welcome/wow85.png
  49. BIN
      src/assets/images/welcome/wow86.png
  50. BIN
      src/assets/images/welcome/wow87.png
  51. BIN
      src/assets/images/welcome/wow88.png
  52. BIN
      src/assets/images/welcome/wow89.png
  53. BIN
      src/assets/images/welcome/wow90.png
  54. BIN
      src/assets/images/welcome/wow91.png
  55. BIN
      src/assets/images/welcome/wow92.png
  56. BIN
      src/assets/images/welcome/wow93.png
  57. BIN
      src/assets/images/welcome/wow94.png
  58. BIN
      src/assets/images/welcome/wow95.png
  59. BIN
      src/assets/images/welcome/wow96.png
  60. BIN
      src/assets/images/welcome/wow97.png
  61. BIN
      src/assets/images/welcome/wow98.png
  62. BIN
      src/assets/images/welcome/wow99.png
  63. BIN
      src/assets/images/wowlet.png
  64. BIN
      src/assets/images/wowlet_old.png
  65. 4
      src/dialog/aboutdialog.cpp
  66. 44
      src/dialog/updatedialog.cpp
  67. 31
      src/dialog/updatedialog.h
  68. 108
      src/dialog/updatedialog.ui
  69. 2
      src/libwalletqt/Wallet.cpp
  70. 44
      src/main.cpp
  71. 147
      src/mainwindow.cpp
  72. 26
      src/mainwindow.h
  73. 41
      src/mainwindow.ui
  74. 45
      src/mobile/README.md
  75. 102
      src/mobile/main.cpp
  76. 92
      src/mobile/main.h
  77. 35
      src/mobile/main.qml
  78. 5
      src/mobile/qml.qrc
  79. 104
      src/model/ForumModel.cpp
  80. 41
      src/model/ForumModel.h
  81. 2
      src/sendwidget.cpp
  82. 7
      src/settings.cpp
  83. 9
      src/settings.ui
  84. 7
      src/utils/config.cpp
  85. 5
      src/utils/config.h
  86. 5
      src/utils/networking.cpp
  87. 2
      src/utils/networking.h
  88. 4
      src/utils/prices.cpp
  89. 2
      src/utils/prices.h
  90. 40
      src/utils/utils.cpp
  91. 11
      src/utils/utils.h
  92. 26
      src/vr/main.cpp
  93. 6
      src/vr/qml/wallet/send/SendPageQR.qml
  94. 19
      src/widgets/ForumPost.h
  95. 74
      src/widgets/forumwidget.cpp
  96. 42
      src/widgets/forumwidget.h
  97. 61
      src/widgets/forumwidget.ui
  98. 7
      src/widgets/nodewidget.cpp
  99. 85
      src/widgets/suchwowwidget.cpp
  100. 48
      src/widgets/suchwowwidget.h

45
CMakeLists.txt

@ -4,18 +4,20 @@ project(wowlet)
message(STATUS "Initiating compile using CMake ${CMAKE_VERSION}")
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(VERSION_MAJOR "0")
set(VERSION_MINOR "2")
set(VERSION_MAJOR "2")
set(VERSION_MINOR "1")
set(VERSION_REVISION "0")
set(VERSION "beta-2")
set(VERSION "beta-3")
option(FETCH_DEPS "Download dependencies if they are not found" ON)
option(XMRIG "Include XMRig module" ON)
option(OPENVR "Include OpenVR support" OFF)
option(QML "Include QtQuick (QML)" OFF)
option(TOR_BIN "Path to Tor binary to embed inside WOWlet" OFF)
option(OPENVR "Include OpenVR support")
option(QML "Include QtQuick (QML)")
option(ANDROID "Android deployment")
option(ANDROID_DEBUG "View the Android app on desktop")
option(TOR_BIN "Path to Tor binary to embed inside WOWlet")
option(STATIC "Link libraries statically, requires static Qt")
option(USE_DEVICE_TREZOR "Trezor support compilation" OFF)
option(USE_DEVICE_TREZOR "Trezor support compilation")
option(DONATE_BEG "Prompt donation window every once in a while" ON)
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
include(CheckCCompilerFlag)
@ -28,11 +30,10 @@ include(CheckSymbolExists)
set(WOWNERO_HEAD "f611d5c9e32bc62f1735f6571b0bdb95cc020531")
set(BUILD_GUI_DEPS ON)
set(ARCH "x86-64")
set(BUILD_64 ON)
set(BUILD_64 ON CACHE BOOL "Build 64-bit binaries")
set(INSTALL_VENDORED_LIBUNBOUND ${STATIC})
set(USE_SINGLE_BUILDDIR ON)
if(OPENVR)
if(OPENVR OR ANDROID_DEBUG)
set(QML ON)
endif()
@ -41,10 +42,7 @@ set(_CMAKE_BUILD_TYPE "")
string(TOUPPER "${CMAKE_BUILD_TYPE}" _CMAKE_BUILD_TYPE)
if("${_CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
set(DEBUG ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
message(STATUS "OPENVR: ${OPENVR}")
message(STATUS "QML: ${QML}")
endif()
check_include_file(sys/prctl.h HAVE_SYS_PRCTL_H)
@ -173,7 +171,7 @@ find_package(Boost 1.58 REQUIRED COMPONENTS
program_options
locale)
if(UNIX AND NOT APPLE)
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)
@ -195,6 +193,17 @@ if("$ENV{DRONE}" STREQUAL "true")
message(STATUS "We are inside a static compile with Drone CI")
endif()
if(UNIX)
if(NOT CMAKE_PREFIX_PATH AND DEFINED ENV{CMAKE_PREFIX_PATH})
message(STATUS "Using CMAKE_PREFIX_PATH environment variable: '$ENV{CMAKE_PREFIX_PATH}'")
set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
endif()
if(APPLE AND NOT CMAKE_PREFIX_PATH)
execute_process(COMMAND brew --prefix qt5 OUTPUT_VARIABLE QT5_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
list(APPEND CMAKE_PREFIX_PATH ${QT5_DIR})
endif()
endif()
# To build WOWlet with embedded (and static) Tor, pass CMake -DTOR_BIN=/path/to/tor
if(TOR_BIN)
if(APPLE)
@ -249,7 +258,7 @@ if(MINGW)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj")
set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi;crypt32;bcrypt)
if(DEPENDS)
set(ICU_LIBRARIES iconv)
set(ICU_LIBRARIES iconv)
else()
set(ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv)
endif()
@ -264,7 +273,7 @@ elseif(DRAGONFLY)
set(EXTRA_LIBRARIES execinfo ${COMPAT})
elseif(CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
set(EXTRA_LIBRARIES socket nsl resolv)
elseif(NOT MSVC AND NOT DEPENDS)
elseif(NOT MSVC AND NOT DEPENDS AND NOT ANDROID)
find_library(RT rt)
set(EXTRA_LIBRARIES ${RT})
endif()
@ -384,10 +393,6 @@ if(OPENVR)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/contrib/openvr")
endif()
if(APPLE)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/contrib/KDMacTouchBar")
endif()
if(WITH_SCANNER)
add_library(quirc STATIC
contrib/quirc/lib/decode.c

245
Dockerfile.android

@ -0,0 +1,245 @@
FROM debian:stretch
ARG THREADS=1
ARG ANDROID_NDK_REVISION=21d
ARG ANDROID_NDK_HASH=bcf4023eb8cb6976a4c7cff0a8a8f145f162bf4d
ARG ANDROID_SDK_REVISION=4333796
ARG ANDROID_SDK_HASH=92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9
ARG QT_VERSION=5.15.2
WORKDIR /opt/android
ENV WORKDIR=/opt/android
ENV ANDROID_NATIVE_API_LEVEL=28
ENV ANDROID_API=android-${ANDROID_NATIVE_API_LEVEL}
ENV ANDROID_CLANG=aarch64-linux-android${ANDROID_NATIVE_API_LEVEL}-clang
ENV ANDROID_CLANGPP=aarch64-linux-android${ANDROID_NATIVE_API_LEVEL}-clang++
ENV ANDROID_NDK_ROOT=${WORKDIR}/android-ndk-r${ANDROID_NDK_REVISION}
ENV ANDROID_SDK_ROOT=${WORKDIR}/tools
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
ENV PATH=${JAVA_HOME}/bin:${PATH}
ENV PREFIX=${WORKDIR}/prefix
ENV TOOLCHAIN_DIR=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64
RUN apt-get update \
&& apt-get install -y ant automake build-essential ca-certificates-java file gettext git libc6 libncurses5 \
libssl-dev libstdc++6 libtinfo5 libtool libz1 openjdk-8-jdk-headless openjdk-8-jre-headless pkg-config python3 \
unzip wget
RUN wget -q https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_REVISION}.zip \
&& unzip -q sdk-tools-linux-${ANDROID_SDK_REVISION}.zip \
&& rm -f sdk-tools-linux-${ANDROID_SDK_REVISION}.zip
RUN wget -q https://dl.google.com/android/repository/android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip \
&& unzip -q android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip \
&& rm -f android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip
RUN cd ${ANDROID_SDK_ROOT} && echo y | ./bin/sdkmanager "platform-tools" "platforms;${ANDROID_API}" "tools" > /dev/null
RUN cp -r ${WORKDIR}/platforms ${WORKDIR}/platform-tools ${ANDROID_SDK_ROOT}
ENV HOST_PATH=${PATH}
ENV PATH=${TOOLCHAIN_DIR}/aarch64-linux-android/bin:${TOOLCHAIN_DIR}/bin:${PATH}
ARG ZLIB_VERSION=1.2.11
ARG ZLIB_HASH=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
RUN wget -q https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz \
&& tar -xzf zlib-${ZLIB_VERSION}.tar.gz \
&& rm zlib-${ZLIB_VERSION}.tar.gz \
&& cd zlib-${ZLIB_VERSION} \
&& CC=${ANDROID_CLANG} CXX=${ANDROID_CLANGPP} ./configure --prefix=${PREFIX} --static \
&& make -j${THREADS} \
&& make -j${THREADS} install \
&& rm -rf $(pwd)
RUN git clone git://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 \
&& cd qt5 \
&& perl init-repository --module-subset=default,-qtwebengine \
&& PATH=${HOST_PATH} ./configure -v -developer-build -release \
-xplatform android-clang \
-android-ndk-platform ${ANDROID_API} \
-android-ndk ${ANDROID_NDK_ROOT} \
-android-sdk ${ANDROID_SDK_ROOT} \
-android-ndk-host linux-x86_64 \
-no-dbus \
-opengl es2 \
-no-use-gold-linker \
-no-sql-mysql \
-opensource -confirm-license \
-android-arch arm64-v8a \
-prefix ${PREFIX} \
-nomake tools -nomake tests -nomake examples \
-skip qtwebengine \
-skip qtserialport \
-skip qtconnectivity \
-skip qttranslations \
-skip qtpurchasing \
-skip qtgamepad -skip qtscript -skip qtdoc \
-no-warnings-are-errors \
&& sed -i '213,215d' qtbase/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h \
&& PATH=${HOST_PATH} make -j${THREADS} \
&& PATH=${HOST_PATH} make -j${THREADS} install \
&& cd qttools/src/linguist/lrelease \
&& ../../../../qtbase/bin/qmake \
&& PATH=${HOST_PATH} make -j${THREADS} install \
&& cd ../../../.. \
&& rm -rf $(pwd)
ARG ICONV_VERSION=1.16
ARG ICONV_HASH=e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04
RUN wget -q http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz \
&& echo "${ICONV_HASH} libiconv-${ICONV_VERSION}.tar.gz" | sha256sum -c \
&& tar -xzf libiconv-${ICONV_VERSION}.tar.gz \
&& rm -f libiconv-${ICONV_VERSION}.tar.gz \
&& cd libiconv-${ICONV_VERSION} \
&& CC=${ANDROID_CLANG} CXX=${ANDROID_CLANGPP} ./configure --build=x86_64-linux-gnu --host=aarch64 --prefix=${PREFIX} --disable-rpath \
&& make -j${THREADS} \
&& make -j${THREADS} install
ARG BOOST_VERSION=1_74_0
ARG BOOST_VERSION_DOT=1.74.0
ARG BOOST_HASH=83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1
RUN wget -q https://dl.bintray.com/boostorg/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.bz2 \
&& echo "${BOOST_HASH} boost_${BOOST_VERSION}.tar.bz2" | sha256sum -c \
&& tar -xf boost_${BOOST_VERSION}.tar.bz2 \
&& rm -f boost_${BOOST_VERSION}.tar.bz2 \
&& cd boost_${BOOST_VERSION} \
&& PATH=${HOST_PATH} ./bootstrap.sh --prefix=${PREFIX} \
&& PATH=${TOOLCHAIN_DIR}/bin:${HOST_PATH} ./b2 --build-type=minimal link=static runtime-link=static \
--with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization \
--with-system --with-thread --with-locale --build-dir=android --stagedir=android toolset=clang threading=multi \
threadapi=pthread target-os=android -sICONV_PATH=${PREFIX} \
cflags='--target=aarch64-linux-android' \
cxxflags='--target=aarch64-linux-android' \
linkflags='--target=aarch64-linux-android --sysroot=${ANDROID_NDK_ROOT}/platforms/${ANDROID_API}/arch-arm64 ${ANDROID_NDK_ROOT}/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so -nostdlib++' \
install -j${THREADS} \
&& rm -rf $(pwd)
ARG OPENSSL_VERSION=1.1.1g
ARG OPENSSL_HASH=ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46
RUN wget -q https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
&& tar -xzf openssl-${OPENSSL_VERSION}.tar.gz \
&& rm openssl-${OPENSSL_VERSION}.tar.gz \
&& cd openssl-${OPENSSL_VERSION} \
&& ANDROID_NDK_HOME=${ANDROID_NDK_ROOT} ./Configure CC=${ANDROID_CLANG} CXX=${ANDROID_CLANGPP} \
android-arm64 no-asm no-shared --static \
--with-zlib-include=${PREFIX}/include --with-zlib-lib=${PREFIX}/lib \
--prefix=${PREFIX} --openssldir=${PREFIX} \
&& sed -i 's/CNF_EX_LIBS=-ldl -pthread//g;s/BIN_CFLAGS=-pie $(CNF_CFLAGS) $(CFLAGS)//g' Makefile \
&& ANDROID_NDK_HOME=${ANDROID_NDK_ROOT} make -j${THREADS} \
&& make -j${THREADS} install \
&& rm -rf $(pwd)
ARG ZMQ_VERSION=v4.3.3
ARG ZMQ_HASH=04f5bbedee58c538934374dc45182d8fc5926fa3
RUN git clone https://github.com/zeromq/libzmq.git -b ${ZMQ_VERSION} --depth 1 \
&& cd libzmq \
&& git checkout ${ZMQ_HASH} \
&& ./autogen.sh \
&& CC=${ANDROID_CLANG} CXX=${ANDROID_CLANGPP} ./configure --prefix=${PREFIX} --host=aarch64-linux-android \
--enable-static --disable-shared \
&& make -j${THREADS} \
&& make -j${THREADS} install \
&& rm -rf $(pwd)
ARG SODIUM_VERSION=1.0.18
ARG SODIUM_HASH=4f5e89fa84ce1d178a6765b8b46f2b6f91216677
RUN set -ex \
&& git clone https://github.com/jedisct1/libsodium.git -b ${SODIUM_VERSION} --depth 1 \
&& cd libsodium \
&& test `git rev-parse HEAD` = ${SODIUM_HASH} || exit 1 \
&& ./autogen.sh \
&& CC=${ANDROID_CLANG} CXX=${ANDROID_CLANGPP} ./configure --prefix=${PREFIX} --host=aarch64-linux-android --enable-static --disable-shared \
&& make -j${THREADS} install \
&& rm -rf $(pwd)
RUN git clone -b libgpg-error-1.38 --depth 1 git://git.gnupg.org/libgpg-error.git \
&& cd libgpg-error \
&& git reset --hard 71d278824c5fe61865f7927a2ed1aa3115f9e439 \
&& ./autogen.sh \
&& CC=${ANDROID_CLANG} CXX=${ANDROID_CLANGPP} ./configure --host=aarch64-linux-android --prefix=${PREFIX} --disable-rpath --disable-shared --enable-static --disable-doc --disable-tests \
&& PATH=${TOOLCHAIN_DIR}/bin:${HOST_PATH} make -j${THREADS} \
&& make -j${THREADS} install \
&& rm -rf $(pwd)
RUN git clone -b libgcrypt-1.8.5 --depth 1 git://git.gnupg.org/libgcrypt.git \
&& cd libgcrypt \
&& git reset --hard 56606331bc2a80536db9fc11ad53695126007298 \
&& ./autogen.sh \
&& CC=${ANDROID_CLANG} CXX=${ANDROID_CLANGPP} ./configure --host=aarch64-linux-android --prefix=${PREFIX} --with-gpg-error-prefix=${PREFIX} --disable-shared --enable-static --disable-doc --disable-tests \
&& PATH=${TOOLCHAIN_DIR}/bin:${HOST_PATH} make -j${THREADS} \
&& make -j${THREADS} install \
&& rm -rf $(pwd)
RUN cd tools \
&& wget -q http://dl-ssl.google.com/android/repository/tools_r25.2.5-linux.zip \
&& unzip -q tools_r25.2.5-linux.zip \
&& rm -f tools_r25.2.5-linux.zip \
&& echo y | ${ANDROID_SDK_ROOT}/tools/android update sdk --no-ui --all --filter build-tools-28.0.3
RUN git clone -b v3.19.7 --depth 1 https://github.com/Kitware/CMake \
&& cd CMake \
&& git reset --hard 22612dd53a46c7f9b4c3f4b7dbe5c78f9afd9581 \
&& PATH=${HOST_PATH} ./bootstrap \
&& PATH=${HOST_PATH} make -j${THREADS} \
&& PATH=${HOST_PATH} make -j${THREADS} install \
&& rm -rf $(pwd)
RUN git clone -b v1.6.35 --depth 1 https://github.com/glennrp/libpng.git && \
cd libpng && \
git reset --hard c17d164b4467f099b4484dfd4a279da0bc1dbd4a \
&& CC=${ANDROID_CLANG} CXX=${ANDROID_CLANGPP} ./configure --with-zlib-prefix="${PREFIX}" --host=aarch64-linux-android --prefix=${PREFIX} --disable-shared --enable-static \
&& PATH=${TOOLCHAIN_DIR}/bin:${HOST_PATH} make -j${THREADS} \
&& make -j${THREADS} install \
&& rm -rf $(pwd)
# @TODO: don't hardcode ANDROID_PLATFORM
RUN git clone -b v4.0.2 --depth 1 https://github.com/fukuchi/libqrencode.git && \
cd libqrencode && \
git reset --hard 59ee597f913fcfda7a010a6e106fbee2595f68e4 && \
CC=${ANDROID_CLANG} CXX=${ANDROID_CLANGPP} cmake \
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake" \
-DANDROID_PLATFORM="28" \
-DBUILD_SHARED_LIBS=OFF \
-DARCH="armv8-a" \
-DANDROID_ABI="arm64-v8a" \
-DANDROID_TOOLCHAIN=clang \
-DCMAKE_PREFIX_PATH="${PREFIX}" \
-DPNG_PNG_INCLUDE_DIR="${PREFIX}/include/libpng16/" \
-DPNG_LIBRARY="${PREFIX}/lib/libqtlibpng_arm64-v8a.a" \
-DICONV_LIBRARY=/opt/android/prefix/lib/libiconv.a \
-DICONV_INCLUDE_DIR=/opt/android/prefix/include/ \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
RUN ls -al && uname -a
# @TODO: switch to Release
CMD set -ex \
&& cd /wowlet \
&& mkdir -p build/Android/release \
&& cd build/Android/release \
&& E=1 cmake \
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake" \
-DCMAKE_PREFIX_PATH="${PREFIX}" \
-DCMAKE_FIND_ROOT_PATH="${PREFIX}" \
-DCMAKE_BUILD_TYPE=Release \
-DARCH="armv8-a" \
-DANDROID_NATIVE_API_LEVEL=${ANDROID_NATIVE_API_LEVEL} \
-DANDROID_ABI="arm64-v8a" \
-DANDROID_TOOLCHAIN=clang \
-DBoost_USE_STATIC_RUNTIME=ON \
-DLRELEASE_PATH="${PREFIX}/bin" \
-DQT_ANDROID_APPLICATION_BINARY="wowlet" \
-DWITH_SCANNER=ON \
-DUSE_DEVICE_TREZOR=OFF \
-DUSE_SINGLE_BUILDDIR=ON \
-DMANUAL_SUBMODULES=1 \
-DUSE_SINGLE_BUILDDIR=ON \
-DQML=ON \
-DANDROID=ON \
../../.. \
&& PATH=${HOST_PATH} make generate_translations_header \
&& make -j${THREADS} -C src \
&& make -j${THREADS} apk

2
Makefile

@ -27,7 +27,6 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
CMAKEFLAGS = \
-DARCH=x86_64 \
-DBUILD_64=On \
-DBUILD_TESTS=Off \
-DOPENVR=Off \
@ -43,6 +42,7 @@ CMAKEFLAGS = \
$(CMAKEFLAGS_EXTRA)
release-static: CMAKEFLAGS += -DBUILD_TAG="linux-x64"
release-static: CMAKEFLAGS += -DXMRIG=ON
release-static: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF)
release-static: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Release
release-static: CMAKEFLAGS += -DREPRODUCIBLE=$(or ${SOURCE_DATE_EPOCH},OFF)

1
cmake/config-wowlet.h.cmake

@ -3,6 +3,7 @@
#define WOWLET_VERSION "@VERSION@"
#define WOWLET_BRANCH "@WOWLET_BRANCH@"
#define WOWLET_VERSION_SEMVER "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_REVISION@"
#define MONERO_VERSION "@MONERO_VERSION@"
#define MONERO_BRANCH "@MONERO_BRANCH@"

12
contrib/debian/build-deb.sh

@ -22,13 +22,13 @@ mkdir -p "$DEBDIR/usr/share/icons/hicolor/256x256/apps/"
# Copy over assets
cp "$PWD/src/assets/control" "$DEBDIR/DEBIAN/control"
cp "$PWD/src/assets/copyright" "$DEBDIR/debian/copyright"
cp "$PWD/src/assets/copyright" "$DEBDIR/usr/share/doc/wowlet/copyright"
cp "$PWD/src/assets/changelog.gz" "$DEBDIR/usr/share/doc/wowlet/changelog.gz"
cp "$PWD/contrib/debian/control" "$DEBDIR/DEBIAN/control"
cp "$PWD/contrib/debian/copyright" "$DEBDIR/debian/copyright"
cp "$PWD/contrib/debian/copyright" "$DEBDIR/usr/share/doc/wowlet/copyright"
cp "$PWD/contrib/debian/changelog.gz" "$DEBDIR/usr/share/doc/wowlet/changelog.gz"
cp "$PWD/src/assets/org.wowlet.wowlet.metainfo.xml" "$DEBDIR/usr/share/metainfo/org.wowlet.wowlet.metainfo.xml"
cp "$PWD/README.md" "$DEBDIR/usr/share/doc/wowlet/README"
cp "$PWD/SECURITY.md" "$DEBDIR/usr/share/doc/wowlet/SECURITY"
cp "$PWD/docs/SECURITY.md" "$DEBDIR/usr/share/doc/wowlet/SECURITY"
cp "$PWD/build/bin/wowlet" "$DEBDIR/usr/bin/wowlet"
cp "$PWD/src/assets/org.wowlet.wowlet.desktop" "$DEBDIR/usr/share/applications/org.wowlet.wowlet.desktop"
cp "$PWD/src/assets/wowlet.1.gz" "$DEBDIR/usr/share/man/man1/wowlet.1.gz"
@ -43,4 +43,4 @@ cp "$PWD/src/assets/images/appicons/256x256.png" "$DEBDIR/usr/share/icons/hicolo
# Build deb package
dpkg-deb --build $DEBDIR
mv wowlet.DebDir.deb wowlet_1.0_amd64.deb
mv wowlet.DebDir.deb wowlet_2.1_amd64.deb

BIN
contrib/debian/changelog.gz

2
contrib/debian/control

@ -1,5 +1,5 @@
Package: wowlet
Version: 1.0
Version: 2.1
Section: net
Priority: optional
Architecture: amd64

8
docs/BUILDING.md

@ -27,7 +27,7 @@ Replace `master` with the desired version tag (e.g. `beta-4`) to build the relea
#### 2. Base image
```bash
docker build --tag wowlet:linux --build-arg THREADS=4 .
docker build --tag wowlet:linux --build-arg THREADS=6 .
```
Building the base image takes a while. You only need to build the base image once.
@ -37,7 +37,7 @@ Building the base image takes a while. You only need to build the base image onc
##### Standalone binary
```bash
docker run --rm -it -v $PWD:/wowlet -w /wowlet wowlet:linux sh -c 'make release-static -j4'
docker run --rm -it -v $PWD:/wowlet -w /wowlet wowlet:linux sh -c 'make release-static -j6'
```
If you're re-running a build make sure to `rm -rf build/` first.
@ -67,7 +67,7 @@ Replace `master` with the desired version tag (e.g. `beta-4`) to build the relea
```bash
docker build -f Dockerfile.windows --tag wowlet:win --build-arg THREADS=4 .
docker build -f Dockerfile.windows --tag wowlet:win --build-arg THREADS=6 .
```
Building the base image takes a while. You only need to build the base image once.
@ -75,7 +75,7 @@ Building the base image takes a while. You only need to build the base image onc
#### 3. Build
```bash
docker run --rm -it -v $PWD:/wowlet -w /wowlet wowlet:win sh -c 'make depends root=/depends target=x86_64-w64-mingw32 tag=win-x64 -j4'
docker run --rm -it -v $PWD:/wowlet -w /wowlet wowlet:win sh -c 'make windows root=/depends target=x86_64-w64-mingw32 tag=win-x64 -j6'
```
If you're re-running a build make sure to `rm -rf build/` first.

4
docs/HACKING.md

@ -28,7 +28,7 @@ by running this command: `pandoc wowlet.1.md -s -t man -o wowlet.1 && gzip wowle
apt install -y git cmake libqrencode-dev build-essential cmake libboost-all-dev \
miniupnpc libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev \
libzmq3-dev libsodium-dev libhidapi-dev libnorm-dev libusb-1.0-0-dev libpgm-dev \
libprotobuf-dev protobuf-compiler libgcrypt20-dev
libprotobuf-dev protobuf-compiler libgcrypt20-dev libpng-dev
```
## Mac OS
@ -107,6 +107,4 @@ To skip the wizards and open a wallet directly use `--wallet-file`:
./wowlet --use-local-tor --wallet-file /home/user/Wownero/wallets/bla.keys
```
It is recommended that you use `--stagenet` for development. Testnet is also possible,
but you'll have to provide Wownero a testnet node of your own.

84
src/CMakeLists.txt

@ -57,6 +57,15 @@ if(OPENVR)
list(APPEND SOURCE_FILES ${SOURCE_FILES_QML})
endif()
if(ANDROID OR ANDROID_DEBUG)
qt5_add_resources(RESOURCES mobile/qml.qrc)
file(GLOB SOURCE_FILES_QML
"mobile/*.h"
"mobile/*.cpp"
)
list(APPEND SOURCE_FILES ${SOURCE_FILES_QML})
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wno-deprecated-declarations") # @TODO: removeme
add_subdirectory(libwalletqt)
@ -98,11 +107,16 @@ if(APPLE)
list(APPEND RESOURCES ${ICON})
endif()
add_executable(wowlet ${EXECUTABLE_FLAG} main.cpp
${SOURCE_FILES}
${RESOURCES}
${ASSETS_TOR}
)
if(NOT ANDROID)
add_executable(wowlet ${EXECUTABLE_FLAG} main.cpp
${SOURCE_FILES}
${RESOURCES}
${ASSETS_TOR}
)
else()
add_library(wowlet SHARED ${SOURCE_FILES} ${RESOURCES})
set_target_properties(wowlet PROPERTIES COMPILE_DEFINITIONS "ANDROID")
endif()
# mac os bundle
set_target_properties(wowlet PROPERTIES
@ -162,6 +176,14 @@ if(XMRIG)
target_compile_definitions(wowlet PRIVATE HAS_XMRIG=1)
endif()
if(ANDROID)
target_compile_definitions(wowlet PRIVATE HAS_ANDROID=1)
endif()
if(ANDROID_DEBUG)
target_compile_definitions(wowlet PRIVATE HAS_ANDROID_DEBUG=1)
endif()
if(OPENVR)
target_compile_definitions(wowlet PRIVATE HAS_OPENVR=1)
target_compile_definitions(wowlet PUBLIC VR_API_PUBLIC)
@ -220,6 +242,13 @@ else()
target_link_libraries(wowlet PUBLIC monero-seed::monero-seed)
endif()
if(ANDROID)
# yolo some hardcoded paths
target_include_directories(wowlet PUBLIC
/opt/android/prefix/include/QtAndroidExtras/
)
endif()
# Link Wownero core libraries
target_link_libraries(wowlet PUBLIC
wallet_merged
@ -261,6 +290,33 @@ else()
Qt5::WebSockets)
endif()
if(ANDROID)
# yolo some hardcoded paths
target_link_libraries(wowlet PUBLIC
/opt/android/prefix/lib/libQt5QuickTemplates2_arm64-v8a.so
/opt/android/prefix/lib/libQt5Quick_arm64-v8a.so
/opt/android/prefix/lib/libQt5QmlModels_arm64-v8a.so
/opt/android/prefix/lib/libQt5Qml_arm64-v8a.so
/opt/android/prefix/lib/libQt5Svg_arm64-v8a.so
/opt/android/prefix/lib/libQt5Widgets_arm64-v8a.so
/opt/android/prefix/lib/libQt5Gui_arm64-v8a.so
/opt/android/prefix/lib/libQt5Xml_arm64-v8a.so
/opt/android/prefix/lib/libQt5XmlPatterns_arm64-v8a.so
/opt/android/prefix/lib/libQt5Network_arm64-v8a.so
/opt/android/prefix/lib/libQt5Core_arm64-v8a.so
/opt/android/prefix/lib/libQt5VirtualKeyboard_arm64-v8a.so
/opt/android/prefix/lib/libQt5AndroidExtras_arm64-v8a.so
/opt/android/prefix/plugins/bearer/libplugins_bearer_qandroidbearer_arm64-v8a.so
GLESv2
log
z
jnigraphics
android
EGL
c++_shared
)
endif()
# Link random other stuff
target_link_libraries(wowlet PUBLIC
${ICU_LIBRARIES}
@ -294,7 +350,7 @@ if(OPENVR)
endif()
if(APPLE)
target_link_libraries(wowlet
target_link_libraries(wowlet PUBLIC
KDMacTouchBar
)
target_include_directories(wowlet
@ -329,3 +385,19 @@ endif()
install(TARGETS wowlet
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
message(STATUS "=============================================")
message(STATUS "VERSION_MAJOR: ${VERSION_MAJOR}")
message(STATUS "VERSION_MINOR: ${VERSION_MINOR}")
message(STATUS "VERSION_REVISION: ${VERSION_REVISION}")
message(STATUS "STATIC: ${STATIC}")
message(STATUS "Include QtQuick (QML): ${QML}")
message(STATUS "VERSION: ${VERSION}")
message(STATUS "Include the XMRIG tab: ${XMRIG}")
message(STATUS "Include Valve's OpenVR library: ${OPENVR}")
message(STATUS "This build is for Android: ${ANDROID}")
message(STATUS "This build is for testing the Android app on desktop: ${ANDROID_DEBUG}")
message(STATUS "TOR_BIN: ${TOR_BIN}")
message(STATUS "DONATE_BEG: ${DONATE_BEG}")
message(STATUS "=============================================")

176
src/appcontext.cpp

@ -6,6 +6,7 @@
#include "appcontext.h"
#include "globals.h"
#include "config-wowlet.h"
// libwalletqt
#include "libwalletqt/TransactionHistory.h"
@ -30,77 +31,69 @@ AppContext::AppContext(QCommandLineParser *cmdargs) {
this->cmdargs = cmdargs;
AppContext::isQML = false;
// OS & env
#if defined(Q_OS_MAC)
this->isMac = true;
this->isTorSocks = qgetenv("DYLD_INSERT_LIBRARIES").indexOf("libtorsocks") >= 0;
#elif __ANDROID__
this->isAndroid = true;
#elif defined(Q_OS_LINUX)
this->isLinux = true;
this->isTorSocks = qgetenv("LD_PRELOAD").indexOf("libtorsocks") >= 0;
this->isTails = TailsOS::detect();
this->isWhonix = WhonixOS::detect();
#elif defined(Q_OS_WIN)
this->isWindows = true;
this->isTorSocks = false;
#endif
this->androidDebug = cmdargs->isSet("android-debug");
this->isTails = TailsOS::detect();
this->isWhonix = WhonixOS::detect();
//Paths
// Paths
this->pathGenericData = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
this->configRoot = QDir::homePath();
if (isTails) { // #if defined(PORTABLE)
QString portablePath = []{
QString appImagePath = qgetenv("APPIMAGE");
if (appImagePath.isEmpty()) {
qDebug() << "Not an appimage, using currentPath()";
return QDir::currentPath() + "/.wowlet";
}
QFileInfo appImageDir(appImagePath);
return appImageDir.absoluteDir().path() + "/.wowlet";
}();
if (QDir().mkpath(portablePath)) {
this->configRoot = portablePath;
} else {
qCritical() << "Unable to create portable directory: " << portablePath;
}
}
this->accountName = Utils::getUnixAccountName();
this->homeDir = QDir::homePath();
this->configDirectory = QString("%1/.config/wowlet/").arg(this->configRoot);
this->configDirectoryVR = QString("%1%2").arg(this->configDirectory, "vr");
if (isTails) this->setupPathsTails();
QString walletDir = config()->get(Config::walletDirectory).toString();
if (walletDir.isEmpty()) {
#if defined(Q_OS_LINUX) or defined(Q_OS_MAC)
this->defaultWalletDir = QString("%1/Wownero/wallets").arg(this->configRoot);
this->defaultWalletDirRoot = QString("%1/Wownero").arg(this->configRoot);
#elif defined(Q_OS_WIN)
this->defaultWalletDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/Wownero";
this->defaultWalletDirRoot = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
#endif
if(walletDir.isEmpty()) {
if (isAndroid && !androidDebug) setupPathsAndroid();
else if (isWindows) setupPathsWindows();
else if (isLinux || isMac) setupPathsUnix();
} else {
this->defaultWalletDir = walletDir;
this->defaultWalletDirRoot = walletDir;
}
#ifdef __ANDROID__
// can haz disk I/O?
QVector<QString> perms = {
"android.permission.WRITE_EXTERNAL_STORAGE",
"android.permission.READ_EXTERNAL_STORAGE"
};
Utils::androidAskPermissions(perms);
#endif
// Create wallet dirs
qDebug() << "creating " << defaultWalletDir;
if (!QDir().mkpath(defaultWalletDir))
qCritical() << "Unable to create dir: " << defaultWalletDir;
this->configDirectory = QString("%1/.config/wowlet/").arg(this->configRoot);
#if defined(Q_OS_UNIX)
if(!this->configDirectory.endsWith('/'))
this->configDirectory = QString("%1/").arg(this->configDirectory);
#endif
this->configDirectoryVR = QString("%1%2").arg(this->configDirectory, "vr");
// Create some directories
createConfigDirectory(this->configDirectory);
// if(this->cmdargs->isSet("stagenet"))
// this->networkType = NetworkType::STAGENET;
// else if(this->cmdargs->isSet("testnet"))
// this->networkType = NetworkType::TESTNET;
// else
this->networkType = NetworkType::MAINNET;
qDebug() << "configRoot: " << this->configRoot;
qDebug() << "homeDir: " << this->homeDir;
qDebug() << "customWalletDir: " << walletDir;
qDebug() << "defaultWalletDir: " << this->defaultWalletDir;
qDebug() << "defaultWalletDirRoot: " << this->defaultWalletDirRoot;
qDebug() << "configDirectory: " << this->configDirectory;
// auto nodeSourceUInt = config()->get(Config::nodeSource).toUInt();
// AppContext::nodeSource = static_cast<NodeSource>(nodeSourceUInt);
this->nodes = new Nodes(this, this->networkClearnet);
@ -119,6 +112,24 @@ AppContext::AppContext(QCommandLineParser *cmdargs) {
this->storeWallet();
});
// If system clock skewed for >= 300 seconds, assume a wake-up from hibernate and reload the websocket connection
if(!this->isAndroid)
m_hibernateTimer.start(3 * 1000);
m_hibernatePreviousTime = std::chrono::steady_clock::now();
connect(&m_hibernateTimer, &QTimer::timeout, [this]() {
const auto now = std::chrono::steady_clock::now();
const auto elapsed = now - m_hibernatePreviousTime;
if(elapsed >= m_hibernateDetectInterval) {
qCritical() << "Clock skew detected, resetting websocket connection";
this->ws->webSocket.abort();
this->ws->start();
}
m_hibernatePreviousTime = now;
});
// restore height lookup
this->initRestoreHeights();
@ -423,7 +434,6 @@ void AppContext::onWSMessage(const QJsonObject &msg) {
QJsonArray crypto_rates = msg.value("data").toArray();
AppContext::prices->cryptoPricesReceived(crypto_rates);
}
else if(cmd == "fiat_rates") {
QJsonObject fiat_rates = msg.value("data").toObject();
AppContext::prices->fiatPricesReceived(fiat_rates);
@ -432,21 +442,35 @@ void AppContext::onWSMessage(const QJsonObject &msg) {
QJsonArray reddit_data = msg.value("data").toArray();
this->onWSReddit(reddit_data);
}
else if(cmd == "forum") {
QJsonArray forum_data = msg.value("data").toArray();
this->onWSForum(forum_data);
}
else if(cmd == "funding_proposals") {
auto ccs_data = msg.value("data").toArray();
this->onWSCCS(ccs_data);
}
else if(cmd == "suchwow") {
QJsonArray such_data = msg.value("data").toArray();
emit suchWowUpdated(such_data);
}
else if(cmd == "txFiatHistory") {
auto txFiatHistory_data = msg.value("data").toObject();
AppContext::txFiatHistory->onWSData(txFiatHistory_data);
}
else if(cmd == "wowlet_releases") {
versionPending = msg.value("data").toObject();
auto version_str = versionPending.value("version").toString();
if(Utils::versionOutdated(WOWLET_VERSION_SEMVER, version_str))
emit versionOutdated(version_str, versionPending);
}
else if(cmd == "kill") {
// used *only* in dire emergencies
auto killme = msg.value("data").toBool();
if(killme)
QCoreApplication::quit();
}
#if defined(HAS_OPENVR)
else if(cmd == "requestPIN") {
auto pin = msg.value("data").toString();
@ -497,6 +521,23 @@ void AppContext::onWSNodes(const QJsonArray &nodes) {
this->nodes->onWSNodesReceived(l);
}
void AppContext::onWSForum(const QJsonArray& forum_data) {
QList<QSharedPointer<ForumPost>> l;
for (auto &&entry: forum_data) {
auto obj = entry.toObject();
auto forumPost = new ForumPost(
obj.value("title").toString(),
obj.value("author").toString(),
obj.value("permalink").toString(),
obj.value("comments").toInt());
QSharedPointer<ForumPost> r = QSharedPointer<ForumPost>(forumPost);
l.append(r);
}
emit forumUpdated(l);
}
void AppContext::onWSReddit(const QJsonArray& reddit_data) {
QList<QSharedPointer<RedditPost>> l;
@ -558,12 +599,14 @@ void AppContext::createConfigDirectory(const QString &dir) {
}
}
#ifdef HAS_OPENVR
auto config_dir_vr = QString("%1%2").arg(dir, "vr");
if(!Utils::dirExists(config_dir_vr)) {
qDebug() << QString("Creating directory: %1").arg(config_dir_vr);
if (!QDir().mkpath(config_dir_vr))
throw std::runtime_error("Could not create directory " + config_dir_vr.toStdString());
}
#endif
}
void AppContext::createWalletWithoutSpecifyingSeed(const QString &name, const QString &password) {
@ -949,3 +992,38 @@ void AppContext::refreshModels() {
this->currentWallet->coins()->refresh(this->currentWallet->currentSubaddressAccount());
// Todo: set timer for refreshes
}
void AppContext::setupPathsUnix() {
this->defaultWalletDir = QString("%1/Wownero/wallets").arg(this->configRoot);
this->defaultWalletDirRoot = QString("%1/Wownero").arg(this->configRoot);
}
void AppContext::setupPathsWindows() {
this->defaultWalletDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/Wownero";
this->defaultWalletDirRoot = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
}
void AppContext::setupPathsAndroid() {
this->defaultWalletDir = QString("%1/Wownero/wallets").arg(this->pathGenericData);
this->defaultWalletDirRoot = QString("%1/Wownero").arg(this->pathGenericData);
}
void AppContext::setupPathsTails() {
QString portablePath = []{
QString appImagePath = qgetenv("APPIMAGE");
if (appImagePath.isEmpty()) {
qDebug() << "Not an appimage, using currentPath()";
return QDir::currentPath() + "/.wowlet";
}
QFileInfo appImageDir(appImagePath);
return appImageDir.absoluteDir().path() + "/.wowlet";
}();
if (QDir().mkpath(portablePath)) {
this->configRoot = portablePath;
} else {
qCritical() << "Unable to create portable directory: " << portablePath;
}
}

21
src/appcontext.h

@ -19,6 +19,7 @@
#include "utils/txfiathistory.h"
#include "utils/WowletSeed.h"
#include "widgets/RedditPost.h"
#include "widgets/ForumPost.h"
#include "widgets/CCSEntry.h"
#include "utils/RestoreHeightLookup.h"
#include "utils/nodes.h"
@ -39,7 +40,13 @@ public:
~AppContext() override;
bool isTails = false;
bool isWhonix = false;
bool isAndroid = false;
bool isLinux = false;
bool isMac = false;
bool isWindows = false;
bool isDebug = false;
static bool isQML;
bool androidDebug = false;
// Donation config
const QString donationAddress = "Wo3MWeKwtA918DU4c69hVSNgejdWFCRCuWjShRY66mJkU2Hv58eygJWDJS1MNa2Ge5M1WjUkGHuLqHkweDxwZZU42d16v94mP";
@ -50,6 +57,7 @@ public:
QString coinName = "wownero";
bool isTorSocks = false;
QString pathGenericData;
QString homeDir;
QString accountName;
QString configRoot;
@ -98,7 +106,7 @@ public:
static QMap<QString, QString> txDescriptionCache;
static QMap<QString, QString> txCache;
static TxFiatHistory *txFiatHistory;
static bool isQML;
QJsonObject versionPending;
// libwalletqt
bool refreshed = false;
@ -154,6 +162,7 @@ private slots:
void onWSMessage(const QJsonObject& msg);
void onWSCCS(const QJsonArray &ccs_data);
void onWSReddit(const QJsonArray& reddit_data);
void onWSForum(const QJsonArray& forum_data);
void onMoneySpent(const QString &txId, quint64 amount);
void onMoneyReceived(const QString &txId, quint64 amount);
@ -192,6 +201,7 @@ signals:
void wsConnected();
void wsDisconnected();
void redditUpdated(QList<QSharedPointer<RedditPost>> &posts);
void forumUpdated(QList<QSharedPointer<ForumPost>> &posts);
void nodesUpdated(QList<QSharedPointer<WowletNode>> &nodes);
void ccsUpdated(QList<QSharedPointer<CCSEntry>> &entries);
void suchWowUpdated(const QJsonArray &such_data);
@ -210,11 +220,20 @@ signals:
void initiateTransaction();
void endTransaction();
void setTitle(const QString &title); // set window title
void versionOutdated(QString version_string, QJsonObject data);
private:
WalletKeysFilesModel *m_walletKeysFilesModel;
const int m_donationBoundary = 15;
QTimer m_storeTimer;
QTimer m_hibernateTimer;
std::chrono::seconds m_hibernateDetectInterval{300};
std::chrono::time_point<std::chrono::steady_clock> m_hibernatePreviousTime;
void setupPathsUnix();
void setupPathsWindows();
void setupPathsAndroid();
void setupPathsTails();
};
#endif //WOWLET_APPCONTEXT_H

49
src/assets.qrc

@ -129,8 +129,56 @@
<file>assets/images/welcome/wow74.png</file>
<file>assets/images/welcome/wow75.png</file>
<file>assets/images/welcome/wow76.png</file>
<file>assets/images/welcome/wow77.png</file>
<file>assets/images/welcome/wow78.png</file>
<file>assets/images/welcome/wow79.png</file>
<file>assets/images/welcome/wow80.png</file>
<file>assets/images/welcome/wow81.png</file>
<file>assets/images/welcome/wow82.png</file>
<file>assets/images/welcome/wow83.png</file>
<file>assets/images/welcome/wow84.png</file>
<file>assets/images/welcome/wow85.png</file>
<file>assets/images/welcome/wow86.png</file>
<file>assets/images/welcome/wow87.png</file>
<file>assets/images/welcome/wow88.png</file>
<file>assets/images/welcome/wow89.png</file>
<file>assets/images/welcome/wow90.png</file>
<file>assets/images/welcome/wow91.png</file>
<file>assets/images/welcome/wow92.png</file>
<file>assets/images/welcome/wow93.png</file>
<file>assets/images/welcome/wow94.png</file>
<file>assets/images/welcome/wow95.png</file>
<file>assets/images/welcome/wow96.png</file>
<file>assets/images/welcome/wow97.png</file>
<file>assets/images/welcome/wow98.png</file>
<file>assets/images/welcome/wow99.png</file>
<file>assets/images/welcome/wow100.png</file>
<file>assets/images/welcome/wow101.png</file>
<file>assets/images/welcome/wow102.png</file>
<file>assets/images/welcome/wow103.png</file>
<file>assets/images/welcome/wow104.png</file>
<file>assets/images/welcome/wow105.png</file>
<file>assets/images/welcome/wow106.png</file>
<file>assets/images/welcome/wow107.png</file>
<file>assets/images/welcome/wow108.png</file>
<file>assets/images/welcome/wow109.png</file>
<file>assets/images/welcome/wow110.png</file>
<file>assets/images/welcome/wow111.png</file>
<file>assets/images/welcome/wow112.png</file>
<file>assets/images/welcome/wow113.png</file>
<file>assets/images/welcome/wow114.png</file>
<file>assets/images/welcome/wow115.png</file>
<file>assets/images/welcome/wow116.png</file>
<file>assets/images/welcome/wow117.png</file>
<file>assets/images/welcome/wow118.png</file>
<file>assets/images/welcome/wow119.png</file>
<file>assets/images/welcome/wow120.png</file>
<file>assets/images/welcome/wow121.png</file>
<file>assets/images/welcome/wow122.png</file>
<file>assets/images/welcome/wow123.png</file>
<file>assets/images/preferences.png</file>
<file>assets/images/preferences.svg</file>
<file>assets/images/credits.jpg</file>
<file>assets/images/qrcode.png</file>
<file>assets/images/qrcode_white.png</file>
<file>assets/images/revealer_c.png</file>
@ -138,6 +186,7 @@
<file>assets/images/seal.png</file>
<file>assets/images/seed.png</file>
<file>assets/images/speaker.png</file>
<file>assets/images/pls_update.jpg</file>
<file>assets/images/status_connected_fork.png</file>
<file>assets/images/status_connected.png</file>
<file>assets/images/status_connected_proxy_fork.png</file>

BIN
src/assets/images/credits.jpg

After

Width: 1268  |  Height: 586  |  Size: 227 KiB

BIN
src/assets/images/pls_update.jpg

After

Width: 320  |  Height: 320  |  Size: 30 KiB

BIN
src/assets/images/welcome/wow100.png

After

Width: 141  |  Height: 451  |  Size: 117 KiB

BIN
src/assets/images/welcome/wow101.png

After

Width: 141  |  Height: 451  |  Size: 56 KiB

BIN
src/assets/images/welcome/wow102.png

After

Width: 141  |  Height: 451  |  Size: 102 KiB

BIN
src/assets/images/welcome/wow103.png

After

Width: 141  |  Height: 451  |  Size: 136 KiB

BIN
src/assets/images/welcome/wow104.png

After

Width: 141  |  Height: 451  |  Size: 87 KiB

BIN
src/assets/images/welcome/wow105.png

After

Width: 141  |  Height: 451  |  Size: 70 KiB

BIN
src/assets/images/welcome/wow106.png

After

Width: 141  |  Height: 451  |  Size: 5.3 KiB

BIN
src/assets/images/welcome/wow107.png

After

Width: 141  |  Height: 451  |  Size: 94 KiB

BIN
src/assets/images/welcome/wow108.png

After

Width: 141  |  Height: 451  |  Size: 66 KiB

BIN
src/assets/images/welcome/wow109.png

After

Width: 141  |  Height: 451  |  Size: 106 KiB

BIN
src/assets/images/welcome/wow110.png

After

Width: 141  |  Height: 451  |  Size: 112 KiB

BIN
src/assets/images/welcome/wow111.png

After

Width: 141  |  Height: 451  |  Size: 113 KiB

BIN
src/assets/images/welcome/wow112.png

After

Width: 141  |  Height: 451  |  Size: 60 KiB

BIN
src/assets/images/welcome/wow113.png

After

Width: 141  |  Height: 451  |  Size: 80 KiB

BIN
src/assets/images/welcome/wow114.png

After

Width: 141  |  Height: 451  |  Size: 64 KiB

BIN
src/assets/images/welcome/wow115.png

After

Width: 141  |  Height: 451  |  Size: 100 KiB

BIN
src/assets/images/welcome/wow116.png

After

Width: 141  |  Height: 451  |  Size: 92 KiB

BIN
src/assets/images/welcome/wow117.png

After

Width: 141  |  Height: 451  |  Size: 123 KiB

BIN
src/assets/images/welcome/wow118.png

After

Width: 141  |  Height: 451  |  Size: 114 KiB

BIN
src/assets/images/welcome/wow119.png

After

Width: 141  |  Height: 451  |  Size: 37 KiB

BIN
src/assets/images/welcome/wow120.png

After

Width: 141  |  Height: 451  |  Size: 132 KiB

BIN
src/assets/images/welcome/wow121.png

After

Width: 141  |  Height: 451  |  Size: 25 KiB

BIN
src/assets/images/welcome/wow122.png

After

Width: 141  |  Height: 451  |  Size: 65 KiB

BIN
src/assets/images/welcome/wow123.png

After

Width: 141  |  Height: 451  |  Size: 142 KiB

BIN
src/assets/images/welcome/wow77.png

After

Width: 141  |  Height: 451  |  Size: 113 KiB

BIN
src/assets/images/welcome/wow78.png

After

Width: 141  |  Height: 451  |  Size: 92 KiB

BIN
src/assets/images/welcome/wow79.png

After

Width: 141  |  Height: 451  |  Size: 116 KiB

BIN
src/assets/images/welcome/wow80.png

After

Width: 141  |  Height: 451  |  Size: 145 KiB

BIN
src/assets/images/welcome/wow81.png

After

Width: 141  |  Height: 451  |  Size: 93 KiB

BIN
src/assets/images/welcome/wow82.png

After

Width: 141  |  Height: 451  |  Size: 94 KiB

BIN
src/assets/images/welcome/wow83.png

After

Width: 141  |  Height: 451  |  Size: 106 KiB

BIN
src/assets/images/welcome/wow84.png

After

Width: 141  |  Height: 451  |  Size: 129 KiB

BIN
src/assets/images/welcome/wow85.png

After

Width: 141  |  Height: 451  |  Size: 148 KiB

BIN
src/assets/images/welcome/wow86.png

After

Width: 141  |  Height: 451  |  Size: 115 KiB

BIN
src/assets/images/welcome/wow87.png

After

Width: 141  |  Height: 451  |  Size: 83 KiB

BIN
src/assets/images/welcome/wow88.png

After

Width: 141  |  Height: 451  |  Size: 127 KiB

BIN
src/assets/images/welcome/wow89.png

After

Width: 141  |  Height: 451  |  Size: 75 KiB

BIN
src/assets/images/welcome/wow90.png

After

Width: 141  |  Height: 451  |  Size: 98 KiB

BIN
src/assets/images/welcome/wow91.png

After

Width: 141  |  Height: 451  |  Size: 108 KiB

BIN
src/assets/images/welcome/wow92.png

After

Width: 141  |  Height: 451  |  Size: 124 KiB

BIN
src/assets/images/welcome/wow93.png

After

Width: 141  |  Height: 451  |  Size: 83 KiB

BIN
src/assets/images/welcome/wow94.png

After

Width: 141  |  Height: 451  |  Size: 92 KiB

BIN
src/assets/images/welcome/wow95.png

After

Width: 141  |  Height: 451  |  Size: 81 KiB

BIN
src/assets/images/welcome/wow96.png

After

Width: 141  |  Height: 451  |  Size: 100 KiB

BIN
src/assets/images/welcome/wow97.png

After

Width: 141  |  Height: 451  |  Size: 80 KiB

BIN
src/assets/images/welcome/wow98.png

After

Width: 141  |  Height: 451  |  Size: 83 KiB

BIN
src/assets/images/welcome/wow99.png

After

Width: 141  |  Height: 451  |  Size: 83 KiB

BIN
src/assets/images/wowlet.png

Before

Width: 256  |  Height: 256  |  Size: 20 KiB

After

Width: 256  |  Height: 256  |  Size: 49 KiB

BIN
src/assets/images/wowlet_old.png

After

Width: 256  |  Height: 256  |  Size: 20 KiB

4
src/dialog/aboutdialog.cpp

@ -13,8 +13,8 @@ AboutDialog::AboutDialog(QWidget *parent)
ui->setupUi(this);
this->setWindowIcon(QIcon("://assets/images/appicons/64x64.png"));
QPixmap p(":assets/images/illiterate_illuminati.png");
ui->aboutImage->setPixmap(p.scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation));
QPixmap p(":assets/images/credits.jpg");
ui->aboutImage->setPixmap(p.scaled(800, 600, Qt::KeepAspectRatio, Qt::SmoothTransformation));
auto about = Utils::fileOpenQRC(":assets/about.txt");
auto about_text = Utils::barrayToString(about);
about_text = about_text.replace("<wowlet_version>", WOWLET_VERSION);

44
src/dialog/updatedialog.cpp

@ -0,0 +1,44 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project.
#include <QObject>
#include "updatedialog.h"
#include "ui_updatedialog.h"
#include "config-wowlet.h"
UpdateDialog::UpdateDialog(AppContext *ctx, QWidget *parent) :
QDialog(parent),
ctx(ctx),
ui(new Ui::UpdateDialog) {
ui->setupUi(this);
this->setWindowIcon(QIcon("://assets/images/appicons/64x64.png"));
auto version_str = ctx->versionPending.value("version").toString();
QPixmap p(":assets/images/pls_update.jpg");
ui->label_image->setPixmap(p.scaled(320, 320, Qt::KeepAspectRatio, Qt::SmoothTransformation));
ui->info_label->setText("Current version: " + QString(WOWLET_VERSION_SEMVER) + "\n"
"New version: " + version_str);
ui->label_download->setText("Download: <a href=\"https://git.wownero.com/wowlet/wowlet/releases\">git.wownero.com</a>");
ui->label_download->setTextInteractionFlags(Qt::TextBrowserInteraction);
ui->label_download->setOpenExternalLinks(true);
// checkbox
connect(ui->checkbox_ignore, &QCheckBox::clicked, this, &UpdateDialog::checkboxIgnoreWarning);
this->adjustSize();
}
void UpdateDialog::checkboxIgnoreWarning(bool checked) {
if(checked)
config()->set(Config::ignoreUpdateWarning, WOWLET_VERSION_SEMVER);
else
config()->set(Config::ignoreUpdateWarning, "");
}
UpdateDialog::~UpdateDialog() {
delete ui;
}

31
src/dialog/updatedialog.h

@ -0,0 +1,31 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project.
#ifndef WOWLET_UPDATEDIALOG_H
#define WOWLET_UPDATEDIALOG_H
#include <QDialog>
#include "appcontext.h"
namespace Ui {
class UpdateDialog;
}
class UpdateDialog : public QDialog