mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-11 07:29:38 -05:00
Retroshare android service now run and start at boot on android, the qml app is still disfunctional
This commit is contained in:
parent
68a00138d2
commit
279551fe8d
@ -35,6 +35,8 @@ export HOST_NUM_CPU=1
|
||||
|
||||
Now is time for the bad news: as of today Qt assume you use the NDK precompiled toolchain and doesn't have an option to use the custom toolchain you just generated, so you need to tweak a little Qt internals to make usage of the custom toolchain. First of all you need to determine your Qt for Android installation path, in my case it is +/opt/Qt5.7.0/+ then find the +mkspecs+ directory in my case +/opt/Qt5.7.0/5.7/android_armv7/mkspecs+ and then modify qmake configuration for android target according to your toolchain, in my case I have done it with the following commands in the same shell I used before to take advantege of the variables I set before.
|
||||
|
||||
WARNING: This may need slightly modification if you have a different Qt version.
|
||||
|
||||
[source,bash]
|
||||
-------------------------------------------------------------------------------
|
||||
export QT_PATH="/opt/Qt5.7.0/"
|
||||
@ -44,11 +46,10 @@ cd ${QT_PATH}/${QT_MAJOR_VERSION}/android_armv7/mkspecs
|
||||
sudo --preserve-env -s
|
||||
cp -r android-g++ android-g++-backup
|
||||
cd android-g++
|
||||
sed -i "s|^ANDROID_PLATFORM =.*|ANDROID_PLATFORM = android-${ANDROID_PLATFORM_VER}|" qmake.conf
|
||||
sed -i "s|^NDK_TOOLCHAIN_PATH =.*|NDK_TOOLCHAIN_PATH = ${NDK_TOOLCHAIN_PATH}|" qmake.conf
|
||||
sed -i "s|^QMAKE_LFLAGS \+=.*|QMAKE_LFLAGS = --sysroot=${NDK_TOOLCHAIN_PATH}/sysroot/|" qmake.conf
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
== Preparing Qt Creator
|
||||
|
||||
Now that your environement is set up you should configure Qt Creator for Android following the link:http://doc.qt.io/qtcreator/creator-developing-android.html[official guide], at the end of this step your Qt Creator should recognize Android compiler and Qt for Android kit, because we use a custom toolchain some step more is needed.
|
||||
@ -61,33 +62,16 @@ Now go to the Kits tab, select +Android for armeabi-v7a (GCC 4.9, Qt 5.7.0)+ and
|
||||
|
||||
Your Kit is now ready to use, now you can open retroshare as Qt Creator project and in the Projects left menu add the newly created kit if not already present, so you can select it on the build type selection button down on the left.
|
||||
|
||||
== Final tweaks
|
||||
Some of RetroShare modules like +retroshare-gui+, +WebUI+ and +sqlcipher+ are not supported yet on android so to be able to compile RetroShare without error you will have to go to +
|
||||
|
||||
RetroShare GUI, plugins and WebUI are yet not supported on android so to be able to compile RetroShare without error you will have to open RetroShare.pro file with Qt Creator and change the following assignation
|
||||
Qt Creator left pane -> Projects -> Build and Run -> Android SOMESTUFF kit -> Build Steps -> qmake -> Additional arguments, and add the following configurations
|
||||
|
||||
[source,makefile]
|
||||
-------------------------------------------------------------------------------
|
||||
SUBDIRS += \
|
||||
openpgpsdk \
|
||||
libbitdht \
|
||||
libretroshare \
|
||||
libresapi \
|
||||
retroshare_gui \
|
||||
retroshare_nogui \
|
||||
plugins
|
||||
CONFIG+=no_retroshare_gui CONFIG+=no_retroshare_nogui CONFIG+=no_retroshare_plugins CONFIG+=retroshare_android_service CONFIG+=libresapilocalserver CONFIG+=no_libresapihttpserver CONFIG+=no_sqlcipher CONFIG+=retroshare_qml_app
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
into
|
||||
|
||||
[source,makefile]
|
||||
-------------------------------------------------------------------------------
|
||||
SUBDIRS += \
|
||||
openpgpsdk \
|
||||
libbitdht \
|
||||
libretroshare \
|
||||
libresapi \
|
||||
retroshare_nogui
|
||||
-------------------------------------------------------------------------------
|
||||
WARNING: SQLCipher is not supported yet on RetroShare for android this pose a mayor security concern, we are working to fix this ASAP.
|
||||
|
||||
|
||||
== Furter Readings
|
||||
|
@ -38,6 +38,13 @@ retroshare_android_service {
|
||||
retroshare_android_service.target = retroshare_android_service
|
||||
}
|
||||
|
||||
retroshare_qml_app {
|
||||
SUBDIRS += retroshare_qml_app
|
||||
retroshare_qml_app.file = retroshare-qml-app/src/retroshare-qml-app.pro
|
||||
retroshare_qml_app.depends = libretroshare retroshare_android_service
|
||||
retroshare_qml_app.target = retroshare_qml_app
|
||||
}
|
||||
|
||||
retroshare_plugins {
|
||||
SUBDIRS += plugins
|
||||
plugins.file = plugins/plugins.pro
|
||||
|
@ -2,19 +2,28 @@
|
||||
|
||||
## You are supposed to provide the following variables according to your system setup
|
||||
[ -z ${ANDROID_NDK_PATH+x} ] && export ANDROID_NDK_PATH="/opt/android-ndk/"
|
||||
[ -z ${NDK_TOOLCHAIN_PATH+x} ] && export NDK_TOOLCHAIN_PATH="/home/$(whoami)/Development/android-toolchains/retroshare-android/"
|
||||
[ -z ${ANDROID_NDK_ARCH+x} ] && export ANDROID_NDK_ARCH="arm"
|
||||
[ -z ${ANDROID_PLATFORM_VER+x} ] && export ANDROID_PLATFORM_VER="23"
|
||||
[ -z ${ANDROID_NDK_ABI_VER+x} ] && export ANDROID_NDK_ABI_VER="4.9"
|
||||
[ -z ${ANDROID_PLATFORM_VER+x} ] && export ANDROID_PLATFORM_VER="18"
|
||||
[ -z ${NDK_TOOLCHAIN_PATH+x} ] && export NDK_TOOLCHAIN_PATH="/home/$(whoami)/Development/android-toolchains/retroshare-android-${ANDROID_PLATFORM_VER}-${ANDROID_NDK_ARCH}-abi${ANDROID_NDK_ABI_VER}/"
|
||||
[ -z ${HOST_NUM_CPU+x} ] && export HOST_NUM_CPU=4
|
||||
|
||||
runDir="$(pwd)"
|
||||
|
||||
## You should not edit the following variables
|
||||
if [ "${ANDROID_NDK_ARCH}" == "x86" ]; then
|
||||
cArch="i686"
|
||||
eABI=""
|
||||
else
|
||||
cArch="${ANDROID_NDK_ARCH}"
|
||||
eABI="eabi"
|
||||
fi
|
||||
export SYSROOT="${NDK_TOOLCHAIN_PATH}/sysroot"
|
||||
export PREFIX="${SYSROOT}"
|
||||
export CC="${NDK_TOOLCHAIN_PATH}/bin/arm-linux-androideabi-gcc"
|
||||
export CXX="${NDK_TOOLCHAIN_PATH}/bin/arm-linux-androideabi-g++"
|
||||
export AR="${NDK_TOOLCHAIN_PATH}/bin/arm-linux-androideabi-ar"
|
||||
export RANLIB="${NDK_TOOLCHAIN_PATH}/bin/arm-linux-androideabi-gcc-ranlib"
|
||||
export CC="${NDK_TOOLCHAIN_PATH}/bin/${cArch}-linux-android${eABI}-gcc"
|
||||
export CXX="${NDK_TOOLCHAIN_PATH}/bin/${cArch}-linux-android${eABI}-g++"
|
||||
export AR="${NDK_TOOLCHAIN_PATH}/bin/${cArch}-linux-android${eABI}-ar"
|
||||
export RANLIB="${NDK_TOOLCHAIN_PATH}/bin/${cArch}-linux-android${eABI}-ranlib"
|
||||
export ANDROID_DEV="${ANDROID_NDK_PATH}/platforms/android-${ANDROID_PLATFORM_VER}/arch-${ANDROID_NDK_ARCH}/usr"
|
||||
|
||||
|
||||
@ -22,7 +31,8 @@ export ANDROID_DEV="${ANDROID_NDK_PATH}/platforms/android-${ANDROID_PLATFORM_VER
|
||||
build_toolchain()
|
||||
{
|
||||
rm -rf ${NDK_TOOLCHAIN_PATH}
|
||||
${ANDROID_NDK_PATH}/build/tools/make-standalone-toolchain.sh --ndk-dir=${ANDROID_NDK_PATH} --arch=${ANDROID_NDK_ARCH} --install-dir=${NDK_TOOLCHAIN_PATH} --platform=android-${ANDROID_PLATFORM_VER}
|
||||
[ "${ANDROID_NDK_ARCH}" == "x86" ] && toolchainName="${ANDROID_NDK_ARCH}-${ANDROID_NDK_ABI_VER}" || toolchainName="${ANDROID_NDK_ARCH}-linux-androideabi-${ANDROID_NDK_ABI_VER}"
|
||||
${ANDROID_NDK_PATH}/build/tools/make-standalone-toolchain.sh --ndk-dir=${ANDROID_NDK_PATH} --arch=${ANDROID_NDK_ARCH} --install-dir=${NDK_TOOLCHAIN_PATH} --platform=android-${ANDROID_PLATFORM_VER} --toolchain=${toolchainName} --verbose
|
||||
}
|
||||
|
||||
## More information available at retroshare://file?name=Android%20Native%20Development%20Kit%20Cookbook.pdf&size=29214468&hash=0123361c1b14366ce36118e82b90faf7c7b1b136
|
||||
@ -40,9 +50,9 @@ build_bzlib()
|
||||
sed -i "s/^all: libbz2.a bzip2 bzip2recover test/all: libbz2.a bzip2 bzip2recover/" Makefile
|
||||
make -j${HOST_NUM_CPU}
|
||||
make install PREFIX=${SYSROOT}/usr
|
||||
sed -i "/^CC=.*/d" Makefile-libbz2_so
|
||||
make -f Makefile-libbz2_so -j${HOST_NUM_CPU}
|
||||
cp libbz2.so.1.0.6 ${SYSROOT}/usr/lib/libbz2.so
|
||||
# sed -i "/^CC=.*/d" Makefile-libbz2_so
|
||||
# make -f Makefile-libbz2_so -j${HOST_NUM_CPU}
|
||||
# cp libbz2.so.1.0.6 ${SYSROOT}/usr/lib/libbz2.so
|
||||
cd ..
|
||||
}
|
||||
|
||||
@ -54,12 +64,23 @@ build_openssl()
|
||||
[ -f $B_dir.tar.gz ] || wget https://www.openssl.org/source/$B_dir.tar.gz
|
||||
tar -xf $B_dir.tar.gz
|
||||
cd $B_dir
|
||||
ANDROID_NDK_ROOT="${ANDROID_NDK_PATH}" ./Configure shared android-armv7 --prefix="${SYSROOT}/usr" --openssldir="${SYSROOT}/etc/ssl"
|
||||
if [ "${ANDROID_NDK_ARCH}" == "arm" ]; then
|
||||
oArch="armv7"
|
||||
else
|
||||
oArch="${ANDROID_NDK_ARCH}"
|
||||
fi
|
||||
# ANDROID_NDK_ROOT="${ANDROID_NDK_PATH}" ./Configure android-${oArch} shared --prefix="${SYSROOT}/usr" --openssldir="${SYSROOT}/etc/ssl"
|
||||
## We link openssl statically to avoid android silently sneaking in his own
|
||||
## version of libssl.so (we noticed this because it had some missing symbol
|
||||
## that made RS crash), the crash in some android version is only one of the
|
||||
## possible problems the fact that android insert his own binary libssl.so pose
|
||||
## non neglegible security concerns.
|
||||
ANDROID_NDK_ROOT="${ANDROID_NDK_PATH}" ./Configure android-${oArch} --prefix="${SYSROOT}/usr" --openssldir="${SYSROOT}/etc/ssl"
|
||||
sed -i 's/LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \\/LIBNAME=$$i \\/g' Makefile
|
||||
sed -i '/LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \\/d' Makefile
|
||||
make -j${HOST_NUM_CPU}
|
||||
make install
|
||||
cp *.so "${SYSROOT}/usr/lib"
|
||||
# cp *.so "${SYSROOT}/usr/lib"
|
||||
cd ..
|
||||
}
|
||||
|
||||
@ -72,6 +93,7 @@ build_sqlite()
|
||||
./configure --prefix="${SYSROOT}/usr" --host=${ANDROID_NDK_ARCH}-linux
|
||||
make -j${HOST_NUM_CPU}
|
||||
make install
|
||||
rm -f ${SYSROOT}/usr/lib/libsqlite3.so*
|
||||
${CC} -shared -o libsqlite3.so -fPIC sqlite3.o -ldl
|
||||
cp libsqlite3.so "${SYSROOT}/usr/lib"
|
||||
cd ..
|
||||
|
@ -21,9 +21,9 @@
|
||||
|
||||
namespace resource_api{
|
||||
|
||||
ApiServerLocal::ApiServerLocal(ApiServer* server, QObject *parent) :
|
||||
ApiServerLocal::ApiServerLocal(ApiServer* server, const QString &listenPath, QObject *parent) :
|
||||
QObject(parent), serverThread(this),
|
||||
localListener(server) // Must have no parent to be movable to other thread
|
||||
localListener(server, listenPath) // Must have no parent to be movable to other thread
|
||||
{
|
||||
localListener.moveToThread(&serverThread);
|
||||
serverThread.start();
|
||||
@ -31,15 +31,17 @@ ApiServerLocal::ApiServerLocal(ApiServer* server, QObject *parent) :
|
||||
|
||||
ApiServerLocal::~ApiServerLocal() { serverThread.quit(); }
|
||||
|
||||
ApiLocalListener::ApiLocalListener(ApiServer *server, QObject *parent) :
|
||||
ApiLocalListener::ApiLocalListener(ApiServer *server,
|
||||
const QString &listenPath,
|
||||
QObject *parent) :
|
||||
QObject(parent), mApiServer(server), mLocalServer(this)
|
||||
{
|
||||
mLocalServer.removeServer(serverName());
|
||||
mLocalServer.removeServer(listenPath);
|
||||
#if QT_VERSION >= 0x050000
|
||||
mLocalServer.setSocketOptions(QLocalServer::UserAccessOption);
|
||||
#endif
|
||||
connect(&mLocalServer, SIGNAL(newConnection()), this, SLOT(handleConnection()));
|
||||
mLocalServer.listen(serverName());
|
||||
mLocalServer.listen(listenPath);
|
||||
}
|
||||
|
||||
void ApiLocalListener::handleConnection()
|
||||
|
@ -34,16 +34,9 @@ class ApiLocalListener : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ApiLocalListener(ApiServer* server, QObject *parent=0);
|
||||
ApiLocalListener(ApiServer* server, const QString &listenPath, QObject *parent=0);
|
||||
~ApiLocalListener() { mLocalServer.close(); }
|
||||
|
||||
const static QString& serverName()
|
||||
{
|
||||
const static QString sockPath(RsAccounts::AccountDirectory()
|
||||
.append("/libresapi.sock").c_str());
|
||||
return sockPath;
|
||||
}
|
||||
|
||||
public slots:
|
||||
void handleConnection();
|
||||
|
||||
@ -57,9 +50,23 @@ class ApiServerLocal : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ApiServerLocal(ApiServer* server, QObject *parent=0);
|
||||
ApiServerLocal(ApiServer* server, const QString& listenPath, QObject *parent=0);
|
||||
~ApiServerLocal();
|
||||
|
||||
const static QString& loginServerPath()
|
||||
{
|
||||
const static QString sockPath(RsAccounts::ConfigDirectory()
|
||||
.append("/libresapi.sock").c_str());
|
||||
return sockPath;
|
||||
}
|
||||
|
||||
const static QString& serverPath()
|
||||
{
|
||||
const static QString sockPath(RsAccounts::AccountDirectory()
|
||||
.append("/libresapi.sock").c_str());
|
||||
return sockPath;
|
||||
}
|
||||
|
||||
private:
|
||||
QThread serverThread;
|
||||
ApiLocalListener localListener;
|
||||
|
@ -881,3 +881,16 @@ test_bitdht {
|
||||
# ENABLED UDP NOW.
|
||||
}
|
||||
|
||||
android-g++ {
|
||||
## Add this here and not in retroshare.pri because static library are very
|
||||
## sensible to order in command line
|
||||
LIBS += -L$$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/ -lssl
|
||||
INCLUDEPATH += $$NDK_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
DEPENDPATH += $$NDK_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
PRE_TARGETDEPS += $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libssl.a
|
||||
|
||||
LIBS += -L$$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/ -lcrypto
|
||||
INCLUDEPATH += $$NDK_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
DEPENDPATH += $$NDK_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
PRE_TARGETDEPS += $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libcrypto.a
|
||||
}
|
||||
|
@ -129,15 +129,21 @@ class RsInit
|
||||
|
||||
namespace RsAccounts
|
||||
{
|
||||
// Directories.
|
||||
std::string ConfigDirectory(); // aka Base Directory. (normally ~/.retroshare)
|
||||
/**
|
||||
* @brief ConfigDirectory (normally ~/.retroshare) you can call this method
|
||||
* even before initialisation (you can't with some other methods)
|
||||
* @see RsAccountsDetail::PathBaseDirectory()
|
||||
*/
|
||||
std::string ConfigDirectory();
|
||||
|
||||
/**
|
||||
* @brief DataDirectory
|
||||
* you can call this method even before initialisation (you can't with the other methods)
|
||||
* you can call this method even before initialisation (you can't with some other methods)
|
||||
* @param check if set to true and directory does not exist, return empty string
|
||||
* @return path where global platform independent files are stored, like bdboot.txt or webinterface files
|
||||
*/
|
||||
std::string DataDirectory(bool check = true);
|
||||
|
||||
std::string PGPDirectory();
|
||||
std::string AccountDirectory();
|
||||
|
||||
|
@ -65,14 +65,8 @@ AccountDetails::AccountDetails()
|
||||
return;
|
||||
}
|
||||
|
||||
RsAccountsDetail::RsAccountsDetail()
|
||||
:mAccountsLocked(false), mPreferredId(""), mBaseDirectory("")
|
||||
{
|
||||
mAccounts.clear();
|
||||
mUnsupportedKeys.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
RsAccountsDetail::RsAccountsDetail() : mAccountsLocked(false), mPreferredId("")
|
||||
{}
|
||||
|
||||
bool RsAccountsDetail::loadAccounts()
|
||||
{
|
||||
@ -214,6 +208,7 @@ std::string RsAccountsDetail::PathPGPDirectory()
|
||||
|
||||
std::string RsAccountsDetail::PathBaseDirectory()
|
||||
{
|
||||
if(mBaseDirectory.empty()) defaultBaseDirectory();
|
||||
return mBaseDirectory;
|
||||
}
|
||||
|
||||
@ -326,8 +321,6 @@ bool RsAccountsDetail::setupBaseDirectory(std::string alt_basedir)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool RsAccountsDetail::defaultBaseDirectory()
|
||||
{
|
||||
std::string basedir;
|
||||
@ -339,8 +332,8 @@ bool RsAccountsDetail::defaultBaseDirectory()
|
||||
char *h = getenv("HOME");
|
||||
if (h == NULL)
|
||||
{
|
||||
std::cerr << "defaultBaseDirectory() Error: ";
|
||||
std::cerr << "cannot determine $HOME dir" <<std::endl;
|
||||
std::cerr << "defaultBaseDirectory() Error: cannot determine $HOME dir"
|
||||
<< std::endl;
|
||||
return false ;
|
||||
}
|
||||
|
||||
@ -1254,7 +1247,7 @@ bool RsInit::LoadPassword(const std::string& id, const std::string& inPwd)
|
||||
********************************************************************************/
|
||||
|
||||
// Directories.
|
||||
std::string RsAccounts::ConfigDirectory() { return rsAccounts->PathBaseDirectory(); }
|
||||
std::string RsAccounts::ConfigDirectory() { return RsAccountsDetail::PathBaseDirectory(); }
|
||||
std::string RsAccounts::DataDirectory(bool check) { return RsAccountsDetail::PathDataDirectory(check); }
|
||||
std::string RsAccounts::PGPDirectory() { return rsAccounts->PathPGPDirectory(); }
|
||||
std::string RsAccounts::AccountDirectory() { return rsAccounts->PathAccountDirectory(); }
|
||||
@ -1333,3 +1326,4 @@ bool RsAccounts::GenerateSSLCertificate(const RsPgpId& pgp_id, const std::str
|
||||
* END OF: PUBLIC INTERFACE FUNCTIONS
|
||||
********************************************************************************/
|
||||
|
||||
std::string RsAccountsDetail::mBaseDirectory;
|
||||
|
@ -80,7 +80,13 @@ class RsAccountsDetail
|
||||
* @return path where global platform independent files are stored, like bdboot.txt or webinterface files
|
||||
*/
|
||||
static std::string PathDataDirectory(bool check = true);
|
||||
std::string PathBaseDirectory();
|
||||
|
||||
/**
|
||||
* @brief PathBaseDirectory
|
||||
* @return path where user data is stored ( on Linux and similar
|
||||
* systems it is usually something like /home/USERNAME/.retroshare ).
|
||||
*/
|
||||
static std::string PathBaseDirectory();
|
||||
|
||||
// PGP Path is only dependent on BaseDirectory.
|
||||
std::string PathPGPDirectory();
|
||||
@ -134,7 +140,7 @@ class RsAccountsDetail
|
||||
private:
|
||||
bool checkPreferredId();
|
||||
|
||||
bool defaultBaseDirectory();
|
||||
static bool defaultBaseDirectory();
|
||||
|
||||
bool getAvailableAccounts(std::map<RsPeerId, AccountDetails> &accounts,
|
||||
int& failing_accounts,
|
||||
@ -148,7 +154,7 @@ class RsAccountsDetail
|
||||
|
||||
std::map<RsPeerId, AccountDetails> mAccounts;
|
||||
RsPeerId mPreferredId;
|
||||
std::string mBaseDirectory;
|
||||
static std::string mBaseDirectory;
|
||||
|
||||
std::map<std::string,std::vector<std::string> > mUnsupportedKeys ;
|
||||
};
|
||||
|
@ -507,7 +507,7 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck
|
||||
AuthSSL::AuthSSLInit();
|
||||
AuthSSL::getAuthSSL() -> InitAuth(NULL, NULL, NULL, "");
|
||||
|
||||
rsAccounts = new RsAccountsDetail() ;
|
||||
rsAccounts = new RsAccountsDetail();
|
||||
|
||||
// first check config directories, and set bootstrap values.
|
||||
if(!rsAccounts->setupBaseDirectory(opt_base_dir))
|
||||
|
@ -32,10 +32,19 @@
|
||||
#include "rsserver/rsaccounts.h"
|
||||
#include "rsdiscspace.h"
|
||||
#include <util/rsthreads.h>
|
||||
#ifndef WIN32
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
#ifdef __ANDROID__
|
||||
# include <android/api-level.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
# include <wtypes.h>
|
||||
#elif defined(__ANDROID__) && (__ANDROID_API__ < 21)
|
||||
# include <sys/vfs.h>
|
||||
# define statvfs64 statfs
|
||||
# warning statvfs64 is not supported with android platform < 21 falling back to statfs that is untested (may misbehave)
|
||||
#else
|
||||
#include <wtypes.h>
|
||||
# include <sys/statvfs.h>
|
||||
#endif
|
||||
|
||||
#define DELAY_BETWEEN_CHECKS 2
|
||||
|
@ -0,0 +1,23 @@
|
||||
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
||||
|
||||
TARGET = retroshare-android-service
|
||||
|
||||
QT += core network androidextras
|
||||
QT -= gui
|
||||
|
||||
CONFIG += c++11
|
||||
CONFIG += dll
|
||||
|
||||
TEMPLATE = lib
|
||||
|
||||
SOURCES += service.cpp
|
||||
|
||||
DEPENDPATH *= ../../libresapi/src
|
||||
INCLUDEPATH *= ../../libresapi/src
|
||||
PRE_TARGETDEPS *= ../../libresapi/src/lib/libresapi.a
|
||||
LIBS *= ../../libresapi/src/lib/libresapi.a
|
||||
|
||||
DEPENDPATH *= ../../libretroshare/src
|
||||
INCLUDEPATH *= ../../libretroshare/src
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS *= ../../libretroshare/src/lib/libretroshare.a
|
52
retroshare-android-service/src/service.cpp
Normal file
52
retroshare-android-service/src/service.cpp
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* RetroShare Android Service
|
||||
* Copyright (C) 2016 Gioacchino Mazzurco <gio@eigenlab.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QtAndroidExtras>
|
||||
|
||||
#include "retroshare/rsinit.h"
|
||||
#include "api/ApiServer.h"
|
||||
#include "api/ApiServerLocal.h"
|
||||
#include "api/RsControlModule.h"
|
||||
|
||||
using namespace resource_api;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
ApiServer api;
|
||||
RsControlModule ctrl_mod(argc, argv, api.getStateTokenServer(), &api, true);
|
||||
api.addResourceHandler("control", dynamic_cast<resource_api::ResourceRouter*>(&ctrl_mod), &resource_api::RsControlModule::handleRequest);
|
||||
|
||||
QString sockPath = QString::fromStdString(RsAccounts::ConfigDirectory());
|
||||
sockPath.append("/libresapi.sock");
|
||||
qDebug() << "Listening on:" << sockPath;
|
||||
ApiServerLocal apiServerLocal(&api, sockPath); (void) apiServerLocal;
|
||||
|
||||
qDebug() << "Is service.cpp running as a service?" << QtAndroid::androidService().isValid();
|
||||
qDebug() << "Is service.cpp running as an activity?" << QtAndroid::androidActivity().isValid();
|
||||
|
||||
while (!ctrl_mod.processShouldExit())
|
||||
{
|
||||
a.processEvents();
|
||||
usleep(20000);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -100,7 +100,7 @@ QString WebuiPage::helpText() const
|
||||
|
||||
// TODO: LIBRESAPI_LOCAL_SERVER Move in appropriate place
|
||||
#ifdef LIBRESAPI_LOCAL_SERVER
|
||||
apiServerLocal = new resource_api::ApiServerLocal(apiServer);
|
||||
apiServerLocal = new resource_api::ApiServerLocal(apiServer, resource_api::ApiServerLocal::serverPath());
|
||||
#endif
|
||||
return ok;
|
||||
}
|
||||
|
10
retroshare-qml-app/src/Page1.qml
Normal file
10
retroshare-qml-app/src/Page1.qml
Normal file
@ -0,0 +1,10 @@
|
||||
import QtQuick 2.7
|
||||
|
||||
Page1Form {
|
||||
button1.onClicked: {
|
||||
console.log("Button 1 clicked.");
|
||||
}
|
||||
button2.onClicked: {
|
||||
console.log("Button 2 clicked.");
|
||||
}
|
||||
}
|
22
retroshare-qml-app/src/Page1Form.ui.qml
Normal file
22
retroshare-qml-app/src/Page1Form.ui.qml
Normal file
@ -0,0 +1,22 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.0
|
||||
|
||||
Item {
|
||||
property alias button1: button1
|
||||
property alias button2: button2
|
||||
|
||||
RowLayout {
|
||||
anchors.centerIn: parent
|
||||
|
||||
Button {
|
||||
id: button1
|
||||
text: qsTr("Press Me 1")
|
||||
}
|
||||
|
||||
Button {
|
||||
id: button2
|
||||
text: qsTr("Press Me 2")
|
||||
}
|
||||
}
|
||||
}
|
5
retroshare-qml-app/src/android/.gitignore
vendored
Normal file
5
retroshare-qml-app/src/android/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
.build
|
||||
.gradle
|
||||
.idea
|
||||
captures
|
||||
local.properties
|
139
retroshare-qml-app/src/android/AndroidManifest.xml
Normal file
139
retroshare-qml-app/src/android/AndroidManifest.xml
Normal file
@ -0,0 +1,139 @@
|
||||
<?xml version="1.0"?>
|
||||
<manifest package="org.retroshare.android.qml_app" 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="RetroShare">
|
||||
<activity
|
||||
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
|
||||
android:name=".RetroShareQmlActivity"
|
||||
android:label="RetroShare QML"
|
||||
android:screenOrientation="unspecified"
|
||||
android:launchMode="singleTop">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
|
||||
<!-- Application to launch -->
|
||||
<meta-data android:name="android.app.lib_name" android:value="retroshare-qml-app"/>
|
||||
<!-- Application to launch -->
|
||||
|
||||
<!-- Application arguments -->
|
||||
<!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ -->
|
||||
<!-- Application arguments -->
|
||||
|
||||
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
|
||||
<meta-data android:name="android.app.repository" android:value="default"/>
|
||||
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
||||
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
|
||||
<!-- Deploy Qt libs as part of package -->
|
||||
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
|
||||
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
||||
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
|
||||
<!-- Run with local libs -->
|
||||
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
|
||||
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
|
||||
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
|
||||
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
|
||||
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
|
||||
<!-- Messages maps -->
|
||||
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
|
||||
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
|
||||
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
|
||||
<!-- Messages maps -->
|
||||
|
||||
<!-- Splash screen -->
|
||||
<!-- meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/ -->
|
||||
<!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ -->
|
||||
<!-- Splash screen -->
|
||||
|
||||
<!-- Background running -->
|
||||
<!-- Warning: changing this value to true may cause unexpected crashes if the
|
||||
application still try to draw after
|
||||
"applicationStateChanged(Qt::ApplicationSuspended)"
|
||||
signal is sent! -->
|
||||
<meta-data android:name="android.app.background_running" android:value="false"/>
|
||||
<!-- Background running -->
|
||||
|
||||
<!-- auto screen scale factor -->
|
||||
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/>
|
||||
<!-- auto screen scale factor -->
|
||||
|
||||
<!-- extract android style -->
|
||||
<!-- available android:values :
|
||||
* full - useful QWidget & Quick Controls 1 apps
|
||||
* minimal - useful for Quick Controls 2 apps, it is much faster than "full"
|
||||
* none - useful for apps that don't use any of the above Qt modules
|
||||
-->
|
||||
<meta-data android:name="android.app.extract_android_style" android:value="full"/>
|
||||
<!-- extract android style -->
|
||||
</activity>
|
||||
|
||||
<receiver android:name=".BootCompletedReceiver" android:enabled="true" android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices -->
|
||||
<service
|
||||
android:process=":rs"
|
||||
android:name=".RetroShareAndroidService"
|
||||
android:label="RetroShare Service"
|
||||
android:exported="true"> <!-- Added to be able to run the service from adb shell -->
|
||||
<!-- android:process=":qt" is needed to force the service to run on a separate process than the Activity -->
|
||||
|
||||
|
||||
<!-- Application arguments -->
|
||||
<!-- meta-data android:name="android.app.arguments" android:value="-service"/ -->
|
||||
<!-- Application arguments -->
|
||||
|
||||
<!-- If you are using the same application (.so file) for activity and also for service, then you
|
||||
need to use *android.app.arguments* to pass some arguments to your service in order to know which
|
||||
one is which.
|
||||
-->
|
||||
|
||||
<!-- Application to launch -->
|
||||
<meta-data android:name="android.app.lib_name" android:value="retroshare-android-service"/>
|
||||
<!-- Application to launch -->
|
||||
|
||||
<!-- Ministro -->
|
||||
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
|
||||
<meta-data android:name="android.app.repository" android:value="default"/>
|
||||
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
||||
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
|
||||
<!-- Deploy Qt libs as part of package -->
|
||||
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
|
||||
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
||||
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
|
||||
<!-- Run with local libs -->
|
||||
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
|
||||
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
|
||||
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
|
||||
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
|
||||
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
|
||||
<!-- Messages maps -->
|
||||
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
|
||||
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
|
||||
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
|
||||
<!-- Messages maps -->
|
||||
|
||||
|
||||
<!-- Background running -->
|
||||
<meta-data android:name="android.app.background_running" android:value="true"/>
|
||||
<!-- Background running -->
|
||||
</service>
|
||||
</application>
|
||||
|
||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="18"/>
|
||||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
||||
|
||||
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
|
||||
Remove the comment if you do not require these default permissions. -->
|
||||
<!-- %%INSERT_PERMISSIONS -->
|
||||
|
||||
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
|
||||
Remove the comment if you do not require these default features. -->
|
||||
<!-- %%INSERT_FEATURES -->
|
||||
|
||||
<!-- Added by G10h4ck: Needed permission for autostart at boot -->
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
</manifest>
|
96
retroshare-qml-app/src/android/android.iml
Normal file
96
retroshare-qml-app/src/android/android.iml
Normal file
@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id="android" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="android-gradle" name="Android-Gradle">
|
||||
<configuration>
|
||||
<option name="GRADLE_PROJECT_PATH" value=":" />
|
||||
</configuration>
|
||||
</facet>
|
||||
<facet type="android" name="Android">
|
||||
<configuration>
|
||||
<option name="SELECTED_BUILD_VARIANT" value="debug" />
|
||||
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
|
||||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
||||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
|
||||
<afterSyncTasks>
|
||||
<task>generateDebugSources</task>
|
||||
</afterSyncTasks>
|
||||
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
||||
<option name="RES_FOLDER_RELATIVE_PATH" value="/../../../../qt5/qtbase/src/android/java/res" />
|
||||
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/../../../../qt5/qtbase/src/android/java/res;file://$MODULE_DIR$/res" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/.build/intermediates/classes/debug" />
|
||||
<output-test url="file://$MODULE_DIR$/.build/intermediates/classes/test/debug" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/../../../../qt5/qtbase/src/android/java/res">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../../../qt5/qtbase/src/android/java/res" type="java-resource" />
|
||||
</content>
|
||||
<content url="file://$MODULE_DIR$/../../../../qt5/qtbase/src/android/java/src">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../../../qt5/qtbase/src/android/java/src" isTestSource="false" />
|
||||
</content>
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/.build/generated/source/r/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/.build/generated/source/aidl/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/.build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/.build/generated/source/rs/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/.build/generated/res/rs/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/.build/generated/res/generated/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/.build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/.build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/.build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/.build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/.build/generated/res/rs/androidTest/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/.build/generated/res/generated/androidTest/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/assets" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.build/intermediates/assets" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.build/intermediates/incremental" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.build/intermediates/manifests" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.build/intermediates/mockable-android-18.jar" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.build/intermediates/res" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.build/intermediates/resources" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.build/intermediates/rs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.build/intermediates/symbols" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.build/outputs" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 18 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="mockable-android-18" level="project" />
|
||||
</component>
|
||||
</module>
|
57
retroshare-qml-app/src/android/build.gradle
Normal file
57
retroshare-qml-app/src/android/build.gradle
Normal file
@ -0,0 +1,57 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.1.0'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
}
|
||||
|
||||
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 androidBuildToolsVersion
|
||||
|
||||
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']
|
||||
}
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
Activity Resolver Table:
|
||||
Non-Data Actions:
|
||||
android.intent.action.MAIN:
|
||||
42420338 org.retroshare.android.qml_app/.RetroShareQmlActivity filter 42424830
|
||||
|
||||
Receiver Resolver Table:
|
||||
Non-Data Actions:
|
||||
android.intent.action.BOOT_COMPLETED:
|
||||
4245c230 org.retroshare.android.qml_app/.BootCompletedReceiver filter 4245c360
|
||||
|
||||
Packages:
|
||||
Package [org.retroshare.android.qml_app] (4289b2f8):
|
||||
userId=10168 gids=[3003, 1015, 1028]
|
||||
pkg=Package{42244e18 org.retroshare.android.qml_app}
|
||||
codePath=/data/app/org.retroshare.android.qml_app-2.apk
|
||||
resourcePath=/data/app/org.retroshare.android.qml_app-2.apk
|
||||
nativeLibraryPath=/data/app-lib/org.retroshare.android.qml_app-2
|
||||
versionCode=1 targetSdk=18
|
||||
versionName=1.0
|
||||
applicationInfo=ApplicationInfo{4232af50 org.retroshare.android.qml_app}
|
||||
flags=[ DEBUGGABLE HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]
|
||||
dataDir=/data/data/org.retroshare.android.qml_app
|
||||
supportsScreens=[small, medium, large, xlarge, resizeable, anyDensity]
|
||||
timeStamp=2016-08-22 16:53:12
|
||||
firstInstallTime=2016-08-22 16:47:19
|
||||
lastUpdateTime=2016-08-22 16:53:30
|
||||
signatures=PackageSignatures{4233b1e0 [4265b018]}
|
||||
permissionsFixed=true haveGids=true installStatus=1
|
||||
pkgFlags=[ DEBUGGABLE HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]
|
||||
User 0: installed=true stopped=false notLaunched=false enabled=0
|
||||
grantedPermissions:
|
||||
android.permission.READ_EXTERNAL_STORAGE
|
||||
android.permission.RECEIVE_BOOT_COMPLETED
|
||||
android.permission.ACCESS_NETWORK_STATE
|
||||
android.permission.WRITE_EXTERNAL_STORAGE
|
||||
android.permission.INTERNET
|
9
retroshare-qml-app/src/android/gradle.properties
Normal file
9
retroshare-qml-app/src/android/gradle.properties
Normal file
@ -0,0 +1,9 @@
|
||||
## This file is automatically generated by QtCreator.
|
||||
#
|
||||
# This file must *NOT* be checked into Version Control Systems,
|
||||
# as it contains information specific to your local configuration.
|
||||
|
||||
androidBuildToolsVersion=24.0.1
|
||||
androidCompileSdkVersion=18
|
||||
buildDir=.build
|
||||
qt5AndroidDir=/opt/Qt5.7.0/5.7/android_armv7/src/android/java
|
BIN
retroshare-qml-app/src/android/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
retroshare-qml-app/src/android/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
retroshare-qml-app/src/android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
retroshare-qml-app/src/android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
#Wed Apr 10 15:27:10 PDT 2013
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
|
164
retroshare-qml-app/src/android/gradlew
vendored
Executable file
164
retroshare-qml-app/src/android/gradlew
vendored
Executable file
@ -0,0 +1,164 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
90
retroshare-qml-app/src/android/gradlew.bat
vendored
Normal file
90
retroshare-qml-app/src/android/gradlew.bat
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
25
retroshare-qml-app/src/android/res/values/libs.xml
Normal file
25
retroshare-qml-app/src/android/res/values/libs.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<array name="qt_sources">
|
||||
<item>https://download.qt.io/ministro/android/qt5/qt-5.7</item>
|
||||
</array>
|
||||
|
||||
<!-- The following is handled automatically by the deployment tool. It should
|
||||
not be edited manually. -->
|
||||
|
||||
<array name="bundled_libs">
|
||||
<!-- %%INSERT_EXTRA_LIBS%% -->
|
||||
</array>
|
||||
|
||||
<array name="qt_libs">
|
||||
<!-- %%INSERT_QT_LIBS%% -->
|
||||
</array>
|
||||
|
||||
<array name="bundled_in_lib">
|
||||
<!-- %%INSERT_BUNDLED_IN_LIB%% -->
|
||||
</array>
|
||||
<array name="bundled_in_assets">
|
||||
<!-- %%INSERT_BUNDLED_IN_ASSETS%% -->
|
||||
</array>
|
||||
|
||||
</resources>
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* RetroShare Android Service
|
||||
* Copyright (C) 2016 Gioacchino Mazzurco <gio@eigenlab.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.retroshare.android.qml_app;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
public class BootCompletedReceiver extends BroadcastReceiver
|
||||
{
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent)
|
||||
{
|
||||
Intent myIntent = new Intent(context, RetroShareAndroidService.class);
|
||||
context.startService(myIntent);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* RetroShare Android Service
|
||||
* Copyright (C) 2016 Gioacchino Mazzurco <gio@eigenlab.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.retroshare.android.qml_app;
|
||||
|
||||
import org.qtproject.qt5.android.bindings.QtService;
|
||||
|
||||
public class RetroShareAndroidService extends QtService {}
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* RetroShare Android QML App
|
||||
* Copyright (C) 2016 Gioacchino Mazzurco <gio@eigenlab.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.retroshare.android.qml_app;
|
||||
|
||||
import org.qtproject.qt5.android.bindings.QtActivity;
|
||||
|
||||
public class RetroShareQmlActivity extends QtActivity {}
|
13
retroshare-qml-app/src/deployment.pri
Normal file
13
retroshare-qml-app/src/deployment.pri
Normal file
@ -0,0 +1,13 @@
|
||||
unix:!android {
|
||||
isEmpty(target.path) {
|
||||
qnx {
|
||||
target.path = /tmp/$${TARGET}/bin
|
||||
} else {
|
||||
target.path = /opt/$${TARGET}/bin
|
||||
}
|
||||
export(target.path)
|
||||
}
|
||||
INSTALLS += target
|
||||
}
|
||||
|
||||
export(INSTALLS)
|
47
retroshare-qml-app/src/main.cpp
Normal file
47
retroshare-qml-app/src/main.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* RetroShare Android QML App
|
||||
* Copyright (C) 2016 Gioacchino Mazzurco <gio@eigenlab.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QDebug>
|
||||
|
||||
#include <QtAndroidExtras>
|
||||
#include <QFileInfo>
|
||||
#include <QDateTime>
|
||||
|
||||
#include "retroshare/rsinit.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
|
||||
|
||||
QString sockPath = QString::fromStdString(RsAccounts::ConfigDirectory());
|
||||
sockPath.append("/libresapi.sock");
|
||||
|
||||
QFileInfo fileInfo(sockPath);
|
||||
|
||||
qDebug() << "Is service.cpp running as a service?" << QtAndroid::androidService().isValid();
|
||||
qDebug() << "Is service.cpp running as an activity?" << QtAndroid::androidActivity().isValid();
|
||||
qDebug() << "QML APP:" << sockPath << fileInfo.exists() << fileInfo.lastModified().toString();
|
||||
|
||||
return app.exec();
|
||||
}
|
37
retroshare-qml-app/src/main.qml
Normal file
37
retroshare-qml-app/src/main.qml
Normal file
@ -0,0 +1,37 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.0
|
||||
|
||||
ApplicationWindow {
|
||||
visible: true
|
||||
width: 640
|
||||
height: 480
|
||||
title: qsTr("Hello World")
|
||||
|
||||
SwipeView {
|
||||
id: swipeView
|
||||
anchors.fill: parent
|
||||
currentIndex: tabBar.currentIndex
|
||||
|
||||
Page1 {
|
||||
}
|
||||
|
||||
Page {
|
||||
Label {
|
||||
text: qsTr("Second page")
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
footer: TabBar {
|
||||
id: tabBar
|
||||
currentIndex: swipeView.currentIndex
|
||||
TabButton {
|
||||
text: qsTr("First")
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Second")
|
||||
}
|
||||
}
|
||||
}
|
7
retroshare-qml-app/src/qml.qrc
Normal file
7
retroshare-qml-app/src/qml.qrc
Normal file
@ -0,0 +1,7 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>main.qml</file>
|
||||
<file>Page1.qml</file>
|
||||
<file>Page1Form.ui.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
31
retroshare-qml-app/src/retroshare-qml-app.pro
Normal file
31
retroshare-qml-app/src/retroshare-qml-app.pro
Normal file
@ -0,0 +1,31 @@
|
||||
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
||||
|
||||
QT += qml quick androidextras
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
SOURCES += main.cpp
|
||||
|
||||
RESOURCES += qml.qrc
|
||||
|
||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||
QML_IMPORT_PATH =
|
||||
|
||||
# Default rules for deployment.
|
||||
include(deployment.pri)
|
||||
|
||||
DISTFILES += \
|
||||
android/AndroidManifest.xml \
|
||||
android/gradle/wrapper/gradle-wrapper.jar \
|
||||
android/gradlew \
|
||||
android/res/values/libs.xml \
|
||||
android/build.gradle \
|
||||
android/gradle/wrapper/gradle-wrapper.properties \
|
||||
android/gradlew.bat
|
||||
|
||||
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
|
||||
|
||||
DEPENDPATH *= ../../libretroshare/src
|
||||
INCLUDEPATH *= ../../libretroshare/src
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS *= ../../libretroshare/src/lib/libretroshare.a
|
@ -55,16 +55,15 @@ android-g++ {
|
||||
DEFINES *= "fopen64=fopen"
|
||||
DEFINES *= "fseeko64=fseeko"
|
||||
DEFINES *= "ftello64=ftello"
|
||||
INCLUDEPATH *= $$NDK_TOOLCHAIN_PATH/sysroot/usr/include/
|
||||
INCLUDEPATH += $$NDK_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
LIBS *= -L$$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/
|
||||
LIBS *= -lssl -lcrypto -lsqlite3 -lupnp -lixml -lthreadutil
|
||||
ANDROID_EXTRA_LIBS *= $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libcrypto.so
|
||||
ANDROID_EXTRA_LIBS *= $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libssl.so
|
||||
ANDROID_EXTRA_LIBS *= $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libbz2.so
|
||||
LIBS *= -lbz2 -lupnp -lixml -lthreadutil -lsqlite3
|
||||
ANDROID_EXTRA_LIBS *= $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libsqlite3.so
|
||||
# message(NDK_TOOLCHAIN_PATH: $$NDK_TOOLCHAIN_PATH)
|
||||
# message(LIBS: $$LIBS)
|
||||
# message(ANDROID_EXTRA_LIBS: $$ANDROID_EXTRA_LIBS)
|
||||
# message(ANDROID_PLATFORM: $$ANDROID_PLATFORM)
|
||||
# message(ANDROID_PLATFORM_ROOT_PATH: $$ANDROID_PLATFORM_ROOT_PATH)
|
||||
# message(NDK_TOOLCHAIN_PATH: $$NDK_TOOLCHAIN_PATH)
|
||||
}
|
||||
|
||||
win32 {
|
||||
|
Loading…
Reference in New Issue
Block a user