Skip to content

Instantly share code, notes, and snippets.

@emiliodallatorre
Created August 22, 2023 09:03
Show Gist options
  • Save emiliodallatorre/d43c9ee4000335ab7b3b20a7db14d4a7 to your computer and use it in GitHub Desktop.
Save emiliodallatorre/d43c9ee4000335ab7b3b20a7db14d4a7 to your computer and use it in GitHub Desktop.
Simple script to extract key.properties from a list of Flutter project directories
from os import walk
from os.path import exists
directories: list = walk(".")
key_properties_files: dict = {}
for directory in directories:
# Check if it is a flutter project
if "pubspec.yaml" in directory[2]:
# Check if key.properties exists
if exists(directory[0] + "/android/key.properties"):
print("Found key.properties in " + directory[0] + "/android/key.properties")
key_properties_files[directory[0]] = (
directory[0] + "/android/key.properties"
)
output_path: str = input("Enter path to export key.properties: ")
for key in key_properties_files:
with open(key_properties_files[key], "r") as key_properties_file:
with open(output_path + "/" + key + ".properties", "w") as output_file:
output_file.write(key_properties_file.read())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment