|
@@ -1124,7 +1124,261 @@ def change(platform: str, mode: str, path_dest: str, features: dict, security: d
|
|
else:
|
|
else:
|
|
f.write(line)
|
|
f.write(line)
|
|
elif platform == "ios_react":
|
|
elif platform == "ios_react":
|
|
- pass
|
|
|
|
|
|
+ main_act_path = os.path.join(path_dest, "App.tsx")
|
|
|
|
+ with open(main_act_path, "r") as f:
|
|
|
|
+ lines = f.readlines()
|
|
|
|
+ with open(main_act_path, "w") as f:
|
|
|
|
+ for line in lines:
|
|
|
|
+ if "'Features'" in line:
|
|
|
|
+ f.write(indented_str(4, "'Setting',", spaces=2))
|
|
|
|
+ f.write(indented_str(4, "'Profile',", spaces=2))
|
|
|
|
+ if features["cc"]["status"]:
|
|
|
|
+ f.write(indented_str(4, "'Contact Center',", spaces=2))
|
|
|
|
+ else:
|
|
|
|
+ f.write(indented_str(4, "// 'Contact Center',", spaces=2))
|
|
|
|
+ if features["nc"]["status"]:
|
|
|
|
+ f.write(indented_str(4, "'Notification Center',", spaces=2))
|
|
|
|
+ else:
|
|
|
|
+ f.write(indented_str(4, "// 'Notification Center',", spaces=2))
|
|
|
|
+ if features["im"]["status"]:
|
|
|
|
+ f.write(indented_str(4, "'Chat',", spaces=2))
|
|
|
|
+ else:
|
|
|
|
+ f.write(indented_str(4, "// 'Chat',", spaces=2))
|
|
|
|
+ if features["call"]["status"]:
|
|
|
|
+ f.write(indented_str(4, "'Call',", spaces=2))
|
|
|
|
+ else:
|
|
|
|
+ f.write(indented_str(4, "// 'Call',", spaces=2))
|
|
|
|
+ if features["ls"]["status"]:
|
|
|
|
+ f.write(indented_str(4, "'Live Streaming',", spaces=2))
|
|
|
|
+ else:
|
|
|
|
+ f.write(indented_str(4, "// 'Live Streaming',", spaces=2))
|
|
|
|
+ elif "//FEATURES1" in line:
|
|
|
|
+ n = 0
|
|
|
|
+ f.write(indented_str(5, f"if (buttonIndex === {n}) {{", spaces=2))
|
|
|
|
+ f.write(indented_str(6, "CallNative.openSetting();", spaces=2))
|
|
|
|
+ f.write(indented_str(5, "}", spaces=2))
|
|
|
|
+ n = n + 1
|
|
|
|
+ f.write(indented_str(5, f"if (buttonIndex === {n}) {{", spaces=2))
|
|
|
|
+ f.write(indented_str(6, "CallNative.openProfile();", spaces=2))
|
|
|
|
+ f.write(indented_str(5, "}", spaces=2))
|
|
|
|
+ n = n + 1
|
|
|
|
+ if features["cc"]["status"]:
|
|
|
|
+ f.write(indented_str(5, f"if (buttonIndex === {n}) {{", spaces=2))
|
|
|
|
+ f.write(indented_str(6, "CallNative.openContactCenter();", spaces=2))
|
|
|
|
+ f.write(indented_str(5, "}", spaces=2))
|
|
|
|
+ n = n + 1
|
|
|
|
+ else:
|
|
|
|
+ f.write(indented_str(5, "// if (buttonIndex === 2) {", spaces=2))
|
|
|
|
+ f.write(indented_str(6, "// CallNative.openContactCenter();", spaces=2))
|
|
|
|
+ f.write(indented_str(5, "// }", spaces=2))
|
|
|
|
+ if features["nc"]["status"]:
|
|
|
|
+ f.write(indented_str(5, f"if (buttonIndex === {n}) {{", spaces=2))
|
|
|
|
+ f.write(indented_str(6, "CallNative.openNotificationCenter();", spaces=2))
|
|
|
|
+ f.write(indented_str(5, "}", spaces=2))
|
|
|
|
+ n = n + 1
|
|
|
|
+ else:
|
|
|
|
+ f.write(indented_str(5, "// if (buttonIndex === 3) {", spaces=2))
|
|
|
|
+ f.write(indented_str(6, "// CallNative.openNotificationCenter();", spaces=2))
|
|
|
|
+ f.write(indented_str(5, "// }", spaces=2))
|
|
|
|
+ if features["im"]["status"]:
|
|
|
|
+ f.write(indented_str(5, f"if (buttonIndex === {n}) {{", spaces=2))
|
|
|
|
+ f.write(indented_str(6, "CallNative.openChat();", spaces=2))
|
|
|
|
+ f.write(indented_str(5, "}", spaces=2))
|
|
|
|
+ n = n + 1
|
|
|
|
+ else:
|
|
|
|
+ f.write(indented_str(5, "// if (buttonIndex === 4) {", spaces=2))
|
|
|
|
+ f.write(indented_str(6, "// CallNative.openChat();", spaces=2))
|
|
|
|
+ f.write(indented_str(5, "// }", spaces=2))
|
|
|
|
+ if features["call"]["status"]:
|
|
|
|
+ f.write(indented_str(5, f"if (buttonIndex === {n}) {{", spaces=2))
|
|
|
|
+ f.write(indented_str(6, "CallNative.openCall();", spaces=2))
|
|
|
|
+ f.write(indented_str(5, "}", spaces=2))
|
|
|
|
+ n = n + 1
|
|
|
|
+ else:
|
|
|
|
+ f.write(indented_str(5, "// if (buttonIndex === 5) {", spaces=2))
|
|
|
|
+ f.write(indented_str(6, "// CallNative.openCall();", spaces=2))
|
|
|
|
+ f.write(indented_str(5, "// }", spaces=2))
|
|
|
|
+ if features["ls"]["status"]:
|
|
|
|
+ f.write(indented_str(5, f"if (buttonIndex === {n}) {{", spaces=2))
|
|
|
|
+ f.write(indented_str(6, "CallNative.openStreaming();", spaces=2))
|
|
|
|
+ f.write(indented_str(5, "}", spaces=2))
|
|
|
|
+ n = n + 1
|
|
|
|
+ else:
|
|
|
|
+ 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))
|
|
|
|
+ elif "//FEATURES2" in line:
|
|
|
|
+ n = 0
|
|
|
|
+ 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.openSetting();", 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
|
|
|
|
+ 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.openProfile();", 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
|
|
|
|
+ if features["cc"]["status"]:
|
|
|
|
+ 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.openContactCenter();", 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 === 2) {", spaces=2))
|
|
|
|
+ f.write(indented_str(3, "// try {", spaces=2))
|
|
|
|
+ f.write(indented_str(4, "// CallNative.openContactCenter();", 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 features["nc"]["status"]:
|
|
|
|
+ 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.openNotificationCenter();", 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 === 3) {", spaces=2))
|
|
|
|
+ f.write(indented_str(3, "// try {", spaces=2))
|
|
|
|
+ f.write(indented_str(4, "// CallNative.openNotificationCenter();", 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 features["im"]["status"]:
|
|
|
|
+ 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.openChat();", 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 === 4) {", spaces=2))
|
|
|
|
+ f.write(indented_str(3, "// try {", spaces=2))
|
|
|
|
+ f.write(indented_str(4, "// CallNative.openChat();", 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 features["call"]["status"]:
|
|
|
|
+ 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.openCall();", 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 === 5) {", spaces=2))
|
|
|
|
+ f.write(indented_str(3, "// try {", spaces=2))
|
|
|
|
+ f.write(indented_str(4, "// CallNative.openCall();", 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 features["ls"]["status"]:
|
|
|
|
+ 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.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))
|
|
|
|
+ n = n + 1
|
|
|
|
+ else:
|
|
|
|
+ f.write(indented_str(2, "// if (buttonIndex === {n}) {", 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))
|
|
|
|
+ elif "//FEATURES3" in line:
|
|
|
|
+ n = 0
|
|
|
|
+ f.write(indented_str(5, "<Button", spaces=2))
|
|
|
|
+ f.write(indented_str(6, 'title="Setting"', spaces=2))
|
|
|
|
+ f.write(indented_str(6, f'onPress={{() => handleActionSheetPress({n})}}', spaces=2))
|
|
|
|
+ f.write(indented_str(5, "/>", spaces=2))
|
|
|
|
+ n = n + 1
|
|
|
|
+ f.write(indented_str(5, "<Button", spaces=2))
|
|
|
|
+ f.write(indented_str(6, 'title="Profile"', spaces=2))
|
|
|
|
+ f.write(indented_str(6, f'onPress={{() => handleActionSheetPress({n})}}', spaces=2))
|
|
|
|
+ f.write(indented_str(5, "/>", spaces=2))
|
|
|
|
+ n = n + 1
|
|
|
|
+ if features["cc"]["status"]:
|
|
|
|
+ f.write(indented_str(5, "<Button", spaces=2))
|
|
|
|
+ f.write(indented_str(6, 'title="Contact Center"', 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="Contact Center"', spaces=2))
|
|
|
|
+ f.write(indented_str(6, f'onPress={{() => handleActionSheetPress(2)}}', spaces=2))
|
|
|
|
+ f.write(indented_str(5, "/> */}", spaces=2))
|
|
|
|
+ if features["nc"]["status"]:
|
|
|
|
+ f.write(indented_str(5, "<Button", spaces=2))
|
|
|
|
+ f.write(indented_str(6, 'title="Notification Center"', 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="Notification Center"', spaces=2))
|
|
|
|
+ f.write(indented_str(6, f'onPress={{() => handleActionSheetPress(3)}}', spaces=2))
|
|
|
|
+ f.write(indented_str(5, "/> */}", spaces=2))
|
|
|
|
+ if features["im"]["status"]:
|
|
|
|
+ f.write(indented_str(5, "<Button", spaces=2))
|
|
|
|
+ f.write(indented_str(6, 'title="Chat"', 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="Chat"', spaces=2))
|
|
|
|
+ f.write(indented_str(6, f'onPress={{() => handleActionSheetPress(4)}}', spaces=2))
|
|
|
|
+ f.write(indented_str(5, "/> */}", spaces=2))
|
|
|
|
+ if features["call"]["status"]:
|
|
|
|
+ f.write(indented_str(5, "<Button", spaces=2))
|
|
|
|
+ f.write(indented_str(6, 'title="Call"', 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="Call"', spaces=2))
|
|
|
|
+ f.write(indented_str(6, f'onPress={{() => handleActionSheetPress(5)}}', spaces=2))
|
|
|
|
+ f.write(indented_str(5, "/> */}", spaces=2))
|
|
|
|
+ if features["ls"]["status"]:
|
|
|
|
+ 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({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="Live Streaming"', spaces=2))
|
|
|
|
+ f.write(indented_str(6, f'onPress={{() => handleActionSheetPress(5)}}', spaces=2))
|
|
|
|
+ f.write(indented_str(5, "/> */}", spaces=2))
|
|
|
|
+ else:
|
|
|
|
+ f.write(line)
|
|
|
|
|
|
|
|
|
|
def deliver_zip(path_dest, uid):
|
|
def deliver_zip(path_dest, uid):
|