Kaynağa Gözat

update change openURL SecureBrowser

alqindiirsyam 5 ay önce
ebeveyn
işleme
3703748aa6

+ 6 - 6
AppBuilder/AppBuilder/SecondTabViewController.swift

@@ -1301,22 +1301,22 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                 APIS.openContactCenter();
                 return true;
             case "18d1c6d9f330215af7b49": //bpkh haji
-                Nexilis.openUrl(url: Utils.decrypt(str: "6]tov!l_opgn=hgz?ykmgv?yoro3kt?uo>yoro3kt??@yvzzn"))
+                APIS.openUrl(url: Utils.decrypt(str: "6]tov!l_opgn=hgz?ykmgv?yoro3kt?uo>yoro3kt??@yvzzn"))
                 return true;
             case "18d1c6eefd40215af7b49": //bpkh bpjs
-                Nexilis.openUrl(url: Utils.decrypt(str: "1>ojq`g@tkqc.cbu:tfhbq:tjmjyfo:pj/tjmjyfo::;tquui"))
+                APIS.openUrl(url: Utils.decrypt(str: "1>ojq`g@tkqc.cbu:tfhbq:tjmjyfo:pj/tjmjyfo::;tquui"))
                 return true;
             case "18d30e711c20230d00c15": //ina bpjs
-                Nexilis.openUrl(url: Utils.decrypt(str: "6]tov!l_ypvh=hgz?ykmgv?yoro3kt?sui>ykrgyomojrkyz??@yvzzn"))
+                APIS.openUrl(url: Utils.decrypt(str: "6]tov!l_ypvh=hgz?ykmgv?yoro3kt?sui>ykrgyomojrkyz??@yvzzn"))
                 return true;
             case "18d30e47ae60230d00c15": //ina KTP, KK, SKL
-                Nexilis.openUrl(url: Utils.decrypt(str: "1>ojq`g@qul.cbu:tfhbq:tjmjyfo:npd/tfmbtjhjemftu::;tquui"))
+                APIS.openUrl(url: Utils.decrypt(str: "1>ojq`g@qul.cbu:tfhbq:tjmjyfo:npd/tfmbtjhjemftu::;tquui"))
                 return true;
             case "18d30eb2e910230d00c15": //SIM, SKKB, SKBN
-                Nexilis.openUrl(url: Utils.decrypt(str: "4[rmt}j]qmw;fex=wiket=wmpm1ir=qsg<wipewmkmhpiwx==>wtxxl"))
+                APIS.openUrl(url: Utils.decrypt(str: "4[rmt}j]qmw;fex=wiket=wmpm1ir=qsg<wipewmkmhpiwx==>wtxxl"))
                 return true;
             case "18da1c0200f0215af7b49": //BPKH index BMI
-                Nexilis.openUrl(url: Utils.decrypt(str: "4[rmt}j]mqf}1ihrm=mqf=wmpm1ir=sm<wmpm1ir==>wtxxl"))
+                APIS.openUrl(url: Utils.decrypt(str: "4[rmt}j]mqf}1ihrm=mqf=wmpm1ir=sm<wmpm1ir==>wtxxl"))
                 return true;
             default:
                 break;

+ 4 - 2
NexilisLite/NexilisLite/Source/APIS.swift

@@ -130,10 +130,12 @@ public class APIS: NSObject {
         }
         let controller = BNIBookingWebView()
         controller.customUrl = url
+        let navigationController = CustomNavigationController(rootViewController: controller)
+        navigationController.defaultStyle()
         if UIApplication.shared.visibleViewController?.navigationController != nil {
-            UIApplication.shared.visibleViewController?.navigationController?.present(controller, animated: true, completion: nil)
+            UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
         } else {
-            UIApplication.shared.visibleViewController?.present(controller, animated: true, completion: nil)
+            UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
         }
     }
     

+ 2 - 44
NexilisLite/NexilisLite/Source/Nexilis.swift

@@ -1080,9 +1080,9 @@ public class Nexilis: NSObject {
         //print("BTNCLICK \(index) \(id)")
         if index == IDX_QUEUE_SYSTEM || index == IDX_NEWS || index == IDX_SOCIAL_COMMERCE {
             if id == "fb\(index)"{
-                openUrl(url: "https://google.com/")
+                APIS.openUrl(url: "https://google.com/")
             } else {
-                openUrl(url: id)
+                APIS.openUrl(url: id)
             }
         } else if index == IDX_NOTIF_CENTER {
             APIS.openNotificationCenter()
@@ -1119,48 +1119,6 @@ public class Nexilis: NSObject {
         }
     }
     
-    public static func openUrl(isBNI: Bool = false, url: String = "") {
-        let isChangeProfile = Utils.getSetProfile()
-        if !isChangeProfile {
-            let alert = LibAlertController(title: "Change Profile".localized(), message: "You must change your name to use this feature".localized(), preferredStyle: .alert)
-            alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: {(_) in
-                let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "signupsignin") as! SignUpSignIn
-                controller.forceLogin = true
-                let navigationController = CustomNavigationController(rootViewController: controller)
-                navigationController.modalPresentationStyle = .fullScreen
-                navigationController.navigationBar.tintColor = .white
-                navigationController.navigationBar.barTintColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
-                navigationController.navigationBar.isTranslucent = false
-                navigationController.navigationBar.overrideUserInterfaceStyle = .dark
-                navigationController.navigationBar.barStyle = .black
-                let cancelButtonAttributes: [NSAttributedString.Key: Any] = [NSAttributedString.Key.foregroundColor: UIColor.white, NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16)]
-                UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
-                let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
-                navigationController.navigationBar.titleTextAttributes = textAttributes
-                if UIApplication.shared.visibleViewController?.navigationController != nil {
-                    UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
-                } else {
-                    UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
-                }
-            }))
-            if UIApplication.shared.visibleViewController?.navigationController != nil {
-                UIApplication.shared.visibleViewController?.navigationController?.present(alert, animated: true, completion: nil)
-            } else {
-                UIApplication.shared.visibleViewController?.present(alert, animated: true, completion: nil)
-            }
-            return
-        }
-        let controller = BNIBookingWebView()
-        if !isBNI {
-            controller.customUrl = url
-        }
-        if UIApplication.shared.visibleViewController?.navigationController != nil {
-            UIApplication.shared.visibleViewController?.navigationController?.present(controller, animated: true, completion: nil)
-        } else {
-            UIApplication.shared.visibleViewController?.present(controller, animated: true, completion: nil)
-        }
-    }
-    
     public static func openApp(id: String) {
         //print("openApp itms-apps://apple.com/app/\(id)")
         let isChangeProfile = Utils.getSetProfile()

+ 6 - 2
NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift

@@ -6185,8 +6185,12 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
         if stringURl.lowercased().starts(with: "www.") {
             stringURl = "https://" + stringURl.replacingOccurrences(of: "www.", with: "")
         }
-        guard let url = URL(string: stringURl) else { return }
-        UIApplication.shared.open(url)
+        if Nexilis.checkingAccess(key: "secure_browser") {
+            APIS.openUrl(url: stringURl)
+        } else {
+            guard let url = URL(string: stringURl) else { return }
+            UIApplication.shared.open(url)
+        }
     }
     
     //    public func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {

+ 6 - 2
NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -7478,8 +7478,12 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
         if stringURl.lowercased().starts(with: "www.") {
             stringURl = "https://" + stringURl.replacingOccurrences(of: "www.", with: "")
         }
-        guard let url = URL(string: stringURl) else { return }
-        UIApplication.shared.open(url)
+        if Nexilis.checkingAccess(key: "secure_browser") {
+            APIS.openUrl(url: stringURl)
+        } else {
+            guard let url = URL(string: stringURl) else { return }
+            UIApplication.shared.open(url)
+        }
     }
     
 //    public func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {

+ 6 - 6
NexilisLite/NexilisLite/Source/View/Control/ContactChatViewController.swift

@@ -939,22 +939,22 @@ extension ContactChatViewController {
                 APIS.openContactCenter();
                 return true;
             case "18d1c6d9f330215af7b49": //bpkh haji
-                Nexilis.openUrl(url: Utils.decrypt(str: "6]tov!l_opgn=hgz?ykmgv?yoro3kt?uo>yoro3kt??@yvzzn"))
+                APIS.openUrl(url: Utils.decrypt(str: "6]tov!l_opgn=hgz?ykmgv?yoro3kt?uo>yoro3kt??@yvzzn"))
                 return true;
             case "18d1c6eefd40215af7b49": //bpkh bpjs
-                Nexilis.openUrl(url: Utils.decrypt(str: "1>ojq`g@tkqc.cbu:tfhbq:tjmjyfo:pj/tjmjyfo::;tquui"))
+                APIS.openUrl(url: Utils.decrypt(str: "1>ojq`g@tkqc.cbu:tfhbq:tjmjyfo:pj/tjmjyfo::;tquui"))
                 return true;
             case "18d30e711c20230d00c15": //ina bpjs
-                Nexilis.openUrl(url: Utils.decrypt(str: "6]tov!l_ypvh=hgz?ykmgv?yoro3kt?sui>ykrgyomojrkyz??@yvzzn"))
+                APIS.openUrl(url: Utils.decrypt(str: "6]tov!l_ypvh=hgz?ykmgv?yoro3kt?sui>ykrgyomojrkyz??@yvzzn"))
                 return true;
             case "18d30e47ae60230d00c15": //ina KTP, KK, SKL
-                Nexilis.openUrl(url: Utils.decrypt(str: "1>ojq`g@qul.cbu:tfhbq:tjmjyfo:npd/tfmbtjhjemftu::;tquui"))
+                APIS.openUrl(url: Utils.decrypt(str: "1>ojq`g@qul.cbu:tfhbq:tjmjyfo:npd/tfmbtjhjemftu::;tquui"))
                 return true;
             case "18d30eb2e910230d00c15": //SIM, SKKB, SKBN
-                Nexilis.openUrl(url: Utils.decrypt(str: "4[rmt}j]qmw;fex=wiket=wmpm1ir=qsg<wipewmkmhpiwx==>wtxxl"))
+                APIS.openUrl(url: Utils.decrypt(str: "4[rmt}j]qmw;fex=wiket=wmpm1ir=qsg<wipewmkmhpiwx==>wtxxl"))
                 return true;
             case "18da1c0200f0215af7b49": //BPKH index BMI
-                Nexilis.openUrl(url: Utils.decrypt(str: "4[rmt}j]mqf}1ihrm=mqf=wmpm1ir=sm<wmpm1ir==>wtxxl"))
+                APIS.openUrl(url: Utils.decrypt(str: "4[rmt}j]mqf}1ihrm=mqf=wmpm1ir=sm<wmpm1ir==>wtxxl"))
                 return true;
             default:
                 break;