|
@@ -11,8 +11,8 @@ from zipfile import ZipFile
|
|
|
ImageFile.SAFEBLOCK = 2048 * 2048
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
-app.base_project = "/Users/maronakins/appbuilder-ios/AppBuilder"
|
|
|
-app.nexilis_lite = "/Users/maronakins/appbuilder-ios/NexilisLite"
|
|
|
+app.base_project = "/Users/maronakins/Documents/AppBuilder/appbuilder-ios/AppBuilder"
|
|
|
+app.nexilis_lite = "/Users/maronakins/Documents/AppBuilder/appbuilder-ios/NexilisLite"
|
|
|
app.temp_folder = "/Users/maronakins/BuildIos"
|
|
|
app.app_folder = "/Users/maronakins/"
|
|
|
app.verbose = True
|
|
@@ -108,11 +108,14 @@ def change_name(path_dest, app_name, package_id):
|
|
|
with open(xcshareddata, "w") as f:
|
|
|
f.write(replaced)
|
|
|
xcuserdata = os.path.join(xcproj, "xcuserdata/{}.xcuserdatad/xcschemes/xcschememanagement.plist".format(app.username))
|
|
|
- with open(xcuserdata, "r") as f:
|
|
|
- file_source = f.read()
|
|
|
- replaced = file_source.replace("AppBuilder", app_name)
|
|
|
- with open(xcuserdata, "w") as f:
|
|
|
- f.write(replaced)
|
|
|
+ try:
|
|
|
+ with open(xcuserdata, "r") as f:
|
|
|
+ file_source = f.read()
|
|
|
+ replaced = file_source.replace("AppBuilder", app_name)
|
|
|
+ with open(xcuserdata, "w") as f:
|
|
|
+ f.write(replaced)
|
|
|
+ except FileNotFoundError:
|
|
|
+ pass
|
|
|
contentsw = os.path.join(xcwork, "contents.xcworkspacedata")
|
|
|
with open(contentsw, "r") as f:
|
|
|
file_source = f.read()
|
|
@@ -191,6 +194,7 @@ def change_background(c_code_path, background):
|
|
|
assets_dir = os.path.join(c_code_path, "Assets.xcassets")
|
|
|
img_src_path_1 = os.path.join(assets_dir, "pb_lbackground_1.imageset")
|
|
|
if isinstance(background, str):
|
|
|
+ background = []
|
|
|
background = background.split(",")
|
|
|
for i, b in enumerate(background):
|
|
|
n = i + 1
|
|
@@ -211,6 +215,18 @@ def change_background(c_code_path, background):
|
|
|
logo = Image.open(f)
|
|
|
logo = logo.resize((600, 1250))
|
|
|
logo.save(img_path, "PNG")
|
|
|
+ second_tab = os.path.join(c_code_path, "SecondTabViewController.swift")
|
|
|
+ fourth_tab = os.path.join(c_code_path, "FourthTabViewController.swift")
|
|
|
+ with open(second_tab, "r") as f:
|
|
|
+ file_source = f.read()
|
|
|
+ replaced = file_source.replace("1..<2", "1..<{}".format(len(background) + 1))
|
|
|
+ with open(second_tab, "w") as f:
|
|
|
+ f.write(replaced)
|
|
|
+ with open(fourth_tab, "r") as f:
|
|
|
+ file_source = f.read()
|
|
|
+ replaced = file_source.replace("1..<2", "1..<{}".format(len(background) + 1))
|
|
|
+ with open(fourth_tab, "w") as f:
|
|
|
+ f.write(replaced)
|
|
|
else:
|
|
|
img_path = os.path.join(img_src_path_1, "pb_lbackground_1.png")
|
|
|
logo = Image.open(background)
|