changes for new toolchain

This commit is contained in:
akshayaurora 2016-06-01 01:56:34 +05:30 committed by ThomasV
parent f061fe047d
commit 07c5f02639
6 changed files with 13 additions and 10 deletions

View File

@ -1,4 +1,5 @@
PYTHON = python PYTHON = python
# needs kivy installed or in PYTHONPATH # needs kivy installed or in PYTHONPATH
.PHONY: theming apk clean .PHONY: theming apk clean
@ -17,11 +18,11 @@ prepare:
fi fi
apk: apk:
@make prepare @make prepare
@-cd ../..; buildozer android debug deploy run @-cd ../..; buildozer android_new debug deploy run
@make clean @make clean
release: release:
@make prepare @make prepare
@-cd ../..; buildozer android release @-cd ../..; buildozer android_new release
@make clean @make clean
clean: clean:
# Cleaning up # Cleaning up

View File

@ -310,7 +310,7 @@ class ElectrumWindow(App):
return return
from jnius import autoclass from jnius import autoclass
from android import activity from android import activity
PythonActivity = autoclass('org.renpy.android.PythonActivity') PythonActivity = autoclass('org.kivy.android.PythonActivity')
Intent = autoclass('android.content.Intent') Intent = autoclass('android.content.Intent')
intent = Intent("com.google.zxing.client.android.SCAN") intent = Intent("com.google.zxing.client.android.SCAN")
intent.putExtra("SCAN_MODE", "QR_CODE_MODE") intent.putExtra("SCAN_MODE", "QR_CODE_MODE")
@ -334,7 +334,7 @@ class ElectrumWindow(App):
return return
from jnius import autoclass from jnius import autoclass
from android import activity from android import activity
PythonActivity = autoclass('org.renpy.android.PythonActivity') PythonActivity = autoclass('org.kivy.android.PythonActivity')
IntentIntegrator = autoclass('com.google.zxing.integration.android.IntentIntegrator') IntentIntegrator = autoclass('com.google.zxing.integration.android.IntentIntegrator')
integrator = IntentIntegrator(PythonActivity.mActivity) integrator = IntentIntegrator(PythonActivity.mActivity)
def on_qr_result(requestCode, resultCode, intent): def on_qr_result(requestCode, resultCode, intent):
@ -370,7 +370,7 @@ class ElectrumWindow(App):
if platform == 'android': if platform == 'android':
# move activity to back # move activity to back
from jnius import autoclass from jnius import autoclass
python_act = autoclass('org.renpy.android.PythonActivity') python_act = autoclass('org.kivy.android.PythonActivity')
mActivity = python_act.mActivity mActivity = python_act.mActivity
mActivity.moveTaskToBack(True) mActivity.moveTaskToBack(True)
@ -394,7 +394,7 @@ class ElectrumWindow(App):
if platform == 'android': if platform == 'android':
from android import activity from android import activity
from jnius import autoclass from jnius import autoclass
PythonActivity = autoclass('org.renpy.android.PythonActivity') PythonActivity = autoclass('org.kivy.android.PythonActivity')
mactivity = PythonActivity.mActivity mactivity = PythonActivity.mActivity
self.on_new_intent(mactivity.getIntent()) self.on_new_intent(mactivity.getIntent())
activity.bind(on_new_intent=self.on_new_intent) activity.bind(on_new_intent=self.on_new_intent)

View File

@ -17,7 +17,7 @@ from android import activity
BUILDVERSION = autoclass('android.os.Build$VERSION').SDK_INT BUILDVERSION = autoclass('android.os.Build$VERSION').SDK_INT
NfcAdapter = autoclass('android.nfc.NfcAdapter') NfcAdapter = autoclass('android.nfc.NfcAdapter')
PythonActivity = autoclass('org.renpy.android.PythonActivity') PythonActivity = autoclass('org.kivy.android.PythonActivity')
JString = autoclass('java.lang.String') JString = autoclass('java.lang.String')
Charset = autoclass('java.nio.charset.Charset') Charset = autoclass('java.nio.charset.Charset')
locale = autoclass('java.util.Locale') locale = autoclass('java.util.Locale')

View File

@ -31,7 +31,7 @@ version.filename = %(source.dir)s/lib/version.py
#version = 1.9.8 #version = 1.9.8
# (list) Application requirements # (list) Application requirements
requirements = openssl, pil, plyer==master, kivy==master requirements = hostpython2, android, openssl, pycrypto, pil, plyer, kivy==master
# (str) Presplash of the application # (str) Presplash of the application
#presplash.filename = %(source.dir)s/gui/kivy/theming/splash.png #presplash.filename = %(source.dir)s/gui/kivy/theming/splash.png

View File

@ -208,7 +208,9 @@ def i2o_ECPublicKey(pubkey, compressed=False):
############ functions from pywallet ##################### ############ functions from pywallet #####################
def hash_160(public_key): def hash_160(public_key):
md = hashlib.new('ripemd160') #md = hashlib.new('ripemd')
from Crypto.Hash import RIPEMD
md = RIPEMD.new()
md.update(sha256(public_key)) md.update(sha256(public_key))
return md.digest() return md.digest()

View File

@ -210,7 +210,7 @@ def android_ext_dir():
def android_data_dir(): def android_data_dir():
import jnius import jnius
PythonActivity = jnius.autoclass('org.renpy.android.PythonActivity') PythonActivity = jnius.autoclass('org.kivy.android.PythonActivity')
return PythonActivity.mActivity.getFilesDir().getPath() + '/data' return PythonActivity.mActivity.getFilesDir().getPath() + '/data'
def android_headers_path(): def android_headers_path():