LBRY-Vault/electrum/gui/kivy
SomberNight aa518c0ea5
psbt: allow insecure signing of legacy UTXOs without full previous tx
When "importing" a psbt, we accept witness utxos even for legacy inputs
(warning shown to user in gui).
When "exporting" a psbt, we follow the spec; except when exporting as a QR code,
in which case we include witness utxos for all inputs.
This makes QR codes for psbts with legacy inputs feasible, just like they
were before, with our custom tx serialization format (with the same risk,
of burning coins as miner fees).
2019-11-07 02:40:10 +01:00
..
data android: runtime permission dialog for camera 2018-11-26 17:54:07 +01:00
nfc_scanner fix import error 2018-09-20 01:20:13 +02:00
theming/light kivy: commit png icons (for svg resources) into repo 2019-09-08 17:05:06 +02:00
tools android apk: build two apks. ARMv7 and ARMv8 2019-09-01 15:38:26 +02:00
uix psbt: allow insecure signing of legacy UTXOs without full previous tx 2019-11-07 02:40:10 +01:00
__init__.py config: remove 'open_last_wallet' side-effecting 2019-09-10 17:10:52 +02:00
i18n.py file reorganization with top-level module 2018-07-13 14:01:37 +02:00
main.kv fix #5731 2019-10-29 08:06:53 +01:00
main_window.py integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
Makefile kivy: commit png icons (for svg resources) into repo 2019-09-08 17:05:06 +02:00
Readme.md android build: persist gradle datadir 2019-09-02 17:32:48 +02:00

Kivy GUI

The Kivy GUI is used with Electrum on Android devices. To generate an APK file, follow these instructions.

Android binary with Docker

This script does not produce reproducible output (yet!). Please help us remedy this.

This assumes an Ubuntu (x86_64) host, but it should not be too hard to adapt to another similar system. The docker commands should be executed in the project's root folder.

  1. Install Docker

    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    $ sudo apt-get update
    $ sudo apt-get install -y docker-ce
    
  2. Build image

    $ sudo docker build -t electrum-android-builder-img electrum/gui/kivy/tools
    
  3. Build locale files

    $ ./contrib/pull_locale
    
  4. Prepare pure python dependencies

    $ ./contrib/make_packages
    
  5. Build binaries

    $ mkdir --parents $PWD/.buildozer/.gradle
    $ sudo docker run -it --rm \
        --name electrum-android-builder-cont \
        -v $PWD:/home/user/wspace/electrum \
        -v $PWD/.buildozer/.gradle:/home/user/.gradle \
        -v ~/.keystore:/home/user/.keystore \
        --workdir /home/user/wspace/electrum \
        electrum-android-builder-img \
        ./contrib/make_apk
    

    This mounts the project dir inside the container, and so the modifications will affect it, e.g. .buildozer folder will be created.

  6. The generated binary is in ./bin.

FAQ

I changed something but I don't see any differences on the phone. What did I do wrong?

You probably need to clear the cache: rm -rf .buildozer/android/platform/build/{build,dists}

How do I deploy on connected phone for quick testing?

Assuming adb is installed:

$ adb -d install -r bin/Electrum-*-arm64-v8a-debug.apk
$ adb shell monkey -p org.electrum.electrum 1

How do I get an interactive shell inside docker?

$ sudo docker run -it --rm \
    -v $PWD:/home/user/wspace/electrum \
    -v $PWD/.buildozer/.gradle:/home/user/.gradle \
    --workdir /home/user/wspace/electrum \
    electrum-android-builder-img

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 and android dev docs.