tama 1 vuosi sitten
vanhempi
commit
4a531b4de6
1 muutettua tiedostoa jossa 21 lisäystä ja 20 poistoa
  1. 21 20
      main.py

+ 21 - 20
main.py

@@ -284,12 +284,12 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                     else:
                         f.write(indented_str(0, ""))
                 elif "API.connect" in line:
-                    line_appid = line.replace('***REPLACE***WITH***YOUR***APPLICATION***NAME***', app_id)
+                    replaced = line
+                    if app_id:
+                        replaced = replaced.replace('***REPLACE***WITH***YOUR***APPLICATION***NAME***', app_id)
                     if mode == "floating":
-                        replaced = line_appid.replace("0", "1")
-                        f.write(replaced)
-                    else:
-                        f.write(line_appid)
+                        replaced = replaced.replace("0", "1")
+                    f.write(replaced)
                 else:
                     f.write(line)
         with open(xml_menu_path, "r") as f:
@@ -617,12 +617,12 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                     else:
                         f.write(indented_str(0, ""))
                 elif "API.connect" in line:
-                    line_appid = line.replace('***REPLACE***WITH***YOUR***APPLICATION***NAME***', app_id)
+                    replaced = line
+                    if app_id:
+                        replaced = replaced.replace('***REPLACE***WITH***YOUR***APPLICATION***NAME***', app_id)
                     if mode == "floating":
-                        replaced = line_appid.replace("0", "1")
-                        f.write(replaced)
-                    else:
-                        f.write(line_appid)
+                        replaced = replaced.replace("0", "1")
+                    f.write(replaced)
                 else:
                     f.write(line)
         write_android_manifest(manifest_path, features, security)
@@ -858,12 +858,12 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                     else:
                         f.write(indented_str(0, "", spaces=2))
                 elif "API.connect" in line:
-                    line_appid = line.replace('***REPLACE***WITH***YOUR***APPLICATION***NAME***', app_id)
+                    replaced = line
+                    if app_id:
+                        replaced = replaced.replace('***REPLACE***WITH***YOUR***APPLICATION***NAME***', app_id)
                     if mode == "floating":
-                        replaced = line_appid.replace("0", "1")
-                        f.write(replaced)
-                    else:
-                        f.write(line_appid)
+                        replaced = replaced.replace("0", "1")
+                    f.write(replaced)
                 else:
                     f.write(line)
         write_android_manifest(manifest_path, features, security)
@@ -1291,12 +1291,12 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                     else:
                         f.write(indented_str(0, ""))
                 elif "API.connect" in line:
-                    line_appid = line.replace('***REPLACE***WITH***YOUR***APPLICATION***NAME***', app_id)
+                    replaced = line
+                    if app_id:
+                        replaced = replaced.replace('***REPLACE***WITH***YOUR***APPLICATION***NAME***', app_id)
                     if mode == "floating":
-                        replaced = line_appid.replace("0", "1")
-                        f.write(replaced)
-                    else:
-                        f.write(line_appid)
+                        replaced = replaced.replace("0", "1")
+                    f.write(replaced)
                 else:
                     f.write(line)
         write_android_manifest(manifest_path, features, security)
@@ -1944,6 +1944,7 @@ def build_project():
     if request.method == 'POST':
         platform = "android"
         mode = "burger"
+        app_id = ""
         feature_dict = {
             "im": {
                 "status": False