Skip to content

Commit

Permalink
Ugly fix for pyjnius: manually replacing 'org.renpy.android.PythonAct…
Browse files Browse the repository at this point in the history
…ivity' with 'org.kivy.android.PythonActivity ' in autoclass solves problem.
  • Loading branch information
germn committed Dec 17, 2016
1 parent 31a3d59 commit 716489c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pythonforandroid/recipes/pyjnius/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class PyjniusRecipe(CythonRecipe):
site_packages_name = 'jnius'

patches = [('sdl2_jnienv_getter.patch', will_build('sdl2')),
('genericndkbuild_jnienv_getter.patch', will_build('genericndkbuild'))]
('genericndkbuild_jnienv_getter.patch', will_build('genericndkbuild')),
'ugly_pyjnius_fix.patch']

def postbuild_arch(self, arch):
super(PyjniusRecipe, self).postbuild_arch(arch)
Expand Down
11 changes: 11 additions & 0 deletions pythonforandroid/recipes/pyjnius/ugly_pyjnius_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- ./jnius/reflect.py 2016-10-27 09:12:14.000000000 +0300
+++ ./jnius/reflect.py_fix 2016-12-17 03:05:07.574013000 +0300
@@ -143,6 +143,8 @@
return (s.startswith('get') and len(s) > 3 and s[3].isupper()) or (s.startswith('is') and len(s) > 2 and s[2].isupper())

def autoclass(clsname):
+ if clsname == 'org.renpy.android.PythonActivity':
+ clsname = 'org.kivy.android.PythonActivity'
jniname = clsname.replace('.', '/')
cls = MetaJavaClass.get_javaclass(jniname)
if cls:

1 comment on commit 716489c

@jjccvt
Copy link

@jjccvt jjccvt commented on 716489c Jul 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do i aPply this patch? Do i need o edit the main recipes?

Please sign in to comment.