Compare commits
163 Commits
windows_bu
...
master
Author | SHA1 | Date |
---|---|---|
Sarah Jamie Lewis | 12a6cb4610 | |
Dan Ballard | 8e92a6ae42 | |
erinn | 211e388a7d | |
Dan Ballard | dc3872fc8a | |
erinn | bc55d472d1 | |
Sarah Jamie Lewis | 60af2930b5 | |
Dan Ballard | 1f98899f6b | |
Dan Ballard | b586248bda | |
Sarah Jamie Lewis | f44cb450a5 | |
Sarah Jamie Lewis | f354f5a81a | |
Dan Ballard | e6145d6e12 | |
Sarah Jamie Lewis | ee1a8dbed5 | |
Dan Ballard | 4bb5a52b9f | |
Sarah Jamie Lewis | bf27590afe | |
erinn | 4cdb507e5e | |
Dan Ballard | 3dbcf07396 | |
Dan Ballard | afcceac8cf | |
Sarah Jamie Lewis | 66c46714b7 | |
Dan Ballard | 288e14ede2 | |
Dan Ballard | 1962cf9df5 | |
Dan Ballard | ae8702cda2 | |
Dan Ballard | 85dc5b5714 | |
Dan Ballard | 4932c728ec | |
Dan Ballard | 0f15141f73 | |
Dan Ballard | db0e8a2395 | |
Dan Ballard | be1959b60c | |
Sarah Jamie Lewis | dfb12a2ab0 | |
erinn | 17c946de6d | |
Sarah Jamie Lewis | 9958bb605b | |
Sarah Jamie Lewis | 826c8b3a1d | |
erinn | bb84e8f46f | |
Sarah Jamie Lewis | f168f6aee9 | |
erinn | bc33356ca4 | |
Sarah Jamie Lewis | dfdce13e46 | |
erinn | fa430b7d7c | |
Sarah Jamie Lewis | 4d927c133d | |
erinn | 0663488d6d | |
erinn | 6263dbf1fa | |
erinn | 1a556d05ce | |
erinn | 49bee4deb1 | |
erinn | 240eb56ebe | |
Dan Ballard | 79052038e6 | |
erinn | e5fce8634e | |
erinn | 09079dd224 | |
Dan Ballard | b920d3ab8b | |
erinn | 8b6e8d2e98 | |
erinn | 473e0a02d0 | |
Dan Ballard | b837757617 | |
Sarah Jamie Lewis | 6292b5a1b9 | |
Dan Ballard | cfe0105992 | |
erinn | bbedeb81c7 | |
erinn | 3687ead49f | |
erinn | c3deeaa227 | |
erinn | 96aaf1f0e9 | |
erinn | 79a8bfb0cf | |
Dan Ballard | 23eece4424 | |
Sarah Jamie Lewis | 0de8bd19bb | |
Sarah Jamie Lewis | e9b98f2aea | |
Dan Ballard | 12bed09d4e | |
Dan Ballard | 8e6f5e813a | |
Sarah Jamie Lewis | 4b081a0db6 | |
Sarah Jamie Lewis | a942bfbba1 | |
Dan Ballard | 2035e44cfd | |
Sarah Jamie Lewis | 07cbb1054b | |
Dan Ballard | 0e965d630a | |
Dan Ballard | d4d88ff541 | |
Dan Ballard | d0f90a9b7f | |
Dan Ballard | 3cdb2b2455 | |
Dan Ballard | f02083e0d6 | |
Dan Ballard | c62891b8d9 | |
erinn | 04aae4d093 | |
erinn | 9cc81b1f29 | |
Dan Ballard | 93dbc6d270 | |
Dan Ballard | 8b004543ed | |
erinn | d4e5546079 | |
erinn | ba7bb704cd | |
Dan Ballard | 752e21f89e | |
erinn | 7aa7f67fd3 | |
erinn | 6e6045d911 | |
Sarah Jamie Lewis | 16ee1635f5 | |
Dan Ballard | 9aa4f6d75d | |
erinn | 38923ef814 | |
erinn | 24a7abacd1 | |
Sarah Jamie Lewis | eef74ae8b3 | |
Sarah Jamie Lewis | 05cd440036 | |
Sarah Jamie Lewis | c1bc5a7806 | |
Sarah Jamie Lewis | d25aadbb2b | |
erinn | 7485837669 | |
erinn | f8d3277a6f | |
erinn | 0634d34bf2 | |
Dan Ballard | 1eec8dbfe0 | |
Sarah Jamie Lewis | dd5995628a | |
Dan Ballard | d5e81e9ae3 | |
Sarah Jamie Lewis | 4e0ecd72c4 | |
Sarah Jamie Lewis | 6b8a8b8da1 | |
Sarah Jamie Lewis | 1d86c3d326 | |
Sarah Jamie Lewis | ef58f002b3 | |
Sarah Jamie Lewis | 1eb391ecc1 | |
Sarah Jamie Lewis | e74d599d95 | |
erinn | 1515fb7998 | |
Dan Ballard | 78400a17c6 | |
Dan Ballard | 2f6395697e | |
Dan Ballard | e493a18f3f | |
Dan Ballard | 44e0f9ebab | |
Sarah Jamie Lewis | de1b3319b1 | |
Dan Ballard | 4f4df63e51 | |
erinn | bbea51b561 | |
Dan Ballard | 3d509c6810 | |
Sarah Jamie Lewis | 76df3c286d | |
Dan Ballard | de56f8be15 | |
erinn | 9e4917ac5b | |
Dan Ballard | f402f515da | |
erinn | a0081c9d4e | |
erinn | 94381cb076 | |
erinn | a0bbfa7721 | |
erinn | 4179e2798b | |
Sarah Jamie Lewis | 8340b7aed3 | |
Sarah Jamie Lewis | e74a0e8dc2 | |
Sarah Jamie Lewis | 228a9b6ebd | |
Sarah Jamie Lewis | b4b10ca75f | |
Dan Ballard | 46ed17eec2 | |
erinn | a54aa8e0af | |
Sarah Jamie Lewis | a5c96964e8 | |
Sarah Jamie Lewis | cb932d3ca3 | |
Sarah Jamie Lewis | 72457d138b | |
Dan Ballard | 454d10e28c | |
Dan Ballard | aadcb0d7c6 | |
Sarah Jamie Lewis | 4805507014 | |
Sarah Jamie Lewis | eb33e46e3d | |
Sarah Jamie Lewis | 45acecf9d7 | |
Dan Ballard | 483d765146 | |
Dan Ballard | 36a4e13184 | |
Dan Ballard | 5cb284c99c | |
Sarah Jamie Lewis | 7f011663d7 | |
Dan Ballard | 918e44fdb6 | |
erinn | 1c463f235c | |
Dan Ballard | 9701380e3c | |
Sarah Jamie Lewis | 01428b1371 | |
Dan Ballard | 568b979698 | |
Sarah Jamie Lewis | c11e541f4e | |
Dan Ballard | 162ee96a1f | |
erinn | 0be9447a07 | |
Dan Ballard | 0e5d78cbb9 | |
erinn | 98d58ebd62 | |
Dan Ballard | 5ca904b675 | |
erinn | d144f0d8b0 | |
Sarah Jamie Lewis | a276d5732a | |
erinn | fd45f72a09 | |
Dan Ballard | 843790c27b | |
Sarah Jamie Lewis | 9721999e9b | |
Dan Ballard | 6117486808 | |
erinn | b80ecc0a7d | |
erinn | 2433c667d8 | |
Sarah Jamie Lewis | 143dd9693c | |
Sarah Jamie Lewis | 91c182b880 | |
Sarah Jamie Lewis | 48d375f007 | |
erinn | 223936cda8 | |
Dan Ballard | f2a4c61610 | |
Dan Ballard | a247fd91c0 | |
Sarah Jamie Lewis | 1b0d69dfb2 | |
Dan Ballard | fec49cf1fd | |
Sarah Jamie Lewis | bfb431cbaf | |
Sarah Jamie Lewis | ada9dc7bb9 |
78
.drone.yml
|
@ -33,9 +33,10 @@ pipeline:
|
|||
- tar -czf $FILENAME cwtch
|
||||
- sha256sum $FILENAME > $FILENAME.sha256
|
||||
- rm -r cwtch
|
||||
build-android:
|
||||
build-android-arm-v7a:
|
||||
mem_limit: 3G
|
||||
image: therecipe/qt:android
|
||||
secrets: [upload_jks_file,upload_jks_pass]
|
||||
when:
|
||||
repo: cwtch.im/ui
|
||||
branch: master
|
||||
|
@ -52,18 +53,65 @@ pipeline:
|
|||
- apt-get -qq update && apt-get --no-install-recommends -qq -y install ca-certificates curl git
|
||||
- rm -r vendor/
|
||||
- make clean
|
||||
- echo "cwtch-upload" > android/jks_alias
|
||||
- echo $UPLOAD_JKS_PASS > android/jks_pass
|
||||
- echo $UPLOAD_JKS_FILE | tr -d '\n ' > android/ui.jks.b64
|
||||
- base64 --decode android/ui.jks.b64 > android/ui.jks
|
||||
- export GOARCH=arm
|
||||
- go mod download
|
||||
- export VERSION=`git describe --tags`
|
||||
- export BUILDDATE=`date +%G-%m-%d-%H-%M`
|
||||
- go mod vendor
|
||||
- qtsetup generate android
|
||||
- qtsetup generate android
|
||||
- mv assets android/
|
||||
- qtdeploy -ldflags "-X main.buildVer=$VERSION -X main.buildDate=$BUILDDATE" build android
|
||||
- ANDROID_MODULES_INCLUDE="Core,Gui,Svg,QuickWidgets,Xml" qtdeploy -ldflags "-X main.buildVer=$VERSION -X main.buildDate=$BUILDDATE" build android
|
||||
- mv android/assets assets
|
||||
- cd deploy
|
||||
- export FILENAME=cwtch-android-$BUILDDATE.apk
|
||||
- cp android/build-debug.apk $FILENAME
|
||||
- export FILENAME=cwtch-android-arm-v7a-$BUILDDATE.apk
|
||||
- cp android/build-release-signed.apk $FILENAME
|
||||
- sha256sum $FILENAME > $FILENAME.sha256
|
||||
- rm -r android
|
||||
build-android-arm64-v8a:
|
||||
mem_limit: 3G
|
||||
image: therecipe/qt:android
|
||||
secrets: [upload_jks_file,upload_jks_pass]
|
||||
when:
|
||||
repo: cwtch.im/ui
|
||||
branch: master
|
||||
event: push
|
||||
environment:
|
||||
- QT_DIR=/opt/Qt
|
||||
- QT_DOCKER='true'
|
||||
- QT_API=5.13.0
|
||||
- ANDROID_NDK_DIR=/home/user/android-ndk-r18b
|
||||
- ANDROID_SDK_DIR=/home/user/android-sdk-linux
|
||||
- GO111MODULE=on
|
||||
commands:
|
||||
- export PATH=$PATH:/home/user/work/bin:/media/sf_GOPATH1/bin
|
||||
- apt-get -qq update && apt-get --no-install-recommends -qq -y install ca-certificates curl git
|
||||
- rm -r vendor/
|
||||
- make clean
|
||||
- echo "cwtch-upload" > android/jks_alias
|
||||
- echo $UPLOAD_JKS_PASS > android/jks_pass
|
||||
- echo $UPLOAD_JKS_FILE | tr -d '\n ' > android/ui.jks.b64
|
||||
- base64 --decode android/ui.jks.b64 > android/ui.jks
|
||||
- export GOARCH=arm64
|
||||
- perl -pe 's/versionCode="(\d+)"/"versionCode=\"" .($1+1)."\""/eg' android/AndroidManifest.xml > android/AndroidManifest.xml.inc
|
||||
- rm android/AndroidManifest.xml
|
||||
- mv android/AndroidManifest.xml.inc android/AndroidManifest.xml
|
||||
- go mod download
|
||||
- export VERSION=`git describe --tags`
|
||||
- export BUILDDATE=`date +%G-%m-%d-%H-%M`
|
||||
- go mod vendor
|
||||
- qtsetup generate android
|
||||
- mv assets android/
|
||||
- ANDROID_MODULES_INCLUDE="Core,Gui,Svg,QuickWidgets,Xml" qtdeploy -ldflags "-X main.buildVer=$VERSION -X main.buildDate=$BUILDDATE" build android
|
||||
- mv android/assets assets
|
||||
- cd deploy
|
||||
- export FILENAME=cwtch-android-arm64-v8a-$BUILDDATE.apk
|
||||
- cp android/build-release-signed.apk $FILENAME
|
||||
- sha256sum $FILENAME > $FILENAME.sha256
|
||||
- rm -r android
|
||||
build-windows:
|
||||
mem_limit: 3G
|
||||
image: therecipe/qt:windows_64_static
|
||||
|
@ -97,7 +145,25 @@ pipeline:
|
|||
- export FILENAME=cwtch-windows-$BUILDDATE.zip
|
||||
- zip -r $FILENAME cwtch
|
||||
- sha256sum $FILENAME > $FILENAME.sha256
|
||||
- rm -r cwtch
|
||||
- mv cwtch windows
|
||||
package-windows:
|
||||
mem_limit: 3G
|
||||
image: hp41/nsis:latest
|
||||
when:
|
||||
repo: cwtch.im/ui
|
||||
branch: [ master, windows_build ]
|
||||
event: push
|
||||
environment:
|
||||
commands:
|
||||
- cp nsis/cwtch-installer.nsi deploy/
|
||||
- cd deploy
|
||||
- makensis -V3 cwtch-installer.nsi
|
||||
- export BUILDDATE=`date +%G-%m-%d-%H-%M`
|
||||
- export FILENAME=cwtch-installer-$BUILDDATE.exe
|
||||
- mv cwtch-installer.exe $FILENAME
|
||||
- sha256sum $FILENAME > $FILENAME.sha256
|
||||
- rm cwtch-installer.nsi
|
||||
- rm -r windows
|
||||
deploy-buildfiles:
|
||||
image: pivotaldata/concourse-ssh
|
||||
secrets: [buildfiles_key]
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
# Notes on Android Debugging
|
||||
|
||||
If you are reading this you are probably interested in developing Cwtch for Android! Awesome.
|
||||
|
||||
The Cwtch UI app is intended to be a single codebase that runs on multiple platforms. This
|
||||
complicates the build process in favour of simplifying the code (so goes the theory).
|
||||
|
||||
We make use of https://github.com/therecipe/qt/ for deploying Go/Qt code to Android. Before you venture into the weeds
|
||||
of this README please take a look at the [Installation](https://github.com/therecipe/qt/wiki/Installation)
|
||||
and [Setup instructions](https://github.com/therecipe/qt/wiki/Deploying-Linux-to-Android) in therecipe/qt.
|
||||
|
||||
## Building
|
||||
|
||||
Check out and follow the instructions at https://github.com/therecipe/qt/wiki/Deploying-Linux-to-Android as they are sufficient,
|
||||
below you will find high-level notes regarding the process.
|
||||
|
||||
You need to run `qtsetup --qt_version=<vesion> full android` for the non-docker setup. You will need to do this
|
||||
for every major version change of therecipe dependencies.
|
||||
|
||||
You will also need the Android 28 SDK (Pie), the NDK, SDK build tools and platform tools, gradle and **JDK 8**
|
||||
|
||||
JAVA_JDK=/path/to/jre8
|
||||
ANDROID_NDK_DIR=/path/to/ndk
|
||||
|
||||
Once all that setup is done you should be able to run:
|
||||
|
||||
ANDROID_MODULES_INCLUDE="Core,Gui,Svg,QuickWidgets,Xml" qtdeploy build android
|
||||
|
||||
2-4 minutes later an android apk will pop out in `./deploy/android/build-debug.apk`.
|
||||
|
||||
### Build Setup Issues we have seen
|
||||
|
||||
* `Could not determine java version from <blah>` - this is thrown by gradle inside the `androiddeployqt` process when the
|
||||
Java version is *not* JRE8. Ensure that JAVA_HOME is pointed to the correct java installation.
|
||||
* ` readelf <blah> "is not an ordinary file"` - this isn't actually an error that will stop the build, but sometimes
|
||||
because of the very long debug log output you will come across it when trying to find the *actual* error (which is
|
||||
probably a Java version issue). It can be safely ignored.
|
||||
* `could not find QAndroid...` / `CPP build errors` - you will need to run `qtsetup` full android` for the Qt version
|
||||
you are using.
|
||||
* Example: androidextras_android.cpp:9:10: fatal error: 'QAndroidActivityResultReceiver' file not found
|
||||
|
||||
## Testing on a Real Device
|
||||
|
||||
Consult the Android documentation on setting up your device for development.
|
||||
|
||||
You will need an android sdk, setup your device for USB Debugging and then with `adb` you can do:
|
||||
|
||||
adb install -r ./deploy/android/build-debug.apk
|
||||
|
||||
To get the logs you can run
|
||||
|
||||
adb logcat
|
||||
|
||||
Android Studio provides a nice logcat interface for quickly filtering log files that can be very useful when trying to
|
||||
debug complex behavior, but command line tools like `grep` and the built-in [logcat filtering](https://developer.android.com/studio/command-line/logcat)
|
||||
should also suffice.
|
||||
|
||||
*Important*: Cwtch UI technically runs *3* different applications: Cwtch Frontend (application client),
|
||||
Cwtch Backend (application server) and Tor. When filtering logcat you should be aware that some of your messages might
|
||||
be getting logged by a different process.
|
||||
|
||||
(*Ctrl-F Helper: "Why are log messages missing"*)
|
||||
|
||||
# Bundled Libraries
|
||||
|
||||
There seems to be a bug in Qt (https://bugreports.qt.io/browse/QTBUG-84371) that prevents the use of
|
||||
`AndroidExtras` in `ANDROID_MODULES_INCLUDE` so we bundle it in `android/libQt5AndroidExtras.so` along with
|
||||
`libtor` for Tor support.
|
||||
|
||||
## Non-SDK Interfaces
|
||||
|
||||
e.g. java.lang.NoSuchFieldException: No field mPivotX in class Landroid/graphics/drawable/RotateDrawable$RotateState;
|
||||
|
||||
* https://bugreports.qt.io/browse/QTBUG-71590
|
||||
|
||||
## Plugins
|
||||
|
||||
Theoretically speaking it should be possible to use `ANDROID_EXTRA_PLUGINS` to include support for e.g.
|
||||
SVG images on Android. However, we have been unable to make it work. If you would like to try, the following
|
||||
issues might be helpful:
|
||||
|
||||
* https://bugreports.qt.io/browse/QTBUG-60022
|
||||
|
||||
## Notifications
|
||||
|
||||
- Android 8 (API Level 26) forces you to call setChannelId()
|
||||
- Android 9 "Do Not Disturb" mode also hides all notifications
|
||||
- Setting up notification channels only seems possible *once* per install. any changes you need to make
|
||||
require that the app is reinstalled, or the actual channel deleted and changed.
|
2
LICENSE
|
@ -1,4 +1,4 @@
|
|||
All code in this repositorym, unless otherwise indicated, is distributed under the following license:
|
||||
All code in this repository, unless otherwise indicated, is distributed under the following license:
|
||||
|
||||
Copyright 2019 Open Privacy Research Society
|
||||
|
||||
|
|
41
Makefile
|
@ -1,6 +1,11 @@
|
|||
.PHONY: all clean linux windows android
|
||||
|
||||
DEFAULT_GOAL: linux
|
||||
|
||||
SHELL := env QT_BUILD_VERSION=$(QT_BUILD_VERSION) $(SHELL)
|
||||
QT_BUILD_VERSION ?= "5.13.4"
|
||||
|
||||
all: clean linux windows android
|
||||
default: linux
|
||||
|
||||
clean:
|
||||
rm -r vendor || true
|
||||
|
@ -8,41 +13,21 @@ clean:
|
|||
find -iname "rcc*" | xargs rm
|
||||
|
||||
linux:
|
||||
$(MAKE) linux_build || $(MAKE) linux_clean
|
||||
|
||||
windows:
|
||||
$(MAKE) windows_build || $(MAKE) windows_clean
|
||||
|
||||
android:
|
||||
$(MAKE) android_build || $(MAKE) android_clean
|
||||
|
||||
linux_build:
|
||||
date
|
||||
qtdeploy -qt_version "5.13.0" build linux 2>&1 | tee qtdeploy.log | pv
|
||||
qtdeploy -qt_version $(QT_BUILD_VERSION) build linux 2>&1 | tee qtdeploy.log | pv
|
||||
date
|
||||
cp -R assets deploy/linux/
|
||||
$(MAKE) linux_clean
|
||||
|
||||
linux_clean:
|
||||
#ntd
|
||||
|
||||
windows_build:
|
||||
windows:
|
||||
date
|
||||
qtdeploy -qt_version "5.13.0" build windows 2>&1 | tee qtdeploy.log | pv
|
||||
qtdeploy -qt_version $(QT_BUILD_VERSION) build windows 2>&1 | tee qtdeploy.log | pv
|
||||
date
|
||||
cp -R assets deploy/windows/
|
||||
$(MAKE) linux_clean
|
||||
|
||||
windows_clean:
|
||||
#ntd
|
||||
|
||||
android_build:
|
||||
mv assets android/
|
||||
android:
|
||||
cp -R assets android/
|
||||
date
|
||||
qtdeploy -docker build android 2>&1 | tee qtdeploy.log | pv
|
||||
## TODO have this also include AndroidExtras (see ANDROID_DEBUGGING) for full notes.
|
||||
env ANDROID_MODULES_INCLUDE="Core,Gui,Svg,QuickWidgets,Xml" qtdeploy -debug -qt_version $(QT_BUILD_VERSION) build android 2>&1 | tee qtdeploy.log | pv
|
||||
date
|
||||
$(MAKE) android_clean
|
||||
|
||||
android_clean:
|
||||
mv android/assets assets
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
# Settings List / Flickable
|
||||
|
||||
Content not scrolling: Flickable does some reparenting behind the scenes and so
|
||||
in the top level child of the Flickable you will need:
|
||||
|
||||
parent: root.contentItem
|
||||
|
||||
And in the flickable you will need to set the contentHeight:
|
||||
|
||||
contentHeight: <childId>.height + <padding>
|
|
@ -1,9 +1,20 @@
|
|||
<?xml version="1.0"?>
|
||||
<manifest package="ca.openprivacy.cwtch.ui" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
|
||||
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="cwtch" android:icon="@drawable/ic_launcher">
|
||||
<manifest package="ca.openprivacy.cwtch.ui" xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:versionName="1.0"
|
||||
android:versionCode="4"
|
||||
android:installLocation="auto">
|
||||
<application android:hardwareAccelerated="true"
|
||||
android:name="org.qtproject.qt5.android.bindings.QtApplication"
|
||||
android:label="cwtch"
|
||||
android:icon="@drawable/knot">
|
||||
|
||||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
|
||||
android:name="ca.openprivacy.cwtch.ui.CwtchActivity"
|
||||
android:label="cwtch" android:theme="@style/AppTheme" android:screenOrientation="unspecified" android:launchMode="singleTop" android:windowSoftInputMode="adjustResize">
|
||||
android:label="cwtch"
|
||||
android:theme="@style/AppTheme"
|
||||
android:screenOrientation="unspecified"
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
|
@ -110,7 +121,7 @@
|
|||
|
||||
</application>
|
||||
|
||||
<uses-sdk android:minSdkVersion="21" /><!-- android:targetSdkVersion="26"/> -->
|
||||
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29"/> -->
|
||||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
|
|
@ -0,0 +1,150 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.0'
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
}
|
||||
|
||||
android {
|
||||
/*******************************************************
|
||||
* The following variables:
|
||||
* - androidBuildToolsVersion,
|
||||
* - androidCompileSdkVersion
|
||||
* - qt5AndroidDir - holds the path to qt android files
|
||||
* needed to build any Qt application
|
||||
* on Android.
|
||||
*
|
||||
* are defined in gradle.properties file. This file is
|
||||
* updated by QtCreator and androiddeployqt tools.
|
||||
* Changing them manually might break the compilation!
|
||||
*******************************************************/
|
||||
|
||||
compileSdkVersion androidCompileSdkVersion.toInteger()
|
||||
|
||||
buildToolsVersion '28.0.3'
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile 'AndroidManifest.xml'
|
||||
java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
|
||||
aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
|
||||
res.srcDirs = [qt5AndroidDir + '/res', 'res']
|
||||
resources.srcDirs = ['src']
|
||||
renderscript.srcDirs = ['src']
|
||||
assets.srcDirs = ['assets']
|
||||
jniLibs.srcDirs = ['libs']
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// kinda of cheaty, would prefer to use if (System.getEnv("GOARCH") == "arm64") {
|
||||
// but it doesn't want to work in this context
|
||||
if (qt5AndroidDir.contains("arm64")) {
|
||||
|
||||
splits {
|
||||
|
||||
// Configures multiple APKs based on ABI.
|
||||
abi {
|
||||
|
||||
// Enables building multiple APKs per ABI.
|
||||
enable true
|
||||
|
||||
// By default all ABIs are included, so use reset() and include to specify that we only
|
||||
// want APKs for x86 and x86_64.
|
||||
|
||||
// Resets the list of ABIs that Gradle should create APKs for to none.
|
||||
reset()
|
||||
|
||||
// Specifies a list of ABIs that Gradle should create APKs for.
|
||||
// Note that because of the way that therecipe/qt bundles libraries
|
||||
// only the specific architecture specified by GOARCH /GOARM will *actually*
|
||||
// work so we currently have to do separate builds for each arch - this needs to be fixed.
|
||||
include "arm64-v8a"
|
||||
|
||||
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
|
||||
// QT deploy has to be run twice to generate the libgo_base.so for each arch
|
||||
universalApk false
|
||||
}
|
||||
}
|
||||
|
||||
task linkBuildDebugArm64(type: Exec) {
|
||||
workingDir '../build/build/outputs/apk/debug/'
|
||||
commandLine 'ln', '-sf', 'build-arm64-v8a-debug.apk', 'build-debug.apk'
|
||||
}
|
||||
|
||||
task renameBuildReleaseArm64(type: Exec) {
|
||||
workingDir '../build/build/outputs/apk/release/'
|
||||
commandLine 'mv', 'build-arm64-v8a-release-unsigned.apk', 'build-release-unsigned.apk'
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
assembleDebug.finalizedBy(linkBuildDebugArm64)
|
||||
assembleRelease.finalizedBy(renameBuildReleaseArm64)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
splits {
|
||||
|
||||
// Configures multiple APKs based on ABI.
|
||||
abi {
|
||||
|
||||
// Enables building multiple APKs per ABI.
|
||||
enable true
|
||||
|
||||
// By default all ABIs are included, so use reset() and include to specify that we only
|
||||
// want APKs for x86 and x86_64.
|
||||
|
||||
// Resets the list of ABIs that Gradle should create APKs for to none.
|
||||
reset()
|
||||
|
||||
// Specifies a list of ABIs that Gradle should create APKs for.
|
||||
// Note that because of the way that therecipe/qt bundles libraries
|
||||
// only the specific architecture specified by GOARCH /GOARM will *actually*
|
||||
// work so we currently have to do separate builds for each arch - this needs to be fixed.
|
||||
include "armeabi-v7a"
|
||||
|
||||
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
|
||||
// QT deploy has to be run twice to generate the libgo_base.so for each arch
|
||||
universalApk false
|
||||
}
|
||||
}
|
||||
|
||||
task linkBuildDebugArm7(type: Exec) {
|
||||
workingDir '../build/build/outputs/apk/debug/'
|
||||
commandLine 'ln', '-sf', 'build-armeabi-v7a-debug.apk', 'build-debug.apk'
|
||||
}
|
||||
|
||||
task renameBuildReleaseArm7(type: Exec) {
|
||||
workingDir '../build/build/outputs/apk/release/'
|
||||
commandLine 'mv', 'build-armeabi-v7a-release-unsigned.apk', 'build-release-unsigned.apk'
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
assembleDebug.finalizedBy(linkBuildDebugArm7)
|
||||
assembleRelease.finalizedBy(renameBuildReleaseArm7)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lintOptions {
|
||||
abortOnError true
|
||||
}
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 3.7 KiB |
|
@ -2,11 +2,14 @@
|
|||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle" >
|
||||
<solid android:color="#FFFFFFFF"/>
|
||||
<solid android:color="#FFFDF3FC"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- It would be nice to find a way to use a transition and trigger it but I haven't yet -->
|
||||
<item>
|
||||
<bitmap android:src="@drawable/cwtch_logo"
|
||||
android:gravity="center" />
|
||||
<bitmap android:src="@drawable/splash_350"
|
||||
android:gravity="center" />
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
|
|
After Width: | Height: | Size: 13 KiB |
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
|
||||
<style name="AppTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen">
|
||||
<item name="android:windowBackground">@drawable/splash</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="loading_tor">Loading tor...</string>
|
||||
</resources>
|
||||
|
|
@ -23,20 +23,13 @@ import static android.app.Notification.CATEGORY_SERVICE;
|
|||
public class CwtchActivity extends org.qtproject.qt5.android.bindings.QtActivity
|
||||
{
|
||||
private static NotificationManager m_notificationManager;
|
||||
private static Notification.Builder m_builder;
|
||||
private static Notification.Builder m_builderOngoing;
|
||||
private static CwtchActivity m_instance;
|
||||
|
||||
private static int PRIORITY_MIN = -2; // From NotificationCompat
|
||||
private static int PRIORITY_DEFAULT = 0; // From NotificationCompat
|
||||
|
||||
private static String NOTIFICATION_CHANNEL_ID = "cwtch_notification_channel";
|
||||
private static int CONTENT_NOTIFICATION_ID = 2;
|
||||
private static String CONTENT_NOTIFICATION_ID_NAME = "Notifications from Peers";
|
||||
|
||||
private static int ONGOING_NOTIFICATION_ID = 0;
|
||||
private static String ONGOING_NOTIFICATION_ID_NAME = "ongoing";
|
||||
|
||||
private static int CONTENT_NOTIFICATION_ID = 1;
|
||||
private static String CONTENT_NOTIFICATION_ID_NAME = "content";
|
||||
|
||||
|
||||
public CwtchActivity() {
|
||||
|
@ -57,66 +50,47 @@ public class CwtchActivity extends org.qtproject.qt5.android.bindings.QtActivity
|
|||
}
|
||||
}
|
||||
|
||||
public static void notify(String s)
|
||||
public static void notify(String s, String o)
|
||||
{
|
||||
if (m_notificationManager == null) {
|
||||
m_notificationManager = (NotificationManager)m_instance.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
createNotificationChannel();
|
||||
}
|
||||
|
||||
if (m_builder == null) {
|
||||
m_builder = new Notification.Builder(m_instance);
|
||||
m_builder.setSmallIcon(R.drawable.ic_launcher);
|
||||
m_builder.setContentTitle("Cwtch");
|
||||
m_builder.setPriority(PRIORITY_DEFAULT);
|
||||
// Apparently thr android documentation is just wrong and we need to provide a setGroupSummary
|
||||
// notification regardless of targetted support version...
|
||||
Notification groupSummary =
|
||||
new Notification.Builder(m_instance)
|
||||
.setContentTitle("Cwtch")
|
||||
.setContentText("New Message from Peer: " + o)
|
||||
.setGroupSummary(true)
|
||||
.setWhen(System.currentTimeMillis())
|
||||
.setSmallIcon(R.drawable.ic_launcher)
|
||||
.setGroup(NOTIFICATION_CHANNEL_ID)
|
||||
.setChannelId(NOTIFICATION_CHANNEL_ID)
|
||||
.build();
|
||||
m_notificationManager.notify(1, groupSummary);
|
||||
|
||||
}
|
||||
Notification.Builder m_builder = new Notification.Builder(m_instance)
|
||||
.setSmallIcon(R.drawable.ic_launcher)
|
||||
.setChannelId(NOTIFICATION_CHANNEL_ID)
|
||||
.setGroup(NOTIFICATION_CHANNEL_ID)
|
||||
.setWhen(System.currentTimeMillis())
|
||||
.setAutoCancel(true)
|
||||
.setContentTitle("New Message from Peer: " + o)
|
||||
.setContentText("[redacted: Open Cwtch App to see the Message]");
|
||||
m_notificationManager.notify(CONTENT_NOTIFICATION_ID++, m_builder.build());
|
||||
|
||||
m_builder.setContentText(s);
|
||||
m_notificationManager.notify(CONTENT_NOTIFICATION_ID, m_builder.build());
|
||||
}
|
||||
|
||||
public static void ongoingNotify(String s)
|
||||
{
|
||||
if (m_notificationManager == null) {
|
||||
m_notificationManager = (NotificationManager)m_instance.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
createNotificationChannel();
|
||||
}
|
||||
|
||||
if (m_builderOngoing == null) {
|
||||
m_builderOngoing = new Notification.Builder(m_instance);
|
||||
m_builderOngoing.setSmallIcon(R.drawable.ic_launcher);
|
||||
m_builderOngoing.setContentTitle("Cwtch");
|
||||
m_builderOngoing.setPriority(PRIORITY_MIN);
|
||||
|
||||
m_builderOngoing.setWhen(0); // Don't show the time
|
||||
m_builderOngoing.setOngoing(true);
|
||||
if (SDK_INT >= 21) {
|
||||
m_builderOngoing.setCategory(CATEGORY_SERVICE);
|
||||
//m_builder.setVisibility(VISIBILITY_SECRET);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
m_builderOngoing.setContentText(s);
|
||||
m_notificationManager.notify(ONGOING_NOTIFICATION_ID, m_builderOngoing.build());
|
||||
}
|
||||
|
||||
private static void createNotificationChannel() {
|
||||
// Create the NotificationChannel, but only on API 26+ because
|
||||
// the NotificationChannel class is new and not in the support library
|
||||
if (SDK_INT >= 26) {
|
||||
String description = "Cwtch Ongoing Notification Channel";
|
||||
int importance = NotificationManager.IMPORTANCE_LOW;
|
||||
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, ONGOING_NOTIFICATION_ID_NAME, importance);
|
||||
channel.setDescription(description);
|
||||
// Register the channel with the system; you can't change the importance
|
||||
// or other notification behaviors after this
|
||||
m_notificationManager.createNotificationChannel(channel);
|
||||
|
||||
description = "Cwtch Content Notification Channel";
|
||||
importance = NotificationManager.IMPORTANCE_DEFAULT;
|
||||
channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, CONTENT_NOTIFICATION_ID_NAME, importance);
|
||||
String description = "Cwtch Notification Channel";
|
||||
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, CONTENT_NOTIFICATION_ID_NAME, NotificationManager.IMPORTANCE_HIGH);
|
||||
channel.setDescription(description);
|
||||
// Register the channel with the system; you can't change the importance
|
||||
// or other notification behaviors after this
|
||||
|
|
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 774 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 998 B |
After Width: | Height: | Size: 396 B |
After Width: | Height: | Size: 478 B |
After Width: | Height: | Size: 512 B |
After Width: | Height: | Size: 530 B |
After Width: | Height: | Size: 868 B |
After Width: | Height: | Size: 258 B |
After Width: | Height: | Size: 393 B |
After Width: | Height: | Size: 234 B |
After Width: | Height: | Size: 308 B |
After Width: | Height: | Size: 166 B |
After Width: | Height: | Size: 270 B |
After Width: | Height: | Size: 218 B |
After Width: | Height: | Size: 268 B |
After Width: | Height: | Size: 532 B |
Before Width: | Height: | Size: 826 B After Width: | Height: | Size: 826 B |
After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 792 B After Width: | Height: | Size: 792 B |
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 766 B |
After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 848 B After Width: | Height: | Size: 848 B |
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 599 B After Width: | Height: | Size: 599 B |
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 634 B After Width: | Height: | Size: 634 B |
After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 564 B After Width: | Height: | Size: 564 B |
After Width: | Height: | Size: 7.5 KiB |
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:none;}
|
||||
</style>
|
||||
<g>
|
||||
<path d="M8.9,12.9c-0.3,0-0.6,0-0.9,0c-2.1,0-6.3,1-6.3,3.1v2.2h5.4V16C7.1,14.7,7.8,13.7,8.9,12.9z"/>
|
||||
<path d="M8,11.1c1.5,0,2.7-1.2,2.7-2.7c0-1.5-1.2-2.7-2.7-2.7c-1.5,0-2.7,1.2-2.7,2.7C5.3,9.9,6.5,11.1,8,11.1z"/>
|
||||
<path d="M14.3,11.1c1.5,0,2.7-1.2,2.7-2.7c0-1.5-1.2-2.7-2.7-2.7s-2.7,1.2-2.7,2.7C11.7,9.9,12.8,11.1,14.3,11.1z"/>
|
||||
<path d="M15.4,13c-0.4,0-0.7-0.1-1.1-0.1c-2.1,0-6-0.4-6.3,3.1v2.2h4.8c0-0.2,0-0.3,0-0.5C12.8,15.8,13.8,14,15.4,13z"/>
|
||||
</g>
|
||||
<path class="st0" d="M0,0h24v24H0V0z"/>
|
||||
<path d="M22.1,18.3c0-0.1,0-0.3,0-0.4c0-0.2,0-0.3,0-0.4l1-0.7c0.1-0.1,0.1-0.2,0.1-0.3l-0.9-1.6c-0.1-0.1-0.2-0.1-0.3-0.1l-1.1,0.5
|
||||
c-0.2-0.2-0.5-0.3-0.8-0.4l-0.2-1.2c0-0.1-0.1-0.2-0.2-0.2h-1.8c-0.1,0-0.2,0.1-0.2,0.2l-0.2,1.2c-0.3,0.1-0.5,0.3-0.8,0.4l-1.1-0.5
|
||||
c-0.1,0-0.2,0-0.3,0.1l-0.9,1.6c-0.1,0.1,0,0.2,0.1,0.3l1,0.7c0,0.1,0,0.3,0,0.4s0,0.3,0,0.4l-1,0.7c-0.1,0.1-0.1,0.2-0.1,0.3
|
||||
l0.9,1.6c0.1,0.1,0.2,0.1,0.3,0.1l1.1-0.5c0.2,0.2,0.5,0.3,0.8,0.4l0.2,1.2c0,0.1,0.1,0.2,0.2,0.2h1.8c0.1,0,0.2-0.1,0.2-0.2L20,21
|
||||
c0.3-0.1,0.5-0.3,0.8-0.4l1.1,0.5c0.1,0,0.2,0,0.3-0.1l0.9-1.6c0.1-0.1,0-0.2-0.1-0.3L22.1,18.3z M18.7,19.5c-0.9,0-1.7-0.8-1.7-1.7
|
||||
c0-0.9,0.8-1.7,1.7-1.7c0.9,0,1.7,0.8,1.7,1.7C20.5,18.8,19.7,19.5,18.7,19.5z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 510 B |
After Width: | Height: | Size: 445 B |
After Width: | Height: | Size: 366 B |
After Width: | Height: | Size: 376 B |
After Width: | Height: | Size: 134 B |
After Width: | Height: | Size: 984 B |
After Width: | Height: | Size: 194 B |
After Width: | Height: | Size: 834 B |
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:none;}
|
||||
</style>
|
||||
<path class="st0" d="M0,0h24v24H0V0z"/>
|
||||
<g>
|
||||
<path d="M13.6,13.8c-1-0.2-2-0.3-2.8-0.3c-2.7,0-8,1.3-8,4v2h9.8c-0.3-0.6-0.4-1.3-0.4-2.1C12.2,15.9,12.7,14.7,13.6,13.8z"/>
|
||||
<circle cx="10.8" cy="7.4" r="4"/>
|
||||
</g>
|
||||
<path d="M21.1,17.9c0-0.1,0-0.3,0-0.4c0-0.2,0-0.3,0-0.4l1-0.7c0.1-0.1,0.1-0.2,0.1-0.3l-0.9-1.6c-0.1-0.1-0.2-0.1-0.3-0.1l-1.1,0.5
|
||||
c-0.2-0.2-0.5-0.3-0.8-0.4l-0.2-1.2c0-0.1-0.1-0.2-0.2-0.2h-1.8c-0.1,0-0.2,0.1-0.2,0.2l-0.2,1.2c-0.3,0.1-0.5,0.3-0.8,0.4l-1.1-0.5
|
||||
c-0.1,0-0.2,0-0.3,0.1L13.4,16c-0.1,0.1,0,0.2,0.1,0.3l1,0.7c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4l-1,0.7c-0.1,0.1-0.1,0.2-0.1,0.3
|
||||
l0.9,1.6c0.1,0.1,0.2,0.1,0.3,0.1l1.1-0.5c0.2,0.2,0.5,0.3,0.8,0.4l0.2,1.2c0,0.1,0.1,0.2,0.2,0.2h1.8c0.1,0,0.2-0.1,0.2-0.2
|
||||
l0.2-1.2c0.3-0.1,0.5-0.3,0.8-0.4l1.1,0.5c0.1,0,0.2,0,0.3-0.1l0.9-1.6c0.1-0.1,0-0.2-0.1-0.3L21.1,17.9z M17.7,19.2
|
||||
c-0.9,0-1.7-0.8-1.7-1.7c0-0.9,0.8-1.7,1.7-1.7c0.9,0,1.7,0.8,1.7,1.7C19.4,18.4,18.7,19.2,17.7,19.2z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 678 B |
Before Width: | Height: | Size: 787 B After Width: | Height: | Size: 787 B |
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 686 B After Width: | Height: | Size: 686 B |
After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 974 B After Width: | Height: | Size: 974 B |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 616 B |
After Width: | Height: | Size: 262 B |
After Width: | Height: | Size: 214 B |
After Width: | Height: | Size: 226 B |
After Width: | Height: | Size: 344 B |
After Width: | Height: | Size: 626 B |
After Width: | Height: | Size: 642 B |
After Width: | Height: | Size: 608 B |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 414 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 888 B |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.3 KiB |