Browse Source

android build: persist debug keystore

so that we can upgrade debug installations on the phone and keep the datadir
dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
SomberNight 6 years ago
parent
commit
baa0293620
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 1
      .gitignore
  2. 11
      contrib/make_apk
  3. 23
      electrum/gui/kivy/Readme.md
  4. 2
      electrum/gui/kivy/tools/Dockerfile

1
.gitignore

@ -30,3 +30,4 @@ contrib/build-wine/tmp/
contrib/build-wine/fresh_clone/ contrib/build-wine/fresh_clone/
contrib/build-linux/appimage/build/ contrib/build-linux/appimage/build/
contrib/build-linux/appimage/.cache/ contrib/build-linux/appimage/.cache/
contrib/android_debug.keystore

11
contrib/make_apk

@ -30,6 +30,17 @@ if [[ -n "$1" && "$1" == "release" ]] ; then
export P4A_RELEASE_KEYALIAS=electrum export P4A_RELEASE_KEYALIAS=electrum
make release make release
else 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 make apk
fi fi

23
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` 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? ### Kivy can be run directly on Linux Desktop. How?
Install Kivy. Install Kivy.
Build atlas: `(cd electrum/gui/kivy/; make theming)` Build atlas: `(cd electrum/gui/kivy/; make theming)`
Run electrum with the `-g` switch: `electrum -g kivy` 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).

2
electrum/gui/kivy/tools/Dockerfile

@ -152,6 +152,8 @@ RUN cd /opt \
&& git cherry-pick d7f722e4e5d4b3e6f5b1733c95e6a433f78ee570 \ && git cherry-pick d7f722e4e5d4b3e6f5b1733c95e6a433f78ee570 \
# fix gradle "versionCode" overflow: # fix gradle "versionCode" overflow:
&& git cherry-pick ed20e196fbcdce718a180f88f23bb2d165c4c5d8 \ && git cherry-pick ed20e196fbcdce718a180f88f23bb2d165c4c5d8 \
# gradle: persist debug keystore:
&& git cherry-pick aaa0d5d0e7a334631df71e0a9bf127817e0ab9ab \
&& python3 -m pip install --user -e . && python3 -m pip install --user -e .
# build env vars # build env vars

Loading…
Cancel
Save