This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sys | |
# ... | |
# Main function | |
def main(): | |
global company_item | |
global input_company_id | |
global input_key_filename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function for generating signed apk | |
def generateSignedApk(): | |
print('\nGENERATING apk...') | |
process = Popen('./gradlew assembleRelease', shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True) | |
output, errors = process.communicate() | |
# Zero returncode means process success | |
if not process.returncode: | |
print('Signed apk generated!') | |
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
# ... | |
# Function for downloading icon | |
def downloadIcon(item_dict): | |
print('\nDOWNLOADING icon file...') | |
url = item_dict[constants.JSON_KEY_APP_ICON] | |
try: | |
r = requests.get(url, allow_redirects=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from subprocess import Popen, PIPE | |
# ... | |
# Function for creating keystore file | |
def createKeystore(item_dict): | |
global input_key_filename | |
global input_store_pass | |
global input_key_alias |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fileinput | |
# ... | |
# Function for overwriting gradle.properties file | |
def overwriteGradleProperties(source_item_dict): | |
global input_company_id | |
global app_properties_keys | |
print('\nOVERWRITING gradle.properties file...') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import constants | |
# Variables | |
app_properties_keys = [ | |
{"gradle_key": constants.GRADLE_KEY_APP_NAME, "json_key": constants.JSON_KEY_APP_NAME}, | |
{"gradle_key": constants.GRADLE_KEY_APPLICATION_ID, "json_key": constants.JSON_KEY_PACKAGE_NAME}, | |
{"gradle_key": constants.GRADLE_KEY_THEME_COLOR, "json_key": constants.JSON_KEY_THEME_COLOR} | |
] | |
# constants.GRADLE_KEY_KEYSTORE_INFO_FILE was not included in this array, because keystore info won't come from json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Constants | |
COMPANY_INFO_FILE = 'companyInfo.json' | |
GRADLE_PROPERTIES_FILE = 'gradle.properties' | |
KEYSTORE_FOLDER = 'keystore/' | |
KEYSTORE_PROPERTIES_FILE_NAME_SUFFIX = '_keystore.properties' | |
APP_ICON_FILE = 'app/src/main/res/drawable/app_icon.png' | |
APP_BUILD_GRADLE_FILE = 'app/build.gradle' | |
RELEASE_APK_FOLDER = 'app/build/outputs/apk/release/' | |
RELEASE_APK_FILE_NAME = 'app-release.apk' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": 1, | |
"app_name": "Google Genius", | |
"package_name": "com.ehsanfahad.googlegenius.appautomate", | |
"theme_color": "#0F9D58", | |
"app_icon": "https://img.icons8.com/bubbles/2x/google-logo.png", | |
"keystore_owner": "App Automate Inc.", | |
"keystore_organizational_unit": "Coding Playground", | |
"keystore_organization": "Google Inc", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
android { | |
// ... | |
signingConfigs { | |
release | |
} | |
// To let gradle automate signing process, lintOptions to be added |