Browse Source

Merge pull request #6227 from spesmilo/mv_android

move android stuff to contrib/android
bip39-recovery
ThomasV 5 years ago
committed by GitHub
parent
commit
16b14d6f06
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .travis.yml
  2. 0
      contrib/android/Dockerfile
  3. 33
      contrib/android/Makefile
  4. 4
      contrib/android/Readme.md
  5. 0
      contrib/android/bitcoin_intent.xml
  6. 0
      contrib/android/blacklist.txt
  7. 3
      contrib/android/buildozer.spec
  8. 10
      contrib/android/make_apk
  9. 33
      electrum/gui/kivy/Makefile

4
.travis.yml

@ -65,12 +65,12 @@ jobs:
install:
- pip install requests && ./contrib/pull_locale
- ./contrib/make_packages
- sudo docker build --no-cache -t electrum-android-builder-img electrum/gui/kivy/tools
- sudo docker build --no-cache -t electrum-android-builder-img contrib/android
script:
- sudo chown -R 1000:1000 .
# Output something every minute or Travis kills the job
- while sleep 60; do echo "=====[ $SECONDS seconds still running ]====="; done &
- sudo docker run -it -u 1000:1000 --rm --name electrum-android-builder-cont --env CI=true -v $PWD:/home/user/wspace/electrum --workdir /home/user/wspace/electrum electrum-android-builder-img ./contrib/make_apk
- sudo docker run -it -u 1000:1000 --rm --name electrum-android-builder-cont --env CI=true -v $PWD:/home/user/wspace/electrum --workdir /home/user/wspace/electrum electrum-android-builder-img ./contrib/android/make_apk
# kill background sleep loop
- kill %1
- ls -la bin

0
electrum/gui/kivy/tools/Dockerfile → contrib/android/Dockerfile

33
contrib/android/Makefile

@ -0,0 +1,33 @@
PYTHON = python3
# needs kivy installed or in PYTHONPATH
.PHONY: theming apk clean
theming:
#bash -c 'for i in network lightning; do convert -background none theming/light/$i.{svg,png}; done'
$(PYTHON) -m kivy.atlas ../../electrum/gui/kivy/theming/light 1024 ../../electrum/gui/kivy/theming/light/*.png
prepare:
# running pre build setup
@cp buildozer.spec ../../buildozer.spec
# copy electrum to main.py
@cp ../../run_electrum ../../main.py
@-if [ ! -d "../../.buildozer" ];then \
cd ../..; buildozer android debug;\
cp -f blacklist.txt .buildozer/android/platform/python-for-android/src/blacklist.txt;\
rm -rf ./.buildozer/android/platform/python-for-android/dist;\
fi
apk:
@make prepare
@-cd ../..; buildozer android debug deploy run
@make clean
release:
@make prepare
@-cd ../..; buildozer android release
@make clean
clean:
# Cleaning up
# rename main.py to electrum
@-rm ../../main.py
# remove buildozer.spec
@-rm ../../buildozer.spec

4
electrum/gui/kivy/Readme.md → contrib/android/Readme.md

@ -24,7 +24,7 @@ folder.
2. Build image
```
$ sudo docker build -t electrum-android-builder-img electrum/gui/kivy/tools
$ sudo docker build -t electrum-android-builder-img contrib/android
```
3. Build locale files
@ -50,7 +50,7 @@ folder.
-v ~/.keystore:/home/user/.keystore \
--workdir /home/user/wspace/electrum \
electrum-android-builder-img \
./contrib/make_apk
./contrib/android/make_apk
```
This mounts the project dir inside the container,
and so the modifications will affect it, e.g. `.buildozer` folder

0
electrum/gui/kivy/tools/bitcoin_intent.xml → contrib/android/bitcoin_intent.xml

0
electrum/gui/kivy/tools/blacklist.txt → contrib/android/blacklist.txt

3
electrum/gui/kivy/tools/buildozer.spec → contrib/android/buildozer.spec

@ -22,7 +22,6 @@ source.exclude_exts = spec
source.exclude_dirs = bin, build, dist, contrib,
electrum/tests,
electrum/gui/qt,
electrum/gui/kivy/tools,
electrum/gui/kivy/theming/light
# (list) List of exclusions using pattern matching
source.exclude_patterns = Makefile,setup*
@ -123,7 +122,7 @@ android.add_activities = org.electrum.qr.SimpleScannerActivity
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png
# (str) XML file to include as an intent filters in <activity> tag
android.manifest.intent_filters = electrum/gui/kivy/tools/bitcoin_intent.xml
android.manifest.intent_filters = contrib/android/bitcoin_intent.xml
# (str) launchMode to set for the main activity
android.manifest.launch_mode = singleTask

10
contrib/make_apk → contrib/android/make_apk

@ -2,8 +2,8 @@
set -e
CONTRIB="$(dirname "$(readlink -e "$0")")"
ROOT_FOLDER="$CONTRIB"/..
CONTRIB_ANDROID="$(dirname "$(readlink -e "$0")")"
ROOT_FOLDER="$CONTRIB_ANDROID"/../..
PACKAGES="$ROOT_FOLDER"/packages/
LOCALE="$ROOT_FOLDER"/electrum/locale/
@ -17,7 +17,7 @@ if [ ! -d "$PACKAGES" ]; then
exit 1
fi
pushd ./electrum/gui/kivy/
pushd ./contrib/android
make theming
@ -34,13 +34,13 @@ if [[ -n "$1" && "$1" == "release" ]] ; then
export APP_ANDROID_ARCH=arm64-v8a
make release
else
export P4A_DEBUG_KEYSTORE="$CONTRIB"/android_debug.keystore
export P4A_DEBUG_KEYSTORE="$CONTRIB_ANDROID"/android_debug.keystore
export P4A_DEBUG_KEYSTORE_PASSWD=unsafepassword
export P4A_DEBUG_KEYALIAS_PASSWD=unsafepassword
export P4A_DEBUG_KEYALIAS=electrum
# create keystore if needed
if [ ! -f "$P4A_DEBUG_KEYSTORE" ]; then
keytool -genkey -v -keystore "$CONTRIB"/android_debug.keystore \
keytool -genkey -v -keystore "$CONTRIB_ANDROID"/android_debug.keystore \
-alias "$P4A_DEBUG_KEYALIAS" -keyalg RSA -keysize 2048 -validity 10000 \
-dname "CN=mqttserver.ibm.com, OU=ID, O=IBM, L=Hursley, S=Hants, C=GB" \
-storepass "$P4A_DEBUG_KEYSTORE_PASSWD" \

33
electrum/gui/kivy/Makefile

@ -1,33 +0,0 @@
PYTHON = python3
# needs kivy installed or in PYTHONPATH
.PHONY: theming apk clean
theming:
#bash -c 'for i in network lightning; do convert -background none theming/light/$i.{svg,png}; done'
$(PYTHON) -m kivy.atlas theming/light 1024 theming/light/*.png
prepare:
# running pre build setup
@cp tools/buildozer.spec ../../../buildozer.spec
# copy electrum to main.py
@cp ../../../run_electrum ../../../main.py
@-if [ ! -d "../../../.buildozer" ];then \
cd ../../..; buildozer android debug;\
cp -f electrum/gui/kivy/tools/blacklist.txt .buildozer/android/platform/python-for-android/src/blacklist.txt;\
rm -rf ./.buildozer/android/platform/python-for-android/dist;\
fi
apk:
@make prepare
@-cd ../../..; buildozer android debug deploy run
@make clean
release:
@make prepare
@-cd ../../..; buildozer android release
@make clean
clean:
# Cleaning up
# rename main.py to electrum
@-rm ../../../main.py
# remove buildozer.spec
@-rm ../../../buildozer.spec
Loading…
Cancel
Save