Skip to content

Commit 9409cf7

Browse files
committed
Added option to support custom shared libraries with <uses-library> tag
1 parent 50afdf1 commit 9409cf7

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,8 @@ def parse_args(args=None):
594594
help='The permissions to give this app.', nargs='+')
595595
ap.add_argument('--meta-data', dest='meta_data', action='append',
596596
help='Custom key=value to add in application metadata')
597+
ap.add_argument('--uses-library', dest='android_used_libs', action='append',
598+
help='Used shared libraries included using <uses-library> tag in AndroidManifest.xml')
597599
ap.add_argument('--icon', dest='icon',
598600
help=('A png file to use as the icon for '
599601
'the application.'))
@@ -749,6 +751,9 @@ def _read_configuration():
749751
if args.meta_data is None:
750752
args.meta_data = []
751753

754+
if args.android_used_libs is None:
755+
args.android_used_libs = []
756+
752757
if args.services is None:
753758
args.services = []
754759

pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
android:allowBackup="{{ args.allow_backup }}"
5757
android:theme="@android:style/Theme.NoTitleBar{% if not args.window %}.Fullscreen{% endif %}"
5858
android:hardwareAccelerated="true" >
59+
{% for l in args.android_used_libs %}
60+
<uses-library android:name="{{ l }}" />
61+
{% endfor %}
5962

6063
{% for m in args.meta_data %}
6164
<meta-data android:name="{{ m.split('=', 1)[0] }}" android:value="{{ m.split('=', 1)[-1] }}"/>{% endfor %}

pythonforandroid/bootstraps/service_only/build/templates/AndroidManifest.tmpl.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@
4949
android:allowBackup="true"
5050
android:theme="@android:style/Theme.NoTitleBar{% if not args.window %}.Fullscreen{% endif %}"
5151
android:hardwareAccelerated="true" >
52-
52+
{% for l in args.android_used_libs %}
53+
<uses-library android:name="{{ l }}" />
54+
{% endfor %}
5355
{% for m in args.meta_data %}
5456
<meta-data android:name="{{ m.split('=', 1)[0] }}" android:value="{{ m.split('=', 1)[-1] }}"/>{% endfor %}
5557
<meta-data android:name="wakelock" android:value="{% if args.wakelock %}1{% else %}0{% endif %}"/>

pythonforandroid/bootstraps/webview/build/templates/AndroidManifest.tmpl.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
android:allowBackup="true"
5151
android:theme="@android:style/Theme.NoTitleBar{% if not args.window %}.Fullscreen{% endif %}"
5252
android:hardwareAccelerated="true" >
53-
53+
{% for l in args.android_used_libs %}
54+
<uses-library android:name="{{ l }}" />
55+
{% endfor %}
5456
{% for m in args.meta_data %}
5557
<meta-data android:name="{{ m.split('=', 1)[0] }}" android:value="{{ m.split('=', 1)[-1] }}"/>{% endfor %}
5658
<meta-data android:name="wakelock" android:value="{% if args.wakelock %}1{% else %}0{% endif %}"/>

0 commit comments

Comments
 (0)