diff --git a/gui/kivy/main_window.py b/gui/kivy/main_window.py index 32914b099..f8ba67cc1 100644 --- a/gui/kivy/main_window.py +++ b/gui/kivy/main_window.py @@ -358,7 +358,7 @@ class ElectrumWindow(App): sendIntent.setAction(Intent.ACTION_SEND) sendIntent.setType("text/plain") sendIntent.putExtra(Intent.EXTRA_TEXT, JS(data)) - PythonActivity = autoclass('org.renpy.android.PythonActivity') + PythonActivity = autoclass('org.kivy.android.PythonActivity') currentActivity = cast('android.app.Activity', PythonActivity.mActivity) it = Intent.createChooser(sendIntent, cast('java.lang.CharSequence', JS(title))) currentActivity.startActivity(it) diff --git a/lib/bitcoin.py b/lib/bitcoin.py index a3dd20953..d4010b664 100644 --- a/lib/bitcoin.py +++ b/lib/bitcoin.py @@ -26,6 +26,7 @@ import hashlib import base64 +import os import re import hmac @@ -208,9 +209,11 @@ def i2o_ECPublicKey(pubkey, compressed=False): ############ functions from pywallet ##################### def hash_160(public_key): - #md = hashlib.new('ripemd') - from Crypto.Hash import RIPEMD - md = RIPEMD.new() + if 'ANDROID_DATA' in os.environ: + from Crypto.Hash import RIPEMD + md = RIPEMD.new() + else: + md = hashlib.new('ripemd') md.update(sha256(public_key)) return md.digest()