Skip to content

Commit db77497

Browse files
committed
webview: Allow passing activity meta-data
to the Android manifest XML. https://phabricator.endlessm.com/T33607
1 parent b672ec4 commit db77497

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pythonforandroid/bootstraps/common/build/build.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,8 @@ def parse_args_and_make_package(args=None):
682682
help='The permissions to give this app.', nargs='+')
683683
ap.add_argument('--meta-data', dest='meta_data', action='append', default=[],
684684
help='Custom key=value to add in application metadata')
685+
ap.add_argument('--activity-meta-data', dest='activity_meta_data', action='append', default=[],
686+
help='Custom key=value to add in activity metadata')
685687
ap.add_argument('--uses-library', dest='android_used_libs', action='append', default=[],
686688
help='Used shared libraries included using <uses-library> tag in AndroidManifest.xml')
687689
ap.add_argument('--asset', dest='assets',

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
{%- if args.intent_filters -%}
7979
{{- args.intent_filters -}}
8080
{%- endif -%}
81+
{% for m in args.activity_meta_data %}
82+
<meta-data android:name="{{ m.split('=', 1)[0] }}" android:value="{{ m.split('=', 1)[-1] }}"/>{% endfor %}
8183
</activity>
8284

8385
{% if service %}

0 commit comments

Comments
 (0)