Prechádzať zdrojové kódy

Add dialog security shield

alqindiirsyam 1 rok pred
rodič
commit
22699d6de3

+ 24 - 0
appbuilder-ios/NexilisLite/NexilisLite/Resource/id.lproj/Localizable.strings

@@ -321,3 +321,27 @@
 "Forward All" = "Teruskan Semua";
 "Delete All" = "Hapus Semua";
 "Resend" = "Kirim Ulang";
+"Unable to access your primary device" = "Tidak dapat mengakses perangkat utama Anda";
+"To verify your identity for signing in on a new device, we need access to your main device. Please turn on your primary device. If it's not accessible, contact us to undergo a KYC verification process." = "Untuk memverifikasi identitas Anda untuk masuk di perangkat baru, kami memerlukan akses ke perangkat utama Anda. Silakan nyalakan perangkat utama Anda. Jika tidak dapat diakses, hubungi kami untuk menjalani proses verifikasi KYC.";
+"We value your security" = "Kami menghargai keamanan Anda";
+"Verify it's you" = "Verifikasi itu anda";
+"Enter Code" = "Masukkan Kode";
+"To help keep your Account safe, We wants to make sure it's really you trying to Sign-In\n\nA secure notification containing a verification code was just sent to your main Device" = "Untuk membantu menjaga keamanan Akun Anda, Kami ingin memastikan bahwa memang Anda yang mencoba Masuk\n\nPemberitahuan keamanan yang berisi kode verifikasi baru saja dikirimkan ke Perangkat utama Anda";
+"New Sign-In Detected" = "Terdeteksi login baru";
+"We detected a new Sign-In to your Account" = "Kami mendeteksi ada yang login ke Akun Anda";
+"Device" = "Perangkat";
+"Time" = "Waktu";
+"Location" = "Lokasi";
+"Your Account is at risk if this wasn't you." = "Akun Anda berisiko jika ini bukan Anda.";
+"Nexilis Verification Code" = "Kode Verifikasi Nexilis";
+"We received a request to verify the Sign-In from" = "Kami mendapatkan permintaan untuk memverifikasi login baru dari";
+"to your Account" = "ke akun anda";
+"Your Nexilis verification code is" = "Kode verifikasi akun nexilis adalah";
+"(do not forward or give this code to anyone)" = "(jangan meneruskan atau memberikan kode ini pada siapapun)";
+"If you did not request this code, it is possible that someone else is trying to access the Account." = "Jika anda tidak meminta kode ini, kemungkinan orang lain sedang mencoba mengakses akun anda.";
+"Your Account is Protected" = "Akun Anda Terlindungi";
+"Security Shield has been activated for your Peace of Mind..." = "Security Shield telah diaktifkan untuk Ketenangan Pikiran Anda";
+"Account & Transaction Protection" = "Proteksi Akun & Transaksi";
+"Early Threat Detection" = "Deteksi Ancaman Dini";
+"Emergency Data Control" = "Mengontrol Data Penting";
+"Please feel free to contact us for more information." = "Jangan ragu untuk menghubungi kami untuk informasi lebih lanjut.";

+ 17 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/Extension.swift

@@ -426,6 +426,10 @@ extension UIColor {
         return renderColor(hex: "#ff0000")
     }
     
+    public static var blueTextField: UIColor {
+        return renderColor(hex: "#4c92d2")
+    }
+    
     public class func renderColor(hex: String) -> UIColor {
         var cString:String = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased()
 
@@ -1369,3 +1373,16 @@ extension UIGraphicsRenderer {
             return renderImagesAt(urls: [url], size: size, scale: scale)
         }
 }
+
+extension NSAttributedString {
+    convenience init(html: String) throws {
+        let options: [NSAttributedString.DocumentReadingOptionKey: Any] = [
+            .documentType: NSAttributedString.DocumentType.html,
+            .characterEncoding: String.Encoding.utf8.rawValue
+        ]
+        guard let data = html.data(using: .utf8) else {
+            throw NSError(domain: "Invalid HTML", code: 0, userInfo: nil)
+        }
+        try self.init(data: data, options: options, documentAttributes: nil)
+    }
+}

+ 0 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/Nexilis.swift

@@ -14,7 +14,6 @@ import UIKit
 import FMDB
 import QuickLook
 import NotificationBannerSwift
-import CallKit
 
 public class Nexilis: NSObject {
     public static var sAPIKey = ""

+ 503 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/Utils.swift

@@ -687,3 +687,506 @@ public class CustomNavigationController: UINavigationController {
         fatalError("init(coder:) has not been implemented")
     }
 }
+
+public class DialogUnableAccess: UIViewController {
+    
+    public let content = "To verify your identity for signing in on a new device, we need access to your main device. Please turn on your primary device. If it's not accessible, contact us to undergo a KYC verification process.".localized()
+    
+    public override func viewDidLoad() {
+        super.viewDidLoad()
+        self.view.backgroundColor = .black.withAlphaComponent(0.5)
+        
+        let container = UIView()
+        self.view.addSubview(container)
+        container.anchor(top: self.view.topAnchor, left: self.view.leftAnchor, right: self.view.rightAnchor, paddingTop: 30, paddingLeft: 20, paddingRight: 20)
+        container.layer.cornerRadius = 20.0
+        container.clipsToBounds = true
+        container.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .white
+        
+        let title = UILabel()
+        title.text = "Unable to access your primary device".localized()
+        title.font = .systemFont(ofSize: 14, weight: .medium)
+        title.numberOfLines = 0
+        title.textAlignment = .center
+        title.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
+        container.addSubview(title)
+        title.anchor(top: container.topAnchor, paddingTop: 15, centerX: container.centerXAnchor, width: 270)
+        
+        let imageWarning = UIImageView(image: UIImage(named: "pb_security_warning", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!)
+        container.addSubview(imageWarning)
+        imageWarning.anchor(top: container.topAnchor, right: title.leftAnchor, paddingTop: 10, paddingRight: 5, width: 30, height: 30)
+        
+        let imageChat = UIImageView(image: UIImage(named: "pb_startup_iconsuffix", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!)
+        container.addSubview(imageChat)
+        imageChat.anchor(top: container.topAnchor, left: title.rightAnchor, paddingTop: 10, paddingLeft: 5, width: 30, height: 30)
+        
+        let contentS = UILabel()
+        contentS.text = content
+        contentS.font = .systemFont(ofSize: 12)
+        contentS.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
+        contentS.numberOfLines = 0
+        container.addSubview(contentS)
+        contentS.anchor(top: title.bottomAnchor, left: container.leftAnchor, right: container.rightAnchor, paddingTop: 15, paddingLeft: 15, paddingRight: 10)
+        
+        let buttonKYC = UIButton(type: .custom)
+        let backgroundImageKYC = resizeImage(image: UIImage(named: "pb_security_kyc_center", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: UIScreen.main.bounds.width / 3 - 20, height: 35))
+        buttonKYC.setBackgroundImage(backgroundImageKYC, for: .normal)
+        buttonKYC.imageView?.contentMode = .scaleAspectFill
+        buttonKYC.addTarget(self, action: #selector(kycTapped), for: .touchUpInside)
+        buttonKYC.contentEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        container.addSubview(buttonKYC)
+        buttonKYC.anchor(top: contentS.bottomAnchor, paddingTop: 15, centerX: container.centerXAnchor, width: UIScreen.main.bounds.width / 3 - 20, height: 35)
+        
+        let buttonTryAgain = UIButton(type: .custom)
+        let backgroundImageTryAgain = resizeImage(image: UIImage(named: "pb_security_try_again", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: UIScreen.main.bounds.width / 3 - 20, height: 35))
+        buttonTryAgain.setBackgroundImage(backgroundImageTryAgain, for: .normal)
+        buttonTryAgain.imageView?.contentMode = .scaleAspectFill
+        buttonTryAgain.addTarget(self, action: #selector(tryAgainTapped), for: .touchUpInside)
+        buttonTryAgain.contentEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        container.addSubview(buttonTryAgain)
+        buttonTryAgain.anchor(top: contentS.bottomAnchor, right: buttonKYC.leftAnchor, paddingTop: 15, width: UIScreen.main.bounds.width / 3 - 20, height: 35)
+        
+        let buttonCancel = UIButton(type: .custom)
+        let backgroundImageCancel = resizeImage(image: UIImage(named: "pb_security_cancel", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: UIScreen.main.bounds.width / 3 - 20, height: 35))
+        buttonCancel.setBackgroundImage(backgroundImageCancel, for: .normal)
+        buttonCancel.imageView?.contentMode = .scaleAspectFill
+        buttonCancel.addTarget(self, action: #selector(cancelTapped), for: .touchUpInside)
+        buttonCancel.contentEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        container.addSubview(buttonCancel)
+        buttonCancel.anchor(top: contentS.bottomAnchor, left: buttonKYC.rightAnchor, paddingTop: 15, width: UIScreen.main.bounds.width / 3 - 20, height: 35)
+        
+        let footer = UILabel()
+        footer.text = "We value your security".localized()
+        footer.font = .systemFont(ofSize: 12)
+        footer.textColor = .gray
+        footer.numberOfLines = 0
+        container.addSubview(footer)
+        footer.anchor(top: buttonCancel.bottomAnchor, bottom: container.bottomAnchor, right: container.rightAnchor, paddingBottom: 5, paddingRight: 10)
+        
+    }
+    
+    @objc func kycTapped() {
+        print("kycTapped")
+        self.dismiss(animated: true)
+    }
+    
+    @objc func tryAgainTapped() {
+        print("tryAgainTapped")
+        self.dismiss(animated: true)
+    }
+    
+    @objc func cancelTapped() {
+        print("cancelTapped")
+        self.dismiss(animated: true)
+    }
+}
+
+public class DialogVerifyYou: UIViewController {
+    
+    public let content = "To help keep your Account safe, We wants to make sure it's really you trying to Sign-In\n\nA secure notification containing a verification code was just sent to your main Device".localized()
+    let textFieldCode = UITextField()
+    
+    public override func viewDidLoad() {
+        super.viewDidLoad()
+        self.view.backgroundColor = .black.withAlphaComponent(0.5)
+        
+        let container = UIView()
+        self.view.addSubview(container)
+        container.anchor(top: self.view.topAnchor, left: self.view.leftAnchor, right: self.view.rightAnchor, paddingTop: 30, paddingLeft: 20, paddingRight: 20)
+        container.layer.cornerRadius = 20.0
+        container.clipsToBounds = true
+        container.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .white
+        
+        let title = UILabel()
+        title.text = "Verify it's you".localized()
+        title.font = .systemFont(ofSize: 14, weight: .medium)
+        title.numberOfLines = 0
+        title.textAlignment = .center
+        title.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
+        container.addSubview(title)
+        title.anchor(top: container.topAnchor, paddingTop: 15, centerX: container.centerXAnchor, maxWidth: 270)
+        
+        let imageAsk = UIImageView(image: UIImage(named: "pb_security_ask", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!)
+        container.addSubview(imageAsk)
+        imageAsk.anchor(top: container.topAnchor, right: title.leftAnchor, paddingTop: 10, paddingRight: 5, width: 30, height: 30)
+        
+        let imageChat = UIImageView(image: UIImage(named: "pb_startup_iconsuffix", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!)
+        container.addSubview(imageChat)
+        imageChat.anchor(top: container.topAnchor, right: container.rightAnchor, paddingTop: 10, paddingRight: 20, width: 30, height: 30)
+
+        let contentS = UILabel()
+        contentS.text = content
+        contentS.font = .systemFont(ofSize: 12)
+        contentS.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
+        contentS.numberOfLines = 0
+        container.addSubview(contentS)
+        contentS.anchor(top: title.bottomAnchor, left: container.leftAnchor, right: container.rightAnchor, paddingTop: 15, paddingLeft: 15, paddingRight: 10)
+        
+        let containerText = UIView()
+        container.addSubview(containerText)
+        containerText.anchor(top: contentS.bottomAnchor, left: container.leftAnchor, right: container.rightAnchor, paddingTop: 10, paddingLeft: 15, paddingRight: 15, height: 40)
+        containerText.layer.cornerRadius = 8.0
+        containerText.clipsToBounds = true
+        containerText.layer.borderWidth = 3
+        containerText.layer.borderColor = UIColor.blueTextField.cgColor
+        
+        let containerEnterCode = UIView()
+        container.addSubview(containerEnterCode)
+        containerEnterCode.anchor(top: contentS.bottomAnchor, left: container.leftAnchor, paddingTop: 2, paddingLeft: 30, height: 20, maxWidth: 150)
+        containerEnterCode.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .white
+        
+        let titleEnterCode = UILabel()
+        containerEnterCode.addSubview(titleEnterCode)
+        titleEnterCode.text = "Enter Code".localized()
+        titleEnterCode.font = .systemFont(ofSize: 12, weight: .medium)
+        titleEnterCode.textColor = .blueTextField
+        titleEnterCode.textAlignment = .center
+        titleEnterCode.anchor(top: containerEnterCode.topAnchor, left: containerEnterCode.leftAnchor, bottom: containerEnterCode.bottomAnchor, right: containerEnterCode.rightAnchor, paddingLeft: 10, paddingRight: 10)
+        
+        let buttonSubmit = UIButton(type: .custom)
+        containerText.addSubview(buttonSubmit)
+        buttonSubmit.anchor(top: containerText.topAnchor, bottom: containerText.bottomAnchor, right: containerText.rightAnchor, paddingTop: 5, paddingBottom: 5, paddingRight: 5, width: 100)
+        buttonSubmit.backgroundColor = .blueTextField
+        buttonSubmit.setTitle("Submit".localized(), for: .normal)
+        buttonSubmit.titleLabel?.font = .systemFont(ofSize: 10, weight: .medium)
+        buttonSubmit.layer.cornerRadius = 5.0
+        buttonSubmit.clipsToBounds = true
+        buttonSubmit.addTarget(self, action: #selector(submitTapped), for: .touchUpInside)
+        
+        container.addSubview(textFieldCode)
+        textFieldCode.anchor(top: contentS.bottomAnchor, left: container.leftAnchor, right: buttonSubmit.leftAnchor, paddingTop: 20, paddingLeft: 25, paddingRight: 5, height: 25)
+        textFieldCode.keyboardType = .numberPad
+        
+        let footer = UILabel()
+        footer.text = "We value your security".localized()
+        footer.font = .systemFont(ofSize: 12)
+        footer.textColor = .gray
+        footer.numberOfLines = 0
+        container.addSubview(footer)
+        footer.anchor(top: containerText.bottomAnchor, bottom: container.bottomAnchor, right: container.rightAnchor, paddingTop: 8, paddingBottom: 5, paddingRight: 10)
+        
+        let tapGesture = UITapGestureRecognizer(target: self, action: #selector(dismissView))
+        tapGesture.cancelsTouchesInView = false
+        self.view.addGestureRecognizer(tapGesture)
+        
+    }
+    
+    @objc func submitTapped() {
+        print("submitTapped")
+        self.dismiss(animated: true)
+    }
+    
+    @objc func dismissView() {
+        if textFieldCode.isFirstResponder {
+            textFieldCode.resignFirstResponder()
+        } else {
+            self.dismiss(animated: true)
+        }
+    }
+}
+
+public class DialogSignIn: UIViewController {
+    
+    public var valueDevice = "Galaxy S21 Ultra 5G"
+    public var valueTime = "14:02"
+    public var valueLocation = "Surakarta, Central Java"
+    
+    public override func viewDidLoad() {
+        super.viewDidLoad()
+        self.view.backgroundColor = .black.withAlphaComponent(0.5)
+        
+        let container = UIView()
+        self.view.addSubview(container)
+        container.anchor(top: self.view.topAnchor, left: self.view.leftAnchor, right: self.view.rightAnchor, paddingTop: 30, paddingLeft: 20, paddingRight: 20)
+        container.layer.cornerRadius = 20.0
+        container.clipsToBounds = true
+        container.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .white
+        
+        let title = UILabel()
+        title.text = "New Sign-In Detected".localized()
+        title.font = .systemFont(ofSize: 14, weight: .medium)
+        title.numberOfLines = 0
+        title.textAlignment = .center
+        title.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
+        container.addSubview(title)
+        title.anchor(top: container.topAnchor, paddingTop: 15, centerX: container.centerXAnchor, maxWidth: 270)
+        
+        let imageWarning = UIImageView(image: UIImage(named: "pb_security_warning", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!)
+        container.addSubview(imageWarning)
+        imageWarning.anchor(top: container.topAnchor, right: title.leftAnchor, paddingTop: 10, paddingRight: 5, width: 30, height: 30)
+        
+        let imageChat = UIImageView(image: UIImage(named: "pb_startup_iconsuffix", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!)
+        container.addSubview(imageChat)
+        imageChat.anchor(top: container.topAnchor, right: container.rightAnchor, paddingTop: 10, paddingRight: 20, width: 30, height: 30)
+        
+        let lang = UserDefaults.standard.string(forKey: "i18n_language")
+        let sContent1 = "We detected a new Sign-In to your Account".localized()
+        let sContent2 = "Device".localized()
+        let sContent3 = "Time".localized()
+        let sContent4 = "Location".localized()
+        let sContent5 = "Your Account is at risk if this wasn't you.".localized()
+        let fullString = sContent1 + "\n\u{2022}\u{00a0}\u{00a0}" + sContent2 + String(repeating: "\u{00a0}", count: (lang == "id" ? 6 : 10)) + ": " + valueDevice + "\n\u{2022}\u{00a0}\u{00a0}" + sContent3 + String(repeating: "\u{00a0}", count: 13) + ": " + valueTime + "\n\u{2022}\u{00a0}\u{00a0}" + sContent4 + String(repeating: "\u{00a0}", count: (lang == "id" ? 13 : 6)) + ": " + valueLocation + "\n\n" + sContent5;
+        let contentFull = NSMutableAttributedString(string: fullString)
+        contentFull.addAttributes([.font: UIFont.systemFont(ofSize: 12)], range: NSRange(location: 0, length: fullString.count))
+        if let range = fullString.range(of: valueDevice) {
+            let index = fullString.distance(from: fullString.startIndex, to: range.lowerBound)
+            contentFull.addAttributes([.font: UIFont.systemFont(ofSize: 12, weight: .medium)], range: NSRange(location: index, length: valueDevice.count))
+        }
+        if let range = fullString.range(of: valueTime) {
+            let index = fullString.distance(from: fullString.startIndex, to: range.lowerBound)
+            contentFull.addAttributes([.font: UIFont.systemFont(ofSize: 12, weight: .medium)], range: NSRange(location: index, length: valueTime.count))
+        }
+        if let range = fullString.range(of: valueLocation) {
+            let index = fullString.distance(from: fullString.startIndex, to: range.lowerBound)
+            contentFull.addAttributes([.font: UIFont.systemFont(ofSize: 12, weight: .medium)], range: NSRange(location: index, length: valueLocation.count))
+        }
+        
+        let contentS = UILabel()
+        contentS.attributedText = contentFull
+        contentS.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
+        contentS.numberOfLines = 0
+        container.addSubview(contentS)
+        contentS.anchor(top: title.bottomAnchor, left: container.leftAnchor, right: container.rightAnchor, paddingTop: 15, paddingLeft: 15, paddingRight: 10)
+        
+        let buttonCC = UIButton(type: .custom)
+        let backgroundImageKYC = resizeImage(image: UIImage(named: "pb_startup_cc", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: UIScreen.main.bounds.width / 3 - 20, height: 35))
+        buttonCC.setBackgroundImage(backgroundImageKYC, for: .normal)
+        buttonCC.imageView?.contentMode = .scaleAspectFill
+        buttonCC.addTarget(self, action: #selector(ccTapped), for: .touchUpInside)
+        buttonCC.contentEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        container.addSubview(buttonCC)
+        buttonCC.anchor(top: contentS.bottomAnchor, paddingTop: 10, centerX: container.centerXAnchor, width: UIScreen.main.bounds.width / 3 - 20, height: 35)
+        
+        let buttonVerify = UIButton(type: .custom)
+        let backgroundImageTryAgain = resizeImage(image: UIImage(named: "pb_security_verify_device", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: UIScreen.main.bounds.width / 3 - 20, height: 35))
+        buttonVerify.setBackgroundImage(backgroundImageTryAgain, for: .normal)
+        buttonVerify.imageView?.contentMode = .scaleAspectFill
+        buttonVerify.addTarget(self, action: #selector(verifyTapped), for: .touchUpInside)
+        buttonVerify.contentEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        container.addSubview(buttonVerify)
+        buttonVerify.anchor(top: contentS.bottomAnchor, right: buttonCC.leftAnchor, paddingTop: 10, width: UIScreen.main.bounds.width / 3 - 20, height: 35)
+        
+        let buttonBlock = UIButton(type: .custom)
+        let backgroundImageCancel = resizeImage(image: UIImage(named: "pb_security_block_device", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: UIScreen.main.bounds.width / 3 - 20, height: 35))
+        buttonBlock.setBackgroundImage(backgroundImageCancel, for: .normal)
+        buttonBlock.imageView?.contentMode = .scaleAspectFill
+        buttonBlock.addTarget(self, action: #selector(blockTapped), for: .touchUpInside)
+        buttonBlock.contentEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        container.addSubview(buttonBlock)
+        buttonBlock.anchor(top: contentS.bottomAnchor, left: buttonCC.rightAnchor, paddingTop: 10, width: UIScreen.main.bounds.width / 3 - 20, height: 35)
+        
+        let footer = UILabel()
+        footer.text = "We value your security".localized()
+        footer.font = .systemFont(ofSize: 12)
+        footer.textColor = .gray
+        footer.numberOfLines = 0
+        container.addSubview(footer)
+        footer.anchor(top: buttonBlock.bottomAnchor, bottom: container.bottomAnchor, right: container.rightAnchor, paddingBottom: 5, paddingRight: 10)
+        
+    }
+    
+    @objc func ccTapped() {
+        print("kycTapped")
+        self.dismiss(animated: true)
+    }
+    
+    @objc func verifyTapped() {
+        print("tryAgainTapped")
+        self.dismiss(animated: true)
+    }
+    
+    @objc func blockTapped() {
+        print("cancelTapped")
+        self.dismiss(animated: true)
+    }
+}
+
+public class DialogVerificationCode: UIViewController {
+    
+    public var valueDevice = "Galaxy S21 Ultra 5G"
+    public var valueAccount = "1001001234."
+    public var valueCode = "900214"
+    
+    public override func viewDidLoad() {
+        super.viewDidLoad()
+        self.view.backgroundColor = .black.withAlphaComponent(0.5)
+        
+        let container = UIView()
+        self.view.addSubview(container)
+        container.anchor(top: self.view.topAnchor, left: self.view.leftAnchor, right: self.view.rightAnchor, paddingTop: 30, paddingLeft: 20, paddingRight: 20)
+        container.layer.cornerRadius = 20.0
+        container.clipsToBounds = true
+        container.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .white
+        
+        let title = UILabel()
+        title.text = "Nexilis Verification Code".localized()
+        title.font = .systemFont(ofSize: 14, weight: .medium)
+        title.numberOfLines = 0
+        title.textAlignment = .center
+        title.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
+        container.addSubview(title)
+        title.anchor(top: container.topAnchor, paddingTop: 15, centerX: container.centerXAnchor, maxWidth: 270)
+        
+        let imageInfo = UIImageView(image: UIImage(named: "pb_security_information", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!)
+        container.addSubview(imageInfo)
+        imageInfo.anchor(top: container.topAnchor, right: title.leftAnchor, paddingTop: 10, paddingRight: 5, width: 30, height: 30)
+        
+        let imageMail = UIImageView(image: UIImage(named: "pb_security_message", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!)
+        container.addSubview(imageMail)
+        imageMail.anchor(top: container.topAnchor, right: container.rightAnchor, paddingTop: 10, paddingRight: 20, width: 30, height: 30)
+        
+        let sContent1 = "We received a request to verify the Sign-In from".localized()
+        let sContent2 = "to your Account".localized()
+        let sContent3 = "Your Nexilis verification code is".localized()
+        let sContent4 = "(do not forward or give this code to anyone)".localized()
+        let sContent5 = "If you did not request this code, it is possible that someone else is trying to access the Account.".localized()
+        let fullString = sContent1 + " " + valueDevice + " " + sContent2 + " " + valueAccount + " " + sContent3 + ":\n\n" + valueCode + " " + sContent4 + "\n\n" + sContent5;
+        let contentFull = NSMutableAttributedString(string: fullString)
+        contentFull.addAttributes([.font: UIFont.systemFont(ofSize: 12), .foregroundColor: (self.traitCollection.userInterfaceStyle == .dark ? UIColor.white : UIColor.black)], range: NSRange(location: 0, length: fullString.count))
+        if let range = fullString.range(of: valueDevice) {
+            let index = fullString.distance(from: fullString.startIndex, to: range.lowerBound)
+            contentFull.addAttributes([.font: UIFont.systemFont(ofSize: 12, weight: .medium)], range: NSRange(location: index, length: valueDevice.count))
+        }
+        if let range = fullString.range(of: valueAccount) {
+            let index = fullString.distance(from: fullString.startIndex, to: range.lowerBound)
+            contentFull.addAttributes([.foregroundColor: UIColor.blueTextField], range: NSRange(location: index, length: valueAccount.count))
+        }
+        if let range = fullString.range(of: valueCode) {
+            let index = fullString.distance(from: fullString.startIndex, to: range.lowerBound)
+            contentFull.addAttributes([.font: UIFont.systemFont(ofSize: 18, weight: .medium)], range: NSRange(location: index, length: valueCode.count))
+        }
+        if let range = fullString.range(of: sContent4) {
+            let index = fullString.distance(from: fullString.startIndex, to: range.lowerBound)
+            contentFull.addAttributes([.foregroundColor: UIColor.systemRed], range: NSRange(location: index, length: sContent4.count))
+        }
+        
+        let contentS = UILabel()
+        contentS.attributedText = contentFull
+        contentS.numberOfLines = 0
+        container.addSubview(contentS)
+        contentS.anchor(top: title.bottomAnchor, left: container.leftAnchor, right: container.rightAnchor, paddingTop: 15, paddingLeft: 15, paddingRight: 10)
+        
+        let footer = UILabel()
+        footer.text = "We value your security".localized()
+        footer.font = .systemFont(ofSize: 12)
+        footer.textColor = .gray
+        footer.numberOfLines = 0
+        container.addSubview(footer)
+        footer.anchor(top: contentS.bottomAnchor, bottom: container.bottomAnchor, right: container.rightAnchor, paddingTop: 10, paddingBottom: 5, paddingRight: 10)
+        
+        let tapGesture = UITapGestureRecognizer(target: self, action: #selector(dismissView))
+        tapGesture.cancelsTouchesInView = false
+        self.view.addGestureRecognizer(tapGesture)
+        
+    }
+    
+    @objc func dismissView() {
+        self.dismiss(animated: true)
+    }
+}
+
+public class DialogSecurityShield: UIViewController {
+    
+    public override func viewDidLoad() {
+        super.viewDidLoad()
+        self.view.backgroundColor = .black.withAlphaComponent(0.5)
+        
+        let container = UIView()
+        self.view.addSubview(container)
+        container.anchor(top: self.view.topAnchor, left: self.view.leftAnchor, right: self.view.rightAnchor, paddingTop: 30, paddingLeft: 20, paddingRight: 20)
+        container.layer.cornerRadius = 20.0
+        container.clipsToBounds = true
+        container.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .white
+        
+        let title = UILabel()
+        title.text = "Your Account is Protected".localized()
+        title.font = .systemFont(ofSize: 14, weight: .medium)
+        title.numberOfLines = 0
+        title.textAlignment = .center
+        title.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
+        container.addSubview(title)
+        title.anchor(top: container.topAnchor, paddingTop: 15, centerX: container.centerXAnchor, maxWidth: 270)
+        
+        let imageWarning = UIImageView(image: UIImage(named: "pb_security_warning_green", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!)
+        container.addSubview(imageWarning)
+        imageWarning.anchor(top: container.topAnchor, right: title.leftAnchor, paddingTop: 10, paddingRight: 5, width: 30, height: 30)
+        
+        let imageChat = UIImageView(image: UIImage(named: "pb_startup_iconsuffix", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!)
+        container.addSubview(imageChat)
+        imageChat.anchor(top: container.topAnchor, right: container.rightAnchor, paddingTop: 10, paddingRight: 20, width: 30, height: 30)
+        
+        let sContent1 = "Security Shield has been activated for your Peace of Mind...".localized()
+        let sContent2 = "Account & Transaction Protection".localized()
+        let sContent3 = "Early Threat Detection".localized()
+        let sContent4 = "Emergency Data Control".localized()
+        let sContent5 = "Please feel free to contact us for more information.".localized()
+        let fullString = sContent1 + "\n\u{2022}" + String(repeating: "\u{00a0}", count: 2) + sContent2 + "\n\u{2022}" + String(repeating: "\u{00a0}", count: 2) + sContent3 + "\n\u{2022}" + String(repeating: "\u{00a0}", count: 2) + sContent4 + "\n" + sContent5;
+        
+        let contentS = UILabel()
+        contentS.text = fullString
+        contentS.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
+        contentS.numberOfLines = 0
+        contentS.font = .systemFont(ofSize: 12)
+        container.addSubview(contentS)
+        contentS.anchor(top: title.bottomAnchor, left: container.leftAnchor, right: container.rightAnchor, paddingTop: 15, paddingLeft: 15, paddingRight: 10)
+        
+        let buttonCC = UIButton(type: .custom)
+        let backgroundImageKYC = resizeImage(image: UIImage(named: "pb_startup_cc", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: UIScreen.main.bounds.width / 3 - 20, height: 35))
+        buttonCC.setBackgroundImage(backgroundImageKYC, for: .normal)
+        buttonCC.imageView?.contentMode = .scaleAspectFill
+        buttonCC.addTarget(self, action: #selector(ccTapped), for: .touchUpInside)
+        buttonCC.contentEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        container.addSubview(buttonCC)
+        buttonCC.anchor(top: contentS.bottomAnchor, paddingTop: 10, centerX: container.centerXAnchor, width: UIScreen.main.bounds.width / 3 - 20, height: 35)
+        
+        let buttonActive = UIButton(type: .custom)
+        let backgroundImageTryAgain = resizeImage(image: UIImage(named: "pb_startup_activate", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: UIScreen.main.bounds.width / 3 - 20, height: 35))
+        buttonActive.setBackgroundImage(backgroundImageTryAgain, for: .normal)
+        buttonActive.imageView?.contentMode = .scaleAspectFill
+        buttonActive.addTarget(self, action: #selector(activateTapped), for: .touchUpInside)
+        buttonActive.contentEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        container.addSubview(buttonActive)
+        buttonActive.anchor(top: contentS.bottomAnchor, right: buttonCC.leftAnchor, paddingTop: 10, width: UIScreen.main.bounds.width / 3 - 20, height: 35)
+        
+        let buttonDeactive = UIButton(type: .custom)
+        let backgroundImageCancel = resizeImage(image: UIImage(named: "pb_startup_deactivate", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: UIScreen.main.bounds.width / 3 - 20, height: 35))
+        buttonDeactive.setBackgroundImage(backgroundImageCancel, for: .normal)
+        buttonDeactive.imageView?.contentMode = .scaleAspectFill
+        buttonDeactive.addTarget(self, action: #selector(deactiveTapped), for: .touchUpInside)
+        buttonDeactive.contentEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        container.addSubview(buttonDeactive)
+        buttonDeactive.anchor(top: contentS.bottomAnchor, left: buttonCC.rightAnchor, paddingTop: 10, width: UIScreen.main.bounds.width / 3 - 20, height: 35)
+        
+        let footer = UILabel()
+        footer.text = "We value your security".localized()
+        footer.font = .systemFont(ofSize: 12)
+        footer.textColor = .gray
+        footer.numberOfLines = 0
+        container.addSubview(footer)
+        footer.anchor(top: buttonDeactive.bottomAnchor, bottom: container.bottomAnchor, right: container.rightAnchor, paddingBottom: 5, paddingRight: 10)
+        
+        let tapGesture = UITapGestureRecognizer(target: self, action: #selector(dismissView))
+        tapGesture.cancelsTouchesInView = false
+        self.view.addGestureRecognizer(tapGesture)
+        
+    }
+    
+    @objc func ccTapped() {
+        print("kycTapped")
+        self.dismiss(animated: true)
+    }
+    
+    @objc func activateTapped() {
+        print("tryAgainTapped")
+        self.dismiss(animated: true)
+    }
+    
+    @objc func deactiveTapped() {
+        print("cancelTapped")
+        self.dismiss(animated: true)
+    }
+    
+    @objc func dismissView() {
+        self.dismiss(animated: true)
+    }
+}