forked from bitcoin/bitcoin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin#17227: Qt: Add Android packaging support
- Loading branch information
Showing
22 changed files
with
234 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright (c) 2019-2020 The Bitcoin Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
export LC_ALL=C.UTF-8 | ||
|
||
export CONTAINER_NAME=ci_android | ||
export PACKAGES="clang llvm unzip openjdk-8-jdk gradle" | ||
|
||
export ANDROID_API_LEVEL=28 | ||
export ANDROID_BUILD_TOOLS_VERSION=28.0.3 | ||
export ANDROID_NDK_VERSION=21.1.6352462 | ||
export ANDROID_TOOLS_URL=https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip | ||
|
||
export SYSCOIN_CONFIG="--disable-ccache" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- old/qtbase/mkspecs/common/android-base-head.conf | ||
+++ new/qtbase/mkspecs/common/android-base-head.conf | ||
@@ -73,6 +73,6 @@ CROSS_COMPILE = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX- | ||
QMAKE_PCH_OUTPUT_EXT = .gch | ||
|
||
QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} | ||
-QMAKE_CFLAGS_USE_PRECOMPILE = -include ${QMAKE_PCH_OUTPUT_BASE} | ||
+QMAKE_CFLAGS_USE_PRECOMPILE = -include-pch ${QMAKE_PCH_OUTPUT} | ||
QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} | ||
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ANDROID BUILD NOTES | ||
====================== | ||
|
||
This guide describes how to build and package the `syscoin-qt` GUI for Android on Linux and macOS. | ||
|
||
## Preparation | ||
|
||
You will need to get the Android NDK and build dependencies for Android as described in [depends/README.md](../depends/README.md). | ||
|
||
## Building and packaging | ||
|
||
After the depends are built configure with one of the resulting prefixes and run `make && make apk` in `src/qt`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<manifest package="org.syscoincore.qt" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto"> | ||
<uses-sdk android:targetSdkVersion="24"/> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
|
||
<uses-feature android:glEsVersion="0x00020000" android:required="true" /> | ||
|
||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> | ||
|
||
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Syscoin Core"> | ||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" | ||
android:name="org.syscoincore.qt.SyscoinQtActivity" | ||
android:label="Syscoin Core" | ||
android:icon="@drawable/syscoin" | ||
android:screenOrientation="unspecified" | ||
android:launchMode="singleTop"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
|
||
<meta-data android:name="android.app.arguments" android:value="-testnet"/> | ||
<meta-data android:name="android.app.lib_name" android:value="syscoin-qt"/> | ||
<meta-data android:name="android.app.repository" android:value="default"/> | ||
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="1"/> | ||
<meta-data android:name="android.app.use_local_qt_libs" android:value="1"/> | ||
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/> | ||
<meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> | ||
<meta-data android:name="android.app.background_running" android:value="true"/> | ||
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="true"/> | ||
<meta-data android:name="android.app.extract_android_style" android:value="default"/> | ||
</activity> | ||
|
||
</application> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
buildscript { | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:3.1.0' | ||
} | ||
} | ||
|
||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
|
||
apply plugin: 'com.android.application' | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
} | ||
|
||
android { | ||
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 | ||
} | ||
|
||
dexOptions { | ||
javaMaxHeapSize '4g' | ||
} | ||
|
||
defaultConfig { | ||
minSdkVersion 24 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
androidBuildToolsVersion=28.0.3 | ||
androidCompileSdkVersion=28 | ||
qt5AndroidDir=new File(".").absolutePath | ||
org.gradle.jvmargs=-Xmx4608M |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
src/qt/android/src/org/bitcoincore/qt/BitcoinQtActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.syscoincore.qt; | ||
|
||
import android.os.Bundle; | ||
import android.system.ErrnoException; | ||
import android.system.Os; | ||
|
||
import org.qtproject.qt5.android.bindings.QtActivity; | ||
|
||
import java.io.File; | ||
|
||
public class SyscoinQtActivity extends QtActivity | ||
{ | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) | ||
{ | ||
final File syscoinDir = new File(getFilesDir().getAbsolutePath() + "/.syscoin"); | ||
if (!syscoinDir.exists()) { | ||
syscoinDir.mkdir(); | ||
} | ||
|
||
try { | ||
Os.setenv("QT_QPA_PLATFORM", "android", true); | ||
} catch (ErrnoException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
super.onCreate(savedInstanceState); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters