Skip to content

Commit baa0293

Browse files
committed
android build: persist debug keystore
so that we can upgrade debug installations on the phone and keep the datadir
1 parent 0fafd8c commit baa0293

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ contrib/build-wine/tmp/
3030
contrib/build-wine/fresh_clone/
3131
contrib/build-linux/appimage/build/
3232
contrib/build-linux/appimage/.cache/
33+
contrib/android_debug.keystore

contrib/make_apk

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ if [[ -n "$1" && "$1" == "release" ]] ; then
3030
export P4A_RELEASE_KEYALIAS=electrum
3131
make release
3232
else
33+
export P4A_DEBUG_KEYSTORE="$CONTRIB"/android_debug.keystore
34+
export P4A_DEBUG_KEYSTORE_PASSWD=unsafepassword
35+
export P4A_DEBUG_KEYALIAS_PASSWD=unsafepassword
36+
export P4A_DEBUG_KEYALIAS=electrum
37+
if [ ! -f "$P4A_DEBUG_KEYSTORE" ]; then
38+
keytool -genkey -v -keystore "$CONTRIB"/android_debug.keystore \
39+
-alias "$P4A_DEBUG_KEYALIAS" -keyalg RSA -keysize 2048 -validity 10000 \
40+
-dname "CN=mqttserver.ibm.com, OU=ID, O=IBM, L=Hursley, S=Hants, C=GB" \
41+
-storepass "$P4A_DEBUG_KEYSTORE_PASSWD" \
42+
-keypass "$P4A_DEBUG_KEYALIAS_PASSWD"
43+
fi
3344
make apk
3445
fi
3546

electrum/gui/kivy/Readme.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,34 @@ $ sudo docker run -it --rm \
8181
```
8282
8383
84-
### How do I get more verbose logs?
84+
### How do I get more verbose logs for the build?
8585
See `log_level` in `buildozer.spec`
8686
8787
88+
### How can I see logs at runtime?
89+
This should work OK for most scenarios:
90+
```
91+
adb logcat | grep python
92+
```
93+
Better `grep` but fragile because of `cut`:
94+
```
95+
adb logcat | grep -F "`adb shell ps | grep org.electrum.electrum | cut -c14-19`"
96+
```
97+
98+
8899
### Kivy can be run directly on Linux Desktop. How?
89100
Install Kivy.
90101
91102
Build atlas: `(cd electrum/gui/kivy/; make theming)`
92103
93104
Run electrum with the `-g` switch: `electrum -g kivy`
105+
106+
### debug vs release build
107+
If you just follow the instructions above, you will build the apk
108+
in debug mode. The most notable difference is that the apk will be
109+
signed using a debug keystore. If you are planning to upload
110+
what you build to e.g. the Play Store, you should create your own
111+
keystore, back it up safely, and run `./contrib/make_apk release`.
112+
113+
See e.g. [kivy wiki](https://github.com/kivy/kivy/wiki/Creating-a-Release-APK)
114+
and [android dev docs](https://developer.android.com/studio/build/building-cmdline#sign_cmdline).

electrum/gui/kivy/tools/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ RUN cd /opt \
152152
&& git cherry-pick d7f722e4e5d4b3e6f5b1733c95e6a433f78ee570 \
153153
# fix gradle "versionCode" overflow:
154154
&& git cherry-pick ed20e196fbcdce718a180f88f23bb2d165c4c5d8 \
155+
# gradle: persist debug keystore:
156+
&& git cherry-pick aaa0d5d0e7a334631df71e0a9bf127817e0ab9ab \
155157
&& python3 -m pip install --user -e .
156158

157159
# build env vars

0 commit comments

Comments
 (0)