|
@@ -15,12 +15,17 @@ app.base_project = "/Users/maronakins/Documents/AppBuilder/appbuilder-ios/AppBui
|
|
app.nexilis_lite = "/Users/maronakins/Documents/AppBuilder/appbuilder-ios/NexilisLite"
|
|
app.nexilis_lite = "/Users/maronakins/Documents/AppBuilder/appbuilder-ios/NexilisLite"
|
|
app.temp_folder = "/Users/maronakins/BuildIos"
|
|
app.temp_folder = "/Users/maronakins/BuildIos"
|
|
app.app_folder = "/Users/maronakins/"
|
|
app.app_folder = "/Users/maronakins/"
|
|
|
|
+app.asset_folder = "/Users/maronakins/BuildIosAssets"
|
|
app.verbose = True
|
|
app.verbose = True
|
|
app.ssl = None
|
|
app.ssl = None
|
|
app.keytool = '/usr/bin/keytool'
|
|
app.keytool = '/usr/bin/keytool'
|
|
app.username = "maronakins"
|
|
app.username = "maronakins"
|
|
# app.ios_platform_ids = ["bb8f256703e8fbe84da414cee20cb4d0eca3388d"]
|
|
# app.ios_platform_ids = ["bb8f256703e8fbe84da414cee20cb4d0eca3388d"]
|
|
app.ios_platform_ids = []
|
|
app.ios_platform_ids = []
|
|
|
|
+app.app_name = "AppBuilder"
|
|
|
|
+app.package_id = "io.newuniverse.AppBuilder420"
|
|
|
|
+app.version_code = "1"
|
|
|
|
+app.version_name = "1.0.0"
|
|
|
|
|
|
app.base_project_name = os.path.basename(app.base_project)
|
|
app.base_project_name = os.path.basename(app.base_project)
|
|
|
|
|
|
@@ -154,29 +159,54 @@ def change_font(c_code_path, font):
|
|
pass
|
|
pass
|
|
|
|
|
|
|
|
|
|
-def change_logo(c_code_path, logo, logo_float=None):
|
|
|
|
|
|
+def change_logo(c_code_path, lib_dest, logo, logo_float=None):
|
|
app_icon_set = [29,40,57,58,60,80,87,114,120,180,1024]
|
|
app_icon_set = [29,40,57,58,60,80,87,114,120,180,1024]
|
|
app_icon_dir = os.path.join(c_code_path, 'Assets.xcassets/AppIcon.appiconset')
|
|
app_icon_dir = os.path.join(c_code_path, 'Assets.xcassets/AppIcon.appiconset')
|
|
- app_float_dir = os.path.join(c_code_path, 'Assets.xcassets/pb_icon.imageset')
|
|
|
|
|
|
+ app_float_dir = os.path.join(lib_dest, 'NexilisLite/Resource/Assets.xcassets/pb_ball.imageset')
|
|
if isinstance(logo, str):
|
|
if isinstance(logo, str):
|
|
- logo = requests.get('https://id.palio.io/dashboardv2/uploads/logo/{}'.format(logo))
|
|
|
|
- for size in app_icon_set:
|
|
|
|
- img_path = os.path.join(app_icon_dir, "{}.png".format(size))
|
|
|
|
- with open(img_path, "wb") as f:
|
|
|
|
- f.write(logo.content)
|
|
|
|
- with open(img_path, "rb") as f:
|
|
|
|
- l = Image.open(f)
|
|
|
|
- l = l.resize((size, size))
|
|
|
|
- l.save(img_path, "PNG")
|
|
|
|
|
|
+ # try:
|
|
|
|
+ # logo_url = requests.get('https://newuniverse.io/dashboardv2/uploads/logo/{}'.format(logo))
|
|
|
|
+ # for size in app_icon_set:
|
|
|
|
+ # img_path = os.path.join(app_icon_dir, "{}.png".format(size))
|
|
|
|
+ # with open(img_path, "wb") as f:
|
|
|
|
+ # f.write(logo_url.content)
|
|
|
|
+ # with open(img_path, "rb") as f:
|
|
|
|
+ # l = Image.open(f)
|
|
|
|
+ # l = l.resize((size, size))
|
|
|
|
+ # l.save(img_path, "PNG")
|
|
|
|
+ # except:
|
|
|
|
+ try:
|
|
|
|
+ logo_path = os.path.join(app.asset_folder, "logo", "{}".format(logo))
|
|
|
|
+ for size in app_icon_set:
|
|
|
|
+ img_path = os.path.join(app_icon_dir, "{}.png".format(size))
|
|
|
|
+ with open(logo_path, "rb") as f:
|
|
|
|
+ l = Image.open(f)
|
|
|
|
+ l = l.resize((size, size))
|
|
|
|
+ l.save(img_path, "PNG")
|
|
|
|
+ except:
|
|
|
|
+ print("error logo: {}".format(logo))
|
|
|
|
+ return
|
|
if logo_float:
|
|
if logo_float:
|
|
- logo_float = requests.get('https://id.palio.io/dashboardv2/uploads/logofloat/{}'.format(logo_float))
|
|
|
|
- img_path = os.path.join(app_float_dir, "nexilis_icon.png")
|
|
|
|
- with open(img_path, "wb") as f:
|
|
|
|
- f.write(logo_float.content)
|
|
|
|
- with open(img_path, "rb") as f:
|
|
|
|
- l = Image.open(f)
|
|
|
|
- l = l.resize((512, 512))
|
|
|
|
- l.save(img_path, "PNG")
|
|
|
|
|
|
+ # try:
|
|
|
|
+ # logo_float_url = requests.get('https://newuniverse.io/dashboardv2/uploads/logofloat/{}'.format(logo_float))
|
|
|
|
+ # img_path = os.path.join(app_float_dir, "pb_ball.png")
|
|
|
|
+ # with open(img_path, "wb") as f:
|
|
|
|
+ # f.write(logo_float_url.content)
|
|
|
|
+ # with open(img_path, "rb") as f:
|
|
|
|
+ # l = Image.open(f)
|
|
|
|
+ # l = l.resize((512, 512))
|
|
|
|
+ # l.save(img_path, "PNG")
|
|
|
|
+ # except:
|
|
|
|
+ try:
|
|
|
|
+ logo_float_path = os.path.join(app.asset_folder, "logofloat", "{}".format(logo))
|
|
|
|
+ img_path = os.path.join(app_float_dir, "pb_ball.png".format(size))
|
|
|
|
+ with open(logo_float_path, "rb") as f:
|
|
|
|
+ l = Image.open(f)
|
|
|
|
+ l = l.resize((size, size))
|
|
|
|
+ l.save(img_path, "PNG")
|
|
|
|
+ except:
|
|
|
|
+ print("error logofloat: {}".format(logo))
|
|
|
|
+ return
|
|
else:
|
|
else:
|
|
logo = Image.open(logo)
|
|
logo = Image.open(logo)
|
|
for size in app_icon_set:
|
|
for size in app_icon_set:
|
|
@@ -194,27 +224,40 @@ def change_background(c_code_path, background):
|
|
assets_dir = os.path.join(c_code_path, "Assets.xcassets")
|
|
assets_dir = os.path.join(c_code_path, "Assets.xcassets")
|
|
img_src_path_1 = os.path.join(assets_dir, "pb_lbackground_1.imageset")
|
|
img_src_path_1 = os.path.join(assets_dir, "pb_lbackground_1.imageset")
|
|
if isinstance(background, str):
|
|
if isinstance(background, str):
|
|
- background = []
|
|
|
|
background = background.split(",")
|
|
background = background.split(",")
|
|
for i, b in enumerate(background):
|
|
for i, b in enumerate(background):
|
|
n = i + 1
|
|
n = i + 1
|
|
|
|
+ print(b)
|
|
img_src_path = os.path.join(assets_dir, "pb_lbackground_{}.imageset".format(n))
|
|
img_src_path = os.path.join(assets_dir, "pb_lbackground_{}.imageset".format(n))
|
|
|
|
+ print(img_src_path)
|
|
if n != 1:
|
|
if n != 1:
|
|
- shutil.copy(img_src_path_1,img_src_path)
|
|
|
|
- contents_json = os.path.join(img_src_path, "Contents.json")
|
|
|
|
- with open(contents_json, "r") as f:
|
|
|
|
- file_source = f.read()
|
|
|
|
- replaced = file_source.replace("lbackground_1", "= lbackground_{}".format(n))
|
|
|
|
- with open(contents_json, "w") as f:
|
|
|
|
- f.write(replaced)
|
|
|
|
|
|
+ shutil.copytree(img_src_path_1,img_src_path)
|
|
|
|
+ os.remove(os.path.join(img_src_path,"pb_lbackground_1.png"))
|
|
|
|
+ contents_json = os.path.join(img_src_path, "Contents.json")
|
|
|
|
+ with open(contents_json, "r") as f:
|
|
|
|
+ file_source = f.read()
|
|
|
|
+ replaced = file_source.replace("lbackground_1", "lbackground_{}".format(n))
|
|
|
|
+ with open(contents_json, "w") as f:
|
|
|
|
+ f.write(replaced)
|
|
img_path = os.path.join(img_src_path, "pb_lbackground_{}.png".format(n))
|
|
img_path = os.path.join(img_src_path, "pb_lbackground_{}.png".format(n))
|
|
- logo = requests.get('https://id.palio.io/dashboardv2/uploads/background/{}'.format(b))
|
|
|
|
- with open(img_path, "wb") as f:
|
|
|
|
- f.write(logo.content)
|
|
|
|
- with open(img_path, "rb") as f:
|
|
|
|
- logo = Image.open(f)
|
|
|
|
- logo = logo.resize((600, 1250))
|
|
|
|
- logo.save(img_path, "PNG")
|
|
|
|
|
|
+ # try:
|
|
|
|
+ # background_url = requests.get('https://newuniverse.io/dashboardv2/uploads/background/{}'.format(b))
|
|
|
|
+ # with open(img_path, "wb") as f:
|
|
|
|
+ # f.write(background_url.content)
|
|
|
|
+ # with open(img_path, "rb") as f:
|
|
|
|
+ # l = Image.open(f)
|
|
|
|
+ # l = l.resize((600, 1250))
|
|
|
|
+ # l.save(img_path, "PNG")
|
|
|
|
+ # except:
|
|
|
|
+ try:
|
|
|
|
+ background_path = os.path.join(app.asset_folder, "background", "{}".format(b))
|
|
|
|
+ with open(background_path, "rb") as f:
|
|
|
|
+ l = Image.open(f)
|
|
|
|
+ l = l.resize((600, 1250))
|
|
|
|
+ l.save(img_path, "PNG")
|
|
|
|
+ except:
|
|
|
|
+ print("error background: {}".format(b))
|
|
|
|
+ return
|
|
second_tab = os.path.join(c_code_path, "SecondTabViewController.swift")
|
|
second_tab = os.path.join(c_code_path, "SecondTabViewController.swift")
|
|
fourth_tab = os.path.join(c_code_path, "FourthTabViewController.swift")
|
|
fourth_tab = os.path.join(c_code_path, "FourthTabViewController.swift")
|
|
with open(second_tab, "r") as f:
|
|
with open(second_tab, "r") as f:
|
|
@@ -242,13 +285,23 @@ def change_fb(lib_dest, fb_icon):
|
|
img_path = "NexilisLite/Resource/Assets.xcassets"
|
|
img_path = "NexilisLite/Resource/Assets.xcassets"
|
|
img_path = os.path.join(lib_dest, img_path, "{}.imageset".format(default_fb_icon[i]), "{}.png".format(default_fb_icon[i]))
|
|
img_path = os.path.join(lib_dest, img_path, "{}.imageset".format(default_fb_icon[i]), "{}.png".format(default_fb_icon[i]))
|
|
if isinstance(fb_icon[i], str):
|
|
if isinstance(fb_icon[i], str):
|
|
- logo = requests.get('https://id.palio.io/dashboardv2/uploads/fb_icon/{}'.format(fb_icon[i]))
|
|
|
|
- with open(img_path, "wb") as f:
|
|
|
|
- f.write(logo.content)
|
|
|
|
- with open(img_path, "rb") as f:
|
|
|
|
- logo = Image.open(f)
|
|
|
|
- logo = logo.resize((150, 150))
|
|
|
|
- logo.save(img_path, "PNG")
|
|
|
|
|
|
+ try:
|
|
|
|
+ fb_icon_url = requests.get('https://newuniverse.io/dashboardv2/uploads/fb_icon/{}'.format(fb_icon[i]))
|
|
|
|
+ with open(img_path, "wb") as f:
|
|
|
|
+ f.write(fb_icon_url.content)
|
|
|
|
+ with open(img_path, "rb") as f:
|
|
|
|
+ l = Image.open(f)
|
|
|
|
+ l = l.resize((150, 150))
|
|
|
|
+ l.save(img_path, "PNG")
|
|
|
|
+ except:
|
|
|
|
+ try:
|
|
|
|
+ fb_icon_path = os.path.join(app.asset_folder, "fb_icon", "{}".format(fb_icon[i]))
|
|
|
|
+ with open(fb_icon_path, "rb") as f:
|
|
|
|
+ l = Image.open(f)
|
|
|
|
+ l = l.resize((150, 150))
|
|
|
|
+ l.save(img_path, "PNG")
|
|
|
|
+ except:
|
|
|
|
+ print("error tab icon {}: {}".format(i,fb_icon[i]))
|
|
else:
|
|
else:
|
|
logo = Image.open(fb_icon[i])
|
|
logo = Image.open(fb_icon[i])
|
|
logo = logo.resize((150, 150))
|
|
logo = logo.resize((150, 150))
|
|
@@ -277,13 +330,24 @@ def change_tab(c_code_path, tabs, tab_icon, tab3_mode):
|
|
"{}_icon.imageset".format(default_tab_icon[i]),
|
|
"{}_icon.imageset".format(default_tab_icon[i]),
|
|
"{}_nexilis.png".format(default_tab_icon[i]))
|
|
"{}_nexilis.png".format(default_tab_icon[i]))
|
|
if isinstance(tab_icon[i], str):
|
|
if isinstance(tab_icon[i], str):
|
|
- logo = requests.get('https://id.palio.io/dashboardv2/uploads/tab_icon/{}'.format(tab_icon[i]))
|
|
|
|
- with open(img_path, "wb") as f:
|
|
|
|
- f.write(logo.content)
|
|
|
|
- with open(img_path, "rb") as f:
|
|
|
|
- logo = Image.open(f)
|
|
|
|
- logo = logo.resize((150, 150))
|
|
|
|
- logo.save(img_path, "PNG")
|
|
|
|
|
|
+ # try:
|
|
|
|
+ # tab_icon_url = requests.get('https://newuniverse.io/dashboardv2/uploads/tab_icon/{}'.format(tab_icon[i]))
|
|
|
|
+ # with open(img_path, "wb") as f:
|
|
|
|
+ # f.write(tab_icon_url.content)
|
|
|
|
+ # with open(img_path, "rb") as f:
|
|
|
|
+ # l = Image.open(f)
|
|
|
|
+ # l = l.resize((150, 150))
|
|
|
|
+ # l.save(img_path, "PNG")
|
|
|
|
+ # except:
|
|
|
|
+ try:
|
|
|
|
+ tab_icon_path = os.path.join(app.asset_folder, "tab_icon", "{}".format(tab_icon[i]))
|
|
|
|
+ with open(tab_icon_path, "rb") as f:
|
|
|
|
+ l = Image.open(f)
|
|
|
|
+ l = l.resize((150, 150))
|
|
|
|
+ l.save(img_path, "PNG")
|
|
|
|
+ except:
|
|
|
|
+ print("error tab_icon {}: {}".format(i,tab_icon[i]))
|
|
|
|
+ return
|
|
else:
|
|
else:
|
|
logo = Image.open(tab_icon[i])
|
|
logo = Image.open(tab_icon[i])
|
|
logo = logo.resize((150, 150))
|
|
logo = logo.resize((150, 150))
|
|
@@ -353,8 +417,8 @@ def build_apk():
|
|
if request.method == 'POST':
|
|
if request.method == 'POST':
|
|
logo = None
|
|
logo = None
|
|
logo_float = None
|
|
logo_float = None
|
|
- app_name = "AppBuilder"
|
|
|
|
- package_id = "io.newuniverse.AppBuilder420"
|
|
|
|
|
|
+ app_name = app.app_name
|
|
|
|
+ package_id = app.package_id
|
|
acc = None
|
|
acc = None
|
|
url = None
|
|
url = None
|
|
keystore = None
|
|
keystore = None
|
|
@@ -365,8 +429,8 @@ def build_apk():
|
|
tab_icon = [None, None, None, None]
|
|
tab_icon = [None, None, None, None]
|
|
fb_icon = [None, None, None, None, None]
|
|
fb_icon = [None, None, None, None, None]
|
|
background = None
|
|
background = None
|
|
- version_code = "1"
|
|
|
|
- version_name = "1.0.0"
|
|
|
|
|
|
+ version_code = app.version_code
|
|
|
|
+ version_name = app.version_name
|
|
font = 0
|
|
font = 0
|
|
key = {"alias": "nexilislite", "store_password": "allyourbase", "key_password": "arebelongto", "common_name": "all", "organization_unit": "your",
|
|
key = {"alias": "nexilislite", "store_password": "allyourbase", "key_password": "arebelongto", "common_name": "all", "organization_unit": "your",
|
|
"organization_name": "base", "locality_name": "are", "state_name": "belong", "country": "to"}
|
|
"organization_name": "base", "locality_name": "are", "state_name": "belong", "country": "to"}
|
|
@@ -524,7 +588,7 @@ def build_apk():
|
|
change_version(path_dest, app_name, version_code, version_name)
|
|
change_version(path_dest, app_name, version_code, version_name)
|
|
change_font(c_code_path, font)
|
|
change_font(c_code_path, font)
|
|
if logo:
|
|
if logo:
|
|
- change_logo(c_code_path, logo, logo_float)
|
|
|
|
|
|
+ change_logo(c_code_path, lib_dest, logo, logo_float)
|
|
if background:
|
|
if background:
|
|
change_background(c_code_path, background)
|
|
change_background(c_code_path, background)
|
|
change_fb(lib_dest, fb_icon)
|
|
change_fb(lib_dest, fb_icon)
|