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)