Skip to content

Instantly share code, notes, and snippets.

@Dirk-Sandberg
Last active May 8, 2020 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dirk-Sandberg/a2346014a77e86733956e618aff44dbe to your computer and use it in GitHub Desktop.
Save Dirk-Sandberg/a2346014a77e86733956e618aff44dbe to your computer and use it in GitHub Desktop.
used by sign_and_deploy shell script
import sys
ANDROID_TARGET_API = '28'
ARCH = sys.argv[1]
with open("buildozer.spec", "r") as f:
text = f.readlines()
for i, line in enumerate(text):
if 'android.api' in line:
# Set the minimum target API as required by Google
text[i] = 'android.api = ' + ANDROID_TARGET_API + "\n"
if 'android.arch' in line:
# Update the architecture to build
text[i] = 'android.arch = ' + ARCH + "\n"
with open("buildozer.spec", "w") as f:
# Save the edited buildozer.spec file
f.write(''.join(line for line in text))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment