added android.service_class_name option
This commit is contained in:
parent
53bacca6ef
commit
487a5979bf
3 changed files with 48 additions and 2 deletions
|
@ -309,7 +309,11 @@ class Buildozer:
|
|||
if get_stdout:
|
||||
ret_stdout.append(chunk)
|
||||
if show_output:
|
||||
stdout.write(chunk.decode('utf-8', 'replace'))
|
||||
try:
|
||||
stdout.write(chunk.decode('utf-8', 'replace'))
|
||||
except UnicodeEncodeError:
|
||||
# attempt to solve encoding errors when output from external process is not "printable"
|
||||
stdout.write(chunk.decode('utf-8', 'ignore'))
|
||||
if fd_stderr in readx:
|
||||
chunk = process.stderr.read()
|
||||
if not chunk:
|
||||
|
@ -317,7 +321,11 @@ class Buildozer:
|
|||
if get_stderr:
|
||||
ret_stderr.append(chunk)
|
||||
if show_output:
|
||||
stderr.write(chunk.decode('utf-8', 'replace'))
|
||||
try:
|
||||
stderr.write(chunk.decode('utf-8', 'replace'))
|
||||
except UnicodeEncodeError:
|
||||
# attempt to solve encoding errors when output from external process is not "printable"
|
||||
stderr.write(chunk.decode('utf-8', 'ignore'))
|
||||
|
||||
stdout.flush()
|
||||
stderr.flush()
|
||||
|
|
|
@ -138,6 +138,10 @@ fullscreen = 0
|
|||
# use that parameter together with android.entrypoint to set custom Java class instead of PythonActivity
|
||||
#android.activity_class_name = org.kivy.android.PythonActivity
|
||||
|
||||
# (str) Full name including package path of the Java class that implements Python Service
|
||||
# use that parameter to set custom Java class instead of PythonService
|
||||
#android.service_class_name = org.kivy.android.PythonService
|
||||
|
||||
# (str) Android app theme, default is ok for Kivy-based app
|
||||
#android.apptheme = "@android:style/Theme.NoTitleBar"
|
||||
|
||||
|
@ -199,6 +203,16 @@ fullscreen = 0
|
|||
# (str) launchMode to set for the main activity
|
||||
#android.manifest.launch_mode = standard
|
||||
|
||||
# (str) Add a Network Security Configuration file path to AndroidManifest.xml
|
||||
# More info: https://developer.android.com/guide/topics/manifest/application-element#networkSecurityConfig
|
||||
# File with desired network config must already exist in:
|
||||
# ./pythonforandroid/bootstraps/sdl2/build/src/main/res/xml/network_security_config.xml
|
||||
#android.manifest.network_security_config = "@xml/network_security_config"
|
||||
|
||||
# (str) Indicate that app intends to use cleartext network traffic in AndroidManifest.xml
|
||||
# More info: https://developer.android.com/guide/topics/manifest/application-element#usesCleartextTraffic
|
||||
#android.manifest.uses_cleartext_traffic = False
|
||||
|
||||
# (list) Android additional libraries to copy into libs/armeabi
|
||||
#android.add_libs_armeabi = libs/android/*.so
|
||||
#android.add_libs_armeabi_v7a = libs/android-v7/*.so
|
||||
|
|
|
@ -902,6 +902,30 @@ class TargetAndroid(Target):
|
|||
for lib in uses_library:
|
||||
cmd.append('--uses-library={}'.format(lib))
|
||||
|
||||
# support for activity-class-name
|
||||
activity_class_name = self.buildozer.config.getdefault(
|
||||
'app', 'android.activity_class_name', 'org.kivy.android.PythonActivity')
|
||||
if activity_class_name != 'org.kivy.android.PythonActivity':
|
||||
cmd.append('--activity-class-name={}'.format(activity_class_name))
|
||||
|
||||
# support for service-class-name
|
||||
service_class_name = self.buildozer.config.getdefault(
|
||||
'app', 'android.service_class_name', 'org.kivy.android.PythonService')
|
||||
if service_class_name != 'org.kivy.android.PythonService':
|
||||
cmd.append('--service-class-name={}'.format(service_class_name))
|
||||
|
||||
# support for network-security-config
|
||||
network_security_config = self.buildozer.config.getdefault(
|
||||
'app', 'android.manifest.network_security_config', None)
|
||||
if network_security_config is not None:
|
||||
cmd.append("--network-security-config={}".format(network_security_config))
|
||||
|
||||
# support for uses-cleartext-traffic
|
||||
uses_cleartext_traffic = self.buildozer.config.getdefault(
|
||||
'app', 'android.manifest.uses_cleartext_traffic', None)
|
||||
if uses_cleartext_traffic is not None:
|
||||
cmd.append("--uses-cleartext-traffic={}".format('true' if uses_cleartext_traffic else 'false'))
|
||||
|
||||
# support for gradle dependencies
|
||||
gradle_dependencies = self.buildozer.config.getlist('app', 'android.gradle_dependencies', [])
|
||||
for gradle_dependency in gradle_dependencies:
|
||||
|
|
Loading…
Reference in a new issue