|
@@ -66,17 +66,19 @@ def write_android_manifest(manifest_path: str, features: dict, security: dict):
|
|
|
f.write(indented_str(1, '<uses-permission android:name="android.permission.WRITE_SMS" />'))
|
|
|
else:
|
|
|
f.write(indented_str(1, '<!-- use SMS permission -->'))
|
|
|
- f.write(indented_str(1, '<!-- <uses-permission android:name="android.permission.RECEIVE_SMS" /> -->'))
|
|
|
+ f.write(
|
|
|
+ indented_str(1, '<!-- <uses-permission android:name="android.permission.RECEIVE_SMS" /> -->'))
|
|
|
f.write(indented_str(1, '<!-- <uses-permission android:name="android.permission.SEND_SMS" /> -->'))
|
|
|
f.write(indented_str(1, '<!-- <uses-permission android:name="android.permission.READ_SMS" /> -->'))
|
|
|
f.write(indented_str(1, '<!-- <uses-permission android:name="android.permission.WRITE_SMS" /> -->'))
|
|
|
elif "<!-- SECURITY -->" in line:
|
|
|
- if security["malware"] or security["side_load"] :
|
|
|
+ if security["malware"] or security["side_load"]:
|
|
|
f.write(indented_str(1, '<!-- use Malware Detection & Sideload App permission -->'))
|
|
|
f.write(indented_str(1, '<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />'))
|
|
|
else:
|
|
|
f.write(indented_str(1, '<!-- use Malware Detection & Sideload App permission -->'))
|
|
|
- f.write(indented_str(1, '<!-- <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" /> -->'))
|
|
|
+ f.write(indented_str(1,
|
|
|
+ '<!-- <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" /> -->'))
|
|
|
else:
|
|
|
f.write(line)
|
|
|
|
|
@@ -87,6 +89,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
"app/src/main/java/com/example/nexilissamplecodeburger/MainActivity.java")
|
|
|
xml_menu_path = os.path.join(path_dest, "app/src/main/res/menu/menu_main.xml")
|
|
|
manifest_path = os.path.join(path_dest, "app/src/main/AndroidManifest.xml")
|
|
|
+ layout_grid_path = os.path.join(path_dest, "app/src/main/res/layout/activity_main_grid.xml")
|
|
|
with open(main_act_path, "r") as f:
|
|
|
lines = f.readlines()
|
|
|
with open(main_act_path, "w") as f:
|
|
@@ -236,22 +239,135 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
f.write(indented_str(2, "API.setEnabledSmartBot(true);"))
|
|
|
else:
|
|
|
f.write(indented_str(2, "// API.setEnabledSmartBot(true);"))
|
|
|
+ elif "//GRID" in line:
|
|
|
+ f.write(indented_str(2, "API.setGeneralCallback(new GeneralCallback() {"))
|
|
|
+ f.write(indented_str(3, "@Override"))
|
|
|
+ f.write(
|
|
|
+ indented_str(3, "public void onAddJavasript(WebView webView, WebSettings webSettings) {"))
|
|
|
+ f.write(indented_str(4, "webSettings.setJavaScriptEnabled(true);"))
|
|
|
+ f.write(indented_str(3, "}"))
|
|
|
+ f.write(indented_str(0, ""))
|
|
|
+ f.write(indented_str(3, "@Override"))
|
|
|
+ f.write(
|
|
|
+ indented_str(3,
|
|
|
+ "public void onAddJavascriptGeneral(WebView webView, WebSettings webSettings) {"))
|
|
|
+ f.write(indented_str(4, "webSettings.setJavaScriptEnabled(true);"))
|
|
|
+ f.write(indented_str(3, "}"))
|
|
|
+ f.write(indented_str(0, ""))
|
|
|
+ f.write(indented_str(3, "@Override"))
|
|
|
+ f.write(
|
|
|
+ indented_str(3,
|
|
|
+ "public void onAddJavascriptOpenLink(WebView webView, WebSettings webSettings) {"))
|
|
|
+ f.write(indented_str(4, "webSettings.setJavaScriptEnabled(true);"))
|
|
|
+ f.write(indented_str(3, "}"))
|
|
|
+ f.write(indented_str(0, ""))
|
|
|
+ f.write(indented_str(3, "@Override"))
|
|
|
+ f.write(
|
|
|
+ indented_str(3,
|
|
|
+ "public void onAddJavascriptWebRTC(AppCompatActivity appCompatActivity, WebSettings webSettings) {"))
|
|
|
+ f.write(indented_str(4, ""))
|
|
|
+ f.write(indented_str(3, "}"))
|
|
|
+ f.write(indented_str(2, "});"))
|
|
|
+ f.write(indented_str(0, ""))
|
|
|
+ f.write(indented_str(2, "ImageView imageViewSetting = findViewById(R.id.btn_setting);"))
|
|
|
+ f.write(indented_str(2, "ImageView imageViewProfile = findViewById(R.id.btn_person);"))
|
|
|
+ if features["cc"]["status"]:
|
|
|
+ f.write(indented_str(2, "ImageView imageViewCC = findViewById(R.id.btn_cc);"))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(2, "// ImageView imageViewCC = findViewById(R.id.btn_cc);"))
|
|
|
+ if features["nc"]["status"]:
|
|
|
+ f.write(indented_str(2, "ImageView imageViewNC = findViewById(R.id.btn_nc);"))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(2, "// ImageView imageViewNC = findViewById(R.id.btn_nc);"))
|
|
|
+ if features["im"]["status"]:
|
|
|
+ f.write(indented_str(2, "ImageView imageViewChat = findViewById(R.id.btn_chat);"))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(2, "// ImageView imageViewChat = findViewById(R.id.btn_chat);"))
|
|
|
+ if features["call"]["status"]:
|
|
|
+ f.write(indented_str(2, "ImageView imageViewCall = findViewById(R.id.btn_call);"))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(2, "// ImageView imageViewCall = findViewById(R.id.btn_call);"))
|
|
|
+ if features["ls"]["status"]:
|
|
|
+ f.write(indented_str(2, "ImageView imageViewStream = findViewById(R.id.btn_stream);"))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(2, "// ImageView imageViewStream = findViewById(R.id.btn_stream);"))
|
|
|
+ if security["secure_folder"]:
|
|
|
+ f.write(indented_str(2, "ImageView imageViewSF = findViewById(R.id.btn_sf);"))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(2, "// ImageView imageViewSF = findViewById(R.id.btn_sf);"))
|
|
|
+ f.write(indented_str(0, ""))
|
|
|
+ f.write(indented_str(2, "imageViewSetting.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "API.openSettings();"))
|
|
|
+ f.write(indented_str(2, "});"))
|
|
|
+ f.write(indented_str(2, "imageViewProfile.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "API.openProfile();"))
|
|
|
+ f.write(indented_str(2, "});"))
|
|
|
+ if features["cc"]["status"]:
|
|
|
+ f.write(indented_str(2, "imageViewCC.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "API.openContactCenter();"))
|
|
|
+ f.write(indented_str(2, "});"))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(2, "// imageViewCC.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "// API.openContactCenter();"))
|
|
|
+ f.write(indented_str(2, "// });"))
|
|
|
+ if features["nc"]["status"]:
|
|
|
+ f.write(indented_str(2, "imageViewNC.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "API.openNotificationCenter();"))
|
|
|
+ f.write(indented_str(2, "});"))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(2, "// imageViewNC.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "// API.openNotificationCenter();"))
|
|
|
+ f.write(indented_str(2, "// });"))
|
|
|
+ if features["nc"]["status"]:
|
|
|
+ f.write(indented_str(2, "imageViewChat.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "API.openChat();"))
|
|
|
+ f.write(indented_str(2, "});"))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(2, "// imageViewChat.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "// API.openChat();"))
|
|
|
+ f.write(indented_str(2, "// });"))
|
|
|
+ if features["call"]["status"]:
|
|
|
+ f.write(indented_str(2, "imageViewCall.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "API.openCall();"))
|
|
|
+ f.write(indented_str(2, "});"))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(2, "// imageViewCall.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "// API.openCall();"))
|
|
|
+ f.write(indented_str(2, "// });"))
|
|
|
+ if features["ls"]["status"]:
|
|
|
+ f.write(indented_str(2, "imageViewStream.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "API.openLiveStreaming();"))
|
|
|
+ f.write(indented_str(2, "});"))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(2, "// imageViewStream.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "// API.openLiveStreaming();"))
|
|
|
+ f.write(indented_str(2, "// });"))
|
|
|
+ if security["secure_folder"]:
|
|
|
+ f.write(indented_str(2, "imageViewSF.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "API.openSecureFolder();"))
|
|
|
+ f.write(indented_str(2, "});"))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(2, "// imageViewSF.setOnClickListener(v -> {"))
|
|
|
+ f.write(indented_str(3, "// API.openSecureFolder();"))
|
|
|
+ f.write(indented_str(2, "// });"))
|
|
|
elif "//BREAK" in line:
|
|
|
- if mode == "floating":
|
|
|
+ if mode == "floating" or mode == "grid":
|
|
|
f.write("}")
|
|
|
break
|
|
|
else:
|
|
|
- f.write(indented_str(0,""))
|
|
|
+ f.write(indented_str(0, ""))
|
|
|
elif "//FLOATING" in line:
|
|
|
if mode == "floating":
|
|
|
f.write(indented_str(6, "ArrayList<FloatingButton> fb = new ArrayList<>();"))
|
|
|
if features["cc"]["status"]:
|
|
|
- f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.CONTACT_CENTER, ""));'))
|
|
|
+ f.write(indented_str(6,
|
|
|
+ 'fb.add(new FloatingButton(FloatingButton.FEATURE.CONTACT_CENTER, ""));'))
|
|
|
else:
|
|
|
f.write(indented_str(6,
|
|
|
'// fb.add(new FloatingButton(FloatingButton.FEATURE.CONTACT_CENTER, ""));'))
|
|
|
if features["nc"]["status"]:
|
|
|
- f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.NOTIF_CENTER, ""));'))
|
|
|
+ f.write(
|
|
|
+ indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.NOTIF_CENTER, ""));'))
|
|
|
else:
|
|
|
f.write(indented_str(6,
|
|
|
'// fb.add(new FloatingButton(FloatingButton.FEATURE.NOTIF_CENTER, ""));'))
|
|
@@ -263,7 +379,8 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
'// fb.add(new FloatingButton(FloatingButton.FEATURE.MESSAGING, ""));'))
|
|
|
if features["call"]["status"]:
|
|
|
f.write(
|
|
|
- indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_VIDEO_CALL, ""));'))
|
|
|
+ indented_str(6,
|
|
|
+ 'fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_VIDEO_CALL, ""));'))
|
|
|
else:
|
|
|
f.write(indented_str(6,
|
|
|
'// fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_VIDEO_CALL, ""));'))
|
|
@@ -275,7 +392,8 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
'// fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));'))
|
|
|
if security["secure_folder"]:
|
|
|
f.write(
|
|
|
- indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));'))
|
|
|
+ indented_str(6,
|
|
|
+ 'fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));'))
|
|
|
else:
|
|
|
f.write(indented_str(6,
|
|
|
'// fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));'))
|
|
@@ -290,6 +408,11 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
if mode == "floating":
|
|
|
replaced = replaced.replace("0", "1")
|
|
|
f.write(replaced)
|
|
|
+ elif "R.layout.activity_main" in line:
|
|
|
+ replaced = line
|
|
|
+ if mode == "grid":
|
|
|
+ replaced = replaced.replace("activity_main", "activity_main_grid")
|
|
|
+ f.write(replaced)
|
|
|
else:
|
|
|
f.write(line)
|
|
|
with open(xml_menu_path, "r") as f:
|
|
@@ -396,10 +519,124 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
n = n + 1
|
|
|
else:
|
|
|
f.write(line)
|
|
|
+ l_features = [x for x in list(features.keys()) if features[x]["status"] and x != "smartbot" and x != "sms" and x != "email"]
|
|
|
+ if security["secure_folder"]:
|
|
|
+ l_features.append("secure_folder")
|
|
|
+ n_features = len(l_features) + 2
|
|
|
+ row_count = -(n_features // -3) # ceiling div
|
|
|
+ column_count = 3
|
|
|
+ with open(layout_grid_path, "r") as f:
|
|
|
+ lines = f.readlines()
|
|
|
+ with open(layout_grid_path, "w") as f:
|
|
|
+ for line in lines:
|
|
|
+ if "rowCount" in line:
|
|
|
+ f.write(indented_str(1, f'android:rowCount="{row_count}"'))
|
|
|
+ elif "columnCount" in line:
|
|
|
+ f.write(indented_str(1,f'android:columnCount="{column_count}"'))
|
|
|
+ elif "<!-- FEATURES -->" in line:
|
|
|
+ f.write(indented_str(1, "<ImageView"))
|
|
|
+ f.write(indented_str(2, 'android:id="@+id/btn_setting"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_height="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_width="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_margin="10dp"'))
|
|
|
+ f.write(indented_str(2, 'android:src="@drawable/pb_cuc_menu_item_setting"/>'))
|
|
|
+ f.write(indented_str(1, "<ImageView"))
|
|
|
+ f.write(indented_str(2, 'android:id="@+id/btn_person"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_height="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_width="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_margin="10dp"'))
|
|
|
+ f.write(indented_str(2, 'android:src="@drawable/pb_ic_person_boy"/>'))
|
|
|
+ if "cc" in l_features:
|
|
|
+ f.write(indented_str(1, "<ImageView"))
|
|
|
+ f.write(indented_str(2, 'android:id="@+id/btn_cc"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_height="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_width="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_margin="10dp"'))
|
|
|
+ f.write(indented_str(2, 'android:src="@drawable/pb_button_cc"/>'))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(1, "<!--<ImageView-->"))
|
|
|
+ f.write(indented_str(2, '<!--android:id="@+id/btn_cc"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_height="100dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_width="100dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_margin="10dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:src="@drawable/pb_button_cc"/>-->'))
|
|
|
+ if "nc" in l_features:
|
|
|
+ f.write(indented_str(1, "<ImageView"))
|
|
|
+ f.write(indented_str(2, 'android:id="@+id/btn_nc"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_height="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_width="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_margin="10dp"'))
|
|
|
+ f.write(indented_str(2, 'android:src="@drawable/pb_button_notif_center"/>'))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(1, "<!--<ImageView-->"))
|
|
|
+ f.write(indented_str(2, '<!--android:id="@+id/btn_nc"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_height="100dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_width="100dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_margin="10dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:src="@drawable/pb_button_notif_center"/>-->'))
|
|
|
+ if "im" in l_features:
|
|
|
+ f.write(indented_str(1, "<ImageView"))
|
|
|
+ f.write(indented_str(2, 'android:id="@+id/btn_chat"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_height="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_width="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_margin="10dp"'))
|
|
|
+ f.write(indented_str(2, 'android:src="@drawable/pb_button_chat"/>'))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(1, "<!--<ImageView-->"))
|
|
|
+ f.write(indented_str(2, '<!--android:id="@+id/btn_chat"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_height="100dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_width="100dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_margin="10dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:src="@drawable/pb_button_chat"/>-->'))
|
|
|
+ if "call" in l_features:
|
|
|
+ f.write(indented_str(1, "<ImageView"))
|
|
|
+ f.write(indented_str(2, 'android:id="@+id/btn_call"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_height="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_width="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_margin="10dp"'))
|
|
|
+ f.write(indented_str(2, 'android:src="@drawable/pb_button_call"/>'))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(1, "<!--<ImageView-->"))
|
|
|
+ f.write(indented_str(2, '<!--android:id="@+id/btn_call"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_height="100dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_width="100dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_margin="10dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:src="@drawable/pb_button_call"/>-->'))
|
|
|
+ if "ls" in l_features:
|
|
|
+ f.write(indented_str(1, "<ImageView"))
|
|
|
+ f.write(indented_str(2, 'android:id="@+id/btn_stream"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_height="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_width="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_margin="10dp"'))
|
|
|
+ f.write(indented_str(2, 'android:src="@drawable/pb_button_stream"/>'))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(1, "<!--<ImageView-->"))
|
|
|
+ f.write(indented_str(2, '<!--android:id="@+id/btn_stream"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_height="100dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_width="100dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_margin="10dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:src="@drawable/pb_button_stream"/>-->'))
|
|
|
+ if "secure_folder" in l_features:
|
|
|
+ f.write(indented_str(1, "<ImageView"))
|
|
|
+ f.write(indented_str(2, 'android:id="@+id/btn_sf"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_height="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_width="100dp"'))
|
|
|
+ f.write(indented_str(2, 'android:layout_margin="10dp"'))
|
|
|
+ f.write(indented_str(2, 'android:src="@drawable/pb_button_secure_folder"/>'))
|
|
|
+ else:
|
|
|
+ f.write(indented_str(1, "<!--<ImageView-->"))
|
|
|
+ f.write(indented_str(2, '<!--android:id="@+id/btn_sf"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_height="100dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_width="100dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:layout_margin="10dp"-->'))
|
|
|
+ f.write(indented_str(2, '<!--android:src="@drawable/pb_button_secure_folder"/>-->'))
|
|
|
+ else:
|
|
|
+ f.write(line)
|
|
|
write_android_manifest(manifest_path, features, security)
|
|
|
elif platform == "android_flutter":
|
|
|
main_act_path = os.path.join(path_dest, "lib/main.dart")
|
|
|
- main_act_android = os.path.join(path_dest, "android/app/src/main/java/com/example/paliolitesamplecodeflutter/MainActivity.java")
|
|
|
+ main_act_android = os.path.join(path_dest,
|
|
|
+ "android/app/src/main/java/com/example/paliolitesamplecodeflutter/MainActivity.java")
|
|
|
manifest_path = os.path.join(path_dest, "android/app/src/main/AndroidManifest.xml")
|
|
|
with open(main_act_path, "r") as f:
|
|
|
lines = f.readlines()
|
|
@@ -608,7 +845,8 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
'// fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));'))
|
|
|
if security["secure_folder"]:
|
|
|
f.write(
|
|
|
- indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));'))
|
|
|
+ indented_str(6,
|
|
|
+ 'fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));'))
|
|
|
else:
|
|
|
f.write(indented_str(6,
|
|
|
'// fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));'))
|
|
@@ -627,8 +865,9 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
f.write(line)
|
|
|
write_android_manifest(manifest_path, features, security)
|
|
|
elif platform == "android_ionic":
|
|
|
- main_act_path = os.path.join(path_dest,"src/app/app.component.ts")
|
|
|
- main_act_android = os.path.join(path_dest, "android/app/src/main/java/com/example/nexilissamplecodeionic/MainActivity.java")
|
|
|
+ main_act_path = os.path.join(path_dest, "src/app/app.component.ts")
|
|
|
+ main_act_android = os.path.join(path_dest,
|
|
|
+ "android/app/src/main/java/com/example/nexilissamplecodeionic/MainActivity.java")
|
|
|
manifest_path = os.path.join(path_dest, "android/app/src/main/AndroidManifest.xml")
|
|
|
with open(main_act_path, "r") as f:
|
|
|
lines = f.readlines()
|
|
@@ -818,41 +1057,53 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
f.write(indented_str(6, "ArrayList<FloatingButton> fb = new ArrayList<>();", spaces=2))
|
|
|
if features["cc"]["status"]:
|
|
|
f.write(indented_str(6,
|
|
|
- 'fb.add(new FloatingButton(FloatingButton.FEATURE.CONTACT_CENTER, ""));', spaces=2))
|
|
|
+ 'fb.add(new FloatingButton(FloatingButton.FEATURE.CONTACT_CENTER, ""));',
|
|
|
+ spaces=2))
|
|
|
else:
|
|
|
f.write(indented_str(6,
|
|
|
- '// fb.add(new FloatingButton(FloatingButton.FEATURE.CONTACT_CENTER, ""));', spaces=2))
|
|
|
+ '// fb.add(new FloatingButton(FloatingButton.FEATURE.CONTACT_CENTER, ""));',
|
|
|
+ spaces=2))
|
|
|
if features["nc"]["status"]:
|
|
|
f.write(
|
|
|
- indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.NOTIF_CENTER, ""));', spaces=2))
|
|
|
+ indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.NOTIF_CENTER, ""));',
|
|
|
+ spaces=2))
|
|
|
else:
|
|
|
f.write(indented_str(6,
|
|
|
- '// fb.add(new FloatingButton(FloatingButton.FEATURE.NOTIF_CENTER, ""));', spaces=2))
|
|
|
+ '// fb.add(new FloatingButton(FloatingButton.FEATURE.NOTIF_CENTER, ""));',
|
|
|
+ spaces=2))
|
|
|
if features["im"]["status"]:
|
|
|
f.write(
|
|
|
- indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.MESSAGING, ""));', spaces=2))
|
|
|
+ indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.MESSAGING, ""));',
|
|
|
+ spaces=2))
|
|
|
else:
|
|
|
f.write(indented_str(6,
|
|
|
- '// fb.add(new FloatingButton(FloatingButton.FEATURE.MESSAGING, ""));', spaces=2))
|
|
|
+ '// fb.add(new FloatingButton(FloatingButton.FEATURE.MESSAGING, ""));',
|
|
|
+ spaces=2))
|
|
|
if features["call"]["status"]:
|
|
|
f.write(
|
|
|
indented_str(6,
|
|
|
- 'fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_VIDEO_CALL, ""));', spaces=2))
|
|
|
+ 'fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_VIDEO_CALL, ""));',
|
|
|
+ spaces=2))
|
|
|
else:
|
|
|
f.write(indented_str(6,
|
|
|
- '// fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_VIDEO_CALL, ""));', spaces=2))
|
|
|
+ '// fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_VIDEO_CALL, ""));',
|
|
|
+ spaces=2))
|
|
|
if features["ls"]["status"]:
|
|
|
f.write(
|
|
|
- indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));', spaces=2))
|
|
|
+ indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));',
|
|
|
+ spaces=2))
|
|
|
else:
|
|
|
f.write(indented_str(6,
|
|
|
- '// fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));', spaces=2))
|
|
|
+ '// fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));',
|
|
|
+ spaces=2))
|
|
|
if security["secure_folder"]:
|
|
|
f.write(
|
|
|
- indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));', spaces=2))
|
|
|
+ indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));',
|
|
|
+ spaces=2))
|
|
|
else:
|
|
|
f.write(indented_str(6,
|
|
|
- '// fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));', spaces=2))
|
|
|
+ '// fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));',
|
|
|
+ spaces=2))
|
|
|
f.write(indented_str(6,
|
|
|
'API.configureFloating(fb);', spaces=2))
|
|
|
else:
|
|
@@ -869,7 +1120,8 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
write_android_manifest(manifest_path, features, security)
|
|
|
elif platform == "android_react":
|
|
|
main_act_path = os.path.join(path_dest, "App.tsx")
|
|
|
- main_act_android = os.path.join(path_dest, "android/app/src/main/java/com/paliolitesamplecode/MainActivity.java")
|
|
|
+ main_act_android = os.path.join(path_dest,
|
|
|
+ "android/app/src/main/java/com/paliolitesamplecode/MainActivity.java")
|
|
|
manifest_path = os.path.join(path_dest, "android/app/src/main/AndroidManifest.xml")
|
|
|
with open(main_act_path, "r") as f:
|
|
|
lines = f.readlines()
|
|
@@ -1282,7 +1534,8 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
'// fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));'))
|
|
|
if security["secure_folder"]:
|
|
|
f.write(
|
|
|
- indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));'))
|
|
|
+ indented_str(6,
|
|
|
+ 'fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));'))
|
|
|
else:
|
|
|
f.write(indented_str(6,
|
|
|
'// fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));'))
|
|
@@ -1326,7 +1579,8 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
f.write(indented_str(4, "APIS.openNotificationCenter();"))
|
|
|
f.write(indented_str(3, "}),"))
|
|
|
else:
|
|
|
- f.write(indented_str(3, '// UIAction(title: "Notification Center".localized(), handler: {(_) in'))
|
|
|
+ f.write(
|
|
|
+ indented_str(3, '// UIAction(title: "Notification Center".localized(), handler: {(_) in'))
|
|
|
f.write(indented_str(4, "// APIS.openNotificationCenter();"))
|
|
|
f.write(indented_str(3, "// }),"))
|
|
|
if features["im"]["status"]:
|
|
@@ -1362,19 +1616,20 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
if features["nc"]["status"]:
|
|
|
f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_NOTIF_CENTER)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_NOTIF_CENTER)'))
|
|
|
+ f.write(
|
|
|
+ indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_NOTIF_CENTER)'))
|
|
|
if features["im"]["status"]:
|
|
|
f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_CHAT)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2,'// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CHAT)'))
|
|
|
+ f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CHAT)'))
|
|
|
if features["call"]["status"]:
|
|
|
- f.write(indented_str(2,'Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
+ f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2,'// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
+ f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
if features["ls"]["status"]:
|
|
|
f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_STREAM)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2,'// Nexilis.defaultFloatingButton.append(Nexilis.IDX_STREAM)'))
|
|
|
+ f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_STREAM)'))
|
|
|
else:
|
|
|
f.write(indented_str(0, ""))
|
|
|
elif "APIS.connect" in line:
|
|
@@ -1480,19 +1735,20 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
if features["nc"]["status"]:
|
|
|
f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_NOTIF_CENTER)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_NOTIF_CENTER)'))
|
|
|
+ f.write(
|
|
|
+ indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_NOTIF_CENTER)'))
|
|
|
if features["im"]["status"]:
|
|
|
f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_CHAT)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2,'// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CHAT)'))
|
|
|
+ f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CHAT)'))
|
|
|
if features["call"]["status"]:
|
|
|
- f.write(indented_str(2,'Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
+ f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2,'// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
+ f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
if features["ls"]["status"]:
|
|
|
f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_STREAM)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2,'// Nexilis.defaultFloatingButton.append(Nexilis.IDX_STREAM)'))
|
|
|
+ f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_STREAM)'))
|
|
|
else:
|
|
|
f.write(indented_str(0, ""))
|
|
|
elif "APIS.connect" in line:
|
|
@@ -1608,19 +1864,20 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
if features["nc"]["status"]:
|
|
|
f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_NOTIF_CENTER)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_NOTIF_CENTER)'))
|
|
|
+ f.write(
|
|
|
+ indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_NOTIF_CENTER)'))
|
|
|
if features["im"]["status"]:
|
|
|
f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_CHAT)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2,'// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CHAT)'))
|
|
|
+ f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CHAT)'))
|
|
|
if features["call"]["status"]:
|
|
|
- f.write(indented_str(2,'Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
+ f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2,'// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
+ f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
if features["ls"]["status"]:
|
|
|
f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_STREAM)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2,'// Nexilis.defaultFloatingButton.append(Nexilis.IDX_STREAM)'))
|
|
|
+ f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_STREAM)'))
|
|
|
else:
|
|
|
f.write(indented_str(0, ""))
|
|
|
elif "APIS.connect" in line:
|
|
@@ -1901,19 +2158,20 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
if features["nc"]["status"]:
|
|
|
f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_NOTIF_CENTER)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_NOTIF_CENTER)'))
|
|
|
+ f.write(
|
|
|
+ indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_NOTIF_CENTER)'))
|
|
|
if features["im"]["status"]:
|
|
|
f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_CHAT)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2,'// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CHAT)'))
|
|
|
+ f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CHAT)'))
|
|
|
if features["call"]["status"]:
|
|
|
- f.write(indented_str(2,'Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
+ f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2,'// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
+ f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_CALL)'))
|
|
|
if features["ls"]["status"]:
|
|
|
f.write(indented_str(2, 'Nexilis.defaultFloatingButton.append(Nexilis.IDX_STREAM)'))
|
|
|
else:
|
|
|
- f.write(indented_str(2,'// Nexilis.defaultFloatingButton.append(Nexilis.IDX_STREAM)'))
|
|
|
+ f.write(indented_str(2, '// Nexilis.defaultFloatingButton.append(Nexilis.IDX_STREAM)'))
|
|
|
else:
|
|
|
f.write(indented_str(0, ""))
|
|
|
elif "APIS.connect" in line:
|
|
@@ -1925,6 +2183,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
|
|
|
else:
|
|
|
f.write(line)
|
|
|
|
|
|
+
|
|
|
def deliver_zip(path_dest, uid):
|
|
|
rand_name = ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(32))
|
|
|
zip_name = f"{rand_name}"
|
|
@@ -1958,9 +2217,6 @@ def build_project():
|
|
|
"ls": {
|
|
|
"status": False
|
|
|
},
|
|
|
- "settings": {
|
|
|
- "status": False
|
|
|
- },
|
|
|
"nc": {
|
|
|
"status": False
|
|
|
},
|