From 80d53a2a4f2a272c8ec0ee37ec618b0dba7427ec Mon Sep 17 00:00:00 2001 From: Mirko Galimberti Date: Wed, 19 Aug 2020 18:25:30 +0200 Subject: [PATCH] Add manifestPlaceholders feature --- buildozer/default.spec | 6 ++++++ buildozer/targets/android.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/buildozer/default.spec b/buildozer/default.spec index 988fbe829..4b05bfc6c 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -235,6 +235,12 @@ android.allow_backup = True # (str) XML file for custom backup rules (see official auto backup documentation) # android.backup_rules = +# (str) If you need to insert variables into your AndroidManifest.xml file, +# you can do so with the manifestPlaceholders property. +# This property takes a map of key-value pairs. (via a string) +# Usage example : android.manifest_placeholders = [myCustomUrl:\"org.kivy.customurl\"] +# android.manifest_placeholders = [:] + # # Python for android (p4a) specific # diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index d16098ba9..c06df6f8e 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -897,6 +897,12 @@ def execute_build_package(self, build_cmd): cmd.append('--depend') cmd.append(gradle_dependency) + # support for manifestPlaceholders + manifest_placeholders = self.buildozer.config.getdefault('app', 'android.manifest_placeholders', '[:]') + if manifest_placeholders: + cmd.append('--manifest-placeholders') + cmd.append("{}".format(manifest_placeholders)) + cmd.append('--arch') cmd.append(self._arch)