tama vor 11 Monaten
Ursprung
Commit
df2f469741

+ 3 - 2
NexilisSampleCode/app/src/main/java/com/example/nexilissamplecodeburger/MainActivity.java

@@ -11,11 +11,12 @@ import android.webkit.WebSettings;
 import android.webkit.WebView;
 import android.widget.ImageView;
 import android.widget.Toast;
-import io.nexilis.service.Callback;
 import io.nexilis.service.API;
+import io.nexilis.service.Callback;
+import io.nexilis.service.utils.callback.GeneralCallback;
 import io.nexilis.service.utils.callback.SimCardDetectionCallback;
 import io.nexilis.service.utils.xthunder.FloatingButton;
-import io.nexilis.service.utils.callback.GeneralCallback;
+import io.nexilis.service.utils.xthunder.FloatingButtonVar;
 
 public class MainActivity extends AppCompatActivity {
 

+ 164 - 192
main.py

@@ -87,6 +87,97 @@ def write_android_manifest(manifest_path: str, features: dict, security: dict):
             else:
                 f.write(line)
 
+def write_floating_button(f, features: dict, security: dict, spaces=4):
+    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, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.CONTACT_CENTER, ""));', spaces))
+    if features["cc_chat"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_CHAT));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_CHAT));', spaces))
+    if features["cc_voip"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_AC));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_AC));', spaces))
+    if features["cc_vidcall"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_VC));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_VC));', spaces))
+    if features["cc_email"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_EMAIL));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_EMAIL));', spaces))
+    if features["cc_sms"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_SMS));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_SMS));', spaces))
+    if features["cc_gsm"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_GCALL));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_GCALL));', spaces))
+    if features["cc_whatsapp"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_WA));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_WA));', spaces))
+    if features["cc_smartbot"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_CHATBOT));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton("", FloatingButtonVar.CC_SUB_CHATBOT));', spaces))
+    if features["nc"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.NOTIF_CENTER, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.NOTIF_CENTER, ""));', spaces))
+    if features["im"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.MESSAGING, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.MESSAGING, ""));', spaces))
+    if features["ac"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_CALL, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_CALL, ""));', spaces))
+    if features["vc"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.VIDEO_CALL, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.VIDEO_CALL, ""));', spaces))
+    if features["call"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_VIDEO_CALL, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_VIDEO_CALL, ""));', spaces))
+    if features["ls"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));', spaces))
+    if security["secure_folder"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));', spaces))
+    if features["conpost"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.POST, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.POST, ""));', spaces))
+    if features["ppob"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.PPOB, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.PPOB, ""));', spaces))
+    if features["wallet"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.WALLET, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.WALLET, ""));', spaces))
+    if features["social_commerce"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.SOCIAL_COMMERCE, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.SOCIAL_COMMERCE, ""));', spaces))
+    if features["news_update"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.NEWS, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.NEWS, ""));', spaces))
+    if features["contact_list"]["status"]:
+        f.write(indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.CONTACT_LIST, ""));', spaces))
+    else:
+        f.write(indented_str(6, '// fb.add(new FloatingButton(FloatingButton.FEATURE.CONTACT_LIST, ""));', spaces))
+    f.write(indented_str(6, 'API.configureFloating(fb);', spaces))
 
 def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict, security: dict):
     if platform == "android":
@@ -344,7 +435,7 @@ 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:
+                elif "//GRID" in line and mode == "grid":
                     f.write(indented_str(2, "API.setGeneralCallback(new GeneralCallback() {"))
                     f.write(indented_str(3, "@Override"))
                     f.write(
@@ -583,47 +674,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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, ""));'))
-                        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, ""));'))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// fb.add(new FloatingButton(FloatingButton.FEATURE.NOTIF_CENTER, ""));'))
-                        if features["im"]["status"]:
-                            f.write(
-                                indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.MESSAGING, ""));'))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// 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, ""));'))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_VIDEO_CALL, ""));'))
-                        if features["ls"]["status"]:
-                            f.write(
-                                indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));'))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));'))
-                        if security["secure_folder"]:
-                            f.write(
-                                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, ""));'))
-                        f.write(indented_str(6,
-                                             'API.configureFloating(fb);'))
+                        write_floating_button(f, features, security)
                     else:
                         f.write(indented_str(0, ""))
                 elif "API.connect" in line:
@@ -899,6 +950,8 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                 elif "columnCount" in line:
                     f.write(indented_str(1,f'android:columnCount="{column_count}"'))
                 elif "<!-- FEATURES -->" in line:
+                    if mode != "grid":
+                        f.write(indented_str(1, "<!--"))
                     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"'))
@@ -911,7 +964,9 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                     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:
+                    if mode != "grid":
+                        f.write(indented_str(1, "-->"))
+                    if mode == "grid" and "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"'))
@@ -925,7 +980,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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:
+                    if mode == "grid" and "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"'))
@@ -939,7 +994,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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:
+                    if mode == "grid" and "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"'))
@@ -953,7 +1008,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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 "ac" in l_features:
+                    if mode == "grid" and "ac" in l_features:
                         f.write(indented_str(1, "<ImageView"))
                         f.write(indented_str(2, 'android:id="@+id/btn_audio_call"'))
                         f.write(indented_str(2, 'android:layout_height="100dp"'))
@@ -967,7 +1022,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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_audio_call"/>-->'))
-                    if "vc" in l_features:
+                    if mode == "grid" and "vc" in l_features:
                         f.write(indented_str(1, "<ImageView"))
                         f.write(indented_str(2, 'android:id="@+id/btn_video_call"'))
                         f.write(indented_str(2, 'android:layout_height="100dp"'))
@@ -981,7 +1036,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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_video_call"/>-->'))
-                    if "call" in l_features:
+                    if mode == "grid" and "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"'))
@@ -995,7 +1050,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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:
+                    if mode == "grid" and "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"'))
@@ -1009,7 +1064,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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:
+                    if mode == "grid" and "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"'))
@@ -1023,7 +1078,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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"/>-->'))
-                    if "custom_url" in l_features:
+                    if mode == "grid" and "custom_url" in l_features:
                         f.write(indented_str(1, "<ImageView"))
                         f.write(indented_str(2, 'android:id="@+id/btn_custom_url"'))
                         f.write(indented_str(2, 'android:layout_height="100dp"'))
@@ -1037,7 +1092,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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_custom_url"/>-->'))
-                    if "xapps" in l_features:
+                    if mode == "grid" and "xapps" in l_features:
                         f.write(indented_str(1, "<ImageView"))
                         f.write(indented_str(2, 'android:id="@+id/btn_xapps"'))
                         f.write(indented_str(2, 'android:layout_height="100dp"'))
@@ -1051,7 +1106,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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_external_apps"/>-->'))
-                    if "conpost" in l_features:
+                    if mode == "grid" and "conpost" in l_features:
                         f.write(indented_str(1, "<ImageView"))
                         f.write(indented_str(2, 'android:id="@+id/btn_contentpost"'))
                         f.write(indented_str(2, 'android:layout_height="100dp"'))
@@ -1065,7 +1120,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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_user_content"/>-->'))
-                    if "ppob" in l_features:
+                    if mode == "grid" and "ppob" in l_features:
                         f.write(indented_str(1, "<ImageView"))
                         f.write(indented_str(2, 'android:id="@+id/btn_ppob"'))
                         f.write(indented_str(2, 'android:layout_height="100dp"'))
@@ -1079,7 +1134,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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_ppob"/>-->'))
-                    if "wallet" in l_features:
+                    if mode == "grid" and "wallet" in l_features:
                         f.write(indented_str(1, "<ImageView"))
                         f.write(indented_str(2, 'android:id="@+id/btn_wallet"'))
                         f.write(indented_str(2, 'android:layout_height="100dp"'))
@@ -1093,7 +1148,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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_wallet"/>-->'))
-                    if "social_commerce" in l_features:
+                    if mode == "grid" and "social_commerce" in l_features:
                         f.write(indented_str(1, "<ImageView"))
                         f.write(indented_str(2, 'android:id="@+id/btn_social_commerce"'))
                         f.write(indented_str(2, 'android:layout_height="100dp"'))
@@ -1107,7 +1162,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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_social_commerce"/>-->'))
-                    if "news_update" in l_features:
+                    if mode == "grid" and "news_update" in l_features:
                         f.write(indented_str(1, "<ImageView"))
                         f.write(indented_str(2, 'android:id="@+id/btn_news"'))
                         f.write(indented_str(2, 'android:layout_height="100dp"'))
@@ -1121,7 +1176,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         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_news"/>-->'))
-                    if "contact_list" in l_features:
+                    if mode == "grid" and "contact_list" in l_features:
                         f.write(indented_str(1, "<ImageView"))
                         f.write(indented_str(2, 'android:id="@+id/btn_contact_list"'))
                         f.write(indented_str(2, 'android:layout_height="100dp"'))
@@ -1316,47 +1371,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         f.write(indented_str(2, "// API.setEnabledSmartBot(true);"))
                 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, ""));'))
-                        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, ""));'))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// fb.add(new FloatingButton(FloatingButton.FEATURE.NOTIF_CENTER, ""));'))
-                        if features["im"]["status"]:
-                            f.write(
-                                indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.MESSAGING, ""));'))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// 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, ""));'))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_VIDEO_CALL, ""));'))
-                        if features["ls"]["status"]:
-                            f.write(
-                                indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));'))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));'))
-                        if security["secure_folder"]:
-                            f.write(
-                                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, ""));'))
-                        f.write(indented_str(6,
-                                             'API.configureFloating(fb);'))
+                        write_floating_button(f, features, security)
                     else:
                         f.write(indented_str(0, ""))
                 elif "API.connect" in line:
@@ -1559,58 +1574,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         f.write(indented_str(2, "// API.setEnabledSmartBot(true);"))
                 elif "//FLOATING" in line:
                     if mode == "floating":
-                        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))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// 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))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// 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))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// 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))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// 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))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// 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))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// fb.add(new FloatingButton(FloatingButton.FEATURE.SECURE_FOLDER, ""));',
-                                                 spaces=2))
-                        f.write(indented_str(6,
-                                             'API.configureFloating(fb);', spaces=2))
+                        write_floating_button(f, features, security, spaces=2)
                     else:
                         f.write(indented_str(0, "", spaces=2))
                 elif "API.connect" in line:
@@ -2005,47 +1969,7 @@ def change(app_id: str, platform: str, mode: str, path_dest: str, features: dict
                         f.write(indented_str(2, "// API.setEnabledSmartBot(true);"))
                 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, ""));'))
-                        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, ""));'))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// fb.add(new FloatingButton(FloatingButton.FEATURE.NOTIF_CENTER, ""));'))
-                        if features["im"]["status"]:
-                            f.write(
-                                indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.MESSAGING, ""));'))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// 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, ""));'))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// fb.add(new FloatingButton(FloatingButton.FEATURE.AUDIO_VIDEO_CALL, ""));'))
-                        if features["ls"]["status"]:
-                            f.write(
-                                indented_str(6, 'fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));'))
-                        else:
-                            f.write(indented_str(6,
-                                                 '// fb.add(new FloatingButton(FloatingButton.FEATURE.STREAMING, ""));'))
-                        if security["secure_folder"]:
-                            f.write(
-                                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, ""));'))
-                        f.write(indented_str(6,
-                                             'API.configureFloating(fb);'))
+                        write_floating_button(f, features, security)
                     else:
                         f.write(indented_str(0, ""))
                 elif "API.connect" in line:
@@ -2841,6 +2765,38 @@ def build_project():
             "secure_folder": {
                 "status": False,
                 "icon": None
+            },
+            "cc_chat": {
+                "status": False,
+                "icon": None
+            },
+            "cc_voip": {
+                "status": False,
+                "icon": None
+            },
+            "cc_vidcall": {
+                "status": False,
+                "icon": None
+            },
+            "cc_smartbot": {
+                "status": False,
+                "icon": None
+            },
+            "cc_email": {
+                "status": False,
+                "icon": None
+            },
+            "cc_sms": {
+                "status": False,
+                "icon": None
+            },
+            "cc_gsm": {
+                "status": False,
+                "icon": None
+            },
+            "cc_whatsapp": {
+                "status": False,
+                "icon": None
             }
         }
         security_dict = {
@@ -2897,6 +2853,22 @@ def build_project():
                 feature_dict["news_update"]["status"] = request.form["news_update"] == "1"
             if "feature_contact_list" in request.form:
                 feature_dict["contact_list"]["status"] = request.form["contact_list"] == "1"
+            if "feature_cc_chat" in request.form:
+                feature_dict["cc_chat"]["status"] = request.form["feature_cc_chat"] == "1"
+            if "feature_cc_voip" in request.form:
+                feature_dict["cc_voip"]["status"] = request.form["feature_cc_voip"] == "1"
+            if "feature_cc_vidcall" in request.form:
+                feature_dict["cc_vidcall"]["status"] = request.form["feature_cc_vidcall"] == "1"
+            if "feature_cc_smartbot" in request.form:
+                feature_dict["cc_smartbot"]["status"] = request.form["feature_cc_smartbot"] == "1"
+            if "feature_cc_email" in request.form:
+                feature_dict["cc_email"]["status"] = request.form["feature_cc_email"] == "1"
+            if "feature_cc_sms" in request.form:
+                feature_dict["cc_sms"]["status"] = request.form["feature_cc_sms"] == "1"
+            if "feature_cc_gsm" in request.form:
+                feature_dict["cc_gsm"]["status"] = request.form["feature_cc_gsm"] == "1"
+            if "feature_cc_whatsapp" in request.form:
+                feature_dict["cc_whatsapp"]["status"] = request.form["feature_cc_whatsapp"] == "1"
             
             if "security_malware" in request.form:
                 security_dict["malware"] = request.form["security_malware"] == "1"