Bläddra i källkod

Merge branch 'master' of http://192.168.0.2:3000/kevin/EmbedFeatures

yayan 1 år sedan
förälder
incheckning
d5df7c33fd

+ 6 - 0
.gitignore

@@ -43,3 +43,9 @@ app.*.map.json
 /android/app/debug
 /android/app/profile
 /android/app/release
+
+/NXCode/
+/uploads/
+**/.gradle/
+**/local.properties
+

+ 5 - 0
NexilisSampleCodeIonic-Android/android/app/src/main/java/com/example/paliolitesamplecodeionic/NativePlugin.java

@@ -64,6 +64,11 @@ public class NativePlugin extends Plugin {
     API.openSettings();
   }
 
+  @PluginMethod
+  public void openProfile(PluginCall call) {
+    API.openProfile();
+  }
+
   @PluginMethod
   public void openContactCenterChat(PluginCall call) {
     int category = call.getInt("category", 0);

+ 1 - 0
NexilisSampleCodeIonic-Android/ios/App/App/NativeCap.m

@@ -20,4 +20,5 @@ CAP_PLUGIN(NativeCap, "NativeCap",
            CAP_PLUGIN_METHOD(adminSignIn, CAPPluginReturnPromise);
            CAP_PLUGIN_METHOD(openScreenSharing, CAPPluginReturnPromise);
            CAP_PLUGIN_METHOD(openWhiteboard, CAPPluginReturnPromise);
+           CAP_PLUGIN_METHOD(openProfile, CAPPluginReturnPromise);
            )

+ 5 - 0
NexilisSampleCodeIonic-Android/ios/App/App/NativeCap.swift

@@ -41,6 +41,11 @@ public class NativeCap: CAPPlugin {
             APIS.openSetting()
         }
     }
+    @objc func openProfile(_ call: CAPPluginCall) {
+        DispatchQueue.main.async {
+            APIS.openProfile()
+        }
+    }
     @objc func openContactCenterChat(_ call: CAPPluginCall) {
         let media = 0
         let category = call.options["category"]

+ 1 - 0
NexilisSampleCodeIonic-Android/src/app/Native.ts

@@ -13,6 +13,7 @@ export interface NativePlugin {
   adminSignIn({pwd}:any): Promise<{response:string}>;
   openChatGPT(): Promise<{response:string}>;
   openSettings(): Promise<{}>;
+  openProfile(): Promise<{}>;
 }
 
 const native_plugin = registerPlugin<NativePlugin>("NativeCap");

+ 4 - 0
NexilisSampleCodeIonic-Android/src/app/app.component.ts

@@ -47,6 +47,10 @@ export class AppComponent {
     await native_plugin.openSettings();
   }
 
+  async openProfile() {
+    await native_plugin.openProfile();
+  }
+
   async openWhiteboard() {
     let result = await native_plugin.openWhiteboard();
     console.log(result);

+ 5 - 0
NexilisSampleCodeIonic-iOS/android/app/src/main/java/com/example/paliolitesamplecodeionic/NativePlugin.java

@@ -64,6 +64,11 @@ public class NativePlugin extends Plugin {
     API.openSettings();
   }
 
+  @PluginMethod
+  public void openProfile(PluginCall call) {
+    API.openProfile();
+  }
+
   @PluginMethod
   public void openContactCenterChat(PluginCall call) {
     int category = call.getInt("category", 0);

+ 1 - 0
NexilisSampleCodeIonic-iOS/ios/App/App/NativeCap.m

@@ -20,4 +20,5 @@ CAP_PLUGIN(NativeCap, "NativeCap",
            CAP_PLUGIN_METHOD(adminSignIn, CAPPluginReturnPromise);
            CAP_PLUGIN_METHOD(openScreenSharing, CAPPluginReturnPromise);
            CAP_PLUGIN_METHOD(openWhiteboard, CAPPluginReturnPromise);
+           CAP_PLUGIN_METHOD(openProfile, CAPPluginReturnPromise);
            )

+ 5 - 0
NexilisSampleCodeIonic-iOS/ios/App/App/NativeCap.swift

@@ -41,6 +41,11 @@ public class NativeCap: CAPPlugin {
             APIS.openSetting()
         }
     }
+    @objc func openProfile(_ call: CAPPluginCall) {
+        DispatchQueue.main.async {
+            APIS.openProfile()
+        }
+    }
     @objc func openContactCenterChat(_ call: CAPPluginCall) {
         let media = 0
         let category = call.options["category"]

+ 1 - 0
NexilisSampleCodeIonic-iOS/src/app/Native.ts

@@ -13,6 +13,7 @@ export interface NativePlugin {
   adminSignIn({pwd}:any): Promise<{response:string}>;
   openChatGPT(): Promise<{response:string}>;
   openSettings(): Promise<{}>;
+  openProfile(): Promise<{}>;
 }
 
 const native_plugin = registerPlugin<NativePlugin>("NativeCap");

+ 4 - 0
NexilisSampleCodeIonic-iOS/src/app/app.component.ts

@@ -47,6 +47,10 @@ export class AppComponent {
     await native_plugin.openSettings();
   }
 
+  async openProfile() {
+    await native_plugin.openProfile();
+  }
+
   async openWhiteboard() {
     let result = await native_plugin.openWhiteboard();
     console.log(result);

+ 93 - 26
main.py

@@ -118,6 +118,16 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                         f.write(indented_str(3, "// API.openOptionsStreaming();"))
                         f.write(indented_str(3, "// return true;"))
                         f.write(indented_str(2, "// }"))
+                    if security["secure_folder"]:
+                        f.write(indented_str(2, "if (id == R.id.action_sf) {"))
+                        f.write(indented_str(3, "API.openSecureFolder();"))
+                        f.write(indented_str(3, "return true;"))
+                        f.write(indented_str(2, "}"))
+                    else:
+                        f.write(indented_str(2, "// if (id == R.id.action_sf) {"))
+                        f.write(indented_str(3, "// API.openSecureFolder();"))
+                        f.write(indented_str(3, "// return true;"))
+                        f.write(indented_str(2, "// }"))
                 elif "//SECURITY" in line:
                     if security["show_security"]:
                         f.write(indented_str(2, "API.setShowSecurityShieldDialog(true);"))
@@ -182,12 +192,6 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                     else:
                         f.write(indented_str(2, "// API.setCheckCallForwarding(true);"))
                         f.write(os.linesep)
-                    if security["secure_folder"]:
-                        f.write(indented_str(2, "API.openSecureFolder();"))
-                        f.write(os.linesep)
-                    else:
-                        f.write(indented_str(2, "// API.openSecureFolder();"))
-                        f.write(os.linesep)
                 elif "//SMS" in line:
                     if features["sms"]["status"]:
                         f.write(indented_str(2, "API.setEnabledSMS(true);"))
@@ -340,6 +344,20 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                         f.write(indented_str(2, 'android:title="Streaming"'))
                         f.write(indented_str(2, 'app:showAsAction="never" /> -->'))
                         n = n + 1
+                    if security["secure_folder"]:
+                        f.write(indented_str(1, "<item"))
+                        f.write(indented_str(2, 'android:id="@+id/action_sf"'))
+                        f.write(indented_str(2, f'android:orderInCategory="{n}"'))
+                        f.write(indented_str(2, 'android:title="Secure Folder"'))
+                        f.write(indented_str(2, 'app:showAsAction="never" />'))
+                        n = n + 1
+                    else:
+                        f.write(indented_str(1, "<!-- <item"))
+                        f.write(indented_str(2, 'android:id="@+id/action_sf"'))
+                        f.write(indented_str(2, f'android:orderInCategory="{n}"'))
+                        f.write(indented_str(2, 'android:title="Secure Folder"'))
+                        f.write(indented_str(2, 'app:showAsAction="never" /> -->'))
+                        n = n + 1
                 else:
                     f.write(line)
     elif platform == "android_flutter":
@@ -373,6 +391,10 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                         features_str.append("'Streaming'")
                     else:
                         features_str.append("// 'Streaming'")
+                    if security["secure_folder"]:
+                        features_str.append("'Secure Folder'")
+                    else:
+                        features_str.append("// 'Secure Folder'")
                     for feature_str in features_str:
                         f.write(indented_str(8, f"{feature_str},", spaces=2))
                 elif "//FEATURES" in line:
@@ -422,6 +444,14 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                         f.write(indented_str(3, '// case "Streaming":', spaces=2))
                         f.write(indented_str(4, '// nativeChannel.invokeMethod("openStreaming");', spaces=2))
                         f.write(indented_str(4, "// break;", spaces=2))
+                    if security["secure_folder"]:
+                        f.write(indented_str(3, 'case "Secure Folder":', spaces=2))
+                        f.write(indented_str(4, 'nativeChannel.invokeMethod("openSecureFolder");', spaces=2))
+                        f.write(indented_str(4, "break;", spaces=2))
+                    else:
+                        f.write(indented_str(3, '// case "Secure Folder":', spaces=2))
+                        f.write(indented_str(4, '// nativeChannel.invokeMethod("openSecureFolder");', spaces=2))
+                        f.write(indented_str(4, "// break;", spaces=2))
                 else:
                     f.write(line)
         with open(main_act_android, "r") as f:
@@ -492,12 +522,6 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                     else:
                         f.write(indented_str(2, "// API.setCheckCallForwarding(true);"))
                         f.write(os.linesep)
-                    if security["secure_folder"]:
-                        f.write(indented_str(2, "API.openSecureFolder();"))
-                        f.write(os.linesep)
-                    else:
-                        f.write(indented_str(2, "// API.openSecureFolder();"))
-                        f.write(os.linesep)
                 elif "//SMS" in line:
                     if features["sms"]["status"]:
                         f.write(indented_str(2, "API.setEnabledSMS(true);"))
@@ -649,6 +673,20 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                         f.write(indented_str(6, "// this.openStreaming();", spaces=2))
                         f.write(indented_str(5, "// },", spaces=2))
                         f.write(indented_str(4, "// },", spaces=2))
+                    if security["secure_folder"]:
+                        f.write(indented_str(4, '{', spaces=2))
+                        f.write(indented_str(5, "text: 'Secure Folder',", spaces=2))
+                        f.write(indented_str(5, "handler: () => {", spaces=2))
+                        f.write(indented_str(6, "this.openSecureFolder();", spaces=2))
+                        f.write(indented_str(5, "},", spaces=2))
+                        f.write(indented_str(4, "},", spaces=2))
+                    else:
+                        f.write(indented_str(4, '// {', spaces=2))
+                        f.write(indented_str(5, "// text: 'Secure Folder',", spaces=2))
+                        f.write(indented_str(5, "// handler: () => {", spaces=2))
+                        f.write(indented_str(6, "// this.openSecureFolder();", spaces=2))
+                        f.write(indented_str(5, "// },", spaces=2))
+                        f.write(indented_str(4, "// },", spaces=2))
                 else:
                     f.write(line)
         with open(main_act_android, "r") as f:
@@ -719,12 +757,6 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                     else:
                         f.write(indented_str(2, "// API.setCheckCallForwarding(true);", spaces=2))
                         f.write(os.linesep)
-                    if security["secure_folder"]:
-                        f.write(indented_str(2, "API.openSecureFolder();", spaces=2))
-                        f.write(os.linesep)
-                    else:
-                        f.write(indented_str(2, "// API.openSecureFolder();", spaces=2))
-                        f.write(os.linesep)
                 elif "//SMS" in line:
                     if features["sms"]["status"]:
                         f.write(indented_str(2, "API.setEnabledSMS(true);", spaces=2))
@@ -816,6 +848,10 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                         f.write(indented_str(4, "'Live Streaming',", spaces=2))
                     else:
                         f.write(indented_str(4, "// 'Live Streaming',", spaces=2))
+                    if security["secure_folder"]:
+                        f.write(indented_str(4, "'Secure Folder',", spaces=2))
+                    else:
+                        f.write(indented_str(4, "// 'Secure Folder',", spaces=2))
                 elif "//FEATURES1" in line:
                     n = 0
                     f.write(indented_str(5, f"if (buttonIndex === {n}) {{", spaces=2))
@@ -871,6 +907,15 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                         f.write(indented_str(5, "// if (buttonIndex === 6) {", spaces=2))
                         f.write(indented_str(6, "// CallNative.openStreaming();", spaces=2))
                         f.write(indented_str(5, "// }", spaces=2))
+                    if security["secure_folder"]:
+                        f.write(indented_str(5, f"if (buttonIndex === {n}) {{", spaces=2))
+                        f.write(indented_str(6, "CallNative.openSecureFolder();", spaces=2))
+                        f.write(indented_str(5, "}", spaces=2))
+                        n = n + 1
+                    else:
+                        f.write(indented_str(5, "// if (buttonIndex === 7) {", spaces=2))
+                        f.write(indented_str(6, "// CallNative.openSecureFolder();", spaces=2))
+                        f.write(indented_str(5, "// }", spaces=2))
                 elif "//FEATURES2" in line:
                     n = 0
                     f.write(indented_str(2, f"if (buttonIndex === {n}) {{", spaces=2))
@@ -967,13 +1012,30 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                         f.write(indented_str(2, "}", spaces=2))
                         n = n + 1
                     else:
-                        f.write(indented_str(2, "// if (buttonIndex === {n}) {", spaces=2))
+                        f.write(indented_str(2, "// if (buttonIndex === 6) {", spaces=2))
                         f.write(indented_str(3, "// try {", spaces=2))
                         f.write(indented_str(4, "// CallNative.openStreaming();", spaces=2))
                         f.write(indented_str(3, "// } catch (e) {", spaces=2))
                         f.write(indented_str(4, "// console.log(e);", spaces=2))
                         f.write(indented_str(3, "// }", spaces=2))
                         f.write(indented_str(2, "// }", spaces=2))
+                    if security["secure_folder"]:
+                        f.write(indented_str(2, f"if (buttonIndex === {n}) {{", spaces=2))
+                        f.write(indented_str(3, "try {", spaces=2))
+                        f.write(indented_str(4, "CallNative.openSecureFolder();", spaces=2))
+                        f.write(indented_str(3, "} catch (e) {", spaces=2))
+                        f.write(indented_str(4, "console.log(e);", spaces=2))
+                        f.write(indented_str(3, "}", spaces=2))
+                        f.write(indented_str(2, "}", spaces=2))
+                        n = n + 1
+                    else:
+                        f.write(indented_str(2, "// if (buttonIndex === 7) {", spaces=2))
+                        f.write(indented_str(3, "// try {", spaces=2))
+                        f.write(indented_str(4, "// CallNative.openSecureFolder();", spaces=2))
+                        f.write(indented_str(3, "// } catch (e) {", spaces=2))
+                        f.write(indented_str(4, "// console.log(e);", spaces=2))
+                        f.write(indented_str(3, "// }", spaces=2))
+                        f.write(indented_str(2, "// }", spaces=2))
                 elif "//FEATURES3" in line:
                     n = 0
                     f.write(indented_str(5, "<Button", spaces=2))
@@ -1039,7 +1101,18 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                     else:
                         f.write(indented_str(5, "{/* <Button", spaces=2))
                         f.write(indented_str(6, 'title="Live Streaming"', spaces=2))
-                        f.write(indented_str(6, f'onPress={{() => handleActionSheetPress(5)}}', spaces=2))
+                        f.write(indented_str(6, f'onPress={{() => handleActionSheetPress(6)}}', spaces=2))
+                        f.write(indented_str(5, "/> */}", spaces=2))
+                    if security["secure_folder"]:
+                        f.write(indented_str(5, "<Button", spaces=2))
+                        f.write(indented_str(6, 'title="Secure Folder"', spaces=2))
+                        f.write(indented_str(6, f'onPress={{() => handleActionSheetPress({n})}}', spaces=2))
+                        f.write(indented_str(5, "/>", spaces=2))
+                        n = n + 1
+                    else:
+                        f.write(indented_str(5, "{/* <Button", spaces=2))
+                        f.write(indented_str(6, 'title="Secure Folder"', spaces=2))
+                        f.write(indented_str(6, f'onPress={{() => handleActionSheetPress(7)}}', spaces=2))
                         f.write(indented_str(5, "/> */}", spaces=2))
                 else:
                     f.write(line)
@@ -1111,12 +1184,6 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
                     else:
                         f.write(indented_str(2, "// API.setCheckCallForwarding(true);"))
                         f.write(os.linesep)
-                    if security["secure_folder"]:
-                        f.write(indented_str(2, "API.openSecureFolder();"))
-                        f.write(os.linesep)
-                    else:
-                        f.write(indented_str(2, "// API.openSecureFolder();"))
-                        f.write(os.linesep)
                 elif "//SMS" in line:
                     if features["sms"]["status"]:
                         f.write(indented_str(2, "API.setEnabledSMS(true);"))