electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit baa02936207e5fdfbad446bf635d5d032f7cb398
parent 0fafd8c0a776336d59db1f1effbdbf143e036fc5
Author: SomberNight <somber.night@protonmail.com>
Date:   Thu, 27 Jun 2019 07:08:03 +0200

android build: persist debug keystore

so that we can upgrade debug installations on the phone and keep the datadir

Diffstat:
M.gitignore | 1+
Mcontrib/make_apk | 11+++++++++++
Melectrum/gui/kivy/Readme.md | 23++++++++++++++++++++++-
Melectrum/gui/kivy/tools/Dockerfile | 2++
4 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore @@ -30,3 +30,4 @@ contrib/build-wine/tmp/ contrib/build-wine/fresh_clone/ contrib/build-linux/appimage/build/ contrib/build-linux/appimage/.cache/ +contrib/android_debug.keystore diff --git a/contrib/make_apk b/contrib/make_apk @@ -30,6 +30,17 @@ if [[ -n "$1" && "$1" == "release" ]] ; then export P4A_RELEASE_KEYALIAS=electrum make release else + export P4A_DEBUG_KEYSTORE="$CONTRIB"/android_debug.keystore + export P4A_DEBUG_KEYSTORE_PASSWD=unsafepassword + export P4A_DEBUG_KEYALIAS_PASSWD=unsafepassword + export P4A_DEBUG_KEYALIAS=electrum + if [ ! -f "$P4A_DEBUG_KEYSTORE" ]; then + keytool -genkey -v -keystore "$CONTRIB"/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" \ + -keypass "$P4A_DEBUG_KEYALIAS_PASSWD" + fi make apk fi diff --git a/electrum/gui/kivy/Readme.md b/electrum/gui/kivy/Readme.md @@ -81,13 +81,34 @@ $ sudo docker run -it --rm \ ``` -### How do I get more verbose logs? +### How do I get more verbose logs for the build? See `log_level` in `buildozer.spec` +### How can I see logs at runtime? +This should work OK for most scenarios: +``` +adb logcat | grep python +``` +Better `grep` but fragile because of `cut`: +``` +adb logcat | grep -F "`adb shell ps | grep org.electrum.electrum | cut -c14-19`" +``` + + ### Kivy can be run directly on Linux Desktop. How? Install Kivy. Build atlas: `(cd electrum/gui/kivy/; make theming)` Run electrum with the `-g` switch: `electrum -g kivy` + +### debug vs release build +If you just follow the instructions above, you will build the apk +in debug mode. The most notable difference is that the apk will be +signed using a debug keystore. If you are planning to upload +what you build to e.g. the Play Store, you should create your own +keystore, back it up safely, and run `./contrib/make_apk release`. + +See e.g. [kivy wiki](https://github.com/kivy/kivy/wiki/Creating-a-Release-APK) +and [android dev docs](https://developer.android.com/studio/build/building-cmdline#sign_cmdline). diff --git a/electrum/gui/kivy/tools/Dockerfile b/electrum/gui/kivy/tools/Dockerfile @@ -152,6 +152,8 @@ RUN cd /opt \ && git cherry-pick d7f722e4e5d4b3e6f5b1733c95e6a433f78ee570 \ # fix gradle "versionCode" overflow: && git cherry-pick ed20e196fbcdce718a180f88f23bb2d165c4c5d8 \ + # gradle: persist debug keystore: + && git cherry-pick aaa0d5d0e7a334631df71e0a9bf127817e0ab9ab \ && python3 -m pip install --user -e . # build env vars