electrum

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

make_apk (1640B)


      1 #!/bin/bash
      2 
      3 set -e
      4 
      5 CONTRIB_ANDROID="$(dirname "$(readlink -e "$0")")"
      6 ROOT_FOLDER="$CONTRIB_ANDROID"/../..
      7 PACKAGES="$ROOT_FOLDER"/packages/
      8 LOCALE="$ROOT_FOLDER"/electrum/locale/
      9 
     10 if [ ! -d "$LOCALE" ]; then
     11   echo "Run pull_locale first!"
     12   exit 1
     13 fi
     14 
     15 if [ ! -d "$PACKAGES" ]; then
     16   echo "Run make_packages first!"
     17   exit 1
     18 fi
     19 
     20 pushd ./contrib/android
     21 
     22 make theming
     23 
     24 if [[ -n "$1"  && "$1" == "release" ]] ; then
     25     echo -n Keystore Password:
     26     read -s password
     27     export P4A_RELEASE_KEYSTORE=~/.keystore
     28     export P4A_RELEASE_KEYSTORE_PASSWD=$password
     29     export P4A_RELEASE_KEYALIAS_PASSWD=$password
     30     export P4A_RELEASE_KEYALIAS=electrum
     31     # build two apks
     32     export APP_ANDROID_ARCH=armeabi-v7a
     33     make release
     34     export APP_ANDROID_ARCH=arm64-v8a
     35     make release
     36 else
     37     export P4A_DEBUG_KEYSTORE="$CONTRIB_ANDROID"/android_debug.keystore
     38     export P4A_DEBUG_KEYSTORE_PASSWD=unsafepassword
     39     export P4A_DEBUG_KEYALIAS_PASSWD=unsafepassword
     40     export P4A_DEBUG_KEYALIAS=electrum
     41     # create keystore if needed
     42     if [ ! -f "$P4A_DEBUG_KEYSTORE" ]; then
     43         keytool -genkey -v -keystore "$CONTRIB_ANDROID"/android_debug.keystore \
     44             -alias "$P4A_DEBUG_KEYALIAS" -keyalg RSA -keysize 2048 -validity 10000 \
     45             -dname "CN=mqttserver.ibm.com, OU=ID, O=IBM, L=Hursley, S=Hants, C=GB" \
     46             -storepass "$P4A_DEBUG_KEYSTORE_PASSWD" \
     47             -keypass "$P4A_DEBUG_KEYALIAS_PASSWD"
     48     fi
     49     # build two apks (only one on Travis CI)
     50     export APP_ANDROID_ARCH=arm64-v8a
     51     make apk
     52     if [ ! $CI ]; then
     53         export APP_ANDROID_ARCH=armeabi-v7a
     54         make apk
     55     fi
     56 fi
     57 
     58 popd