diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..50d839a Binary files /dev/null and b/.DS_Store differ diff --git a/Befund.xcodeproj/project.pbxproj b/Befund.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2067fe3 --- /dev/null +++ b/Befund.xcodeproj/project.pbxproj @@ -0,0 +1,1142 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 690849DE281DCB26004A631F /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 690849DD281DCB26004A631F /* Log.swift */; }; + 6949A0F7286A079D00987D04 /* Servers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6949A0F6286A079D00987D04 /* Servers.swift */; }; + 694E9F72284103B000431F95 /* ViewExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 694E9F71284103B000431F95 /* ViewExtension.swift */; }; + 694E9F782841127300431F95 /* ResultsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 694E9F762841127300431F95 /* ResultsTableViewCell.swift */; }; + 694E9F792841127300431F95 /* ResultsTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 694E9F772841127300431F95 /* ResultsTableViewCell.xib */; }; + 694E9F7B2841299400431F95 /* Status.swift in Sources */ = {isa = PBXBuildFile; fileRef = 694E9F7A2841299400431F95 /* Status.swift */; }; + 694FF360282F86D40070C3F2 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 694FF35F282F86D40070C3F2 /* Request.swift */; }; + 694FF364282FACFB0070C3F2 /* KeyExchange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 694FF363282FACFB0070C3F2 /* KeyExchange.swift */; }; + 694FF366282FAD3A0070C3F2 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 694FF365282FAD3A0070C3F2 /* Models.swift */; }; + 694FF36B282FB4FA0070C3F2 /* PublicKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 694FF36A282FB4FA0070C3F2 /* PublicKey.swift */; }; + 695DD3DE284690A700A7F0F0 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 695DD3DD284690A700A7F0F0 /* Image.swift */; }; + 696DF3972838CF5A00E710BD /* System.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696DF3962838CF5A00E710BD /* System.swift */; }; + 696DF3992838DD6800E710BD /* Device.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696DF3982838DD6800E710BD /* Device.swift */; }; + 696DF39C2838E18100E710BD /* StorageInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696DF39B2838E18100E710BD /* StorageInfo.swift */; }; + 696DF39F2838F0DA00E710BD /* Database.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696DF39E2838F0DA00E710BD /* Database.swift */; }; + 696DF3A12838F14700E710BD /* Logs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696DF3A02838F14700E710BD /* Logs.swift */; }; + 698D54F2283015E000766CE3 /* EncryptedRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 698D54F1283015E000766CE3 /* EncryptedRequest.swift */; }; + 698D54F428301C6800766CE3 /* Subscribe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 698D54F328301C6800766CE3 /* Subscribe.swift */; }; + 698D54F628301D7A00766CE3 /* EncryptedResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 698D54F528301D7A00766CE3 /* EncryptedResponse.swift */; }; + 6995E6A3283C011A003ABF6C /* Session.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6995E6A2283C011A003ABF6C /* Session.swift */; }; + 699DCADE283F7DFF0072D121 /* Results.swift in Sources */ = {isa = PBXBuildFile; fileRef = 699DCADD283F7DFF0072D121 /* Results.swift */; }; + 699DCAE0283F81E10072D121 /* Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 699DCADF283F81E10072D121 /* Settings.swift */; }; + 699DCAE3283FC7800072D121 /* Lang.swift in Sources */ = {isa = PBXBuildFile; fileRef = 699DCAE2283FC7800072D121 /* Lang.swift */; }; + 699DCAE5283FC7B90072D121 /* DE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 699DCAE4283FC7B90072D121 /* DE.swift */; }; + 699DCAEC283FF2320072D121 /* Exception.swift in Sources */ = {isa = PBXBuildFile; fileRef = 699DCAEB283FF2320072D121 /* Exception.swift */; }; + 699DCAF0283FF6AB0072D121 /* Success.swift in Sources */ = {isa = PBXBuildFile; fileRef = 699DCAEF283FF6AB0072D121 /* Success.swift */; }; + 69A0CA55281D124200DEA57A /* SHA512.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69A0CA54281D124200DEA57A /* SHA512.swift */; }; + 69A0CA57281D7B5F00DEA57A /* Curve25519.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69A0CA56281D7B5F00DEA57A /* Curve25519.swift */; }; + 69AB1FA028422AAC008045E1 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69AB1F9F28422AAC008045E1 /* Download.swift */; }; + 69AB1FA228424279008045E1 /* CheckFileChecksum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69AB1FA128424279008045E1 /* CheckFileChecksum.swift */; }; + 69AB1FAA2842572D008045E1 /* PDFViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69AB1FA92842572D008045E1 /* PDFViewController.swift */; }; + 69AD77AE2849266800FB6F3D /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69AD77AD2849266800FB6F3D /* Button.swift */; }; + 69B7A110281C59F000A249C6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69B7A10F281C59F000A249C6 /* AppDelegate.swift */; }; + 69B7A112281C59F000A249C6 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69B7A111281C59F000A249C6 /* SceneDelegate.swift */; }; + 69B7A114281C59F000A249C6 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69B7A113281C59F000A249C6 /* ViewController.swift */; }; + 69B7A117281C59F000A249C6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 69B7A115281C59F000A249C6 /* Main.storyboard */; }; + 69B7A119281C59F200A249C6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 69B7A118281C59F200A249C6 /* Assets.xcassets */; }; + 69B7A11C281C59F200A249C6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 69B7A11A281C59F200A249C6 /* LaunchScreen.storyboard */; }; + 69B7A127281C59F200A249C6 /* BefundTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69B7A126281C59F200A249C6 /* BefundTests.swift */; }; + 69B7A131281C59F200A249C6 /* BefundUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69B7A130281C59F200A249C6 /* BefundUITests.swift */; }; + 69B7A133281C59F200A249C6 /* BefundUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69B7A132281C59F200A249C6 /* BefundUITestsLaunchTests.swift */; }; + 69C6F890284B626500F5F775 /* ic_downloading.gif in Resources */ = {isa = PBXBuildFile; fileRef = 69C6F88F284B626500F5F775 /* ic_downloading.gif */; }; + 69F1078D286A1AEA0098C451 /* EN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69F1078C286A1AEA0098C451 /* EN.swift */; }; + 69F4DE91281C88280030D34D /* Core.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69F4DE90281C88280030D34D /* Core.swift */; }; + 69F4DE93281C88600030D34D /* Security.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69F4DE92281C88600030D34D /* Security.swift */; }; + 69F4DE95281C88D70030D34D /* MD5.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69F4DE94281C88D70030D34D /* MD5.swift */; }; + 69F4DE97281C89520030D34D /* Base64.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69F4DE96281C89520030D34D /* Base64.swift */; }; + 69F4DE99281C8DE60030D34D /* AES.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69F4DE98281C8DE60030D34D /* AES.swift */; }; + 69F6BE22285CEE820073C3D0 /* GetOpened.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69F6BE21285CEE820073C3D0 /* GetOpened.swift */; }; + 69FA6FE82836271400961CE9 /* CircleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FA6FE72836271400961CE9 /* CircleButton.swift */; }; + 6E04519028BF7C1700595CF1 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E04518F28BF7C1700595CF1 /* WebViewController.swift */; }; + 6E04519328C7489400595CF1 /* PasswordTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E04519228C7489400595CF1 /* PasswordTextField.swift */; }; + 6E2A3E2628A706FB002EB204 /* UIDownPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E2A3E1A28A706FB002EB204 /* UIDownPicker.m */; }; + 6E2A3E2828A706FB002EB204 /* DownPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E2A3E1C28A706FB002EB204 /* DownPicker.m */; }; + 6E2A3E2A28A706FB002EB204 /* downArrow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6E2A3E2128A706FB002EB204 /* downArrow@2x.png */; }; + 6E2A3E2B28A706FB002EB204 /* downArrow@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6E2A3E2228A706FB002EB204 /* downArrow@3x.png */; }; + 6E2A3E2D28A706FB002EB204 /* downArrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 6E2A3E2428A706FB002EB204 /* downArrow.png */; }; + 6E31A84C28CF1D0F0046CB23 /* UIImageWithAlpha.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E31A84B28CF1D0F0046CB23 /* UIImageWithAlpha.swift */; }; + 6E3BBFB128A2657B0010B7F2 /* UISlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E3BBFB028A2657B0010B7F2 /* UISlider.swift */; }; + 6E3BBFB328A265BE0010B7F2 /* UISlider.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6E3BBFB228A265BE0010B7F2 /* UISlider.xib */; }; + 6E3CAB64287C7E3300E3064D /* Labor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E3CAB63287C7E3300E3064D /* Labor.swift */; }; + 6E3CAB662889AD6A00E3064D /* SettingsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E3CAB652889AD6A00E3064D /* SettingsController.swift */; }; + 6E3CAB682891506900E3064D /* LoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E3CAB672891506900E3064D /* LoginController.swift */; }; + 6E53C5E128BCA87C008125AC /* ScannerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E53C5E028BCA87C008125AC /* ScannerController.swift */; }; + 6E53C5E328BCDAB3008125AC /* SelectLaborController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E53C5E228BCDAB3008125AC /* SelectLaborController.swift */; }; + 6E6F186528A8EC6900610A59 /* OEGDController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E6F186428A8EC6900610A59 /* OEGDController.swift */; }; + 6E6F186728AC4D8600610A59 /* SupportController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E6F186628AC4D8600610A59 /* SupportController.swift */; }; + 6E74190D28EDABF9001632A6 /* faq.html in Resources */ = {isa = PBXBuildFile; fileRef = 6E74190C28EDABF9001632A6 /* faq.html */; }; + 6E74190F28EDBB9F001632A6 /* privacy_policy.html in Resources */ = {isa = PBXBuildFile; fileRef = 6E74190E28EDBB9F001632A6 /* privacy_policy.html */; }; + 6E74191128F60080001632A6 /* ConnectionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E74191028F60080001632A6 /* ConnectionManager.swift */; }; + 6E74191328F60871001632A6 /* AGBPolicyController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E74191228F60871001632A6 /* AGBPolicyController.swift */; }; + 6E78B22928D376AA00F2DA82 /* KeyboardExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E78B22828D376AA00F2DA82 /* KeyboardExtension.swift */; }; + 6E78B22D28E36FCE00F2DA82 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6E78B22C28E36FCE00F2DA82 /* InfoPlist.strings */; }; + 6EA6D4E9289936080009F0E7 /* ChangeVerificatorHash.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EA6D4E8289936080009F0E7 /* ChangeVerificatorHash.swift */; }; + 6EA6D4ED289BC8AD0009F0E7 /* GetPIN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EA6D4EC289BC8AD0009F0E7 /* GetPIN.swift */; }; + 6EA6D4EF289BC8C80009F0E7 /* Support.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EA6D4EE289BC8C80009F0E7 /* Support.swift */; }; + 6EA6D4F1289BCB870009F0E7 /* PIN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EA6D4F0289BCB870009F0E7 /* PIN.swift */; }; + 6EA6D4F3289BF9B40009F0E7 /* ViewControllerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EA6D4F2289BF9B40009F0E7 /* ViewControllerExtension.swift */; }; + 6EA6D4F5289D14AE0009F0E7 /* CheckBoxButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EA6D4F4289D14AE0009F0E7 /* CheckBoxButton.swift */; }; + 6EA6D4F728A106060009F0E7 /* OEGD.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EA6D4F628A106060009F0E7 /* OEGD.swift */; }; + 6EA6D4F928A10F310009F0E7 /* OEGDFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EA6D4F828A10F310009F0E7 /* OEGDFile.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 69B7A123281C59F200A249C6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 69B7A104281C59F000A249C6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 69B7A10B281C59F000A249C6; + remoteInfo = Befund; + }; + 69B7A12D281C59F200A249C6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 69B7A104281C59F000A249C6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 69B7A10B281C59F000A249C6; + remoteInfo = Befund; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 69978ED828341AED0061F365 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 690849DD281DCB26004A631F /* Log.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = ""; }; + 6949A0F6286A079D00987D04 /* Servers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Servers.swift; sourceTree = ""; }; + 694E9F71284103B000431F95 /* ViewExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewExtension.swift; sourceTree = ""; }; + 694E9F762841127300431F95 /* ResultsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultsTableViewCell.swift; sourceTree = ""; }; + 694E9F772841127300431F95 /* ResultsTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ResultsTableViewCell.xib; sourceTree = ""; }; + 694E9F7A2841299400431F95 /* Status.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Status.swift; sourceTree = ""; }; + 694FF35F282F86D40070C3F2 /* Request.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = ""; }; + 694FF363282FACFB0070C3F2 /* KeyExchange.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyExchange.swift; sourceTree = ""; }; + 694FF365282FAD3A0070C3F2 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + 694FF36A282FB4FA0070C3F2 /* PublicKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicKey.swift; sourceTree = ""; }; + 695DD3DD284690A700A7F0F0 /* Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Image.swift; sourceTree = ""; }; + 696DF3962838CF5A00E710BD /* System.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = System.swift; sourceTree = ""; }; + 696DF3982838DD6800E710BD /* Device.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Device.swift; sourceTree = ""; }; + 696DF39B2838E18100E710BD /* StorageInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StorageInfo.swift; sourceTree = ""; }; + 696DF39E2838F0DA00E710BD /* Database.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Database.swift; sourceTree = ""; }; + 696DF3A02838F14700E710BD /* Logs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logs.swift; sourceTree = ""; }; + 698D54F1283015E000766CE3 /* EncryptedRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptedRequest.swift; sourceTree = ""; }; + 698D54F328301C6800766CE3 /* Subscribe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Subscribe.swift; sourceTree = ""; }; + 698D54F528301D7A00766CE3 /* EncryptedResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptedResponse.swift; sourceTree = ""; }; + 6995E6A2283C011A003ABF6C /* Session.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Session.swift; sourceTree = ""; }; + 69978EC82834156A0061F365 /* Befund.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Befund.entitlements; sourceTree = ""; }; + 699DCADD283F7DFF0072D121 /* Results.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Results.swift; sourceTree = ""; }; + 699DCADF283F81E10072D121 /* Settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Settings.swift; sourceTree = ""; }; + 699DCAE2283FC7800072D121 /* Lang.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Lang.swift; sourceTree = ""; }; + 699DCAE4283FC7B90072D121 /* DE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DE.swift; sourceTree = ""; }; + 699DCAEB283FF2320072D121 /* Exception.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Exception.swift; sourceTree = ""; }; + 699DCAEF283FF6AB0072D121 /* Success.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Success.swift; sourceTree = ""; }; + 69A0CA54281D124200DEA57A /* SHA512.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHA512.swift; sourceTree = ""; }; + 69A0CA56281D7B5F00DEA57A /* Curve25519.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Curve25519.swift; sourceTree = ""; }; + 69A0CA58281D950000DEA57A /* AppPlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = AppPlayground.playground; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; + 69AB1F9F28422AAC008045E1 /* Download.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Download.swift; sourceTree = ""; }; + 69AB1FA128424279008045E1 /* CheckFileChecksum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckFileChecksum.swift; sourceTree = ""; }; + 69AB1FA92842572D008045E1 /* PDFViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PDFViewController.swift; sourceTree = ""; }; + 69AD77AD2849266800FB6F3D /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; + 69B7A10C281C59F000A249C6 /* Befund.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Befund.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 69B7A10F281C59F000A249C6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 69B7A111281C59F000A249C6 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 69B7A113281C59F000A249C6 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 69B7A116281C59F000A249C6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 69B7A118281C59F200A249C6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 69B7A11B281C59F200A249C6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 69B7A122281C59F200A249C6 /* BefundTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BefundTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 69B7A126281C59F200A249C6 /* BefundTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BefundTests.swift; sourceTree = ""; }; + 69B7A12C281C59F200A249C6 /* BefundUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BefundUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 69B7A130281C59F200A249C6 /* BefundUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BefundUITests.swift; sourceTree = ""; }; + 69B7A132281C59F200A249C6 /* BefundUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BefundUITestsLaunchTests.swift; sourceTree = ""; }; + 69C6F88F284B626500F5F775 /* ic_downloading.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = ic_downloading.gif; sourceTree = ""; }; + 69F1078C286A1AEA0098C451 /* EN.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EN.swift; sourceTree = ""; }; + 69F4DE90281C88280030D34D /* Core.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Core.swift; sourceTree = ""; }; + 69F4DE92281C88600030D34D /* Security.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Security.swift; sourceTree = ""; }; + 69F4DE94281C88D70030D34D /* MD5.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MD5.swift; sourceTree = ""; }; + 69F4DE96281C89520030D34D /* Base64.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Base64.swift; sourceTree = ""; }; + 69F4DE98281C8DE60030D34D /* AES.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AES.swift; sourceTree = ""; }; + 69F6BE21285CEE820073C3D0 /* GetOpened.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetOpened.swift; sourceTree = ""; }; + 69FA6FE72836271400961CE9 /* CircleButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleButton.swift; sourceTree = ""; }; + 6E04518F28BF7C1700595CF1 /* WebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = ""; }; + 6E04519228C7489400595CF1 /* PasswordTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordTextField.swift; sourceTree = ""; }; + 6E2A3E1A28A706FB002EB204 /* UIDownPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIDownPicker.m; sourceTree = ""; }; + 6E2A3E1C28A706FB002EB204 /* DownPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DownPicker.m; sourceTree = ""; }; + 6E2A3E1D28A706FB002EB204 /* UIDownPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDownPicker.h; sourceTree = ""; }; + 6E2A3E1E28A706FB002EB204 /* DownPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DownPicker.h; sourceTree = ""; }; + 6E2A3E2128A706FB002EB204 /* downArrow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "downArrow@2x.png"; sourceTree = ""; }; + 6E2A3E2228A706FB002EB204 /* downArrow@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "downArrow@3x.png"; sourceTree = ""; }; + 6E2A3E2428A706FB002EB204 /* downArrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = downArrow.png; sourceTree = ""; }; + 6E2A3E2F28A70C22002EB204 /* Befund-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Befund-Bridging-Header.h"; sourceTree = ""; }; + 6E31A84B28CF1D0F0046CB23 /* UIImageWithAlpha.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIImageWithAlpha.swift; sourceTree = ""; }; + 6E3BBFB028A2657B0010B7F2 /* UISlider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UISlider.swift; sourceTree = ""; }; + 6E3BBFB228A265BE0010B7F2 /* UISlider.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = UISlider.xib; sourceTree = ""; }; + 6E3CAB63287C7E3300E3064D /* Labor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Labor.swift; sourceTree = ""; }; + 6E3CAB652889AD6A00E3064D /* SettingsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsController.swift; sourceTree = ""; }; + 6E3CAB672891506900E3064D /* LoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginController.swift; sourceTree = ""; }; + 6E53C5E028BCA87C008125AC /* ScannerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScannerController.swift; sourceTree = ""; }; + 6E53C5E228BCDAB3008125AC /* SelectLaborController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectLaborController.swift; sourceTree = ""; }; + 6E6F186428A8EC6900610A59 /* OEGDController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OEGDController.swift; sourceTree = ""; }; + 6E6F186628AC4D8600610A59 /* SupportController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportController.swift; sourceTree = ""; }; + 6E74190C28EDABF9001632A6 /* faq.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = faq.html; sourceTree = ""; }; + 6E74190E28EDBB9F001632A6 /* privacy_policy.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = privacy_policy.html; sourceTree = ""; }; + 6E74191028F60080001632A6 /* ConnectionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionManager.swift; sourceTree = ""; }; + 6E74191228F60871001632A6 /* AGBPolicyController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AGBPolicyController.swift; sourceTree = ""; }; + 6E78B22828D376AA00F2DA82 /* KeyboardExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardExtension.swift; sourceTree = ""; }; + 6E78B22C28E36FCE00F2DA82 /* InfoPlist.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = InfoPlist.strings; sourceTree = ""; }; + 6EA6D4E8289936080009F0E7 /* ChangeVerificatorHash.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangeVerificatorHash.swift; sourceTree = ""; }; + 6EA6D4EC289BC8AD0009F0E7 /* GetPIN.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetPIN.swift; sourceTree = ""; }; + 6EA6D4EE289BC8C80009F0E7 /* Support.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Support.swift; sourceTree = ""; }; + 6EA6D4F0289BCB870009F0E7 /* PIN.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PIN.swift; sourceTree = ""; }; + 6EA6D4F2289BF9B40009F0E7 /* ViewControllerExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerExtension.swift; sourceTree = ""; }; + 6EA6D4F4289D14AE0009F0E7 /* CheckBoxButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckBoxButton.swift; sourceTree = ""; }; + 6EA6D4F628A106060009F0E7 /* OEGD.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OEGD.swift; sourceTree = ""; }; + 6EA6D4F828A10F310009F0E7 /* OEGDFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OEGDFile.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 69B7A109281C59F000A249C6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 69B7A11F281C59F200A249C6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 69B7A129281C59F200A249C6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 694E9F702841039C00431F95 /* Extensions */ = { + isa = PBXGroup; + children = ( + 694E9F71284103B000431F95 /* ViewExtension.swift */, + 69AD77AD2849266800FB6F3D /* Button.swift */, + 6EA6D4F2289BF9B40009F0E7 /* ViewControllerExtension.swift */, + 6EA6D4F4289D14AE0009F0E7 /* CheckBoxButton.swift */, + 695DD3DD284690A700A7F0F0 /* Image.swift */, + 6E78B22828D376AA00F2DA82 /* KeyboardExtension.swift */, + 6E74191028F60080001632A6 /* ConnectionManager.swift */, + ); + path = Extensions; + sourceTree = ""; + }; + 694E9F7328410E9100431F95 /* UITableViewCell */ = { + isa = PBXGroup; + children = ( + 694E9F762841127300431F95 /* ResultsTableViewCell.swift */, + 694E9F772841127300431F95 /* ResultsTableViewCell.xib */, + ); + path = UITableViewCell; + sourceTree = ""; + }; + 694FF35E282F86B10070C3F2 /* Https */ = { + isa = PBXGroup; + children = ( + 694FF35F282F86D40070C3F2 /* Request.swift */, + 6949A0F6286A079D00987D04 /* Servers.swift */, + ); + path = Https; + sourceTree = ""; + }; + 694FF361282FACCE0070C3F2 /* Models */ = { + isa = PBXGroup; + children = ( + 699DCADC283F7DDB0072D121 /* Database */, + 696DF39A2838E13E00E710BD /* System */, + 694FF369282FB4E90070C3F2 /* Response */, + 694FF362282FACE30070C3F2 /* Request */, + 694FF365282FAD3A0070C3F2 /* Models.swift */, + 6995E6A2283C011A003ABF6C /* Session.swift */, + 699DCADF283F81E10072D121 /* Settings.swift */, + 6E3CAB63287C7E3300E3064D /* Labor.swift */, + 6EA6D4F628A106060009F0E7 /* OEGD.swift */, + 6EA6D4F828A10F310009F0E7 /* OEGDFile.swift */, + ); + path = Models; + sourceTree = ""; + }; + 694FF362282FACE30070C3F2 /* Request */ = { + isa = PBXGroup; + children = ( + 694FF363282FACFB0070C3F2 /* KeyExchange.swift */, + 698D54F1283015E000766CE3 /* EncryptedRequest.swift */, + 698D54F328301C6800766CE3 /* Subscribe.swift */, + 69AB1FA128424279008045E1 /* CheckFileChecksum.swift */, + 69F6BE21285CEE820073C3D0 /* GetOpened.swift */, + 6EA6D4E8289936080009F0E7 /* ChangeVerificatorHash.swift */, + 6EA6D4EC289BC8AD0009F0E7 /* GetPIN.swift */, + 6EA6D4EE289BC8C80009F0E7 /* Support.swift */, + ); + path = Request; + sourceTree = ""; + }; + 694FF369282FB4E90070C3F2 /* Response */ = { + isa = PBXGroup; + children = ( + 699DCAEB283FF2320072D121 /* Exception.swift */, + 694FF36A282FB4FA0070C3F2 /* PublicKey.swift */, + 698D54F528301D7A00766CE3 /* EncryptedResponse.swift */, + 699DCAEF283FF6AB0072D121 /* Success.swift */, + 69AB1F9F28422AAC008045E1 /* Download.swift */, + 6EA6D4F0289BCB870009F0E7 /* PIN.swift */, + ); + path = Response; + sourceTree = ""; + }; + 696B7546283685B100C8637D /* Buttons */ = { + isa = PBXGroup; + children = ( + 69FA6FE72836271400961CE9 /* CircleButton.swift */, + ); + path = Buttons; + sourceTree = ""; + }; + 696B7548283685E000C8637D /* Controllers */ = { + isa = PBXGroup; + children = ( + 6E6F186428A8EC6900610A59 /* OEGDController.swift */, + 69B7A113281C59F000A249C6 /* ViewController.swift */, + 69AB1FA92842572D008045E1 /* PDFViewController.swift */, + 6E3CAB652889AD6A00E3064D /* SettingsController.swift */, + 6E3CAB672891506900E3064D /* LoginController.swift */, + 6E6F186628AC4D8600610A59 /* SupportController.swift */, + 6E53C5E028BCA87C008125AC /* ScannerController.swift */, + 6E53C5E228BCDAB3008125AC /* SelectLaborController.swift */, + 6E74191228F60871001632A6 /* AGBPolicyController.swift */, + ); + path = Controllers; + sourceTree = ""; + }; + 696B75492836860100C8637D /* Screens */ = { + isa = PBXGroup; + children = ( + 69B7A115281C59F000A249C6 /* Main.storyboard */, + 69B7A11A281C59F200A249C6 /* LaunchScreen.storyboard */, + ); + path = Screens; + sourceTree = ""; + }; + 696DF39A2838E13E00E710BD /* System */ = { + isa = PBXGroup; + children = ( + 696DF3982838DD6800E710BD /* Device.swift */, + 696DF39B2838E18100E710BD /* StorageInfo.swift */, + ); + path = System; + sourceTree = ""; + }; + 696DF39D2838F07100E710BD /* Database */ = { + isa = PBXGroup; + children = ( + 696DF39E2838F0DA00E710BD /* Database.swift */, + 696DF3A02838F14700E710BD /* Logs.swift */, + ); + path = Database; + sourceTree = ""; + }; + 699DCADC283F7DDB0072D121 /* Database */ = { + isa = PBXGroup; + children = ( + 699DCADD283F7DFF0072D121 /* Results.swift */, + 694E9F7A2841299400431F95 /* Status.swift */, + ); + path = Database; + sourceTree = ""; + }; + 699DCAE1283FC7310072D121 /* Lang */ = { + isa = PBXGroup; + children = ( + 699DCAE2283FC7800072D121 /* Lang.swift */, + 699DCAE4283FC7B90072D121 /* DE.swift */, + 69F1078C286A1AEA0098C451 /* EN.swift */, + ); + path = Lang; + sourceTree = ""; + }; + 699EC2FF284E04F100A794F1 /* Files */ = { + isa = PBXGroup; + children = ( + 6E74190E28EDBB9F001632A6 /* privacy_policy.html */, + 6E74190C28EDABF9001632A6 /* faq.html */, + 6E78B22C28E36FCE00F2DA82 /* InfoPlist.strings */, + ); + path = Files; + sourceTree = ""; + }; + 69B7A103281C59F000A249C6 = { + isa = PBXGroup; + children = ( + 69B7A10E281C59F000A249C6 /* Befund */, + 69B7A125281C59F200A249C6 /* BefundTests */, + 69B7A12F281C59F200A249C6 /* BefundUITests */, + 69B7A10D281C59F000A249C6 /* Products */, + ); + sourceTree = ""; + }; + 69B7A10D281C59F000A249C6 /* Products */ = { + isa = PBXGroup; + children = ( + 69B7A10C281C59F000A249C6 /* Befund.app */, + 69B7A122281C59F200A249C6 /* BefundTests.xctest */, + 69B7A12C281C59F200A249C6 /* BefundUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 69B7A10E281C59F000A249C6 /* Befund */ = { + isa = PBXGroup; + children = ( + 699EC2FF284E04F100A794F1 /* Files */, + 696B75492836860100C8637D /* Screens */, + 696B7548283685E000C8637D /* Controllers */, + 69FA6FE6283626F700961CE9 /* Controls */, + 69978EC82834156A0061F365 /* Befund.entitlements */, + 69F4DE88281C80380030D34D /* Core */, + 69B7A10F281C59F000A249C6 /* AppDelegate.swift */, + 69B7A111281C59F000A249C6 /* SceneDelegate.swift */, + 69B7A118281C59F200A249C6 /* Assets.xcassets */, + 69C6F88F284B626500F5F775 /* ic_downloading.gif */, + 6E2A3E2F28A70C22002EB204 /* Befund-Bridging-Header.h */, + ); + path = Befund; + sourceTree = ""; + }; + 69B7A125281C59F200A249C6 /* BefundTests */ = { + isa = PBXGroup; + children = ( + 69B7A126281C59F200A249C6 /* BefundTests.swift */, + 69A0CA58281D950000DEA57A /* AppPlayground.playground */, + ); + path = BefundTests; + sourceTree = ""; + }; + 69B7A12F281C59F200A249C6 /* BefundUITests */ = { + isa = PBXGroup; + children = ( + 69B7A130281C59F200A249C6 /* BefundUITests.swift */, + 69B7A132281C59F200A249C6 /* BefundUITestsLaunchTests.swift */, + ); + path = BefundUITests; + sourceTree = ""; + }; + 69F4DE88281C80380030D34D /* Core */ = { + isa = PBXGroup; + children = ( + 694E9F702841039C00431F95 /* Extensions */, + 699DCAE1283FC7310072D121 /* Lang */, + 696DF39D2838F07100E710BD /* Database */, + 694FF361282FACCE0070C3F2 /* Models */, + 694FF35E282F86B10070C3F2 /* Https */, + 69F4DE89281C80400030D34D /* Security */, + 69F4DE90281C88280030D34D /* Core.swift */, + 690849DD281DCB26004A631F /* Log.swift */, + 696DF3962838CF5A00E710BD /* System.swift */, + ); + path = Core; + sourceTree = ""; + }; + 69F4DE89281C80400030D34D /* Security */ = { + isa = PBXGroup; + children = ( + 69F4DE92281C88600030D34D /* Security.swift */, + 69F4DE94281C88D70030D34D /* MD5.swift */, + 69F4DE96281C89520030D34D /* Base64.swift */, + 69F4DE98281C8DE60030D34D /* AES.swift */, + 69A0CA54281D124200DEA57A /* SHA512.swift */, + 69A0CA56281D7B5F00DEA57A /* Curve25519.swift */, + ); + path = Security; + sourceTree = ""; + }; + 69FA6FE6283626F700961CE9 /* Controls */ = { + isa = PBXGroup; + children = ( + 6E04519128C7483A00595CF1 /* PasswordText */, + 6E04518E28BF7BDA00595CF1 /* WebView */, + 6E2A3E1828A706FB002EB204 /* DownPicker */, + 6E3BBFAF28A1E98E0010B7F2 /* UISlider */, + 694E9F7328410E9100431F95 /* UITableViewCell */, + 696B7546283685B100C8637D /* Buttons */, + 6E31A84B28CF1D0F0046CB23 /* UIImageWithAlpha.swift */, + ); + path = Controls; + sourceTree = ""; + }; + 6E04518E28BF7BDA00595CF1 /* WebView */ = { + isa = PBXGroup; + children = ( + 6E04518F28BF7C1700595CF1 /* WebViewController.swift */, + ); + path = WebView; + sourceTree = ""; + }; + 6E04519128C7483A00595CF1 /* PasswordText */ = { + isa = PBXGroup; + children = ( + 6E04519228C7489400595CF1 /* PasswordTextField.swift */, + ); + name = PasswordText; + sourceTree = ""; + }; + 6E2A3E1828A706FB002EB204 /* DownPicker */ = { + isa = PBXGroup; + children = ( + 6E2A3E1928A706FB002EB204 /* Classes */, + 6E2A3E2028A706FB002EB204 /* Assets */, + ); + path = DownPicker; + sourceTree = ""; + }; + 6E2A3E1928A706FB002EB204 /* Classes */ = { + isa = PBXGroup; + children = ( + 6E2A3E1A28A706FB002EB204 /* UIDownPicker.m */, + 6E2A3E1C28A706FB002EB204 /* DownPicker.m */, + 6E2A3E1D28A706FB002EB204 /* UIDownPicker.h */, + 6E2A3E1E28A706FB002EB204 /* DownPicker.h */, + ); + path = Classes; + sourceTree = ""; + }; + 6E2A3E2028A706FB002EB204 /* Assets */ = { + isa = PBXGroup; + children = ( + 6E2A3E2128A706FB002EB204 /* downArrow@2x.png */, + 6E2A3E2228A706FB002EB204 /* downArrow@3x.png */, + 6E2A3E2428A706FB002EB204 /* downArrow.png */, + ); + path = Assets; + sourceTree = ""; + }; + 6E3BBFAF28A1E98E0010B7F2 /* UISlider */ = { + isa = PBXGroup; + children = ( + 6E3BBFB028A2657B0010B7F2 /* UISlider.swift */, + 6E3BBFB228A265BE0010B7F2 /* UISlider.xib */, + ); + path = UISlider; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 69B7A10B281C59F000A249C6 /* Befund */ = { + isa = PBXNativeTarget; + buildConfigurationList = 69B7A136281C59F200A249C6 /* Build configuration list for PBXNativeTarget "Befund" */; + buildPhases = ( + 69B7A108281C59F000A249C6 /* Sources */, + 69B7A109281C59F000A249C6 /* Frameworks */, + 69B7A10A281C59F000A249C6 /* Resources */, + 69978ED828341AED0061F365 /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Befund; + productName = Befund; + productReference = 69B7A10C281C59F000A249C6 /* Befund.app */; + productType = "com.apple.product-type.application"; + }; + 69B7A121281C59F200A249C6 /* BefundTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 69B7A139281C59F200A249C6 /* Build configuration list for PBXNativeTarget "BefundTests" */; + buildPhases = ( + 69B7A11E281C59F200A249C6 /* Sources */, + 69B7A11F281C59F200A249C6 /* Frameworks */, + 69B7A120281C59F200A249C6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 69B7A124281C59F200A249C6 /* PBXTargetDependency */, + ); + name = BefundTests; + productName = BefundTests; + productReference = 69B7A122281C59F200A249C6 /* BefundTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 69B7A12B281C59F200A249C6 /* BefundUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 69B7A13C281C59F200A249C6 /* Build configuration list for PBXNativeTarget "BefundUITests" */; + buildPhases = ( + 69B7A128281C59F200A249C6 /* Sources */, + 69B7A129281C59F200A249C6 /* Frameworks */, + 69B7A12A281C59F200A249C6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 69B7A12E281C59F200A249C6 /* PBXTargetDependency */, + ); + name = BefundUITests; + productName = BefundUITests; + productReference = 69B7A12C281C59F200A249C6 /* BefundUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 69B7A104281C59F000A249C6 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1330; + LastUpgradeCheck = 1310; + ORGANIZATIONNAME = "MVZ Dr. Stein und Kollegen"; + TargetAttributes = { + 69B7A10B281C59F000A249C6 = { + CreatedOnToolsVersion = 13.1; + }; + 69B7A121281C59F200A249C6 = { + CreatedOnToolsVersion = 13.1; + TestTargetID = 69B7A10B281C59F000A249C6; + }; + 69B7A12B281C59F200A249C6 = { + CreatedOnToolsVersion = 13.1; + TestTargetID = 69B7A10B281C59F000A249C6; + }; + }; + }; + buildConfigurationList = 69B7A107281C59F000A249C6 /* Build configuration list for PBXProject "Befund" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 69B7A103281C59F000A249C6; + productRefGroup = 69B7A10D281C59F000A249C6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 69B7A10B281C59F000A249C6 /* Befund */, + 69B7A121281C59F200A249C6 /* BefundTests */, + 69B7A12B281C59F200A249C6 /* BefundUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 69B7A10A281C59F000A249C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 69B7A11C281C59F200A249C6 /* LaunchScreen.storyboard in Resources */, + 6E2A3E2D28A706FB002EB204 /* downArrow.png in Resources */, + 6E2A3E2A28A706FB002EB204 /* downArrow@2x.png in Resources */, + 69C6F890284B626500F5F775 /* ic_downloading.gif in Resources */, + 6E3BBFB328A265BE0010B7F2 /* UISlider.xib in Resources */, + 69B7A119281C59F200A249C6 /* Assets.xcassets in Resources */, + 694E9F792841127300431F95 /* ResultsTableViewCell.xib in Resources */, + 6E2A3E2B28A706FB002EB204 /* downArrow@3x.png in Resources */, + 69B7A117281C59F000A249C6 /* Main.storyboard in Resources */, + 6E74190D28EDABF9001632A6 /* faq.html in Resources */, + 6E78B22D28E36FCE00F2DA82 /* InfoPlist.strings in Resources */, + 6E74190F28EDBB9F001632A6 /* privacy_policy.html in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 69B7A120281C59F200A249C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 69B7A12A281C59F200A249C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 69B7A108281C59F000A249C6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 696DF3972838CF5A00E710BD /* System.swift in Sources */, + 6E31A84C28CF1D0F0046CB23 /* UIImageWithAlpha.swift in Sources */, + 69A0CA55281D124200DEA57A /* SHA512.swift in Sources */, + 694FF360282F86D40070C3F2 /* Request.swift in Sources */, + 694E9F7B2841299400431F95 /* Status.swift in Sources */, + 6E3CAB682891506900E3064D /* LoginController.swift in Sources */, + 69F4DE91281C88280030D34D /* Core.swift in Sources */, + 698D54F628301D7A00766CE3 /* EncryptedResponse.swift in Sources */, + 699DCAEC283FF2320072D121 /* Exception.swift in Sources */, + 694E9F72284103B000431F95 /* ViewExtension.swift in Sources */, + 6E74191128F60080001632A6 /* ConnectionManager.swift in Sources */, + 690849DE281DCB26004A631F /* Log.swift in Sources */, + 694FF364282FACFB0070C3F2 /* KeyExchange.swift in Sources */, + 6EA6D4F1289BCB870009F0E7 /* PIN.swift in Sources */, + 6E2A3E2828A706FB002EB204 /* DownPicker.m in Sources */, + 699DCAE3283FC7800072D121 /* Lang.swift in Sources */, + 6EA6D4F5289D14AE0009F0E7 /* CheckBoxButton.swift in Sources */, + 6EA6D4F3289BF9B40009F0E7 /* ViewControllerExtension.swift in Sources */, + 69AB1FA228424279008045E1 /* CheckFileChecksum.swift in Sources */, + 6E04519028BF7C1700595CF1 /* WebViewController.swift in Sources */, + 6EA6D4ED289BC8AD0009F0E7 /* GetPIN.swift in Sources */, + 699DCAF0283FF6AB0072D121 /* Success.swift in Sources */, + 6E53C5E128BCA87C008125AC /* ScannerController.swift in Sources */, + 6EA6D4E9289936080009F0E7 /* ChangeVerificatorHash.swift in Sources */, + 695DD3DE284690A700A7F0F0 /* Image.swift in Sources */, + 696DF39C2838E18100E710BD /* StorageInfo.swift in Sources */, + 69B7A114281C59F000A249C6 /* ViewController.swift in Sources */, + 6E6F186728AC4D8600610A59 /* SupportController.swift in Sources */, + 69F4DE95281C88D70030D34D /* MD5.swift in Sources */, + 6E53C5E328BCDAB3008125AC /* SelectLaborController.swift in Sources */, + 6995E6A3283C011A003ABF6C /* Session.swift in Sources */, + 696DF3A12838F14700E710BD /* Logs.swift in Sources */, + 69A0CA57281D7B5F00DEA57A /* Curve25519.swift in Sources */, + 6E78B22928D376AA00F2DA82 /* KeyboardExtension.swift in Sources */, + 698D54F428301C6800766CE3 /* Subscribe.swift in Sources */, + 6EA6D4F928A10F310009F0E7 /* OEGDFile.swift in Sources */, + 69AB1FA028422AAC008045E1 /* Download.swift in Sources */, + 698D54F2283015E000766CE3 /* EncryptedRequest.swift in Sources */, + 699DCADE283F7DFF0072D121 /* Results.swift in Sources */, + 6EA6D4EF289BC8C80009F0E7 /* Support.swift in Sources */, + 6E3CAB662889AD6A00E3064D /* SettingsController.swift in Sources */, + 6EA6D4F728A106060009F0E7 /* OEGD.swift in Sources */, + 696DF3992838DD6800E710BD /* Device.swift in Sources */, + 69B7A110281C59F000A249C6 /* AppDelegate.swift in Sources */, + 6E2A3E2628A706FB002EB204 /* UIDownPicker.m in Sources */, + 69F1078D286A1AEA0098C451 /* EN.swift in Sources */, + 69F4DE97281C89520030D34D /* Base64.swift in Sources */, + 694FF36B282FB4FA0070C3F2 /* PublicKey.swift in Sources */, + 699DCAE5283FC7B90072D121 /* DE.swift in Sources */, + 69F4DE99281C8DE60030D34D /* AES.swift in Sources */, + 6E6F186528A8EC6900610A59 /* OEGDController.swift in Sources */, + 694E9F782841127300431F95 /* ResultsTableViewCell.swift in Sources */, + 69B7A112281C59F000A249C6 /* SceneDelegate.swift in Sources */, + 69F4DE93281C88600030D34D /* Security.swift in Sources */, + 6E3BBFB128A2657B0010B7F2 /* UISlider.swift in Sources */, + 6E04519328C7489400595CF1 /* PasswordTextField.swift in Sources */, + 6E74191328F60871001632A6 /* AGBPolicyController.swift in Sources */, + 694FF366282FAD3A0070C3F2 /* Models.swift in Sources */, + 699DCAE0283F81E10072D121 /* Settings.swift in Sources */, + 6949A0F7286A079D00987D04 /* Servers.swift in Sources */, + 69FA6FE82836271400961CE9 /* CircleButton.swift in Sources */, + 69AB1FAA2842572D008045E1 /* PDFViewController.swift in Sources */, + 69F6BE22285CEE820073C3D0 /* GetOpened.swift in Sources */, + 6E3CAB64287C7E3300E3064D /* Labor.swift in Sources */, + 69AD77AE2849266800FB6F3D /* Button.swift in Sources */, + 696DF39F2838F0DA00E710BD /* Database.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 69B7A11E281C59F200A249C6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 69B7A127281C59F200A249C6 /* BefundTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 69B7A128281C59F200A249C6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 69B7A133281C59F200A249C6 /* BefundUITestsLaunchTests.swift in Sources */, + 69B7A131281C59F200A249C6 /* BefundUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 69B7A124281C59F200A249C6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 69B7A10B281C59F000A249C6 /* Befund */; + targetProxy = 69B7A123281C59F200A249C6 /* PBXContainerItemProxy */; + }; + 69B7A12E281C59F200A249C6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 69B7A10B281C59F000A249C6 /* Befund */; + targetProxy = 69B7A12D281C59F200A249C6 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 69B7A115281C59F000A249C6 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 69B7A116281C59F000A249C6 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 69B7A11A281C59F200A249C6 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 69B7A11B281C59F200A249C6 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 69B7A134281C59F200A249C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 69B7A135281C59F200A249C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 69B7A137281C59F200A249C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = Befund/Befund.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 6; + DEVELOPMENT_TEAM = 9239XBB72R; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = Befund/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "Patienten Befundapp"; + INFOPLIST_KEY_NSCameraUsageDescription = "Die Kamera wird verwendet, um den QR-Code des Labors zu scannen"; + INFOPLIST_KEY_NSFaceIDUsageDescription = "Biometrische Daten sind notwendig um die PIN anzufordern"; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UIRequiresFullScreen = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UIUserInterfaceStyle = Light; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.1; + PRODUCT_BUNDLE_IDENTIFIER = "de.labor-stein.Befund"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/$(PROJECT_NAME)-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 69B7A138281C59F200A249C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = Befund/Befund.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 6; + DEVELOPMENT_TEAM = 9239XBB72R; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = Befund/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "Patienten Befundapp"; + INFOPLIST_KEY_NSCameraUsageDescription = "Die Kamera wird verwendet, um den QR-Code des Labors zu scannen"; + INFOPLIST_KEY_NSFaceIDUsageDescription = "Biometrische Daten sind notwendig um die PIN anzufordern"; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UIRequiresFullScreen = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UIUserInterfaceStyle = Light; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.1; + PRODUCT_BUNDLE_IDENTIFIER = "de.labor-stein.Befund"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/$(PROJECT_NAME)-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 69B7A13A281C59F200A249C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 9239XBB72R; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "de.labor-stein.BefundTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Befund.app/Befund"; + }; + name = Debug; + }; + 69B7A13B281C59F200A249C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 9239XBB72R; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "de.labor-stein.BefundTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Befund.app/Befund"; + }; + name = Release; + }; + 69B7A13D281C59F200A249C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 9239XBB72R; + GENERATE_INFOPLIST_FILE = YES; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "de.labor-stein.BefundUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = Befund; + }; + name = Debug; + }; + 69B7A13E281C59F200A249C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 9239XBB72R; + GENERATE_INFOPLIST_FILE = YES; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "de.labor-stein.BefundUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = Befund; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 69B7A107281C59F000A249C6 /* Build configuration list for PBXProject "Befund" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 69B7A134281C59F200A249C6 /* Debug */, + 69B7A135281C59F200A249C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 69B7A136281C59F200A249C6 /* Build configuration list for PBXNativeTarget "Befund" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 69B7A137281C59F200A249C6 /* Debug */, + 69B7A138281C59F200A249C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 69B7A139281C59F200A249C6 /* Build configuration list for PBXNativeTarget "BefundTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 69B7A13A281C59F200A249C6 /* Debug */, + 69B7A13B281C59F200A249C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 69B7A13C281C59F200A249C6 /* Build configuration list for PBXNativeTarget "BefundUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 69B7A13D281C59F200A249C6 /* Debug */, + 69B7A13E281C59F200A249C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 69B7A104281C59F000A249C6 /* Project object */; +} diff --git a/Befund.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Befund.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Befund.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Befund.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Befund.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Befund.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Befund.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Befund.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/Befund.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/Befund.xcodeproj/xcshareddata/xcschemes/Befund.xcscheme b/Befund.xcodeproj/xcshareddata/xcschemes/Befund.xcscheme new file mode 100644 index 0000000..9c0e7ca --- /dev/null +++ b/Befund.xcodeproj/xcshareddata/xcschemes/Befund.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Befund/.DS_Store b/Befund/.DS_Store new file mode 100644 index 0000000..a00cef4 Binary files /dev/null and b/Befund/.DS_Store differ diff --git a/Befund/AppDelegate.swift b/Befund/AppDelegate.swift new file mode 100644 index 0000000..3a1245a --- /dev/null +++ b/Befund/AppDelegate.swift @@ -0,0 +1,83 @@ +// +// AppDelegate.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 29.04.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import UIKit +import UserNotifications + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + public static var Session: Core.Models.Session = Core.Models.Session() + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool + { + + Initialize(application: application) + sleep(1) + return true + } + + /** + * Initializes the application contexts + */ + func Initialize(application: UIApplication) + { + Core.Log.Initialize() + Core.Database.Results.CreateDBIfNotExists() + //let pre = Locale.current.language.languageCode?.identifier + //Core.Lang.SetLanguage(lang: (pre != "de" ? Core.Lang.Languages.EN : Core.Lang.Languages.DE)) + + //Core.Lang.SetLanguage(lang: .DE) + AppDelegate.Session.Device = Core.System.GetDevice() + AppDelegate.Session.NotificationGranted = false + } + + func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) + { + AppDelegate.Session.Device!.token = deviceToken.map { data in String(format: "%02.2hhx", data) }.joined() + Core.Log.Info(msg: "Device got a push notification token", namespace: "AppDelegate", method: "application(didRegisterForRemoteNotificationsWithDeviceToken)") + ViewController.CurrentViewController?.onSessionChanged(session: AppDelegate.Session) + } + + func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) + { + AppDelegate.Session.NotificationGranted = false + let nsError = error as NSError + if (nsError.code==3010) + { + //emulator doesn't support push notification and can't be registered and get device_token. + //But we need it for test Request where device_token is checked for nil/empty + AppDelegate.Session.Device!.token = "EmulatorDeviceToken1234567890" + Core.Log.Info(msg: "Set device token to EmulatorDeviceToken1234567890, because in emulator mode remote notification is not supported. ", namespace: "AppDelegate", method: "application(didFailToRegisterForRemoteNotificationsWithError)") + } + else + { + AppDelegate.Session.Device!.token = nil + Core.Log.Critical(err: error, namespace: "AppDelegate", method: "application(didFailToRegisterForRemoteNotificationsWithError)") + } + + if(ViewController.CurrentViewController != nil) + { + ViewController.CurrentViewController!.onSessionChanged(session: AppDelegate.Session) + } + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } +} + diff --git a/Befund/Assets.xcassets/.DS_Store b/Befund/Assets.xcassets/.DS_Store new file mode 100644 index 0000000..4d4b31d Binary files /dev/null and b/Befund/Assets.xcassets/.DS_Store differ diff --git a/Befund/Assets.xcassets/AccentColor.colorset/Contents.json b/Befund/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/Befund/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/AppIcon-1.appiconset/Contents.json b/Befund/Assets.xcassets/AppIcon-1.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/Befund/Assets.xcassets/AppIcon-1.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/Contents.json b/Befund/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..106570b --- /dev/null +++ b/Befund/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,116 @@ +{ + "images" : [ + { + "filename" : "icon_40-1.jpg", + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "icon_60.jpg", + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "filename" : "Icon_58-1.jpg", + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "icon_87.jpg", + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "icon_80-1.jpg", + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "icon_120.jpg", + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "filename" : "icon_120-1.jpg", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "Icon_180.jpg", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "filename" : "icon_20.jpg", + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "filename" : "icon_40.jpg", + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "icon_29.jpg", + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "Icon_58.jpg", + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "icon_40-2.jpg", + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "filename" : "icon_80.jpg", + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "icon_76.jpg", + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "filename" : "icon_152.jpg", + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "filename" : "icon_167.jpg", + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "Icon.jpg", + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/Icon.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/Icon.jpg new file mode 100644 index 0000000..0781530 Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/Icon.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/Icon_180.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/Icon_180.jpg new file mode 100644 index 0000000..4caaeab Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/Icon_180.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/Icon_58-1.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/Icon_58-1.jpg new file mode 100644 index 0000000..aa7848d Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/Icon_58-1.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/Icon_58.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/Icon_58.jpg new file mode 100644 index 0000000..aa7848d Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/Icon_58.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_120-1.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_120-1.jpg new file mode 100644 index 0000000..67541c4 Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_120-1.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_120.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_120.jpg new file mode 100644 index 0000000..67541c4 Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_120.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_152.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_152.jpg new file mode 100644 index 0000000..00cb0fd Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_152.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_167.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_167.jpg new file mode 100644 index 0000000..c372cd5 Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_167.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_20.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_20.jpg new file mode 100644 index 0000000..c0e2236 Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_20.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_29.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_29.jpg new file mode 100644 index 0000000..4f49e17 Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_29.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_40-1.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_40-1.jpg new file mode 100644 index 0000000..b86d70d Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_40-1.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_40-2.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_40-2.jpg new file mode 100644 index 0000000..b86d70d Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_40-2.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_40.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_40.jpg new file mode 100644 index 0000000..b86d70d Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_40.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_60.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_60.jpg new file mode 100644 index 0000000..cdaa871 Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_60.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_76.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_76.jpg new file mode 100644 index 0000000..59ae248 Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_76.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_80-1.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_80-1.jpg new file mode 100644 index 0000000..b18c123 Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_80-1.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_80.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_80.jpg new file mode 100644 index 0000000..b18c123 Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_80.jpg differ diff --git a/Befund/Assets.xcassets/AppIcon.appiconset/icon_87.jpg b/Befund/Assets.xcassets/AppIcon.appiconset/icon_87.jpg new file mode 100644 index 0000000..7227e51 Binary files /dev/null and b/Befund/Assets.xcassets/AppIcon.appiconset/icon_87.jpg differ diff --git a/Befund/Assets.xcassets/Contents.json b/Befund/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Befund/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/New Folder/Contents.json b/Befund/Assets.xcassets/New Folder/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Befund/Assets.xcassets/New Folder/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/New Folder/ic_do_not_disturb_on.imageset/Contents.json b/Befund/Assets.xcassets/New Folder/ic_do_not_disturb_on.imageset/Contents.json new file mode 100644 index 0000000..d28ed86 --- /dev/null +++ b/Befund/Assets.xcassets/New Folder/ic_do_not_disturb_on.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_do_not_disturb_on.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_do_not_disturb_on-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_do_not_disturb_on-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/New Folder/ic_do_not_disturb_on.imageset/ic_do_not_disturb_on-1.png b/Befund/Assets.xcassets/New Folder/ic_do_not_disturb_on.imageset/ic_do_not_disturb_on-1.png new file mode 100644 index 0000000..32d43aa Binary files /dev/null and b/Befund/Assets.xcassets/New Folder/ic_do_not_disturb_on.imageset/ic_do_not_disturb_on-1.png differ diff --git a/Befund/Assets.xcassets/New Folder/ic_do_not_disturb_on.imageset/ic_do_not_disturb_on-2.png b/Befund/Assets.xcassets/New Folder/ic_do_not_disturb_on.imageset/ic_do_not_disturb_on-2.png new file mode 100644 index 0000000..227c829 Binary files /dev/null and b/Befund/Assets.xcassets/New Folder/ic_do_not_disturb_on.imageset/ic_do_not_disturb_on-2.png differ diff --git a/Befund/Assets.xcassets/New Folder/ic_do_not_disturb_on.imageset/ic_do_not_disturb_on.png b/Befund/Assets.xcassets/New Folder/ic_do_not_disturb_on.imageset/ic_do_not_disturb_on.png new file mode 100644 index 0000000..f8282be Binary files /dev/null and b/Befund/Assets.xcassets/New Folder/ic_do_not_disturb_on.imageset/ic_do_not_disturb_on.png differ diff --git a/Befund/Assets.xcassets/bottom_xhdpi.imageset/Contents.json b/Befund/Assets.xcassets/bottom_xhdpi.imageset/Contents.json new file mode 100644 index 0000000..ff0be91 --- /dev/null +++ b/Befund/Assets.xcassets/bottom_xhdpi.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "bottom_xhdpi.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "bottom_xxhdpi.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "bottom_xxxhdpi.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/bottom_xhdpi.imageset/bottom_xhdpi.png b/Befund/Assets.xcassets/bottom_xhdpi.imageset/bottom_xhdpi.png new file mode 100644 index 0000000..65b30d9 Binary files /dev/null and b/Befund/Assets.xcassets/bottom_xhdpi.imageset/bottom_xhdpi.png differ diff --git a/Befund/Assets.xcassets/bottom_xhdpi.imageset/bottom_xxhdpi.png b/Befund/Assets.xcassets/bottom_xhdpi.imageset/bottom_xxhdpi.png new file mode 100644 index 0000000..8dea481 Binary files /dev/null and b/Befund/Assets.xcassets/bottom_xhdpi.imageset/bottom_xxhdpi.png differ diff --git a/Befund/Assets.xcassets/bottom_xhdpi.imageset/bottom_xxxhdpi.png b/Befund/Assets.xcassets/bottom_xhdpi.imageset/bottom_xxxhdpi.png new file mode 100644 index 0000000..8539663 Binary files /dev/null and b/Befund/Assets.xcassets/bottom_xhdpi.imageset/bottom_xxxhdpi.png differ diff --git a/Befund/Assets.xcassets/btn_qrcode.imageset/Contents.json b/Befund/Assets.xcassets/btn_qrcode.imageset/Contents.json new file mode 100644 index 0000000..6fd1459 --- /dev/null +++ b/Befund/Assets.xcassets/btn_qrcode.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "btn_qrcode.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "btn_qrcode-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "btn_qrcode-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/btn_qrcode.imageset/btn_qrcode-1.png b/Befund/Assets.xcassets/btn_qrcode.imageset/btn_qrcode-1.png new file mode 100644 index 0000000..9c04bee Binary files /dev/null and b/Befund/Assets.xcassets/btn_qrcode.imageset/btn_qrcode-1.png differ diff --git a/Befund/Assets.xcassets/btn_qrcode.imageset/btn_qrcode-2.png b/Befund/Assets.xcassets/btn_qrcode.imageset/btn_qrcode-2.png new file mode 100644 index 0000000..9c04bee Binary files /dev/null and b/Befund/Assets.xcassets/btn_qrcode.imageset/btn_qrcode-2.png differ diff --git a/Befund/Assets.xcassets/btn_qrcode.imageset/btn_qrcode.png b/Befund/Assets.xcassets/btn_qrcode.imageset/btn_qrcode.png new file mode 100644 index 0000000..9c04bee Binary files /dev/null and b/Befund/Assets.xcassets/btn_qrcode.imageset/btn_qrcode.png differ diff --git a/Befund/Assets.xcassets/de_icon.imageset/.DS_Store b/Befund/Assets.xcassets/de_icon.imageset/.DS_Store new file mode 100644 index 0000000..1cfca55 Binary files /dev/null and b/Befund/Assets.xcassets/de_icon.imageset/.DS_Store differ diff --git a/Befund/Assets.xcassets/de_icon.imageset/Contents.json b/Befund/Assets.xcassets/de_icon.imageset/Contents.json new file mode 100644 index 0000000..08354a0 --- /dev/null +++ b/Befund/Assets.xcassets/de_icon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "de.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "de_1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "de_2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/de_icon.imageset/de.png b/Befund/Assets.xcassets/de_icon.imageset/de.png new file mode 100644 index 0000000..2fd433f Binary files /dev/null and b/Befund/Assets.xcassets/de_icon.imageset/de.png differ diff --git a/Befund/Assets.xcassets/de_icon.imageset/de_1.png b/Befund/Assets.xcassets/de_icon.imageset/de_1.png new file mode 100644 index 0000000..2fd433f Binary files /dev/null and b/Befund/Assets.xcassets/de_icon.imageset/de_1.png differ diff --git a/Befund/Assets.xcassets/de_icon.imageset/de_2.png b/Befund/Assets.xcassets/de_icon.imageset/de_2.png new file mode 100644 index 0000000..2fd433f Binary files /dev/null and b/Befund/Assets.xcassets/de_icon.imageset/de_2.png differ diff --git a/Befund/Assets.xcassets/en_icon.imageset/.DS_Store b/Befund/Assets.xcassets/en_icon.imageset/.DS_Store new file mode 100644 index 0000000..5f35036 Binary files /dev/null and b/Befund/Assets.xcassets/en_icon.imageset/.DS_Store differ diff --git a/Befund/Assets.xcassets/en_icon.imageset/Contents.json b/Befund/Assets.xcassets/en_icon.imageset/Contents.json new file mode 100644 index 0000000..d012303 --- /dev/null +++ b/Befund/Assets.xcassets/en_icon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "en.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "en_1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "en_2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/en_icon.imageset/en.png b/Befund/Assets.xcassets/en_icon.imageset/en.png new file mode 100644 index 0000000..be8a095 Binary files /dev/null and b/Befund/Assets.xcassets/en_icon.imageset/en.png differ diff --git a/Befund/Assets.xcassets/en_icon.imageset/en_1.png b/Befund/Assets.xcassets/en_icon.imageset/en_1.png new file mode 100644 index 0000000..be8a095 Binary files /dev/null and b/Befund/Assets.xcassets/en_icon.imageset/en_1.png differ diff --git a/Befund/Assets.xcassets/en_icon.imageset/en_2.png b/Befund/Assets.xcassets/en_icon.imageset/en_2.png new file mode 100644 index 0000000..be8a095 Binary files /dev/null and b/Befund/Assets.xcassets/en_icon.imageset/en_2.png differ diff --git a/Befund/Assets.xcassets/ic_add.imageset/Contents.json b/Befund/Assets.xcassets/ic_add.imageset/Contents.json new file mode 100644 index 0000000..0da1e3f --- /dev/null +++ b/Befund/Assets.xcassets/ic_add.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_add.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_add-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_add-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_add.imageset/ic_add-1.png b/Befund/Assets.xcassets/ic_add.imageset/ic_add-1.png new file mode 100644 index 0000000..8231844 Binary files /dev/null and b/Befund/Assets.xcassets/ic_add.imageset/ic_add-1.png differ diff --git a/Befund/Assets.xcassets/ic_add.imageset/ic_add-2.png b/Befund/Assets.xcassets/ic_add.imageset/ic_add-2.png new file mode 100644 index 0000000..a5d64dc Binary files /dev/null and b/Befund/Assets.xcassets/ic_add.imageset/ic_add-2.png differ diff --git a/Befund/Assets.xcassets/ic_add.imageset/ic_add.png b/Befund/Assets.xcassets/ic_add.imageset/ic_add.png new file mode 100644 index 0000000..334187b Binary files /dev/null and b/Befund/Assets.xcassets/ic_add.imageset/ic_add.png differ diff --git a/Befund/Assets.xcassets/ic_add_location.imageset/Contents.json b/Befund/Assets.xcassets/ic_add_location.imageset/Contents.json new file mode 100644 index 0000000..f0f5979 --- /dev/null +++ b/Befund/Assets.xcassets/ic_add_location.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_location_on.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_location_on-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_location_on-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_add_location.imageset/ic_location_on-1.png b/Befund/Assets.xcassets/ic_add_location.imageset/ic_location_on-1.png new file mode 100644 index 0000000..6cf44a4 Binary files /dev/null and b/Befund/Assets.xcassets/ic_add_location.imageset/ic_location_on-1.png differ diff --git a/Befund/Assets.xcassets/ic_add_location.imageset/ic_location_on-2.png b/Befund/Assets.xcassets/ic_add_location.imageset/ic_location_on-2.png new file mode 100644 index 0000000..eec0590 Binary files /dev/null and b/Befund/Assets.xcassets/ic_add_location.imageset/ic_location_on-2.png differ diff --git a/Befund/Assets.xcassets/ic_add_location.imageset/ic_location_on.png b/Befund/Assets.xcassets/ic_add_location.imageset/ic_location_on.png new file mode 100644 index 0000000..6a01fdc Binary files /dev/null and b/Befund/Assets.xcassets/ic_add_location.imageset/ic_location_on.png differ diff --git a/Befund/Assets.xcassets/ic_add_to_home_screen.imageset/Contents.json b/Befund/Assets.xcassets/ic_add_to_home_screen.imageset/Contents.json new file mode 100644 index 0000000..5f0514e --- /dev/null +++ b/Befund/Assets.xcassets/ic_add_to_home_screen.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_add_to_home_screen.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_add_to_home_screen-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_add_to_home_screen-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_add_to_home_screen.imageset/ic_add_to_home_screen-1.png b/Befund/Assets.xcassets/ic_add_to_home_screen.imageset/ic_add_to_home_screen-1.png new file mode 100644 index 0000000..a93346b Binary files /dev/null and b/Befund/Assets.xcassets/ic_add_to_home_screen.imageset/ic_add_to_home_screen-1.png differ diff --git a/Befund/Assets.xcassets/ic_add_to_home_screen.imageset/ic_add_to_home_screen-2.png b/Befund/Assets.xcassets/ic_add_to_home_screen.imageset/ic_add_to_home_screen-2.png new file mode 100644 index 0000000..324a7be Binary files /dev/null and b/Befund/Assets.xcassets/ic_add_to_home_screen.imageset/ic_add_to_home_screen-2.png differ diff --git a/Befund/Assets.xcassets/ic_add_to_home_screen.imageset/ic_add_to_home_screen.png b/Befund/Assets.xcassets/ic_add_to_home_screen.imageset/ic_add_to_home_screen.png new file mode 100644 index 0000000..0ac8df2 Binary files /dev/null and b/Befund/Assets.xcassets/ic_add_to_home_screen.imageset/ic_add_to_home_screen.png differ diff --git a/Befund/Assets.xcassets/ic_add_user.imageset/Contents.json b/Befund/Assets.xcassets/ic_add_user.imageset/Contents.json new file mode 100644 index 0000000..6eeecf6 --- /dev/null +++ b/Befund/Assets.xcassets/ic_add_user.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_add_user.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_add_user-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_add_user-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_add_user.imageset/ic_add_user-1.png b/Befund/Assets.xcassets/ic_add_user.imageset/ic_add_user-1.png new file mode 100644 index 0000000..cb30293 Binary files /dev/null and b/Befund/Assets.xcassets/ic_add_user.imageset/ic_add_user-1.png differ diff --git a/Befund/Assets.xcassets/ic_add_user.imageset/ic_add_user-2.png b/Befund/Assets.xcassets/ic_add_user.imageset/ic_add_user-2.png new file mode 100644 index 0000000..e49d835 Binary files /dev/null and b/Befund/Assets.xcassets/ic_add_user.imageset/ic_add_user-2.png differ diff --git a/Befund/Assets.xcassets/ic_add_user.imageset/ic_add_user.png b/Befund/Assets.xcassets/ic_add_user.imageset/ic_add_user.png new file mode 100644 index 0000000..487fcd6 Binary files /dev/null and b/Befund/Assets.xcassets/ic_add_user.imageset/ic_add_user.png differ diff --git a/Befund/Assets.xcassets/ic_alternate_email.imageset/Contents.json b/Befund/Assets.xcassets/ic_alternate_email.imageset/Contents.json new file mode 100644 index 0000000..9b246bf --- /dev/null +++ b/Befund/Assets.xcassets/ic_alternate_email.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_alternate_email.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_alternate_email-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_alternate_email-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_alternate_email.imageset/ic_alternate_email-1.png b/Befund/Assets.xcassets/ic_alternate_email.imageset/ic_alternate_email-1.png new file mode 100644 index 0000000..0a1593f Binary files /dev/null and b/Befund/Assets.xcassets/ic_alternate_email.imageset/ic_alternate_email-1.png differ diff --git a/Befund/Assets.xcassets/ic_alternate_email.imageset/ic_alternate_email-2.png b/Befund/Assets.xcassets/ic_alternate_email.imageset/ic_alternate_email-2.png new file mode 100644 index 0000000..fe7f758 Binary files /dev/null and b/Befund/Assets.xcassets/ic_alternate_email.imageset/ic_alternate_email-2.png differ diff --git a/Befund/Assets.xcassets/ic_alternate_email.imageset/ic_alternate_email.png b/Befund/Assets.xcassets/ic_alternate_email.imageset/ic_alternate_email.png new file mode 100644 index 0000000..cef524e Binary files /dev/null and b/Befund/Assets.xcassets/ic_alternate_email.imageset/ic_alternate_email.png differ diff --git a/Befund/Assets.xcassets/ic_av_timer.imageset/Contents.json b/Befund/Assets.xcassets/ic_av_timer.imageset/Contents.json new file mode 100644 index 0000000..9917c0e --- /dev/null +++ b/Befund/Assets.xcassets/ic_av_timer.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_av_timer.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_av_timer-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_av_timer-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_av_timer.imageset/ic_av_timer-1.png b/Befund/Assets.xcassets/ic_av_timer.imageset/ic_av_timer-1.png new file mode 100644 index 0000000..93fe28e Binary files /dev/null and b/Befund/Assets.xcassets/ic_av_timer.imageset/ic_av_timer-1.png differ diff --git a/Befund/Assets.xcassets/ic_av_timer.imageset/ic_av_timer-2.png b/Befund/Assets.xcassets/ic_av_timer.imageset/ic_av_timer-2.png new file mode 100644 index 0000000..3086923 Binary files /dev/null and b/Befund/Assets.xcassets/ic_av_timer.imageset/ic_av_timer-2.png differ diff --git a/Befund/Assets.xcassets/ic_av_timer.imageset/ic_av_timer.png b/Befund/Assets.xcassets/ic_av_timer.imageset/ic_av_timer.png new file mode 100644 index 0000000..1072b6a Binary files /dev/null and b/Befund/Assets.xcassets/ic_av_timer.imageset/ic_av_timer.png differ diff --git a/Befund/Assets.xcassets/ic_change_key.imageset/Contents.json b/Befund/Assets.xcassets/ic_change_key.imageset/Contents.json new file mode 100644 index 0000000..137ed07 --- /dev/null +++ b/Befund/Assets.xcassets/ic_change_key.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_change_key.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_change_key-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_change_key-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_change_key.imageset/ic_change_key-1.png b/Befund/Assets.xcassets/ic_change_key.imageset/ic_change_key-1.png new file mode 100644 index 0000000..e6154bb Binary files /dev/null and b/Befund/Assets.xcassets/ic_change_key.imageset/ic_change_key-1.png differ diff --git a/Befund/Assets.xcassets/ic_change_key.imageset/ic_change_key-2.png b/Befund/Assets.xcassets/ic_change_key.imageset/ic_change_key-2.png new file mode 100644 index 0000000..a1e84c5 Binary files /dev/null and b/Befund/Assets.xcassets/ic_change_key.imageset/ic_change_key-2.png differ diff --git a/Befund/Assets.xcassets/ic_change_key.imageset/ic_change_key.png b/Befund/Assets.xcassets/ic_change_key.imageset/ic_change_key.png new file mode 100644 index 0000000..7a3f698 Binary files /dev/null and b/Befund/Assets.xcassets/ic_change_key.imageset/ic_change_key.png differ diff --git a/Befund/Assets.xcassets/ic_close_menu.imageset/Contents.json b/Befund/Assets.xcassets/ic_close_menu.imageset/Contents.json new file mode 100644 index 0000000..7f627b3 --- /dev/null +++ b/Befund/Assets.xcassets/ic_close_menu.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_close_menu.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_close_menu-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_close_menu-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_close_menu.imageset/ic_close_menu-1.png b/Befund/Assets.xcassets/ic_close_menu.imageset/ic_close_menu-1.png new file mode 100644 index 0000000..d7b672f Binary files /dev/null and b/Befund/Assets.xcassets/ic_close_menu.imageset/ic_close_menu-1.png differ diff --git a/Befund/Assets.xcassets/ic_close_menu.imageset/ic_close_menu-2.png b/Befund/Assets.xcassets/ic_close_menu.imageset/ic_close_menu-2.png new file mode 100644 index 0000000..02dd70e Binary files /dev/null and b/Befund/Assets.xcassets/ic_close_menu.imageset/ic_close_menu-2.png differ diff --git a/Befund/Assets.xcassets/ic_close_menu.imageset/ic_close_menu.png b/Befund/Assets.xcassets/ic_close_menu.imageset/ic_close_menu.png new file mode 100644 index 0000000..430a04b Binary files /dev/null and b/Befund/Assets.xcassets/ic_close_menu.imageset/ic_close_menu.png differ diff --git a/Befund/Assets.xcassets/ic_data_privacy.imageset/Contents.json b/Befund/Assets.xcassets/ic_data_privacy.imageset/Contents.json new file mode 100644 index 0000000..01a4f5d --- /dev/null +++ b/Befund/Assets.xcassets/ic_data_privacy.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_data_privacy.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_data_privacy-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_data_privacy-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_data_privacy.imageset/ic_data_privacy-1.png b/Befund/Assets.xcassets/ic_data_privacy.imageset/ic_data_privacy-1.png new file mode 100644 index 0000000..56bd950 Binary files /dev/null and b/Befund/Assets.xcassets/ic_data_privacy.imageset/ic_data_privacy-1.png differ diff --git a/Befund/Assets.xcassets/ic_data_privacy.imageset/ic_data_privacy-2.png b/Befund/Assets.xcassets/ic_data_privacy.imageset/ic_data_privacy-2.png new file mode 100644 index 0000000..980e897 Binary files /dev/null and b/Befund/Assets.xcassets/ic_data_privacy.imageset/ic_data_privacy-2.png differ diff --git a/Befund/Assets.xcassets/ic_data_privacy.imageset/ic_data_privacy.png b/Befund/Assets.xcassets/ic_data_privacy.imageset/ic_data_privacy.png new file mode 100644 index 0000000..5391fd3 Binary files /dev/null and b/Befund/Assets.xcassets/ic_data_privacy.imageset/ic_data_privacy.png differ diff --git a/Befund/Assets.xcassets/ic_dehaze.imageset/Contents.json b/Befund/Assets.xcassets/ic_dehaze.imageset/Contents.json new file mode 100644 index 0000000..fcd3bdf --- /dev/null +++ b/Befund/Assets.xcassets/ic_dehaze.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_dehaze.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_dehaze-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_dehaze-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_dehaze.imageset/ic_dehaze-1.png b/Befund/Assets.xcassets/ic_dehaze.imageset/ic_dehaze-1.png new file mode 100644 index 0000000..78f9e78 Binary files /dev/null and b/Befund/Assets.xcassets/ic_dehaze.imageset/ic_dehaze-1.png differ diff --git a/Befund/Assets.xcassets/ic_dehaze.imageset/ic_dehaze-2.png b/Befund/Assets.xcassets/ic_dehaze.imageset/ic_dehaze-2.png new file mode 100644 index 0000000..9993202 Binary files /dev/null and b/Befund/Assets.xcassets/ic_dehaze.imageset/ic_dehaze-2.png differ diff --git a/Befund/Assets.xcassets/ic_dehaze.imageset/ic_dehaze.png b/Befund/Assets.xcassets/ic_dehaze.imageset/ic_dehaze.png new file mode 100644 index 0000000..1c4200c Binary files /dev/null and b/Befund/Assets.xcassets/ic_dehaze.imageset/ic_dehaze.png differ diff --git a/Befund/Assets.xcassets/ic_delete_user.imageset/Contents.json b/Befund/Assets.xcassets/ic_delete_user.imageset/Contents.json new file mode 100644 index 0000000..5a9ba37 --- /dev/null +++ b/Befund/Assets.xcassets/ic_delete_user.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_delete_user.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_delete_user-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_delete_user-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_delete_user.imageset/ic_delete_user-1.png b/Befund/Assets.xcassets/ic_delete_user.imageset/ic_delete_user-1.png new file mode 100644 index 0000000..856bc29 Binary files /dev/null and b/Befund/Assets.xcassets/ic_delete_user.imageset/ic_delete_user-1.png differ diff --git a/Befund/Assets.xcassets/ic_delete_user.imageset/ic_delete_user-2.png b/Befund/Assets.xcassets/ic_delete_user.imageset/ic_delete_user-2.png new file mode 100644 index 0000000..57b3e5f Binary files /dev/null and b/Befund/Assets.xcassets/ic_delete_user.imageset/ic_delete_user-2.png differ diff --git a/Befund/Assets.xcassets/ic_delete_user.imageset/ic_delete_user.png b/Befund/Assets.xcassets/ic_delete_user.imageset/ic_delete_user.png new file mode 100644 index 0000000..c162ece Binary files /dev/null and b/Befund/Assets.xcassets/ic_delete_user.imageset/ic_delete_user.png differ diff --git a/Befund/Assets.xcassets/ic_e_pass.imageset/Contents.json b/Befund/Assets.xcassets/ic_e_pass.imageset/Contents.json new file mode 100644 index 0000000..b045373 --- /dev/null +++ b/Befund/Assets.xcassets/ic_e_pass.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_e_pass.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_e_pass-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_e_pass-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_e_pass.imageset/ic_e_pass-1.png b/Befund/Assets.xcassets/ic_e_pass.imageset/ic_e_pass-1.png new file mode 100644 index 0000000..8403681 Binary files /dev/null and b/Befund/Assets.xcassets/ic_e_pass.imageset/ic_e_pass-1.png differ diff --git a/Befund/Assets.xcassets/ic_e_pass.imageset/ic_e_pass-2.png b/Befund/Assets.xcassets/ic_e_pass.imageset/ic_e_pass-2.png new file mode 100644 index 0000000..af88fcb Binary files /dev/null and b/Befund/Assets.xcassets/ic_e_pass.imageset/ic_e_pass-2.png differ diff --git a/Befund/Assets.xcassets/ic_e_pass.imageset/ic_e_pass.png b/Befund/Assets.xcassets/ic_e_pass.imageset/ic_e_pass.png new file mode 100644 index 0000000..1d8ba07 Binary files /dev/null and b/Befund/Assets.xcassets/ic_e_pass.imageset/ic_e_pass.png differ diff --git a/Befund/Assets.xcassets/ic_edit.imageset/Contents.json b/Befund/Assets.xcassets/ic_edit.imageset/Contents.json new file mode 100644 index 0000000..5e3b9b7 --- /dev/null +++ b/Befund/Assets.xcassets/ic_edit.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_edit.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_edit-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_edit-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_edit.imageset/ic_edit-1.png b/Befund/Assets.xcassets/ic_edit.imageset/ic_edit-1.png new file mode 100644 index 0000000..c447c16 Binary files /dev/null and b/Befund/Assets.xcassets/ic_edit.imageset/ic_edit-1.png differ diff --git a/Befund/Assets.xcassets/ic_edit.imageset/ic_edit-2.png b/Befund/Assets.xcassets/ic_edit.imageset/ic_edit-2.png new file mode 100644 index 0000000..c1e73d3 Binary files /dev/null and b/Befund/Assets.xcassets/ic_edit.imageset/ic_edit-2.png differ diff --git a/Befund/Assets.xcassets/ic_edit.imageset/ic_edit.png b/Befund/Assets.xcassets/ic_edit.imageset/ic_edit.png new file mode 100644 index 0000000..20566cf Binary files /dev/null and b/Befund/Assets.xcassets/ic_edit.imageset/ic_edit.png differ diff --git a/Befund/Assets.xcassets/ic_event.imageset/Contents.json b/Befund/Assets.xcassets/ic_event.imageset/Contents.json new file mode 100644 index 0000000..66be006 --- /dev/null +++ b/Befund/Assets.xcassets/ic_event.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_event.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_event-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_event-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_event.imageset/ic_event-1.png b/Befund/Assets.xcassets/ic_event.imageset/ic_event-1.png new file mode 100644 index 0000000..4ee8461 Binary files /dev/null and b/Befund/Assets.xcassets/ic_event.imageset/ic_event-1.png differ diff --git a/Befund/Assets.xcassets/ic_event.imageset/ic_event-2.png b/Befund/Assets.xcassets/ic_event.imageset/ic_event-2.png new file mode 100644 index 0000000..51dfbad Binary files /dev/null and b/Befund/Assets.xcassets/ic_event.imageset/ic_event-2.png differ diff --git a/Befund/Assets.xcassets/ic_event.imageset/ic_event.png b/Befund/Assets.xcassets/ic_event.imageset/ic_event.png new file mode 100644 index 0000000..3b2caee Binary files /dev/null and b/Befund/Assets.xcassets/ic_event.imageset/ic_event.png differ diff --git a/Befund/Assets.xcassets/ic_eye.imageset/Contents.json b/Befund/Assets.xcassets/ic_eye.imageset/Contents.json new file mode 100644 index 0000000..8684c6f --- /dev/null +++ b/Befund/Assets.xcassets/ic_eye.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_eye.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_eye-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_eye-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_eye.imageset/ic_eye-1.png b/Befund/Assets.xcassets/ic_eye.imageset/ic_eye-1.png new file mode 100644 index 0000000..2d6232b Binary files /dev/null and b/Befund/Assets.xcassets/ic_eye.imageset/ic_eye-1.png differ diff --git a/Befund/Assets.xcassets/ic_eye.imageset/ic_eye-2.png b/Befund/Assets.xcassets/ic_eye.imageset/ic_eye-2.png new file mode 100644 index 0000000..909e882 Binary files /dev/null and b/Befund/Assets.xcassets/ic_eye.imageset/ic_eye-2.png differ diff --git a/Befund/Assets.xcassets/ic_eye.imageset/ic_eye.png b/Befund/Assets.xcassets/ic_eye.imageset/ic_eye.png new file mode 100644 index 0000000..d149299 Binary files /dev/null and b/Befund/Assets.xcassets/ic_eye.imageset/ic_eye.png differ diff --git a/Befund/Assets.xcassets/ic_file_download.imageset/Contents.json b/Befund/Assets.xcassets/ic_file_download.imageset/Contents.json new file mode 100644 index 0000000..7552eee --- /dev/null +++ b/Befund/Assets.xcassets/ic_file_download.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_file_download.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_file_download-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_file_download-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_file_download.imageset/ic_file_download-1.png b/Befund/Assets.xcassets/ic_file_download.imageset/ic_file_download-1.png new file mode 100644 index 0000000..bd133c4 Binary files /dev/null and b/Befund/Assets.xcassets/ic_file_download.imageset/ic_file_download-1.png differ diff --git a/Befund/Assets.xcassets/ic_file_download.imageset/ic_file_download-2.png b/Befund/Assets.xcassets/ic_file_download.imageset/ic_file_download-2.png new file mode 100644 index 0000000..8ee8cba Binary files /dev/null and b/Befund/Assets.xcassets/ic_file_download.imageset/ic_file_download-2.png differ diff --git a/Befund/Assets.xcassets/ic_file_download.imageset/ic_file_download.png b/Befund/Assets.xcassets/ic_file_download.imageset/ic_file_download.png new file mode 100644 index 0000000..e9b4478 Binary files /dev/null and b/Befund/Assets.xcassets/ic_file_download.imageset/ic_file_download.png differ diff --git a/Befund/Assets.xcassets/ic_headset_code.imageset/Contents.json b/Befund/Assets.xcassets/ic_headset_code.imageset/Contents.json new file mode 100644 index 0000000..509de21 --- /dev/null +++ b/Befund/Assets.xcassets/ic_headset_code.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_headset_code.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_headset_code-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_headset_code-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_headset_code.imageset/ic_headset_code-1.png b/Befund/Assets.xcassets/ic_headset_code.imageset/ic_headset_code-1.png new file mode 100644 index 0000000..51a2afd Binary files /dev/null and b/Befund/Assets.xcassets/ic_headset_code.imageset/ic_headset_code-1.png differ diff --git a/Befund/Assets.xcassets/ic_headset_code.imageset/ic_headset_code-2.png b/Befund/Assets.xcassets/ic_headset_code.imageset/ic_headset_code-2.png new file mode 100644 index 0000000..7613399 Binary files /dev/null and b/Befund/Assets.xcassets/ic_headset_code.imageset/ic_headset_code-2.png differ diff --git a/Befund/Assets.xcassets/ic_headset_code.imageset/ic_headset_code.png b/Befund/Assets.xcassets/ic_headset_code.imageset/ic_headset_code.png new file mode 100644 index 0000000..4c091d3 Binary files /dev/null and b/Befund/Assets.xcassets/ic_headset_code.imageset/ic_headset_code.png differ diff --git a/Befund/Assets.xcassets/ic_headset_mic.imageset/Contents.json b/Befund/Assets.xcassets/ic_headset_mic.imageset/Contents.json new file mode 100644 index 0000000..f9efedd --- /dev/null +++ b/Befund/Assets.xcassets/ic_headset_mic.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_headset_mic.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_headset_mic-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_headset_mic-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_headset_mic.imageset/ic_headset_mic-1.png b/Befund/Assets.xcassets/ic_headset_mic.imageset/ic_headset_mic-1.png new file mode 100644 index 0000000..78239f1 Binary files /dev/null and b/Befund/Assets.xcassets/ic_headset_mic.imageset/ic_headset_mic-1.png differ diff --git a/Befund/Assets.xcassets/ic_headset_mic.imageset/ic_headset_mic-2.png b/Befund/Assets.xcassets/ic_headset_mic.imageset/ic_headset_mic-2.png new file mode 100644 index 0000000..621ac24 Binary files /dev/null and b/Befund/Assets.xcassets/ic_headset_mic.imageset/ic_headset_mic-2.png differ diff --git a/Befund/Assets.xcassets/ic_headset_mic.imageset/ic_headset_mic.png b/Befund/Assets.xcassets/ic_headset_mic.imageset/ic_headset_mic.png new file mode 100644 index 0000000..a8b844a Binary files /dev/null and b/Befund/Assets.xcassets/ic_headset_mic.imageset/ic_headset_mic.png differ diff --git a/Befund/Assets.xcassets/ic_highlight_off.imageset/Contents.json b/Befund/Assets.xcassets/ic_highlight_off.imageset/Contents.json new file mode 100644 index 0000000..90fa028 --- /dev/null +++ b/Befund/Assets.xcassets/ic_highlight_off.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_highlight_off.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_highlight_off-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_highlight_off-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_highlight_off.imageset/ic_highlight_off-1.png b/Befund/Assets.xcassets/ic_highlight_off.imageset/ic_highlight_off-1.png new file mode 100644 index 0000000..0aa8082 Binary files /dev/null and b/Befund/Assets.xcassets/ic_highlight_off.imageset/ic_highlight_off-1.png differ diff --git a/Befund/Assets.xcassets/ic_highlight_off.imageset/ic_highlight_off-2.png b/Befund/Assets.xcassets/ic_highlight_off.imageset/ic_highlight_off-2.png new file mode 100644 index 0000000..4ebb890 Binary files /dev/null and b/Befund/Assets.xcassets/ic_highlight_off.imageset/ic_highlight_off-2.png differ diff --git a/Befund/Assets.xcassets/ic_highlight_off.imageset/ic_highlight_off.png b/Befund/Assets.xcassets/ic_highlight_off.imageset/ic_highlight_off.png new file mode 100644 index 0000000..702257f Binary files /dev/null and b/Befund/Assets.xcassets/ic_highlight_off.imageset/ic_highlight_off.png differ diff --git a/Befund/Assets.xcassets/ic_info_outline.imageset/Contents.json b/Befund/Assets.xcassets/ic_info_outline.imageset/Contents.json new file mode 100644 index 0000000..30df349 --- /dev/null +++ b/Befund/Assets.xcassets/ic_info_outline.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_info_outline.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_info_outline-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_info_outline-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_info_outline.imageset/ic_info_outline-1.png b/Befund/Assets.xcassets/ic_info_outline.imageset/ic_info_outline-1.png new file mode 100644 index 0000000..de29baf Binary files /dev/null and b/Befund/Assets.xcassets/ic_info_outline.imageset/ic_info_outline-1.png differ diff --git a/Befund/Assets.xcassets/ic_info_outline.imageset/ic_info_outline-2.png b/Befund/Assets.xcassets/ic_info_outline.imageset/ic_info_outline-2.png new file mode 100644 index 0000000..500b461 Binary files /dev/null and b/Befund/Assets.xcassets/ic_info_outline.imageset/ic_info_outline-2.png differ diff --git a/Befund/Assets.xcassets/ic_info_outline.imageset/ic_info_outline.png b/Befund/Assets.xcassets/ic_info_outline.imageset/ic_info_outline.png new file mode 100644 index 0000000..b2b9f16 Binary files /dev/null and b/Befund/Assets.xcassets/ic_info_outline.imageset/ic_info_outline.png differ diff --git a/Befund/Assets.xcassets/ic_keyboard_arrow_left.imageset/Contents.json b/Befund/Assets.xcassets/ic_keyboard_arrow_left.imageset/Contents.json new file mode 100644 index 0000000..e769ab7 --- /dev/null +++ b/Befund/Assets.xcassets/ic_keyboard_arrow_left.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_keyboard_arrow_left.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_keyboard_arrow_left-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_keyboard_arrow_left-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_keyboard_arrow_left.imageset/ic_keyboard_arrow_left-1.png b/Befund/Assets.xcassets/ic_keyboard_arrow_left.imageset/ic_keyboard_arrow_left-1.png new file mode 100644 index 0000000..4a2771d Binary files /dev/null and b/Befund/Assets.xcassets/ic_keyboard_arrow_left.imageset/ic_keyboard_arrow_left-1.png differ diff --git a/Befund/Assets.xcassets/ic_keyboard_arrow_left.imageset/ic_keyboard_arrow_left-2.png b/Befund/Assets.xcassets/ic_keyboard_arrow_left.imageset/ic_keyboard_arrow_left-2.png new file mode 100644 index 0000000..a1eb2bd Binary files /dev/null and b/Befund/Assets.xcassets/ic_keyboard_arrow_left.imageset/ic_keyboard_arrow_left-2.png differ diff --git a/Befund/Assets.xcassets/ic_keyboard_arrow_left.imageset/ic_keyboard_arrow_left.png b/Befund/Assets.xcassets/ic_keyboard_arrow_left.imageset/ic_keyboard_arrow_left.png new file mode 100644 index 0000000..9ed387c Binary files /dev/null and b/Befund/Assets.xcassets/ic_keyboard_arrow_left.imageset/ic_keyboard_arrow_left.png differ diff --git a/Befund/Assets.xcassets/ic_launcher.imageset/Contents.json b/Befund/Assets.xcassets/ic_launcher.imageset/Contents.json new file mode 100644 index 0000000..f9384fb --- /dev/null +++ b/Befund/Assets.xcassets/ic_launcher.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_launcher.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_launcher-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_launcher-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_launcher.imageset/ic_launcher-1.png b/Befund/Assets.xcassets/ic_launcher.imageset/ic_launcher-1.png new file mode 100644 index 0000000..28ffd2e Binary files /dev/null and b/Befund/Assets.xcassets/ic_launcher.imageset/ic_launcher-1.png differ diff --git a/Befund/Assets.xcassets/ic_launcher.imageset/ic_launcher-2.png b/Befund/Assets.xcassets/ic_launcher.imageset/ic_launcher-2.png new file mode 100644 index 0000000..da4fd9f Binary files /dev/null and b/Befund/Assets.xcassets/ic_launcher.imageset/ic_launcher-2.png differ diff --git a/Befund/Assets.xcassets/ic_launcher.imageset/ic_launcher.png b/Befund/Assets.xcassets/ic_launcher.imageset/ic_launcher.png new file mode 100644 index 0000000..4684d18 Binary files /dev/null and b/Befund/Assets.xcassets/ic_launcher.imageset/ic_launcher.png differ diff --git a/Befund/Assets.xcassets/ic_launcher_adaptive_back.imageset/Contents.json b/Befund/Assets.xcassets/ic_launcher_adaptive_back.imageset/Contents.json new file mode 100644 index 0000000..7d59806 --- /dev/null +++ b/Befund/Assets.xcassets/ic_launcher_adaptive_back.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_launcher_adaptive_back.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_launcher_adaptive_back-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_launcher_adaptive_back-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_launcher_adaptive_back.imageset/ic_launcher_adaptive_back-1.png b/Befund/Assets.xcassets/ic_launcher_adaptive_back.imageset/ic_launcher_adaptive_back-1.png new file mode 100644 index 0000000..b8a5c23 Binary files /dev/null and b/Befund/Assets.xcassets/ic_launcher_adaptive_back.imageset/ic_launcher_adaptive_back-1.png differ diff --git a/Befund/Assets.xcassets/ic_launcher_adaptive_back.imageset/ic_launcher_adaptive_back-2.png b/Befund/Assets.xcassets/ic_launcher_adaptive_back.imageset/ic_launcher_adaptive_back-2.png new file mode 100644 index 0000000..6807fa5 Binary files /dev/null and b/Befund/Assets.xcassets/ic_launcher_adaptive_back.imageset/ic_launcher_adaptive_back-2.png differ diff --git a/Befund/Assets.xcassets/ic_launcher_adaptive_back.imageset/ic_launcher_adaptive_back.png b/Befund/Assets.xcassets/ic_launcher_adaptive_back.imageset/ic_launcher_adaptive_back.png new file mode 100644 index 0000000..9784f16 Binary files /dev/null and b/Befund/Assets.xcassets/ic_launcher_adaptive_back.imageset/ic_launcher_adaptive_back.png differ diff --git a/Befund/Assets.xcassets/ic_launcher_adaptive_fore.imageset/Contents.json b/Befund/Assets.xcassets/ic_launcher_adaptive_fore.imageset/Contents.json new file mode 100644 index 0000000..66f2af2 --- /dev/null +++ b/Befund/Assets.xcassets/ic_launcher_adaptive_fore.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_launcher_adaptive_fore.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_launcher_adaptive_fore-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_launcher_adaptive_fore-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_launcher_adaptive_fore.imageset/ic_launcher_adaptive_fore-1.png b/Befund/Assets.xcassets/ic_launcher_adaptive_fore.imageset/ic_launcher_adaptive_fore-1.png new file mode 100644 index 0000000..2e745af Binary files /dev/null and b/Befund/Assets.xcassets/ic_launcher_adaptive_fore.imageset/ic_launcher_adaptive_fore-1.png differ diff --git a/Befund/Assets.xcassets/ic_launcher_adaptive_fore.imageset/ic_launcher_adaptive_fore-2.png b/Befund/Assets.xcassets/ic_launcher_adaptive_fore.imageset/ic_launcher_adaptive_fore-2.png new file mode 100644 index 0000000..ff1ad40 Binary files /dev/null and b/Befund/Assets.xcassets/ic_launcher_adaptive_fore.imageset/ic_launcher_adaptive_fore-2.png differ diff --git a/Befund/Assets.xcassets/ic_launcher_adaptive_fore.imageset/ic_launcher_adaptive_fore.png b/Befund/Assets.xcassets/ic_launcher_adaptive_fore.imageset/ic_launcher_adaptive_fore.png new file mode 100644 index 0000000..4188944 Binary files /dev/null and b/Befund/Assets.xcassets/ic_launcher_adaptive_fore.imageset/ic_launcher_adaptive_fore.png differ diff --git a/Befund/Assets.xcassets/ic_launcher_round.imageset/Contents.json b/Befund/Assets.xcassets/ic_launcher_round.imageset/Contents.json new file mode 100644 index 0000000..9254f4e --- /dev/null +++ b/Befund/Assets.xcassets/ic_launcher_round.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_launcher_round.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_launcher_round-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_launcher_round-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_launcher_round.imageset/ic_launcher_round-1.xml b/Befund/Assets.xcassets/ic_launcher_round.imageset/ic_launcher_round-1.xml new file mode 100644 index 0000000..90f9580 --- /dev/null +++ b/Befund/Assets.xcassets/ic_launcher_round.imageset/ic_launcher_round-1.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Befund/Assets.xcassets/ic_launcher_round.imageset/ic_launcher_round-2.xml b/Befund/Assets.xcassets/ic_launcher_round.imageset/ic_launcher_round-2.xml new file mode 100644 index 0000000..90f9580 --- /dev/null +++ b/Befund/Assets.xcassets/ic_launcher_round.imageset/ic_launcher_round-2.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Befund/Assets.xcassets/ic_launcher_round.imageset/ic_launcher_round.xml b/Befund/Assets.xcassets/ic_launcher_round.imageset/ic_launcher_round.xml new file mode 100644 index 0000000..90f9580 --- /dev/null +++ b/Befund/Assets.xcassets/ic_launcher_round.imageset/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Befund/Assets.xcassets/ic_link_off.imageset/Contents.json b/Befund/Assets.xcassets/ic_link_off.imageset/Contents.json new file mode 100644 index 0000000..41d8136 --- /dev/null +++ b/Befund/Assets.xcassets/ic_link_off.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_link_off.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_link_off-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_link_off-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_link_off.imageset/ic_link_off-1.png b/Befund/Assets.xcassets/ic_link_off.imageset/ic_link_off-1.png new file mode 100644 index 0000000..83ab857 Binary files /dev/null and b/Befund/Assets.xcassets/ic_link_off.imageset/ic_link_off-1.png differ diff --git a/Befund/Assets.xcassets/ic_link_off.imageset/ic_link_off-2.png b/Befund/Assets.xcassets/ic_link_off.imageset/ic_link_off-2.png new file mode 100644 index 0000000..2f16fa0 Binary files /dev/null and b/Befund/Assets.xcassets/ic_link_off.imageset/ic_link_off-2.png differ diff --git a/Befund/Assets.xcassets/ic_link_off.imageset/ic_link_off.png b/Befund/Assets.xcassets/ic_link_off.imageset/ic_link_off.png new file mode 100644 index 0000000..08fdc1a Binary files /dev/null and b/Befund/Assets.xcassets/ic_link_off.imageset/ic_link_off.png differ diff --git a/Befund/Assets.xcassets/ic_local_printshop.imageset/Contents.json b/Befund/Assets.xcassets/ic_local_printshop.imageset/Contents.json new file mode 100644 index 0000000..5a3f8c3 --- /dev/null +++ b/Befund/Assets.xcassets/ic_local_printshop.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_local_printshop.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_local_printshop-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_local_printshop-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_local_printshop.imageset/ic_local_printshop-1.png b/Befund/Assets.xcassets/ic_local_printshop.imageset/ic_local_printshop-1.png new file mode 100644 index 0000000..0015507 Binary files /dev/null and b/Befund/Assets.xcassets/ic_local_printshop.imageset/ic_local_printshop-1.png differ diff --git a/Befund/Assets.xcassets/ic_local_printshop.imageset/ic_local_printshop-2.png b/Befund/Assets.xcassets/ic_local_printshop.imageset/ic_local_printshop-2.png new file mode 100644 index 0000000..66119f3 Binary files /dev/null and b/Befund/Assets.xcassets/ic_local_printshop.imageset/ic_local_printshop-2.png differ diff --git a/Befund/Assets.xcassets/ic_local_printshop.imageset/ic_local_printshop.png b/Befund/Assets.xcassets/ic_local_printshop.imageset/ic_local_printshop.png new file mode 100644 index 0000000..6d0f138 Binary files /dev/null and b/Befund/Assets.xcassets/ic_local_printshop.imageset/ic_local_printshop.png differ diff --git a/Befund/Assets.xcassets/ic_lock.imageset/Contents.json b/Befund/Assets.xcassets/ic_lock.imageset/Contents.json new file mode 100644 index 0000000..0639a87 --- /dev/null +++ b/Befund/Assets.xcassets/ic_lock.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_lock.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_lock-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_lock-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_lock.imageset/ic_lock-1.png b/Befund/Assets.xcassets/ic_lock.imageset/ic_lock-1.png new file mode 100644 index 0000000..73a7e9e Binary files /dev/null and b/Befund/Assets.xcassets/ic_lock.imageset/ic_lock-1.png differ diff --git a/Befund/Assets.xcassets/ic_lock.imageset/ic_lock-2.png b/Befund/Assets.xcassets/ic_lock.imageset/ic_lock-2.png new file mode 100644 index 0000000..e4a885c Binary files /dev/null and b/Befund/Assets.xcassets/ic_lock.imageset/ic_lock-2.png differ diff --git a/Befund/Assets.xcassets/ic_lock.imageset/ic_lock.png b/Befund/Assets.xcassets/ic_lock.imageset/ic_lock.png new file mode 100644 index 0000000..6637623 Binary files /dev/null and b/Befund/Assets.xcassets/ic_lock.imageset/ic_lock.png differ diff --git a/Befund/Assets.xcassets/ic_no_eye.imageset/Contents.json b/Befund/Assets.xcassets/ic_no_eye.imageset/Contents.json new file mode 100644 index 0000000..9c14e2c --- /dev/null +++ b/Befund/Assets.xcassets/ic_no_eye.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_no_eye.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_no_eye-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_no_eye-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_no_eye.imageset/ic_no_eye-1.png b/Befund/Assets.xcassets/ic_no_eye.imageset/ic_no_eye-1.png new file mode 100644 index 0000000..2d44f6a Binary files /dev/null and b/Befund/Assets.xcassets/ic_no_eye.imageset/ic_no_eye-1.png differ diff --git a/Befund/Assets.xcassets/ic_no_eye.imageset/ic_no_eye-2.png b/Befund/Assets.xcassets/ic_no_eye.imageset/ic_no_eye-2.png new file mode 100644 index 0000000..75cbdf1 Binary files /dev/null and b/Befund/Assets.xcassets/ic_no_eye.imageset/ic_no_eye-2.png differ diff --git a/Befund/Assets.xcassets/ic_no_eye.imageset/ic_no_eye.png b/Befund/Assets.xcassets/ic_no_eye.imageset/ic_no_eye.png new file mode 100644 index 0000000..f9fc752 Binary files /dev/null and b/Befund/Assets.xcassets/ic_no_eye.imageset/ic_no_eye.png differ diff --git a/Befund/Assets.xcassets/ic_notifications_active.imageset/Contents.json b/Befund/Assets.xcassets/ic_notifications_active.imageset/Contents.json new file mode 100644 index 0000000..fad545e --- /dev/null +++ b/Befund/Assets.xcassets/ic_notifications_active.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_notifications_active-2.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_notifications_active.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_notifications_active-1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_notifications_active.imageset/ic_notifications_active-1.png b/Befund/Assets.xcassets/ic_notifications_active.imageset/ic_notifications_active-1.png new file mode 100644 index 0000000..bb3319d Binary files /dev/null and b/Befund/Assets.xcassets/ic_notifications_active.imageset/ic_notifications_active-1.png differ diff --git a/Befund/Assets.xcassets/ic_notifications_active.imageset/ic_notifications_active-2.png b/Befund/Assets.xcassets/ic_notifications_active.imageset/ic_notifications_active-2.png new file mode 100644 index 0000000..b05cfc8 Binary files /dev/null and b/Befund/Assets.xcassets/ic_notifications_active.imageset/ic_notifications_active-2.png differ diff --git a/Befund/Assets.xcassets/ic_notifications_active.imageset/ic_notifications_active.png b/Befund/Assets.xcassets/ic_notifications_active.imageset/ic_notifications_active.png new file mode 100644 index 0000000..5fa7ed1 Binary files /dev/null and b/Befund/Assets.xcassets/ic_notifications_active.imageset/ic_notifications_active.png differ diff --git a/Befund/Assets.xcassets/ic_notifications_off.imageset/Contents.json b/Befund/Assets.xcassets/ic_notifications_off.imageset/Contents.json new file mode 100644 index 0000000..c86d5cc --- /dev/null +++ b/Befund/Assets.xcassets/ic_notifications_off.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_notifications_off.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_notifications_off-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_notifications_off-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_notifications_off.imageset/ic_notifications_off-1.png b/Befund/Assets.xcassets/ic_notifications_off.imageset/ic_notifications_off-1.png new file mode 100644 index 0000000..0d4fcc3 Binary files /dev/null and b/Befund/Assets.xcassets/ic_notifications_off.imageset/ic_notifications_off-1.png differ diff --git a/Befund/Assets.xcassets/ic_notifications_off.imageset/ic_notifications_off-2.png b/Befund/Assets.xcassets/ic_notifications_off.imageset/ic_notifications_off-2.png new file mode 100644 index 0000000..0d4fcc3 Binary files /dev/null and b/Befund/Assets.xcassets/ic_notifications_off.imageset/ic_notifications_off-2.png differ diff --git a/Befund/Assets.xcassets/ic_notifications_off.imageset/ic_notifications_off.png b/Befund/Assets.xcassets/ic_notifications_off.imageset/ic_notifications_off.png new file mode 100644 index 0000000..0d93945 Binary files /dev/null and b/Befund/Assets.xcassets/ic_notifications_off.imageset/ic_notifications_off.png differ diff --git a/Befund/Assets.xcassets/ic_number.imageset/Contents.json b/Befund/Assets.xcassets/ic_number.imageset/Contents.json new file mode 100644 index 0000000..1bf45a3 --- /dev/null +++ b/Befund/Assets.xcassets/ic_number.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_number.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_number-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_number-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_number.imageset/ic_number-1.png b/Befund/Assets.xcassets/ic_number.imageset/ic_number-1.png new file mode 100644 index 0000000..ff93a84 Binary files /dev/null and b/Befund/Assets.xcassets/ic_number.imageset/ic_number-1.png differ diff --git a/Befund/Assets.xcassets/ic_number.imageset/ic_number-2.png b/Befund/Assets.xcassets/ic_number.imageset/ic_number-2.png new file mode 100644 index 0000000..9783b56 Binary files /dev/null and b/Befund/Assets.xcassets/ic_number.imageset/ic_number-2.png differ diff --git a/Befund/Assets.xcassets/ic_number.imageset/ic_number.png b/Befund/Assets.xcassets/ic_number.imageset/ic_number.png new file mode 100644 index 0000000..cf6f7d0 Binary files /dev/null and b/Befund/Assets.xcassets/ic_number.imageset/ic_number.png differ diff --git a/Befund/Assets.xcassets/ic_opacity.imageset/Contents.json b/Befund/Assets.xcassets/ic_opacity.imageset/Contents.json new file mode 100644 index 0000000..7628092 --- /dev/null +++ b/Befund/Assets.xcassets/ic_opacity.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_opacity.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_opacity-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_opacity-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_opacity.imageset/ic_opacity-1.png b/Befund/Assets.xcassets/ic_opacity.imageset/ic_opacity-1.png new file mode 100644 index 0000000..05294dd Binary files /dev/null and b/Befund/Assets.xcassets/ic_opacity.imageset/ic_opacity-1.png differ diff --git a/Befund/Assets.xcassets/ic_opacity.imageset/ic_opacity-2.png b/Befund/Assets.xcassets/ic_opacity.imageset/ic_opacity-2.png new file mode 100644 index 0000000..81156d5 Binary files /dev/null and b/Befund/Assets.xcassets/ic_opacity.imageset/ic_opacity-2.png differ diff --git a/Befund/Assets.xcassets/ic_opacity.imageset/ic_opacity.png b/Befund/Assets.xcassets/ic_opacity.imageset/ic_opacity.png new file mode 100644 index 0000000..764552d Binary files /dev/null and b/Befund/Assets.xcassets/ic_opacity.imageset/ic_opacity.png differ diff --git a/Befund/Assets.xcassets/ic_photo_camera.imageset/Contents.json b/Befund/Assets.xcassets/ic_photo_camera.imageset/Contents.json new file mode 100644 index 0000000..a96471c --- /dev/null +++ b/Befund/Assets.xcassets/ic_photo_camera.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_photo_camera.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_photo_camera-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_photo_camera-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_photo_camera.imageset/ic_photo_camera-1.png b/Befund/Assets.xcassets/ic_photo_camera.imageset/ic_photo_camera-1.png new file mode 100644 index 0000000..0a408f4 Binary files /dev/null and b/Befund/Assets.xcassets/ic_photo_camera.imageset/ic_photo_camera-1.png differ diff --git a/Befund/Assets.xcassets/ic_photo_camera.imageset/ic_photo_camera-2.png b/Befund/Assets.xcassets/ic_photo_camera.imageset/ic_photo_camera-2.png new file mode 100644 index 0000000..aa8cb47 Binary files /dev/null and b/Befund/Assets.xcassets/ic_photo_camera.imageset/ic_photo_camera-2.png differ diff --git a/Befund/Assets.xcassets/ic_photo_camera.imageset/ic_photo_camera.png b/Befund/Assets.xcassets/ic_photo_camera.imageset/ic_photo_camera.png new file mode 100644 index 0000000..5d4dcbc Binary files /dev/null and b/Befund/Assets.xcassets/ic_photo_camera.imageset/ic_photo_camera.png differ diff --git a/Befund/Assets.xcassets/ic_picture_as_pdf.imageset/Contents.json b/Befund/Assets.xcassets/ic_picture_as_pdf.imageset/Contents.json new file mode 100644 index 0000000..7048e03 --- /dev/null +++ b/Befund/Assets.xcassets/ic_picture_as_pdf.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_picture_as_pdf.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_picture_as_pdf-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_picture_as_pdf-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_picture_as_pdf.imageset/ic_picture_as_pdf-1.png b/Befund/Assets.xcassets/ic_picture_as_pdf.imageset/ic_picture_as_pdf-1.png new file mode 100644 index 0000000..27597f7 Binary files /dev/null and b/Befund/Assets.xcassets/ic_picture_as_pdf.imageset/ic_picture_as_pdf-1.png differ diff --git a/Befund/Assets.xcassets/ic_picture_as_pdf.imageset/ic_picture_as_pdf-2.png b/Befund/Assets.xcassets/ic_picture_as_pdf.imageset/ic_picture_as_pdf-2.png new file mode 100644 index 0000000..42d3dc5 Binary files /dev/null and b/Befund/Assets.xcassets/ic_picture_as_pdf.imageset/ic_picture_as_pdf-2.png differ diff --git a/Befund/Assets.xcassets/ic_picture_as_pdf.imageset/ic_picture_as_pdf.png b/Befund/Assets.xcassets/ic_picture_as_pdf.imageset/ic_picture_as_pdf.png new file mode 100644 index 0000000..0faa70f Binary files /dev/null and b/Befund/Assets.xcassets/ic_picture_as_pdf.imageset/ic_picture_as_pdf.png differ diff --git a/Befund/Assets.xcassets/ic_pin.imageset/Contents.json b/Befund/Assets.xcassets/ic_pin.imageset/Contents.json new file mode 100644 index 0000000..a035557 --- /dev/null +++ b/Befund/Assets.xcassets/ic_pin.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_pin.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_pin-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_pin-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_pin.imageset/ic_pin-1.png b/Befund/Assets.xcassets/ic_pin.imageset/ic_pin-1.png new file mode 100644 index 0000000..6c00757 Binary files /dev/null and b/Befund/Assets.xcassets/ic_pin.imageset/ic_pin-1.png differ diff --git a/Befund/Assets.xcassets/ic_pin.imageset/ic_pin-2.png b/Befund/Assets.xcassets/ic_pin.imageset/ic_pin-2.png new file mode 100644 index 0000000..dad7285 Binary files /dev/null and b/Befund/Assets.xcassets/ic_pin.imageset/ic_pin-2.png differ diff --git a/Befund/Assets.xcassets/ic_pin.imageset/ic_pin.png b/Befund/Assets.xcassets/ic_pin.imageset/ic_pin.png new file mode 100644 index 0000000..7a5c6cc Binary files /dev/null and b/Befund/Assets.xcassets/ic_pin.imageset/ic_pin.png differ diff --git a/Befund/Assets.xcassets/ic_question_answer.imageset/Contents.json b/Befund/Assets.xcassets/ic_question_answer.imageset/Contents.json new file mode 100644 index 0000000..8153006 --- /dev/null +++ b/Befund/Assets.xcassets/ic_question_answer.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_question_answer.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_question_answer-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_question_answer-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_question_answer.imageset/ic_question_answer-1.png b/Befund/Assets.xcassets/ic_question_answer.imageset/ic_question_answer-1.png new file mode 100644 index 0000000..8075bdc Binary files /dev/null and b/Befund/Assets.xcassets/ic_question_answer.imageset/ic_question_answer-1.png differ diff --git a/Befund/Assets.xcassets/ic_question_answer.imageset/ic_question_answer-2.png b/Befund/Assets.xcassets/ic_question_answer.imageset/ic_question_answer-2.png new file mode 100644 index 0000000..ac0261f Binary files /dev/null and b/Befund/Assets.xcassets/ic_question_answer.imageset/ic_question_answer-2.png differ diff --git a/Befund/Assets.xcassets/ic_question_answer.imageset/ic_question_answer.png b/Befund/Assets.xcassets/ic_question_answer.imageset/ic_question_answer.png new file mode 100644 index 0000000..af06eff Binary files /dev/null and b/Befund/Assets.xcassets/ic_question_answer.imageset/ic_question_answer.png differ diff --git a/Befund/Assets.xcassets/ic_settings.imageset/Contents.json b/Befund/Assets.xcassets/ic_settings.imageset/Contents.json new file mode 100644 index 0000000..015cdc2 --- /dev/null +++ b/Befund/Assets.xcassets/ic_settings.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_settings.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_settings-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_settings-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_settings.imageset/ic_settings-1.png b/Befund/Assets.xcassets/ic_settings.imageset/ic_settings-1.png new file mode 100644 index 0000000..7c96411 Binary files /dev/null and b/Befund/Assets.xcassets/ic_settings.imageset/ic_settings-1.png differ diff --git a/Befund/Assets.xcassets/ic_settings.imageset/ic_settings-2.png b/Befund/Assets.xcassets/ic_settings.imageset/ic_settings-2.png new file mode 100644 index 0000000..ce0bf12 Binary files /dev/null and b/Befund/Assets.xcassets/ic_settings.imageset/ic_settings-2.png differ diff --git a/Befund/Assets.xcassets/ic_settings.imageset/ic_settings.png b/Befund/Assets.xcassets/ic_settings.imageset/ic_settings.png new file mode 100644 index 0000000..2d36603 Binary files /dev/null and b/Befund/Assets.xcassets/ic_settings.imageset/ic_settings.png differ diff --git a/Befund/Assets.xcassets/ic_share.imageset/Contents.json b/Befund/Assets.xcassets/ic_share.imageset/Contents.json new file mode 100644 index 0000000..f147e4d --- /dev/null +++ b/Befund/Assets.xcassets/ic_share.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_share.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_share-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_share-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_share.imageset/ic_share-1.png b/Befund/Assets.xcassets/ic_share.imageset/ic_share-1.png new file mode 100644 index 0000000..ce0955a Binary files /dev/null and b/Befund/Assets.xcassets/ic_share.imageset/ic_share-1.png differ diff --git a/Befund/Assets.xcassets/ic_share.imageset/ic_share-2.png b/Befund/Assets.xcassets/ic_share.imageset/ic_share-2.png new file mode 100644 index 0000000..64a51ab Binary files /dev/null and b/Befund/Assets.xcassets/ic_share.imageset/ic_share-2.png differ diff --git a/Befund/Assets.xcassets/ic_share.imageset/ic_share.png b/Befund/Assets.xcassets/ic_share.imageset/ic_share.png new file mode 100644 index 0000000..3463f2b Binary files /dev/null and b/Befund/Assets.xcassets/ic_share.imageset/ic_share.png differ diff --git a/Befund/Assets.xcassets/ic_vpn_key.imageset/Contents.json b/Befund/Assets.xcassets/ic_vpn_key.imageset/Contents.json new file mode 100644 index 0000000..9bd3b40 --- /dev/null +++ b/Befund/Assets.xcassets/ic_vpn_key.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_vpn_key.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_vpn_key-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_vpn_key-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/ic_vpn_key.imageset/ic_vpn_key-1.png b/Befund/Assets.xcassets/ic_vpn_key.imageset/ic_vpn_key-1.png new file mode 100644 index 0000000..2b99678 Binary files /dev/null and b/Befund/Assets.xcassets/ic_vpn_key.imageset/ic_vpn_key-1.png differ diff --git a/Befund/Assets.xcassets/ic_vpn_key.imageset/ic_vpn_key-2.png b/Befund/Assets.xcassets/ic_vpn_key.imageset/ic_vpn_key-2.png new file mode 100644 index 0000000..e96ae8e Binary files /dev/null and b/Befund/Assets.xcassets/ic_vpn_key.imageset/ic_vpn_key-2.png differ diff --git a/Befund/Assets.xcassets/ic_vpn_key.imageset/ic_vpn_key.png b/Befund/Assets.xcassets/ic_vpn_key.imageset/ic_vpn_key.png new file mode 100644 index 0000000..31faf87 Binary files /dev/null and b/Befund/Assets.xcassets/ic_vpn_key.imageset/ic_vpn_key.png differ diff --git a/Befund/Assets.xcassets/labor_aachen.imageset/Contents.json b/Befund/Assets.xcassets/labor_aachen.imageset/Contents.json new file mode 100644 index 0000000..88f9755 --- /dev/null +++ b/Befund/Assets.xcassets/labor_aachen.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_aachen.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_aachen.imageset/labor_aachen.png b/Befund/Assets.xcassets/labor_aachen.imageset/labor_aachen.png new file mode 100644 index 0000000..9f77c74 Binary files /dev/null and b/Befund/Assets.xcassets/labor_aachen.imageset/labor_aachen.png differ diff --git a/Befund/Assets.xcassets/labor_berlin.imageset/Contents.json b/Befund/Assets.xcassets/labor_berlin.imageset/Contents.json new file mode 100644 index 0000000..58b8772 --- /dev/null +++ b/Befund/Assets.xcassets/labor_berlin.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_berlin.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_berlin.imageset/labor_berlin.png b/Befund/Assets.xcassets/labor_berlin.imageset/labor_berlin.png new file mode 100644 index 0000000..dddf962 Binary files /dev/null and b/Befund/Assets.xcassets/labor_berlin.imageset/labor_berlin.png differ diff --git a/Befund/Assets.xcassets/labor_cottbus.imageset/Contents.json b/Befund/Assets.xcassets/labor_cottbus.imageset/Contents.json new file mode 100644 index 0000000..65b97be --- /dev/null +++ b/Befund/Assets.xcassets/labor_cottbus.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_cottbus.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_cottbus.imageset/labor_cottbus.png b/Befund/Assets.xcassets/labor_cottbus.imageset/labor_cottbus.png new file mode 100644 index 0000000..a135cac Binary files /dev/null and b/Befund/Assets.xcassets/labor_cottbus.imageset/labor_cottbus.png differ diff --git a/Befund/Assets.xcassets/labor_dessau.imageset/Contents.json b/Befund/Assets.xcassets/labor_dessau.imageset/Contents.json new file mode 100644 index 0000000..152a791 --- /dev/null +++ b/Befund/Assets.xcassets/labor_dessau.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_dessau.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_dessau.imageset/labor_dessau.png b/Befund/Assets.xcassets/labor_dessau.imageset/labor_dessau.png new file mode 100644 index 0000000..edfa92c Binary files /dev/null and b/Befund/Assets.xcassets/labor_dessau.imageset/labor_dessau.png differ diff --git a/Befund/Assets.xcassets/labor_dortmund.imageset/Contents.json b/Befund/Assets.xcassets/labor_dortmund.imageset/Contents.json new file mode 100644 index 0000000..b37d7d6 --- /dev/null +++ b/Befund/Assets.xcassets/labor_dortmund.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_dortmund.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_dortmund.imageset/labor_dortmund.png b/Befund/Assets.xcassets/labor_dortmund.imageset/labor_dortmund.png new file mode 100644 index 0000000..e841b3f Binary files /dev/null and b/Befund/Assets.xcassets/labor_dortmund.imageset/labor_dortmund.png differ diff --git a/Befund/Assets.xcassets/labor_dresden.imageset/Contents.json b/Befund/Assets.xcassets/labor_dresden.imageset/Contents.json new file mode 100644 index 0000000..b578270 --- /dev/null +++ b/Befund/Assets.xcassets/labor_dresden.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_dresden.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_dresden.imageset/labor_dresden.png b/Befund/Assets.xcassets/labor_dresden.imageset/labor_dresden.png new file mode 100644 index 0000000..f561036 Binary files /dev/null and b/Befund/Assets.xcassets/labor_dresden.imageset/labor_dresden.png differ diff --git a/Befund/Assets.xcassets/labor_erfurt.imageset/Contents.json b/Befund/Assets.xcassets/labor_erfurt.imageset/Contents.json new file mode 100644 index 0000000..be716ab --- /dev/null +++ b/Befund/Assets.xcassets/labor_erfurt.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_erfurt.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_erfurt.imageset/labor_erfurt.png b/Befund/Assets.xcassets/labor_erfurt.imageset/labor_erfurt.png new file mode 100644 index 0000000..f051122 Binary files /dev/null and b/Befund/Assets.xcassets/labor_erfurt.imageset/labor_erfurt.png differ diff --git a/Befund/Assets.xcassets/labor_essen.imageset/Contents.json b/Befund/Assets.xcassets/labor_essen.imageset/Contents.json new file mode 100644 index 0000000..196e0a7 --- /dev/null +++ b/Befund/Assets.xcassets/labor_essen.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_essen.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_essen.imageset/labor_essen.png b/Befund/Assets.xcassets/labor_essen.imageset/labor_essen.png new file mode 100644 index 0000000..20700f0 Binary files /dev/null and b/Befund/Assets.xcassets/labor_essen.imageset/labor_essen.png differ diff --git a/Befund/Assets.xcassets/labor_frankfurt.imageset/Contents.json b/Befund/Assets.xcassets/labor_frankfurt.imageset/Contents.json new file mode 100644 index 0000000..95071f4 --- /dev/null +++ b/Befund/Assets.xcassets/labor_frankfurt.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_frankfurt.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_frankfurt.imageset/labor_frankfurt.jpg b/Befund/Assets.xcassets/labor_frankfurt.imageset/labor_frankfurt.jpg new file mode 100644 index 0000000..d8b0c5e Binary files /dev/null and b/Befund/Assets.xcassets/labor_frankfurt.imageset/labor_frankfurt.jpg differ diff --git a/Befund/Assets.xcassets/labor_freiburg.imageset/Contents.json b/Befund/Assets.xcassets/labor_freiburg.imageset/Contents.json new file mode 100644 index 0000000..07701f8 --- /dev/null +++ b/Befund/Assets.xcassets/labor_freiburg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_freiburg.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_freiburg.imageset/labor_freiburg.png b/Befund/Assets.xcassets/labor_freiburg.imageset/labor_freiburg.png new file mode 100644 index 0000000..0b4a6d3 Binary files /dev/null and b/Befund/Assets.xcassets/labor_freiburg.imageset/labor_freiburg.png differ diff --git a/Befund/Assets.xcassets/labor_hannover.imageset/Contents.json b/Befund/Assets.xcassets/labor_hannover.imageset/Contents.json new file mode 100644 index 0000000..7e8a056 --- /dev/null +++ b/Befund/Assets.xcassets/labor_hannover.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_hannover.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_hannover.imageset/labor_hannover.png b/Befund/Assets.xcassets/labor_hannover.imageset/labor_hannover.png new file mode 100644 index 0000000..fc55386 Binary files /dev/null and b/Befund/Assets.xcassets/labor_hannover.imageset/labor_hannover.png differ diff --git a/Befund/Assets.xcassets/labor_hannover_mlh.imageset/Contents.json b/Befund/Assets.xcassets/labor_hannover_mlh.imageset/Contents.json new file mode 100644 index 0000000..499f3c1 --- /dev/null +++ b/Befund/Assets.xcassets/labor_hannover_mlh.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_hannover_mlh.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_hannover_mlh.imageset/labor_hannover_mlh.png b/Befund/Assets.xcassets/labor_hannover_mlh.imageset/labor_hannover_mlh.png new file mode 100644 index 0000000..c833511 Binary files /dev/null and b/Befund/Assets.xcassets/labor_hannover_mlh.imageset/labor_hannover_mlh.png differ diff --git a/Befund/Assets.xcassets/labor_heidelberg.imageset/Contents.json b/Befund/Assets.xcassets/labor_heidelberg.imageset/Contents.json new file mode 100644 index 0000000..0a6e575 --- /dev/null +++ b/Befund/Assets.xcassets/labor_heidelberg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_heidelberg.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_heidelberg.imageset/labor_heidelberg.png b/Befund/Assets.xcassets/labor_heidelberg.imageset/labor_heidelberg.png new file mode 100644 index 0000000..66741bb Binary files /dev/null and b/Befund/Assets.xcassets/labor_heidelberg.imageset/labor_heidelberg.png differ diff --git a/Befund/Assets.xcassets/labor_hofheim.imageset/Contents.json b/Befund/Assets.xcassets/labor_hofheim.imageset/Contents.json new file mode 100644 index 0000000..7c6bf02 --- /dev/null +++ b/Befund/Assets.xcassets/labor_hofheim.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_hofheim.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_hofheim.imageset/labor_hofheim.png b/Befund/Assets.xcassets/labor_hofheim.imageset/labor_hofheim.png new file mode 100644 index 0000000..331c534 Binary files /dev/null and b/Befund/Assets.xcassets/labor_hofheim.imageset/labor_hofheim.png differ diff --git a/Befund/Assets.xcassets/labor_karlsruhe.imageset/Contents.json b/Befund/Assets.xcassets/labor_karlsruhe.imageset/Contents.json new file mode 100644 index 0000000..d3ff20a --- /dev/null +++ b/Befund/Assets.xcassets/labor_karlsruhe.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_karlsruhe.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_karlsruhe.imageset/labor_karlsruhe.png b/Befund/Assets.xcassets/labor_karlsruhe.imageset/labor_karlsruhe.png new file mode 100644 index 0000000..71a65ad Binary files /dev/null and b/Befund/Assets.xcassets/labor_karlsruhe.imageset/labor_karlsruhe.png differ diff --git a/Befund/Assets.xcassets/labor_kassel.imageset/Contents.json b/Befund/Assets.xcassets/labor_kassel.imageset/Contents.json new file mode 100644 index 0000000..6f8bde8 --- /dev/null +++ b/Befund/Assets.xcassets/labor_kassel.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_kassel.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_kassel.imageset/labor_kassel.png b/Befund/Assets.xcassets/labor_kassel.imageset/labor_kassel.png new file mode 100644 index 0000000..edfa92c Binary files /dev/null and b/Befund/Assets.xcassets/labor_kassel.imageset/labor_kassel.png differ diff --git a/Befund/Assets.xcassets/labor_leipzig.imageset/Contents.json b/Befund/Assets.xcassets/labor_leipzig.imageset/Contents.json new file mode 100644 index 0000000..0d2fa9b --- /dev/null +++ b/Befund/Assets.xcassets/labor_leipzig.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_leipzig.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_leipzig.imageset/labor_leipzig.png b/Befund/Assets.xcassets/labor_leipzig.imageset/labor_leipzig.png new file mode 100644 index 0000000..87f67fa Binary files /dev/null and b/Befund/Assets.xcassets/labor_leipzig.imageset/labor_leipzig.png differ diff --git a/Befund/Assets.xcassets/labor_ludwigsburg.imageset/Contents.json b/Befund/Assets.xcassets/labor_ludwigsburg.imageset/Contents.json new file mode 100644 index 0000000..6f56d9d --- /dev/null +++ b/Befund/Assets.xcassets/labor_ludwigsburg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_ludwigsburg.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_ludwigsburg.imageset/labor_ludwigsburg.png b/Befund/Assets.xcassets/labor_ludwigsburg.imageset/labor_ludwigsburg.png new file mode 100644 index 0000000..2eb03e2 Binary files /dev/null and b/Befund/Assets.xcassets/labor_ludwigsburg.imageset/labor_ludwigsburg.png differ diff --git a/Befund/Assets.xcassets/labor_moenchengladbach.imageset/Contents.json b/Befund/Assets.xcassets/labor_moenchengladbach.imageset/Contents.json new file mode 100644 index 0000000..dcb4a0a --- /dev/null +++ b/Befund/Assets.xcassets/labor_moenchengladbach.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_moenchengladbach.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_moenchengladbach.imageset/labor_moenchengladbach.png b/Befund/Assets.xcassets/labor_moenchengladbach.imageset/labor_moenchengladbach.png new file mode 100644 index 0000000..5b05bb2 Binary files /dev/null and b/Befund/Assets.xcassets/labor_moenchengladbach.imageset/labor_moenchengladbach.png differ diff --git a/Befund/Assets.xcassets/labor_muenchen.imageset/Contents.json b/Befund/Assets.xcassets/labor_muenchen.imageset/Contents.json new file mode 100644 index 0000000..70b55fa --- /dev/null +++ b/Befund/Assets.xcassets/labor_muenchen.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_muenchen.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_muenchen.imageset/labor_muenchen.png b/Befund/Assets.xcassets/labor_muenchen.imageset/labor_muenchen.png new file mode 100644 index 0000000..1000c49 Binary files /dev/null and b/Befund/Assets.xcassets/labor_muenchen.imageset/labor_muenchen.png differ diff --git a/Befund/Assets.xcassets/labor_muenster.imageset/Contents.json b/Befund/Assets.xcassets/labor_muenster.imageset/Contents.json new file mode 100644 index 0000000..6758d7f --- /dev/null +++ b/Befund/Assets.xcassets/labor_muenster.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_muenster.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_muenster.imageset/labor_muenster.png b/Befund/Assets.xcassets/labor_muenster.imageset/labor_muenster.png new file mode 100644 index 0000000..4910e89 Binary files /dev/null and b/Befund/Assets.xcassets/labor_muenster.imageset/labor_muenster.png differ diff --git a/Befund/Assets.xcassets/labor_nuernberg.imageset/Contents.json b/Befund/Assets.xcassets/labor_nuernberg.imageset/Contents.json new file mode 100644 index 0000000..0bcb74e --- /dev/null +++ b/Befund/Assets.xcassets/labor_nuernberg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_nuernberg.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_nuernberg.imageset/labor_nuernberg.png b/Befund/Assets.xcassets/labor_nuernberg.imageset/labor_nuernberg.png new file mode 100644 index 0000000..bc4c055 Binary files /dev/null and b/Befund/Assets.xcassets/labor_nuernberg.imageset/labor_nuernberg.png differ diff --git a/Befund/Assets.xcassets/labor_passau.imageset/Contents.json b/Befund/Assets.xcassets/labor_passau.imageset/Contents.json new file mode 100644 index 0000000..df83c33 --- /dev/null +++ b/Befund/Assets.xcassets/labor_passau.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_passau.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_passau.imageset/labor_passau.png b/Befund/Assets.xcassets/labor_passau.imageset/labor_passau.png new file mode 100644 index 0000000..cd167ff Binary files /dev/null and b/Befund/Assets.xcassets/labor_passau.imageset/labor_passau.png differ diff --git a/Befund/Assets.xcassets/labor_ravensburg.imageset/Contents.json b/Befund/Assets.xcassets/labor_ravensburg.imageset/Contents.json new file mode 100644 index 0000000..cbeaa33 --- /dev/null +++ b/Befund/Assets.xcassets/labor_ravensburg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_ravensburg.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_ravensburg.imageset/labor_ravensburg.png b/Befund/Assets.xcassets/labor_ravensburg.imageset/labor_ravensburg.png new file mode 100644 index 0000000..ebbf87c Binary files /dev/null and b/Befund/Assets.xcassets/labor_ravensburg.imageset/labor_ravensburg.png differ diff --git a/Befund/Assets.xcassets/labor_rosenheim.imageset/Contents.json b/Befund/Assets.xcassets/labor_rosenheim.imageset/Contents.json new file mode 100644 index 0000000..fdf4eee --- /dev/null +++ b/Befund/Assets.xcassets/labor_rosenheim.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_rosenheim.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_rosenheim.imageset/labor_rosenheim.png b/Befund/Assets.xcassets/labor_rosenheim.imageset/labor_rosenheim.png new file mode 100644 index 0000000..4ceccba Binary files /dev/null and b/Befund/Assets.xcassets/labor_rosenheim.imageset/labor_rosenheim.png differ diff --git a/Befund/Assets.xcassets/labor_schweinfurt.imageset/Contents.json b/Befund/Assets.xcassets/labor_schweinfurt.imageset/Contents.json new file mode 100644 index 0000000..efa2731 --- /dev/null +++ b/Befund/Assets.xcassets/labor_schweinfurt.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_schweinfurt.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_schweinfurt.imageset/labor_schweinfurt.png b/Befund/Assets.xcassets/labor_schweinfurt.imageset/labor_schweinfurt.png new file mode 100644 index 0000000..f052194 Binary files /dev/null and b/Befund/Assets.xcassets/labor_schweinfurt.imageset/labor_schweinfurt.png differ diff --git a/Befund/Assets.xcassets/labor_schwerin.imageset/Contents.json b/Befund/Assets.xcassets/labor_schwerin.imageset/Contents.json new file mode 100644 index 0000000..87f56a8 --- /dev/null +++ b/Befund/Assets.xcassets/labor_schwerin.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_schwerin.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_schwerin.imageset/labor_schwerin.png b/Befund/Assets.xcassets/labor_schwerin.imageset/labor_schwerin.png new file mode 100644 index 0000000..0cbe864 Binary files /dev/null and b/Befund/Assets.xcassets/labor_schwerin.imageset/labor_schwerin.png differ diff --git a/Befund/Assets.xcassets/labor_stralsrund.imageset/Contents.json b/Befund/Assets.xcassets/labor_stralsrund.imageset/Contents.json new file mode 100644 index 0000000..6ecb724 --- /dev/null +++ b/Befund/Assets.xcassets/labor_stralsrund.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_stralsrund.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_stralsrund.imageset/labor_stralsrund.png b/Befund/Assets.xcassets/labor_stralsrund.imageset/labor_stralsrund.png new file mode 100644 index 0000000..163a05e Binary files /dev/null and b/Befund/Assets.xcassets/labor_stralsrund.imageset/labor_stralsrund.png differ diff --git a/Befund/Assets.xcassets/labor_suhl.imageset/Contents.json b/Befund/Assets.xcassets/labor_suhl.imageset/Contents.json new file mode 100644 index 0000000..43279e2 --- /dev/null +++ b/Befund/Assets.xcassets/labor_suhl.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_suhl.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_suhl.imageset/labor_suhl.png b/Befund/Assets.xcassets/labor_suhl.imageset/labor_suhl.png new file mode 100644 index 0000000..6c95406 Binary files /dev/null and b/Befund/Assets.xcassets/labor_suhl.imageset/labor_suhl.png differ diff --git a/Befund/Assets.xcassets/labor_ulm.imageset/Contents.json b/Befund/Assets.xcassets/labor_ulm.imageset/Contents.json new file mode 100644 index 0000000..365bc5f --- /dev/null +++ b/Befund/Assets.xcassets/labor_ulm.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "labor_ulm.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/labor_ulm.imageset/labor_ulm.png b/Befund/Assets.xcassets/labor_ulm.imageset/labor_ulm.png new file mode 100644 index 0000000..707945b Binary files /dev/null and b/Befund/Assets.xcassets/labor_ulm.imageset/labor_ulm.png differ diff --git a/Befund/Assets.xcassets/limbach-gruppe-logo.imageset/Contents.json b/Befund/Assets.xcassets/limbach-gruppe-logo.imageset/Contents.json new file mode 100644 index 0000000..26cb9a1 --- /dev/null +++ b/Befund/Assets.xcassets/limbach-gruppe-logo.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "limbach-gruppe-logo.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/limbach-gruppe-logo.imageset/limbach-gruppe-logo.png b/Befund/Assets.xcassets/limbach-gruppe-logo.imageset/limbach-gruppe-logo.png new file mode 100644 index 0000000..1a59a18 Binary files /dev/null and b/Befund/Assets.xcassets/limbach-gruppe-logo.imageset/limbach-gruppe-logo.png differ diff --git a/Befund/Assets.xcassets/splash_screen_bg.imageset/Contents.json b/Befund/Assets.xcassets/splash_screen_bg.imageset/Contents.json new file mode 100644 index 0000000..4b10b66 --- /dev/null +++ b/Befund/Assets.xcassets/splash_screen_bg.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "splash_screen_bg.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "splash_screen_bg_x2.jpg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "splash_screen_bg_x2-1.jpg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/splash_screen_bg.imageset/splash_screen_bg.jpg b/Befund/Assets.xcassets/splash_screen_bg.imageset/splash_screen_bg.jpg new file mode 100644 index 0000000..8503619 Binary files /dev/null and b/Befund/Assets.xcassets/splash_screen_bg.imageset/splash_screen_bg.jpg differ diff --git a/Befund/Assets.xcassets/splash_screen_bg.imageset/splash_screen_bg_x2-1.jpg b/Befund/Assets.xcassets/splash_screen_bg.imageset/splash_screen_bg_x2-1.jpg new file mode 100644 index 0000000..ebc5bf9 Binary files /dev/null and b/Befund/Assets.xcassets/splash_screen_bg.imageset/splash_screen_bg_x2-1.jpg differ diff --git a/Befund/Assets.xcassets/splash_screen_bg.imageset/splash_screen_bg_x2.jpg b/Befund/Assets.xcassets/splash_screen_bg.imageset/splash_screen_bg_x2.jpg new file mode 100644 index 0000000..ebc5bf9 Binary files /dev/null and b/Befund/Assets.xcassets/splash_screen_bg.imageset/splash_screen_bg_x2.jpg differ diff --git a/Befund/Assets.xcassets/splash_screen_logo.imageset/Contents.json b/Befund/Assets.xcassets/splash_screen_logo.imageset/Contents.json new file mode 100644 index 0000000..f4446f7 --- /dev/null +++ b/Befund/Assets.xcassets/splash_screen_logo.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "splash_screen_logo.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "splash_screen_logo_x2.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "splash_screen_x3.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Befund/Assets.xcassets/splash_screen_logo.imageset/splash_screen_logo.png b/Befund/Assets.xcassets/splash_screen_logo.imageset/splash_screen_logo.png new file mode 100644 index 0000000..4d93b40 Binary files /dev/null and b/Befund/Assets.xcassets/splash_screen_logo.imageset/splash_screen_logo.png differ diff --git a/Befund/Assets.xcassets/splash_screen_logo.imageset/splash_screen_logo_x2.png b/Befund/Assets.xcassets/splash_screen_logo.imageset/splash_screen_logo_x2.png new file mode 100644 index 0000000..51fdd80 Binary files /dev/null and b/Befund/Assets.xcassets/splash_screen_logo.imageset/splash_screen_logo_x2.png differ diff --git a/Befund/Assets.xcassets/splash_screen_logo.imageset/splash_screen_x3.png b/Befund/Assets.xcassets/splash_screen_logo.imageset/splash_screen_x3.png new file mode 100644 index 0000000..bede3ea Binary files /dev/null and b/Befund/Assets.xcassets/splash_screen_logo.imageset/splash_screen_x3.png differ diff --git a/Befund/Befund-Bridging-Header.h b/Befund/Befund-Bridging-Header.h new file mode 100644 index 0000000..6bb43d7 --- /dev/null +++ b/Befund/Befund-Bridging-Header.h @@ -0,0 +1,15 @@ +// +// Befund-Bridging-Header.h +// Befund +// +// Created by Artur Savitskiy on 13.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +#ifndef Befund_Bridging_Header_h +#define Befund_Bridging_Header_h + + +#endif /* Befund_Bridging_Header_h */ + +#import "DownPicker.h" diff --git a/Befund/Befund.entitlements b/Befund/Befund.entitlements new file mode 100644 index 0000000..903def2 --- /dev/null +++ b/Befund/Befund.entitlements @@ -0,0 +1,8 @@ + + + + + aps-environment + development + + diff --git a/Befund/Controllers/AGBPolicyController.swift b/Befund/Controllers/AGBPolicyController.swift new file mode 100644 index 0000000..7e3ad66 --- /dev/null +++ b/Befund/Controllers/AGBPolicyController.swift @@ -0,0 +1,190 @@ +// +// AGBPolicyController.swift +// Befund +// +// Created by Artur Savitskiy on 11.10.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +import UIKit +import WebKit + + +class AGBPolicyController: UIViewController, UIAlertViewDelegate +{ + private let webView: WKWebView = { + let preferences = WKPreferences() + preferences.javaScriptEnabled = true + let configuration = WKWebViewConfiguration() + configuration.preferences = preferences + let webView = WKWebView(frame: .zero, configuration: configuration) + return webView + }() + + @IBOutlet weak var webViewOverlay: UIView! + + @IBOutlet weak var btnAcceptAGB: UIButton! + @IBOutlet weak var labelAcceptAGB: UILabel! + + override func viewDidLoad() { + super.viewDidLoad() + self.Initialize() + } + + private var flagPreviewOnly = false + private var url2Load: String = "" + private var buttonTitle: String = "" + private var labelTitle: String = "" + + private let noConnectionTemplate : String = #"

[NO_CONNECTION]

"# + + public static func InitWebViewController(url: String, previewOnly: Bool, btnText: String, labText: String) -> AGBPolicyController + { + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let settingsAGBController = storyboard.instantiateViewController(identifier: "AGBPolicy") as AGBPolicyController + + settingsAGBController.flagPreviewOnly = previewOnly + settingsAGBController.url2Load = url + settingsAGBController.buttonTitle = btnText + settingsAGBController.labelTitle = labText + + return settingsAGBController + } + + private func Initialize() + { + + view.backgroundColor = .systemBackground + self.webViewOverlay.addSubview(webView) + self.webView.sizeToFit() + + var loadUrl: URL + if (InternetConnectionManager.isConnectedToNetwork()) + { + if (url2Load.isEmpty) + { + guard let stdurl = URL(string: Core.Lang.Get(key: "AGB_POLICY_LINK")) else { + return + } + loadUrl = stdurl + } + else + { + guard let url = URL(string: url2Load) else { + return + } + loadUrl = url + } + + webView.load(URLRequest(url: loadUrl)) + } + else + { + var html2Load : String + if (url2Load.isEmpty) + { + html2Load = Core.Lang.Get(key: "APP_MUST_BE_CLOSED") + + } + else + { + if(labelTitle.contains("FAQ")) + { + html2Load = Core.Lang.Get(key: "NO_FAQ_AVAILABLE") + } + else + { + html2Load = Core.Lang.Get(key: "NO_AGB_AVAILABLE") + } + } + webView.loadHTMLString(noConnectionTemplate.replacing("[NO_CONNECTION]",with: html2Load), baseURL: nil) + } + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + if (!flagPreviewOnly) + { + self.btnAcceptAGB.setTitle(Core.Lang.Get(key: "BTN_ACCEPT_PRIVACY_POLICY"), for: .normal) + self.labelAcceptAGB.text = Core.Lang.Get(key: "LBL_PRIVACY_POLICY") + self.btnAcceptAGB.isEnabled = false + + var settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + if (settings == nil) + { + settings = Core.Models.Settings() + settings?.save(atPath: Core.System.SettingsPath()) + } + + let flagAGB = (settings?.policyAGBExplained ?? false) + + if (!flagAGB) + { + if(!InternetConnectionManager.isConnectedToNetwork()) + { + + let ac = UIAlertController(title: Core.Lang.Get(key: "LBL_SUPPORT_TOPIC_TROUBLE"), message: Core.Lang.Get(key: "ERROR_PRIVACY_POLICY_NEEDS_CONNECTION"), preferredStyle: .alert) + ac.addAction(UIAlertAction(title: "OK", style: .default, handler: failedWithAlertOk)) + self.present(ac, animated: true, completion: nil) + + } + else + { + flagPreviewOnly = false + webView.frame = self.webViewOverlay.bounds + self.btnAcceptAGB.isEnabled = true + } + } + else + { + flagPreviewOnly = true + webView.frame = self.webViewOverlay.bounds + self.btnAcceptAGB.isEnabled = true + } + + } + else + { + self.btnAcceptAGB.setTitle( buttonTitle, for: .normal) + self.labelAcceptAGB.text = labelTitle + webView.frame = self.webViewOverlay.bounds + self.btnAcceptAGB.isEnabled = true + } + } + + func failedWithAlertOk(alert: UIAlertAction!) { + flagPreviewOnly=true + webView.frame = self.webViewOverlay.bounds + self.btnAcceptAGB.isHidden = true + } + + + @IBAction func AcceptButtonClick(_ sender: Any) + { + if (flagPreviewOnly) + { + self.return2MainWindow() + } + else + { + let settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + if (!settings!.policyAGBExplained) + { + settings!.policyAGBExplained = true + _ = settings!.save(atPath: Core.System.SettingsPath()) + } + + UIApplication.shared.windows[0].rootViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "SelectLabor") + } + } + + private func return2MainWindow() + { + self.view.endEditing(true) + self.dismiss(animated: true, completion: nil) + } + + +} diff --git a/Befund/Controllers/LoginController.swift b/Befund/Controllers/LoginController.swift new file mode 100644 index 0000000..691dc7b --- /dev/null +++ b/Befund/Controllers/LoginController.swift @@ -0,0 +1,533 @@ +// +// LoginController.swift +// Befund +// +// Created by Artur Savitskiy on 27.07.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +import LocalAuthentication +import UIKit + +class LoginController: UIViewController, UITextFieldDelegate, UIAlertViewDelegate +{ + public static var CurrentViewController: LoginController? = nil + public static var Settings: Core.Models.Settings? = nil + + @IBOutlet weak var loginPassword_PassworArea: UIView! + + @IBOutlet weak var loginPassword_LaborLogoArea: UIView! + @IBOutlet weak var loginPasswordView_LaborLogo: UIImageView! + + @IBOutlet weak var loginPasswordArea_InputArea: UIView! + @IBOutlet weak var loginPasswordView_txtPassword: UITextField! + + @IBOutlet weak var loginPasswordArea_StatusArea: UIView! + @IBOutlet weak var loginPasswordView_Status: UILabel! + + //MARK: *** PopupNewPGS - Buttons + @IBOutlet weak var loginPasswordArea_ButtonsArea: UIView! + @IBOutlet weak var loginPasswordView_BtnLogin: UIButton! + @IBOutlet weak var loginPasswordView_BtnReset: UIButton! + @IBOutlet weak var loginPasswordView_BtnSupport: UIButton! + + @IBOutlet weak var passwordReset_Overlay: UIView! + @IBOutlet weak var passwordReset: UIView! + + //MARK: *** passwordReset - PGS + @IBOutlet weak var passwordReset_Loading: UIActivityIndicatorView! + @IBOutlet weak var passwordReset_Status: UILabel! + + //MARK: *** passwordReset - MasterPassword + @IBOutlet weak var passwordReset_MasterPassword: UIView! + @IBOutlet weak var passwordReset_PINView: UIView! + @IBOutlet weak var passwordReset_PINVNewView: UIView! + @IBOutlet weak var passwordReset_PasswordConfirmView: UIView! + @IBOutlet weak var passwordReset_PasswordView: UIView! + + @IBOutlet weak var passwordReset_txtPassword: UITextField! + @IBOutlet weak var passwordReset_txtPasswordConfirm: UITextField! + @IBOutlet weak var passwordReset_txtPin: UITextField! + @IBOutlet weak var passwordReset_txtPinNew: UITextField! + @IBOutlet weak var passwordReset_lblPwdHinweis: UILabel! + + //MARK: *** passwordReset - Buttons + @IBOutlet weak var passwordReset_BtnChange: UIButton! + @IBOutlet weak var passwordReset_BtnPinRequest: UIButton! + @IBOutlet weak var passwordReset_BtnCancel: UIButton! + + override func viewDidLoad() + { + super.viewDidLoad() + self.Initialize() + } + + override func loadView() { + super.loadView() + } + + override func viewDidAppear(_ animated: Bool) + { + super.viewDidAppear(animated) + self.SetLabels() + } + + /** + * Initializes view + */ + private func Initialize() + { + LoginController.CurrentViewController = self + LoginController.Settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + self.loginPasswordView_txtPassword.delegate = self + self.loginPasswordView_txtPassword.enablePasswordToggle() + + self.passwordReset_Overlay.frame = self.view.frame + self.view.addSubview(self.passwordReset_Overlay) + + self.passwordReset_txtPin.delegate = self + self.passwordReset_txtPin.returnKeyType = .next + + self.passwordReset_txtPinNew.delegate = self + self.passwordReset_txtPinNew.returnKeyType = .next + + self.passwordReset_txtPassword.delegate = self + self.passwordReset_txtPassword.enablePasswordToggle() + self.passwordReset_txtPassword.returnKeyType = .next + + self.passwordReset_txtPasswordConfirm.delegate = self + self.passwordReset_txtPasswordConfirm.enablePasswordToggle() + self.passwordReset_txtPasswordConfirm.returnKeyType = .done + + self.passwordReset_Overlay.isHidden = true + + self.passwordReset_lblPwdHinweis.text = "" + self.passwordReset_lblPwdHinweis.isHidden = false + self.passwordReset_txtPassword.addTarget(self, action: #selector(self.ShowPWDHinweis), for: .editingDidBegin) + self.passwordReset_txtPassword.addTarget(self, action: #selector(self.HidePWDHinweis), for: .editingDidEnd) + self.passwordReset_txtPasswordConfirm.addTarget(self, action: #selector(self.ShowPWDHinweis), for: .editingDidBegin) + self.passwordReset_txtPasswordConfirm.addTarget(self, action: #selector(self.HidePWDHinweis), for: .editingDidEnd) + self.passwordReset_txtPinNew.addTarget(self, action: #selector(self.ShowPinHinweis), for: .editingDidBegin) + self.passwordReset_txtPinNew.addTarget(self, action: #selector(self.HidePWDHinweis), for: .editingDidEnd) + + self.addDoneToolbar([self.passwordReset_txtPin, self.passwordReset_txtPinNew, self.passwordReset_txtPassword, self.passwordReset_txtPasswordConfirm]) + self.hideKeyboardWhenTappedAround() + } + + @objc func ShowPinHinweis() + { + self.passwordReset_Status.text = "" + + self.passwordReset_lblPwdHinweis.text = Core.Lang.Get(key: "ERROR_PIN_LENGTH") + self.passwordReset_lblPwdHinweis.isHidden = false + } + + @objc func ShowPWDHinweis() + { + self.passwordReset_Status.text = "" + + self.passwordReset_lblPwdHinweis.text = Core.Lang.Get(key: "ERROR_ENTER_STRONG_PASSWORD") + self.passwordReset_lblPwdHinweis.isHidden = false + } + + @objc func HidePWDHinweis() + { + self.passwordReset_lblPwdHinweis.text = "" + self.passwordReset_lblPwdHinweis.isHidden = true + } + + private func SetLabels() + { + self.loginPasswordView_txtPassword.placeholder = Core.Lang.Get(key: "LBL_PASSWORD") + + self.loginPasswordView_BtnReset.setTitle(Core.Lang.Get(key: "BTN_FORGOT"), for: .normal) + self.loginPasswordView_BtnLogin.setTitle(Core.Lang.Get(key: "BTN_LOGIN"), for: .normal) + self.loginPasswordView_BtnSupport.setTitle(Core.Lang.Get(key: "BTN_SUPPORT"), for: .normal) + + self.passwordReset_BtnCancel.setTitle(Core.Lang.Get(key: "BTN_CANCEL"), for: .normal) + self.passwordReset_BtnChange.setTitle(Core.Lang.Get(key: "BTN_CHANGE"), for: .normal) + self.passwordReset_BtnPinRequest.setTitle(Core.Lang.Get(key: "BTN_PIN_REQUEST"), for: .normal) + self.passwordReset_txtPin.placeholder = Core.Lang.Get(key: "LBL_PIN") + self.passwordReset_txtPinNew.placeholder = Core.Lang.Get(key: "LBL_NEW_PIN") + self.passwordReset_txtPassword.text = Core.Lang.Get(key: "LBL_NEW_PASSWORD") + self.passwordReset_txtPasswordConfirm.text = Core.Lang.Get(key: "LBL_PASSWORD_CONFIRM") + + self.loginPasswordView_LaborLogo.image = LoginController.Settings?.labor?.logo + } + + internal func textFieldShouldReturn(_ textField: UITextField) -> Bool { + self.switchBasedNextTextField(textField) + return true + } + + private func switchBasedNextTextField(_ textField: UITextField) { + switch textField { + case self.passwordReset_txtPin: + self.passwordReset_txtPinNew.becomeFirstResponder() + case self.passwordReset_txtPinNew: + self.passwordReset_txtPassword.becomeFirstResponder() + case self.passwordReset_txtPassword: + self.passwordReset_txtPasswordConfirm.becomeFirstResponder() + default: + self.view.endEditing(true) + self.LoginPasswordView_BtnLoginClick("") + } + } + + @IBAction func ButtonSupportOpenClick(_ sender: Any) + { + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let settingsSupportController = storyboard.instantiateViewController(identifier: "SupportController") + + settingsSupportController.modalPresentationStyle = .fullScreen + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromRight + self.view.window!.layer.add(transition, forKey: kCATransition) + self.present(settingsSupportController, animated: false) + } + + @IBAction func LoginPasswordView_BtnLoginClick(_ sender: Any) + { + self.loginPasswordView_Status.text = "" + + if(self.loginPasswordView_txtPassword.text?.isEmpty ?? true) + { + self.loginPasswordView_Status.text=Core.Lang.Get(key: "ERROR_INVALID_PASSWORD") + } + else + { + let password = self.loginPasswordView_txtPassword.text ?? "" + let encrypted_pwd = Core.Security.AES.Decrypt(value: LoginController.Settings?.hashed_private_key ?? "", password: String( decoding:Core.Security.AES.GetKey(password: password), as: UTF8.self)) + if(encrypted_pwd==nil) + { + self.loginPasswordView_Status.text=Core.Lang.Get(key: "ERROR_INVALID_PASSWORD") + } + else + { + AppDelegate.Session.DevicePassword = password + self.view.endEditing(true) + self.dismiss(animated: true, completion: nil) + } + } + + } + + private func PasswordActivity_HideLoading(message: String) + { + self.passwordReset_Loading.isHidden = true + if(!message.isEmpty) + { + self.passwordReset_Status.isHidden = false + self.passwordReset_Status.text = message + } + } + + + @IBAction func LoginPasswordView_BtnResetClick(_ sender: Any) + { + self.passwordReset_txtPin.text = "" + self.passwordReset_txtPinNew.text = "" + self.passwordReset_txtPassword.text = "" + self.passwordReset_txtPasswordConfirm.text = "" + self.passwordReset_Status.text = "" + self.passwordReset_Loading.isHidden = true + self.passwordReset_Loading.stopAnimating() + + + self.passwordReset.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + self.passwordReset_Overlay.alpha = 0.0 + self.passwordReset_Overlay.isHidden = false + + UIView.animate(withDuration: 0.24) { + self.passwordReset.transform = CGAffineTransform.identity + self.passwordReset_Overlay.alpha = 70.0 + } + } + + @IBAction func PasswordReset_BtnCancelClick(_ sender: Any) + { + self.HidePasswordResetPopup() + } + + private func HidePasswordResetPopup() + { + self.view.endEditing(true) + UIView.animate(withDuration: 0.24, animations: { + self.passwordReset_Overlay.alpha = 0.0 + self.passwordReset.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + }) {_ in + self.passwordReset_Overlay.isHidden = true + } + } + + @IBAction func PasswordReset_BtnChangeClick(_ sender: Any) + { + self.ChangePassword() + } + + func ChangePassword() + { + self.ResetPassword_ShowLoading() + + let pin = (self.passwordReset_txtPin.text ?? "") + let pinNew = (self.passwordReset_txtPinNew.text ?? "") + if(pin.count == 0) + { + self.ResetPassword_HideLoading( message: Core.Lang.Get(key: "ERROR_ENTER_YOUR_PIN")) + } + else if(pin.count != 5) + { + self.ResetPassword_HideLoading( message: Core.Lang.Get(key: "ERROR_PIN_LENGTH")) + } + else if(pinNew.count == 0) + { + self.ResetPassword_HideLoading( message: Core.Lang.Get(key: "ERROR_ENTER_PIN")) + } + else if(pinNew.count != 5) + { + self.ResetPassword_HideLoading( message: Core.Lang.Get(key: "ERROR_PIN_LENGTH")) + } + else + { + let oldPasswordDecrypted = Core.Models.Request.ChangeVerificatorHashProvider.GetDecryptedOldPasswordByPin(settings: LoginController.Settings!, pin: pin) + + if(oldPasswordDecrypted == nil) + { + self.ResetPassword_HideLoading( message: Core.Lang.Get(key: "ERROR_INVALID_PASSWORD_RESET_PIN")) + } + else + { + let newPass = self.passwordReset_txtPassword?.text ?? "" + let confirmPass = self.passwordReset_txtPasswordConfirm?.text ?? "" + + + if(!Core.Models.Request.ChangeVerificatorHashProvider.IsPasswordStrong(password: newPass)) + { + self.ResetPassword_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_STRONG_PASSWORD")) + } + else if(newPass != confirmPass) + { + self.ResetPassword_HideLoading(message: Core.Lang.Get(key: "ERROR_CONFIRM_PASSWORD")) + } + else + { + let changeVerificatorHash = Core.Models.Request.ChangeVerificatorHashProvider.PrepareChangeVerificatorHash(settings: LoginController.Settings!, oldPassword: oldPasswordDecrypted!, newPassword: newPass, newPin: pinNew) + + let requestKeyPair = Core.Security.Curve25519.GenerateKeyPair() + + Core.Https.Request.KeyExchangeAsync(host: (LoginController.Settings!.labor?.host ?? .DEVELOPMENT), keyPair: requestKeyPair, + onSuccess: { + publicKey in + + let sharedKey = requestKeyPair.GetSharedKey(peerPublicKeyBase64: publicKey.key) + let encryptedRequest = Core.Models.Request.EncryptedRequest(descriptor: "ChangeVerificatorHash", contentObject: changeVerificatorHash, requestType: .REQUEST_VERIFICATOR_HASH, key: sharedKey!) + + let currentHost = ViewController.Settings!.labor?.host ?? .DEVELOPMENT + + Core.Https.Request.EncryptedRequestAsync(host: currentHost, controller: "results", action: "update_verificator_hash", request: encryptedRequest, serverPublicKey: publicKey, keyPair: requestKeyPair, onSuccess: { + + encryptedResponse in + + encryptedResponse.Decrypt(key: sharedKey!) + + DispatchQueue.main.async + { + if(encryptedResponse.descriptor!.lowercased() == "success") + { + var errMsg: String? = nil + LoginController.Settings = Core.Models.Request.ChangeVerificatorHashProvider.SaveChangedVerificatorBySuccess(settings: LoginController.Settings!, oldPassword: oldPasswordDecrypted!, newPassword: newPass, pin: (changeVerificatorHash.pin ?? ""), errorMsg: &errMsg) + + if(errMsg != nil) + { + self.PasswordActivity_HideLoading(message: errMsg!) + Core.Log.Critical(msg: "Could not save settings to the file", namespace: "SettingsController", method: "PasswordChange") + } + else + { + self.PasswordActivity_HideLoading(message: "") + + DispatchQueue.main.asyncAfter(deadline: .now() + 1) + { + self.HidePasswordResetPopup() + + self.ShowMessagePopup(title: "", message: Core.Lang.Get(key: "MSG_PASSWORD_HAS_BEEN_CHANGED").replacingOccurrences(of: "[PIN]", with: changeVerificatorHash.pin!)) + } + } + } + else + { + self.PasswordActivity_HideLoading(message: encryptedResponse.descriptor!) + } + } + }, + onError: { + error in + + DispatchQueue.main.async + { + self.PasswordActivity_HideLoading(message: error) + Core.Log.Critical(msg: "Server not reachable", namespace: "LoginController", method: "ChangePassword") + } + }) + }, + onError: { + error in + DispatchQueue.main.async + { + self.PasswordActivity_HideLoading(message: error) + Core.Log.Critical(msg: "Server not reachable", namespace: "LoginController", method: "ChangePassword") + } + }) + + } + + } + + + } + + } + + @IBAction func PasswordReset_BtnRequestPinClick(_ sender: Any) + { + self.RequestPIN() + } + + func RequestPIN() + { + var authError: NSError? + let localAuthContext = LAContext() + if (localAuthContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &authError)) { + + localAuthContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: Core.Lang.Get(key: "MSG_TOUCHID_INFO")) { success, evaluateError in + + if success { + + DispatchQueue.main.async + { + self.ResetPassword_ShowLoading() + } + + self.RequestPINFromServer() + + } else { + //TODO: User did not authenticate successfully, look at error and take appropriate action + guard let error = evaluateError else { + return + } + DispatchQueue.main.async + { + self.ResetPassword_HideLoading(message: error.localizedDescription) + } + } + } + } else { + + guard let error = authError else { + return + } + DispatchQueue.main.async + { + self.ResetPassword_HideLoading(message: Core.Lang.Get(key: "ERROR_BIOMETRICAL_AUTHENTICATION_COULD_NOT_ACTIVATED")) + } + } + + } + + func ResetPassword_ShowLoading() + { + self.passwordReset_Status.text = "" + self.passwordReset_Status.isHidden = true + self.passwordReset_Loading.isHidden = false + self.passwordReset_Loading.startAnimating() + } + + func ResetPassword_HideLoading(message: String) + { + self.passwordReset_Loading.isHidden = true + if(!message.isEmpty) + { + self.passwordReset_Status.text = message + self.passwordReset_Status.isHidden = false + } + } + + func RequestPINFromServer() + { + let requestKeyPair = Core.Security.Curve25519.GenerateKeyPair() + + Core.Https.Request.KeyExchangeAsync(host: (LoginController.Settings!.labor?.host ?? .DEVELOPMENT), keyPair: requestKeyPair, + onSuccess: { + publicKey in + + let getPIN = Core.Models.Request.GetPIN() + getPIN.udid = LoginController.Settings!.udid; + getPIN.verificator_hash = LoginController.Settings!.verificator_hash; + let sharedKey = requestKeyPair.GetSharedKey(peerPublicKeyBase64: publicKey.key) + + let encryptedRequest = Core.Models.Request.EncryptedRequest(descriptor: "PIN", contentObject: getPIN, requestType: .REQUEST_GET_PIN, key: sharedKey!) + + let currentHost = ViewController.Settings!.labor?.host ?? .DEVELOPMENT + + Core.Https.Request.EncryptedRequestAsync(host: currentHost, controller: "results", action: "pin", request: encryptedRequest, serverPublicKey: publicKey, keyPair: requestKeyPair, onSuccess: { + + encryptedResponse in + + let response = encryptedResponse.Decrypt(key: sharedKey!) + + DispatchQueue.main.async + { + if(response != nil) + { + let pin = response as? Core.Models.Response.PIN; + + if(pin != nil && pin!.code!.count > 0) + { + self.ResetPassword_HideLoading(message: Core.Lang.Get(key: "PIN_HAS_BEEN_REQUESTED")) + + self.passwordReset_txtPin.text = pin!.code + } + else + { + let exception = response as? Core.Models.Response.Exception + if(exception != nil) + { + self.ResetPassword_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_GET_PIN") + ": " + (exception!.message ?? "")) + } + else + { + self.ResetPassword_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_GET_PIN")) + Core.Log.Error(msg: "Could not get pin from the server", namespace: "LoginActivity", method: "RequestPINFromServer") + } + } + } + else + { + self.ResetPassword_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_GET_PIN")) + Core.Log.Error(msg: "Could not get pin from the server", namespace: "LoginActivity", method: "RequestPINFromServer") + } + } + }, + onError: { + error in + + DispatchQueue.main.async + { + self.ResetPassword_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_GET_PIN")); + Core.Log.Error(msg: error, namespace: "LoginActivity", method: "RequestPINFromServer"); + } + }) + }, + onError: { + error in + DispatchQueue.main.async + { + self.ResetPassword_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_GET_PIN")); + Core.Log.Error(msg: error, namespace: "LoginActivity", method: "RequestPINFromServer"); + } + }) + } +} diff --git a/Befund/Controllers/OEGDController.swift b/Befund/Controllers/OEGDController.swift new file mode 100644 index 0000000..cfe5a71 --- /dev/null +++ b/Befund/Controllers/OEGDController.swift @@ -0,0 +1,897 @@ +// +// OEGDController.swift +// Befund +// +// Created by Artur Savitskiy on 03.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +import UIKit + +//import "DownPicker.h" + +class OEGDController: UIViewController, UITextFieldDelegate, UIScrollViewDelegate, UpdatingParentCheckBox +{ + public enum OEGDEditType: Int + { + case New + case Edit + } + public var currentMode: OEGDEditType = OEGDEditType.New + + private var Genders: NSMutableArray = + [ Core.Lang.Get(key: "LBL_GENDER_M") + , Core.Lang.Get(key: "LBL_GENDER_W") + , Core.Lang.Get(key: "LBL_GENDER_D") + , Core.Lang.Get(key: "LBL_GENDER_X")] + + @IBOutlet weak var editPopup_HeightScrollView: NSLayoutConstraint! + @IBOutlet weak var mainOEGD_HeightScrollView: NSLayoutConstraint! + + public static var Settings: Core.Models.Settings? = nil + + + @IBOutlet weak var LBL_TITLE: UILabel! + //@IBOutlet weak var LBL_BACK: UILabel! + @IBOutlet weak var mainOEGD_MenuBtn: UIButton! + @IBOutlet weak var mainOEGD_BackBtn: UIButton! + @IBOutlet weak var LBL_NO_OEGD: UILabel! + + //new or edit OEGD popup + @IBOutlet weak var LBL_EDIT_TITLE: UILabel! + + @IBOutlet weak var editPopup_Overlay: UIView! + @IBOutlet weak var editPopup_Content: UIView! + @IBOutlet weak var editPopup_ScrollView: UIScrollView! + + @IBOutlet weak var editOEGD_txtTitle: UITextField! + @IBOutlet weak var editOEGD_txtFirstname: UITextField! + @IBOutlet weak var editOEGD_txtLastname: UITextField! + @IBOutlet weak var editOEGD_txtAddLastname: UITextField! + @IBOutlet weak var editOEGD_txtPrefix: UITextField! + @IBOutlet weak var editOEGD_txtGender: UITextField! + var genderDownPicker: DownPicker! + + @IBOutlet weak var editOEGD_txtBirthday: UITextField! + let editOEGD_dtBirthday = UIDatePicker() + @IBOutlet weak var editOEGD_txtStreet: UITextField! + @IBOutlet weak var editOEGD_txtZip: UITextField! + @IBOutlet weak var editOEGD_txtCity: UITextField! + @IBOutlet weak var editOEGD_txtTelefon: UITextField! + @IBOutlet weak var editOEGD_CWAPolicyView: UIView! + @IBOutlet weak var editOEGD_CWAPolicyBtn: UIButton! + @IBOutlet weak var editOEGD_CreateBtn: UIButton! + @IBOutlet weak var editOEGD_BackBtn: UIButton! + @IBOutlet weak var editOEGD_Status: UILabel! + + //OEGD Options-Popup + + @IBOutlet weak var optionsPopup_Overlay: UIView! + @IBOutlet weak var optionsPopup_Content: UIView! + @IBOutlet weak var optionsPopup_ButtonsContent: UIView! + + @IBOutlet weak var optionsPopup_EditContent: UIView! + @IBOutlet weak var optionsPopup_AddContent: UIView! + @IBOutlet weak var optionsPopup_DeleteContent: UIView! + + @IBOutlet weak var optionsOEGD_AddBtn: UIButton! + @IBOutlet weak var optionsOEGD_EditBtn: UIButton! + @IBOutlet weak var optionsOEGD_DeleteBtn: UIButton! + @IBOutlet weak var optionsOEGD_CancelBtn: UIButton! + + @IBOutlet weak var optionsPopup_ConfirmDelete: UIView! + @IBOutlet weak var optionsOEGD_DeleteTitle: UILabel! + @IBOutlet weak var optionsOEGD_DeleteNoBtn: UIButton! + @IBOutlet weak var optionsOEGD_DeleteYesBtn: UIButton! + + + //CWA-Policy Popup + @IBOutlet weak var LBL_POLICY_TITLE: UILabel! + @IBOutlet weak var policyPopup_Overlay: UIView! + @IBOutlet weak var policyPopup_AcceptView: UIView! + @IBOutlet weak var policyPopup_PolicyText: UILabel! + @IBOutlet weak var policyPopup_btnAcceptPolicy: UIButton! + + @IBOutlet var editPopup_Checkbox: CheckBoxButton! + public var confirmCheckBox:CheckBoxButton! { + get { + return editPopup_Checkbox + } + } + + + @IBOutlet weak var pageControl: UIPageControl! + @IBOutlet weak var scrollView: UIScrollView! + + @IBOutlet weak var qrImage: UIImageView! + + private var OEGDFiles: [Core.Models.OEGDFile] = [] + private var CurrentOEGDFile: Core.Models.OEGDFile? = nil + + private let CWAPolicyLink = "https://www.limbachgruppe.com/datenschutz" + + private var blinkTimer: Timer? = nil + + private var isAlpha1: Bool = true + + private let menuBtnWidth = 90.0 + private let menuBtnHeight = 65.0 + + override func viewDidLoad() + { + super.viewDidLoad() + self.Initialize() + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + self.SetLabels() + } + + private func FormMenuButton() + { + if(self.OEGDFiles.count==0) + { + if (self.blinkTimer==nil) + { + self.blinkTimer = Timer.scheduledTimer(timeInterval: 0.7, target: self, selector: #selector(self.alarmAlertActivate), userInfo: nil, repeats: true) + } + } + else + { + if (self.blinkTimer != nil) + { + self.blinkTimer!.invalidate() + self.blinkTimer = nil + let menuImg = UIImage(named: "ic_dehaze")?.image(alpha: 1.0, targetSize: CGSize(width: menuBtnWidth, height: menuBtnHeight)) + self.mainOEGD_MenuBtn.setImage(menuImg, for: .normal) + } + } + } + + private func Initialize() + { + //OEGDController.CurrentViewController = self + OEGDController.Settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + + + self.editOEGD_txtTitle.delegate = self + self.editOEGD_txtFirstname.delegate = self + self.editOEGD_txtLastname.delegate = self + self.editOEGD_txtAddLastname.delegate = self + self.editOEGD_txtPrefix.delegate = self + self.editOEGD_txtGender.delegate = self + self.editOEGD_txtBirthday.delegate = self + self.editOEGD_txtStreet.delegate = self + self.editOEGD_txtZip.delegate = self + self.editOEGD_txtCity.delegate = self + self.editOEGD_txtTelefon.delegate = self + + self.editOEGD_txtTitle.returnKeyType = .next + self.editOEGD_txtFirstname.returnKeyType = .next + self.editOEGD_txtLastname.returnKeyType = .next + self.editOEGD_txtAddLastname.returnKeyType = .next + self.editOEGD_txtPrefix.returnKeyType = .next + self.editOEGD_txtGender.returnKeyType = .next + self.editOEGD_txtBirthday.returnKeyType = .next + self.editOEGD_txtStreet.returnKeyType = .next + self.editOEGD_txtZip.returnKeyType = .next + self.editOEGD_txtCity.returnKeyType = .next + self.editOEGD_txtTelefon.returnKeyType = .done + + self.addDoneToolbar([self.editOEGD_txtTitle, self.editOEGD_txtFirstname, self.editOEGD_txtLastname, self.editOEGD_txtAddLastname, self.editOEGD_txtPrefix, self.editOEGD_txtGender, self.editOEGD_txtStreet, self.editOEGD_txtZip, self.editOEGD_txtCity, self.editOEGD_txtTelefon]) + + self.hideKeyboardWhenTappedAround() + self.createDatePicker() + + self.optionsPopup_Overlay.frame = self.view.frame + self.view.addSubview(self.optionsPopup_Overlay) + optionsPopup_Overlay.isHidden = true + + optionsPopup_ConfirmDelete.isHidden = true + + self.editPopup_Overlay.frame = self.view.frame + self.view.addSubview(self.editPopup_Overlay) + editPopup_Overlay.isHidden = true + + self.policyPopup_Overlay.frame = self.view.frame + self.view.addSubview(self.policyPopup_Overlay) + policyPopup_Overlay.isHidden = true + + self.editPopup_Checkbox = CheckBoxButton(frame: CGRect(x: 20, y: 10, width: 30, height: 30)) + self.editOEGD_CWAPolicyView.addSubview(self.editPopup_Checkbox) + let gesture = UITapGestureRecognizer(target: self, action: #selector(didTapCheckbox)) + self.editPopup_Checkbox.addGestureRecognizer(gesture) + self.editPopup_Checkbox.setChecked(flag: true) + + self.genderDownPicker = DownPicker(textField: editOEGD_txtGender, withData: (Genders as! [Any])) + + self.scrollView.delegate = self + + self.InitializeScrollView() + + //calc top-position of round Back-button + let screenBound = UIScreen.main.bounds; + var width = CGFloat((screenBound.width * 30) / 100.0) + if(width > 100.0) + { + width = CGFloat(100.0) + } + //calc new height for ScrollView in edit OEGD + let bottom = (screenBound.height - 100) - (width / 2.0) - 30 + var newHeight = bottom - self.editPopup_ScrollView.frame.origin.y + self.editPopup_HeightScrollView.constant = newHeight + //calc new height for ScrollView in main form (for QRCode), minus 10 pt for Page-control + newHeight = bottom - self.scrollView.frame.origin.y - 10 + self.mainOEGD_HeightScrollView.constant = newHeight + + let menuImg = UIImage(named: "ic_dehaze")?.image(alpha: 1.0, targetSize: CGSize(width: menuBtnWidth, height: menuBtnHeight)) + self.mainOEGD_MenuBtn.setImage(menuImg, for: .normal) + + } + + @objc func alarmAlertActivate(){ + UIView.animate(withDuration: 0.7) { + let menuImg = UIImage(named: "ic_dehaze")?.image(alpha: self.isAlpha1 ? 1.0: 0.0, targetSize: CGSize(width: self.menuBtnWidth, height: self.menuBtnHeight)) + self.mainOEGD_MenuBtn.setImage(menuImg, for: .normal) + } + self.isAlpha1 = !self.isAlpha1 + } + + func scrollViewDidScroll(_ scrollView: UIScrollView) { + let pageIndex = round(scrollView.contentOffset.x/view.frame.width) + pageControl.currentPage = Int(pageIndex) + self.CurrentOEGDFile = self.OEGDFiles[Int(pageIndex)] + } + + + internal func textFieldShouldReturn(_ textField: UITextField) -> Bool { + self.switchBasedNextTextField(textField) + return true + } + + private func switchBasedNextTextField(_ textField: UITextField) { + switch textField { + case self.editOEGD_txtTitle: + self.editOEGD_txtFirstname.becomeFirstResponder() + case self.editOEGD_txtFirstname: + self.editOEGD_txtLastname.becomeFirstResponder() + case self.editOEGD_txtLastname: + self.editOEGD_txtAddLastname.becomeFirstResponder() + case self.editOEGD_txtAddLastname: + self.editOEGD_txtPrefix.becomeFirstResponder() + case self.editOEGD_txtPrefix: + self.editOEGD_txtGender.becomeFirstResponder() + case self.editOEGD_txtGender: + self.editOEGD_txtBirthday.becomeFirstResponder() + case self.editOEGD_txtBirthday: + self.editOEGD_txtStreet.becomeFirstResponder() + case self.editOEGD_txtStreet: + self.editOEGD_txtZip.becomeFirstResponder() + case self.editOEGD_txtZip: + self.editOEGD_txtCity.becomeFirstResponder() + case self.editOEGD_txtCity: + self.editOEGD_txtTelefon.becomeFirstResponder() + default: + self.view.endEditing(true) + } + } + + + private func InitializeScrollView() + { + self.LoadOEGDs() + + + if(self.OEGDFiles.count>0) + { + let slides: [UISlider] = createSlides() + setupSlideScrollView(slides: slides) + + scrollView.contentOffset.x = 0 + pageControl.numberOfPages = slides.count + pageControl.currentPage = 0 + view.bringSubviewToFront(pageControl) + + self.CurrentOEGDFile = self.OEGDFiles[0] + + self.scrollView.isHidden = false + self.pageControl.isHidden = false + + optionsPopup_EditContent.isHidden = false + optionsPopup_DeleteContent.isHidden = false + + } + else + { + self.CurrentOEGDFile = nil + + self.scrollView.isHidden = true + self.pageControl.isHidden = true + + optionsPopup_EditContent.isHidden = true + optionsPopup_DeleteContent.isHidden = true + } + + self.FormMenuButton() + + } + + func setupSlideScrollView(slides : [UISlider]) { + scrollView.frame = CGRect(x: 0, y: 100, width: view.frame.width, height: view.frame.height-300) + scrollView.contentSize = CGSize(width: view.frame.width * CGFloat(slides.count), height: view.frame.height-300) + scrollView.isPagingEnabled = true + + for i in 0 ..< slides.count { + slides[i].frame = CGRect(x: view.frame.width * CGFloat(i), y: 0, width: view.frame.width, height: view.frame.height-200) + scrollView.addSubview(slides[i]) + } + } + + func createSlides() -> [UISlider] { + + var slides: [UISlider] = [] + + let fileCounter = self.OEGDFiles.count + if ( fileCounter > 0) + { + pageControl.numberOfPages = fileCounter + for index in 0.. UIImage + { + let context = CIContext() + let data = content + let filter = CIFilter.qrCodeGenerator() + filter.setValue(data, forKey: "inputMessage") + if let outputImage = filter.outputImage { + let transform = CGAffineTransform(scaleX: 10, y: 10) + let scaledQRImage = outputImage.transformed(by: transform) + if let cgimg = context.createCGImage(scaledQRImage, from: scaledQRImage.extent){ + return UIImage(cgImage: cgimg) + } + } + return UIImage(systemName: "xmark.circle") ?? UIImage() + } + + private func PrepareEditOEGD() + { + self.currentMode = OEGDEditType.Edit + self.LBL_EDIT_TITLE.text = Core.Lang.Get(key: "LBL_EDIT_OEGD") + + if (self.CurrentOEGDFile != nil) + { + let curOEGD = self.CurrentOEGDFile?.OEGD + self.editOEGD_txtTitle.text = curOEGD?.title + self.editOEGD_txtFirstname.text = curOEGD?.first_name + self.editOEGD_txtLastname.text = curOEGD?.last_name + self.editOEGD_txtAddLastname.text = curOEGD?.name_addition + self.editOEGD_txtPrefix.text = curOEGD?.prefix + + let curGender = curOEGD?.gender ?? "" + if(curGender == "M") + { + self.editOEGD_txtGender.text = Genders[0] as? String + } + else if(curGender == "W") + { + self.editOEGD_txtGender.text = Genders[1] as? String + } + else if(curGender == "D") + { + self.editOEGD_txtGender.text = Genders[2] as? String + } + else if(curGender == "X") + { + self.editOEGD_txtGender.text = Genders[3] as? String + } + + + if((curOEGD?.birthdate ?? "").count > 0) + { + let birthday = curOEGD?.GetBirthday() + if(birthday != nil) + { + self.editOEGD_dtBirthday.setDate(birthday!, animated: false) + self.editOEGD_txtBirthday.text = curOEGD?.GetFormatedBirthday() + } + } + self.editOEGD_txtStreet.text = curOEGD?.address.street_number + self.editOEGD_txtZip.text = curOEGD?.address.zip_code + self.editOEGD_txtCity.text = curOEGD?.address.city + self.editOEGD_txtTelefon.text = curOEGD?.phone + self.editPopup_Checkbox.setChecked(flag: (curOEGD?.cwa_consent_flag ?? false)) + } + } + private func PrepareNewOEGD() + { + self.currentMode = OEGDEditType.New + self.LBL_EDIT_TITLE.text = Core.Lang.Get(key: "LBL_NEW_OEGD") + + self.editOEGD_txtTitle.text = nil + self.editOEGD_txtFirstname.text = nil + self.editOEGD_txtLastname.text = nil + self.editOEGD_txtAddLastname.text = nil + self.editOEGD_txtPrefix.text = nil + self.editOEGD_txtGender.text = nil + self.editOEGD_txtBirthday.text = nil + self.editOEGD_dtBirthday.setDate(Date(), animated: false) + self.editOEGD_txtStreet.text = nil + self.editOEGD_txtZip.text = nil + self.editOEGD_txtCity.text = nil + self.editOEGD_txtTelefon.text = nil + //self.editPopup_Checkbox.setChecked(flag: false) + } + + private func OpenConfirmDialog() + { + let confirmText = Core.Lang.Get(key: "MSG_SURE_WANT_DELETE").replacingOccurrences(of: "[ITEM]", with: (self.CurrentOEGDFile?.OEGD.first_name ?? "") + " " + (self.CurrentOEGDFile?.OEGD.last_name ?? "")) + self.optionsOEGD_DeleteTitle.text = confirmText + + self.optionsPopup_ConfirmDelete.isHidden = false + self.optionsPopup_ButtonsContent.isHidden = true + } + + private func CancelConfirmDialog() + { + self.optionsPopup_ConfirmDelete.isHidden = true + self.optionsPopup_ButtonsContent.isHidden = false + } + + private func DeleteCurrentOEGD() + { + if(self.CurrentOEGDFile != nil) + { + + let fileName = self.CurrentOEGDFile?.filename + let filePath = Core.System.GetPathForStorageFile(filename: fileName!) + + if(filePath != nil) + { + Core.System.DeleteFile(atPath: filePath!) + } + } + + } + + @objc func didTapCheckbox() + { + self.editPopup_Checkbox.toogle() + } + + + func SetLabels() + { + self.LBL_TITLE.text = Core.Lang.Get(key: "LBL_OEGD") + self.LBL_NO_OEGD.text = Core.Lang.Get(key: "LBL_NO_OEGD") + //self.LBL_BACK.text = Core.Lang.Get(key: "BTN_BACK") + + self.editOEGD_txtTitle.placeholder = Core.Lang.Get(key: "LBL_TITLE") + self.editOEGD_txtFirstname.placeholder = Core.Lang.Get(key: "LBL_FIRSTNAME") + self.editOEGD_txtLastname.placeholder = Core.Lang.Get(key: "LBL_LASTNAME") + self.editOEGD_txtAddLastname.placeholder = Core.Lang.Get(key: "LBL_ADDITION_NAME") + self.editOEGD_txtPrefix.placeholder = Core.Lang.Get(key: "LBL_NAME_PREFIX") + self.editOEGD_txtGender.placeholder = Core.Lang.Get(key: "LBL_GENDER") + self.editOEGD_txtBirthday.placeholder = Core.Lang.Get(key: "LBL_BIRTHDAY") + self.editOEGD_txtStreet.placeholder = Core.Lang.Get(key: "LBL_STREET") + self.editOEGD_txtZip.placeholder = Core.Lang.Get(key: "LBL_ZIP") + self.editOEGD_txtCity.placeholder = Core.Lang.Get(key: "LBL_CITY") + self.editOEGD_txtTelefon.placeholder = Core.Lang.Get(key: "LBL_TELEFON") + self.editOEGD_CWAPolicyBtn.setTitle(Core.Lang.Get(key: "BTN_ACCEPT_CWA_POLICY"), for: .normal) + self.editOEGD_Status.text = "" + self.editOEGD_CreateBtn.setTitle(Core.Lang.Get(key: "BTN_REGISTER"), for: .normal) + + self.LBL_POLICY_TITLE.text = Core.Lang.Get(key: "LBL_CWA_POLICY") + self.policyPopup_PolicyText.text = Core.Lang.Get(key: "CWA_POLICY_TEXT") + self.policyPopup_btnAcceptPolicy.setTitle(Core.Lang.Get(key: "BTN_ACCEPT_CWA_POLICY"), for: .normal) + + self.optionsOEGD_AddBtn.setTitle(Core.Lang.Get(key: "BTN_REGISTER"), for: .normal) + self.optionsOEGD_EditBtn.setTitle(Core.Lang.Get(key: "BTN_EDIT"), for: .normal) + self.optionsOEGD_DeleteBtn.setTitle(Core.Lang.Get(key: "BTN_DELETE"), for: .normal) + self.optionsOEGD_CancelBtn.setTitle(Core.Lang.Get(key: "BTN_CANCEL"), for: .normal) + self.optionsOEGD_DeleteYesBtn.setTitle(Core.Lang.Get(key: "BTN_YES"), for: .normal) + self.optionsOEGD_DeleteNoBtn.setTitle(Core.Lang.Get(key: "BTN_NO"), for: .normal) + + + } + + func createDatePicker() + { + self.editOEGD_dtBirthday.locale = Locale(identifier: Core.Lang.GetLocale()) + self.editOEGD_dtBirthday.calendar.locale = Locale(identifier: Core.Lang.GetLocale()) + self.editOEGD_dtBirthday.datePickerMode = .date + self.editOEGD_dtBirthday.preferredDatePickerStyle = .wheels + self.editOEGD_dtBirthday.maximumDate = Date() + + let toolbar = UIToolbar() + let flexSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, + target: nil, action: nil) + + let btnDone = UIBarButtonItem(title: Core.Lang.Get(key: "BTN_DONE"), style: .done, target: nil, action: #selector(editOEGD_dtBirthdayDone)) + + toolbar.sizeToFit() + toolbar.setItems([ flexSpace, btnDone ], animated: true) + + self.editOEGD_txtBirthday.inputAccessoryView = toolbar + self.editOEGD_txtBirthday.inputView = self.editOEGD_dtBirthday + } + + @objc func editOEGD_dtBirthdayDone() + { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd.MM.yyyy" + let dt = dateFormatter.string(from: self.editOEGD_dtBirthday.date) + + self.editOEGD_txtBirthday.text = dt + self.editOEGD_txtBirthday.becomeFirstResponder() + + self.view.endEditing(true) + } + + @IBAction func goBack(_ sender: Any) + { + self.view.endEditing(true) + self.dismiss(animated: true, completion: nil) + } + + @IBAction func mainOEGD_MenuBtn_Click(_ sender: Any) + { + self.ShowOEGDOptions() + } + + private func ShowOEGDOptions() + { + self.scrollView.isHidden = true + self.pageControl.isHidden = true + + self.optionsPopup_Overlay.frame.origin = CGPoint(x: -self.optionsPopup_Overlay.frame.width, y: self.optionsPopup_Overlay.frame.origin.y) + self.optionsPopup_Overlay.isHidden = false + + UIView.animate(withDuration: 0.24, animations: { + self.optionsPopup_Overlay.frame.origin = CGPoint(x: 0, y: self.optionsPopup_Overlay.frame.origin.y) + }) + + } + + @IBAction func optionsOEGD_CancelBtn_Click(_ sender: Any) + { + self.InitializeScrollView() + self.HideOEGDOptions() + } + + private func HideOEGDOptions() + { + UIView.animate(withDuration: 0.24, animations: { + self.optionsPopup_Overlay.frame.origin = CGPoint(x: -self.optionsPopup_Overlay.frame.width, y: self.optionsPopup_Overlay.frame.origin.y) + }) {_ in + self.optionsPopup_Overlay.isHidden = true + } + } + + @IBAction func optionsOEGD_EditBtn_Click(_ sender: Any) + { + self.PrepareEditOEGD() + self.ShowOEGDEdit() + } + + + @IBAction func optionsOEGD_AddBtn_Click(_ sender: Any) + { + self.PrepareNewOEGD() + self.ShowOEGDEdit() + } + + @IBAction func optionsOEGD_ConfirmYesBtn_Click(_ sender: Any) + { + self.DeleteCurrentOEGD() + self.CancelConfirmDialog() + self.InitializeScrollView() + self.HideOEGDOptions() + } + + @IBAction func optionsOEGD_ConfirmNoBtn_Click(_ sender: Any) + { + self.CancelConfirmDialog() + } + + @IBAction func optionsOEGD_DeleteBtn_Click(_ sender: Any) + { + self.OpenConfirmDialog() + } + + + private func ShowOEGDEdit() + { + self.editPopup_Overlay.frame.origin = CGPoint(x: -self.optionsPopup_Overlay.frame.width, y: self.editPopup_Overlay.frame.origin.y) + self.editPopup_Overlay.isHidden = false + + UIView.animate(withDuration: 0.24, animations: { + self.editPopup_Overlay.frame.origin = CGPoint(x: 0, y: self.optionsPopup_Overlay.frame.origin.y) + self.optionsPopup_Overlay.frame.origin = CGPoint(x: self.optionsPopup_Overlay.frame.width, y: self.optionsPopup_Overlay.frame.origin.y) + }) {_ in + self.optionsPopup_Overlay.isHidden = true + } + } + + private func NewOEGDCreate(filename: String?) -> Bool + { + let firstName = editOEGD_txtFirstname.text ?? "" + let lastName = editOEGD_txtLastname.text ?? "" + let gender = editOEGD_txtGender.text ?? "" + let birthday = editOEGD_txtBirthday.text ?? "" + let street = editOEGD_txtStreet.text ?? "" + let zip = editOEGD_txtZip.text ?? "" + let city = editOEGD_txtCity.text ?? "" + + editOEGD_Status.text = "" + + if(firstName.count==0) + { + editOEGD_Status.text = Core.Lang.Get(key: "ERROR_ENTER_FIRSTNAME") + } + else if(lastName.count == 0) + { + editOEGD_Status.text = Core.Lang.Get(key: "ERROR_ENTER_LASTNAME") + } + else if(birthday.count == 0) + { + editOEGD_Status.text = Core.Lang.Get(key: "ERROR_ENTER_BIRTHDAY") + } + else if(gender.count == 0) + { + editOEGD_Status.text = Core.Lang.Get(key: "ERROR_ENTER_GENDER") + } + else if(street.count == 0) + { + editOEGD_Status.text = Core.Lang.Get(key: "ERROR_ENTER_STREET") + } + else if(zip.count == 0) + { + editOEGD_Status.text = Core.Lang.Get(key: "ERROR_ENTER_ZIP") + } + else if(city.count == 0) + { + editOEGD_Status.text = Core.Lang.Get(key: "ERROR_ENTER_CITY") + } + else if(!editPopup_Checkbox.IsChecked()) + { + editOEGD_Status.text = Core.Lang.Get(key: "ERROR_ERROR_ACCEPT_CWA_POLICY") + } + else + { + let oegd = Core.Models.OEGD() + oegd.first_name = firstName + oegd.last_name = lastName + oegd.gender = gender + + oegd.title = (editOEGD_txtTitle.text ?? "") + oegd.name_addition = (editOEGD_txtAddLastname.text ?? "") + oegd.prefix = (editOEGD_txtPrefix.text ?? "") + + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd" + oegd.birthdate = dateFormatter.string(from: self.editOEGD_dtBirthday.date) + + if(gender.elementsEqual(Core.Lang.Get(key: "LBL_GENDER_M"))) + { + oegd.gender = "M"; + } + else if(gender.elementsEqual(Core.Lang.Get(key: "LBL_GENDER_W"))) + { + oegd.gender = "W"; + } + else if(gender.elementsEqual(Core.Lang.Get(key: "LBL_GENDER_D"))) + { + oegd.gender = "D"; + } + else + { + oegd.gender = "X"; + } + + oegd.address.zip_code = zip + oegd.address.city = city + oegd.address.street_number = street + oegd.address.country_code = "D" + + oegd.cwa_consent_flag = true + + oegd.phone = (editOEGD_txtTelefon.text ?? "") + + let jsonEncoder = JSONEncoder() + var jsonData: Data? + do{ + jsonData = try jsonEncoder.encode(oegd) + } + catch let err + { + Core.Log.Error(err: err, namespace: "OEGDController", method: "NewOEGDCreate") + } + + + let json = String(data: jsonData!, encoding: .utf8) + if(json != nil) + { + let password = Core.Security.AES.GetKey(password: AppDelegate.Session.DevicePassword) + let encryptedContent = Core.Security.AES.Encrypt(value: (json ?? ""), password: String(decoding: password, as: UTF8.self)) ?? "" + + if (encryptedContent.count>0) + { + var fileName2Store: String + if (filename == nil) + { + let formatter = DateFormatter() + formatter.dateFormat = "yyyyMMdd_HH_mm_ss" + fileName2Store = formatter.string(from: Date()) + NSUUID().uuidString.replacingOccurrences(of: "-", with: "") + ".oegd" + } + else + { + fileName2Store = filename! + } + + if (Core.System.WriteToStorage(filename: fileName2Store, data: encryptedContent.data(using: .utf8)!)) + { + return true + } + else + { + editOEGD_Status.text = Core.Lang.Get(key: "ERROR_COULD_NOT_SAVE_OEGD") + } + } + else + { + editOEGD_Status.text = Core.Lang.Get(key: "ERROR_COULD_NOT_SAVE_OEGD") + } + + } + + } + + return false + + } + + private func LoadOEGDs() + { + self.OEGDFiles = [] + let oegdfiles = Core.System.GetOEGDFiles() + if(oegdfiles.count>0) + { + for oneFile in oegdfiles + { + let encrypted_content = Core.System.ReadFromStorage(filename: oneFile) + if (encrypted_content != nil) + { + let pwd = Core.Security.AES.GetKey(password: AppDelegate.Session.DevicePassword) + let json = Core.Security.AES.Decrypt(value: String(decoding: encrypted_content!, as: UTF8.self), password: String(decoding: pwd, as: UTF8.self )) + if(json != nil) + { + let jsonDecoder = JSONDecoder() + do + { + let obj = try jsonDecoder.decode(Core.Models.OEGD.self, from: (json?.data(using: .utf8))!) + + let oegdFile = Core.Models.OEGDFile(OEGD: obj, filename: oneFile) + self.OEGDFiles.append(oegdFile) + + } + catch let err + { + Core.Log.Error(err: err, namespace: "OEGDController", method: "LoadOEGDs") + } + } + } + + } + } + + } + + @IBAction func editOEGD_SaveBtn_Click(_ sender: Any) + { + var filename: String? = nil + if (self.currentMode == OEGDEditType.Edit) + { + filename = self.CurrentOEGDFile?.filename + } + + if (NewOEGDCreate(filename: filename)) + { + self.HideOEGDEdit() + self.HideOEGDOptions() + self.InitializeScrollView() + } + } + + @IBAction func editOEGD_BackBtn_Click(_ sender: Any) + { + self.HideOEGDEdit() + } + + + private func HideOEGDEdit() + { + self.optionsPopup_Overlay.isHidden = false + + UIView.animate(withDuration: 0.24, animations: { + self.editPopup_Overlay.frame.origin = CGPoint(x: -self.editPopup_Overlay.frame.width, y: self.optionsPopup_Overlay.frame.origin.y) + self.optionsPopup_Overlay.frame.origin = CGPoint(x: 0, y: self.optionsPopup_Overlay.frame.origin.y) + }) {_ in + self.editPopup_Overlay.isHidden = true + } + + } + + @IBAction func editOEGD_PolicyBtn_Click(_ sender: Any) + { + //self.ShowCWAPolicy() + //self.ShowCWAPolicyInWeb() + } + + private func ShowCWAPolicyInWeb() + { + guard let url = URL(string: CWAPolicyLink) else { + return + } + let vc = WebViewController(url: url, title: Core.Lang.Get(key: "BTN_ACCEPT_CWA_POLICY"), localUrl: url) + vc.parentView = self + let navVC = UINavigationController(rootViewController: vc) + present(navVC, animated: true) + } + + private func ShowCWAPolicy() + { + self.policyPopup_Overlay.frame.origin = CGPoint(x: -self.policyPopup_Overlay.frame.width, y: self.editPopup_Overlay.frame.origin.y) + self.policyPopup_Overlay.isHidden = false + + UIView.animate(withDuration: 0.24, animations: { + self.policyPopup_Overlay.frame.origin = CGPoint(x: 0, y: self.policyPopup_Overlay.frame.origin.y) + self.editPopup_Overlay.frame.origin = CGPoint(x: self.editPopup_Overlay.frame.width, y: self.editPopup_Overlay.frame.origin.y) + }) {_ in + self.editPopup_Overlay.isHidden = true + } + } + + @IBAction func policyPopup_AcceptBtn_Click(_ sender: Any) + { + self.HideCWAPolicy() + } + + private func HideCWAPolicy() + { + self.editPopup_Checkbox.setChecked(flag: true) + + self.editPopup_Overlay.isHidden = false + + UIView.animate(withDuration: 0.24, animations: { + self.policyPopup_Overlay.frame.origin = CGPoint(x: -self.editPopup_Overlay.frame.width, y: self.policyPopup_Overlay.frame.origin.y) + self.editPopup_Overlay.frame.origin = CGPoint(x: 0, y: self.editPopup_Overlay.frame.origin.y) + }) {_ in + self.policyPopup_Overlay.isHidden = true + } + } + +} diff --git a/Befund/Controllers/PDFViewController.swift b/Befund/Controllers/PDFViewController.swift new file mode 100644 index 0000000..858cd10 --- /dev/null +++ b/Befund/Controllers/PDFViewController.swift @@ -0,0 +1,147 @@ +// +// PDFViewController.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 28.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import UIKit +import PDFKit + +class PDFViewController: UIViewController, PDFViewDelegate +{ + @IBOutlet weak var LBL_MY_RESULTS: UILabel! + @IBOutlet weak var PDFViewerArea: UIView! + private var PDFViewer: PDFView! + private var PDFData: Data? = nil + private var currentPdfDoc: PDFDocument? = nil + //@IBOutlet weak var LBL_BACK: UILabel! + + @IBOutlet weak var mainBtnBack: UIButton! + @IBOutlet weak var mainBtnMenu: UIButton! + + @IBOutlet weak var popupOverlay: UIView! + @IBOutlet weak var popupContent: UIView! + + @IBOutlet weak var popupBtnPrint: UIButton! + @IBOutlet weak var popupBtnShare: UIButton! + @IBOutlet weak var popupBtnBack: UIButton! + + override func viewDidLoad() + { + super.viewDidLoad() + + self.PDFViewer = PDFView(frame: self.PDFViewerArea.bounds) + self.PDFViewerArea.addSubview(self.PDFViewer) + self.PDFViewer.sizeToFit() + self.PDFViewer.autoScales = true + self.PDFViewer.displayDirection = .horizontal + + self.PDFViewer.delegate = self + //self.LBL_BACK.text = Core.Lang.Get(key: "BTN_BACK") + self.LBL_MY_RESULTS.text = Core.Lang.Get(key: "BTN_MY_RESULT") + + if(self.PDFData != nil) + { + self.currentPdfDoc = PDFDocument(data: self.PDFData!) + self.PDFViewer.document = self.currentPdfDoc + + } + + self.popupOverlay.frame = self.view.frame + self.view.addSubview(self.popupOverlay) + self.popupOverlay.isHidden = true + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + self.InitLabels() + } + + private func InitLabels() + { + self.LBL_MY_RESULTS.text = Core.Lang.Get(key: "BTN_MY_RESULT") + //self.LBL_BACK.text = Core.Lang.Get(key: "BTN_BACK") + + self.popupBtnPrint.setTitle(Core.Lang.Get(key: "BTN_PRINT"), for: .normal) + self.popupBtnShare.setTitle(Core.Lang.Get(key: "BTN_FILE_SHARE"), for: .normal) + self.popupBtnBack.setTitle(Core.Lang.Get(key: "BTN_BACK"), for: .normal) + } + + public func setContent(data: Data) + { + self.PDFData = data + } + + @IBAction func goBack(_ sender: Any) + { + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromLeft + self.view.window!.layer.add(transition, forKey: kCATransition) + self.dismiss(animated: false) + } + + @IBAction func PopupMenuShow(_ sender: Any) + { + self.popupContent.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + self.popupOverlay.alpha = 0.0 + self.popupOverlay.isHidden = false + + UIView.animate(withDuration: 0.24) { + self.popupContent.transform = CGAffineTransform.identity + self.popupOverlay.alpha = 70.0 + } + } + + @IBAction func PopupMenuHide(_ sender: Any) + { + + UIView.animate(withDuration: 0.24, animations: { + self.popupOverlay.alpha = 0.0 + self.popupContent.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + }) {_ in + self.popupOverlay.isHidden = true + } + } + + + @IBAction func PrintButtonClick(_ sender: Any) + { + if(self.PDFViewer != nil) + { + let printController = UIPrintInteractionController.shared + let printInfo = UIPrintInfo(dictionary: nil) + printInfo.jobName = "Befunddruck" + printInfo.outputType = .photo + printController.printInfo = printInfo + printController.printingItem = self.PDFData + printController.present(animated: true) + { + (_, isPrinted, error) in + + if(error != nil) + { + Core.Log.Error(err: error!, namespace: "PDFViewController", method: "PrintButtonClick") + } + } + } + } + + @IBAction func ShareButtonClick(_ sender: Any) + { + //var filesToShare = [Any]() + //filesToShare.append(self.currentPdfDoc) + + if let pdfData = self.currentPdfDoc?.dataRepresentation() + { + let objectsToShare = [pdfData] + + let activityViewController = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil) + activityViewController.popoverPresentationController?.sourceView = self.view + present(activityViewController, animated: true, completion: nil) + } + } + +} diff --git a/Befund/Controllers/ScannerController.swift b/Befund/Controllers/ScannerController.swift new file mode 100644 index 0000000..f8701c9 --- /dev/null +++ b/Befund/Controllers/ScannerController.swift @@ -0,0 +1,280 @@ +// +// ScannerController.swift +// Befund +// +// Created by Artur Savitskiy on 29.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import AVFoundation +import UIKit + +class ScannerViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate { + var captureSession: AVCaptureSession! + var previewLayer: AVCaptureVideoPreviewLayer! + + var scanFailed: Bool = false + var laborIsSelected: Bool = false + + private var isBarcodeScan = false + + @IBOutlet weak var btnBack: UIButton! + + enum CameraAutorizationStatus{ + case None + case Autorized + case Declined + } + + public static func InitScannerController( scanSampleID: Bool) -> ScannerViewController + { + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let scanController = storyboard.instantiateViewController(identifier: "ScannerController") as ScannerViewController + + scanController.isBarcodeScan = scanSampleID + + return scanController + } + + + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = UIColor.gray + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + let status = self.checkCameraAutorizationStatus() + if ( status == CameraAutorizationStatus.Declined) { + failedWithAlert() + } + else if (status == CameraAutorizationStatus.Autorized) + { + StartCapture() + } + } + + private func StartCapture() + { + if (captureSession == nil) + { + + captureSession = AVCaptureSession() + + guard let videoCaptureDevice = AVCaptureDevice.default(for: .video) else { + failed() + return } + + let videoInput: AVCaptureDeviceInput + + do { + videoInput = try AVCaptureDeviceInput(device: videoCaptureDevice) + } catch { + failed() + return + } + + if (captureSession.canAddInput(videoInput)) { + captureSession.addInput(videoInput) + } else { + failed() + return + } + + let metadataOutput = AVCaptureMetadataOutput() + + if (captureSession.canAddOutput(metadataOutput)) { + captureSession.addOutput(metadataOutput) + + metadataOutput.setMetadataObjectsDelegate(self, queue: DispatchQueue.main) + if (isBarcodeScan) + { + metadataOutput.metadataObjectTypes = [.code128, .code39, .code39Mod43, .code93, .ean13, .ean8, .interleaved2of5, .itf14, .pdf417, .upce] + } + else + { + metadataOutput.metadataObjectTypes = [.qr] + } + } else { + failed() + return + } + + previewLayer = AVCaptureVideoPreviewLayer(session: captureSession) + previewLayer.frame = view.layer.bounds + previewLayer.videoGravity = .resizeAspectFill + view.layer.addSublayer(previewLayer) + + btnBack.superview?.bringSubviewToFront(btnBack); + } + + if (captureSession?.isRunning == false) { + captureSession.startRunning() + } + + } + + func checkCameraAutorizationStatus() -> CameraAutorizationStatus + { + switch AVCaptureDevice.authorizationStatus(for: .video) + { + case .authorized: + return CameraAutorizationStatus.Autorized + case .notDetermined: + AVCaptureDevice.requestAccess(for: .video) { + granted in + if granted { + DispatchQueue.main.async + { + self.StartCapture() + } + } + else + { + DispatchQueue.main.async + { + self.return2MainWindow() + } + } + } + return CameraAutorizationStatus.None + case .denied: + return CameraAutorizationStatus.Declined + case .restricted: + return CameraAutorizationStatus.Declined + @unknown default: + return CameraAutorizationStatus.Declined + } + } + + func failed() + { + scanFailed = true + captureSession = nil + failedWithAlert() + } + + func failedWithAlert() { + let ac = UIAlertController(title: Core.Lang.Get(key: "LBL_SCAN_NOT_SUPPORTED"), message: Core.Lang.Get(key: "MSG_SCAN_NOT_SUPPORTED"), preferredStyle: .alert) + ac.addAction(UIAlertAction(title: "OK", style: .default, handler: failedWithAlertOk)) + let settingsAction = UIAlertAction(title: "Einstellungen", style: .default, handler: OpenSettings) + ac.addAction(settingsAction) + self.present(ac, animated: true, completion: nil) + } + + func OpenSettings(alert: UIAlertAction!) + { + guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else + { + return + } + + if (UIApplication.shared.canOpenURL(settingsUrl)){ + UIApplication.shared.open(settingsUrl) + } + } + + func failedWithAlertOk(alert: UIAlertAction!) { + #if DEBUG + if (isBarcodeScan) + { + self.foundBarcode(code: "123456789ABCDE") + } + else + { + self.found(code: "befund://labor?id=LIS_SIMULATOR") + } + //self.found(code: "befund://labor?id=LABOR_MOENCHENGLADBACH") + #endif + if (!laborIsSelected) + { + self.return2MainWindow() + } + + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + + if (captureSession?.isRunning == true) { + captureSession.stopRunning() + } + } + + func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) { + captureSession.stopRunning() + + if let metadataObject = metadataObjects.first { + guard let readableObject = metadataObject as? AVMetadataMachineReadableCodeObject else { return } + guard let stringValue = readableObject.stringValue else { return } + AudioServicesPlaySystemSound(SystemSoundID(kSystemSoundID_Vibrate)) + if (isBarcodeScan) + { + foundBarcode(code: stringValue) + } + else + { + found(code: stringValue) + } + + } + + dismiss(animated: true) + } + + func found(code: String) { + if(code.count>0) + { + let posIndex = code.range(of: "id=")!.lowerBound + let index = code.distance(from: code.startIndex, to: posIndex) + let substr = code.dropFirst(index) + let labID = substr.replacingOccurrences(of: "id=", with: "") + let labor = Core.Models.Labor.GetLaborByName(id: labID) + if (labor.id.count>0) + { + self.SelectLabor(labor: labor) + self.return2MainWindow() + } + } + } + + func foundBarcode(code: String) { + if(code.count>0) + { + ViewController.currentlySelectedBarcode = code + self.return2MainWindow() + } + } + + + func SelectLabor(labor: Core.Models.Labor) + { + var settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + if (settings == nil) + { + settings = Core.Models.Settings() + } + settings!.labor = labor + laborIsSelected = settings!.save(atPath: Core.System.SettingsPath()) + } + + @IBAction func goBack(_ sender: Any) + { + self.return2MainWindow() + } + + private func return2MainWindow() + { + self.view.endEditing(true) + self.dismiss(animated: true, completion: nil) + } + + override var prefersStatusBarHidden: Bool { + return true + } + + override var supportedInterfaceOrientations: UIInterfaceOrientationMask { + return .portrait + } +} diff --git a/Befund/Controllers/SelectLaborController.swift b/Befund/Controllers/SelectLaborController.swift new file mode 100644 index 0000000..5c0bf7f --- /dev/null +++ b/Befund/Controllers/SelectLaborController.swift @@ -0,0 +1,81 @@ +// +// SelectLaborController.swift +// Befund +// +// Created by Artur Savitskiy on 29.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +import UIKit + +class SelectLaborController: UIViewController, UIAlertViewDelegate +{ + + @IBOutlet weak var LBL_SELECT_LABOR: UILabel! + @IBOutlet weak var LBL_SCAN_QR_CODE: UILabel! + @IBOutlet weak var selectLaborBtn: UIButton! + + var qrImage: UIImage! + + override func viewDidLoad() { + super.viewDidLoad() + self.Initialize() + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + self.SetLabels() + let settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + if(settings != nil && settings?.labor != nil) + { + UIApplication.shared.windows[0].rootViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "Main") + } + } + + private func Initialize() + { + let image = UIImage(named: "btn_qrcode") + let btnFrame = self.selectLaborBtn.frame + let newRatio = btnFrame.size.width / image!.size.width + let newSize = CGSize(width: image!.size.width * newRatio, height: image!.size.height * newRatio) + + let rect = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height) + UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0) + image?.draw(in: rect) + qrImage = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + } + + private func SetLabels() + { + self.LBL_SELECT_LABOR.text = Core.Lang.Get(key: "LBL_SELECT_LABOR") + self.LBL_SELECT_LABOR.isHidden = true + + self.LBL_SCAN_QR_CODE.text = Core.Lang.Get(key: "LBL_SCAN_QR_CODE") + + self.selectLaborBtn.setTitle("", for: .normal) + self.selectLaborBtn.setImage(qrImage?.withRenderingMode(.alwaysOriginal), for: .normal) + + } + + @IBAction func selectLaborBtn_Click(_ sender: Any) + { + self.OpenScanner() + } + + private func OpenScanner() + { + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let scannerController = storyboard.instantiateViewController(identifier: "ScannerController") + + scannerController.modalPresentationStyle = .fullScreen + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromRight + self.view.window!.layer.add(transition, forKey: kCATransition) + self.present(scannerController, animated: false) + + } +} diff --git a/Befund/Controllers/SettingsController.swift b/Befund/Controllers/SettingsController.swift new file mode 100644 index 0000000..f5265bb --- /dev/null +++ b/Befund/Controllers/SettingsController.swift @@ -0,0 +1,765 @@ +// +// EditOEGDController.swift +// Befund +// +// Created by Artur Savitskiy on 21.07.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +import UIKit + +class SettingsController: UIViewController, UITextFieldDelegate, UpdatingParentCheckBox +{ + + public enum PopupType: Int + { + case Setting + case ChangePWD + case OEGD + case Support + case FAQ + case AGB + } + + + public static var CurrentViewController: SettingsController? = nil + public static var Settings: Core.Models.Settings? = nil + + @IBOutlet weak var settingsContent: UIView! + + @IBOutlet weak var LBL_TITLE: UILabel! + @IBOutlet weak var LBL_REGISTER: UILabel! + + @IBOutlet weak var menuContent_btnBack: UIButton! + //@IBOutlet weak var menuContent_labelBack: UILabel! + @IBOutlet weak var menuContent_btnSettings: UIButton! + @IBOutlet weak var menuContent_btnChangePassword: UIButton! + //@IBOutlet weak var menuContent_btnOEGD: UIButton! + @IBOutlet weak var menuContent_btnSupport: UIButton! + @IBOutlet weak var menuContent_btnFAQ: UIButton! + @IBOutlet weak var menuContent_btnAGB: UIButton! + + //Settings-Popup + @IBOutlet weak var PopupSettings_Overlay: UIView! + @IBOutlet weak var PopupSettings: UIView! + @IBOutlet weak var menuSettingsView: UIView! + @IBOutlet weak var menuChangePWDView: UIView! + //@IBOutlet weak var menuOEGDView: UIView! + @IBOutlet weak var menuSupportView: UIView! + @IBOutlet weak var menuFAQView: UIView! + @IBOutlet weak var menuAGBView: UIView! + + @IBOutlet weak var popupSettings_labelSettings: UILabel! + @IBOutlet weak var popupSettings_labelYourLabor: UILabel! + @IBOutlet weak var popupSettings_labelName: UILabel! + @IBOutlet weak var popupSettings_labelStreet: UILabel! + @IBOutlet weak var popupSettings_labelCity: UILabel! + @IBOutlet weak var popupSettings_labelTel: UILabel! + @IBOutlet weak var popupSettings_labelWeb: UILabel! + @IBOutlet weak var popupSettings_labelStatus: UILabel! + @IBOutlet weak var popupSettings_laborLogo: UIImageView! + + + @IBOutlet weak var popupSettings_labelLanguage: UILabel! + @IBOutlet weak var popupSettings_btnDE: UIButton! + @IBOutlet weak var popupSettings_markerDE: UIView! + @IBOutlet weak var popupSettings_btnEN: UIButton! + @IBOutlet weak var popupSettings_markerEN: UIView! + @IBOutlet weak var popupSettings_btnBack: UIButton! + + //ChangePassword-Popup + @IBOutlet weak var PopupChangePWD_Overlay: UIView! + @IBOutlet weak var PopupChangePWD: UIView! + @IBOutlet weak var popupChangePWD_btnBack: UIButton! + @IBOutlet weak var popupChangePWD_btnChange: UIButton! + @IBOutlet weak var popupChangePWD_Loading: UIActivityIndicatorView! + @IBOutlet weak var popupChangePWD_Status: UILabel! + @IBOutlet weak var popupChangePWD_txtOldPassword: UITextField! + @IBOutlet weak var popupChangePWD_txtNewPassword: UITextField! + @IBOutlet weak var popupChangePWD_txtNewPasswordConfirm: UITextField! + @IBOutlet weak var popupChangePWD_txtNewPin: UITextField! + @IBOutlet weak var popupChangePWD_labPwdHinweis: UILabel! + + //private let faqLink = "https://www.limbachgruppe.com/fileadmin/downloads/098672600.html" + @IBOutlet var PopupPrivatePolicy_Checkbox: CheckBoxButton! + public var confirmCheckBox: CheckBoxButton! { + get { + return PopupPrivatePolicy_Checkbox + } + } + + + override func viewDidLoad() + { + super.viewDidLoad() + self.Initialize() + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + self.InitLabels() + self.EnableButtonViews() + } + + override func loadView() { + super.loadView() + } + + /** + * Initializes view + */ + private func Initialize() + { + SettingsController.CurrentViewController = self + SettingsController.Settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + + self.PopupSettings_Overlay.frame = self.view.frame + self.view.addSubview(self.PopupSettings_Overlay) + self.PopupSettings_Overlay.isHidden = true + + self.PopupChangePWD_Overlay.frame = self.view.frame + self.view.addSubview(self.PopupChangePWD_Overlay) + self.PopupChangePWD_Overlay.isHidden = true + + self.popupSettings_btnDE.tag = 0 + self.popupSettings_btnEN.tag = 1 + + self.MarkSelectedLanguage(lang: SettingsController.Settings?.lang) + + self.popupChangePWD_txtOldPassword.delegate = self + self.popupChangePWD_txtOldPassword.returnKeyType = .next + self.popupChangePWD_txtNewPassword.delegate = self + self.popupChangePWD_txtNewPassword.returnKeyType = .next + self.popupChangePWD_txtNewPasswordConfirm.delegate = self + self.popupChangePWD_txtNewPasswordConfirm.returnKeyType = .next + self.popupChangePWD_txtNewPin.delegate = self + self.popupChangePWD_txtNewPin.returnKeyType = .done + + self.popupChangePWD_labPwdHinweis.text = "" + self.popupChangePWD_labPwdHinweis.isHidden = false + self.popupChangePWD_txtNewPassword.addTarget(self, action: #selector(self.ShowPWDHinweis), for: .editingDidBegin) + self.popupChangePWD_txtNewPassword.addTarget(self, action: #selector(self.HidePWDHinweis), for: .editingDidEnd) + self.popupChangePWD_txtNewPasswordConfirm.addTarget(self, action: #selector(self.ShowPWDHinweis), for: .editingDidBegin) + self.popupChangePWD_txtNewPasswordConfirm.addTarget(self, action: #selector(self.HidePWDHinweis), for: .editingDidEnd) + self.popupChangePWD_txtNewPin.addTarget(self, action: #selector(self.ShowPinHinweis), for: .editingDidBegin) + self.popupChangePWD_txtNewPin.addTarget(self, action: #selector(self.HidePWDHinweis), for: .editingDidEnd) + + self.addDoneToolbar([popupChangePWD_txtOldPassword, popupChangePWD_txtNewPassword, popupChangePWD_txtNewPasswordConfirm, popupChangePWD_txtNewPin]) + + self.hideKeyboardWhenTappedAround() + } + + @objc func ShowPWDHinweis() + { + self.popupChangePWD_Status.text = "" + + self.popupChangePWD_labPwdHinweis.text = Core.Lang.Get(key: "ERROR_ENTER_STRONG_PASSWORD") + self.popupChangePWD_labPwdHinweis.isHidden = false + } + + @objc func ShowPinHinweis() + { + self.popupChangePWD_Status.text = "" + + self.popupChangePWD_labPwdHinweis.text = Core.Lang.Get(key: "ERROR_PIN_LENGTH") + self.popupChangePWD_labPwdHinweis.isHidden = false + } + + + @objc func HidePWDHinweis() + { + self.popupChangePWD_labPwdHinweis.text = "" + self.popupChangePWD_labPwdHinweis.isHidden = true + } + + internal func textFieldShouldReturn(_ textField: UITextField) -> Bool { + self.switchBasedNextTextField(textField) + return true + } + + private func switchBasedNextTextField(_ textField: UITextField) { + switch textField { + case self.popupChangePWD_txtOldPassword: + self.popupChangePWD_txtNewPassword.becomeFirstResponder() + case self.popupChangePWD_txtNewPassword: + self.popupChangePWD_txtNewPasswordConfirm.becomeFirstResponder() + case self.popupChangePWD_txtNewPasswordConfirm: + self.popupChangePWD_txtNewPin.becomeFirstResponder() + default: + self.view.endEditing(true) + } + } + + private func EnableButtonViews() + { + let pwdIsNotDefined = ((AppDelegate.Session.DevicePassword ?? "").count == 0) + + self.LBL_REGISTER.isHidden = !pwdIsNotDefined + self.menuSettingsView.isHidden = pwdIsNotDefined + self.menuChangePWDView.isHidden = pwdIsNotDefined + //self.menuOEGDView.isHidden = pwdIsNotDefined + + let fullHeight = self.settingsContent.frame.size.height + var showHeight = self.LBL_TITLE.frame.size.height + showHeight += (pwdIsNotDefined ? self.LBL_REGISTER.frame.size.height : 0) + showHeight += (!pwdIsNotDefined ? self.menuSettingsView.frame.size.height : 0) + showHeight += (!pwdIsNotDefined ? self.menuChangePWDView.frame.size.height : 0) + //showHeight += (!pwdIsNotDefined ? self.menuOEGDView.frame.size.height : 0) + showHeight += self.menuSupportView.frame.size.height + showHeight += self.menuFAQView.frame.size.height + showHeight += self.menuAGBView.frame.size.height + + var begY = (fullHeight - showHeight) / 2 + + var vFrame = self.LBL_TITLE.frame + vFrame.origin.y = begY + self.LBL_TITLE.frame = vFrame + begY += self.LBL_TITLE.frame.size.height + + if(pwdIsNotDefined) { + vFrame = self.LBL_REGISTER.frame + vFrame.origin.y = begY + self.LBL_REGISTER.frame = vFrame + begY += self.LBL_REGISTER.frame.size.height + } + if(!pwdIsNotDefined) { + vFrame = self.menuSettingsView.frame + vFrame.origin.y = begY + self.menuSettingsView.frame = vFrame + begY += self.menuSettingsView.frame.size.height + + vFrame = self.menuChangePWDView.frame + vFrame.origin.y = begY + self.menuChangePWDView.frame = vFrame + begY += self.menuChangePWDView.frame.size.height + + //vFrame = self.menuOEGDView.frame + //vFrame.origin.y = begY + //self.menuOEGDView.frame = vFrame + //begY += self.menuOEGDView.frame.size.height + } + + vFrame = self.menuSupportView.frame + vFrame.origin.y = begY + self.menuSupportView.frame = vFrame + begY += self.menuSupportView.frame.size.height + + vFrame = self.menuFAQView.frame + vFrame.origin.y = begY + self.menuFAQView.frame = vFrame + begY += self.menuFAQView.frame.size.height + + vFrame = self.menuAGBView.frame + vFrame.origin.y = begY + self.menuAGBView.frame = vFrame + begY += self.menuAGBView.frame.size.height + + } + + private func MarkSelectedLanguage(lang: Core.Lang.Languages?) + { + if (lang == Core.Lang.Languages.EN) + { + self.popupSettings_markerDE.isHidden=true + self.popupSettings_markerEN.isHidden=false + } + else + { + self.popupSettings_markerDE.isHidden=false + self.popupSettings_markerEN.isHidden=true + } + } + + private func InitLabels() + { + + self.LBL_TITLE.text = Core.Lang.Get(key: "LBL_MENU") + self.LBL_REGISTER.text = Core.Lang.Get(key: "MSG_YOU_ARE_NOT_REGISTERED") + + self.menuContent_btnSettings.setTitle(Core.Lang.Get(key: "BTN_SETTINGS"), for: .normal) + self.menuContent_btnSettings.tag = PopupType.Setting.rawValue + + self.menuContent_btnChangePassword.setTitle(Core.Lang.Get(key: "BTN_CHANGE_PASSWORD"), for: .normal) + self.menuContent_btnChangePassword.tag = PopupType.ChangePWD.rawValue + + //self.menuContent_btnOEGD.setTitle(Core.Lang.Get(key: "BTN_OEGD"), for: .normal) + //self.menuContent_btnOEGD.tag = PopupType.OEGD.rawValue + + self.menuContent_btnSupport.setTitle(Core.Lang.Get(key: "BTN_SUPPORT"), for: .normal) + self.menuContent_btnSupport.tag = PopupType.Support.rawValue + + self.menuContent_btnFAQ.setTitle(Core.Lang.Get(key: "BTN_FAQ"), for: .normal) + self.menuContent_btnFAQ.tag = PopupType.FAQ.rawValue + + self.menuContent_btnAGB.setTitle(Core.Lang.Get(key: "LBL_PRIVACY_POLICY"), for: .normal) + self.menuContent_btnAGB.tag = PopupType.AGB.rawValue + + self.menuContent_btnBack.setTitle("", for: .normal) + //self.menuContent_labelBack.text = Core.Lang.Get(key: "BTN_CLOSE") + + self.popupSettings_btnBack.setTitle(Core.Lang.Get(key: "BTN_CLOSE"), for: .normal) + self.popupSettings_btnBack.tag = PopupType.Setting.rawValue + self.popupSettings_labelLanguage.text = Core.Lang.Get(key: "LBL_LANGUAGE") + + //popup "Password change" + self.popupChangePWD_btnChange.setTitle(Core.Lang.Get(key: "BTN_CHANGE"), for: .normal) + self.popupChangePWD_btnBack.setTitle(Core.Lang.Get(key: "BTN_BACK"), for: .normal) + self.popupChangePWD_btnBack.tag = PopupType.ChangePWD.rawValue + + self.popupChangePWD_Loading.isHidden = true + self.popupChangePWD_Loading.stopAnimating() + + self.popupChangePWD_txtOldPassword.placeholder = Core.Lang.Get(key: "LBL_CURRENT_PASSWORD") + self.popupChangePWD_txtOldPassword.enablePasswordToggle() + self.popupChangePWD_txtNewPassword.placeholder = Core.Lang.Get(key: "LBL_NEW_PASSWORD") + self.popupChangePWD_txtNewPassword.enablePasswordToggle() + self.popupChangePWD_txtNewPasswordConfirm.placeholder = Core.Lang.Get(key: "LBL_PASSWORD_CONFIRM") + self.popupChangePWD_txtNewPasswordConfirm.enablePasswordToggle() + + self.popupChangePWD_txtNewPin.placeholder = Core.Lang.Get(key: "LBL_NEW_PIN") + + + self.popupSettings_labelSettings.text = Core.Lang.Get(key: "LBL_YOUR_LABOR") + self.popupSettings_labelYourLabor.text = "" + if(SettingsController.Settings?.labor != nil) + { + self.popupSettings_labelName.text = SettingsController.Settings?.labor?.name + self.popupSettings_labelStreet.text = SettingsController.Settings?.labor?.street + self.popupSettings_labelCity.text = SettingsController.Settings?.labor?.city + self.popupSettings_labelTel.text = SettingsController.Settings?.labor?.tel + self.popupSettings_labelWeb.text = SettingsController.Settings?.labor?.web + + self.popupSettings_laborLogo.image = SettingsController.Settings?.labor?.logo + + if(AppDelegate.Session.Maintenance) + { + self.popupSettings_labelStatus.text = Core.Lang.Get(key: "MSG_MAINTENANCE") + self.popupSettings_labelStatus.backgroundColor = UIColor.red + } + else + { + self.CheckHostLabor() + } + } + } + + @IBAction func BtnFAQ_Click(_ sender: Any) + { + //var localUrl = getLocalFAQLink() + //guard let url = URL(string: localUrl) else { + // localUrl = faqLink + // return + //} + let localUrl = Core.Lang.Get(key: "FAQ_LINK") + let settingsAGBController = AGBPolicyController.InitWebViewController(url: localUrl, previewOnly: true, btnText: Core.Lang.Get(key: "BTN_BACK"), labText: "FAQ") + + settingsAGBController.modalPresentationStyle = .fullScreen + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromRight + self.view.window!.layer.add(transition, forKey: kCATransition) + self.present(settingsAGBController, animated: false) + + + + //self.ShowFAQInWeb() + } + + private func getLocalFAQLink() -> String + { + let baseURL = Bundle.main.path(forResource: "faq", ofType: "html") + return baseURL ?? "" + } + + private func ShowFAQInWeb() + { + let faqLink = Core.Lang.Get(key: "FAQ_LINK") + guard let url = URL(string: faqLink) else { + return + } + let localUrl = URL(string: getLocalFAQLink()) ?? url + + let vc = WebViewController(url: url, title: Core.Lang.Get(key: "BTN_BACK"), localUrl: localUrl) + vc.parentView = self + let navVC = UINavigationController(rootViewController: vc) + present(navVC, animated: true) + } + + + private func CheckHostLabor() + { + let requestKeyPair = Core.Security.Curve25519.GenerateKeyPair() + let currentHost = (SettingsController.Settings!.labor?.host) + + Core.Https.Request.KeyExchangeAsync(host: currentHost!, keyPair: requestKeyPair, + onSuccess: { + publicKey in + + + DispatchQueue.main.async + { + self.popupSettings_labelStatus.text = Core.Lang.Get(key: "LBL_CONNECTED") + self.popupSettings_labelStatus.backgroundColor = UIColor.green + } + }, + onError: { + error in + + DispatchQueue.main.async + { + self.popupSettings_labelStatus.text = Core.Lang.Get(key: "LBL_DISCONNECTED") + self.popupSettings_labelStatus.backgroundColor = UIColor.red + } + }) + + } + + @IBAction func goBack(_ sender: Any) + { + self.view.endEditing(true) + self.dismiss(animated: true, completion: nil) + } + + @IBAction func ButtonSupportOpenClick(_ sender: Any) + { + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let settingsSupportController = storyboard.instantiateViewController(identifier: "SupportController") + + settingsSupportController.modalPresentationStyle = .fullScreen + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromRight + self.view.window!.layer.add(transition, forKey: kCATransition) + self.present(settingsSupportController, animated: false) + } + + @IBAction func ButtonOEGDOpenClick(_ sender: Any) + { + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let settingsOEGDController = storyboard.instantiateViewController(identifier: "OEGDController") + + settingsOEGDController.modalPresentationStyle = .fullScreen + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromRight + self.view.window!.layer.add(transition, forKey: kCATransition) + self.present(settingsOEGDController, animated: false) + } + + @IBAction func ButtonAGBOpenClick(_ sender: Any) + { + let localUrl = Core.Lang.Get(key: "AGB_POLICY_LINK") + let settingsAGBController = AGBPolicyController.InitWebViewController(url: localUrl, previewOnly: true, btnText: Core.Lang.Get(key: "BTN_BACK"), labText: "Datenschutzerklärung") + + settingsAGBController.modalPresentationStyle = .fullScreen + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromRight + self.view.window!.layer.add(transition, forKey: kCATransition) + self.present(settingsAGBController, animated: false) + + } + + @IBAction func PopupSettingsShow(_ sender: Any) + { + let popupT = PopupType(rawValue: (sender as! UIButton).tag) + + var popupOverlay: UIView! = nil + var popup: UIView! = nil + + switch popupT { + case .Setting: + popupOverlay = self.PopupSettings_Overlay + popup = self.PopupSettings + break + case .ChangePWD: + self.popupChangePWD_txtOldPassword.text = "" + self.popupChangePWD_txtNewPassword.text = "" + self.popupChangePWD_txtNewPasswordConfirm.text = "" + popupOverlay = self.PopupChangePWD_Overlay + popup = self.PopupChangePWD + break + case .OEGD: + break + case .Support: + break + default: + break + } + + if (popup != nil) + { + popup.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + popupOverlay.alpha = 0.0 + popupOverlay.isHidden = false + + UIView.animate(withDuration: 0.24) { + popup.transform = CGAffineTransform.identity + popupOverlay.alpha = 70.0 + } + } + } + + @IBAction func PopupSettings_BtnBackClick(_ sender: Any) + { + + let popupT = PopupType(rawValue: (sender as! UIButton).tag) + self.HidePopup(popupType: popupT!) + } + + private func HidePopup(popupType: PopupType) + { + + var popupOverlay: UIView! = nil + var popup: UIView! = nil + + switch popupType { + case .Setting: + popupOverlay = self.PopupSettings_Overlay + popup = self.PopupSettings + break + case .ChangePWD: + popupOverlay = self.PopupChangePWD_Overlay + popup = self.PopupChangePWD + break + case .OEGD: + break + case .Support: + break + default: + break + } + + if (popup != nil) + { + UIView.animate(withDuration: 0.24, animations: { + popupOverlay.alpha = 0.0 + popup.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + }) {_ in + popupOverlay.isHidden = true + } + } + } + + @IBAction func PopupSettings_BtnLangClick(_ sender: Any) + { + let curBut = sender as! UIButton + let curType = curBut.tag + switch curType + { + case 1: + Core.Lang.SetLanguage(lang: Core.Lang.Languages.EN) + SettingsController.Settings?.lang = Core.Lang.Languages.EN + break + default: + Core.Lang.SetLanguage(lang: Core.Lang.Languages.DE) + SettingsController.Settings?.lang = Core.Lang.Languages.DE + break + } + self.MarkSelectedLanguage(lang: SettingsController.Settings?.lang) + SettingsController.Settings?.save(atPath: Core.System.SettingsPath()) + self.InitLabels() + } + + private func PasswordActivity_HideLoading(message: String) + { + self.popupChangePWD_Loading.isHidden = true + if(!message.isEmpty) + { + self.popupChangePWD_Status.text = message + } + } + + @IBAction func popupPasswordChange_BtnChangeClick() + { + self.popupChangePWD_Loading.isHidden=false + self.popupChangePWD_Loading.startAnimating() + + let old_password = self.popupChangePWD_txtOldPassword.text ?? "" + if(old_password.count == 0) + { + self.PasswordActivity_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_OLD_PASSWORD")) + } + else + { + let tmp_decrypted_key = Core.Security.AES.Decrypt(value: SettingsController.Settings?.hashed_private_key ?? "", password: String( decoding:Core.Security.AES.GetKey(password: old_password), as: UTF8.self)) + + if(tmp_decrypted_key != nil) + { + let newPass = self.popupChangePWD_txtNewPassword.text ?? "" + let confirmPass = self.popupChangePWD_txtNewPasswordConfirm.text ?? "" + let pinNew = self.popupChangePWD_txtNewPin.text ?? "" + + if(!Core.Models.Request.ChangeVerificatorHashProvider.IsPasswordStrong(password: newPass)) + { + self.PasswordActivity_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_STRONG_PASSWORD")) + } + else if(newPass != confirmPass) + { + self.PasswordActivity_HideLoading(message: Core.Lang.Get(key: "ERROR_PASSWORD_MISMATCH")) + } + else if(pinNew.count == 0) + { + self.PasswordActivity_HideLoading( message: Core.Lang.Get(key: "ERROR_ENTER_PIN")) + } + else if(pinNew.count != 5) + { + self.PasswordActivity_HideLoading( message: Core.Lang.Get(key: "ERROR_PIN_LENGTH")) + } + else + { + self.popupChangePWD_Status.text = "" + + let newPassAESkey = Core.Security.AES.GetKey(password: newPass) + let decrypted_private_key = Core.Security.AES.Decrypt(value: SettingsController.Settings?.hashed_private_key ?? "", password: String( decoding:Core.Security.AES.GetKey(password: old_password), as: UTF8.self)) + + var requestKeyPair = Core.Security.Curve25519.GenerateKeyPair(); + + let changeVerificatorHash = Core.Models.Request.ChangeVerificatorHash() + + changeVerificatorHash.old_verificator_hash = SettingsController.Settings?.verificator_hash + + changeVerificatorHash.new_verificator_hash = Core.Security.SHA512.HMAC(message: Core.Security.SHA512.VerificatorHashingValue.data(using: .utf8)!, key: String(decoding: newPassAESkey, as: UTF8.self)) + + changeVerificatorHash.udid = SettingsController.Settings?.udid + + changeVerificatorHash.pin = pinNew + + let results = Core.Database.Results.GetResults() + + if(results != nil && results!.count>0) + { + for res in results! + { + + let file = Core.System.GetPathForStorageEncryptedFile(filename: res.pgs!) + + if(file != nil && Core.System.FileExists(atPath: file!)) + { + let encrypted_content = Core.System.ReadFromEncryptedStorage(filename: res.pgs!) + + if(!encrypted_content!.isEmpty) + { + let oldKey=Core.Security.AES.GetKey(password: old_password) + let decrypted_content = Core.Security.AES.Decrypt( + value: String (decoding: encrypted_content!, as: UTF8.self), + password: String(decoding: oldKey, as: UTF8.self)) + + if(decrypted_content != nil) + { + let newKey = Core.Security.AES.GetKey(password: newPass) + let local_encrypted = Core.Security.AES.Encrypt( + value: decrypted_content!, + password: String(decoding: newKey, as: UTF8.self)) + + if(local_encrypted != nil) + { + Core.System.WriteToEncryptedStorage(filename: res.pgs!, data: local_encrypted!.data(using: .utf8)!) + + } + } + } + } + } + } + + requestKeyPair = Core.Security.Curve25519.GenerateKeyPair() + + let currentHost = ViewController.Settings!.labor?.host ?? .DEVELOPMENT + + Core.Https.Request.KeyExchangeAsync(host: (ViewController.Settings!.labor?.host ?? .DEVELOPMENT), keyPair: requestKeyPair, + onSuccess: { + publicKey in + + let sharedKey = requestKeyPair.GetSharedKey(peerPublicKeyBase64: publicKey.key) + let encryptedRequest = Core.Models.Request.EncryptedRequest(descriptor: "ChangeVerificatorHash", contentObject: changeVerificatorHash, requestType: .REQUEST_VERIFICATOR_HASH, key: sharedKey!) + + Core.Https.Request.EncryptedRequestAsync(host: currentHost, controller: "results", action: "update_verificator_hash", request: encryptedRequest, serverPublicKey: publicKey, keyPair: requestKeyPair, onSuccess: { + + encryptedResponse in + + encryptedResponse.Decrypt(key: sharedKey!) + + DispatchQueue.main.async + { + if(encryptedResponse.descriptor!.lowercased() == "success") + { + + let keyNewPass = Core.Security.AES.GetKey(password: newPass) + + SettingsController.Settings!.password_reset_hash = NSUUID().uuidString + + let pwdPlus = (SettingsController.Settings!.password_reset_hash ?? "") + changeVerificatorHash.pin! + + let passwordHashKey = Core.Security.AES.GetKey( + password: pwdPlus) + + SettingsController.Settings!.password_hash = Core.Security.AES.Encrypt(value: newPass, password: String(decoding: passwordHashKey, as: UTF8.self)) + + SettingsController.Settings!.verificator_hash = Core.Security.SHA512.HMAC( + message: Core.Security.SHA512.VerificatorHashingValue.data(using: .utf8)!, + key: String(decoding: keyNewPass, as: UTF8.self)) + + + SettingsController.Settings!.hashed_private_key = Core.Security.AES.Encrypt(value: decrypted_private_key!, password: String(decoding: keyNewPass, as: UTF8.self)) + + if(!SettingsController.Settings!.save(atPath: Core.System.SettingsPath())) + { + self.PasswordActivity_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_SAVE")) + Core.Log.Critical(msg: "Could not save settings to the file", namespace: "SettingsController", method: "PasswordChange") + } + else + { + ViewController.Settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + } + + AppDelegate.Session.DevicePassword = newPass + + self.PasswordActivity_HideLoading(message: "") + + DispatchQueue.main.asyncAfter(deadline: .now() + 1) + { + self.HidePopup(popupType: PopupType.ChangePWD) + + self.ShowMessagePopup(title: "", message: Core.Lang.Get(key: "MSG_PASSWORD_HAS_BEEN_CHANGED").replacingOccurrences(of: "[PIN]", with: changeVerificatorHash.pin!)) + } + } + else + { + self.PasswordActivity_HideLoading(message: encryptedResponse.descriptor!) + + } + } + }, + onError: { + error in + + DispatchQueue.main.async + { + self.PasswordActivity_HideLoading(message: error) + Core.Log.Critical(msg: "Server not reachable", namespace: "ViewController", method: "requestPGS") + } + }) + }, + onError: { + error in + DispatchQueue.main.async + { + self.PasswordActivity_HideLoading(message: error) + Core.Log.Critical(msg: "Server not reachable", namespace: "ViewController", method: "requestPGS") + } + }) + } + } + else + { + self.PasswordActivity_HideLoading(message: Core.Lang.Get(key: "ERROR_INVALID_PASSWORD")) + } + } + } +} diff --git a/Befund/Controllers/SupportController.swift b/Befund/Controllers/SupportController.swift new file mode 100644 index 0000000..4292db6 --- /dev/null +++ b/Befund/Controllers/SupportController.swift @@ -0,0 +1,342 @@ +// +// SupportController.swift +// Befund +// +// Created by Artur Savitskiy on 17.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +import UIKit + +class SupportController: UIViewController, UITextFieldDelegate, UIAlertViewDelegate, UITextViewDelegate +{ + public static var CurrentViewController: SupportController? = nil + public static var Settings: Core.Models.Settings? = nil + + private var SupportTopicsRegistered: NSMutableArray = + [ Core.Lang.Get(key: "LBL_SUPPORT_TOPIC_INFO") + , Core.Lang.Get(key: "LBL_SUPPORT_TOPIC_TROUBLE") + , Core.Lang.Get(key: "LBL_SUPPORT_TOPIC_ACCOUNT_DELETE")] + + private var SupportTopicsUnregistered: NSMutableArray = + [ Core.Lang.Get(key: "LBL_SUPPORT_TOPIC_INFO") + , Core.Lang.Get(key: "LBL_SUPPORT_TOPIC_TROUBLE")] + + //@IBOutlet weak var LBL_BACK: UILabel! + + @IBOutlet weak var popupSettings_labelYourLabor: UILabel! + @IBOutlet weak var popupSettings_labelName: UILabel! + @IBOutlet weak var popupSettings_labelStreet: UILabel! + @IBOutlet weak var popupSettings_labelCity: UILabel! + @IBOutlet weak var popupSettings_labelTel: UILabel! + @IBOutlet weak var popupSettings_labelWeb: UILabel! + @IBOutlet weak var popupSettings_laborLogo: UIImageView! + + @IBOutlet weak var support_LabHeader: UILabel! + @IBOutlet weak var support_btnBack: UIButton! + @IBOutlet weak var support_btnSend: UIButton! + @IBOutlet weak var support_Loading: UIActivityIndicatorView! + @IBOutlet weak var support_Status: UILabel! + @IBOutlet weak var support_txtEMail: UITextField! + @IBOutlet weak var support_txtTopic: UITextField! + var topicDownPicker: DownPicker! + @IBOutlet weak var support_txtMessage: UITextView! + + @IBOutlet weak var supportPassword_Overlay: UIView! + @IBOutlet weak var supportPassword_Content: UIView! + @IBOutlet weak var supportPassword_txtPassword: UITextField! + @IBOutlet weak var supportPassword_pwdStatus: UILabel! + @IBOutlet weak var supportPassword_btnBack: UIButton! + @IBOutlet weak var supportPassword_btnOK: UIButton! + + @IBOutlet weak var LBLBACK_Bottom: NSLayoutConstraint! + + override func viewDidLoad() { + super.viewDidLoad() + self.Initialize() + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + self.SetLabels() + } + + private func Initialize() + { + SupportController.Settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + + self.support_Loading.isHidden = true + self.support_Status.text = "" + + self.support_txtMessage.text = "" + + self.support_txtEMail.delegate = self + self.addDoneToolbar([self.support_txtEMail]) + self.support_txtTopic.delegate = self + self.support_txtMessage.delegate = self + self.addDoneToolbar(self.support_txtMessage) + + + self.supportPassword_txtPassword.delegate = self + self.supportPassword_txtPassword.enablePasswordToggle() + + if(SupportController.Settings?.verificator_hash != nil && AppDelegate.Session.DevicePassword != nil) + { + self.topicDownPicker = DownPicker(textField: self.support_txtTopic, withData: (SupportTopicsRegistered as! [Any])) + } + else + { + self.topicDownPicker = DownPicker(textField: self.support_txtTopic, withData: (SupportTopicsUnregistered as! [Any])) + } + + self.supportPassword_Overlay.frame = self.view.frame + self.view.addSubview(self.supportPassword_Overlay) + self.supportPassword_Overlay.isHidden = true + + self.hideKeyboardWhenTappedAround() + } + + private func SetLabels() + { + + //self.LBL_BACK.text = Core.Lang.Get(key: "BTN_BACK") + if(self.view.frame.height < 700) + { + //move circle button to bottom to save place for Status label for iPhone 8 + self.support_btnBack.frame.origin.y = self.support_btnBack.frame.origin.y + 30 + //self.LBLBACK_Bottom.constant = -5 + } + + self.support_LabHeader.text = Core.Lang.Get(key: "LBL_SUPPORT") + self.support_txtEMail.placeholder = Core.Lang.Get(key: "LBL_EMAIL") + self.support_btnSend.setTitle(Core.Lang.Get(key: "BTN_SEND"), for: .normal) + + self.supportPassword_txtPassword.placeholder = Core.Lang.Get(key: "LBL_PASSWORD") + self.supportPassword_btnBack.setTitle(Core.Lang.Get(key: "BTN_CANCEL"), for: .normal) + self.supportPassword_btnOK.setTitle(Core.Lang.Get(key: "BTN_SEND"), for: .normal) + + if(SupportController.Settings?.labor != nil) + { + self.popupSettings_labelName.text = SupportController.Settings?.labor?.name + self.popupSettings_labelStreet.text = SupportController.Settings?.labor?.street + self.popupSettings_labelCity.text = SupportController.Settings?.labor?.city + self.popupSettings_labelTel.text = SupportController.Settings?.labor?.tel + self.popupSettings_labelWeb.text = SupportController.Settings?.labor?.web + + self.popupSettings_laborLogo.image = SupportController.Settings?.labor?.logo + } + } + + private func ShowConfirmPassword() + { + self.supportPassword_pwdStatus.text = "" + + self.supportPassword_Content.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + self.supportPassword_Overlay.alpha = 0.0 + self.supportPassword_Overlay.isHidden = false + + UIView.animate(withDuration: 0.24) { + self.supportPassword_Content.transform = CGAffineTransform.identity + self.supportPassword_Overlay.alpha = 70.0 + } + + } + + @IBAction func supportPassword_BtnOK_Click(_ sender: Any) + { + let pwd = self.supportPassword_txtPassword.text ?? "" + + if(pwd.count==0) + { + self.supportPassword_pwdStatus.text = Core.Lang.Get(key: "ERROR_ENTER_PASSWORD") + } + else + { + let pwdDecrypted = Core.Security.AES.Decrypt(value: (SettingsController.Settings?.hashed_private_key ?? ""), password: pwd) + + if(pwdDecrypted != nil) + { + let txtEMail = self.support_txtEMail.text ?? "" + let txtTopic = self.support_txtTopic.text ?? "" + let txtMessage = self.support_txtMessage.text ?? "" + self.SendAsync(txtEmail: txtEMail, txtTopic: txtTopic, txtMessage: txtMessage, deleteDevice: true) + + self.HidePasswordResetPopup() + } + else + { + self.supportPassword_pwdStatus.text = Core.Lang.Get(key: "ERROR_INVALID_PASSWORD") + } + } + } + + @IBAction func supportPassword_BtnBack_Click(_ sender: Any) + { + self.HidePasswordResetPopup() + } + + private func HidePasswordResetPopup() + { + self.view.endEditing(true) + UIView.animate(withDuration: 0.24, animations: { + self.supportPassword_Overlay.alpha = 0.0 + self.supportPassword_Content.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + }) {_ in + self.supportPassword_Overlay.isHidden = true + } + } + + @IBAction func goBack(_ sender: Any) + { + self.view.endEditing(true) + self.dismiss(animated: true, completion: nil) + } + + private func support_HideLoading(message: String? = nil) + { + self.support_Loading.isHidden = true + self.support_Loading.stopAnimating() + + if(message != nil) + { + self.support_Status.text = message! + self.support_Status.isHidden = false + } + } + + @IBAction func support_BtnSend_Click(_ sender: Any) + { + self.support_Status.text = "" + + let txtEMail = self.support_txtEMail.text ?? "" + let txtTopic = self.support_txtTopic.text ?? "" + let txtMessage = self.support_txtMessage.text ?? "" + + if(txtEMail.count == 0) + { + self.support_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_EMAIL")) + } + else if(txtTopic.count == 0) + { + self.support_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_TOPIC")) + } + else if(txtMessage.count == 0) + { + self.support_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_TEXT")) + } + else + { + let deleteDevice = (txtTopic == Core.Lang.Get(key: "LBL_SUPPORT_TOPIC_ACCOUNT_DELETE")) + if(deleteDevice) + { + self.ShowConfirmPassword() + } + else + { + self.SendAsync(txtEmail: txtEMail, txtTopic: txtTopic, txtMessage: txtMessage, deleteDevice: deleteDevice) + self.support_btnSend.isEnabled = false + } + } + + } + + + private func SendAsync(txtEmail: String, txtTopic: String, txtMessage: String, deleteDevice: Bool) + { + self.support_Loading.isHidden = false + self.support_Loading.startAnimating() + + let requestKeyPair = Core.Security.Curve25519.GenerateKeyPair() + + let support = Core.Models.Request.Support() + support.email = txtEmail + support.topic = txtTopic + support.text = txtMessage + support.udid = AppDelegate.Session.Device?.udid + support.verificator_hash = SupportController.Settings?.verificator_hash + support.delete_device = deleteDevice + + let currentHost = ViewController.Settings!.labor?.host ?? .DEVELOPMENT + + Core.Https.Request.KeyExchangeAsync(host: currentHost, keyPair: requestKeyPair, + onSuccess: { + publicKey in + + let sharedKey = requestKeyPair.GetSharedKey(peerPublicKeyBase64: publicKey.key) + let encryptedRequest = Core.Models.Request.EncryptedRequest(descriptor: "Support", contentObject: support, requestType: .REQUEST_SUPPORT, key: sharedKey!) + + Core.Https.Request.EncryptedRequestAsync(host: currentHost, controller: "results", action: "support", request: encryptedRequest, serverPublicKey: publicKey, keyPair: requestKeyPair, onSuccess: { + + encryptedResponse in + + encryptedResponse.Decrypt(key: sharedKey!) + + DispatchQueue.main.async + { + if(encryptedResponse.descriptor.lowercased().elementsEqual("success")) + { + if(deleteDevice) + { + if (Core.System.DeleteAllFiles()) + { + + self.support_HideLoading(message: Core.Lang.Get(key: "MSG_ACCOUNT_SUCCESSFULLY_DELETED")) + + DispatchQueue.main.asyncAfter(deadline: .now() + 1) + { + AppDelegate.Session.DevicePassword = nil + UIApplication.shared.windows[0].rootViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "SelectLabor") + } + } + + } + else + { + self.support_HideLoading(message: Core.Lang.Get(key: "MSG_SUPPORT_SUCCESSFULLY_SENT")) + } + + } + else + { + if(deleteDevice) + { + self.support_HideLoading(message: Core.Lang.Get(key: "MSG_ACCOUNT_COULD_NOT_DELETED")) + } + else + { + self.support_HideLoading(message: Core.Lang.Get(key: "MSG_SUPPORT_COULD_NOT_SEND")) + } + } + + self.support_btnSend.isEnabled = true + self.support_txtEMail.text = "" + self.support_txtTopic.text = "" + self.support_txtMessage.text = "" + + } + }, + onError: { + error in + + DispatchQueue.main.async + { + //self.PasswordActivity_HideLoading(message: error) + Core.Log.Critical(msg: "Server not reachable", namespace: "LoginController", method: "ChangePassword") + + self.support_btnSend.isEnabled = true + } + }) + }, + onError: { + error in + DispatchQueue.main.async + { + //self.PasswordActivity_HideLoading(message: error) + Core.Log.Critical(msg: "Server not reachable", namespace: "SupportController", method: "DeleteAccount") + + self.support_btnSend.isEnabled = true + } + }) + } +} diff --git a/Befund/Controllers/ViewController.swift b/Befund/Controllers/ViewController.swift new file mode 100644 index 0000000..385ff1b --- /dev/null +++ b/Befund/Controllers/ViewController.swift @@ -0,0 +1,1922 @@ +// +// ViewController.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 29.04.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import AVFoundation +import UIKit + +class ViewController: UIViewController, UIAlertViewDelegate, UITextFieldDelegate, UITableViewDataSource, UITableViewDelegate, UNUserNotificationCenterDelegate, UpdatingParentCheckBox +{ + //MARK: *** ViewController + public static var CurrentViewController: ViewController? = nil + public static var Settings: Core.Models.Settings? = nil + public static var currentlySelectedBarcode: String = "" + + @IBOutlet weak var DashedArea: UIView! + @IBOutlet weak var LBLNORESULTS: UILabel! + //@IBOutlet weak var LBL_NEW_RESULTS: UILabel! + @IBOutlet weak var LBL_MY_RESULTS: UILabel! + @IBOutlet weak var LBL_HINWEIS: UILabel! + @IBOutlet weak var ResultsTable: UITableView! + private var ResultsTableRefresher: UIRefreshControl! + @IBOutlet weak var MainLoading: UIActivityIndicatorView! + + private var dbResults: Array? = nil + + //MARK: *** PopupNewPGS + + @IBOutlet weak var PopupNewPGS_Overlay: UIView! + @IBOutlet weak var PopupNewPGS: UIView! + + //MARK: *** PopupNewPGS - PGS + @IBOutlet weak var PopupNewPGS_PGS: UIView! + @IBOutlet weak var PopupNewPGS_ZipView: UIView! + @IBOutlet weak var PopupNewPGS_BirthdayView: UIView! + @IBOutlet weak var PopupNewPGS_SampleidView: UIView! + @IBOutlet weak var PopupNewPGS_txtZIP: UITextField! + @IBOutlet weak var PopupNewPGS_txtBirthday: UITextField! + let PopupNewPGS_dtBirthday = UIDatePicker() + @IBOutlet weak var PopupNewPGS_txtSampleid: UITextField! + @IBOutlet weak var PopupNwePGS_btnScanBarcode: UIButton! + @IBOutlet weak var PopupNewPGS_Loading: UIActivityIndicatorView! + @IBOutlet weak var PopupNewPGS_Status: UILabel! + @IBOutlet weak var PopupNewPGS_labPwdHinweis: UILabel! + + //MARK: *** PopupNewPGS - MasterPassword + @IBOutlet weak var PopupNewPGS_MasterPassword: UIView! + @IBOutlet weak var PopupNewPGS_PasswordConfirmView: UIView! + @IBOutlet weak var PopupNewPGS_PasswordView: UIView! + + @IBOutlet weak var PopupNewPGS_txtPassword: UITextField! + @IBOutlet weak var PopupNewPGS_txtPasswordConfirm: UITextField! + @IBOutlet weak var PopupNewPGS_txtPin: UITextField! + @IBOutlet weak var PopupNewPGS_PrivatePolicyArea: UIView! + @IBOutlet weak var PopupNewPGS_BtnPrivatePolicy: UIButton! + + //MARK: *** PopupNewPGS - Buttons + @IBOutlet weak var PopupNewPGS_BtnAdd: UIButton! + @IBOutlet weak var PopupNewPGS_BtnCancel: UIButton! + + //MARK: *** PopupPasswordConfirm + @IBOutlet weak var PopupPasswordConfirm_Overlay: UIView! + @IBOutlet weak var PopupPasswordConfirm: UIView! + @IBOutlet weak var PopupPasswordConfirm_BtnCancel: UIButton! + @IBOutlet weak var PopupPasswordConfirm_BtnEncrypt: UIButton! + @IBOutlet weak var PopupPasswordConfirm_PasswordView: UIView! + @IBOutlet weak var PopupPasswordConfirm_txtPassword: UITextField! + @IBOutlet weak var PopupPasswordConfirm_Loading: UIActivityIndicatorView! + @IBOutlet weak var PopupPasswordConfirm_Status: UILabel! + + + //MARK: *** PopupPrivatePolicy + @IBOutlet weak var PopupPrivatePolicy_Overlay: UIView! + @IBOutlet weak var PopupPrivatePolicy: UIView! + + @IBOutlet weak var PopupPrivatePolicy_TextLabel: UILabel! + @IBOutlet weak var PopupPrivatePolicy_BtnAccept: UIButton! + @IBOutlet weak var PopupPrivatePolicy_HeadLabel: UILabel! + + + // PopupPushNotification + @IBOutlet weak var PopupPush_Overlay: UIView! + @IBOutlet weak var PopupPush_Content: UIView! + + @IBOutlet weak var PopupPush_LabelText: UILabel! + @IBOutlet weak var PopupPush_LabelHeader: UILabel! + @IBOutlet weak var PopupPush_BtnYes: UIButton! + @IBOutlet weak var PopupPush_BtnNo: UIButton! + + + //MARK: *** Processing objects + private var CurrentDownload: Core.Models.Response.Download? = nil + private var CurrentDownloadResults: Core.Models.Database.Results? = nil + private var CurrentDownloadProcessing: Bool = false + private var LoadingData: Bool = false + + //MARK: Bottom Menu + @IBOutlet weak var BottomMenu: UIView! + + @IBOutlet weak var launch_Overlay: UIView! + @IBOutlet weak var launch_LimbachLogo: UIImageView! + @IBOutlet weak var launch_LaborLogo: UIImageView! + + //private let privatePolicyLink = "https://www.limbachgruppe.com/fileadmin/downloads/6406135946.html" + + + private var afterInitialize: Bool = false + + @IBOutlet var PopupPrivatePolicy_Checkbox: CheckBoxButton! + public var confirmCheckBox: CheckBoxButton! { + get { + return PopupPrivatePolicy_Checkbox + } + } + + override func viewDidLoad() + { + super.viewDidLoad() + self.Initialize() + NotificationCenter.default.addObserver(self, selector: #selector(appActivated), name: UIApplication.didBecomeActiveNotification, object: nil) + } + + @objc func appActivated() + { + if (self.viewIfLoaded?.window != nil && !self.CurrentDownloadProcessing) + { + self.dashedAreaLongPressed(sender: UILongPressGestureRecognizer()) + } + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + self.SetLabels() + ViewController.Settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + + if (!self.PopupNewPGS_Overlay.isHidden && ViewController.currentlySelectedBarcode.count > 0) + { + self.PopupNewPGS_txtSampleid.text = ViewController.currentlySelectedBarcode + ViewController.currentlySelectedBarcode = "" + } + + if (self.afterInitialize){ + self.afterInitialize = false + self.ShowLaborLogo() + } + else + { + self.ShowMainView() + } + } + + private func ShowMainView() + { + if(AppDelegate.Session.DevicePassword == nil && (ViewController.Settings?.verificator_hash != nil)) + { + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let devicePwdController = storyboard.instantiateViewController(identifier: "LoginController") + + devicePwdController.modalPresentationStyle = .fullScreen + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromRight + self.view.window!.layer.add(transition, forKey: kCATransition) + self.present(devicePwdController, animated: false) + } + else + { + if(ViewController.Settings?.udid != nil) + { + self.loadResults() + } + } + + if(!(ViewController.Settings?.pushNotificationExplained ?? false)) + { + self.ShowPopup(overlay: self.PopupPush_Overlay, content: self.PopupPush_Content) + } + else + { + self.AskForPushPermissions() + } + + } + + private func ShowLaborLogo() + { + if ((ViewController.Settings?.labor?.id ?? "").count > 0 ) + { + self.launch_Overlay.isHidden = false + + self.launch_LaborLogo.image = ViewController.Settings!.labor!.logo + self.launch_LaborLogo.frame.origin = CGPoint(x: -self.view.frame.width, y: self.launch_LimbachLogo.frame.origin.y) + self.launch_LaborLogo.isHidden = false + + let storeX = self.launch_LimbachLogo.frame.origin.x + + UIView.animate(withDuration: 1.00, animations: { + self.launch_LimbachLogo.frame.origin = CGPoint(x: self.view.frame.width, y: self.launch_LimbachLogo.frame.origin.y) + self.launch_LaborLogo.frame.origin = CGPoint(x: storeX, y: self.launch_LaborLogo.frame.origin.y) + }) {_ in + sleep(1) + self.launch_Overlay.isHidden = true + self.ShowMainView() + } + + } + else + { + self.ShowMainView() + } + + } + + /** + * Initializes view + */ + private func Initialize() + { + self.afterInitialize = true + //MARK: *** ViewController + + ViewController.CurrentViewController = self + ViewController.Settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + + self.PopupNewPGS_MasterPassword.isHidden = true + self.PopupNewPGS_HideLoading() + + self.launch_Overlay.frame = self.view.frame + self.view.addSubview(self.launch_Overlay) + + //MARK: *** PopupNewPGS + self.PopupNewPGS_Overlay.frame = self.view.frame + self.view.addSubview(self.PopupNewPGS_Overlay) + + var popupFieldHeight = (self.PopupNewPGS_PGS.frame.size.height / 3) + + if(popupFieldHeight > 100) + { + popupFieldHeight = 100 + } + + let popupFieldMargin = ((popupFieldHeight * 5) / 100) + popupFieldHeight = popupFieldHeight - (3 * popupFieldMargin) + + self.PopupNewPGS_ZipView.frame.size.height = popupFieldHeight + + self.PopupNewPGS_BirthdayView.frame.size.height = popupFieldHeight + self.PopupNewPGS_BirthdayView.frame.origin = CGPoint(x: self.PopupNewPGS_BirthdayView.frame.origin.x, y: self.PopupNewPGS_ZipView.frame.origin.y + self.PopupNewPGS_ZipView.frame.size.height + popupFieldMargin) + + self.PopupNewPGS_SampleidView.frame.size.height = popupFieldHeight + self.PopupNewPGS_SampleidView.frame.origin = CGPoint(x: self.PopupNewPGS_SampleidView.frame.origin.x, y: self.PopupNewPGS_BirthdayView.frame.origin.y + self.PopupNewPGS_BirthdayView.frame.size.height + popupFieldMargin) + + self.PopupNewPGS_txtZIP.delegate = self + self.PopupNewPGS_txtBirthday.delegate = self + self.PopupNewPGS_txtSampleid.delegate = self + self.PopupNewPGS_txtPassword.delegate = self + self.PopupNewPGS_txtPassword.enablePasswordToggle() + self.PopupNewPGS_txtPasswordConfirm.delegate = self + self.PopupNewPGS_txtPasswordConfirm.enablePasswordToggle() + self.PopupNewPGS_txtPin.delegate = self + + self.PopupNewPGS_txtZIP.returnKeyType = .next + self.PopupNewPGS_txtBirthday.returnKeyType = .next + self.PopupNewPGS_txtSampleid.returnKeyType = .done + self.PopupNewPGS_txtPassword.returnKeyType = .next + self.PopupNewPGS_txtPasswordConfirm.returnKeyType = .next + self.PopupNewPGS_txtPin.returnKeyType = .done + + self.PopupPrivatePolicy_Checkbox = CheckBoxButton(frame: CGRect(x: 10, y: 5, width: 30, height: 30)) + self.PopupNewPGS_PrivatePolicyArea.addSubview(self.PopupPrivatePolicy_Checkbox) + let gesture = UITapGestureRecognizer(target: self, action: #selector(didTapCheckbox)) + self.PopupPrivatePolicy_Checkbox.addGestureRecognizer(gesture) + self.PopupPrivatePolicy_Checkbox.setChecked(flag: true) + + self.addDoneToolbar([self.PopupNewPGS_txtZIP, self.PopupNewPGS_txtSampleid, self.PopupNewPGS_txtPassword, self.PopupNewPGS_txtPasswordConfirm, self.PopupNewPGS_txtPin]) + + self.hideKeyboardWhenTappedAround() + self.createDatePicker() + + //MARK: *** Table + self.DashedArea.addDashedBorder() + self.ResultsTableRefresher = UIRefreshControl() + let attributes = [NSAttributedString.Key.foregroundColor: UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 0.8), NSAttributedString.Key.font: UIFont.systemFont(ofSize: 15.0)] + self.ResultsTableRefresher.attributedTitle = NSAttributedString(string: Core.Lang.Get(key: "MSG_DATA_REFRESHING"), attributes: attributes) + self.ResultsTableRefresher.tintColor = .clear + self.ResultsTableRefresher.addTarget(self, action: #selector(tableRefresh), for: .valueChanged) + self.ResultsTable.addSubview(self.ResultsTableRefresher) + self.ResultsTable.isHidden = true + self.LBLNORESULTS.isHidden = false + self.ResultsTable.delegate = self + self.ResultsTable.dataSource = self + self.ResultsTable.contentInset = .init(top: 0, left: 0, bottom: 70, right: 0) + self.ResultsTable.register(ResultsTableViewCell.nib(), forCellReuseIdentifier: ResultsTableViewCell.identifier) + + let longPressRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(dashedAreaLongPressed)) + self.DashedArea.addGestureRecognizer(longPressRecognizer) + + //MARK: *** PopupPasswordConfirm + + self.PopupPasswordConfirm_Overlay.isHidden = true + self.PopupPasswordConfirm_HideLoading() + + self.PopupPasswordConfirm_Overlay.frame = self.view.frame + self.view.addSubview(self.PopupPasswordConfirm_Overlay) + self.PopupPasswordConfirm_txtPassword.delegate = self + self.PopupPasswordConfirm_txtPassword.enablePasswordToggle() + + self.MainLoadingHide() + + if(ViewController.Settings?.udid != nil) + { + self.PopupNewPGS_BtnAdd.setTitle(Core.Lang.Get(key: "BTN_ADD"), for: .normal) + self.loadResults() + } + else + { + self.PopupNewPGS_BtnAdd.setTitle(Core.Lang.Get(key: "BTN_NEXT"), for: .normal) + } + + self.PopupNwePGS_btnScanBarcode.setTitle("", for: .normal) + + self.PopupPrivatePolicy_Overlay.frame = self.view.frame + self.view.addSubview(self.PopupPrivatePolicy_Overlay) + self.PopupPrivatePolicy_Overlay.isHidden = true + + + //MARK: Bottom Menu + self.BottomMenu.transform = CGAffineTransform(rotationAngle: CGFloat(5.0 * .pi / 180)) + self.BottomMenu.frame.origin.y = UIScreen.main.bounds.height + + + self.PopupPush_Overlay.frame = self.view.frame + self.view.addSubview(self.PopupPush_Overlay) + self.PopupPush_Overlay.isHidden = true + + self.PopupNewPGS_labPwdHinweis.text = "" + self.PopupNewPGS_labPwdHinweis.isHidden = false + self.PopupNewPGS_txtPassword.addTarget(self, action: #selector(self.ShowPWDHinweis), for: .editingDidBegin) + self.PopupNewPGS_txtPassword.addTarget(self, action: #selector(self.HidePWDHinweis), for: .editingDidEnd) + self.PopupNewPGS_txtPasswordConfirm.addTarget(self, action: #selector(self.ShowPWDHinweis), for: .editingDidBegin) + self.PopupNewPGS_txtPasswordConfirm.addTarget(self, action: #selector(self.HidePWDHinweis), for: .editingDidEnd) + self.PopupNewPGS_txtPin.addTarget(self, action: #selector(self.ShowPinHinweis), for: .editingDidBegin) + self.PopupNewPGS_txtPin.addTarget(self, action: #selector(self.HidePWDHinweis), for: .editingDidEnd) + + } + + @objc func ShowPWDHinweis() + { + self.PopupNewPGS_Status.text = "" + + self.PopupNewPGS_labPwdHinweis.text = Core.Lang.Get(key: "ERROR_ENTER_STRONG_PASSWORD") + self.PopupNewPGS_labPwdHinweis.isHidden = false + } + + @objc func ShowPinHinweis() + { + self.PopupNewPGS_Status.text = "" + + self.PopupNewPGS_labPwdHinweis.text = Core.Lang.Get(key: "ERROR_PIN_LENGTH") + self.PopupNewPGS_labPwdHinweis.isHidden = false + } + + + @objc func HidePWDHinweis() + { + self.PopupNewPGS_labPwdHinweis.text = "" + self.PopupNewPGS_labPwdHinweis.isHidden = true + } + + private func SetLabels() + { + + // Initialize Language + self.LBL_MY_RESULTS.text = Core.Lang.Get(key: "LBL_MY_RESULTS") + self.LBL_HINWEIS.text = Core.Lang.Get(key: "LBL_BEFUND_HINWEIS") + self.PopupNewPGS_txtZIP.placeholder = Core.Lang.Get(key: "LBL_ZIP") + self.PopupNewPGS_txtBirthday.placeholder = Core.Lang.Get(key: "LBL_BIRTHDAY") + self.PopupNewPGS_txtSampleid.placeholder = Core.Lang.Get(key: "LBL_SAMPLEID") + self.PopupNewPGS_txtPassword.placeholder = Core.Lang.Get(key: "LBL_PASSWORD") + self.PopupNewPGS_txtPasswordConfirm.placeholder = Core.Lang.Get(key: "LBL_PASSWORD_CONFIRM") + self.PopupNewPGS_BtnCancel.setTitle(Core.Lang.Get(key: "BTN_CANCEL"), for: .normal) + self.PopupNewPGS_BtnAdd.setTitle(Core.Lang.Get(key: "BTN_ADD"), for: .normal) + self.PopupNewPGS_BtnPrivatePolicy.setTitle(Core.Lang.Get(key: "LBL_PRIVACY_POLICY"), for: .normal) + self.LBLNORESULTS.text = Core.Lang.Get(key: "LBL_NO_RESULTS") + + self.PopupPasswordConfirm_BtnCancel.setTitle(Core.Lang.Get(key: "BTN_CANCEL"), for: .normal) + self.PopupPasswordConfirm_BtnEncrypt.setTitle(Core.Lang.Get(key: "BTN_ENCRYPT"), for: .normal) + self.PopupPasswordConfirm_txtPassword.placeholder = Core.Lang.Get(key: "LBL_PASSWORD") + + self.PopupPrivatePolicy_TextLabel.text = Core.Lang.Get(key: "PRIVATE_POLICY_TEXT") + self.PopupPrivatePolicy_HeadLabel.text = Core.Lang.Get(key: "LBL_PRIVACY_POLICY") + self.PopupPrivatePolicy_BtnAccept.setTitle(Core.Lang.Get(key: "BTN_ACCEPT_PRIVACY_POLICY"), for: .normal) + + self.PopupPush_LabelHeader.text = Core.Lang.Get(key: "LBL_PUSH_NOTIFICATION_EXPLAIN_HEADER") + self.PopupPush_LabelText.text = Core.Lang.Get(key: "MSG_PUSH_NOTIFICATION_EXPLAIN_TEXT") + self.PopupPush_BtnYes.setTitle(Core.Lang.Get(key: "BTN_OK"), for: .normal) + } + + @objc func didTapCheckbox() + { + self.PopupPrivatePolicy_Checkbox.toogle() + } + + /** + * Creates the datepicker on the bottom popup menu + */ + func createDatePicker() + { + let formatter=DateFormatter() + formatter.dateFormat = "yyyy/MM/dd" + self.PopupNewPGS_dtBirthday.locale = Locale(identifier: Core.Lang.GetLocale()) + self.PopupNewPGS_dtBirthday.calendar.locale = Locale(identifier: Core.Lang.GetLocale()) + self.PopupNewPGS_dtBirthday.datePickerMode = .date + self.PopupNewPGS_dtBirthday.preferredDatePickerStyle = .wheels + self.PopupNewPGS_dtBirthday.date = formatter.date(from: "2000/01/01")! + self.PopupNewPGS_dtBirthday.maximumDate = Date() + self.PopupNewPGS_dtBirthday.minimumDate = formatter.date(from: "1900/01/01") + + let toolbar = UIToolbar() + let flexSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, + target: nil, action: nil) + let doneButton = UIBarButtonItem(title: Core.Lang.Get(key: "BTN_DONE"), style: .done, + target: self, action: #selector(PopupNewPGS_dtBirthdayDone)) + + toolbar.setItems([flexSpace, doneButton], animated: true) + toolbar.sizeToFit() + + self.PopupNewPGS_txtBirthday.inputAccessoryView = toolbar + self.PopupNewPGS_txtBirthday.inputView = self.PopupNewPGS_dtBirthday + } + + //MARK: BEGIN Application Event Bridgs + + public func onSessionChanged(session: Core.Models.Session) + { + //TODO: handle if push permission was taken away-> Show Instruction View that the user has to permitt permissions to push + } + + //MARK: END Application Event Bridgs + + //MARK: BEGIN Events + + @objc func PopupNewPGS_dtBirthdayDone() + { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd.MM.yyyy" + let dt = dateFormatter.string(from: self.PopupNewPGS_dtBirthday.date) + + self.PopupNewPGS_txtBirthday.text = dt + self.PopupNewPGS_txtSampleid.becomeFirstResponder() + } + + @IBAction func popupPush_BtnYes_Click(_ sender: Any) + { + self.PushNotificationAccepted(true) + } + + private func PushNotificationAccepted(_ flagAccepted: Bool) + { + if (ViewController.Settings == nil) + { + ViewController.Settings = Core.Models.Settings() + } + ViewController.Settings!.pushNotificationExplained = true + ViewController.Settings!.pushNotificationAccepted = flagAccepted + _ = ViewController.Settings!.save(atPath: Core.System.SettingsPath()) + + self.HidePopup(overlay: self.PopupPush_Overlay, content: self.PopupPush_Content) + + if(flagAccepted) + { + self.AskForPushPermissions() + } + + } + + + + private func OpenScanner2SelectLabor(_ sender: Any) + { + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let scannerController = storyboard.instantiateViewController(identifier: "ScannerController") + + scannerController.modalPresentationStyle = .fullScreen + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromRight + self.view.window!.layer.add(transition, forKey: kCATransition) + self.present(scannerController, animated: false) + } + + @IBAction func ScanBarcodeClick(_ sender: Any) + { + + let scannerController = ScannerViewController.InitScannerController(scanSampleID: true) + + scannerController.modalPresentationStyle = .fullScreen + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromRight + self.view.window!.layer.add(transition, forKey: kCATransition) + self.present(scannerController, animated: false) + } + + // MARK: ON AddButton Click + @IBAction func AddButtonClick(_ sender: Any) + { + self.PopupNewPGS_Status.text = "" + self.PopupNewPGS_txtSampleid.text = "" + self.PopupNewPGS_Loading.isHidden = true + self.PopupNewPGS_Loading.stopAnimating() + self.PopupNewPGS_BtnCancel.setTitle(Core.Lang.Get(key: "BTN_CANCEL"), for: .normal) + + if(ViewController.Settings?.udid != nil) + { + if(ViewController.Settings!.zip != nil) + { + self.PopupNewPGS_txtZIP.text = ViewController.Settings!.zip + } + + if(ViewController.Settings!.birthday != nil) + { + self.PopupNewPGS_dtBirthday.date = ViewController.Settings!.GetBirthday()! + self.PopupNewPGS_txtBirthday.text = ViewController.Settings!.GetFormatedBirthday()! + } + + self.PopupNewPGS_BtnAdd.setTitle(Core.Lang.Get(key: "BTN_ADD"), for: .normal) + self.PopupNewPGS_PGS.frame.origin = CGPoint(x: 0, y: self.PopupNewPGS_PGS.frame.origin.y) + self.PopupNewPGS_MasterPassword.frame.origin = CGPoint( + x: self.PopupNewPGS_MasterPassword.frame.width, + y: self.PopupNewPGS_MasterPassword.frame.origin.y) + self.PopupNewPGS_MasterPassword.isHidden = true + } + else + { + self.PopupNewPGS_BtnAdd.setTitle(Core.Lang.Get(key: "BTN_NEXT"), for: .normal) + } + + self.PopupNewPGS.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + self.PopupNewPGS_Overlay.alpha = 0.0 + self.PopupNewPGS_Overlay.isHidden = false + + UIView.animate(withDuration: 0.24) { + self.PopupNewPGS.transform = CGAffineTransform.identity + self.PopupNewPGS_Overlay.alpha = 70.0 + } + } + + private func ShowPopup(overlay: UIView!, content: UIView!) + { + content.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + overlay.alpha = 0.0 + overlay.isHidden = false + + UIView.animate(withDuration: 0.24) { + content.transform = CGAffineTransform.identity + overlay.alpha = 70.0 + } + } + + private func HidePopup(overlay: UIView!, content: UIView!) + { + UIView.animate(withDuration: 0.24, animations: { + overlay.alpha = 0.0 + content.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + }) {_ in + overlay.isHidden = true + } + + } + + private func Ask4PolicyAGBFirstTime() + { + if(!(ViewController.Settings?.policyAGBExplained ?? false)) + { + self.ShowPrivatePolicyInWeb() + } + + } + + private func AskForPushPermissions() + { + let center = UNUserNotificationCenter.current() + center.delegate = self + + center.requestAuthorization(options: [ .sound,.alert,.badge ]) + { + (granted, error) in + + if error == nil + { + if (granted) + { + AppDelegate.Session.NotificationGranted = true + DispatchQueue.main.async { + UIApplication.shared.registerForRemoteNotifications() + } + } + else + { + AppDelegate.Session.NotificationGranted = false + Core.Log.Warning(msg: "User did not grant the permission to the notifications", namespace: "AppDelegate", method: "Initialize") + } + + DispatchQueue.main.async + { + self.Ask4PolicyAGBFirstTime() + } + + } + else + { + AppDelegate.Session.NotificationGranted = false + Core.Log.Error(err: error!, namespace: "AppDelegate", method: "Initialize") + } + + } + + } + + // MARK: BEGIN PUSH-Notification delegates + func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (_ options: UNNotificationPresentationOptions) -> Void) + { + if(ViewController.CurrentViewController != nil) + { + ViewController.CurrentViewController!.loadResults() + } + } + + func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) + { + UIApplication.shared.applicationIconBadgeNumber = 1 + } + + // MARK: END PUSH-Notification delegates + + //MARK: BEGIN TextField delegates + func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool + { + let currentString: NSString = textField.text! as NSString + let newString: NSString = currentString.replacingCharacters(in: range, with: string) as NSString + + if(textField == self.PopupNewPGS_txtSampleid) + { + let filteredString = string.rangeOfCharacter(from: NSCharacterSet.alphanumerics) + return newString.length <= 14 && (filteredString != nil || string.count == 0) + } + + if(textField == self.PopupNewPGS_txtZIP || textField == self.PopupNewPGS_txtPin) + { + let filteredString = string.rangeOfCharacter(from: NSCharacterSet.decimalDigits) + return newString.length <= 5 && (filteredString != nil || string.count == 0) + } + + return true + } + + func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool + { + self.PopupNewPGS_Status.text = "" + + if(textField == self.PopupNewPGS_txtSampleid) + { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd.MM.yyyy" + let dt = dateFormatter.string(from: self.PopupNewPGS_dtBirthday.date) + self.PopupNewPGS_txtBirthday.text = dt + } + + return true + } + + func textFieldShouldReturn(_ textField: UITextField) -> Bool + { + if(textField == self.PopupNewPGS_txtZIP) + { + self.PopupNewPGS_txtBirthday.becomeFirstResponder() + } + else if(textField == self.PopupNewPGS_txtBirthday) + { + self.PopupNewPGS_txtSampleid.becomeFirstResponder() + } + else if(textField == self.PopupNewPGS_txtSampleid) + { + if(ViewController.Settings?.verificator_hash == nil) + { + self.showPasswordArea() + self.PopupNewPGS_txtPassword.becomeFirstResponder() + } + else + { + self.view.endEditing(true) + self.requestPGS() + } + } + else if(textField == self.PopupNewPGS_txtPassword) + { + self.PopupNewPGS_txtPasswordConfirm.becomeFirstResponder() + } + else if(textField == self.PopupNewPGS_txtPasswordConfirm) + { + self.PopupNewPGS_txtPin.becomeFirstResponder() + } + else if(textField == self.PopupNewPGS_txtPin) + { + self.view.endEditing(true) + self.requestPGS() + } + + return true + } + + //MARK: END TextField delegates + + @IBAction func PopupNewPGS_BtnCancelClick(_ sender: Any) + { + self.view.endEditing(true) + + if(!self.PopupNewPGS_Loading.isAnimating) + { + if(self.PopupNewPGS_MasterPassword.isHidden) + { + self.PopupNewPGSHide() + } + else + { + self.hidePasswordArea() + } + } + } + + private func PopupNewPGSHide() + { + UIView.animate(withDuration: 0.24, animations: { + self.PopupNewPGS_Overlay.alpha = 0.0 + self.PopupNewPGS.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + }) {_ in + self.PopupNewPGS_Overlay.isHidden = true + } + } + + @IBAction func PopupMenuArea_BtnSettingsClick(_ sender: Any) + { + self.view.endEditing(true) + //self.PopupMenuAreaHide() + + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let settingsController = storyboard.instantiateViewController(identifier: "SettingsController") + settingsController.modalPresentationStyle = .fullScreen + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromRight + self.view.window!.layer.add(transition, forKey: kCATransition) + self.present(settingsController, animated: false) + } + + + @IBAction func PopupNewPGS_BtnAddClick(_ sender: Any) + { + if(ViewController.Settings?.udid != nil) + { + self.requestPGS() + } + else + { + if(self.validatePGSData()) + { + self.showPasswordArea() + } + } + } + + @objc func dashedAreaLongPressed(sender: UILongPressGestureRecognizer) + { + if(ViewController.Settings?.udid != nil) + { + self.loadResults() + } + } + + //MARK: END Events + + //MARK: BEGIN Functions + + private func showPasswordArea() + { + if(self.PopupNewPGS_MasterPassword.isHidden) + { + self.PopupNewPGS_MasterPassword.frame.origin = CGPoint(x: self.PopupNewPGS_MasterPassword.frame.width, y: self.PopupNewPGS_MasterPassword.frame.origin.y) + self.PopupNewPGS_MasterPassword.isHidden = false + + UIView.animate(withDuration: 0.24, animations: { + self.PopupNewPGS_PGS.frame.origin = CGPoint(x: -self.PopupNewPGS_PGS.frame.width, y: self.PopupNewPGS_PGS.frame.origin.y) + self.PopupNewPGS_MasterPassword.frame.origin = CGPoint(x: 0, y: self.PopupNewPGS_MasterPassword.frame.origin.y) + }) {_ in + + self.PopupNewPGS_BtnCancel.setTitle(Core.Lang.Get(key: "BTN_BACK"), for: .normal) + self.PopupNewPGS_BtnAdd.setTitle(Core.Lang.Get(key: "BTN_REGISTER"), for: .normal) + } + } + else + { + self.requestPGS() + } + } + + @IBAction func PopupPrivatePolicy_BtnAcceptClick(_ sender: Any) + { + self.HidePrivatePolicy() + } + + @IBAction func PopupPrivatePolicy_BtnAddClick(_ sender: Any) + { + self.ShowPrivatePolicyInWeb() + } + + + private func getLocalPolicyLink() -> String + { + let baseURL = Bundle.main.path(forResource: "privacy_policy", ofType: "html") + return baseURL ?? "" + } + + private func ShowPrivatePolicyInWeb() + { + guard let url = URL(string: Core.Lang.Get(key: "AGB_POLICY_LINK")) else { + return + } + let localUrl = URL(string: getLocalPolicyLink()) ?? url + + let vc = WebViewController(url: url, title: Core.Lang.Get(key: "BTN_ACCEPT_PRIVACY_POLICY"), localUrl: localUrl) + vc.parentView = self + let navVC = UINavigationController(rootViewController: vc) + present(navVC, animated: true) + } + + + private func ShowPrivatePolicy() + { + self.PopupPrivatePolicy_Overlay.alpha = 100 + self.PopupPrivatePolicy_Overlay.isHidden = false + + UIView.animate(withDuration: 0.24, animations: { + self.PopupNewPGS_Overlay.frame.origin = CGPoint(x: -self.PopupNewPGS_Overlay.frame.width, y: self.PopupNewPGS_Overlay.frame.origin.y) + self.PopupPrivatePolicy.frame.origin = CGPoint(x: 0, y: self.PopupPrivatePolicy.frame.origin.y) + }) + } + + private func HidePrivatePolicy() + { + self.PopupPrivatePolicy_Checkbox.setChecked(flag: true) + + UIView.animate(withDuration: 0.24, animations: { + self.PopupNewPGS_Overlay.frame.origin = CGPoint(x: 0, y: self.PopupNewPGS_Overlay.frame.origin.y) + self.PopupPrivatePolicy.frame.origin = CGPoint(x: self.PopupPrivatePolicy.frame.width, y: self.PopupPrivatePolicy.frame.origin.y) + + }) {_ in + self.PopupPrivatePolicy_Overlay.isHidden = true + self.PopupNewPGS_Overlay.isHidden = false + } + } + + + private func hidePasswordArea() + { + UIView.animate(withDuration: 0.24, animations: { + self.PopupNewPGS_PGS.frame.origin = CGPoint(x: 0, y: self.PopupNewPGS_PGS.frame.origin.y) + self.PopupNewPGS_MasterPassword.frame.origin = CGPoint(x: self.PopupNewPGS_MasterPassword.frame.width, y: self.PopupNewPGS_MasterPassword.frame.origin.y) + }) {_ in + self.PopupNewPGS_MasterPassword.isHidden = true + self.PopupNewPGS_BtnCancel.setTitle(Core.Lang.Get(key: "BTN_CANCEL"), for: .normal) + self.PopupNewPGS_BtnAdd.setTitle(Core.Lang.Get(key: "BTN_NEXT"), for: .normal) + } + } + + /** + * Load results from the database and from the outside service + * @param onlyLocale - if true it will load only from locale db + */ + public func loadResults(onlyLocale: Bool = false) + { + //if password is not defined than don't make any results loading + if (AppDelegate.Session.DevicePassword == nil) + { + return + } + + if(!self.LoadingData) + { + self.LoadingData = true + + self.dbResults = Core.Database.Results.GetResults() + + let resultsAvailable = self.dbResults != nil && self.dbResults!.count > 0 + + self.LBLNORESULTS.isHidden = resultsAvailable + self.ResultsTable.isHidden = !resultsAvailable + + self.ResultsTable.reloadData() + + UIApplication.shared.applicationIconBadgeNumber = 0 + + if(!onlyLocale) + { + self.MainLoadingShow() + + //MARK: Load from serverhttps://stackoverflow.com/questions/24190277/writing-handler-for-uialertaction + let getOpened = Core.Models.Request.GetOpened() + getOpened.udid = AppDelegate.Session.Device!.udid + getOpened.verificator_hash = ViewController.Settings!.verificator_hash + + let requestKeyPair = Core.Security.Curve25519.GenerateKeyPair() + let currentHost = (ViewController.Settings!.labor?.host ?? .DEVELOPMENT) + + Core.Https.Request.KeyExchangeAsync(host: currentHost, keyPair: requestKeyPair, + onSuccess: { + publicKey in + + let sharedKey = requestKeyPair.GetSharedKey(peerPublicKeyBase64: publicKey.key) + let encryptedRequest = Core.Models.Request.EncryptedRequest(descriptor: "GetOpened", contentObject: getOpened, requestType: .REQUEST_GET_OPENED, key: sharedKey!) + + Core.Https.Request.EncryptedRequestAsync(host: currentHost, controller: "results", action: "opened", request: encryptedRequest, serverPublicKey: publicKey, keyPair: requestKeyPair, onSuccess: { + + encryptedResponse in + + let status = encryptedResponse.Decrypt(key: sharedKey!) as? Array + + self.dbResults = Core.Database.Results.GetResults(activeOnly: false) + + if(status != nil && status!.count > 0) + { + //MARK: Check if new requests or update + for i in 0...(status!.count-1) + { + let s = status![i] + let statusText = s.results_status?.lowercased() ?? "" + let results = s.ToResults() + + if(statusText.count > 0 && statusText != "none") + { + if(statusText == "not_found") + { + _ = Core.Database.Results.Delete(results: results) + + DispatchQueue.main.async + { + self.ShowMessagePopup(title: "", message: Core.Lang.Get(key: "MSG_REQUESTED_RESULTS_NOT_FOUND")) + } + + } + else if (statusText == "rejected") + { + DispatchQueue.main.async + { + self.ShowMessagePopup(title: "", message: Core.Lang.Get(key: "MSG_REQUESTED_RESULTS_REJECTED")) + } + + } + else + { + if(!self.dbResults!.contains(where: { $0.pgs == s.pgs })) + { + if(!Core.Database.Results.Create(results: results)) + { + Core.Log.Error(msg: "could not create results in db", namespace: "ViewController", method: "loadResults") + } + } + else + { + if(!Core.Database.Results.Update(results: results)) + { + Core.Log.Error(msg: "could not update results in db", namespace: "ViewController", method: "loadResults") + } + } + + self.dbResults = Core.Database.Results.GetResults() + + DispatchQueue.main.async + { + let resultsAvailable = self.dbResults != nil && self.dbResults!.count > 0 + + self.LBLNORESULTS.isHidden = resultsAvailable + self.ResultsTable.isHidden = !resultsAvailable + + self.ResultsTable.reloadData() + } + + } + } + + } + + } + + DispatchQueue.main.async + { + self.MainLoadingHide() + } + + self.LoadingData = false + }, + onError: { + error in + Core.Log.Error(msg: error, namespace: "ViewController", method: "loadResults") + self.LoadingData = false + + DispatchQueue.main.async + { + self.MainLoadingHide() + } + }) + }, + onError: { + error in + self.LoadingData = false + + Core.Log.Error(msg: error, namespace: "ViewController", method: "loadResults") + + DispatchQueue.main.async + { + if(AppDelegate.Session.Maintenance && !AppDelegate.Session.MaintenanceNotified) + { + AppDelegate.Session.MaintenanceNotified = true + self.ShowMessagePopup(title: "Fehler", message: Core.Lang.Get(key: "MSG_MAINTENANCE")) + } + self.MainLoadingHide() + } + }) + } + else + { + self.LoadingData = false + } + } + } + + private func validatePGSData() -> Bool + { + if(!self.PopupNewPGS_Loading.isAnimating) + { + self.PopupNewPGS_ShowLoading() + + let zipText = self.PopupNewPGS_txtZIP.text ?? "" + let birthdayText = self.PopupNewPGS_txtBirthday.text ?? "" + let sampleidText = self.PopupNewPGS_txtSampleid.text ?? "" + + if(zipText.count==0) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_ZIP")) + //self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ALREADY_SUBSCRIBTED")) + } + else if(birthdayText.count == 0) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_BIRTHDAY")) + } + else if(sampleidText.count == 0) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_SAMPLEID")) + } + else if(zipText.count < 4) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_VALID_ZIP")) + } + else if(birthdayText.count < 10 ) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_VALID_BIRTHDAY")) + } + else if(sampleidText.count < 6 || sampleidText.count > 14) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_VALID_SAMPLEID")) + } + else + { + self.PopupNewPGS_HideLoading() + return true + } + } + + return false + } + + private func validateRegistrationData() -> Bool + { + if(!self.PopupNewPGS_Loading.isAnimating) + { + self.PopupNewPGS_ShowLoading() + + let pinText = self.PopupNewPGS_txtPin.text ?? "" + let passwordText = self.PopupNewPGS_txtPassword.text ?? "" + + if(passwordText.count == 0) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_PASSWORD")) + } + else + { + if(!Core.Models.Request.ChangeVerificatorHashProvider.IsPasswordStrong(password: passwordText)) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_STRONG_PASSWORD")) + } + else if(self.PopupNewPGS_txtPassword.text != self.PopupNewPGS_txtPasswordConfirm.text) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_PASSWORD_MISMATCH")) + } + else if(pinText.count == 0) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_PIN")) + } + else if(pinText.count != 5) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_PIN_LENGTH")) + } + else if(!self.PopupPrivatePolicy_Checkbox.IsChecked()) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ACCEPT_PRIVACY_POLICY")) + } + else + { + self.PopupNewPGS_HideLoading() + return true + } + } + } + + return false + } + + /** + * Send PGS Request to the server + */ + private func requestPGS() + { + self.PopupNewPGS_Status.text = "" + + let zipText = self.PopupNewPGS_txtZIP.text ?? "" + let birthdayText = self.PopupNewPGS_txtBirthday.text ?? "" + let sampleidText = self.PopupNewPGS_txtSampleid.text ?? "" + let pinText = self.PopupNewPGS_txtPin.text ?? "" + let passwordText = self.PopupNewPGS_txtPassword.text ?? "" + + if(self.validatePGSData()) + { + //First installation + if(ViewController.Settings?.udid == nil) + { + if(self.validateRegistrationData()) + { + self.PopupNewPGS_ShowLoading() + + let encryptionKeyPair = Core.Security.Curve25519.GenerateKeyPair() + + if(encryptionKeyPair.PrivateKey != nil && encryptionKeyPair.PublicKey != nil) + { + if (ViewController.Settings == nil) { + ViewController.Settings = Core.Models.Settings() + } + + AppDelegate.Session.DevicePassword = passwordText + let pwdKey = Core.Security.AES.GetKey(password: passwordText) + let pwdKeyString = String(decoding: pwdKey, as: UTF8.self) + ViewController.Settings!.public_key = encryptionKeyPair.PublicKey! + let pwd_reset_hash = NSUUID().uuidString + ViewController.Settings!.password_reset_hash = pwd_reset_hash + let passwordHashKey = Core.Security.AES.GetKey(password: pwd_reset_hash + pinText) + let pwdHash = Core.Security.AES.Encrypt(value: passwordText, password: String(decoding: passwordHashKey, as: UTF8.self)) + ViewController.Settings!.password_hash = pwdHash + ViewController.Settings!.verificator_hash = Core.Security.SHA512.HMAC(message: Core.Security.SHA512.VerificatorHashingValue.data(using: .utf8)!, key: pwdKeyString) + + ViewController.Settings!.hashed_private_key = Core.Security.AES.Encrypt(value: encryptionKeyPair.PrivateKey!, password: pwdKeyString) + + ViewController.Settings!.zip = zipText + ViewController.Settings!.SetBirthday(date: PopupNewPGS_dtBirthday.date) + ViewController.Settings!.udid = AppDelegate.Session.Device!.udid + + if(!ViewController.Settings!.save(atPath: Core.System.SettingsPath())) + { + PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_SAVE")) + Core.Log.Critical(msg: "Could not save settings to the file", namespace: "ViewController", method: "requestPGS") + } + else + { + ViewController.Settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + } + } + else + { + PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ENCRYPTION_NOT_SUPPORTED")) + Core.Log.Critical(msg: "Could not create Curve25519 keyPair", namespace: "ViewController", method: "requestPGS") + } + } + } + else + { + ViewController.Settings!.zip = zipText + ViewController.Settings!.SetBirthday(date: PopupNewPGS_dtBirthday.date) + + if(!ViewController.Settings!.save(atPath: Core.System.SettingsPath())) + { + PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_SAVE")) + Core.Log.Critical(msg: "Could not save settings to the file", namespace: "ViewController", method: "requestPGS") + } + } + + // User has password already defined + if(ViewController.Settings?.udid != nil) + { + self.PopupNewPGS_ShowLoading() + + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd" + let birthday = dateFormatter.string(from: self.PopupNewPGS_dtBirthday.date) + + let subscribe = Core.Models.Request.Subscribe() + subscribe.udid = AppDelegate.Session.Device!.udid + subscribe.device_token = AppDelegate.Session.Device!.token + subscribe.pgs = Core.Security.SHA512.Encrypt(data: (zipText + birthday + sampleidText).data(using: .utf8)!) + let pwd = Core.Security.AES.GetKey(password: subscribe.udid! + Core.Security.AES.PGS_ENCRYPT_PARTIAL_KEY) + subscribe.pgs_hash = Core.Security.AES.Encrypt(value: (zipText + "|" + birthday + "|" + sampleidText), password: String(decoding:pwd, as: UTF8.self))! + subscribe.client_public_key = ViewController.Settings!.public_key + subscribe.device_type = 1 + subscribe.verificator_hash = ViewController.Settings!.verificator_hash + subscribe.pin = pinText + + if(subscribe.pin?.isEmpty ?? true) + { + subscribe.pin = String(Int.random(in: 10000..<99999)) + } + + let dbResults = Core.Database.Results.GetResults(pgs: subscribe.pgs!) + + if(dbResults != nil) + { + let status = dbResults?.GetStatus() + + if(status == .COMPLETED) + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "MSG_PGS_ALREADY_EXISTS")) + } + else + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "MSG_PGS_RESPONSE_PENDING")) + } + } + else + { + self.hideKeyboard() + + let requestKeyPair = Core.Security.Curve25519.GenerateKeyPair() + let currentHost = (ViewController.Settings!.labor?.host ?? .DEVELOPMENT) + + Core.Https.Request.KeyExchangeAsync(host: currentHost, keyPair: requestKeyPair, + onSuccess: { + publicKey in + + let sharedKey = requestKeyPair.GetSharedKey(peerPublicKeyBase64: publicKey.key) + let encryptedRequest = Core.Models.Request.EncryptedRequest(descriptor: "Subscribe", contentObject: subscribe, requestType: .REQUEST_SUBSCRIBE, key: sharedKey!) + + Core.Https.Request.EncryptedRequestAsync(host: currentHost, controller: "results", action: "subscribe", request: encryptedRequest, serverPublicKey: publicKey, keyPair: requestKeyPair, onSuccess: { + + encryptedResponse in + + let response = encryptedResponse.Decrypt(key: sharedKey!) + + DispatchQueue.main.async + { + if(encryptedResponse.descriptor!.lowercased() == "success") + { + if(Core.Database.Results.Create(results: subscribe.ToResults())) + { + self.PopupNewPGS_HideLoading() + self.ShowMessagePopup(title: "Vielen Dank", message: Core.Lang.Get(key: "MSG_PGS_SUCCESSFULLY_CREATED")) + self.loadResults() + + DispatchQueue.main.asyncAfter(deadline: .now() + 1) + { + self.PopupNewPGSHide() + } + } + else + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_SAVE")) + Core.Log.Critical(msg: "Could not save results to the database", namespace: "ViewController", method: "requestPGS") + } + } + else if(encryptedResponse.descriptor!.lowercased() == "status") + { + let status = (response as? Core.Models.Database.Status) + + if(status == nil || !Core.Database.Results.CreateOrUpdate(results: status!.ToResults())) + { + Core.Log.Critical(msg: "Could not update status in the database", namespace: "ViewController", method: "requestPGS") + } + + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "MSG_PGS_ALREADY_AVAILABLE")) + self.loadResults() + + DispatchQueue.main.asyncAfter(deadline: .now() + 1) + { + self.PopupNewPGSHide() + } + } + else + { + let responseException = (response as? Core.Models.Response.Exception) + + if(responseException != nil) + { + switch(responseException!.error_type) + { + case Core.Models.Response.Exception.Types.MaxOpenedRequestLimit : + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_MAX_OPENED_REQUEST_LIMIT")) + + case Core.Models.Response.Exception.Types.AlreadySubscribted: + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_ALREADY_SUBSCRIBTED")) + + default: + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_REGISTER_PGS")) + } + } + else + { + self.PopupNewPGS_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_REGISTER_PGS")) + Core.Log.Critical(msg: "Could not register", namespace: "ViewController", method: "requestPGS") + } + } + } + }, + onError: { + error in + + DispatchQueue.main.async + { + self.PopupNewPGS_HideLoading(message: error) + Core.Log.Critical(msg: "Server not reachable", namespace: "ViewController", method: "requestPGS") + } + }) + }, + onError: { + error in + DispatchQueue.main.async + { + self.PopupNewPGS_HideLoading(message: error) + Core.Log.Critical(msg: "Server not reachable", namespace: "ViewController", method: "requestPGS") + } + }); + } + } + } + } + + private func PopupNewPGS_ShowLoading() + { + self.PopupNewPGS_Loading.isHidden = false + self.PopupNewPGS_Loading.startAnimating() + self.PopupNewPGS_Status.text = "" + self.PopupNewPGS_Status.isHidden = true + } + + private func PopupNewPGS_HideLoading(message: String? = nil) + { + self.PopupNewPGS_Loading.isHidden = true + self.PopupNewPGS_Loading.stopAnimating() + + if(message != nil) + { + self.PopupNewPGS_Status.text = message! + self.PopupNewPGS_Status.isHidden = false + } + } + + private func PopupPasswordConfirm_ShowLoading() + { + self.PopupPasswordConfirm_Loading.isHidden = false + self.PopupPasswordConfirm_Loading.startAnimating() + self.PopupPasswordConfirm_Status.text = "" + self.PopupPasswordConfirm_Status.isHidden = true + } + + private func PopupPasswordConfirm_HideLoading(message: String? = nil) + { + self.PopupPasswordConfirm_Loading.isHidden = true + self.PopupPasswordConfirm_Loading.stopAnimating() + + if(message != nil) + { + self.PopupPasswordConfirm_Status.text = message! + self.PopupPasswordConfirm_Status.isHidden = false + } + } + + + private func MainLoadingHide() + { + self.MainLoading.stopAnimating() + self.MainLoading.isHidden = true + self.ResultsTableRefresher.endRefreshing() + } + + private func MainLoadingShow() + { + self.MainLoading.startAnimating() + self.MainLoading.isHidden = false + } + + //MARK: END Functions + + //MARK: BEGIN TABLE FUNCTIONS + @objc func tableRefresh(_ sender: Any) + { + self.loadResults() + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat + { + return 70.0 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell + { + let cell = tableView.dequeueReusableCell(withIdentifier: ResultsTableViewCell.identifier, for: indexPath) as! ResultsTableViewCell + + if(self.dbResults != nil && self.dbResults!.count > 0 && indexPath.row >= 0 && indexPath.row < self.dbResults!.count) + { + let result = self.dbResults![indexPath.row] + cell.title.text = result.GetFormatedCreatedDate() + cell.subtitle.text = result.GetStatusText() + cell.identifier.text = result.pgs! + cell.icon.setImage(result.GetStatusIcon(), for: .normal) + cell.icon.tag = indexPath.row + + if(cell.icon.allTargets.count > 0) + { + cell.icon.removeTarget(nil, action: nil, for: .allEvents) + } + + cell.icon.addTarget(self, action: #selector(onTableRowIconClick), for: .touchUpInside) + + cell.separatorInset = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15) + cell.icon.isUserInteractionEnabled = true + + cell.selectionStyle = .default; + let bgView = UIView() + bgView.backgroundColor = .clear + cell.selectedBackgroundView = bgView + + // MARK: Very dirty to start auto download here but for now no chance to do other way + // because we need to change the icon of the row + if(result.GetStatus() == .COMPLETED && result.available && !result.picked_up && !self.CurrentDownloadProcessing && AppDelegate.Session.Device!.token != nil) + { + let gifLoading = UIImage.gifImageWithName("ic_downloading") + cell.icon.setImage(gifLoading, for: .normal) + cell.subtitle.text = Core.Lang.Get(key: "LBL_DOWNLOADING") + + // Download in background + DispatchQueue.global(qos: .background).async + { + self.downloadResults(results: result, button: cell.icon, show: false) + } + } + } + + return cell + } + + + func numberOfSections(in tableView: UITableView) -> Int + { + return 1 + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int + { + return (self.dbResults != nil ? self.dbResults!.count : 0) + } + + func tableView(_ tableView: UITableView, titleForDeleteConfirmationButtonForRowAt indexPath: IndexPath) -> String? + { + return Core.Lang.Get(key: "BTN_DELETE") + } + + func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) + { + if editingStyle == .delete + { + if(self.dbResults != nil && self.dbResults!.count > 0 && indexPath.row >= 0 && indexPath.row < self.dbResults!.count && !self.CurrentDownloadProcessing) + { + let result = self.dbResults![indexPath.row] + + if(Core.Database.Results.Delete(results: result)) + { + self.loadResults(onlyLocale: true) + self.deleteOnServer(results: result) + } + } + } + } + + //MARK: END TABLE FUNCTIONS + + //MARK: BEGIN Download & PDF FUNCTIONS + @objc func onTableRowIconClick(sender: UIButton) + { + let button = sender as UIButton + + if(self.dbResults != nil && self.dbResults!.count > 0 && button.tag >= 0 && button.tag < self.dbResults!.count && !self.CurrentDownloadProcessing) + { + let results = self.dbResults![button.tag] + + if(results.GetStatus() == .COMPLETED && results.available && !results.picked_up && !self.CurrentDownloadProcessing) + { + let gifLoading = UIImage.gifImageWithName("ic_downloading") + sender.setImage(gifLoading, for: .normal) + + self.downloadResults(results: results, button: button) + } + else if(results.GetStatus() == .COMPLETED && results.available && results.picked_up) + { + self.encryptPDF(results: results) + } + } + } + + //MARK: send the download request to the server + private func downloadResults(results: Core.Models.Database.Results, button: UIButton!, show: Bool = true) + { + self.CurrentDownloadProcessing = true + + let subscribe = Core.Models.Request.Subscribe() + subscribe.udid = AppDelegate.Session.Device!.udid + subscribe.device_token = AppDelegate.Session.Device!.token! + subscribe.pgs = results.pgs + subscribe.client_public_key = ViewController.Settings!.public_key + subscribe.verificator_hash = ViewController.Settings!.verificator_hash + + self.MainLoadingShow() + + let requestKeyPair = Core.Security.Curve25519.GenerateKeyPair() + + let currentHost = ViewController.Settings!.labor?.host ?? .DEVELOPMENT + + Core.Https.Request.KeyExchangeAsync(host: currentHost, keyPair: requestKeyPair, + onSuccess: { + publicKey in + + let sharedKey = requestKeyPair.GetSharedKey(peerPublicKeyBase64: publicKey.key) + let encryptedRequest = Core.Models.Request.EncryptedRequest(descriptor: "Subscribe", contentObject: subscribe, requestType: .REQUEST_SUBSCRIBE, key: sharedKey!) + + Core.Https.Request.EncryptedRequestAsync(host: currentHost, controller: "results", action: "download", request: encryptedRequest, serverPublicKey: publicKey, keyPair: requestKeyPair, onSuccess: { + + encryptedResponse in + + self.CurrentDownload = encryptedResponse.Decrypt(key: sharedKey!) as? Core.Models.Response.Download + + if(self.CurrentDownload != nil) + { + self.CurrentDownloadResults = results + + DispatchQueue.main.async + { + if(button != nil) + { + button.setImage(results.GetStatusIcon(), for: .normal) + } + + self.processEncryption(show: show) + self.MainLoadingHide() + } + } + else + { + DispatchQueue.main.async + { + self.MainLoadingHide() + } + } + + self.CurrentDownloadProcessing = false + }, + onError: { + error in + self.CurrentDownloadProcessing = false + + Core.Log.Error(msg: error, namespace: "ViewController", method: "downloadResults") + + DispatchQueue.main.async + { + self.MainLoadingHide() + } + }) + }, + onError: { + error in + Core.Log.Error(msg: error, namespace: "ViewController", method: "downloadResults") + + self.CurrentDownloadProcessing = false + + DispatchQueue.main.async + { + self.MainLoadingHide() + } + }) + } + + //MARK: User has to confirm always decryption of encrypted results by master password + private func encryptPDF(results: Core.Models.Database.Results) + { + if(results.GetStatus() == .COMPLETED && results.available && results.picked_up) + { + self.CurrentDownload = nil + self.CurrentDownloadResults = results + //showPasswordConfirm() + self.processEncryption() + + } + } + + //MARK: send pickedup checksum to the file + private func sendPickedUp(checksum: Core.Models.Request.CheckFileChecksum) + { + self.MainLoadingShow() + + let requestKeyPair = Core.Security.Curve25519.GenerateKeyPair() + let currentHost = ViewController.Settings!.labor?.host ?? .DEVELOPMENT + + Core.Https.Request.KeyExchangeAsync(host: currentHost, keyPair: requestKeyPair, + onSuccess: { + publicKey in + + let sharedKey = requestKeyPair.GetSharedKey(peerPublicKeyBase64: publicKey.key) + let encryptedRequest = Core.Models.Request.EncryptedRequest(descriptor: "CheckFileChecksum", contentObject: checksum, requestType: .REQUEST_CHECKSUM, key: sharedKey!) + + Core.Https.Request.EncryptedRequestAsync(host: currentHost, controller: "results", action: "pickedup", request: encryptedRequest, serverPublicKey: publicKey, keyPair: requestKeyPair, onError: { + error in + Core.Log.Error(msg: error, namespace: "ViewController", method: "sendPickedUp") + }) + + DispatchQueue.main.async + { + self.MainLoadingHide() + } + + }, onError: { + error in + Core.Log.Error(msg: error, namespace: "ViewController", method: "sendPickedUp") + }) + } + + //MARK: deletes results on the server + private func deleteOnServer(results: Core.Models.Database.Results) + { + self.MainLoadingShow() + + let requestKeyPair = Core.Security.Curve25519.GenerateKeyPair() + let currentHost = ViewController.Settings!.labor?.host ?? .DEVELOPMENT + + Core.Https.Request.KeyExchangeAsync(host: currentHost, keyPair: requestKeyPair, + onSuccess: { + publicKey in + + let subscribe = Core.Models.Request.Subscribe() + subscribe.udid = AppDelegate.Session.Device!.udid + subscribe.device_token = AppDelegate.Session.Device!.token! + subscribe.pgs = results.pgs + subscribe.client_public_key = ViewController.Settings!.public_key + subscribe.verificator_hash = ViewController.Settings!.verificator_hash + + let sharedKey = requestKeyPair.GetSharedKey(peerPublicKeyBase64: publicKey.key) + let encryptedRequest = Core.Models.Request.EncryptedRequest(descriptor: "Subscribe", contentObject: subscribe, requestType: .REQUEST_SUBSCRIBE, key: sharedKey!) + + Core.Https.Request.EncryptedRequestAsync(host: currentHost, controller: "results", action: "unsubscribe", request: encryptedRequest, serverPublicKey: publicKey, keyPair: requestKeyPair, onError: { + error in + Core.Log.Error(msg: error, namespace: "ViewController", method: "deleteOnServer") + }) + + DispatchQueue.main.async + { + self.MainLoadingHide() + } + }, + onError: { + error in + Core.Log.Error(msg: error, namespace: "ViewController", method: "deleteOnServer") + }) + } + + private func showPasswordConfirm() + { + self.PopupPasswordConfirm_txtPassword.text = "" + self.PopupPasswordConfirm_HideLoading(message: Core.Lang.Get(key: "ERROR_ENTER_PASSWORD")) + + self.PopupPasswordConfirm.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + self.PopupPasswordConfirm_Overlay.alpha = 0.0 + self.PopupPasswordConfirm_Overlay.isHidden = false + + UIView.animate(withDuration: 0.24) { + self.PopupPasswordConfirm.transform = CGAffineTransform.identity + self.PopupPasswordConfirm_Overlay.alpha = 70.0 + } + } + + private func hidePasswordConfirm() + { + self.view.endEditing(true) + + if(!self.PopupPasswordConfirm_Loading.isAnimating) + { + UIView.animate(withDuration: 0.24, animations: { + self.PopupPasswordConfirm_Overlay.alpha = 0.0 + self.PopupPasswordConfirm.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) + }) {_ in + self.PopupPasswordConfirm_Overlay.isHidden = true + } + } + } + + //MARK: download encrypted results from the server and let them user decrypt it over password confirmation popup + private func encryptDownload(show: Bool = true) + { + if(self.CurrentDownload != nil) + { + let decryptedPrivateKey = Core.Security.AES.Decrypt(value: ViewController.Settings!.hashed_private_key!, password: AppDelegate.Session.DevicePassword) + + if (decryptedPrivateKey != nil) + { + let keyPair = Core.Security.Curve25519.CreateKeyPair(_privateKey: decryptedPrivateKey!, _publicKey: ViewController.Settings!.public_key!) + + let sharedKey = keyPair.GetSharedKey(peerPublicKeyBase64: self.CurrentDownload!.server_public_key!) + + if(sharedKey != nil) + { + let decrypted_content = Core.Security.AES.Decrypt(value: self.CurrentDownload!.encrypted_content!, deriveKey: sharedKey!) + + if(decrypted_content != nil) + { + let local_encrypted = Core.Security.AES.Encrypt(value: decrypted_content!, password: AppDelegate.Session.DevicePassword) + + if(local_encrypted != nil) + { + let now = Date() + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + + self.CurrentDownloadResults!.picked_up = true + self.CurrentDownloadResults!.picked_up_ts = dateFormatter.string(from: now) + self.CurrentDownloadResults!.file_checksum = Core.Security.SHA512.Encrypt(value: decrypted_content!) + + if(Core.System.WriteToEncryptedStorage(filename: self.CurrentDownloadResults!.pgs!, data: local_encrypted!.data(using: .utf8)!) && + Core.Database.Results.Update(results: self.CurrentDownloadResults!)) + { + self.loadResults(onlyLocale: true) + + if(show) + { + self.loadPDF(decryptedContent: Data(base64Encoded: decrypted_content!)!) + } + + let checksum = Core.Models.Request.CheckFileChecksum() + checksum.pgs = self.CurrentDownloadResults!.pgs + checksum.udid = AppDelegate.Session.Device!.udid + checksum.device_token = AppDelegate.Session.Device!.token! + checksum.client_public_key = ViewController.Settings!.public_key + checksum.verificator_hash = ViewController.Settings!.verificator_hash + checksum.file_checksum = self.CurrentDownloadResults!.file_checksum + self.sendPickedUp(checksum: checksum) + self.CurrentDownload = nil + self.CurrentDownloadResults = nil + } + else + { + self.PopupPasswordConfirm_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_SAVE_ENCRYPTED")) + Core.Log.Critical(msg: "could not store encrypted downloaded results", namespace: "ViewController", method: "encryptDownload") + } + } + else + { + self.PopupPasswordConfirm_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_SAVE_ENCRYPTED")) + Core.Log.Critical(msg: "could not store encrypted downloaded results", namespace: "ViewController", method: "encryptDownload") + } + } + else + { + self.PopupPasswordConfirm_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_DECRYPT")) + Core.Log.Critical(msg: "could not decrypt downloaded results", namespace: "ViewController", method: "encryptDownload") + } + } + else + { + self.PopupPasswordConfirm_HideLoading(message: Core.Lang.Get(key: "ERROR_COULD_NOT_DECRYPT")) + Core.Log.Critical(msg: "could not decrypt downloaded results", namespace: "ViewController", method: "encryptDownload") + } + } + else + { + self.PopupPasswordConfirm_HideLoading(message: Core.Lang.Get(key: "ERROR_INVALID_PASSWORD")) + } + } + else + { + self.PopupPasswordConfirm_HideLoading(message: Core.Lang.Get(key: "ERROR_DOWNLOAD_NOT_FOUND")) + Core.Log.Critical(msg: "no download found for encryption", namespace: "ViewController", method: "encryptDownload") + } + } + + /** + * Loads encrypted file from the encrypted storage and decrypts it by master password of user + */ + private func encryptFile() + { + if(self.CurrentDownloadResults != nil) + { + let filePath = Core.System.GetURLForStorageEncryptedFile(filename: self.CurrentDownloadResults!.pgs!) + + if(filePath != nil && Core.System.FileExists(atPath: filePath!.path)) + { + let encrypted_data = Core.System.ReadFromEncryptedStorage(filename: self.CurrentDownloadResults!.pgs!) + + if(encrypted_data != nil) + { + let encrypted_content = String(data: encrypted_data!, encoding: .utf8)! + let local_decrypted = Core.Security.AES.Decrypt(value: encrypted_content, password: AppDelegate.Session.DevicePassword) + + if(local_decrypted != nil) + { + self.loadResults() + self.loadPDF(decryptedContent: Data(base64Encoded: local_decrypted!)!) + self.CurrentDownload = nil + self.CurrentDownloadResults = nil + } + else + { + self.PopupPasswordConfirm_HideLoading(message: Core.Lang.Get(key: "ERROR_INVALID_PASSWORD")) + } + } + else + { + self.PopupPasswordConfirm_HideLoading(message: Core.Lang.Get(key: "ERROR_ENCRYPTED_FILE_NOT_FOUND")) + Core.Log.Critical(msg: "encrypted file not found", namespace: "ViewController", method: "encryptFile") + } + } + else + { + self.PopupPasswordConfirm_HideLoading(message: Core.Lang.Get(key: "ERROR_ENCRYPTED_FILE_NOT_FOUND")) + Core.Log.Critical(msg: "encrypted file not found", namespace: "ViewController", method: "encryptFile") + } + } + else + { + self.PopupPasswordConfirm_HideLoading(message: Core.Lang.Get(key: "ERROR_ENCRYPTED_FILE_NOT_FOUND")) + Core.Log.Critical(msg: "encrypted file not found", namespace: "ViewController", method: "encryptFile") + } + } + + //MARK: Loads PDFViewer with decrypted content + private func loadPDF(decryptedContent: Data) + { + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let pdfViewController = storyboard.instantiateViewController(withIdentifier: "PDFViewController") as! PDFViewController + pdfViewController.setContent(data: decryptedContent) + + pdfViewController.modalPresentationStyle = .fullScreen + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromRight + self.view.window!.layer.add(transition, forKey: kCATransition) + + self.present(pdfViewController, animated: false) + } + + @IBAction func PopupPasswordConfirm_BtnCancelClick(_ sender: Any) + { + self.hidePasswordConfirm() + } + + @IBAction func PopupPasswordConfirm_BtnEncryptClick(_ sender: Any) + { + self.processEncryption() + } + + /** + * Encrypts ether already downloaded results from the device or downloads first the results from the server and encrypts thet after downloading + */ + + private func processEncryption(show: Bool = true) + { + if(self.CurrentDownload != nil) + { + self.encryptDownload(show: show) + } + else if(self.CurrentDownloadResults != nil) + { + self.encryptFile() + } + } + + //MARK: END Download & PDF FUNCTIONS + + //MARK: BEGIN Bottom Menu + + @IBAction func BottonMenuOpenerClick(_ sender: Any) + { + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let settingsPwdController = storyboard.instantiateViewController(identifier: "SettingsController") + + settingsPwdController.modalPresentationStyle = .fullScreen + let transition = CATransition() + transition.duration = 0.25 + transition.type = .push + transition.subtype = .fromRight + self.view.window!.layer.add(transition, forKey: kCATransition) + self.present(settingsPwdController, animated: false) + } + + //MARK: END Bottom Menu +} diff --git a/Befund/Controls/.DS_Store b/Befund/Controls/.DS_Store new file mode 100644 index 0000000..2462080 Binary files /dev/null and b/Befund/Controls/.DS_Store differ diff --git a/Befund/Controls/Buttons/CircleButton.swift b/Befund/Controls/Buttons/CircleButton.swift new file mode 100644 index 0000000..0e52ebe --- /dev/null +++ b/Befund/Controls/Buttons/CircleButton.swift @@ -0,0 +1,69 @@ +// +// AddButton.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 19.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation +import UIKit + +@IBDesignable class AddButton: UIButton +{ + override init(frame: CGRect) + { + super.init(frame: frame) + initialize() + } + + required init(coder aDecoder: NSCoder) + { + super.init(coder: aDecoder)! + } + + override func layoutSubviews() + { + super.layoutSubviews() + initialize() + } + + func initialize() + { + let screenBound = UIScreen.main.bounds; + + var width = CGFloat((screenBound.width * 30) / 180.0) + + if(width > 60.0) + { + width = CGFloat(60.0) + } + + frame.size.width = width + frame.size.height = width + + layer.cornerRadius = width / 2 + + frame.origin.y = (screenBound.height - 60) - (frame.height / 2.0) + frame.origin.x = (screenBound.width / 2.0) - (frame.width / 2.0) + layer.cornerRadius = bounds.size.height / 2.0 + clipsToBounds = true + let gradient = CAGradientLayer() + gradient.frame = bounds + gradient.colors = [UIColor.white.cgColor, UIColor(red: 226/255.0, green: 0.0, blue: 122.0/255.0, alpha: 1.0).cgColor] + gradient.startPoint = CGPoint(x: 1.0, y: 0.5) + gradient.endPoint = CGPoint(x: 1.0, y: 0.5) + let shape = CAShapeLayer() + shape.lineWidth = 5 + shape.path = UIBezierPath( + arcCenter: CGPoint(x: bounds.height/2, + y: bounds.height/2), + radius: bounds.height/2, + startAngle: CGFloat(0), + endAngle:CGFloat(CGFloat.pi * 2), + clockwise: true).cgPath + shape.strokeColor = UIColor.black.cgColor + shape.fillColor = UIColor.clear.cgColor + gradient.mask = shape + layer.addSublayer(gradient) + } +} diff --git a/Befund/Controls/DownPicker/.gitignore b/Befund/Controls/DownPicker/.gitignore new file mode 100644 index 0000000..1205c39 --- /dev/null +++ b/Befund/Controls/DownPicker/.gitignore @@ -0,0 +1,35 @@ +# OS X +.DS_Store + +# Xcode +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +profile +*.moved-aside +DerivedData +*.hmap +*.ipa + +# Bundler +.bundle + +_Pods.xcodeproj + +Carthage +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control +# +# Note: if you ignore the Pods directory, make sure to uncomment +# `pod install` in .travis.yml +# +# Pods/ diff --git a/Befund/Controls/DownPicker/.travis.yml b/Befund/Controls/DownPicker/.travis.yml new file mode 100644 index 0000000..d9ce898 --- /dev/null +++ b/Befund/Controls/DownPicker/.travis.yml @@ -0,0 +1,15 @@ +# references: +# * http://www.objc.io/issue-6/travis-ci.html +# * https://github.com/supermarin/xcpretty#usage + +language: objective-c +# cache: cocoapods +# podfile: Example/Podfile +# before_install: +# - gem install cocoapods # Since Travis is not always on latest version +# - pod install --project-directory=Example +install: +- gem install xcpretty --no-rdoc --no-ri --no-document --quiet +script: +- set -o pipefail && xcodebuild test -workspace Example/DownPicker.xcworkspace -scheme DownPicker-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c +- pod lib lint --quick diff --git a/Befund/Controls/DownPicker/Assets/.gitkeep b/Befund/Controls/DownPicker/Assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Befund/Controls/DownPicker/Assets/downArrow.png b/Befund/Controls/DownPicker/Assets/downArrow.png new file mode 100644 index 0000000..06c5038 Binary files /dev/null and b/Befund/Controls/DownPicker/Assets/downArrow.png differ diff --git a/Befund/Controls/DownPicker/Assets/downArrow@2x.png b/Befund/Controls/DownPicker/Assets/downArrow@2x.png new file mode 100644 index 0000000..47528f6 Binary files /dev/null and b/Befund/Controls/DownPicker/Assets/downArrow@2x.png differ diff --git a/Befund/Controls/DownPicker/Assets/downArrow@3x.png b/Befund/Controls/DownPicker/Assets/downArrow@3x.png new file mode 100644 index 0000000..e32e2ae Binary files /dev/null and b/Befund/Controls/DownPicker/Assets/downArrow@3x.png differ diff --git a/Befund/Controls/DownPicker/Classes/.gitkeep b/Befund/Controls/DownPicker/Classes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Befund/Controls/DownPicker/Classes/DownPicker.h b/Befund/Controls/DownPicker/Classes/DownPicker.h new file mode 100644 index 0000000..89f62c6 --- /dev/null +++ b/Befund/Controls/DownPicker/Classes/DownPicker.h @@ -0,0 +1,72 @@ +// +// DownPicker.h +// -------------------------------------------------------- +// Lightweight DropDownList/ComboBox control for iOS +// +// by Darkseal, 2013-2015 - MIT License +// +// Website: http://www.ryadel.com/ +// GitHub: http://www.ryadel.com/ +// + +#import + +@interface DownPicker : UIControl +{ + UIPickerView* pickerView; + IBOutlet UITextField* textField; + NSArray* dataArray; + NSString* placeholder; + NSString* placeholderWhileSelecting; + NSString* toolbarDoneButtonText; + NSString* toolbarCancelButtonText; + UIBarStyle toolbarStyle; +} + +@property (nonatomic) NSString* text; +@property (nonatomic) NSInteger selectedIndex; + +-(id)initWithTextField:(UITextField *)tf; +-(id)initWithTextField:(UITextField *)tf withData:(NSArray*) data; + +@property (nonatomic) BOOL shouldDisplayCancelButton; + +/** + Sets an alternative image to be show to the right part of the textbox (assuming that showArrowImage is set to TRUE). + @param image + A valid UIImage + */ +-(void) setArrowImage:(UIImage*)image; + +-(void) setData:(NSArray*) data; +-(void) setPlaceholder:(NSString*)str; +-(void) setPlaceholderWhileSelecting:(NSString*)str; +-(void) setAttributedPlaceholder:(NSAttributedString *)attributedString; +-(void) setToolbarDoneButtonText:(NSString*)str; +-(void) setToolbarCancelButtonText:(NSString*)str; +-(void) setToolbarStyle:(UIBarStyle)style; + +/** + TRUE to show the rightmost arrow image, FALSE to hide it. + @param b + TRUE to show the rightmost arrow image, FALSE to hide it. + */ +-(void) showArrowImage:(BOOL)b; + +-(UIPickerView*) getPickerView; +-(UITextField*) getTextField; + +/** + Retrieves the string value at the specified index. + @return + The value at the given index or NIL if nothing has been selected yet. + */ +-(NSString*) getValueAtIndex:(NSInteger)index; + +/** + Sets the zero-based index of the selected item: -1 can be used to clear selection. + @return + The value at the given index or NIL if nothing has been selected yet. + */ +-(void) setValueAtIndex:(NSInteger)index; +@end diff --git a/Befund/Controls/DownPicker/Classes/DownPicker.m b/Befund/Controls/DownPicker/Classes/DownPicker.m new file mode 100644 index 0000000..153411b --- /dev/null +++ b/Befund/Controls/DownPicker/Classes/DownPicker.m @@ -0,0 +1,327 @@ +// +// DownPicker.h +// -------------------------------------------------------- +// Lightweight DropDownList/ComboBox control for iOS +// +// by Darkseal, 2013-2015 - MIT License +// +// Website: http://www.ryadel.com/ +// GitHub: http://www.ryadel.com/ +// + + +#import "DownPicker.h" + + +@implementation DownPicker +{ + NSString* _previousSelectedString; +} + +-(id)initWithTextField:(UITextField *)tf +{ + return [self initWithTextField:tf withData:nil]; +} + +-(id)initWithTextField:(UITextField *)tf withData:(NSArray*) data +{ + self = [super init]; + if (self) { + self->textField = tf; + self->textField.delegate = self; + + // set UI defaults + self->toolbarStyle = UIBarStyleDefault; + + // set language defaults + self->placeholder = @"Bitte wählen";//@"...";//@"Tap to choose..."; + self->placeholderWhileSelecting = @"Bitte wählen";//@"Pick an option..."; + self->toolbarDoneButtonText = @"Fertig";//@"Done"; + self->toolbarCancelButtonText = @"Abbrechen";//@"Cancel"; + + // hide the caret and its blinking + [[textField valueForKey:@"textInputTraits"] + setValue:[UIColor clearColor] + forKey:@"insertionPointColor"]; + + // set the placeholder + self->textField.placeholder = self->placeholder; + + // setup the arrow image + UIImage* img = [UIImage imageNamed:@"downArrow.png"]; // non-CocoaPods + if (img == nil) img = [UIImage imageNamed:@"DownPicker.bundle/downArrow.png"]; // CocoaPods + if (img != nil) self->textField.rightView = [[UIImageView alloc] initWithImage:img]; + self->textField.rightView.contentMode = UIViewContentModeScaleAspectFit; + self->textField.rightView.clipsToBounds = YES; + + // show the arrow image by default + [self showArrowImage:YES]; + + // set the data array (if present) + if (data != nil) { + [self setData: data]; + } + + self.shouldDisplayCancelButton = YES; + } + return self; +} + + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return (interfaceOrientation == UIInterfaceOrientationPortrait); +} + +- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView; +{ + return 1; +} + +- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component +{ + self->textField.text = [dataArray objectAtIndex:row]; + [self sendActionsForControlEvents:UIControlEventValueChanged]; +} + +- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component; +{ + return [dataArray count]; +} + +- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component; +{ + return [dataArray objectAtIndex:row]; +} + +-(void)doneClicked:(id) sender +{ + //hides the pickerView + [textField resignFirstResponder]; + + if (self->textField.text.length == 0 || ![self->dataArray containsObject:self->textField.text]) { + // self->textField.text = [dataArray objectAtIndex:0]; + [self setValueAtIndex:-1]; + self->textField.placeholder = self->placeholder; + } + /* + else { + if (![self->textField.text isEqualToString:_previousSelectedString]) { + [self sendActionsForControlEvents:UIControlEventValueChanged]; + } + } + */ + [self sendActionsForControlEvents:UIControlEventValueChanged]; +} + +-(void)cancelClicked:(id)sender +{ + [textField resignFirstResponder]; //hides the pickerView + if (_previousSelectedString.length == 0 || ![self->dataArray containsObject:_previousSelectedString]) { + self->textField.placeholder = self->placeholder; + } + self->textField.text = _previousSelectedString; +} + + +- (IBAction)showPicker:(id)sender +{ + _previousSelectedString = self->textField.text; + + pickerView = [[UIPickerView alloc] init]; + pickerView.showsSelectionIndicator = YES; + pickerView.dataSource = self; + pickerView.delegate = self; + + //If the text field is empty show the place holder otherwise show the last selected option + if (self->textField.text.length == 0 || ![self->dataArray containsObject:self->textField.text]) + { + if (self->placeholderWhileSelecting) { + self->textField.placeholder = self->placeholderWhileSelecting; + } + // 0.1.31 patch: auto-select first item: it basically makes placeholderWhileSelecting useless, but + // it solves the "first item cannot be selected" bug due to how the pickerView works. + [self setSelectedIndex:0]; + } + else + { + if ([self->dataArray containsObject:self->textField.text]) { + [self->pickerView selectRow:[self->dataArray indexOfObject:self->textField.text] inComponent:0 animated:YES]; + } + } + + UIToolbar* toolbar = [[UIToolbar alloc] init]; + toolbar.barStyle = self->toolbarStyle; + [toolbar sizeToFit]; + + //space between buttons + UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace + target:nil + action:nil]; + + UIBarButtonItem* doneButton = [[UIBarButtonItem alloc] + initWithTitle:self->toolbarDoneButtonText + style:UIBarButtonItemStyleDone + target:self + action:@selector(doneClicked:)]; + + if (self.shouldDisplayCancelButton) { + UIBarButtonItem* cancelButton = [[UIBarButtonItem alloc] + initWithTitle:self->toolbarCancelButtonText + style:UIBarButtonItemStylePlain + target:self + action:@selector(cancelClicked:)]; + + [toolbar setItems:[NSArray arrayWithObjects:cancelButton, flexibleSpace, doneButton, nil]]; + } else { + [toolbar setItems:[NSArray arrayWithObjects:flexibleSpace, doneButton, nil]]; + } + + + //custom input view + textField.inputView = pickerView; + textField.inputAccessoryView = toolbar; +} + +- (BOOL)textFieldShouldBeginEditing:(UITextField *)aTextField +{ + if ([self->dataArray count] > 0) { + [self showPicker:aTextField]; + return YES; + } + return NO; +} + +- (void)textFieldDidBeginEditing:(UITextField *)textField +{ + [self sendActionsForControlEvents:UIControlEventEditingDidBegin]; +} + +- (void)textFieldDidEndEditing:(UITextField *)aTextField { + // [self doneClicked:aTextField]; + aTextField.userInteractionEnabled = YES; + [self sendActionsForControlEvents:UIControlEventEditingDidEnd]; +} + +- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string +{ + return NO; +} + +-(void) setData:(NSArray*) data +{ + dataArray = data; +} + +-(void) showArrowImage:(BOOL)b +{ + if (b == YES) { + // set the DownPicker arrow to the right (you can replace it with any 32x24 px transparent image: changing size might give different results) + self->textField.rightViewMode = UITextFieldViewModeAlways; + } + else { + self->textField.rightViewMode = UITextFieldViewModeNever; + } +} + +-(void) setArrowImage:(UIImage*)image +{ + [(UIImageView*)self->textField.rightView setImage:image]; +} + +-(void) setPlaceholder:(NSString*)str +{ + self->placeholder = str; + self->textField.placeholder = self->placeholder; +} + +-(void) setPlaceholderWhileSelecting:(NSString*)str +{ + self->placeholderWhileSelecting = str; +} + +-(void) setAttributedPlaceholder:(NSAttributedString *)attributedString +{ + self->textField.attributedPlaceholder = attributedString; +} + +-(void) setToolbarDoneButtonText:(NSString*)str +{ + self->toolbarDoneButtonText = str; +} + +-(void) setToolbarCancelButtonText:(NSString*)str +{ + self->toolbarCancelButtonText = str; +} + +-(void) setToolbarStyle:(UIBarStyle)style; +{ + self->toolbarStyle = style; +} + +-(UIPickerView*) getPickerView +{ + return self->pickerView; +} + +-(UITextField*) getTextField +{ + return self->textField; +} + +-(NSString*) getValueAtIndex:(NSInteger)index +{ + return (self->dataArray.count > index) ? [self->dataArray objectAtIndex:index] : nil; +} + +-(void) setValueAtIndex:(NSInteger)index +{ + if (index >= 0) [self pickerView:nil didSelectRow:index inComponent:0]; + else [self setText:nil]; +} + +/** + Getter for text property. + @return + The value of the selected item or NIL NIL if nothing has been selected yet. + */ +- (NSString*) text { + return self->textField.text; +} + +/** + Setter for text property. + @param txt + The value of the item to select or NIL to clear selection. + */ +- (void) setText:(NSString*)txt { + if (txt != nil) { + NSInteger index = [self->dataArray indexOfObject:txt]; + if (index != NSNotFound) [self setValueAtIndex:index]; + } + else { + self->textField.text = txt; + } +} + +/** + Getter for selectedIndex property. + @return + The zero-based index of the selected item or -1 if nothing has been selected yet. + */ +- (NSInteger)selectedIndex { + NSInteger index = [self->dataArray indexOfObject:self->textField.text]; + return (index != NSNotFound) ? (NSInteger)index : -1; +} + +/** + Setter for selectedIndex property. + @param index + Sets the zero-based index of the selected item using the setValueAtIndex method: -1 can be used to clear selection. + */ +- (void)setSelectedIndex:(NSInteger)index { + [self setValueAtIndex:(NSInteger)index]; +} + +@end diff --git a/Befund/Controls/DownPicker/Classes/UIDownPicker.h b/Befund/Controls/DownPicker/Classes/UIDownPicker.h new file mode 100644 index 0000000..14e4ed6 --- /dev/null +++ b/Befund/Controls/DownPicker/Classes/UIDownPicker.h @@ -0,0 +1,21 @@ +// +// DownPicker.h +// -------------------------------------------------------- +// Lightweight DropDownList/ComboBox control for iOS +// +// by Darkseal, 2013-2015 - MIT License +// +// Website: http://www.ryadel.com/ +// GitHub: http://www.ryadel.com/ +// + +#import +#import "DownPicker.h" + +@interface UIDownPicker : UITextField + +@property (strong, nonatomic) DownPicker *DownPicker; + +-(id)initWithData:(NSArray*)data; + +@end diff --git a/Befund/Controls/DownPicker/Classes/UIDownPicker.m b/Befund/Controls/DownPicker/Classes/UIDownPicker.m new file mode 100644 index 0000000..3b9cdd8 --- /dev/null +++ b/Befund/Controls/DownPicker/Classes/UIDownPicker.m @@ -0,0 +1,27 @@ +// +// UIDownPicker.m +// Know +// +// Created by DarkAngel on 29/03/15. +// Copyright (c) 2015 Ryadel. All rights reserved. +// + +#import "UIDownPicker.h" + +@implementation UIDownPicker + +-(id)init +{ + return [self initWithData:nil]; +} + +-(id)initWithData:(NSArray*)data +{ + self = [super init]; + if (self) { + self.DownPicker = [[DownPicker alloc] initWithTextField:self withData:data]; + } + return self; +} + +@end diff --git a/Befund/Controls/PasswordTextField.swift b/Befund/Controls/PasswordTextField.swift new file mode 100644 index 0000000..cdddd74 --- /dev/null +++ b/Befund/Controls/PasswordTextField.swift @@ -0,0 +1,43 @@ +// +// PasswordTextField.swift +// Befund +// +// Created by Artur Savitskiy on 06.09.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation + +extension UITextField +{ + fileprivate func setPasswordToggleImage(_ button: UIButton) { + if(isSecureTextEntry){ + button.setImage(UIImage(named: "ic_eye"), for: .normal) + }else{ + button.setImage(UIImage(named: "ic_no_eye"), for: .normal) + + } + } + + func enablePasswordToggle(){ + let button = UIButton(type: .custom) + setPasswordToggleImage(button) + button.imageEdgeInsets = UIEdgeInsets(top: 0, left: -16, bottom: 0, right: 0) + button.frame = CGRect(x: CGFloat(self.frame.size.width - 25), y: CGFloat(5), width: CGFloat(25), height: CGFloat(25)) + button.addTarget(self, action: #selector(self.togglePasswordView), for: .touchUpInside) + self.rightView = button + self.rightViewMode = .always + + let lbut = UIButton(type: .custom) + button.frame = CGRect(x: CGFloat(self.frame.size.width - 25), y: CGFloat(5), width: CGFloat(25), height: CGFloat(25)) + self.leftView = lbut + self.leftViewMode = .always + + } + + @IBAction func togglePasswordView(_ sender: Any) { + self.isSecureTextEntry = !self.isSecureTextEntry + setPasswordToggleImage(sender as! UIButton) + } + +} diff --git a/Befund/Controls/UIImageWithAlpha.swift b/Befund/Controls/UIImageWithAlpha.swift new file mode 100644 index 0000000..10fee68 --- /dev/null +++ b/Befund/Controls/UIImageWithAlpha.swift @@ -0,0 +1,31 @@ +// +// UIImageWithAlpha.swift +// Befund +// +// Created by Artur Savitskiy on 12.09.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +extension UIImage { + func image(alpha: CGFloat, targetSize: CGSize) -> UIImage? { + let size = size + + let widthRatio = targetSize.width / size.width + let heightRatio = targetSize.height / size.height + + // Figure out what our orientation is, and use that to form the rectangle + var newSize: CGSize + if(widthRatio > heightRatio) { + newSize = CGSize(width: size.width * heightRatio, height: size.height * heightRatio) + } else { + newSize = CGSize(width: size.width * widthRatio, height: size.height * widthRatio) + } + let rect = CGRect(origin: .zero, size: newSize) + UIGraphicsBeginImageContextWithOptions(newSize, false, scale) + draw(in: rect, blendMode: .normal, alpha: alpha) + let newImage = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + return newImage + } +} diff --git a/Befund/Controls/UISlider/UISlider.swift b/Befund/Controls/UISlider/UISlider.swift new file mode 100644 index 0000000..8d358c0 --- /dev/null +++ b/Befund/Controls/UISlider/UISlider.swift @@ -0,0 +1,17 @@ +// +// UISlider.swift +// Befund +// +// Created by Artur Savitskiy on 09.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +import UIKit + +public class UISlider: UIView +{ + @IBOutlet weak var loadedImg: UIImageView! + @IBOutlet weak var titleImg: UILabel! + +} diff --git a/Befund/Controls/UISlider/UISlider.xib b/Befund/Controls/UISlider/UISlider.xib new file mode 100644 index 0000000..063fcf6 --- /dev/null +++ b/Befund/Controls/UISlider/UISlider.xib @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Befund/Controls/UITableViewCell/ResultsTableViewCell.swift b/Befund/Controls/UITableViewCell/ResultsTableViewCell.swift new file mode 100644 index 0000000..3da834a --- /dev/null +++ b/Befund/Controls/UITableViewCell/ResultsTableViewCell.swift @@ -0,0 +1,34 @@ +// +// ResultsTableViewCell.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 27.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import UIKit + +class ResultsTableViewCell: UITableViewCell { + + public static let identifier = "ResultsTableViewCell" + + @IBOutlet var title: UILabel! + @IBOutlet weak var subtitle: UILabel! + @IBOutlet weak var identifier: UILabel! + @IBOutlet weak var icon: UIButton! + + public static func nib() -> UINib + { + return UINib(nibName: "ResultsTableViewCell", bundle: nil) + } + + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } +} diff --git a/Befund/Controls/UITableViewCell/ResultsTableViewCell.xib b/Befund/Controls/UITableViewCell/ResultsTableViewCell.xib new file mode 100644 index 0000000..18ab0a0 --- /dev/null +++ b/Befund/Controls/UITableViewCell/ResultsTableViewCell.xib @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Befund/Controls/WebView/.DS_Store b/Befund/Controls/WebView/.DS_Store new file mode 100644 index 0000000..d15d258 Binary files /dev/null and b/Befund/Controls/WebView/.DS_Store differ diff --git a/Befund/Controls/WebView/WebViewController.swift b/Befund/Controls/WebView/WebViewController.swift new file mode 100644 index 0000000..66645c8 --- /dev/null +++ b/Befund/Controls/WebView/WebViewController.swift @@ -0,0 +1,94 @@ +// +// WebViewController.swift +// Befund +// +// Created by Artur Savitskiy on 31.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import UIKit +import WebKit + +protocol UpdatingParentCheckBox: AnyObject { + var confirmCheckBox: CheckBoxButton! {get} +} + +class WebViewController: UIViewController { + + private let webView: WKWebView = { + let preferences = WKPreferences() + preferences.javaScriptEnabled = true + let configuration = WKWebViewConfiguration() + configuration.preferences = preferences + let webView = WKWebView(frame: .zero, configuration: configuration) + + return webView + }() + + private let url: URL + private let localUrl: URL + private let btnDoneTitle: String + + public var parentView: UpdatingParentCheckBox? = nil + + init(url: URL, title: String, localUrl: URL) + { + self.url = url + self.btnDoneTitle = title + self.localUrl = localUrl + super.init(nibName: nil, bundle: nil) + } + + required init?(coder: NSCoder) + { + fatalError() + } + + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .systemBackground + view.addSubview(webView) + webView.load(URLRequest(url: url)) + configurateButtons() + } + + private func configurateButtons() + { + + let btnDone = UIButton(frame: CGRect(x: 0, y: 0, width: self.view.frame.width-30, height: 45)) + btnDone.setTitle(btnDoneTitle, for: .normal) + btnDone.titleLabel?.lineBreakMode = NSLineBreakMode.byWordWrapping + btnDone.titleLabel?.textAlignment = .center + btnDone.backgroundColor = UIColor(red: 153/255, green: 19/255, blue: 85/255, alpha: 1) + btnDone.setTitleColor(.white, for: .normal) + btnDone.layer.cornerRadius = 5 + btnDone.clipsToBounds = true + btnDone.addTarget(self, action: #selector(didTapAccept), for: .touchUpInside) + let barButton = UIBarButtonItem(customView: btnDone) + + navigationItem.leftBarButtonItem = barButton + } + + @objc private func didTapAccept() + { + if (parentView!.confirmCheckBox != nil) + { + parentView!.confirmCheckBox.setChecked(flag: true) + + let settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + if (!settings!.policyAGBExplained) + { + settings!.policyAGBExplained = true + _ = settings!.save(atPath: Core.System.SettingsPath()) + } + } + + dismiss(animated: true, completion: nil) + } + + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + webView.frame = view.bounds + } + +} diff --git a/Befund/Core/.DS_Store b/Befund/Core/.DS_Store new file mode 100644 index 0000000..eaf6791 Binary files /dev/null and b/Befund/Core/.DS_Store differ diff --git a/Befund/Core/Core.swift b/Befund/Core/Core.swift new file mode 100644 index 0000000..2329f70 --- /dev/null +++ b/Befund/Core/Core.swift @@ -0,0 +1,9 @@ +// +// Core.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 29.04.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation +public struct Core {} diff --git a/Befund/Core/Database/Database.swift b/Befund/Core/Database/Database.swift new file mode 100644 index 0000000..7ea90c8 --- /dev/null +++ b/Befund/Core/Database/Database.swift @@ -0,0 +1,627 @@ +// +// Database.swift +// Befund +// Created by Irakli Abetschkhrischwili on 21.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation +import SQLite3 + +extension Core +{ + public class Database + { + /** + * Database context of results object + */ + public class Results + { + static let SQLITE_STATIC = unsafeBitCast(0, to: sqlite3_destructor_type.self) + static let SQLITE_TRANSIENT = unsafeBitCast(-1, to: sqlite3_destructor_type.self) + + /** + * Creates a database if it still not exist + */ + public static func CreateDBIfNotExists() -> Bool + { + var result: Bool = false + + if(!DatabaseExists()) + { + let con = CreateConnection() + + if(con != nil) + { + let sql = """ + create table if not exists results( + pgs text primary key not null, + pat_hash text null, + available integer not null default 0, + available_ts datetime null, + picked_up bit(1) not null default 0, + picked_up_ts datetime null, + file_checksum text null, + status text not null, + modified datetime null, + created datetime not null + ) + """ + + if(sqlite3_exec(con, sql, nil, nil, nil) == SQLITE_OK) + { + sqlite3_close(con) + result = true + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "CreateDBIfNotExists") + } + } + } + + return result + } + + /** + * Inserts a results in the database + */ + public static func Create(results: Core.Models.Database.Results) -> Bool + { + var result: Bool = false + + if(results.pgs != nil) + { + if(DatabaseExists()) + { + let con = CreateConnection() + + if(con != nil) + { + var cmd: OpaquePointer? = nil + + let sql = "insert into results (pgs, pat_hash, available, available_ts, picked_up, picked_up_ts, file_checksum, status, created) values(?, ?, ?, ?, ?, ?, ?, ?, ?)" + + if(sqlite3_prepare_v2(con, sql, -1, &cmd, nil) == SQLITE_OK) + { + sqlite3_bind_text(cmd, 1, (results.pgs! as NSString).utf8String, -1, SQLITE_TRANSIENT) + + if(results.pat_hash != nil) + { + sqlite3_bind_text(cmd, 2, (results.pat_hash! as NSString).utf8String, -1, SQLITE_TRANSIENT) + } + else + { + sqlite3_bind_null(cmd, 2) + } + + + sqlite3_bind_int(cmd, 3, (results.available ? 1 : 0)) + + if(results.available_ts != nil) + { + sqlite3_bind_text(cmd, 4, (results.available_ts! as NSString).utf8String, -1, SQLITE_TRANSIENT) + } + else + { + sqlite3_bind_null(cmd, 4) + } + + sqlite3_bind_int(cmd, 5, (results.picked_up ? 1 : 0)) + + if(results.picked_up_ts != nil) + { + sqlite3_bind_text(cmd, 6, (results.picked_up_ts! as NSString).utf8String, -1, SQLITE_TRANSIENT) + } + else + { + sqlite3_bind_null(cmd, 6) + } + + if(results.file_checksum != nil) + { + sqlite3_bind_text(cmd, 7, (results.file_checksum! as NSString).utf8String, -1, SQLITE_TRANSIENT) + } + else + { + sqlite3_bind_null(cmd, 7) + } + + sqlite3_bind_text(cmd, 8, (results.status! as NSString).utf8String, -1, SQLITE_TRANSIENT) + + let now = Date() + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + let created = dateFormatter.string(from: now) + sqlite3_bind_text(cmd, 9, (created as NSString).utf8String, -1, SQLITE_TRANSIENT) + + if(sqlite3_step(cmd) != SQLITE_DONE) + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "Create(Results)") + } + + sqlite3_finalize(cmd) + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "Create(Results)") + } + + sqlite3_close(con) + result = true + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "Create(Results)") + } + } + } + + return result + } + + /** + * Updates a results in the database + */ + public static func Update(results: Core.Models.Database.Results) -> Bool + { + var result: Bool = false + + if(results.pgs != nil) + { + if(DatabaseExists()) + { + let con = CreateConnection() + + if(con != nil) + { + var cmd: OpaquePointer? = nil + + let sql = """ + update results set + pat_hash = ?, + available = ?, + available_ts = ?, + picked_up = ?, + picked_up_ts = ?, + file_checksum = ?, + status = ?, + modified = ? + where + pgs = ? + """ + + if(sqlite3_prepare_v2(con, sql, -1, &cmd, nil) == SQLITE_OK) + { + if(results.pat_hash != nil) + { + sqlite3_bind_text(cmd, 1, (results.pat_hash! as NSString).utf8String, -1, SQLITE_TRANSIENT) + } + else + { + sqlite3_bind_null(cmd, 1) + } + + sqlite3_bind_int(cmd, 2, (results.available ? 1 : 0)) + + if(results.available_ts != nil) + { + sqlite3_bind_text(cmd, 3, (results.available_ts! as NSString).utf8String, -1, SQLITE_TRANSIENT) + } + else + { + sqlite3_bind_null(cmd, 3) + } + + sqlite3_bind_int(cmd, 4, (results.picked_up ? 1 : 0)) + + if(results.picked_up_ts != nil) + { + sqlite3_bind_text(cmd, 5, (results.picked_up_ts! as NSString).utf8String, -1, SQLITE_TRANSIENT) + } + else + { + sqlite3_bind_null(cmd, 5) + } + + if(results.file_checksum != nil) + { + sqlite3_bind_text(cmd, 6, (results.file_checksum! as NSString).utf8String, -1, SQLITE_TRANSIENT) + } + else + { + sqlite3_bind_null(cmd, 6) + } + + sqlite3_bind_text(cmd, 7, (results.status! as NSString).utf8String, -1, SQLITE_TRANSIENT) + + let now = Date() + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + let modified = dateFormatter.string(from: now) + sqlite3_bind_text(cmd, 8, (modified as NSString).utf8String, -1, SQLITE_TRANSIENT) + + sqlite3_bind_text(cmd, 9, (results.pgs! as NSString).utf8String, -1, SQLITE_TRANSIENT) + + if(sqlite3_step(cmd) != SQLITE_DONE) + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "Update(Results)") + } + + sqlite3_finalize(cmd) + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "Update(Results)") + } + + sqlite3_close(con) + result = true + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "Update(Results)") + } + } + } + + return result + } + + /** + * Deletes a results from the databse + */ + public static func Delete(results: Core.Models.Database.Results) -> Bool + { + var result: Bool = false + + if(results.pgs != nil) + { + if(DatabaseExists()) + { + let con = CreateConnection() + + if(con != nil) + { + var cmd: OpaquePointer? = nil + + let sql = "delete from results where pgs = ?" + + if(sqlite3_prepare_v2(con, sql, -1, &cmd, nil) == SQLITE_OK) + { + sqlite3_bind_text(cmd, 1, (results.pgs! as NSString).utf8String, -1, SQLITE_TRANSIENT) + + if(sqlite3_step(cmd) != SQLITE_DONE) + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "Delete(Results)") + } + else + { + let filePath = Core.System.GetURLForStorageEncryptedFile(filename: results.pgs!) + + if(filePath != nil && Core.System.FileExists(atPath: filePath!.path)) + { + result = Core.System.DeleteFile(atPath: filePath!.path) + } + } + + sqlite3_finalize(cmd) + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "Delete(Results)") + } + + sqlite3_close(con) + result = true + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "Delete(Results)") + } + } + } + + return result + } + + /** + * Creates or update results in the database + */ + public static func CreateOrUpdate(results: Core.Models.Database.Results) -> Bool + { + let dbResults = GetResults(pgs: results.pgs!) + + if(dbResults != nil) + { + return Update(results: results) + } + else + { + return Create(results: results) + } + } + + /** + * Returns results by pgs + */ + public static func GetResults(pgs: String) -> Core.Models.Database.Results? + { + var result: Core.Models.Database.Results? = nil + + if(DatabaseExists()) + { + let con = CreateConnection() + + if(con != nil) + { + var cmd: OpaquePointer? = nil + + let sql = """ + select + pgs, + pat_hash, + available, + available_ts, + picked_up, + picked_up_ts, + file_checksum, + status, + modified, + created + from + results + where + pgs = ? + """ + + if(sqlite3_prepare_v2(con, sql, -1, &cmd, nil) == SQLITE_OK) + { + sqlite3_bind_text(cmd, 1, (pgs as NSString).utf8String, -1, nil) + + if(sqlite3_step(cmd) == SQLITE_ROW) + { + result = Core.Models.Database.Results() + result!.pgs = String(cString: sqlite3_column_text(cmd, 0)) + + let pat_hash = sqlite3_column_text(cmd, 1) + + if(pat_hash != nil) + { + result!.pat_hash = String(cString: pat_hash!) + } + + result!.available = (sqlite3_column_int(cmd, 2) == 1) + + let available_ts = sqlite3_column_text(cmd, 3) + + if(available_ts != nil) + { + result!.available_ts = String(cString: available_ts!) + } + + result!.picked_up = (sqlite3_column_int(cmd, 4) == 1) + + let picked_up_ts = sqlite3_column_text(cmd, 5) + + if(picked_up_ts != nil) + { + result!.picked_up_ts = String(cString: picked_up_ts!) + } + + let file_checksum = sqlite3_column_text(cmd, 6) + + if(file_checksum != nil) + { + result!.file_checksum = String(cString: file_checksum!) + } + + let status = sqlite3_column_text(cmd, 7) + + if(status != nil) + { + result!.status = String(cString: status!) + } + + let modified_str = sqlite3_column_text(cmd, 8) + + if(modified_str != nil) + { + result!.modified = String(cString: modified_str!) + } + + let created_str = sqlite3_column_text(cmd, 9) + + if(created_str != nil) + { + result!.created = String(cString: created_str!) + } + } + + sqlite3_finalize(cmd) + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "GetResults(String)") + } + + sqlite3_close(con) + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "GetResults(String)") + } + } + + return result + } + + /** + * Returns all results from the database + */ + public static func GetResults(activeOnly: Bool = true) -> Array? + { + var result: Array? = nil + + if(DatabaseExists()) + { + let con = CreateConnection() + + if(con != nil) + { + var cmd: OpaquePointer? = nil + + let sql = """ + select + pgs, + pat_hash, + available, + available_ts, + picked_up, + picked_up_ts, + file_checksum, + status, + modified, + created + from + results + order by + created desc + """ + + if(sqlite3_prepare_v2(con, sql, -1, &cmd, nil) == SQLITE_OK) + { + result = Array() + + while(sqlite3_step(cmd) == SQLITE_ROW) + { + var results = Core.Models.Database.Results() + results.pgs = String(cString: sqlite3_column_text(cmd, 0)) + + let pat_hash = sqlite3_column_text(cmd, 1) + + if(pat_hash != nil) + { + results.pat_hash = String(cString: pat_hash!) + } + + results.available = (sqlite3_column_int(cmd, 2) == 1) + + let available_ts = sqlite3_column_text(cmd, 3) + + if(available_ts != nil) + { + results.available_ts = String(cString: available_ts!) + } + + results.picked_up = (sqlite3_column_int(cmd, 4) == 1) + + let picked_up_ts = sqlite3_column_text(cmd, 5) + + if(picked_up_ts != nil) + { + results.picked_up_ts = String(cString: picked_up_ts!) + } + + let file_checksum = sqlite3_column_text(cmd, 6) + + if(file_checksum != nil) + { + results.file_checksum = String(cString: file_checksum!) + } + + let status = sqlite3_column_text(cmd, 7) + + if(status != nil) + { + results.status = String(cString: status!) + } + + let modified_str = sqlite3_column_text(cmd, 8) + + if(modified_str != nil) + { + results.modified = String(cString: modified_str!) + } + + let created_str = sqlite3_column_text(cmd, 9) + + if(created_str != nil) + { + results.created = String(cString: created_str!) + } + + // Show only ready results + if(activeOnly) + { + let statusCode = results.GetStatus() + if((statusCode == .COMPLETED || statusCode == .EXPIRED) && (results.picked_up || results.available)) + { + result!.append(results) + } + } + else + { + result!.append(results) + } + } + + sqlite3_finalize(cmd) + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "GetResults") + } + + sqlite3_close(con) + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Results", method: "GetResults") + } + } + + return result + } + + /** + * Check if database exists + */ + private static func DatabaseExists() -> Bool + { + let dbPath = Core.System.ResultsDatabasePath() + return (dbPath != nil && Core.System.FileExists(atPath: dbPath!)) + } + + /** + * Returns database connection pointer + */ + private static func CreateConnection() -> OpaquePointer? + { + var result: OpaquePointer? = nil + + let dbPath = Core.System.ResultsDatabasePath() + + if(dbPath != nil && sqlite3_open(dbPath!, &result) == SQLITE_OK) + { + return result + } + + return result + } + } + } +} diff --git a/Befund/Core/Database/Logs.swift b/Befund/Core/Database/Logs.swift new file mode 100644 index 0000000..bc7cdae --- /dev/null +++ b/Befund/Core/Database/Logs.swift @@ -0,0 +1,297 @@ +// +// Logs.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 21.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation +import SQLite3 + +extension Core.Database +{ + /** + * Database context of logs object + */ + public class Logs + { + static let SQLITE_STATIC = unsafeBitCast(0, to: sqlite3_destructor_type.self) + static let SQLITE_TRANSIENT = unsafeBitCast(-1, to: sqlite3_destructor_type.self) + + /** + * Creates a database if it still not exist + */ + public static func CreateDBIfNotExists() -> Bool + { + var result: Bool = false + + if(!DatabaseExists()) + { + let con = CreateConnection() + + if(con != nil) + { + let sql = """ + create table if not exists logs( + id integer primary key autoincrement not null, + guid text not null, + message text not null, + type text not null, + created datetime not null + ) + """ + + if(sqlite3_exec(con, sql, nil, nil, nil) == SQLITE_OK) + { + sqlite3_close(con) + result = true + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Logs", method: "CreateDBIfNotExists") + } + } + } + + return result + } + + /** + * Inserts a log in the database + */ + public static func Create(log: Core.Database.Log) -> Bool + { + var result: Bool = false + + if(log.message != nil && log.type != nil) + { + if(DatabaseExists()) + { + let con = CreateConnection() + + if(con != nil) + { + var cmd: OpaquePointer? = nil + + let sql = "insert into logs (guid, message, type, created) values(?, ?, ?, ?)" + + if(sqlite3_prepare_v2(con, sql, -1, &cmd, nil) == SQLITE_OK) + { + let guid = (log.guid != nil ? log.guid! : UUID().uuidString) + + sqlite3_bind_text(cmd, 1, (guid as NSString).utf8String, -1, SQLITE_TRANSIENT) + sqlite3_bind_text(cmd, 2, (log.message! as NSString).utf8String, -1, SQLITE_TRANSIENT) + sqlite3_bind_text(cmd, 3, (log.type! as NSString).utf8String, -1, SQLITE_TRANSIENT) + + let now = Date() + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + let created = dateFormatter.string(from: now) + + sqlite3_bind_text(cmd, 4, (created as NSString).utf8String, -1, SQLITE_TRANSIENT) + + if(sqlite3_step(cmd) != SQLITE_DONE) + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Logs", method: "Create(Log)") + } + + sqlite3_finalize(cmd) + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Logs", method: "Create(Log)") + } + + sqlite3_close(con) + result = true + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Logs", method: "Create(Log)") + } + } + } + + return result + } + + /** + * Returns logs from the database + */ + public static func GetLogs() -> Array? + { + var result: Array? = nil + + if(DatabaseExists()) + { + let con = CreateConnection() + + if(con != nil) + { + var cmd: OpaquePointer? = nil + + let sql = "select id, guid, message, type, created from logs order by created desc" + + if(sqlite3_prepare_v2(con, sql, -1, &cmd, nil) == SQLITE_OK) + { + result = Array() + + while(sqlite3_step(cmd) == SQLITE_ROW) + { + var log = Core.Database.Log() + log.id = sqlite3_column_int(cmd, 0) + log.guid = String(cString: sqlite3_column_text(cmd, 1)) + log.message = String(cString: sqlite3_column_text(cmd, 2)) + log.type = String(cString: sqlite3_column_text(cmd, 3)) + + let created_str = String(cString: sqlite3_column_text(cmd, 4)) + + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + + log.created = dateFormatter.date(from: created_str) + + result!.append(log) + } + + sqlite3_finalize(cmd) + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Logs", method: "GetLogs") + } + + sqlite3_close(con) + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Logs", method: "GetLogs") + } + } + + return result + } + + /** + * Returns logs by type from the database + */ + public static func GetLogs(type: String) -> Array? + { + var result: Array? = nil + + if(DatabaseExists()) + { + let con = CreateConnection() + + if(con != nil) + { + var cmd: OpaquePointer? = nil + + let sql = "select id, guid, message, type, created from logs where type = ? order by created desc" + + if(sqlite3_prepare_v2(con, sql, -1, &cmd, nil) == SQLITE_OK) + { + sqlite3_bind_text(cmd, 1, (type as NSString).utf8String, -1, nil) + + result = Array() + + while(sqlite3_step(cmd) == SQLITE_ROW) + { + var log = Core.Database.Log() + log.id = sqlite3_column_int(cmd, 0) + log.guid = String(cString: sqlite3_column_text(cmd, 1)) + log.message = String(cString: sqlite3_column_text(cmd, 2)) + log.type = String(cString: sqlite3_column_text(cmd, 3)) + + let created_str = String(cString: sqlite3_column_text(cmd, 4)) + + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + + log.created = dateFormatter.date(from: created_str) + + result!.append(log) + } + + sqlite3_finalize(cmd) + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Logs", method: "GetLogs(String)") + } + + sqlite3_close(con) + } + else + { + let dbError = String(cString: sqlite3_errmsg(con)) + Core.Log.Critical(msg: dbError, namespace: "Core.Database.Logs", method: "GetLogs(String)") + } + } + + return result + } + + /** + * Deletes the database of logs + */ + public static func DeleteLogs() -> Bool + { + var result = false + + let dbPath = Core.System.LogsDatabasePath() + + if(dbPath != nil) + { + result = Core.System.DeleteFile(atPath: dbPath!) + } + + return result + } + + /** + * Check if database exists + */ + private static func DatabaseExists() -> Bool + { + let dbPath = Core.System.LogsDatabasePath() + return (dbPath != nil && Core.System.FileExists(atPath: dbPath!)) + } + + /** + * Returns database connection pointer + */ + private static func CreateConnection() -> OpaquePointer? + { + var result: OpaquePointer? = nil + + let dbPath = Core.System.LogsDatabasePath() + + if(dbPath != nil && sqlite3_open(dbPath!, &result) == SQLITE_OK) + { + return result + } + + return result + } + } + + /** + * Database log object + */ + public struct Log + { + public var id: Int32 = 0 + public var guid: String? = nil + public var message: String? = nil + public var type: String? = nil + public var created: Date? = nil + } +} diff --git a/Befund/Core/Extensions/Button.swift b/Befund/Core/Extensions/Button.swift new file mode 100644 index 0000000..a832b69 --- /dev/null +++ b/Befund/Core/Extensions/Button.swift @@ -0,0 +1,26 @@ +// +// Button.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 02.06.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + + +import Foundation +import UIKit + +extension UIButton +{ + /** + * Sets the background color for UIButton for a state + */ + func setBackgroundColor(color: UIColor, forState: UIControl.State) + { + UIGraphicsBeginImageContext(CGSize(width: 1, height: 1)) + UIGraphicsGetCurrentContext()!.setFillColor(color.cgColor) + UIGraphicsGetCurrentContext()!.fill(CGRect(x: 0, y: 0, width: 1, height: 1)) + let colorImage = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + self.setBackgroundImage(colorImage, for: forState) + } +} diff --git a/Befund/Core/Extensions/CheckBoxButton.swift b/Befund/Core/Extensions/CheckBoxButton.swift new file mode 100644 index 0000000..23b1748 --- /dev/null +++ b/Befund/Core/Extensions/CheckBoxButton.swift @@ -0,0 +1,62 @@ +// +// CheckBoxButton.swift +// Befund +// +// Created by Artur Savitskiy on 05.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import UIKit + +class CheckBoxButton: UIView { + + var isChecked = false + + let imageView: UIImageView = { + let imageView = UIImageView() + imageView.isHidden = true + imageView.contentMode = .scaleAspectFit + imageView.tintColor = UIColor(red: 153/255, green: 19/255, blue: 85/255, alpha: 1) + imageView.image = UIImage(systemName: "checkmark") + return imageView + }() + + let boxView: UIView = { + let view = UIView() + view.layer.borderWidth = 1 + view.layer.borderColor = UIColor.label.cgColor + return view + }() + + override init(frame: CGRect) { + super.init(frame: frame) + backgroundColor = .clear + addSubview(boxView) + addSubview(imageView) + clipsToBounds = true + } + + required init?(coder: NSCoder) { + fatalError() + } + + override func layoutSubviews() { + super.layoutSubviews() + boxView.frame = CGRect(x: 5, y: 5, width: frame.size.width-10, height: frame.size.height-10) + imageView.frame = bounds + } + public func toogle() + { + self.isChecked = !isChecked + imageView.isHidden = !isChecked + } + public func IsChecked() -> Bool + { + return self.isChecked + } + public func setChecked(flag: Bool) + { + self.isChecked = flag + imageView.isHidden = !flag + } +} diff --git a/Befund/Core/Extensions/ConnectionManager.swift b/Befund/Core/Extensions/ConnectionManager.swift new file mode 100644 index 0000000..7cd5e8c --- /dev/null +++ b/Befund/Core/Extensions/ConnectionManager.swift @@ -0,0 +1,39 @@ + +import Foundation +import UIKit +import SystemConfiguration + +public class InternetConnectionManager { + + + private init() { + + } + + public static func isConnectedToNetwork() -> Bool { + + var zeroAddress = sockaddr_in() + zeroAddress.sin_len = UInt8(MemoryLayout.size(ofValue: zeroAddress)) + zeroAddress.sin_family = sa_family_t(AF_INET) + guard let defaultRouteReachability = withUnsafePointer(to: &zeroAddress, { + + $0.withMemoryRebound(to: sockaddr.self, capacity: 1) { + + SCNetworkReachabilityCreateWithAddress(nil, $0) + + } + + }) else { + + return false + } + var flags = SCNetworkReachabilityFlags() + if !SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags) { + return false + } + let isReachable = (flags.rawValue & UInt32(kSCNetworkFlagsReachable)) != 0 + let needsConnection = (flags.rawValue & UInt32(kSCNetworkFlagsConnectionRequired)) != 0 + return (isReachable && !needsConnection) + } + +} diff --git a/Befund/Core/Extensions/Image.swift b/Befund/Core/Extensions/Image.swift new file mode 100644 index 0000000..aad674d --- /dev/null +++ b/Befund/Core/Extensions/Image.swift @@ -0,0 +1,182 @@ +// +// Image.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 27.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import UIKit +import ImageIO +// FIXME: comparison operators with optionals were removed from the Swift Standard Libary. +// Consider refactoring the code to use the non-optional operators. +fileprivate func < (lhs: T?, rhs: T?) -> Bool { + switch (lhs, rhs) { + case let (l?, r?): + return l < r + case (nil, _?): + return true + default: + return false + } +} + +/** + * Extension of gif image support + */ +extension UIImage { + + public class func gifImageWithData(_ data: Data) -> UIImage? { + guard let source = CGImageSourceCreateWithData(data as CFData, nil) else { + print("image doesn't exist") + return nil + } + + return UIImage.animatedImageWithSource(source) + } + + public class func gifImageWithURL(_ gifUrl:String) -> UIImage? { + guard let bundleURL:URL? = URL(string: gifUrl) + else { + print("image named \"\(gifUrl)\" doesn't exist") + return nil + } + guard let imageData = try? Data(contentsOf: bundleURL!) else { + print("image named \"\(gifUrl)\" into NSData") + return nil + } + + return gifImageWithData(imageData) + } + + public class func gifImageWithName(_ name: String) -> UIImage? { + guard let bundleURL = Bundle.main + .url(forResource: name, withExtension: "gif") else { + print("SwiftGif: This image named \"\(name)\" does not exist") + return nil + } + guard let imageData = try? Data(contentsOf: bundleURL) else { + print("SwiftGif: Cannot turn image named \"\(name)\" into NSData") + return nil + } + + return gifImageWithData(imageData) + } + + class func delayForImageAtIndex(_ index: Int, source: CGImageSource!) -> Double { + var delay = 0.1 + + let cfProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil) + let gifProperties: CFDictionary = unsafeBitCast( + CFDictionaryGetValue(cfProperties, + Unmanaged.passUnretained(kCGImagePropertyGIFDictionary).toOpaque()), + to: CFDictionary.self) + + var delayObject: AnyObject = unsafeBitCast( + CFDictionaryGetValue(gifProperties, + Unmanaged.passUnretained(kCGImagePropertyGIFUnclampedDelayTime).toOpaque()), + to: AnyObject.self) + if delayObject.doubleValue == 0 { + delayObject = unsafeBitCast(CFDictionaryGetValue(gifProperties, + Unmanaged.passUnretained(kCGImagePropertyGIFDelayTime).toOpaque()), to: AnyObject.self) + } + + delay = delayObject as! Double + + if delay < 0.1 { + delay = 0.1 + } + + return delay + } + + class func gcdForPair(_ a: Int?, _ b: Int?) -> Int { + var a = a + var b = b + if b == nil || a == nil { + if b != nil { + return b! + } else if a != nil { + return a! + } else { + return 0 + } + } + + if a < b { + let c = a + a = b + b = c + } + + var rest: Int + while true { + rest = a! % b! + + if rest == 0 { + return b! + } else { + a = b + b = rest + } + } + } + + class func gcdForArray(_ array: Array) -> Int { + if array.isEmpty { + return 1 + } + + var gcd = array[0] + + for val in array { + gcd = UIImage.gcdForPair(val, gcd) + } + + return gcd + } + + class func animatedImageWithSource(_ source: CGImageSource) -> UIImage? { + let count = CGImageSourceGetCount(source) + var images = [CGImage]() + var delays = [Int]() + + for i in 0.. UIToolbar + { + let toolbar = UIToolbar() + let flexSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, + target: nil, action: nil) + let doneButton = UIBarButtonItem(title: Core.Lang.Get(key: "BTN_DONE"), style: .done, + target: self, action: #selector(hideKeyboard)) + + toolbar.setItems([flexSpace, doneButton], animated: true) + toolbar.sizeToFit() + + return toolbar + } + + internal func hideKeyboardWhenTappedAround() + { + let tap = UITapGestureRecognizer(target: self, action: #selector(hideKeyboard)) + tap.cancelsTouchesInView = false + view.addGestureRecognizer(tap) + } + + @objc func hideKeyboard() + { + self.view.endEditing(true) + } +} diff --git a/Befund/Core/Extensions/ViewControllerExtension.swift b/Befund/Core/Extensions/ViewControllerExtension.swift new file mode 100644 index 0000000..98cd770 --- /dev/null +++ b/Befund/Core/Extensions/ViewControllerExtension.swift @@ -0,0 +1,26 @@ +// +// ViewControllerExtension.swift +// Befund +// +// Created by Artur Savitskiy on 04.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +import UIKit + +extension UIViewController +{ + func PrepareForPasswordReset() + { + + } + + internal func ShowMessagePopup(title: String, message: String) + { + let ac = UIAlertController(title: title, message: message, preferredStyle: .alert) + ac.addAction(UIAlertAction(title: "OK", style: .default)) + self.present(ac, animated: true, completion: nil) + } + +} diff --git a/Befund/Core/Extensions/ViewExtension.swift b/Befund/Core/Extensions/ViewExtension.swift new file mode 100644 index 0000000..d18059e --- /dev/null +++ b/Befund/Core/Extensions/ViewExtension.swift @@ -0,0 +1,36 @@ +// +// ViewExtension.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 27.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +import UIKit + +extension UIView +{ + /** + * Creates a dashed border for UIView + */ + func addDashedBorder() + { + let color = UIColor.white.cgColor + + let shapeLayer:CAShapeLayer = CAShapeLayer() + let frameSize = self.frame.size + let shapeRect = CGRect(x: 0, y: 0, width: frameSize.width, height: frameSize.height) + + shapeLayer.bounds = shapeRect + shapeLayer.position = CGPoint(x: frameSize.width/2, y: frameSize.height/2) + shapeLayer.fillColor = UIColor.clear.cgColor + shapeLayer.strokeColor = color + shapeLayer.lineWidth = 2 + shapeLayer.lineJoin = CAShapeLayerLineJoin.round + shapeLayer.lineDashPattern = [6,3] + shapeLayer.path = UIBezierPath(roundedRect: shapeRect, cornerRadius: 4).cgPath + + self.layer.addSublayer(shapeLayer) + } +} diff --git a/Befund/Core/Https/Request.swift b/Befund/Core/Https/Request.swift new file mode 100644 index 0000000..20630f5 --- /dev/null +++ b/Befund/Core/Https/Request.swift @@ -0,0 +1,451 @@ +// +// Request.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 15.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation +import UIKit +import Combine +import CryptoKit + +extension Core +{ + public struct Https + { + public class Request + { + /** + * Low Level Header protector + */ + private static let HeaderSecureHash: String = "3HzKQw/&>*VH^?cAR{Qd5pP~6w(V5%aZ"; + private static let HeaderValueSecureHash: String = "7*R3P!f:sC4Q8XS:@*J/z:4/sS;V3GnM"; + + /** + * Sends Key Exchange Request to the server in async mode and calls callback(onSucces or onError) + * @param host - Servers.Host that should get this request + * @param keyPair - Client keyPair(if not given it will create a new one) + * @param onSuccess - onSuccess Handler + * @param onError - onError Handler + */ + static func KeyExchangeAsync(host: Servers, keyPair: Core.Security.Curve25519.KeyPair? = nil, onSuccess: ((Core.Models.Response.PublicKey)->Void)? = nil, onError: ((String)->Void)? = nil) + { + PostKeyExchangeRequestAsync().RunAsync(host: host, controller: "exchange", action: "key", _keyPair: keyPair, onSuccess: onSuccess, onError: onError); + } + + /** + * Sends Encrypted Request to the server in async mode and calls callback(onSucces or onError) + * @param host - Servers.Host that should get this request + * @param controller - controller of the request + * @param action - controller action of the request + * @param request - Encrypted Request that should be sent to the server + * @param serverPublicKey - Server Public Key from Exchange Request + * @param keyPair - Client KeyPair (if not given it will create a new one) + * @param onSuccess - onSuccess Handler + * @param onError - onError Handler + */ + public static func EncryptedRequestAsync(host: Servers, controller: String, action: String, request: Core.Models.Request.EncryptedRequest, serverPublicKey: Core.Models.Response.PublicKey, keyPair: Core.Security.Curve25519.KeyPair? = nil, onSuccess: ((Core.Models.Response.EncryptedResponse)->Void)? = nil, onError: ((String)->Void)? = nil) + { + PostEncryptedRequestAsync().RunAsync(host: host, controller: controller, action: action, _request: request, serverPublicKey:serverPublicKey, _keyPair: keyPair, onSuccess: onSuccess, onError: onError); + } + + /** + * Sends EncryptedRequest to the server in async mode and calls callback(onSucces or onError) + */ + public class PostEncryptedRequestAsync: NSObject, URLSessionDelegate + { + /** + * Runs encrypted request async and calls ether onSuccess or onError callback + * + * @param host - host of the server s. Servers enum + * @param controller - controller of request + * @param action - action of request + * @param _request - encrypted request that contains descriptor, request object and hmac + * @param serverPublicKey - Exchanged server public key from the first request + * @param _keyPair - Curve25519 KeyPair (Private & Public Keys) + * @param onSuccess - onSuccess callback that contains public key of response(Server) + * @param onError - onError callback that contains error message + */ + func RunAsync(host: Servers, controller: String, action: String, _request: Core.Models.Request.EncryptedRequest, serverPublicKey: Core.Models.Response.PublicKey, _keyPair: Core.Security.Curve25519.KeyPair? = nil, onSuccess: ((Core.Models.Response.EncryptedResponse)->Void)? = nil, onError: ((String)->Void)? = nil) + { + var keyPair = _keyPair; + + do + { + if(keyPair == nil) + { + keyPair = Security.Curve25519.GenerateKeyPair() + } + + let strURL = Core.Https.Request.wellFormedControllerAction(host: host, controller: controller, action: action) + let url = URL(string: strURL)! + var request = URLRequest(url: url) + + request.httpMethod = "POST" + request.setValue(host.rawValue, forHTTPHeaderField: "Host") + request.setValue("BefundApp", forHTTPHeaderField: "User-Agent") + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + request.setValue(Security.AES.Encrypt(value: HeaderValueSecureHash, deriveKey: SymmetricKey(data: Security.AES.GetKey(password: HeaderSecureHash))), forHTTPHeaderField: "Client-Hash") + request.setValue(keyPair!.PublicKey, forHTTPHeaderField: "Client-Key") + request.setValue(keyPair!.SigningPublicKey, forHTTPHeaderField: "Client-Signature-Key") + request.setValue(keyPair!.GetSignature(signingValue: (_request.encrypted_content != nil ? _request.encrypted_content : _request.descriptor)!), forHTTPHeaderField: "Client-Signature") + + request.httpBody = try JSONEncoder().encode(_request) + + let session = URLSession(configuration: URLSessionConfiguration.default, delegate: self, delegateQueue: nil) + + DispatchQueue.global(qos: .background).async + { + let task = session.dataTask(with: request) + { + if($2 != nil) + { + self.responseError(message: $2!.localizedDescription, callback: onError) + Log.Error(err: $2!, namespace: "Core.Https.Request.PostEncryptedRequestAsync", method: "RunAsync") + } + + if($1 != nil) + { + let httpUrlResponse = $1 as? HTTPURLResponse + + if(httpUrlResponse != nil) + { + if(httpUrlResponse!.statusCode == 429) + { + AppDelegate.Session.Maintenance = false + AppDelegate.Session.MaintenanceNotified = false + self.responseError(message: Core.Lang.Get(key: "ERROR_TOO_MANY_REQUESTS"), callback: onError) + } + else if (httpUrlResponse!.statusCode == 503) + { + AppDelegate.Session.Maintenance = true + self.responseError(message: Core.Lang.Get(key: "MSG_MAINTENANCE"), callback: onError) + } + else + { + AppDelegate.Session.Maintenance = false + AppDelegate.Session.MaintenanceNotified = false + + if(!Core.Https.Request.validServerHeaders(server: httpUrlResponse!)) + { + self.responseError(message: Core.Lang.Get(key: "ERROR_INVALID_RESPONSE"), callback: onError) + } + else + { + if($0 != nil) + { + self.responseEncryptedResponse(data: $0!, server: httpUrlResponse!, deriveKey: keyPair!.GetSharedKey(peerPublicKeyBase64: serverPublicKey.key!)!, callback: onSuccess) + } + else + { + self.responseError(message: Core.Lang.Get(key: "ERROR_INVALID_RESPONSE"), callback: onError) + } + } + } + } + } + } + + task.resume() + } + } + catch + { + Log.Error(err: error, namespace: "Core.Https.Request.PostKeyExchangeRequestAsync", method: "RunAsync") + } + } + + /** + * Calls OnError Handler with a error message + * + * @param message - error message + * @callback - callback of error response + */ + private func responseError(message: String, callback: ((String)->Void)? = nil) + { + if(callback != nil) + { + callback!(message) + } + } + + /** + * Calls OnSuccess Handler with a EncryptedResponse + * @param data - response data + * @param server - server context that contains response header + * @param deriveKey - deriveKey + * @param callback - onSuccess callback + */ + private func responseEncryptedResponse(data: Data, server: HTTPURLResponse, deriveKey: SymmetricKey, callback: ((Core.Models.Response.EncryptedResponse)->Void)? = nil) + { + if(callback != nil) + { + do + { + let encryptedResponse = try JSONDecoder().decode(Core.Models.Response.EncryptedResponse.self, from: data) + + if(Core.Https.Request.validServerSignature(server: server, encryptedResponse: encryptedResponse, deriveKey: deriveKey)) + { + callback!(encryptedResponse) + } + } + catch + { + Log.Error(err: error, namespace: "Core.Https.Request.PostKeyExchangeRequestAsync", method: "responseEncryptedResponse(data, Callback") + } + } + } + + public func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { +#if DEBUG + completionHandler(.useCredential, URLCredential(trust: challenge.protectionSpace.serverTrust!)) +#else + if(challenge.protectionSpace.host.contains("pba-simulator.patientenbefundapp.labor-limbach-hannover.de")) + { + completionHandler(.useCredential, URLCredential(trust: challenge.protectionSpace.serverTrust!)) + } + else + { + completionHandler(.performDefaultHandling, nil) + } +#endif + } + } + + /** + * Sends Key Exchange Post request to the server in async mode and calls callback(onSucces or onError) + */ + public class PostKeyExchangeRequestAsync: NSObject, URLSessionDelegate + { + /** + * Runs request async and calls ether onSuccess or onError callback + * + * @param host - host of the server s. Servers enum + * @param controller - controller of request + * @param action - action of request + * @param _keyPair - Curve25519 KeyPair (Private & Public Keys) + * @param onSuccess - onSuccess callback that contains public key of response(Server) + * @param onError - onError callback that contains error message + */ + func RunAsync(host: Servers, controller: String, action: String, _keyPair: Core.Security.Curve25519.KeyPair? = nil, onSuccess: ((Core.Models.Response.PublicKey)->Void)? = nil, onError: ((String)->Void)? = nil) + { + var keyPair = _keyPair; + + do + { + if(keyPair == nil) + { + keyPair = Security.Curve25519.GenerateKeyPair() + } + + let strURL = Core.Https.Request.wellFormedControllerAction(host: host, controller: controller, action: action) + let url = URL(string: strURL)! + var request = URLRequest(url: url) + + request.httpMethod = "POST" + request.setValue(host.rawValue, forHTTPHeaderField: "Host"); + request.setValue("BefundApp", forHTTPHeaderField: "User-Agent"); + request.setValue("application/json", forHTTPHeaderField: "Content-Type"); + request.setValue(Security.AES.Encrypt(value: HeaderValueSecureHash, deriveKey: SymmetricKey(data: Security.AES.GetKey(password: HeaderSecureHash))), forHTTPHeaderField: "Client-Hash"); + request.setValue(keyPair!.PublicKey, forHTTPHeaderField: "Client-Key"); + + + request.httpBody = try JSONEncoder().encode(Core.Models.Request.KeyExchange()) + + let session = URLSession(configuration: URLSessionConfiguration.default, delegate: self, delegateQueue: nil) + + DispatchQueue.global(qos: .background).async + { + let task = session.dataTask(with: request) + { + if($2 != nil) + { + self.responseError(message: $2!.localizedDescription, callback: onError) + Log.Error(err: $2!, namespace: "Core.Https.Request.PostKeyExchangeRequestAsync", method: "RunAsync") + } + + if($1 != nil) + { + let httpUrlResponse = $1 as? HTTPURLResponse + + if(httpUrlResponse != nil) + { + if(httpUrlResponse!.statusCode == 429) + { + AppDelegate.Session.Maintenance = false + AppDelegate.Session.MaintenanceNotified = false + self.responseError(message: Core.Lang.Get(key: "ERROR_TOO_MANY_REQUESTS"), callback: onError) + } + else if (httpUrlResponse!.statusCode == 503) + { + AppDelegate.Session.Maintenance = true + self.responseError(message: Core.Lang.Get(key: "MSG_MAINTENANCE"), callback: onError) + } + else + { + AppDelegate.Session.Maintenance = false + AppDelegate.Session.MaintenanceNotified = false + + if(!Core.Https.Request.validServerHeaders(server: httpUrlResponse!)) + { + self.responseError(message: Core.Lang.Get(key: "ERROR_INVALID_RESPONSE"), callback: onError) + } + else + { + if($0 != nil) + { + self.responsePublicKey(data: $0!, callback: onSuccess) + } + else + { + self.responseError(message: Core.Lang.Get(key: "ERROR_INVALID_RESPONSE"), callback: onError) + } + } + } + } + } + } + + task.resume() + } + } + catch + { + Log.Error(err: error, namespace: "Core.Https.Request.PostKeyExchangeRequestAsync", method: "RunAsync") + } + } + + /** + * Calls OnError Handler with a error message + * + * @param message - error message + * @callback - callback of error response + */ + private func responseError(message: String, callback: ((String)->Void)? = nil) + { + if(callback != nil) + { + callback!(message) + } + } + + /** + * Calls OnSuccess Handler with a PublicKey + * @param publicKey - Public Key of the server + */ + private func responsePublicKey(data: Data, callback: ((Core.Models.Response.PublicKey)->Void)? = nil) + { + if(callback != nil) + { + do + { + let publicKey = try JSONDecoder().decode(Core.Models.Response.PublicKey.self, from: data) + callback!(publicKey) + } + catch + { + Log.Error(err: error, namespace: "Core.Https.Request.PostKeyExchangeRequestAsync", method: "responsePublicKey(data, Callback") + } + } + } + + public func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { +#if DEBUG + completionHandler(.useCredential, URLCredential(trust: challenge.protectionSpace.serverTrust!)) +#else + if(challenge.protectionSpace.host.contains("pba-simulator.patientenbefundapp.labor-limbach-hannover.de")) + { + completionHandler(.useCredential, URLCredential(trust: challenge.protectionSpace.serverTrust!)) + } + else + { + completionHandler(.performDefaultHandling, nil) + } +#endif + } + } + + /** + * Forms a controller action for the request + * @param host - Host of URL + * @param controller - Controller of request + * @param action - Action of Controller, that should be called + * @return returns well formed url for the request + */ + public static func wellFormedControllerAction(host: Servers, controller: String?, action: String?) -> String + { + var result: String = "https://" + host.rawValue; + + if(controller != nil && !controller!.isEmpty) + { + result = result + "/" + controller! + } + + if(action != nil && !action!.isEmpty) + { + result = result + "/" + action! + } + + return result + } + + /** + * Verifies server header + * @param server - server that sends response to the client + * @return returns true if server header and signature are valid + */ + public static func validServerHeaders(server: HTTPURLResponse) -> Bool + { + var result: Bool = false + + let userAgent = server.value(forHTTPHeaderField: "User-Agent") + let contentType = server.value(forHTTPHeaderField: "Content-Type") + let serverHash = server.value(forHTTPHeaderField: "Server-Hash") + let serverKey = server.value(forHTTPHeaderField: "Server-Key") + + if(userAgent != nil && + userAgent == "BefundAppServer" && + contentType != nil && + contentType == "application/json" && + serverHash != nil && + HeaderValueSecureHash == Security.AES.Decrypt(value: serverHash!, deriveKey: SymmetricKey(data: Security.AES.GetKey(password: HeaderSecureHash))) + && serverKey != nil) + { + result = true; + } + + return result + } + + /** + * Validates the server response by signature and HMAC + * + * @param server - server that sends response to the client + * @param encryptedResponse - encrypted response with hmac + * @param deriveKey - derive key with server + * @return returns true if valid + */ + public static func validServerSignature(server: HTTPURLResponse, encryptedResponse: Core.Models.Response.EncryptedResponse, deriveKey: SymmetricKey) -> Bool + { + var result: Bool = false + + let signature = server.value(forHTTPHeaderField: "Server-Signature") + let signatureKey = server.value(forHTTPHeaderField: "Server-Signature-Key") + + if(signature != nil && + !signature!.isEmpty && + signatureKey != nil && + !signatureKey!.isEmpty && + encryptedResponse.ValidSignature(deriveKey: deriveKey, clientSignature: signature!, clientSignatureKey: signatureKey!)) + { + result = true; + } + + return result + } + } + } +} diff --git a/Befund/Core/Https/Servers.swift b/Befund/Core/Https/Servers.swift new file mode 100644 index 0000000..1bdcc37 --- /dev/null +++ b/Befund/Core/Https/Servers.swift @@ -0,0 +1,55 @@ +// +// Servers.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 27.06.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation + +extension Core.Https +{ + public enum Servers : String + { + // Development server + case DEVELOPMENT = "192.168.178.86" + + /** + * HOST´s of productive outside services + */ + case LIS_SIMULATOR = "pba-simulator.patientenbefundapp.labor-limbach-hannover.de:8443" + case LABOR_HEIDELBERG = "patientenbefundapp.labor-limbach.de" + case LABOR_LUDWIGSBURG = "patientenbefundapp.mvz-labor-lb.de" + case LABOR_ULM = "patientenbefundapp.humangenetik-ulm.de" + case LABOR_AACHEN = "patientenbefundapp.labor-aachen.de" + case LABOR_BERLIN = "patientenbefundapp.mdi-limbach-berlin.de" + case LABOR_COTTBUS = "patientenbefundapp.labor-cottbus.de" + case LABOR_DESSAU = "patientenbefundapp.laborpraxis-dessau.de" + case LABOR_DORTMUND = "patientenbefundapp.labor-dortmund.de" + case LABOR_DRESDEN = "patientenbefundapp.labordresden.de" + case LABOR_ERFURT = "patientenbefundapp.labor-erfurt.de" + case LABOR_ESSEN = "patientenbefundapp.labor-eveld.de" + case LABOR_FREIBURG = "patientenbefundapp.mvz-clotten.de" + case LABOR_HANNOVER = "patientenbefundapp.labor-limbach-hannover.de" + case LABOR_HOFHEIM = "patientenbefundapp.labor-hofheim.de" + case LABOR_KARLSRUHE = "patientenbefundapp.laborvolkmann.de" + case LABOR_LEIPZIG = "patientenbefundapp.labor-leipzig.de" + case LABOR_MOENCHENGLADBACH = "patientenbefundapp.labor-stein.de" + case LABOR_MUENCHEN = "patientenbefundapp.labor-limbach-muenchen.de" + case LABOR_MUENSTER = "patientenbefundapp.labor-muenster.de" + case LABOR_NUERBERG = "patientenbefundapp.labor-limbach-nuernberg.de" + case LABOR_PASSAU = "patientenbefundapp.labor-passau.de" + case LABOR_RAVENSBURG = "patientenbefundapp.labor-gaertner.de" + case LABOR_ROSENHEIM = "patientenbefundapp.medlabor.de" + case LABOR_SCHWEINFURT = "patientenbefundapp.laboraerzte-schweinfurt.de" + case LABOR_SCHWERIN = "patientenbefundapp.labor-schwerin.de" + case LABOR_STRALSUND = "patientenbefundapp.labor-stralsund.de" + case LABOR_SUHL = "patientenbefundapp.labor-suhl.de" + case LABOR_KASSEL = "MISSING" + case LABOR_HANNOVER_MLM = "patientenbefundapp.mlh.de" + case LABOR_MAINZ = "patientenbefundapp.medgen-mainz.de" + case LABOR_FRANKFURT = "patientenbefundapp.laborarztpraxis.de" + + } +} diff --git a/Befund/Core/Lang/DE.swift b/Befund/Core/Lang/DE.swift new file mode 100644 index 0000000..ff82b03 --- /dev/null +++ b/Befund/Core/Lang/DE.swift @@ -0,0 +1,227 @@ +// +// DE.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 26.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core.Lang +{ + public class DE + { + /** + * Returns dict of words in german + */ + public static func GetDict() -> NSMutableDictionary + { + let result = NSMutableDictionary() + + //MARK: LABELS + result.setValue("Meine Befunde", forKey: "LBL_MY_RESULTS") + result.setValue("Mein Befund", forKey: "BTN_MY_RESULT") + result.setValue("PLZ", forKey: "LBL_ZIP") + result.setValue("Geb. Datum", forKey: "LBL_BIRTHDAY") + result.setValue("Auftragsnummer", forKey: "LBL_SAMPLEID") + result.setValue("Passwort", forKey: "LBL_PASSWORD") + result.setValue("Passwort bestätigen", forKey: "LBL_PASSWORD_CONFIRM") + result.setValue("Ausstehend", forKey: "LBL_PENDING") + result.setValue("Bereit zum Herunterladen", forKey: "LBL_READY_TO_DOWNLOAD") + result.setValue("Wird heruntergeladen", forKey: "LBL_DOWNLOADING") + result.setValue("Heruntergeladen", forKey: "LBL_ALREADY_DOWNLOAD") + result.setValue("Abgelehnt", forKey: "LBL_REJECTED") + result.setValue("Abgelaufen", forKey: "LBL_EXPIRED") + result.setValue("Sie haben aktuell keinen Befund", forKey: "LBL_NO_RESULTS") + //result.setValue("Altes Passwort", forKey: "LBL_OLD_PASSWORD") + //result.setValue("Support Code", forKey: "LBL_SUPPORT_CODE") + result.setValue( "Datenschutzerklärung", forKey: "LBL_PRIVACY_POLICY") + //result.setValue( "Wird geladen...", forKey: "LBL_DOWNLOADING") + result.setValue( "Wählen Sie Ihr Labor aus", forKey: "LBL_SELECT_LABOR") + result.setValue( "MENU", forKey: "LBL_MENU") + //result.setValue( "Biometrische Authentifizierung", forKey: "LBL_BIOMETRICAL_AUTHENTIFICATION") + //result.setValue( "Fehler", forKey: "LBL_ERROR") + result.setValue( "Aktuelle PIN", forKey: "LBL_PIN") + result.setValue( "Neue PIN", forKey: "LBL_NEW_PIN") + result.setValue( "Neues Passwort", forKey: "LBL_NEW_PASSWORD") + result.setValue( "Meine Patientendaten", forKey: "LBL_OEGD") + result.setValue( "Sie haben Ihre Patientendaten noch nicht erfasst. Wählen Sie das Menü unten aus, um Ihre persönlichen Daten zu erfassen.", forKey: "LBL_NO_OEGD") + result.setValue( "Bitte klicken Sie auf das QR-Code-Symbol, um den QR-Code zu scannen.\n\nDamit wird Ihre App automatisch mit dem passenden Labor verknüpft.", forKey: "LBL_SCAN_QR_CODE") + result.setValue( "Neue Patientendaten", forKey: "LBL_NEW_OEGD") + result.setValue( "Patientendaten bearbeiten", forKey: "LBL_EDIT_OEGD") + result.setValue( "Titel", forKey: "LBL_TITLE") + result.setValue( "Vorname", forKey: "LBL_FIRSTNAME") + result.setValue( "Nachname", forKey: "LBL_LASTNAME") + result.setValue( "Vorsatzwort", forKey: "LBL_NAME_PREFIX") + result.setValue( "Zusatzname", forKey: "LBL_ADDITION_NAME") + result.setValue( "Geschlecht", forKey: "LBL_GENDER") + result.setValue( "Straße", forKey: "LBL_STREET") + result.setValue( "HausNr.", forKey: "LBL_STREET_NUMBER") + result.setValue( "Ort", forKey: "LBL_CITY") + result.setValue( "Männlich", forKey: "LBL_GENDER_M") + result.setValue( "Weiblich", forKey: "LBL_GENDER_W") + result.setValue( "Divers", forKey: "LBL_GENDER_D") + result.setValue( "Unbekannt", forKey: "LBL_GENDER_X") + result.setValue( "Telefon", forKey: "LBL_TELEFON") + result.setValue( "CWA Einverständniserklärung", forKey: "LBL_CWA_POLICY") + result.setValue( "Patientendaten bearbeiten", forKey: "LBL_EDIT_OEGD") + result.setValue( "Sprache", forKey: "LBL_LANGUAGE") + result.setValue( "Aktuelles Passwort", forKey: "LBL_CURRENT_PASSWORD") + //result.setValue( "Einstellungen", forKey: "LBL_SETTINGS") + result.setValue( "Ihr Labor", forKey: "LBL_YOUR_LABOR") + result.setValue( "Verbindung erfolgreich", forKey: "LBL_CONNECTED") + result.setValue( "Verbindung nicht erfolgreich", forKey: "LBL_DISCONNECTED") + + //MARK: BUTTONS + //result.setValue("Neuer Befund", forKey: "BTN_NEW_RESULTS") + result.setValue("Hinzufügen", forKey: "BTN_ADD") + result.setValue("Registrieren", forKey: "BTN_REGISTER") + result.setValue("Weiter", forKey: "BTN_NEXT") + result.setValue("Fertig", forKey: "BTN_DONE") + result.setValue("Abbrechen", forKey: "BTN_CANCEL") + result.setValue("Zurück", forKey: "BTN_BACK") + result.setValue("Entschlüsseln", forKey: "BTN_ENCRYPT") + result.setValue("Löschen", forKey: "BTN_DELETE") + //result.setValue("Übernehmen", forKey: "BTN_TAKE_OVER") + + result.setValue("Einstellungen", forKey: "BTN_SETTINGS") + result.setValue("Passwort ändern", forKey: "BTN_CHANGE_PASSWORD") + //result.setValue("Patientendaten erfassen", forKey: "BTN_OEGD") + result.setValue("Support", forKey: "BTN_SUPPORT") + result.setValue("Schließen", forKey: "BTN_CLOSE") + result.setValue("OK", forKey: "BTN_OK") + result.setValue("FAQ", forKey: "BTN_FAQ") + + result.setValue( "Ich akzeptiere die AGB und \ndie Datenschutzerklärung", forKey: "BTN_ACCEPT_PRIVACY_POLICY") + //result.setValue( "Auswählen", forKey: "BTN_SELECT") + result.setValue( "Login", forKey: "BTN_LOGIN") + result.setValue( "Vergessen", forKey: "BTN_FORGOT") + result.setValue( "Bearbeiten", forKey: "BTN_EDIT") + result.setValue( "Ändern", forKey: "BTN_CHANGE") + result.setValue( "PIN anfordern", forKey: "BTN_PIN_REQUEST") + result.setValue( "Drucken", forKey: "BTN_PRINT") + result.setValue( "Dateifreigabe", forKey: "BTN_FILE_SHARE") + //result.setValue( "Erstellen", forKey: "BTN_CREATE") + result.setValue( "CWA Einverständniserklärung", forKey: "BTN_ACCEPT_CWA_POLICY") + result.setValue( "Nein", forKey: "BTN_NO") + result.setValue( "Ja", forKey: "BTN_YES") + //result.setValue( "Speichern", forKey: "BTN_SAVE") + result.setValue( "Absenden", forKey: "BTN_SEND") + result.setValue( "Support", forKey: "LBL_SUPPORT") + result.setValue( "E-Mail", forKey: "LBL_EMAIL") + //result.setValue( "Text", forKey: "LBL_TEXT") + result.setValue( "Information", forKey: "LBL_SUPPORT_TOPIC_INFO") + result.setValue( "Störung", forKey: "LBL_SUPPORT_TOPIC_TROUBLE") + result.setValue( "Account löschen", forKey: "LBL_SUPPORT_TOPIC_ACCOUNT_DELETE") + result.setValue("App-Benachrichtigungen", forKey: "LBL_PUSH_NOTIFICATION_EXPLAIN_HEADER") + + //result.setValue("Referenznummer", forKey: "LBL_REFERENCE_NUMBER") + + result.setValue("Die Übermittlung eines Befundes ersetzt kein Gespräch mit Ihrem Arzt.", forKey: "LBL_BEFUND_HINWEIS") + + //MARK: ERRORS + result.setValue("Bitte geben Sie die PLZ Ihres Wohnorts ein", forKey: "ERROR_ENTER_ZIP") + result.setValue("Bitte geben Sie Ihr Geburtsdatum ein", forKey: "ERROR_ENTER_BIRTHDAY") + result.setValue("Bitte geben Sie eine Auftragsnummer ein", forKey: "ERROR_ENTER_SAMPLEID") + result.setValue("Bitte geben Sie Ihr persönliches Kennwort ein", forKey: "ERROR_ENTER_PASSWORD") + result.setValue("Das Passwort muss min. 8 Zeichen, darunter min. 1 Großbuchstabe, 1 Kleinbuchstabe, 1 Ziffer und 1 Sonderzeichen enthalten.", forKey: "ERROR_ENTER_STRONG_PASSWORD") + result.setValue("Bitte bestätigen Sie Ihr Kennwort", forKey: "ERROR_CONFIRM_PASSWORD") + result.setValue("Die Passwörter stimmen nicht überein", forKey: "ERROR_PASSWORD_MISMATCH") + result.setValue("Die Daten konnten auf dem Gerät nicht geschrieben werden. Bitte prüfen Sie, ob die Berechtigung zum Datenschreiben erlaubt ist", forKey: "ERROR_COULD_NOT_SAVE") + result.setValue("Leider unterstützt Ihr Gerät keine Verschlüsselung und kann für diese Applikation nicht verwendet werden", forKey: "ERROR_ENCRYPTION_NOT_SUPPORTED") + //result.setValue("Leider ist aktuell der Server nicht erreichbar. Bitte versuchen Sie es später erneut", forKey: "ERROR_SERVER_NOT_REACHABLE") + result.setValue("Bitte geben Sie eine gültige PLZ ein", forKey: "ERROR_ENTER_VALID_ZIP") + result.setValue("Bitte geben Sie ein gültiges Geburtsdatum ein", forKey: "ERROR_ENTER_VALID_BIRTHDAY") + result.setValue("Bitte geben Sie eine gültige Auftragsnummer ein", forKey: "ERROR_ENTER_VALID_SAMPLEID") + result.setValue("Die Antwort vom Server konnte nicht validiert werden. Bitte versuchen Sie es später erneut", forKey: "ERROR_INVALID_RESPONSE") + result.setValue("Der Sicherheitsschlüssel konnte mit dem Server nicht ausgetauscht werden", forKey: "ERROR_KEYS_COULD_NOT_EXCHANGED") + result.setValue("Leider konnte Ihre Anfrage für diesen Auftrag nicht registriert werden", forKey: "ERROR_COULD_NOT_REGISTER_PGS") + result.setValue("Sie haben die Anzahl der maximalen zulässigen offenen Anfragen überschritten. (Max. 10 öffene Anfragen erlaubt)", forKey: "ERROR_MAX_OPENED_REQUEST_LIMIT") + result.setValue("Die von Ihnen eingegebene Auftragsnummer wurde bereits auf einem anderen Gerät registriert. Sollte die App neu installiert worden sein, kann das Problem ebenfalls auftreten. Wenden Sie sich in diesem Fall bitte an den Support (siehe Menü), um an Ihren Befund zu kommen.", forKey: "ERROR_ALREADY_SUBSCRIBTED") + result.setValue("Sie haben in letzter Zeit zu viele Anfragen gesendet. Bitte warten Sie und versuchen Sie es später erneut", forKey: "ERROR_TOO_MANY_REQUESTS") + result.setValue("Das eingegebene Passwort ist ungültig.", forKey: "ERROR_INVALID_PASSWORD") + result.setValue("Der Befund konnte leider nicht heruntergeladen werden. Bitte versuchen Sie es später erneut.", forKey: "ERROR_DOWNLOAD_NOT_FOUND") + result.setValue("Der Befund konnte leider nicht entschlüsselt werden. Bitte versuchen Sie es später erneut.", forKey: "ERROR_COULD_NOT_DECRYPT") + result.setValue("Der Befund konnte nicht gespeichert werden.", forKey: "ERROR_COULD_NOT_SAVE_ENCRYPTED") + result.setValue("Der Befund konnte nicht gelesen werden.", forKey: "ERROR_ENCRYPTED_FILE_NOT_FOUND") + result.setValue("Bitte geben Sie das alte Passwort ein", forKey: "ERROR_ENTER_OLD_PASSWORD") + //result.setValue("Leider konnte der Befund nicht übernommen werden. Bitte wenden Sie sich an unseren Support.", forKey: "ERROR_NOT_AUTHORIZED_TO_TAKE_OVER") + //result.setValue("Bitte wenden Sie sich an unseren Support, um diesen Befund übernehmen zu können.", forKey: "ERROR_SUPPORT_CODE_NEEDED") + //result.setValue("Bitte geben Sie einen Support Code ein. Wenn Sie noch keinen Support Code erhalten haben, wenden Sie sich dafür an unseren Support", forKey: "ERROR_ENTER_SUPPORT_CODE_PASSWORD") + result.setValue( "Bitte lesen Sie unsere AGB und Datenschutzerklärung sorgfältig durch, da diese bei der Benutzung unserer Applikation akzeptiert werden müssen", forKey: "ERROR_ACCEPT_PRIVACY_POLICY") + //result.setValue( "Die Berechtigung für Kamera wurde verweigert", forKey: "ERROR_CAMERA_PERMISSION_DENIED") + //result.setValue( "Die Berechtigung für PUSH-Benachrichtigungen wurde verweigert", forKey: "ERROR_PUSH_PERMISSION_DENIED") + //result.setValue( "Download nicht möglich", forKey: "ERROR_RESULTS_COULD_NOT_DOWNLOADED") + //result.setValue( "QR-Code konnte nicht gelesen werden", forKey: "ERROR_COULD_NOT_READ_QRCODE") + result.setValue( "Die biometrische Authentifizierung konnte nicht aktiviert werden", forKey: "ERROR_BIOMETRICAL_AUTHENTICATION_COULD_NOT_ACTIVATED") + result.setValue( "Bitte geben Sie eine PIN ein", forKey: "ERROR_ENTER_PIN") + result.setValue( "PIN muss aus 5 Ziffern bestehen", forKey: "ERROR_PIN_LENGTH") + result.setValue( "Bitte geben Sie Ihre PIN ein", forKey: "ERROR_ENTER_YOUR_PIN") + result.setValue( "Die von Ihnen eingegebene PIN ist nicht gültig", forKey: "ERROR_INVALID_PASSWORD_RESET_PIN") + result.setValue( "PIN konnte vom Server nicht empfangen werden", forKey: "ERROR_COULD_NOT_GET_PIN") + //result.setValue( "Das Passwort konnte nicht geändert werden", forKey: "ERROR_COULD_NOT_CHANGE_PASSWORD") + result.setValue( "Für einen OEGD-Schein benötigen wir Ihre Einverständniserklärung", forKey: "ERROR_ACCEPT_CWA_POLICY") + result.setValue( "OEGD konnte nicht gespeichert werden", forKey: "ERROR_COULD_NOT_SAVE_OEGD") + result.setValue( "Bitte geben Sie Ihren Vornamen ein", forKey: "ERROR_ENTER_FIRSTNAME") + result.setValue( "Bitte geben Sie Ihren Nachnamen ein", forKey: "ERROR_ENTER_LASTNAME") + result.setValue( "Bitte geben Sie Ihr Geschlecht ein", forKey: "ERROR_ENTER_GENDER") + result.setValue( "Bitte geben Sie die Straße ein", forKey: "ERROR_ENTER_STREET") + result.setValue( "Bitte geben Sie die HausNr. ein", forKey: "ERROR_ENTER_STREET_NUMBER") + result.setValue( "Bitte geben Sie Ihren Wohnort ein", forKey: "ERROR_ENTER_CITY") + + result.setValue( "Bitte geben Sie Ihre E-Mail ein", forKey: "ERROR_ENTER_EMAIL") + result.setValue( "Bitte wählen Sie ein Thema ein", forKey: "ERROR_ENTER_TOPIC") + result.setValue( "Bitte geben Sie den Text ein", forKey: "ERROR_ENTER_TEXT") + + result.setValue("Um unsere Datenschutzerklärung lesen und akzeptieren zu können müssen Sie mit dem Internet verbunden sein", forKey: "ERROR_PRIVACY_POLICY_NEEDS_CONNECTION") + + //MARK: MESSAGES + result.setValue("Die eingegebene Auftragsnummer existiert bereits in Ihrer Liste.", forKey: "MSG_PGS_ALREADY_EXISTS") + result.setValue("Es liegt aktuell noch kein Befund vor. Sie werden per Push-Nachricht informiert, sobald Ihr Befund vorliegt.", forKey: "MSG_PGS_RESPONSE_PENDING") + result.setValue("Vielen Dank, Ihre Anfrage wurde erfolgreich registriert. Wir werden Sie über einen neuen Status zu Ihrem Befund benachrichtigen", forKey: "MSG_PGS_SUCCESSFULLY_CREATED") + result.setValue("Daten werden aktualisiert...", forKey: "MSG_DATA_REFRESHING") + result.setValue("Vielen Dank. Ein Status zu Ihrem Befund ist bereits vorhanden", forKey: "MSG_PGS_ALREADY_AVAILABLE") + //result.setValue("Bitte geben Sie das Passwort von Ihrem alten Gerät ein", forKey: "MSG_ENTER_OLD_PASSWORD") + //result.setValue("Der Befund wurde aus Ihrem alten Gerät erfolgreich übernommen", forKey: "MSG_PGS_SUCCESSFULLY_OVER_TOOK") + result.setValue( "Sie sind noch nicht registriert", forKey: "MSG_YOU_ARE_NOT_REGISTERED") + result.setValue( "Ihr Passwort wurde erfolgreich geändert. Die aktuelle PIN hat aus Sicherheitsgründen ihre Gültigkeit verloren, die neue PIN lautet [PIN]", forKey: "MSG_PASSWORD_HAS_BEEN_CHANGED") + result.setValue( "Möchten Sie den ausgewählten Eintrag([ITEM]) wirklich löschen?", forKey: "MSG_SURE_WANT_DELETE") + result.setValue( "Ihr Passwort wurde erfolgreich geändert. Die aktuelle PIN hat aus Sicherheitsgründen ihre Gültigkeit verloren, die neue PIN lautet [PIN]", forKey: "MSG_PASSWORD_HAS_BEEN_CHANGED") + + result.setValue( "Ihre bisherige PIN wurde erfolgreich angefordert. Sie können nun eine neue PIN und ein neues Passwort vergeben.", forKey: "PIN_HAS_BEEN_REQUESTED") + + result.setValue("Ihr Account wurde erfolgreich gelöscht", forKey: "MSG_ACCOUNT_SUCCESSFULLY_DELETED") + result.setValue("Vielen Dank, Ihre Anfrage wurde erfolgreich versendet", forKey: "MSG_SUPPORT_SUCCESSFULLY_SENT") + result.setValue("Account konnte nicht gelöscht werden. Bitte versuchen Sie später erneut", forKey: "MSG_ACCOUNT_COULD_NOT_DELETED") + result.setValue("Nachricht konnte nicht versendet werden.", forKey: "MSG_SUPPORT_COULD_NOT_SEND") + + result.setValue("Vielen Dank, Ihre Anfrage wird nun bearbeitet. Wir werden Sie über einen neuen Status zu Ihrem Befund benachrichtigen. (Bitte beachten Sie, dass die App dazu die Berechtigung benötigt, Ihnen Nachrichten zu senden.)", forKey: "MSG_PGS_SUCCESSFULLY_CREATED") + + result.setValue("Damit Sie direkt bei Vorliegen Ihres Befundes informiert werden können, ist es wichtig, dass diese App Ihnen Push-Nachrichten senden kann.", forKey: "MSG_PUSH_NOTIFICATION_EXPLAIN_TEXT") + result.setValue("Biometrische Daten sind notwendig um die PIN anzufordern", forKey: "MSG_TOUCHID_INFO") + + result.setValue("Aktuell führen wir Wartungsarbeit durch. Bitte beachten Sie, dass unsere App nur eingeschränkt zur Verfügung steht.", forKey: "MSG_MAINTENANCE") + + result.setValue("Zu den von Ihnen gemachten Angaben konnte kein Auftrag gefunden werden. Bitte überprüfen Sie Ihre Angaben.", forKey: "MSG_REQUESTED_RESULTS_NOT_FOUND") + result.setValue("Ihr Befund konnte im Labor bisher nicht eindeutig zugeordnet werden. Bitte prüfen Sie ihre gemachten Angaben. Sollten Sie trotz korrekter Angaben weiterhin dieses Ergebnis erhalten, wenden Sie sich bitte an den Support.", forKey: "MSG_REQUESTED_RESULTS_REJECTED") + + result.setValue("Datenschutzerklärung", forKey: "LBL_PRIVACY_POLICY") + result.setValue("Beim Besuch unserer Website können ausgewählte.", forKey: "PRIVATE_POLICY_TEXT") + result.setValue("Beim Besuch unserer Website können ausgewählte.", forKey: "CWA_POLICY_TEXT") + + + result.setValue("Ihr Gerät lässt das Scannen von QR-Codes in dieser App nicht zu. Bitte geben Sie in Ihren Einstellungen die Freigabe zur Nutzung der Kamera und nutzen Sie ein Gerät mit einer funktionierenden Kamera.", forKey: "MSG_SCAN_NOT_SUPPORTED") + result.setValue("Scannen nicht unterstützt", forKey: "LBL_SCAN_NOT_SUPPORTED") + + result.setValue("https://www.limbachgruppe.com/fileadmin/downloads/6406135946.html", forKey: "AGB_POLICY_LINK") + + result.setValue("https://www.limbachgruppe.com/fileadmin/downloads/098672600.html", forKey: "FAQ_LINK") + + result.setValue("

Application must be closed.

", forKey: "APP_MUST_BE_CLOSED") + result.setValue(#"

Internet-Verbindung ist notwendig. No AGB.

"#, forKey: "NO_AGB_AVAILABLE") + result.setValue("

Internet-Verbindung ist notwendig. No FAQ.

", forKey: "NO_FAQ_AVAILABLE") + + return result + } + } +} diff --git a/Befund/Core/Lang/EN.swift b/Befund/Core/Lang/EN.swift new file mode 100644 index 0000000..bd75373 --- /dev/null +++ b/Befund/Core/Lang/EN.swift @@ -0,0 +1,181 @@ +// +// EN.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 27.06.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation + +extension Core.Lang +{ + public struct EN + { + /** + * Returns dict of words in english + */ + public static func GetDict() -> NSMutableDictionary + { + let result = NSMutableDictionary() + + //TODO: word have to be translated in english + + //MARK: LABELS + result.setValue("My results", forKey: "LBL_MY_RESULTS") + result.setValue("My result", forKey: "BTN_MY_RESULT") + result.setValue("ZIP", forKey: "LBL_ZIP") + result.setValue("Birthday", forKey: "LBL_BIRTHDAY") + result.setValue("Sample Id", forKey: "LBL_SAMPLEID") + result.setValue("Password", forKey: "LBL_PASSWORD") + result.setValue("Confirm Password", forKey: "LBL_PASSWORD_CONFIRM") + result.setValue("Pending", forKey: "LBL_PENDING") + result.setValue("Ready to Download", forKey: "LBL_READY_TO_DOWNLOAD") + result.setValue("Downloaded", forKey: "LBL_ALREADY_DOWNLOAD") + result.setValue("Rejected", forKey: "LBL_REJECTED") + result.setValue("Expired", forKey: "LBL_EXPIRED") + result.setValue("You currently have no results", forKey: "LBL_NO_RESULTS") + //result.setValue("Old Password", forKey: "LBL_OLD_PASSWORD") + //result.setValue("Support Code", forKey: "LBL_SUPPORT_CODE") + result.setValue( "Privacy Policy", forKey: "LBL_PRIVACY_POLICY") + result.setValue( "Downloading...", forKey: "LBL_DOWNLOADING") + result.setValue( "Select Labor", forKey: "LBL_SELECT_LABOR") + result.setValue( "MENU", forKey: "LBL_MENU") + result.setValue( "Biometrical Authentification", forKey: "LBL_BIOMETRICAL_AUTHENTIFICATION") + //result.setValue( "Error", forKey: "LBL_ERROR") + result.setValue( "PIN", forKey: "LBL_PIN") + result.setValue( "New Password", forKey: "LBL_NEW_PASSWORD") + result.setValue( "OEGD", forKey: "LBL_OEGD") + result.setValue( "You currently have no OEGD", forKey: "LBL_NO_OEGD") + result.setValue( "Scan QR-Code", forKey: "LBL_SCAN_QR_CODE") + result.setValue( "New OEGD", forKey: "LBL_NEW_OEGD") + result.setValue( "Title", forKey: "LBL_TITLE") + result.setValue( "Surname", forKey: "LBL_FIRSTNAME") + result.setValue( "Name", forKey: "LBL_LASTNAME") + result.setValue( "Prefix", forKey: "LBL_NAME_PREFIX") + result.setValue( "Additional Names", forKey: "LBL_ADDITION_NAME") + result.setValue( "Gender", forKey: "LBL_GENDER") + result.setValue( "Street", forKey: "LBL_STREET") + result.setValue( "Nr.", forKey: "LBL_STREET_NUMBER") + result.setValue( "City", forKey: "LBL_CITY") + result.setValue( "Male", forKey: "LBL_GENDER_M") + result.setValue( "Female", forKey: "LBL_GENDER_W") + result.setValue( "Diverse", forKey: "LBL_GENDER_D") + result.setValue( "Unknown", forKey: "LBL_GENDER_X") + result.setValue( "Phone", forKey: "LBL_TELEFON") + result.setValue( "CWA Policy", forKey: "LBL_CWA_POLICY") + result.setValue( "Edit OEGD", forKey: "LBL_EDIT_OEGD") + result.setValue( "Language", forKey: "LBL_LANGUAGE") + result.setValue( "Current Password", forKey: "LBL_CURRENT_PASSWORD") + //result.setValue( "Settings", forKey: "LBL_SETTINGS") + result.setValue( "Your Labor", forKey: "LBL_YOUR_LABOR") + result.setValue( "Connected", forKey: "LBL_CONNECTED") + result.setValue( "Disconnected", forKey: "LBL_DISCONNECTED") + + //MARK: BUTTONS + //result.setValue("New Result", forKey: "BTN_NEW_RESULTS") + result.setValue("Add", forKey: "BTN_ADD") + result.setValue("Register", forKey: "BTN_REGISTER") + result.setValue("Next", forKey: "BTN_NEXT") + result.setValue("Done", forKey: "BTN_DONE") + result.setValue("Cancel", forKey: "BTN_CANCEL") + result.setValue("Back", forKey: "BTN_BACK") + result.setValue("Decrypt", forKey: "BTN_ENCRYPT") + result.setValue("Delete", forKey: "BTN_DELETE") + //result.setValue("Accept", forKey: "BTN_TAKE_OVER") + + result.setValue("Settings", forKey: "BTN_SETTINGS") + result.setValue("Change Password", forKey: "BTN_CHANGE_PASSWORD") + //result.setValue("OEGD", forKey: "BTN_OEGD") + result.setValue("Support", forKey: "BTN_SUPPORT") + result.setValue("Close", forKey: "BTN_CLOSE") + result.setValue("OK", forKey: "BTN_OK") + result.setValue("FAQ", forKey: "BTN_FAQ") + + result.setValue( "I accept the privacy policy", forKey: "BTN_ACCEPT_PRIVACY_POLICY") + //result.setValue( "Select", forKey: "BTN_SELECT") + result.setValue( "Login", forKey: "BTN_LOGIN") + result.setValue( "Forgot password", forKey: "BTN_FORGOT") + result.setValue( "Edit", forKey: "BTN_EDIT") + result.setValue( "Change", forKey: "BTN_CHANGE") + result.setValue( "Request PIN", forKey: "BTN_PIN_REQUEST") + result.setValue( "Print", forKey: "BTN_PRINT") + result.setValue( "Share", forKey: "BTN_FILE_SHARE") + //result.setValue( "Create", forKey: "BTN_CREATE") + result.setValue( "Accept CWA Policy", forKey: "BTN_ACCEPT_CWA_POLICY") + result.setValue( "No", forKey: "BTN_NO") + result.setValue( "Yes", forKey: "BTN_YES") + //result.setValue( "Save", forKey: "BTN_SAVE") + result.setValue( "Send", forKey: "BTN_SEND") + result.setValue( "Support", forKey: "LBL_SUPPORT") + result.setValue( "E-Mail", forKey: "LBL_EMAIL") + //result.setValue( "Text", forKey: "LBL_TEXT") + result.setValue( "Information", forKey: "LBL_SUPPORT_TOPIC_INFO") + result.setValue( "Problem", forKey: "LBL_SUPPORT_TOPIC_TROUBLE") + result.setValue( "Delete Account", forKey: "LBL_SUPPORT_TOPIC_ACCOUNT_DELETE") + + //MARK: ERRORS + result.setValue("Bitte geben Sie die PLZ Ihres Wohnorts ein", forKey: "ERROR_ENTER_ZIP") + result.setValue("Bitte geben Sie Ihr Geburtsdatum ein", forKey: "ERROR_ENTER_BIRTHDAY") + result.setValue("Bitte geben Sie eine Auftragsnummer ein", forKey: "ERROR_ENTER_SAMPLEID") + result.setValue("Bitte geben Sie Ihr persönliches Kennwort ein", forKey: "ERROR_ENTER_PASSWORD") + result.setValue("Leider ist Ihr Kennwort nicht stark genug(Min. 8 Zeichen, 1x Großbuchstabe, 1x Kleinbuchstabe, 1x Ziffer und 1x Sonderzeichen)", forKey: "ERROR_ENTER_STRONG_PASSWORD") + result.setValue("Bitte bestätigen Sie Ihr Kennwort", forKey: "ERROR_CONFIRM_PASSWORD") + result.setValue("Die Passwörter stimmen nicht überein", forKey: "ERROR_PASSWORD_MISMATCH") + result.setValue("Die Daten konnten auf dem Gerät nicht geschrieben werden. Bitte prüfen Sie, ob die Berechtigung zum Datenschreiben erlaubt ist", forKey: "ERROR_COULD_NOT_SAVE") + result.setValue("Leider Ihr Gerät unterstützt keine Verschlüsselung und kann für unsere Applikation nicht verwendet werden", forKey: "ERROR_ENCRYPTION_NOT_SUPPORTED") + result.setValue("Leider ist aktuell der Server nicht erreichbar. Bitte versuchen Sie es später erneut", forKey: "ERROR_SERVER_NOT_REACHABLE") + result.setValue("Bitte geben Sie eine gültige PLZ ein", forKey: "ERROR_ENTER_VALID_ZIP") + result.setValue("Bitte geben Sie ein gültiges Geburtsdatum ein", forKey: "ERROR_ENTER_VALID_BIRTHDAY") + result.setValue("Bitte geben Sie eine gültige Auftragsnummer ein", forKey: "ERROR_ENTER_VALID_SAMPLEID") + result.setValue("Die Antwort vom Server konnte nicht validiert werden. Bitte versuchen Sie es später erneut", forKey: "ERROR_INVALID_RESPONSE") + //result.setValue("Der Sicherheitsschlüssel konnte mit dem Server nicht ausgetauscht werden", forKey: "ERROR_KEYS_COULD_NOT_EXCHANGED") + result.setValue("Leider konnte Ihre Anfrage für diesen Auftrag nicht registriert werden", forKey: "ERROR_COULD_NOT_REGISTER_PGS") + result.setValue("Sie haben die Anzahl der maximalen zulässigen öffenen Anfragen überschritten. (Max. 10 öffene Anfragen erlaubt)", forKey: "ERROR_MAX_OPENED_REQUEST_LIMIT") + result.setValue("Die von Ihnen eingegebene Auftragsnummer wurde bereits auf einem anderen Gerät registriert", forKey: "ERROR_ALREADY_SUBSCRIBTED") + result.setValue("Sie haben in letzter Zeit zu viele Anfragen gesendet. Bitte warten Sie und versuchen Sie es später erneut", forKey: "ERROR_TOO_MANY_REQUESTS") + result.setValue("Das eingegebene Passwort ist ungültig", forKey: "ERROR_INVALID_PASSWORD") + result.setValue("Der Befund konnte leider nicht heruntergeladen werden. Bitte versuchen Sie es später erneut", forKey: "ERROR_DOWNLOAD_NOT_FOUND") + result.setValue("Der Befund konnte leider nicht entschlüsselt werden. Bitte versuchen Sie es später erneut", forKey: "ERROR_COULD_NOT_DECRYPT") + result.setValue("Der Befund konnte nicht gespeichert werden", forKey: "ERROR_COULD_NOT_SAVE_ENCRYPTED") + result.setValue("Der Befund konnte nicht gelesen werden", forKey: "ERROR_ENCRYPTED_FILE_NOT_FOUND") + result.setValue("Please enter your previous password", forKey: "ERROR_ENTER_OLD_PASSWORD") + //result.setValue("Leider konnte der Befund nicht übernommen werden. Bitte wenden Sie sich an unseren Support", forKey: "ERROR_NOT_AUTHORIZED_TO_TAKE_OVER") + //result.setValue("Bitte wenden Sie sich an unseren Support, um diesen Befund übernehmen zu können", forKey: "ERROR_SUPPORT_CODE_NEEDED") + //result.setValue("Please enter a Support Code. If you don't have a Support Code, please contact our hotline.", forKey: "ERROR_ENTER_SUPPORT_CODE_PASSWORD") + + result.setValue("Um unsere Datenschutzerklärung lesen und akzeptieren zu können müssen Sie mit dem Internet verbunden sein", forKey: "ERROR_PRIVACY_POLICY_NEEDS_CONNECTION") + + + result.setValue("Biometrical authentication is necessary to request your PIN", forKey: "MSG_TOUCHID_INFO") + + //MARK: MESSAGES + result.setValue("The number you've entered is already contained in your list.", forKey: "MSG_PGS_ALREADY_EXISTS") + result.setValue("Refreshing...", forKey: "MSG_DATA_REFRESHING") + result.setValue("Vielen Dank. Ein Status zu Ihrem Befund ist bereits vorhanden", forKey: "MSG_PGS_ALREADY_AVAILABLE") + //result.setValue("Please enter the password from your previous device.", forKey: "MSG_ENTER_OLD_PASSWORD") + //result.setValue("Your result was successfully transferred from your old device", forKey: "MSG_PGS_SUCCESSFULLY_OVER_TOOK") + result.setValue("Thank you, your request has been successfully registered. We will notify you of a new status for your finding.", forKey: "MSG_PGS_SUCCESSFULLY_CREATED") + + result.setValue("Account deleted successful", forKey: "MSG_ACCOUNT_SUCCESSFULLY_DELETED") + result.setValue("Your request was sent successfully", forKey: "MSG_SUPPORT_SUCCESSFULLY_SENT") + result.setValue("Account could not be deleted, please try again later", forKey: "MSG_ACCOUNT_COULD_NOT_DELETED") + result.setValue("Request could not be sent", forKey: "MSG_SUPPORT_COULD_NOT_SEND") + + result.setValue("Aktuell führen wir Wartungsarbeit durch. Bitte beachten Sie, dass unsere App nur eingeschränkt zur Verfügung steht.", forKey: "MSG_MAINTENANCE") + + result.setValue("Your device does not support scanning a code from an item. Please use a device with a camera.", forKey: "MSG_SCAN_NOT_SUPPORTED") + result.setValue("Scanning not supported", forKey: "LBL_SCAN_NOT_SUPPORTED") + + result.setValue("https://www.limbachgruppe.com/datenschutz/", forKey: "AGB_POLICY_LINK") + + result.setValue("https://www.limbachgruppe.com/impressum/", forKey: "FAQ_LINK") + + result.setValue("

Application must be closed.

", forKey: "APP_MUST_BE_CLOSED") + result.setValue("

Internet connection is needed. No AGB.

", forKey: "NO_AGB_AVAILABLE") + result.setValue("

Internet connection is needed. No FAQ.

", forKey: "NO_FAQ_AVAILABLE") + + return result + } + } +} diff --git a/Befund/Core/Lang/Lang.swift b/Befund/Core/Lang/Lang.swift new file mode 100644 index 0000000..e24730c --- /dev/null +++ b/Befund/Core/Lang/Lang.swift @@ -0,0 +1,73 @@ +// +// Lang.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 26.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core +{ + public class Lang + { + /** + * Available languages for UI + */ + public enum Languages: Int + { + case DE + case EN + } + + /** + * Default language parameter (German is default) + */ + private static var _locale: String = "de_DE" + private static var _dict: NSMutableDictionary? = nil + + /** + * Sets the languahe + */ + public static func SetLanguage(lang: Core.Lang.Languages) + { + switch(lang) + { + case .DE: + _dict = Core.Lang.DE.GetDict() + _locale = "de_DE" + break + + case .EN: + _dict = Core.Lang.EN.GetDict() + _locale = "en_GB" + break + } + } + + /** + * Returns a translated text for a key + */ + public static func Get(key: String) -> String + { + var result: String = key + + if(_dict != nil) + { + let value = _dict!.value(forKey: key) as? String + + if(value != nil) + { + result = value! + } + } + + return result + } + + public static func GetLocale() -> String + { + return _locale + } + } +} diff --git a/Befund/Core/Log.swift b/Befund/Core/Log.swift new file mode 100644 index 0000000..3a13d88 --- /dev/null +++ b/Befund/Core/Log.swift @@ -0,0 +1,122 @@ +// +// Log.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 30.04.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation + +extension Core +{ + public struct Log + { + /** + * Log types + */ + public enum LogTypes: String + { + case CRITICAL + case ERROR + case INFO + case LOG + case DEBUG + case WARNING + } + + /** + * Initializes the loger context + */ + public static func Initialize() + { + Core.Database.Logs.CreateDBIfNotExists() + } + + /** + * Logs critical error with namespace and method of occurrent + */ + public static func Critical(err: Error, namespace: String, method: String) + { + let message = "(" + namespace + "->" + method + "): " + err.localizedDescription + Write(message: message, type: .CRITICAL) + } + + /** + * Logs critical message with namespace and method of occurrent + */ + public static func Critical(msg: String, namespace: String, method: String) + { + let message = "(" + namespace + "->" + method + "): " + msg + Write(message: message, type: .CRITICAL) + } + + /** + * Logs error with namespace and method of occurrent + */ + public static func Error(err: Error, namespace: String, method: String) + { + let message = "(" + namespace + "->" + method + "): " + err.localizedDescription + Write(message: message, type: .ERROR) + } + + /** + * Logs error message with namespace and method of occurrent + */ + public static func Error(msg: String, namespace: String, method: String) + { + let message = "(" + namespace + "->" + method + "): " + msg + Write(message: message, type: .ERROR) + } + + /** + * Logs info message with namespace and method of occurrent + */ + public static func Info(msg: String, namespace: String, method: String) + { + let message = "(" + namespace + "->" + method + "): " + msg + Write(message: message, type: .INFO) + } + + /** + * Logs debug message with namespace and method of occurrent + */ + public static func Debug(msg: String, namespace: String, method: String) + { + let message = "(" + namespace + "->" + method + "): " + msg + Write(message: message, type: .DEBUG) + } + + /** + * Logs warnings message with namespace and method of occurrent + */ + public static func Warning(msg: String, namespace: String, method: String) + { + let message = "(" + namespace + "->" + method + "): " + msg + Write(message: message, type: .WARNING) + } + + /** + * Writes the log by type in the database + */ + public static func Write(message: String, type: LogTypes) + { + let now = Date() + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + let msg = dateFormatter.string(from: now) + " [" + type.rawValue + "]:" + message + "\r\n"; + + if(type == LogTypes.DEBUG) + { + print(msg) + } + + var dbLog = Core.Database.Log() + dbLog.guid = UUID().uuidString + dbLog.message = msg + dbLog.type = type.rawValue + + Core.Database.Logs.Create(log: dbLog) + } + } +} diff --git a/Befund/Core/Models/.DS_Store b/Befund/Core/Models/.DS_Store new file mode 100644 index 0000000..ff239da Binary files /dev/null and b/Befund/Core/Models/.DS_Store differ diff --git a/Befund/Core/Models/Database/Results.swift b/Befund/Core/Models/Database/Results.swift new file mode 100644 index 0000000..78485b1 --- /dev/null +++ b/Befund/Core/Models/Database/Results.swift @@ -0,0 +1,276 @@ +// +// Results.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 26.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation +import UIKit + +extension Core.Models +{ + public struct Database + { + /** + * Database results object + */ + public struct Results + { + public enum ResultsStatus : String + { + case NONE + case CREATED + case REJECTED + case EXPIRED + case COMPLETED + case DELETED + } + + public var pgs: String? = nil + public var pat_hash: String? = nil + public var available: Bool = false + public var available_ts: String? = nil + public var picked_up: Bool = false + public var picked_up_ts: String? = nil + public var file_checksum: String? = nil + public var status: String? = nil + public var modified: String? = nil + public var created: String? = nil + + public func GetStatus() -> Core.Models.Database.Results.ResultsStatus + { + switch(self.status) + { + case "CREATED": return .CREATED + case "REJECTED": return .REJECTED + case "EXPIRED": return .EXPIRED + case "COMPLETED": return .COMPLETED + case "DELETED": return .DELETED + default: return .NONE + } + } + + /** + * Returns translated status of object + */ + public func GetStatusText() -> String + { + var result: String = Core.Lang.Get(key: "LBL_PENDING") + + if(self.available && self.GetStatus() == .COMPLETED && !self.picked_up) + { + result = Core.Lang.Get(key: "LBL_READY_TO_DOWNLOAD") + } + else if(self.available && self.GetStatus() == .COMPLETED && self.picked_up) + { + result = Core.Lang.Get(key: "LBL_ALREADY_DOWNLOAD") + } + else if(!self.available && self.GetStatus() == .REJECTED) + { + result = Core.Lang.Get(key: "LBL_REJECTED") + } + else if(!self.available && self.GetStatus() == .EXPIRED) + { + result = Core.Lang.Get(key: "LBL_EXPIRED") + } + + return result + } + + /** + * Returns icon of the results status + */ + public func GetStatusIcon() -> UIImage + { + var result: UIImage = UIImage(named: "ic_opacity")! + + if(self.available && self.GetStatus() == .COMPLETED && !self.picked_up) + { + result = UIImage(named: "ic_file_download")! + } + else if(self.available && self.GetStatus() == .COMPLETED && self.picked_up) + { + result = UIImage(named: "ic_picture_as_pdf")! + } + else if(!self.available && self.GetStatus() == .REJECTED) + { + result = UIImage(named: "ic_do_not_disturb_on")! + } + else if(!self.available && self.GetStatus() == .EXPIRED) + { + result = UIImage(named: "ic_av_timer")! + } + + return result + } + + /** + * Returns color of the results status + */ + public func GetStatusColor() -> UIColor + { + var result: UIColor = UIColor(red: 192/255, green: 192/255, blue: 192/255, alpha: 1) + + if(self.available && self.GetStatus() == .COMPLETED && !self.picked_up) + { + result = UIColor(red: 101/255, green: 246/255, blue: 107/255, alpha: 1) + } + else if(self.available && self.GetStatus() == .COMPLETED && self.picked_up) + { + result = UIColor(red: 250/255, green: 138/255, blue: 47/255, alpha: 1) + } + else if(!self.available && self.GetStatus() == .REJECTED) + { + result = UIColor(red: 250/255, green: 46/255, blue: 46/255, alpha: 1) + } + else if(!self.available && self.GetStatus() == .EXPIRED) + { + result = UIColor(red: 250/255, green: 46/255, blue: 46/255, alpha: 1) + } + + return result + } + + /** + * Returns formated modified date + */ + public func GetModified() -> Date? + { + var result: Date? = nil + + let dateFormatter = DateFormatter() + + if(self.modified != nil) + { + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + result = dateFormatter.date(from: self.modified!) + } + + return result + } + + /** + * Returns formated created date + */ + public func GetCreated() -> Date? + { + var result: Date? = nil + + let dateFormatter = DateFormatter() + + if(self.created != nil) + { + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + result = dateFormatter.date(from: self.created!) + } + + return result + } + + /** + * Returns formated available date + */ + public func GetAvailableTS() -> Date? + { + var result: Date? = nil + + let dateFormatter = DateFormatter() + + if(self.available_ts != nil) + { + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + result = dateFormatter.date(from: available_ts!) + } + + return result + } + + /** + * Returns formated pickedup date + */ + public func GetPickedUpTS() -> Date? + { + var result: Date? = nil + + let dateFormatter = DateFormatter() + + if(self.picked_up_ts != nil) + { + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + result = dateFormatter.date(from: self.picked_up_ts!) + } + + return result + } + + /** + * Returns formated modified date as string + */ + public func GetFormatedModifiedDate() -> String? + { + var result: String? = nil + + if(self.modified != nil) + { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd.MM.yyyy HH:mm:ss" + result = dateFormatter.string(from: self.GetModified()!) + } + + return result + } + + /** + * Returns formated created date as string + */ + public func GetFormatedCreatedDate() -> String? + { + var result: String? = nil + + if(self.created != nil) + { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd.MM.yyyy HH:mm:ss" + result = dateFormatter.string(from: self.GetCreated()!) + } + + return result + } + + /** + * Returns formated available date as string + */ + public func GetFormatedAvailableTSDate() -> String? + { + var result: String? = nil + + if(self.available_ts != nil) + { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd.MM.yyyy HH:mm:ss" + result = dateFormatter.string(from: self.GetAvailableTS()!) + } + + return result + } + + /** + * Returns formated picked up date as string + */ + public func GetFormatedPickedUpTSDate() -> String? + { + var result: String? = nil + + if(self.picked_up_ts != nil) + { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd.MM.yyyy HH:mm:ss" + result = dateFormatter.string(from: self.GetPickedUpTS()!) + } + + return result + } + } + } +} diff --git a/Befund/Core/Models/Database/Status.swift b/Befund/Core/Models/Database/Status.swift new file mode 100644 index 0000000..5cf08f1 --- /dev/null +++ b/Befund/Core/Models/Database/Status.swift @@ -0,0 +1,117 @@ +// +// Status.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 27.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core.Models.Database +{ + /** + * Database status of results object + */ + public struct Status: Decodable + { + public var pgs: String? = nil + public var pat_hash: String? = nil + public var available: Bool = false + public var available_ts: String? = nil + public var picked_up: Bool = false + public var picked_up_ts: String? = nil + public var notified: Bool = false + public var notified_ts: String? = nil + public var results_status: String? = Core.Models.Database.Results.ResultsStatus.NONE.rawValue + public var created: String? = nil + + /** + * Returns formated available date + */ + public func GetAvailableTS() -> Date? + { + var result: Date? = nil + + let dateFormatter = DateFormatter() + + if(self.available_ts != nil) + { + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + result = dateFormatter.date(from: available_ts!) + } + + return result + } + + /** + * Returns formated picked up date + */ + public func GetPickedUpTS() -> Date? + { + var result: Date? = nil + + let dateFormatter = DateFormatter() + + if(self.picked_up_ts != nil) + { + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + result = dateFormatter.date(from: self.picked_up_ts!) + } + + return result + } + + /** + * Returns formated notified date + */ + public func GetNotifiedTS() -> Date? + { + var result: Date? = nil + + let dateFormatter = DateFormatter() + + if(self.notified_ts != nil) + { + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + result = dateFormatter.date(from: self.notified_ts!) + } + + return result + } + + /** + * Returns formated created date + */ + public func GetCreated() -> Date? + { + var result: Date? = nil + + let dateFormatter = DateFormatter() + + if(self.created != nil) + { + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + result = dateFormatter.date(from: self.created!) + } + + return result + } + + /** + * Converts status object to the results + */ + public func ToResults() -> Core.Models.Database.Results + { + var result = Core.Models.Database.Results() + result.pgs = self.pgs + result.pat_hash = self.pat_hash + result.available = self.available + result.available_ts = self.available_ts + result.picked_up = self.picked_up + result.picked_up_ts = self.picked_up_ts + result.status = self.results_status + result.created = self.created + return result + } + } +} diff --git a/Befund/Core/Models/Labor.swift b/Befund/Core/Models/Labor.swift new file mode 100644 index 0000000..fa4fc6f --- /dev/null +++ b/Befund/Core/Models/Labor.swift @@ -0,0 +1,476 @@ +// +// Labor.swift +// Befund +// +// Created by Artur Savitskiy on 11.07.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +import UIKit + +extension Core.Models +{ + public class Labor + { + public var id: String = "" + public var name: String = "" + public var street: String = "" + public var city: String = "" + public var zip: String = "" + public var tel: String = "" + public var web: String = "" + public var logo: UIImage! = nil + public var host: Core.Https.Servers = .DEVELOPMENT + /** + * Returns labor by id + * + * @param id - id of labor + * @return Labor object + */ + static func GetLaborByName(id: String) -> Labor + { + var result: Labor = Labor() + + let Labors = Labors() + + for l in Labors + { + if(l.id.lowercased() == id.lowercased()) + { + result = l; + break; + } + } + + return result; + } + + /** + * Returns list of all available labors + */ + static func Labors() -> [Labor] + { + var Labors = [Labor]() + /** QRCode selektor : befund;//labor?id=LABOR_HEIDELBERG **/ + + /** LIS Simulator **/ + let lis_simulator = Labor() + lis_simulator.id = "LIS_SIMULATOR"; + lis_simulator.name = "LIS Simulator"; + lis_simulator.street = "Teststr. 7"; + lis_simulator.city = "Testort"; + lis_simulator.zip = "77777"; + lis_simulator.tel = "+49 77 123 456"; + lis_simulator.web = "pba-simulator.patientenbefundapp.labor-limbach-hannover.de"; + lis_simulator.logo = UIImage(named: "labor_hannover") + lis_simulator.host = .LIS_SIMULATOR; + Labors.append(lis_simulator); + + + /** MVZ Labor Dr. Limbach & Kollegen GbR **/ + let labor_heidelberg = Labor() + labor_heidelberg.id = "LABOR_HEIDELBERG"; + labor_heidelberg.name = "MVZ Labor Dr. Limbach & Kollegen GbR"; + labor_heidelberg.street = "Im Breitspiel 16"; + labor_heidelberg.city = "Heidelberg"; + labor_heidelberg.zip = "69126"; + labor_heidelberg.tel = "+49 6221 3432-0"; + labor_heidelberg.web = "www.labor-limbach.de"; + labor_heidelberg.logo = UIImage(named: "labor_heidelberg") + labor_heidelberg.host = .LABOR_HEIDELBERG; + Labors.append(labor_heidelberg); + + /** MVZ Labor Ludwigsburg GbR **/ + let labor_ludwigsburg = Labor() + labor_ludwigsburg.id = "LABOR_LUDWIGSBURG"; + labor_ludwigsburg.name = "MVZ Labor Ludwigsburg GbR"; + labor_ludwigsburg.street = "Wernerstraße 33"; + labor_ludwigsburg.city = "Ludwigsburg"; + labor_ludwigsburg.zip = "71636"; + labor_ludwigsburg.tel = "+49 7141 966-0"; + labor_ludwigsburg.web = "www.mvz-labor-lb.de"; + labor_ludwigsburg.logo = UIImage(named: "labor_ludwigsburg") + labor_ludwigsburg.host = .LABOR_LUDWIGSBURG; + Labors.append(labor_ludwigsburg); + + /** MVZ Humangenetik Ulm **/ + let labor_ulm = Labor() + labor_ulm.id = "LABOR_ULM"; + labor_ulm.name = "MVZ Humangenetik Ulm"; + labor_ulm.street = "Karlstraße 31-33"; + labor_ulm.city = "Ulm"; + labor_ulm.zip = "89073"; + labor_ulm.tel = "+49 731 850773-0"; + labor_ulm.web = "www.humangenetik-ulm.de"; + labor_ulm.logo = UIImage(named: "labor_ulm") + labor_ulm.host = .LABOR_ULM; + Labors.append(labor_ulm); + + /** MVZ Labor Limbach Aachen **/ + let labor_aachen = Labor() + labor_aachen.id = "LABOR_AACHEN"; + labor_aachen.name = "MVZ Labor Limbach Aachen"; + labor_aachen.street = "Karl-Carstens-Straße 19"; + labor_aachen.city = "Würselen"; + labor_aachen.zip = "52146"; + labor_aachen.tel = "+49 2405 4891-0"; + labor_aachen.web = "www.labor-aachen.de"; + labor_aachen.logo = UIImage(named: "labor_aachen") + labor_aachen.host = .LABOR_AACHEN; + Labors.append(labor_aachen); + + /** MDI Limbach Berlin GmbH **/ + let labor_berlin = Labor() + labor_berlin.id = "LABOR_BERLIN"; + labor_berlin.name = "MDI Limbach Berlin GmbH"; + labor_berlin.street = "Aroser Allee 84"; + labor_berlin.city = "Berlin"; + labor_berlin.zip = "13407"; + labor_berlin.tel = "+49 30 890645-0"; + labor_berlin.web = "www.mdi-limbach-berlin.de"; + labor_berlin.logo = UIImage(named: "labor_berlin") + labor_berlin.host = .LABOR_BERLIN; + Labors.append(labor_berlin); + + /** MVZ Gemeinschaftslabor Cottbus GbR **/ + let labor_cottbus = Labor() + labor_cottbus.id = "LABOR_COTTBUS"; + labor_cottbus.name = "MVZ Gemeinschaftslabor Cottbus GbR"; + labor_cottbus.street = "Uhlandstraße 53"; + labor_cottbus.city = "Cottbus"; + labor_cottbus.zip = "03050"; + labor_cottbus.tel = "+49 355 58402-0"; + labor_cottbus.web = "www.labor-cottbus.de"; + labor_cottbus.logo = UIImage(named: "labor_cottbus") + labor_cottbus.host = .LABOR_COTTBUS; + Labors.append(labor_cottbus); + + /** MVZ Medizinische Labore Dessau Kassel GmbH **/ + let labor_dessau = Labor() + labor_dessau.id = "LABOR_DESSAU"; + labor_dessau.name = "MVZ Medizinische Labore Dessau Kassel GmbH"; + labor_dessau.street = "Bauhüttenstraße 6"; + labor_dessau.city = "Dessau"; + labor_dessau.zip = "06847"; + labor_dessau.tel = "+49 340 54053-0"; + labor_dessau.web = "www.laborpraxis-dessau.de"; + labor_dessau.logo = UIImage(named: "labor_dessau") + labor_dessau.host = .LABOR_DESSAU; + Labors.append(labor_dessau); + + /** MVZ Labor Dortmund Leopoldstraße GmbH **/ + let labor_dortmund = Labor() + labor_dortmund.id = "LABOR_DORTMUND"; + labor_dortmund.name = "MVZ Labor Dortmund Leopoldstraße GmbH"; + labor_dortmund.street = "Leopoldstraße 10"; + labor_dortmund.city = "Dortmund"; + labor_dortmund.zip = "44147"; + labor_dortmund.tel = "+49 231 86027-0"; + labor_dortmund.web = "www.labor-dortmund.de"; + labor_dortmund.logo = UIImage(named: "labor_dortmund") + labor_dortmund.host = .LABOR_DORTMUND; + Labors.append(labor_dortmund); + + /** MVZ Labor Limbach Dresden GbR **/ + let labor_dresden = Labor() + labor_dresden.id = "LABOR_DRESDEN"; + labor_dresden.name = "MVZ Labor Limbach Dresden GbR"; + labor_dresden.street = "Köhlerstraße 14 A"; + labor_dresden.city = "Dresden"; + labor_dresden.zip = "01239"; + labor_dresden.tel = "+49 351 47049-0"; + labor_dresden.web = "www.labordresden.de"; + labor_dresden.logo = UIImage(named: "labor_dresden") + labor_dresden.host = .LABOR_DRESDEN; + Labors.append(labor_dresden); + + /** MVZ Labor Limbach Erfurt GmbH **/ + let labor_erfurt = Labor() + labor_erfurt.id = "LABOR_ERFURT"; + labor_erfurt.name = "MVZ Labor Limbach Erfurt GmbH"; + labor_erfurt.street = "Nordhäuser Straße 74"; + labor_erfurt.city = "Erfurt"; + labor_erfurt.zip = "99089"; + labor_erfurt.tel = "+49 361 781-2701"; + labor_erfurt.web = "www.labor-erfurt.de"; + labor_erfurt.logo = UIImage(named: "labor_erfurt") + labor_erfurt.host = .LABOR_ERFURT; + Labors.append(labor_erfurt); + + /** MVZ Labor Limbach Erfurt GmbH **/ + let labor_essen = Labor() + labor_essen.id = "LABOR_ESSEN"; + labor_essen.name = "MVZ Labor Essen Nienkampstraße GmbH"; + labor_essen.street = "Nienkampstraße 1"; + labor_essen.city = "Essen"; + labor_essen.zip = "45326"; + labor_essen.tel = "+49 201 8379-0"; + labor_essen.web = "www.labor-eveld.de"; + labor_essen.logo = UIImage(named: "labor_essen") + labor_essen.host = .LABOR_ESSEN; + Labors.append(labor_essen); + + /** MVZ Clotten Labor Dr. Haas, Dr. Raif & Kollegen GbR **/ + let labor_freiburg = Labor() + labor_freiburg.id = "LABOR_FREIBURG"; + labor_freiburg.name = "MVZ Clotten Labor Dr. Haas, Dr. Raif & Kollegen GbR"; + labor_freiburg.street = "Merzhauser Straße 112 a"; + labor_freiburg.city = "Freiburg"; + labor_freiburg.zip = "79100"; + labor_freiburg.tel = "+49 761 31905-0"; + labor_freiburg.web = "www.mvz-clotten.de"; + labor_freiburg.logo = UIImage(named: "labor_freiburg") + labor_freiburg.host = .LABOR_FREIBURG; + Labors.append(labor_freiburg); + + /** MVZ Labor Limbach Hannover GbR **/ + let labor_hannover = Labor() + labor_hannover.id = "LABOR_HANNOVER"; + labor_hannover.name = "MVZ Labor Limbach Hannover GbR"; + labor_hannover.street = "Auf den Pohläckern 12"; + labor_hannover.city = "Lehrte"; + labor_hannover.zip = "31275"; + labor_hannover.tel = "+49 5132 8695-0"; + labor_hannover.web = "www.labor-limbach-hannover.de"; + labor_hannover.logo = UIImage(named: "labor_hannover") + labor_hannover.host = .LABOR_HANNOVER; + Labors.append(labor_hannover); + + + /** MVZ Medizinisches Labor Main-Taunus GbR **/ + let labor_hofheim = Labor() + labor_hofheim.id = "LABOR_HOFHEIM"; + labor_hofheim.name = "MVZ Medizinisches Labor Main-Taunus GbR"; + labor_hofheim.street = "Hofheimer Straße 71"; + labor_hofheim.city = "Hofheim"; + labor_hofheim.zip = "65719"; + labor_hofheim.tel = "+49 6192 9924-0"; + labor_hofheim.web = "www.labor-hofheim.de"; + labor_hofheim.logo = UIImage(named: "labor_hofheim") + labor_hofheim.host = .LABOR_HOFHEIM; + Labors.append(labor_hofheim); + + /** MVZ Labor PD Dr. Volkmann und Kollegen GbR **/ + let labor_karlsruhe = Labor() + labor_karlsruhe.id = "LABOR_KARLSRUHE"; + labor_karlsruhe.name = "MVZ Labor PD Dr. Volkmann und Kollegen GbR"; + labor_karlsruhe.street = "Gerwigstraße 67"; + labor_karlsruhe.city = "Karlsruhe"; + labor_karlsruhe.zip = "76131"; + labor_karlsruhe.tel = "+49 721 85000-0"; + labor_karlsruhe.web = "www.laborvolkmann.de"; + labor_karlsruhe.logo = UIImage(named: "labor_karlsruhe") + labor_karlsruhe.host = .LABOR_KARLSRUHE; + Labors.append(labor_karlsruhe); + + /** MVZ Labor Dr. Reising-Ackermann und Kollegen GbR **/ + let labor_leipzig = Labor() + labor_leipzig.id = "LABOR_LEIPZIG"; + labor_leipzig.name = "MVZ Labor Dr. Reising-Ackermann und Kollegen GbR"; + labor_leipzig.street = "Strümpellstraße 40"; + labor_leipzig.city = "Leipzig"; + labor_leipzig.zip = "04289"; + labor_leipzig.tel = "+49 341 6565-100"; + labor_leipzig.web = "www.labor-leipzig.de"; + labor_leipzig.logo = UIImage(named: "labor_leipzig") + labor_leipzig.host = .LABOR_LEIPZIG; + Labors.append(labor_leipzig); + + /** MVZ Dr. Stein + Kollegen GbR **/ + let labor_moenchengladbach = Labor() + labor_moenchengladbach.id = "LABOR_MOENCHENGLADBACH"; + labor_moenchengladbach.name = "MVZ Dr. Stein + Kollegen GbR"; + labor_moenchengladbach.street = "Tomphecke 45"; + labor_moenchengladbach.city = "Mönchengladbach"; + labor_moenchengladbach.zip = "41169"; + labor_moenchengladbach.tel = "+49 2161 8194-0"; + labor_moenchengladbach.web = "www.labor-stein.de"; + labor_moenchengladbach.logo = UIImage(named: "labor_moenchengladbach") + labor_moenchengladbach.host = .LABOR_MOENCHENGLADBACH; + Labors.append(labor_moenchengladbach); + + /** MVZ Labor Limbach München GmbH **/ + let labor_muenchen = Labor() + labor_muenchen.id = "LABOR_MUENCHEN"; + labor_muenchen.name = "MVZ Labor Limbach München GmbH"; + labor_muenchen.street = "Richard-Strauss-Straße 80 – 82"; + labor_muenchen.city = "München"; + labor_muenchen.zip = "81679"; + labor_muenchen.tel = "+49 89 9992970-0"; + labor_muenchen.web = "www.labor-limbach-muenchen.de"; + labor_muenchen.logo = UIImage(named: "labor_muenchen") + labor_muenchen.host = .LABOR_MUENCHEN; + Labors.append(labor_muenchen); + + /** MVZ Labor Münster Hafenweg GmbH **/ + let labor_muenster = Labor() + labor_muenster.id = "LABOR_MUENSTER"; + labor_muenster.name = "MVZ Labor Münster Hafenweg GmbH"; + labor_muenster.street = "Hafenweg 9 – 11"; + labor_muenster.city = "Münster"; + labor_muenster.zip = "48155"; + labor_muenster.tel = "+49 251 60916-0"; + labor_muenster.web = "www.labor-muenster.de"; + labor_muenster.logo = UIImage(named: "labor_muenster") + labor_muenster.host = .LABOR_MUENSTER; + Labors.append(labor_muenster); + + /** MVZ Labor Limbach Nürnberg GmbH **/ + let labor_nuernberg = Labor() + labor_nuernberg.id = "LABOR_NUERBERG"; + labor_nuernberg.name = "MVZ Labor Limbach Nürnberg GmbH"; + labor_nuernberg.street = "Handwerkerweg 1"; + labor_nuernberg.city = "Wendelstein"; + labor_nuernberg.zip = "90530"; + labor_nuernberg.tel = "+49 9129 90570-0"; + labor_nuernberg.web = "www.labor-limbach-nuernberg.de"; + labor_nuernberg.logo = UIImage(named: "labor_nuernberg") + labor_nuernberg.host = .LABOR_NUERBERG; + Labors.append(labor_nuernberg); + + /** MVZ Labor Passau GbR **/ + let labor_passau = Labor() + labor_passau.id = "LABOR_PASSAU"; + labor_passau.name = "MVZ Labor Passau GbR"; + labor_passau.street = "Wörth 15"; + labor_passau.city = "Passau"; + labor_passau.zip = "94034"; + labor_passau.tel = "+49 851 9593-00"; + labor_passau.web = "www.labor-passau.de"; + labor_passau.logo = UIImage(named: "labor_passau") + labor_passau.host = .LABOR_PASSAU; + Labors.append(labor_passau); + + /** MVZ Labor Ravensburg GbR **/ + let labor_ravensburg = Labor() + labor_ravensburg.id = "LABOR_RAVENSBURG"; + labor_ravensburg.name = "MVZ Labor Ravensburg GbR"; + labor_ravensburg.street = "Elisabethenstraße 11"; + labor_ravensburg.city = "Ravensburg"; + labor_ravensburg.zip = "88212"; + labor_ravensburg.tel = "+49 751 502-0"; + labor_ravensburg.web = "www.labor-gaertner.de"; + labor_ravensburg.logo = UIImage(named: "labor_ravensburg") + labor_ravensburg.host = .LABOR_RAVENSBURG; + Labors.append(labor_ravensburg); + + /** Medizinisches Labor Rosenheim MVZ GbR **/ + let labor_rosenheim = Labor() + labor_rosenheim.id = "LABOR_ROSENHEIM"; + labor_rosenheim.name = "Medizinisches Labor Rosenheim MVZ GbR"; + labor_rosenheim.street = "Brückenstraße 1"; + labor_rosenheim.city = "Rosenheim"; + labor_rosenheim.zip = "83022"; + labor_rosenheim.tel = "+49 8031 8005-0"; + labor_rosenheim.web = "www.medlabor.de"; + labor_rosenheim.logo = UIImage(named: "labor_rosenheim") + labor_rosenheim.host = .LABOR_ROSENHEIM; + Labors.append(labor_rosenheim); + + /** MVZ Labor Schweinfurt GmbH **/ + let labor_schweinfurt = Labor() + labor_schweinfurt.id = "LABOR_SCHWEINFURT"; + labor_schweinfurt.name = "MVZ Labor Schweinfurt GmbH"; + labor_schweinfurt.street = "Gustav-Adolf-Straße 8"; + labor_schweinfurt.city = "Schweinfurt"; + labor_schweinfurt.zip = "97422"; + labor_schweinfurt.tel = "+49 9721 533320"; + labor_schweinfurt.web = "www.laboraerzte-schweinfurt.de"; + labor_schweinfurt.logo = UIImage(named: "labor_schweinfurt") + labor_schweinfurt.host = .LABOR_SCHWEINFURT; + Labors.append(labor_schweinfurt); + + /** Labor MVZ Westmecklenburg GbR **/ + let labor_schwerin = Labor() + labor_schwerin.id = "LABOR_SCHWERIN"; + labor_schwerin.name = "Labor MVZ Westmecklenburg GbR"; + labor_schwerin.street = "Ellerried 5 – 7"; + labor_schwerin.city = "Schwerin"; + labor_schwerin.zip = "19061"; + labor_schwerin.tel = "+49 385 64424-0"; + labor_schwerin.web = "www.labor-schwerin.de"; + labor_schwerin.logo = UIImage(named: "labor_schwerin") + labor_schwerin.host = .LABOR_SCHWERIN; + Labors.append(labor_schwerin); + + /** MVZ Labor Limbach Vorpommern-Rügen GmbH **/ + let labor_stralsrund = Labor() + labor_stralsrund.id = "LABOR_STRALSUND"; + labor_stralsrund.name = "MVZ Labor Limbach Vorpommern-Rügen GmbH"; + labor_stralsrund.street = "Große-Parower-Straße 47-53"; + labor_stralsrund.city = "Stralsund"; + labor_stralsrund.zip = "18435"; + labor_stralsrund.tel = "+49 3831 668770"; + labor_stralsrund.web = "www.labor-stralsund.de"; + labor_stralsrund.logo = UIImage(named: "labor_stralsrund") + labor_stralsrund.host = .LABOR_STRALSUND; + Labors.append(labor_stralsrund); + + /** MVZ Gemeinschaftslabor Suhl Dr. Siegmund & Kollegen GbR **/ + let labor_suhl = Labor() + labor_suhl.id = "LABOR_SUHL"; + labor_suhl.name = "MVZ Gemeinschaftslabor Suhl Dr. Siegmund & Kollegen GbR"; + labor_suhl.street = "Albert-Schweitzer-Straße 4"; + labor_suhl.city = "Suhl"; + labor_suhl.zip = "98527"; + labor_suhl.tel = "+49 3681 39860"; + labor_suhl.web = "www.labor-suhl.de"; + labor_suhl.logo = UIImage(named: "labor_suhl") + labor_suhl.host = .LABOR_SUHL; + Labors.append(labor_suhl); + + /** MVZ Medizinische Labore Dessau Kassel GmbH **/ + let labor_kassel = Labor() + labor_kassel.id = "LABOR_KASSEL"; + labor_kassel.name = "MVZ Medizinische Labore Dessau Kassel GmbH"; + labor_kassel.street = "Marburger Straße 85"; + labor_kassel.city = "Kassel"; + labor_kassel.zip = "34127"; + labor_kassel.logo = UIImage(named: "labor_kassel") + labor_kassel.host = .LABOR_KASSEL; + Labors.append(labor_kassel); + + /** MVZ Medizinisches Labor Hannover **/ + let labor_hannover_mlh = Labor() + labor_hannover_mlh.id = "LABOR_HANNOVER_MLM"; + labor_hannover_mlh.name = "MVZ Medizinisches Labor Hannover"; + labor_hannover_mlh.street = "Am TÜV 6"; + labor_hannover_mlh.city = "Hannover"; + labor_hannover_mlh.zip = "30519"; + labor_hannover_mlh.tel = "+49 511 85622-0"; + labor_hannover_mlh.web = "www.mlh.de"; + labor_hannover_mlh.logo = UIImage(named: "labor_hannover_mlh") + labor_hannover_mlh.host = .LABOR_HANNOVER_MLM; + Labors.append(labor_hannover_mlh); + + /** Medizinische Genetik Mainz **/ + let labor_mainz = Labor() + labor_mainz.id = "LABOR_MAINZ"; + labor_mainz.name = "Medizinische Genetik Mainz"; + labor_mainz.street = "Haifa-Allee 38"; + labor_mainz.city = "Mainz"; + labor_mainz.zip = "55128"; + labor_mainz.tel = "+49 6131 27661-0"; + labor_mainz.web = "www.medgen-mainz.de"; + labor_mainz.logo = UIImage(named: "labor_mainz") + labor_mainz.host = .LABOR_MAINZ; + Labors.append(labor_mainz); + + /** Laborarztpraxis Rhein-Main MVZ GbR **/ + let labor_frankfurt = Labor() + labor_frankfurt.id = "LABOR_FRANKFURT"; + labor_frankfurt.name = "Laborarztpraxis Rhein-Main MVZ GbR"; + labor_frankfurt.street = "Berner Straße 117"; + labor_frankfurt.city = "Frankfurt"; + labor_frankfurt.zip = "60437"; + labor_frankfurt.tel = "+49 69 669003-900"; + labor_frankfurt.web = "www.laborarztpraxis.de"; + labor_frankfurt.logo = UIImage(named: "labor_frankfurt") + labor_frankfurt.host = .LABOR_FRANKFURT; + Labors.append(labor_frankfurt); + + return Labors; + } + } +} diff --git a/Befund/Core/Models/Models.swift b/Befund/Core/Models/Models.swift new file mode 100644 index 0000000..c436019 --- /dev/null +++ b/Befund/Core/Models/Models.swift @@ -0,0 +1,13 @@ +// +// Models.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 15.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core +{ + public class Models{} +} diff --git a/Befund/Core/Models/OEGD.swift b/Befund/Core/Models/OEGD.swift new file mode 100644 index 0000000..a161a3b --- /dev/null +++ b/Befund/Core/Models/OEGD.swift @@ -0,0 +1,92 @@ +// +// OEGD.swift +// Befund +// +// Created by Artur Savitskiy on 08.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +extension Core.Models +{ + public class OEGD : Encodable, Decodable + { + public var last_name: String + public var first_name: String + public var birthdate: String + public var gender: String + public var title: String + public var name_addition: String + public var prefix: String + public var address: Address + public var cwa_consent_flag: Bool + public var phone: String + + init() + { + self.last_name = "" + self.first_name = "" + self.birthdate = "" + self.gender = "" + self.title = "" + self.name_addition = "" + self.prefix = "" + self.address = Address.createInstance() + self.cwa_consent_flag = false + self.phone = "" + + } + + public class Address : Encodable, Decodable + { + public var zip_code: String = "" + public var city: String = "" + public var street_number: String = "" + public var country_code: String = "" + + public static func createInstance() -> Address + { + return Address() + } + } + + /** + * Returns Birthday from settings + * @return returns Date + */ + public func GetBirthday() -> Date? + { + var result: Date? = nil + + if(self.birthdate.count>0) + { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd" + result = dateFormatter.date(from: self.birthdate) + } + + return result; + } + + /** + * Returns Birthday as string from settings + * @return returns string + */ + public func GetFormatedBirthday() -> String? + { + var result: String? = nil + + let date = self.GetBirthday() + + if(date != nil) + { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd.MM.yyyy" + result = dateFormatter.string(from: date!) + + } + + return result; + } +} +} diff --git a/Befund/Core/Models/OEGDFile.swift b/Befund/Core/Models/OEGDFile.swift new file mode 100644 index 0000000..f9ceb83 --- /dev/null +++ b/Befund/Core/Models/OEGDFile.swift @@ -0,0 +1,16 @@ +// +// OEGDFile.swift +// Befund +// +// Created by Artur Savitskiy on 08.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +extension Core.Models +{ + public struct OEGDFile + { + public var OEGD: OEGD + public var filename: String + } +} diff --git a/Befund/Core/Models/Request/.DS_Store b/Befund/Core/Models/Request/.DS_Store new file mode 100644 index 0000000..b70f87b Binary files /dev/null and b/Befund/Core/Models/Request/.DS_Store differ diff --git a/Befund/Core/Models/Request/ChangeVerificatorHash.swift b/Befund/Core/Models/Request/ChangeVerificatorHash.swift new file mode 100644 index 0000000..4525992 --- /dev/null +++ b/Befund/Core/Models/Request/ChangeVerificatorHash.swift @@ -0,0 +1,131 @@ +// +// ChangeVerificatorHash.swift +// Befund +// +// Created by Artur Savitskiy on 02.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// +import Foundation + +extension Core.Models.Request +{ + public class ChangeVerificatorHash : Encodable, Decodable + { + public var udid: String? = nil + public var old_verificator_hash: String? = nil + public var new_verificator_hash: String? = nil + public var pin: String? = nil + } + + public class ChangeVerificatorHashProvider + { + private static let password_policy = "^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!+@$%^&<>*~:`-]).{8,}$" + + public static func IsPasswordStrong(password: String) -> Bool + { + return NSPredicate(format: "SELF MATCHES %@", password_policy).evaluate(with: password) + } + + public static func GetDecryptedOldPasswordByPassword(settings: Core.Models.Settings, oldPassword: String) -> String? + { + let oldPassAESKey=Core.Security.AES.GetKey(password: oldPassword) + let oldPwdDecryptedKey = Core.Security.AES.Decrypt(value: (settings.hashed_private_key ?? ""), password: String( decoding: oldPassAESKey, as: UTF8.self)) + return oldPwdDecryptedKey + } + + public static func GetDecryptedOldPasswordByPin(settings: Core.Models.Settings, pin: String) -> String? + { + let oldPassAESKey=Core.Security.AES.GetKey(password: (settings.password_reset_hash ?? "") + pin) + let oldPwdDecryptedKey = Core.Security.AES.Decrypt(value: (settings.password_hash ?? ""), password: String(decoding: oldPassAESKey, as: UTF8.self)) + return oldPwdDecryptedKey + } + + public static func PrepareChangeVerificatorHash(settings: Core.Models.Settings, oldPassword: String, newPassword: String, newPin: String) -> Core.Models.Request.ChangeVerificatorHash + { + + let oldPassAESKey=Core.Security.AES.GetKey(password: oldPassword) + let newPassAESkey = Core.Security.AES.GetKey(password: newPassword) + + let changeVerificatorHash = Core.Models.Request.ChangeVerificatorHash() + + changeVerificatorHash.old_verificator_hash = settings.verificator_hash + + changeVerificatorHash.new_verificator_hash = Core.Security.SHA512.HMAC(message: Core.Security.SHA512.VerificatorHashingValue.data(using: .utf8)!, key: String(decoding: newPassAESkey, as: UTF8.self)) + + changeVerificatorHash.udid = settings.udid + + changeVerificatorHash.pin = newPin // String(Int.random(in: 10000..<99999)) + + let results = Core.Database.Results.GetResults() + + if(results != nil && results!.count>0) + { + for res in results! + { + + let file = Core.System.GetPathForStorageEncryptedFile(filename: res.pgs!) + + if(file != nil && Core.System.FileExists(atPath: file!)) + { + let encrypted_content = Core.System.ReadFromEncryptedStorage(filename: res.pgs!) + + if(!encrypted_content!.isEmpty) + { + let decrypted_content = Core.Security.AES.Decrypt( + value: String (decoding: encrypted_content!, as: UTF8.self), + password: String(decoding: oldPassAESKey, as: UTF8.self)) + + if(decrypted_content != nil) + { + let local_encrypted = Core.Security.AES.Encrypt( + value: decrypted_content!, + password: String(decoding: newPassAESkey, as: UTF8.self)) + + if(local_encrypted != nil) + { + Core.System.WriteToEncryptedStorage(filename: res.pgs!, data: local_encrypted!.data(using: .utf8)!) + } + } + } + } + } + } + + return changeVerificatorHash + } + + public static func SaveChangedVerificatorBySuccess(settings: Core.Models.Settings, oldPassword: String, newPassword: String, pin: String, errorMsg: inout String?) -> Core.Models.Settings? + { + let oldPassAESKey=Core.Security.AES.GetKey(password: oldPassword) + let newPassAESkey = Core.Security.AES.GetKey(password: newPassword) + let decrypted_private_key = Core.Security.AES.Decrypt(value: (settings.hashed_private_key ?? ""), password: String( decoding: oldPassAESKey, as: UTF8.self)) + + settings.password_reset_hash = NSUUID().uuidString + + let pwdPlus = (settings.password_reset_hash ?? "") + pin + + let passwordHashKey = Core.Security.AES.GetKey(password: pwdPlus) + + settings.password_hash = Core.Security.AES.Encrypt(value: newPassword, password: String(decoding: passwordHashKey, as: UTF8.self)) + + settings.verificator_hash = Core.Security.SHA512.HMAC( + message: Core.Security.SHA512.VerificatorHashingValue.data(using: .utf8)!, + key: String(decoding: newPassAESkey, as: UTF8.self)) + + settings.hashed_private_key = Core.Security.AES.Encrypt(value: decrypted_private_key!, password: String(decoding: newPassAESkey, as: UTF8.self)) + + if(!settings.save(atPath: Core.System.SettingsPath())) + { + errorMsg = Core.Lang.Get(key: "ERROR_COULD_NOT_SAVE") + return settings + } + else + { + errorMsg = nil + return Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + } + } + } +} + + diff --git a/Befund/Core/Models/Request/CheckFileChecksum.swift b/Befund/Core/Models/Request/CheckFileChecksum.swift new file mode 100644 index 0000000..72476af --- /dev/null +++ b/Befund/Core/Models/Request/CheckFileChecksum.swift @@ -0,0 +1,20 @@ +// +// CheckFileChecksum.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 26.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +extension Core.Models.Request +{ + public class CheckFileChecksum : Encodable, Decodable + { + public var pgs: String? = nil + public var udid: String? = nil + public var device_token: String? = nil + public var device_type = 1 + public var client_public_key: String? = nil + public var verificator_hash: String? = nil + public var file_checksum: String? = nil + } +} diff --git a/Befund/Core/Models/Request/EncryptedRequest.swift b/Befund/Core/Models/Request/EncryptedRequest.swift new file mode 100644 index 0000000..9863f60 --- /dev/null +++ b/Befund/Core/Models/Request/EncryptedRequest.swift @@ -0,0 +1,130 @@ +// +// EncryptedRequest.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 15.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation +import CryptoKit + +extension Core.Models.Request +{ + public class EncryptedRequest : Encodable, Decodable + { + /** + * Request types + */ + public enum Types + { + case REQUEST_KEY_EXCHANGE + case REQUEST_ENCRYPTED_REQUEST + case REQUEST_SUBSCRIBE + case REQUEST_GET_OPENED + case REQUEST_CHECKSUM + case REQUEST_VERIFICATOR_HASH + case REQUEST_SUPPORT + case REQUEST_GET_PIN + } + + public var descriptor: String! + public var encrypted_content: String? = nil + public var hmac: String? = nil + + /** + * Constructor for EncryptedRequest + * + * @param descriptor - descriptor of the content object + * @param contentObject - content object that should be encrypted + * @param requestType - type of request for JSON Encodeer + * @param deriveKey - shared deriveKey that should be used in the encrption + */ + init(descriptor: String, contentObject: Any?, requestType: Types, key: CryptoKit.SymmetricKey) + { + var encrypted_content: String? = nil; + + do + { + if(contentObject != nil) + { + var data: Data? = nil + let encoder = JSONEncoder() + + switch(requestType) + { + case .REQUEST_KEY_EXCHANGE: + data = try encoder.encode(contentObject as! Core.Models.Request.KeyExchange) + break + + case .REQUEST_SUBSCRIBE: + data = try encoder.encode(contentObject as! Core.Models.Request.Subscribe) + break + + case .REQUEST_ENCRYPTED_REQUEST: + data = try encoder.encode(contentObject as! Core.Models.Request.EncryptedRequest) + break; + + case .REQUEST_CHECKSUM: + data = try encoder.encode(contentObject as! Core.Models.Request.CheckFileChecksum) + break; + + case .REQUEST_GET_OPENED: + data = try encoder.encode(contentObject as! Core.Models.Request.GetOpened) + break; + + case .REQUEST_VERIFICATOR_HASH: + data = try encoder.encode(contentObject as! Core.Models.Request.ChangeVerificatorHash) + break; + + case .REQUEST_SUPPORT: + data = try encoder.encode(contentObject as! Core.Models.Request.Support) + break; + + case .REQUEST_GET_PIN: + data = try encoder.encode(contentObject as! Core.Models.Request.GetPIN) + break; + + + } + + if(data != nil) + { + encrypted_content = String(data: data!, encoding: .utf8) + } + } + + self.Encrypt(descriptor: descriptor, encrypted_content: encrypted_content, key: key) + } + catch + { + Core.Log.Error(err: error, namespace: "Core.Models.EncryptedRequest", method: "init(String, Any?, Types, SymmetricKey)") + } + } + + /** + * Encrypts the content of request with derive key + * + * @param descriptor - descriptor of object + * @param encrypted_content - content that should be encrypted + * @param deriveKey - derive key that should be used for the encryption + */ + public func Encrypt(descriptor: String, encrypted_content: String?, key: CryptoKit.SymmetricKey) + { + self.descriptor = Core.Security.AES.Encrypt(value: descriptor, deriveKey: key) + + if(encrypted_content != nil) + { + self.encrypted_content = Core.Security.AES.Encrypt(value: encrypted_content!, deriveKey: key) + + if(self.encrypted_content != nil) + { + self.hmac = Core.Security.SHA512.HMAC(message: self.encrypted_content!.data(using: .utf8)!, key: key) + } + } + else + { + self.hmac = Core.Security.SHA512.HMAC(message: self.descriptor!.data(using: .utf8)!, key: key) + } + } + } +} diff --git a/Befund/Core/Models/Request/GetOpened.swift b/Befund/Core/Models/Request/GetOpened.swift new file mode 100644 index 0000000..b1f5e9b --- /dev/null +++ b/Befund/Core/Models/Request/GetOpened.swift @@ -0,0 +1,15 @@ +// +// CheckFileChecksum.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 26.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +extension Core.Models.Request +{ + public class GetOpened : Encodable, Decodable + { + public var udid: String? = nil + public var verificator_hash: String? = nil + } +} diff --git a/Befund/Core/Models/Request/GetPIN.swift b/Befund/Core/Models/Request/GetPIN.swift new file mode 100644 index 0000000..fa79099 --- /dev/null +++ b/Befund/Core/Models/Request/GetPIN.swift @@ -0,0 +1,15 @@ +// +// GetPIN.swift +// Befund +// +// Created by Artur Savitskiy on 04.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// +extension Core.Models.Request +{ + public class GetPIN : Encodable, Decodable + { + public var udid: String? = nil + public var verificator_hash: String? = nil + } +} diff --git a/Befund/Core/Models/Request/KeyExchange.swift b/Befund/Core/Models/Request/KeyExchange.swift new file mode 100644 index 0000000..ea14eb6 --- /dev/null +++ b/Befund/Core/Models/Request/KeyExchange.swift @@ -0,0 +1,19 @@ +// +// KeyExchange.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 15.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core.Models +{ + public struct Request + { + public class KeyExchange : Encodable, Decodable + { + public var key_type: String = "PublicKey" + } + } +} diff --git a/Befund/Core/Models/Request/Subscribe.swift b/Befund/Core/Models/Request/Subscribe.swift new file mode 100644 index 0000000..cbcae9f --- /dev/null +++ b/Befund/Core/Models/Request/Subscribe.swift @@ -0,0 +1,34 @@ +// +// Subscribe.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 15.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core.Models.Request +{ + public class Subscribe : Encodable, Decodable + { + public var pgs: String? = nil + public var pgs_hash: String? = nil + public var udid: String? = nil + public var device_token: String? = nil + public var device_type = 1 + public var client_public_key: String? = nil + public var verificator_hash: String? = nil + public var pin: String? = nil + + /** + * Converts subscribe request object to the database results object + */ + public func ToResults() -> Core.Models.Database.Results + { + var result = Core.Models.Database.Results() + result.pgs = self.pgs + result.status = Core.Models.Database.Results.ResultsStatus.NONE.rawValue + return result + } + } +} diff --git a/Befund/Core/Models/Request/Support.swift b/Befund/Core/Models/Request/Support.swift new file mode 100644 index 0000000..fb1aeb7 --- /dev/null +++ b/Befund/Core/Models/Request/Support.swift @@ -0,0 +1,21 @@ +// +// Support.swift +// Befund +// +// Created by Artur Savitskiy on 04.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +extension Core.Models.Request +{ + public class Support : Encodable, Decodable + { + public var udid: String? = nil + public var verificator_hash: String? = nil + public var email: String? = nil + public var topic: String? = nil + public var text: String? = nil + public var delete_device: Bool = false + } +} + diff --git a/Befund/Core/Models/Response/Download.swift b/Befund/Core/Models/Response/Download.swift new file mode 100644 index 0000000..4706f01 --- /dev/null +++ b/Befund/Core/Models/Response/Download.swift @@ -0,0 +1,17 @@ +// +// Download.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 28.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core.Models.Response +{ + struct Download : Encodable, Decodable + { + public var encrypted_content: String? = nil + public var server_public_key: String? = nil + } +} diff --git a/Befund/Core/Models/Response/EncryptedResponse.swift b/Befund/Core/Models/Response/EncryptedResponse.swift new file mode 100644 index 0000000..cc02e9e --- /dev/null +++ b/Befund/Core/Models/Response/EncryptedResponse.swift @@ -0,0 +1,104 @@ +// +// EncryptedResponse.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 15.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation +import CryptoKit + +extension Core.Models.Response +{ + public class EncryptedResponse : Encodable, Decodable + { + public var descriptor: String! + public var encrypted_content: String? = nil + public var hmac: String? = nil + + public func Decrypt(key: CryptoKit.SymmetricKey) -> Any? + { + var result: Any? = nil + + do + { + self.descriptor = Core.Security.AES.Decrypt(value: self.descriptor, deriveKey: key) + + if(self.descriptor != nil && self.encrypted_content != nil) + { + self.encrypted_content = Core.Security.AES.Decrypt(value: self.encrypted_content!, deriveKey: key) + + if(self.encrypted_content != nil) + { + let data : Data? = self.encrypted_content!.data(using: .utf8) + + if(data != nil) + { + let decoder = JSONDecoder() + + if(self.descriptor.lowercased() == "success") + { + result = try decoder.decode(Core.Models.Response.Success.self, from: data!) + } + else if(self.descriptor!.lowercased() == "responseexception") + { + result = try decoder.decode(Core.Models.Response.Exception.self, from: data!) + } + else if(self.descriptor!.lowercased() == "list") + { + result = try decoder.decode([Core.Models.Database.Status].self, from: data!) + } + else if(self.descriptor!.lowercased() == "download") + { + result = try decoder.decode(Core.Models.Response.Download.self, from: data!) + } + else if(self.descriptor!.lowercased() == "pin") + { + result = try decoder.decode(Core.Models.Response.PIN.self, from: data!) + } + + } + } + } + } + catch + { + Core.Log.Error(err: error, namespace: "Core.Models.Response.EncryptedResponse", method: "Decrypt(SymmetricKey)") + } + + return result; + } + + /** + * Validates the encrypted request by HMAC and Ed25519 + * + * @param deriveKey - shared derive key, that should be used for the HMAC Authentification + * @param clientSignature - client signature, that should be verified + * @param clientSignatureKey - client public signature key, that was used in client signature + * @return returns true if request is valid + */ + public func ValidSignature(deriveKey: SymmetricKey, clientSignature: String, clientSignatureKey: String) -> Bool + { + if(self.encrypted_content != nil && !self.encrypted_content!.isEmpty) + { + return + // Validate over HMAC + (self.hmac != nil && !self.hmac!.isEmpty && + Core.Security.SHA512.isValidAuthenticationCode(hmac: self.hmac!, message: self.encrypted_content!.data(using: .utf8)!, key: deriveKey) && + + //Validate over Ed25519 + Core.Security.Curve25519.CheckValid(signature: Core.Security.Base64.FromBase64String(base64: clientSignature)!, message: self.encrypted_content!.data(using: .utf8)!, publicKey: Core.Security.Base64.FromBase64String(base64: clientSignatureKey)!)) + } + else + { + return + // Validate over HMAC + (self.hmac != nil && !self.hmac!.isEmpty && + Core.Security.SHA512.isValidAuthenticationCode(hmac: self.hmac!, message: self.descriptor.data(using: .utf8)!, key: deriveKey) && + + //Validate over Ed25519 + Core.Security.Curve25519.CheckValid(signature: Core.Security.Base64.FromBase64String(base64: clientSignature)!, message: self.descriptor.data(using: .utf8)!, publicKey: Core.Security.Base64.FromBase64String(base64: clientSignatureKey)!)) + } + } + } +} diff --git a/Befund/Core/Models/Response/Exception.swift b/Befund/Core/Models/Response/Exception.swift new file mode 100644 index 0000000..1be1cef --- /dev/null +++ b/Befund/Core/Models/Response/Exception.swift @@ -0,0 +1,35 @@ +// +// Exception.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 26.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core.Models.Response +{ + struct Exception : Encodable, Decodable + { + public var error_type: Int = Exception.Types.NONE + public var message: String? = nil + + /** + * Type of response exception + */ + struct Types + { + public static let NONE: Int = 0 + public static let InvalidClient: Int = 1000 + public static let InvalidRequest: Int = 1001 + public static let MissingArgument: Int = 1002 + public static let InvalidArgument: Int = 1003 + public static let Unknown: Int = 1004 + public static let AlreadySubscribted: Int = 1005 + public static let NotAuthorized: Int = 1007 + public static let MaxOpenedRequestLimit: Int = 1008 + public static let NotAvailable: Int = 1009 + public static let WrongFileChecksum: Int = 1010 + } + } +} diff --git a/Befund/Core/Models/Response/PIN.swift b/Befund/Core/Models/Response/PIN.swift new file mode 100644 index 0000000..744795f --- /dev/null +++ b/Befund/Core/Models/Response/PIN.swift @@ -0,0 +1,17 @@ +// +// PIN.swift +// Befund +// +// Created by Artur Savitskiy on 04.08.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation + +extension Core.Models.Response +{ + struct PIN : Encodable, Decodable + { + public var code: String? = nil + } +} diff --git a/Befund/Core/Models/Response/PublicKey.swift b/Befund/Core/Models/Response/PublicKey.swift new file mode 100644 index 0000000..c7ccdcf --- /dev/null +++ b/Befund/Core/Models/Response/PublicKey.swift @@ -0,0 +1,19 @@ +// +// PublicKey.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 15.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core.Models +{ + public struct Response + { + public class PublicKey : Encodable, Decodable + { + public var key: String? = nil + } + } +} diff --git a/Befund/Core/Models/Response/Success.swift b/Befund/Core/Models/Response/Success.swift new file mode 100644 index 0000000..19f52e6 --- /dev/null +++ b/Befund/Core/Models/Response/Success.swift @@ -0,0 +1,16 @@ +// +// Success.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 26.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core.Models.Response +{ + struct Success : Encodable, Decodable + { + public var message: String? = nil + } +} diff --git a/Befund/Core/Models/Session.swift b/Befund/Core/Models/Session.swift new file mode 100644 index 0000000..e420759 --- /dev/null +++ b/Befund/Core/Models/Session.swift @@ -0,0 +1,23 @@ +// +// Session.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 23.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core.Models +{ + public struct Session + { + public var NotificationGranted: Bool = false + public var CameraGranted: Bool = false + public var Device: Core.Models.System.Device? = nil + public var DevicePassword: String! = nil +// public var PushExplained: Bool = false +// public var PushAccepted: Bool = false + public var Maintenance: Bool = false + public var MaintenanceNotified: Bool = true + } +} diff --git a/Befund/Core/Models/Settings.swift b/Befund/Core/Models/Settings.swift new file mode 100644 index 0000000..8e31d2a --- /dev/null +++ b/Befund/Core/Models/Settings.swift @@ -0,0 +1,244 @@ +// +// Settings.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 29.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core.Models +{ + public class Settings + { + public var public_key: String? = nil + public var hashed_private_key: String? = nil + public var verificator_hash: String? = nil + public var password_hash: String? = nil + public var password_reset_hash: String? = nil + public var zip: String? = nil + public var birthday: String? = nil + public var udid: String? = nil + public var lang: Core.Lang.Languages = Core.Lang.Languages.DE + public var labor: Core.Models.Labor? = nil + public var pushNotificationExplained: Bool = false + public var pushNotificationAccepted: Bool = false + public var policyAGBExplained: Bool = false + + /** + * Loads settings from the file + */ + public static func loadFromFile(atPath: String) -> Core.Models.Settings? + { + var result: Core.Models.Settings? = nil + + if(Core.System.FileExists(atPath: atPath)) + { + let dic = NSMutableDictionary(contentsOfFile: atPath) + + if(dic != nil) + { + result = Core.Models.Settings() + + let public_key = dic!.value(forKey: "public_key") + + if(public_key != nil) + { + result!.public_key = public_key as? String + } + + let hashed_private_key = dic!.value(forKey: "hashed_private_key") + + if(hashed_private_key != nil) + { + result!.hashed_private_key = hashed_private_key as? String + } + + let verificator_hash = dic!.value(forKey: "verificator_hash") + + if(verificator_hash != nil) + { + result!.verificator_hash = verificator_hash as? String + } + + let password_hash = dic!.value(forKey: "password_hash") + + if(password_hash != nil) + { + result!.password_hash = password_hash as? String + } + + let password_reset_hash = dic!.value(forKey: "password_reset_hash") + + if(password_reset_hash != nil) + { + result!.password_reset_hash = password_reset_hash as? String + } + + + let zip = dic!.value(forKey: "zip") + + if(zip != nil) + { + result!.zip = zip as? String + } + + let birthday = dic!.value(forKey: "birthday") + + if(birthday != nil) + { + result!.birthday = birthday as? String + } + + let udid = dic!.value(forKey: "udid") + + if(udid != nil) + { + result!.udid = udid as? String + } + + let lang = dic!.value(forKey: "lang") as? String + switch(lang) + { + case "EN": + result!.lang = Core.Lang.Languages.EN + break; + default: + result!.lang = Core.Lang.Languages.DE + break; + + } + + let labor_id = dic!.value(forKey: "labor") + if(labor_id != nil) + { + result!.labor = Core.Models.Labor.GetLaborByName(id: (labor_id as? String)!) + } + else + { + result!.labor = nil //Core.Models.Labor.GetLaborByName(id: "LABOR_HANNOVER") + } + //result!.labor!.host = .LABOR_HANNOVER + + + let pushExplained = dic!.value(forKey: "push_explained") + if (pushExplained != nil) + { + result?.pushNotificationExplained = ((pushExplained as? NSNumber)!).boolValue + } + else + { + result?.pushNotificationExplained = false + } + + let pushAccepted = dic!.value(forKey: "push_accepted") + if (pushAccepted != nil) + { + result?.pushNotificationAccepted = ((pushAccepted as? NSNumber)!).boolValue + } + else + { + result?.pushNotificationAccepted = false + } + + let AGBAccepted = dic!.value(forKey: "agb_accepted") + if (AGBAccepted != nil) + { + result?.policyAGBExplained = ((AGBAccepted as? NSNumber)!).boolValue + } + else + { + result?.policyAGBExplained = false + } + + //let host = dic!.value(forKey: "host") + + //if(host != nil) + //{ + //result!.host = Core.Https.Servers(rawValue: host as! String)! + //} + //result!.host = .LABOR_HANNOVER + } + } + + //if(result != nil && + // (result!.public_key == nil || result!.hashed_private_key == nil || result!.verificator_hash == nil)) + //{ + // result = nil + //} + + return result + } + + /** + * Saves the settings to the file + */ + public func save(atPath: String) -> Bool + { + let dic = NSMutableDictionary() + dic.setValue(self.public_key, forKey: "public_key") + dic.setValue(self.hashed_private_key, forKey: "hashed_private_key") + dic.setValue(self.verificator_hash, forKey: "verificator_hash") + dic.setValue(self.password_hash, forKey: "password_hash") + dic.setValue(self.password_reset_hash, forKey: "password_reset_hash") + dic.setValue(self.zip, forKey: "zip") + dic.setValue(self.birthday, forKey: "birthday") + dic.setValue(self.udid, forKey: "udid") + dic.setValue((self.lang == Core.Lang.Languages.DE ? "DE": "EN"), forKey: "lang") + dic.setValue(self.labor?.id, forKey: "labor") + dic.setValue(self.pushNotificationExplained, forKey: "push_explained") + dic.setValue(self.pushNotificationAccepted, forKey: "push_accepted") + dic.setValue(self.policyAGBExplained, forKey: "agb_accepted") + + dic.write(toFile: atPath, atomically: true) + + return Core.System.FileExists(atPath: atPath) + } + + /** + * Returns formated birthday as date + */ + public func GetBirthday() -> Date? + { + var result: Date? = nil + + if(self.birthday != nil) + { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd" + result = dateFormatter.date(from: self.birthday!) + } + + return result; + } + + /** + * Returns formated birthday as string + */ + public func GetFormatedBirthday() -> String? + { + var result: String? = nil + + let date = self.GetBirthday() + + if(date != nil) + { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd.MM.yyyy" + result = dateFormatter.string(from: date!) + } + + return result + } + + /** + * Sets the birthday to the settings + */ + public func SetBirthday(date: Date) + { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd" + self.birthday = dateFormatter.string(from: date) + } + } +} diff --git a/Befund/Core/Models/System/Device.swift b/Befund/Core/Models/System/Device.swift new file mode 100644 index 0000000..e09f62b --- /dev/null +++ b/Befund/Core/Models/System/Device.swift @@ -0,0 +1,24 @@ +// +// Device.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 21.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core.Models +{ + public struct System + { + public struct Device + { + public var udid: String? = nil + public var name: String? = nil + public var model: String? = nil + public var manufacturer: String? = nil + public var os: String? = nil + public var token: String? = nil + } + } +} diff --git a/Befund/Core/Models/System/StorageInfo.swift b/Befund/Core/Models/System/StorageInfo.swift new file mode 100644 index 0000000..b80c4e0 --- /dev/null +++ b/Befund/Core/Models/System/StorageInfo.swift @@ -0,0 +1,33 @@ +// +// StorageInfo.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 21.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core.Models.System +{ + public struct StorageInfo + { + public var total: Double = 0.0 + public var free: Double = 0.0 + public var used: Double = 0.0 + + /** + * Returns storage info as percent + */ + public func GetStoragePercent() -> Double + { + if(self.free > 0.0 && self.total > 0.0) + { + return (self.free / self.total) + } + else + { + return 0.0 + } + } + } +} diff --git a/Befund/Core/Security/AES.swift b/Befund/Core/Security/AES.swift new file mode 100644 index 0000000..0be5fe3 --- /dev/null +++ b/Befund/Core/Security/AES.swift @@ -0,0 +1,160 @@ +// +// AES.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 29.04.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation +import CryptoKit + +extension Core.Security +{ + public class AES + { + public static let PGS_ENCRYPT_PARTIAL_KEY = "wA6j@x.CcmM>~5Ss^C_!#,zch)$YsDsd59,::>dW#F`@U]Ye5ETZcMT7}&+#*!%z" + /** + * Encrypts string with password (string) + * + * @param value - string value that should be encrypted + * @param password - string password that should be used for encryption(max. 32 bytes) + * @return - returns encrypted base64 string + */ + static func Encrypt(value: String, password: String) -> String? + { + var result: String? = nil + + do + { + let key = SymmetricKey(data: GetKey(password: password)) + let data = value.data(using: .utf8) + + if(data != nil) + { + let encrypted = try CryptoKit.AES.GCM.seal(data!, using: key) + result = encrypted.combined!.base64EncodedString() + } + } + catch + { + Core.Log.Error(err: error, namespace: "Core.Security.AES", method: "Encrypt(string, string)") + } + + return result + } + + /** + * Encrypts string with key + * + * @param value - string value that should be encrypted + * @param deriveKey - shared deriveKey that should be used for encryption(max. 32 bytes) + * @return - returns encrypted base64 string + */ + static func Encrypt(value: String, deriveKey: CryptoKit.SymmetricKey) -> String? + { + var result: String? = nil + + do + { + let data = value.data(using: .utf8) + + if(data != nil) + { + let encrypted = try CryptoKit.AES.GCM.seal(data!, using: deriveKey) + result = Base64.ToBase64String(data: encrypted.combined!) + } + } + catch + { + Core.Log.Error(err: error, namespace: "Core.Security.AES", method: "Encrypt(String, SymmetricKey)") + } + + return result + } + + /** + * Decrypts encrypted base64 string with key + * + * @param value - base64 string that should be decrypted + * @param deriveKey - key that should be used for the decryption(max. 32 bytes) + * @return + */ + static func Decrypt(value: String, deriveKey: CryptoKit.SymmetricKey) -> String? + { + var result: String? = nil + + do + { + let data = Data(base64Encoded: value) + + if(data != nil) + { + let sealedData = try CryptoKit.AES.GCM.SealedBox(combined: data!) + let decryptedData = try CryptoKit.AES.GCM.open(sealedData, using: deriveKey) + result = String(data: decryptedData, encoding: .utf8) + } + } + catch + { + result = nil + } + + return result + } + + /** + * Decrypts encrypted base64 string with password(string) + * + * @param value - base64 string that should be decrypted + * @param password - string password that should be used for the decryption(max. 32 bytes) + * @return + */ + static func Decrypt(value: String, password: String) -> String? + { + var result: String? = nil + + do + { + let key = SymmetricKey(data: GetKey(password: password)) + let data = Data(base64Encoded: value) + + if(data != nil) + { + let sealedData = try CryptoKit.AES.GCM.SealedBox(combined: data!) + let decryptedData = try CryptoKit.AES.GCM.open(sealedData, using:key) + result = String(data: decryptedData, encoding: .utf8) + } + } + catch let error + { + Core.Log.Error(err: error, namespace: "AES", method: "Decrypt") + result = nil + } + + return result + } + + /** + * Converts the text passed password to the 32 byte array + * + * @param password - Text based password + * @return returns password as byte array + */ + static func GetKey(password: String) -> Data + { + if(password.count < 32) + { + return password.padding(toLength: 32, withPad: "@", startingAt: 0).data(using: .ascii)! + } + else if(password.count > 32) + { + return MD5.Encrypt(value: password).data(using: .ascii)! + } + else + { + return password.data(using: .ascii)! + } + } + } +} + diff --git a/Befund/Core/Security/Base64.swift b/Befund/Core/Security/Base64.swift new file mode 100644 index 0000000..a5dab75 --- /dev/null +++ b/Befund/Core/Security/Base64.swift @@ -0,0 +1,38 @@ +// +// Base64.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 29.04.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +import CryptoKit + +extension Core.Security +{ + public class Base64 + { + /** + * Converts byte array to the base64 String + * + * @param data - byte array that should be converted in to base64 string + * @return returns base64 String + */ + static func ToBase64String(data: Data) -> String + { + return data.base64EncodedString() + } + + /** + * Converts base64 string in to byte array + * + * @param base64 - base64 String, that should be converted in to byte array + * @return returns byte array + */ + static func FromBase64String(base64: String) -> Data? + { + return Data(base64Encoded: base64) + } + } +} diff --git a/Befund/Core/Security/Curve25519.swift b/Befund/Core/Security/Curve25519.swift new file mode 100644 index 0000000..c50657e --- /dev/null +++ b/Befund/Core/Security/Curve25519.swift @@ -0,0 +1,140 @@ +// +// Curve25519.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 29.04.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation +import CryptoKit + +extension Core.Security +{ + public struct Curve25519 + { + /** + * Generates the KeyPair with Private & Public Keys + * + * @return returns KeyPair with Public & Private Keys(incl. Signing Private & Public Keys) + */ + static func GenerateKeyPair() -> KeyPair + { + let result: KeyPair = KeyPair() + + let privateKey = CryptoKit.Curve25519.KeyAgreement.PrivateKey() + let publicKey = privateKey.publicKey + + let signingPrivateKey = CryptoKit.Curve25519.Signing.PrivateKey() + let signingPublicKey = signingPrivateKey.publicKey + + result.PrivateKey = privateKey.rawRepresentation.base64EncodedString() + result.PublicKey = publicKey.rawRepresentation.base64EncodedString() + + result.SigningPrivateKey = signingPrivateKey.rawRepresentation.base64EncodedString() + result.SigningPublicKey = signingPublicKey.rawRepresentation.base64EncodedString() + + return result + } + + /* + * Creates KeyPair by private & public keys(base64 encoded) + */ + static func CreateKeyPair(_privateKey: String, _publicKey: String) -> KeyPair + { + let result: KeyPair = KeyPair() + + let privateKey = try! CryptoKit.Curve25519.KeyAgreement.PrivateKey(rawRepresentation: Data(base64Encoded: _privateKey)!) + let publicKey = try! CryptoKit.Curve25519.KeyAgreement.PublicKey(rawRepresentation: Data(base64Encoded: _publicKey)!) + + let signingPrivateKey = CryptoKit.Curve25519.Signing.PrivateKey() + let signingPublicKey = signingPrivateKey.publicKey + + result.PrivateKey = privateKey.rawRepresentation.base64EncodedString() + result.PublicKey = publicKey.rawRepresentation.base64EncodedString() + result.SigningPrivateKey = signingPrivateKey.rawRepresentation.base64EncodedString() + result.SigningPublicKey = signingPublicKey.rawRepresentation.base64EncodedString() + + return result + } + + /** + * Validates a ED25519 Signature with message and public key of sender + * + * @param signature - signature that should be validated + * @param message - message that was signed + * @param publicKey - public key that was used by sender for the message to sign it + * @return returns true if valid + */ + static func CheckValid(signature: Data, message: Data, publicKey: Data) -> Bool + { + let key = try! CryptoKit.Curve25519.Signing.PublicKey(rawRepresentation: publicKey) + return key.isValidSignature(signature, for: message) + } + + /** + * KeyPair with Private & Public Key and Signature Keys + */ + public class KeyPair + { + public var PrivateKey: String! + public var PublicKey: String! + public var SigningPublicKey: String! + public var SigningPrivateKey: String! + + public func GetSignature(signingValue: String) -> String? + { + var result: String? = nil + + do + { + let signingData = signingValue.data(using: .utf8)! + let privateKeyRaw: Data? = Data(base64Encoded: self.SigningPrivateKey!) + let privateKey = try! CryptoKit.Curve25519.Signing.PrivateKey(rawRepresentation: privateKeyRaw!) + result = try privateKey.signature(for: signingData).base64EncodedString() + } + catch + { + Core.Log.Error(err: error, namespace: "Core.Security.Curve25519.KeyPair", method: "GetSignature(String)") + } + + return result + } + + /** + * Returns a shared key with the public key + * + * @peerPublicKeyBase64 - Public key of peer in base64 string format + * @return returns shared key as byte array + */ + public func GetSharedKey(peerPublicKeyBase64: String?) -> CryptoKit.SymmetricKey? + { + var result: CryptoKit.SymmetricKey? = nil + + if(peerPublicKeyBase64 != nil) + { + let privateKeyRaw: Data? = Data(base64Encoded: self.PrivateKey!) + + if(privateKeyRaw != nil) + { + let privateKey = try! CryptoKit.Curve25519.KeyAgreement.PrivateKey(rawRepresentation: privateKeyRaw!) + + let peerPublicKeyRaw: Data? = Data(base64Encoded: peerPublicKeyBase64!) + + if(peerPublicKeyRaw != nil) + { + let peerPublicKey = try! CryptoKit.Curve25519.KeyAgreement.PublicKey(rawRepresentation: peerPublicKeyRaw!) + + let sharedSecret = try! privateKey.sharedSecretFromKeyAgreement(with: peerPublicKey) + + let protocolSalt = "" + + result = sharedSecret.hkdfDerivedSymmetricKey(using: CryptoKit.SHA512.self, salt: protocolSalt.data(using: .ascii)!, sharedInfo: Data(), outputByteCount: 32) + } + } + } + + return result + } + } + } +} diff --git a/Befund/Core/Security/MD5.swift b/Befund/Core/Security/MD5.swift new file mode 100644 index 0000000..945fb50 --- /dev/null +++ b/Befund/Core/Security/MD5.swift @@ -0,0 +1,45 @@ +// +// MD5.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 29.04.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation +import CryptoKit + +extension Core.Security +{ + public class MD5 + { + /** + * Encrypts the given String in to MD5 Hash + * + * @param value - String that should be converted in to MD5 hash String + * @return returns MD5 String + */ + static func Encrypt(value: String) -> String + { + let digest = Insecure.MD5.hash(data: value.data(using: .utf8) ?? Data()) + + return digest.map { + String(format: "%02hhx", $0) + }.joined() + } + + /** + * Encrypts the given byte array in to MD5 Hash + * + * @param value - byte array that should be converted in to MD5 hash String + * @return returns MD5 String + */ + static func Encrypt(value : Data) -> String + { + let digest = Insecure.MD5.hash(data: value) + + return digest.map { + String(format: "%02hhx", $0) + }.joined() + } + } +} diff --git a/Befund/Core/Security/SHA512.swift b/Befund/Core/Security/SHA512.swift new file mode 100644 index 0000000..fed0789 --- /dev/null +++ b/Befund/Core/Security/SHA512.swift @@ -0,0 +1,87 @@ +// +// SHA512.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 29.04.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +// + +import Foundation +import CryptoKit + +extension Core.Security +{ + public class SHA512 + { + public static let VerificatorHashingValue = "U{u)DT~!CV@y9P8U4#,T%KY~D>YRj388" + + /** + * Encrypts a string value in SHA512 hash + * + * @param value - string value that should be encrypted in SHA512 hash + * @return - Returns SHA512 hash + */ + static func Encrypt(value: String) -> String + { + let digest = CryptoKit.SHA512.hash(data: value.data(using: .utf8) ?? Data()) + + return digest.map { + String(format: "%02hhx", $0) + }.joined() + } + + /** + * Encrypts a byte array in SHA512 hash + * + * @param value - byte array that should be encrypted in SHA512 hash + * @return - Returns SHA512 hash + */ + static func Encrypt(data: Data) -> String + { + let digest = CryptoKit.SHA512.hash(data: data) + + return digest.map { + String(format: "%02hhx", $0) + }.joined() + } + + /** + * Generates SHA512 HMAC Hash with key + * + * @param message - message that should be signed by sha512 hmac + * @param key - key that should be used for signing + * @return returns SHA512 HMAC + */ + static func HMAC(message: Data, key: SymmetricKey) -> String + { + let signature = CryptoKit.HMAC.authenticationCode(for: message, using: key) + return Data(signature).map { String(format: "%02hhx", $0) }.joined() + } + + /** + * Generates SHA512 HMAC Hash with key + * + * @param message - message that should be signed by sha512 hmac + * @param key - key that should be used for signing + * @return returns SHA512 HMAC + */ + static func HMAC(message: Data, key: String) -> String + { + let symmetricKey = CryptoKit.SymmetricKey(data: key.data(using: .utf8)!) + return SHA512.HMAC(message: message, key: symmetricKey) + } + + /** + * Validates HMAC with message and key + * + * @param hmac - HMAC from the partner + * @param message - message that should be signed by sha512 hmac + * @param key - key that should be used for signing + * @return returns true if success + */ + static func isValidAuthenticationCode(hmac: String, message: Data, key: SymmetricKey) -> Bool + { + return (hmac == self.HMAC(message: message, key: key)) + } + } +} diff --git a/Befund/Core/Security/Security.swift b/Befund/Core/Security/Security.swift new file mode 100644 index 0000000..1cf8920 --- /dev/null +++ b/Befund/Core/Security/Security.swift @@ -0,0 +1,13 @@ +// +// Security.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 29.04.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation + +extension Core +{ + public class Security {} +} diff --git a/Befund/Core/System.swift b/Befund/Core/System.swift new file mode 100644 index 0000000..9bb1138 --- /dev/null +++ b/Befund/Core/System.swift @@ -0,0 +1,565 @@ +// +// System.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 21.05.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import Foundation +import UIKit +import CoreImage.CIFilterBuiltins + +extension Core +{ + public struct System + { + /** + * Returns application directory path + */ + public static func ApplicationDirectoryPath() -> String + { + return NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] + } + + /** + * Returns settings path + */ + public static func SettingsPath() -> String + { + return ApplicationDirectoryPath() + "/settings.plist" + } + + /** + * Returns storage directory path + */ + public static func StorageDirectoryPath() -> String? + { + var result: String? = ApplicationDirectoryPath() + "/storage" + let fileManager = FileManager.default + + do + { + var isDir:ObjCBool = true + + if(!fileManager.fileExists(atPath: result!, isDirectory: &isDir)) + { + try fileManager.createDirectory(atPath: result!, withIntermediateDirectories: true) + } + + if(!fileManager.fileExists(atPath: result!, isDirectory: &isDir)) + { + result = nil + } + } + catch + { + result = nil + Log.Critical(err: error, namespace: "Core.System", method: "StorageDirectoryPath") + } + + return result + } + + /** + * Returns encrypted storage directory path + */ + public static func EncryptedStorageDirectoryPath() -> String? + { + var result: String? = nil + + do + { + let storagePath = StorageDirectoryPath() + + if(storagePath != nil) + { + result = storagePath! + "/encrypted" + + let fileManager = FileManager.default + + var isDir:ObjCBool = true + + if(!fileManager.fileExists(atPath: result!, isDirectory: &isDir)) + { + try fileManager.createDirectory(atPath: result!, withIntermediateDirectories: true) + } + + if(!fileManager.fileExists(atPath: result!, isDirectory: &isDir)) + { + result = nil + } + } + } + catch + { + result = nil + Log.Critical(err: error, namespace: "Core.System", method: "EncryptedStorageDirectoryPath") + } + + return result + } + + /** + * Returns databases directory path + */ + public static func DatabaseDirectoryPath() -> String? + { + var result: String? = ApplicationDirectoryPath() + "/databases" + let fileManager = FileManager.default + + do + { + var isDir:ObjCBool = true + + if(!fileManager.fileExists(atPath: result!, isDirectory: &isDir)) + { + try fileManager.createDirectory(atPath: result!, withIntermediateDirectories: true) + } + + if(!fileManager.fileExists(atPath: result!, isDirectory: &isDir)) + { + result = nil + } + } + catch + { + result = nil + Log.Critical(err: error, namespace: "Core.System", method: "DatabaseDirectoryPath") + } + + return result + } + + /** + * Returns logs database path + */ + public static func LogsDatabasePath() -> String? + { + var result: String? = nil + + let dbDirectory = DatabaseDirectoryPath() + + if(dbDirectory != nil) + { + result = dbDirectory! + "/logs.db" + } + + return result + } + + /** + * Returns results database path + */ + public static func ResultsDatabasePath() -> String? + { + var result: String? = nil + + let dbDirectory = DatabaseDirectoryPath() + + if(dbDirectory != nil) + { + result = dbDirectory! + "/results.db" + } + + return result + } + + /** + * Checks if file exists + * + * @param atPath - filepath that should be checked if exists + */ + public static func FileExists(atPath: String) -> Bool + { + let fileManager = FileManager.default + return fileManager.fileExists(atPath: atPath) + } + + /** + * Deletes file at the path + * + * @param atPath - file that should be deleted + */ + public static func DeleteFile(atPath: String) -> Bool + { + var result = false + + do + { + let fileManager = FileManager.default + try fileManager.removeItem(atPath: atPath) + + result = !FileExists(atPath: atPath) + } + catch + { + Log.Critical(err: error, namespace: "Core.System", method: "DeleteFile(string)") + } + + return result + } + + /** + * Writes content to the file + * + * @param filename - filename where the content should be written + * @param data - data of content + */ + public static func WriteToStorage(filename: String, data: Data) -> Bool + { + var result = false + + do + { + let storageDirectory = StorageDirectoryPath() + + if(storageDirectory != nil) + { + let filePath = storageDirectory! + "/" + filename + let fileURL = URL.init(fileURLWithPath: filePath) + try data.write(to: fileURL) + + result = true + } + } + catch + { + Log.Critical(err: error, namespace: "Core.System", method: "WriteToStorage(string, data)") + } + + return result + } + + /** + * Writes content to the encrypted storage + * + * @param filename - filename where the content should be written + * @param data - data of content + */ + public static func WriteToEncryptedStorage(filename: String, data: Data) -> Bool + { + var result = false + + do + { + let storageDirectory = EncryptedStorageDirectoryPath() + + if(storageDirectory != nil) + { + let filePath = storageDirectory! + "/" + filename + let fileURL = URL.init(fileURLWithPath: filePath) + + if(FileExists(atPath: filePath)) + { + DeleteFile(atPath: filePath) + } + + try data.write(to: fileURL) + + result = true + } + } + catch + { + Log.Critical(err: error, namespace: "Core.System", method: "WriteToEncryptedStorage(string, data)") + } + + return result + } + + /** + * Reads content of file + * + * @param filename - filename + */ + public static func ReadFromStorage(filename: String) -> Data? + { + var result: Data? = nil + + do + { + let storageDirectory = StorageDirectoryPath() + + if(storageDirectory != nil) + { + let fileAtPath = storageDirectory! + "/" + filename + + if(FileExists(atPath: fileAtPath)) + { + let fileURL = URL.init(fileURLWithPath: fileAtPath) + result = try Data(contentsOf: fileURL) + } + } + } + catch + { + Log.Critical(err: error, namespace: "Core.System", method: "ReadFromStorage(string)") + } + + return result + } + + public static func GetPathForStorageFile(filename: String) -> String? + { + var result: String? = nil + + let storageDirectory = StorageDirectoryPath() + + if(storageDirectory != nil) + { + let fileAtPath = storageDirectory! + "/" + filename + + if(FileExists(atPath: fileAtPath)) + { + result = fileAtPath + } + } + + return result + } + /** + * Returns url of storage file + * + *@param filename - filename + */ + public static func GetURLForStorageFile(filename: String) -> URL? + { + return URL.init(fileURLWithPath: GetPathForStorageFile(filename: filename)!) + } + + /** + * Reads content of encrypted file + * + * @param filename - encrypted filename + */ + public static func ReadFromEncryptedStorage(filename: String) -> Data? + { + var result: Data? = nil + + do + { + let storageDirectory = EncryptedStorageDirectoryPath() + + if(storageDirectory != nil) + { + let fileAtPath = storageDirectory! + "/" + filename + + if(FileExists(atPath: fileAtPath)) + { + let fileURL = URL.init(fileURLWithPath: fileAtPath) + result = try Data(contentsOf: fileURL) + } + } + } + catch + { + Log.Critical(err: error, namespace: "Core.System", method: "ReadFromEncryptedStorage(string)") + } + + return result + } + + /** + * Returns url of encrypted file + * + * @param filename - filenaname + */ + public static func GetURLForStorageEncryptedFile(filename: String) -> URL? + { + var result: URL? = nil + + let fileAtPath = GetPathForStorageEncryptedFile(filename: filename) + + if(FileExists(atPath: fileAtPath!)) + { + result = URL.init(fileURLWithPath: fileAtPath!) + } + + return result + } + + public static func GetPathForStorageEncryptedFile(filename: String) -> String? + { + var result: String? = nil + + let storageDirectory = EncryptedStorageDirectoryPath() + + if(storageDirectory != nil) + { + result = storageDirectory! + "/" + filename + + } + return result + } + + /** + * Returns device object + */ + public static func GetDevice() -> Core.Models.System.Device + { + var result = Core.Models.System.Device() + + result.udid = UIDevice.current.identifierForVendor?.uuidString + result.name = UIDevice.current.name + result.model = UIDevice.current.model + result.manufacturer = "Apple" + result.os = UIDevice.current.systemVersion + + return result + } + + /** + * Returns storage info + */ + public static func GetStorageInfo() -> Core.Models.System.StorageInfo? + { + var result: Core.Models.System.StorageInfo? = nil + + do + { + let fileManager = FileManager.default + let attributes = try fileManager.attributesOfFileSystem(forPath: ApplicationDirectoryPath()) + + let fileSystemSizeInBytes = attributes[.systemSize] as? UInt64 + let freeFileSystemSizeInBytes = attributes[.systemFreeSize] as? UInt64 + + if(fileSystemSizeInBytes != nil && freeFileSystemSizeInBytes != nil) + { + result = Core.Models.System.StorageInfo() + result!.total = (Double)(fileSystemSizeInBytes! / 1000000000) + result!.free = (Double)(freeFileSystemSizeInBytes! / 1000000000) + result!.used = (result!.total - result!.free) + } + } + catch + { + Log.Critical(err: error, namespace: "Core.System", method: "GetStorageInfo") + } + + return result + } + + /** + * Returns file creation date + * + * @param atPath - filename + */ + public static func GetFileCreationDate(atPath: String) -> Date? + { + var result: Date? = nil + + do + { + if(FileExists(atPath: atPath)) + { + let fileManager = FileManager.default + let attributes = try fileManager.attributesOfItem(atPath: atPath) + result = attributes[.modificationDate] as? Date + } + } + catch + { + Log.Critical(err: error, namespace: "Core.System", method: "GetFileCreationDate(string)") + } + + return result + } + + public static func GetOEGDFiles() -> [String] + { + var result: [String] = [] + let storagePath = Core.System.StorageDirectoryPath() ?? "" + + if (storagePath.count>0) + { + let fileManager = FileManager.default + do{ + let files = try fileManager.contentsOfDirectory(atPath: storagePath) + for oneFile in files{ + if(oneFile.range(of: ".oegd") != nil) + { + result.append(oneFile) + } + } + } + catch let err{ + Core.Log.Error(err: err, namespace: "Core.System", method: "GetOEGDFiles") + } + } + return result + } + + public static func GetEncryptedFiles() -> [String] + { + var result: [String] = [] + let storagePath = Core.System.EncryptedStorageDirectoryPath() ?? "" + + if (storagePath.count>0) + { + let fileManager = FileManager.default + do{ + result = try fileManager.contentsOfDirectory(atPath: storagePath) + } + catch let err{ + Core.Log.Error(err: err, namespace: "Core.System", method: "GetEncryptedFiles") + } + } + return result + } + + public static func DeleteAllFiles() -> Bool + { + //delete all decrypted files + var files = GetEncryptedFiles() + if(files.count > 0) + { + for oneFile in files + { + DeleteFile(atPath: oneFile) + } + } + + + //delete all OEGD files + files = GetOEGDFiles() + if(files.count > 0) + { + for oneFile in files + { + DeleteFile(atPath: oneFile) + } + } + + //delete log and resuld databases + let curPath = DatabaseDirectoryPath() ?? "" + if (curPath.count > 0) + { + DeleteFile(atPath: curPath + "/logs.db") + DeleteFile(atPath: curPath + "/results.db") + } + + //delete settings-file + return DeleteFile(atPath: SettingsPath()) + } + + public static func GenerateQRCode(content: String) -> UIImage + { + let context = CIContext() + let data = Data(content.utf8) + let filter = CIFilter.qrCodeGenerator() + filter.setValue(data, forKey: "inpuMessage") + if let outputImage = filter.outputImage { + if let cgimg = context.createCGImage(outputImage, from: outputImage.extent){ + return UIImage(cgImage: cgimg) + + } + } + + + return UIImage(systemName: "xmark.circle") ?? UIImage() + + } + + } + +} diff --git a/Befund/Files/.DS_Store b/Befund/Files/.DS_Store new file mode 100644 index 0000000..95b9fc5 Binary files /dev/null and b/Befund/Files/.DS_Store differ diff --git a/Befund/Files/Icon.psd b/Befund/Files/Icon.psd new file mode 100644 index 0000000..2a52f3f Binary files /dev/null and b/Befund/Files/Icon.psd differ diff --git a/Befund/Files/InfoPlist.strings b/Befund/Files/InfoPlist.strings new file mode 100644 index 0000000..b887f71 --- /dev/null +++ b/Befund/Files/InfoPlist.strings @@ -0,0 +1,7 @@ +/* + InfoPlist.strings + Befund + + Created by Artur Savitskiy on 27.09.22. + Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. +*/ diff --git a/Befund/Files/SplashScreen.psd b/Befund/Files/SplashScreen.psd new file mode 100644 index 0000000..9f65490 Binary files /dev/null and b/Befund/Files/SplashScreen.psd differ diff --git a/Befund/Files/faq.html b/Befund/Files/faq.html new file mode 100644 index 0000000..40aa693 --- /dev/null +++ b/Befund/Files/faq.html @@ -0,0 +1,19 @@ + + + + + + + + + +
+ +

Die App wird mir im Store meines Smartphones nicht angezeigt/Ich kann die App nicht herunterladen.

Es ist möglich, dass Sie die App nicht im Appstore oder Google Playstore finden beziehungsweise herunterladen können. Denn aus Sicherheitsgründen werden zu alte Versionen eines Betriebssystems nicht mehr von der App unterstützt. In diesem Fall können Sie die App auf Ihrem Gerät leider nicht installieren. Sollte dies der Fall sein, prüfen Sie bitte unter Einstellungen Ihre aktuelle Betriebssystem-Version, eventuell können Sie diese aktualisieren. In Ihrem Appstore bzw. Google Playstore finden Sie in der App-Beschreibung heraus, welche Versionen des Betriebssystems von der App unterstützt werden. 

Warum benötigt die App den Zugriff auf meine Kamera und die Möglichkeit, mir Nachrichten zu senden?

Den Zugriff auf die Kamera benötigt die App, damit Sie anfangs einen QR-Code auf dem Flyer scannen können. Die App möchte Ihnen Nachrichten senden, um Sie über einen neuen Status wie z.B. der Fertigstellung Ihres Befundes informieren zu können.

Laut App soll ich zuerst einen QR-Code von einem Flyer scannen. Was soll ich tun, wenn mir der Flyer nicht vorliegt?

Bitte wenden Sie sich in diesem Fall an die Teststelle, an der Sie den Test durchgeführt haben, um an den Flyer bzw. den darauf benötigten QR-Code zu gelangen.

Wann kann ich meinen Auftrag in der App registrieren?

Sie können Ihren Auftrag zu jedem Zeitpunkt mithilfe der Auftragsnummer in der App registrieren. Bitte beachten Sie, dass es eine gewisse Zeit dauert, bis der Auftrag im Labor eingeht und daraufhin vom Labor bearbeitet wird.

Wann bekomme ich nach der Registrierung meinen Befund? Oder wann werde ich über den Status benachrichtigt?

Sie können Ihren Auftrag zu jedem Zeitpunkt mithilfe Ihrer Auftragsnummer in der App registrieren. Wird der Befund nach der Registrierung nicht automatisch in der App bereitgestellt, ist der Befund höchstwahrscheinlich noch in Bearbeitung. Sie werden in dem Fall 24 Stunden nach Ihrer Registrierung automatisch darüber informiert, ob Ihr Befund nun vorliegt. Sollte der Befund dann vorhanden sein, können Sie diesen in Ihrer App abrufen. Sollte zu Ihren registrierten Daten kein Auftrag gefunden worden sein, werden Sie ebenfalls darüber benachrichtigt. Bitte prüfen Sie in dem Fall die von Ihnen angegebenen Daten und führen die Registrierung erneut durch.

Hinweis: Der Befund liegt im Normalfall innerhalb von 24 Stunden vor. In Ausnahmefällen, bei hoher Auslastung der Teststellen oder vor Sonn- und Feiertagen kann die Bearbeitung jedoch etwas länger dauern.  

Wo kann ich beim Registrieren das Jahr vom Geburtsdatum ändern/auswählen? (Betrifft Android-Geräte)

Linksoben im Auswahlfenster finden Sie die Jahreszahl. Wenn Sie darauf klicken, können Sie ihr Geburtsjahr auswählen. 

Wird der Befund direkt auf meinem Smartphone abgespeichert?

Nein, der Befund bleibt vorerst für Sie in der App-Oberfläche sichtbar. Sie können diesen jedoch durch Klicken auf das entsprechende Druck-Symbol herunterladen, weiterleiten oder drucken. 

Wie lange kann ich meinen Befund in der App abrufen?

Sobald der Befund fertig ist (Sie werden per Push-Nachricht informiert) können Sie diesen abrufen. Öffnen Sie hierzu einfach die App, der Download des Befunds startet (insofern die erstmalige Registrierung erfolgreich stattfand) automatisch. Der fertige Befund steht in der App zeitlich unlimitiert zur Verfügung.

Sollten Sie Ihren Befund innerhalb von 30 Tagen nachdem Sie die Benachrichtigung des fertigen Befunds erhalten haben nicht aufgerufen haben, wenden Sie sich bitte an den Support, um Ihren Befund zu erhalten.

Was kann ich im Menü unter "Meine Patientendaten hinzufügen" machen?

Diese Option ist rein optional. Bei manchen Teststellen können Sie hiermit selbst Ihre persönlichen Daten, die für die Testung benötigt werden, angeben. Den daraufhin erzeugte QR-Code kann von der Teststelle ausgelesen werden und direkt einen Auftrag damit erzeugen. Damit können Sie z.B. sicherstellen, dass persönliche Angaben wie z.B. Ihr Name auch korrekt erfasst sind. Bitte fragen Sie zuvor an der jeweiligen Teststelle, ob diese Möglichkeit besteht. 

Muss ich jeden weiteren Befund wieder in der App registrieren?

Nein, zukünftige Befunde werden Ihnen nach der ersten Registrierung automatisch in der App bereitgestellt. Bitte beachten Sie jedoch: Die Voraussetzung hierfür ist, dass die App in der Zwischenzeit nicht deinstalliert und neu installiert wurde, auch z.B. auf einem neuen Gerät. Nach einer Neuinstallation der App muss eine erneute Registrierung erfolgen.

Ich habe keine Push-Benachrichtigung erhalten. Woran liegt das?

Bitte prüfen Sie folgende Optionen:

  • Möglicherweise ist in Ihrem Smartphone/Tablet nicht die Berechtigung hinterlegt, dass die App Push-Nachrichten an ihr Smartphone senden darf. Dies können Sie unter Ihren App-Einstellungen für zukünftige Befunde anpassen.
  • Möglicherweise wurde noch keine Push-Nachricht an Sie versendet. Genauere Informationen finden Sie unter "Wann werde ich über den Status meines Tests benachrichtigt?" .
  • Sollten Sie in der Zwischenzeit die App deinstalliert und neu installiert haben, kann Ihrer "neu installierten" App der Befund nicht mehr zugeordnet werden. In dem Fall wenden Sie sich bitte an den Support. Siehe auch "Ich habe die App nach der Registrierung meines Auftrags deinstalliert. Gibt es bei der Neuinstallation etwas zu beachten?"
  • Während die App geöffnet ist, werden keine Push-Nachrichten versendet. Sollte der Befund fertig werden, während Sie die App geöffnet haben, wird dieser automatisch heruntergeladen und Ihnen in der App angezeigt.

Ich habe die App nach der Registrierung meines Auftrags deinstalliert. Gibt es bei der Neuinstallation etwas zu beachten?

Sollten Sie die App nach der Registrierung Ihres Auftrags deinstalliert haben, kann einer anschließend "neu installierten" App der Befund nicht mehr zugeordnet werden, da die Zuordnung über eine eindeutige "App-ID" stattfindet. Um an Ihren Befund zu kommen wenden Sie sich bitte an den Support. Diesen finden Sie in der App unter: Menü → Support.

Die biometrische Authentifizierung funktioniert nicht, um meine PIN zurückzusetzen. Was soll ich tun?

Das Problem tritt höchstwahrscheinlich deswegen auf, weil die App nicht die Berechtigung zum Abrufen der biometrischen Authentifizieren von Ihrem Smartphone hat. Dann erhalten Sie die Fehlermeldung "Sie können der App in den Einstellungen Ihres Smartphones die entsprechende Berechtigung erteilen. Danach sollte die biometrische Authentifizierung (bei IPhones "Face ID" genannt) funktionieren. Sollte das Problem damit nicht gelöst sein, können Sie sich in der App an den Support wenden. 

+ + + + +
+ + \ No newline at end of file diff --git a/Befund/Files/privacy_policy.html b/Befund/Files/privacy_policy.html new file mode 100644 index 0000000..9a70f53 --- /dev/null +++ b/Befund/Files/privacy_policy.html @@ -0,0 +1,186 @@ + + + + + + + + + +

Datenschutz

+

Datenschutzhinweise
+ Datenschutzhinweise Stand: 30.04.2019
+
+ Vorwort
+ Unabhängig davon, ob Sie Kunde, Interessent, Bewerber oder Besucher unserer Website sind: Wir, MVZ Dr. Stein + Kollegen GbR (im Folgenden: „MVZ Dr. Stein“, „wir“) nehmen den Schutz Ihrer personenbezogenen Daten sehr wichtig. Doch was bedeutet dies konkret? Im Folgenden ermöglichen wir Ihnen, sich einen Einblick darüber zu verschaffen, welche personenbezogenen Daten wir von Ihnen erheben und in welcher Form wir sie verarbeiten. Des Weiteren erhalten Sie eine Übersicht über die Ihnen zustehenden Rechte nach geltendem Datenschutzrecht. Zudem nennen wir Ihnen Ihre Ansprechpartner, falls Sie noch Fragen haben sollten.
+ Als Verantwortlicher i.S.d. geltenden Datenschutzgesetze ergreifen wir,
+
+ MVZ Dr. Stein + Kollegen GbR
+ Tomphecke 45
+ 41169 Mönchengladbach
+ Tel: 02161/ 8194 -0
+ Fax: 02161/ 8194 -50
+
+ alle nach geltendem Datenschutzrecht erforderlichen Maßnahmen, um den Schutz Ihrer personenbezogenen Daten zu gewährleisten. Bei allen Fragen bezüglich dieser Datenschutzerklärung bitten wir Sie, sich an unseren Datenschutzbeauftragten zu wenden.
+
+ 2B Advice GmbH
+ Volker Schrödter
+ Joseph-Schumpeter-Allee 27
+ 53227 Bonn
+ E-Mail: stein@2b-advice.com
+
+ Anwendungsbereich der Datenschutzerklärung
+ Unter der Verarbeitung personenbezogener Daten versteht der Gesetzgeber Tätigkeiten wie das Erheben, das Erfassen, die Organisation, das Ordnen, die Speicherung, die Anpassung oder Veränderung, das Auslesen, das Abfragen, die Verwendung, die Offenlegung durch Übermittlung, Verbreitung oder eine andere Form der Bereitstellung, den Abgleich oder die Verknüpfung, die Einschränkung, das Löschen oder die Vernichtung personenbezogener Daten. Personenbezogene Daten sind alle Informationen, die sich auf eine identifizierte oder identifizierbare natürliche Person beziehen. In dieser Datenschutzerklärung geht es um die personenbezogenen Daten von Kunden, Interessenten, Bewerbern oder Besuchern.
+
+ Welche personenbezogenen Daten verarbeiten wir?
+ Ihre personenbezogenen Daten werden von uns erhoben, wenn Sie mit uns, z.B. als Interessent oder Kunde, in Kontakt treten. Dies kann beispielsweise geschehen, indem Sie sich für unsere Produkte interessieren, sich für unsere Online-Dienste registrieren, sich über unsere Kommunikationskanäle an uns wenden, oder wenn Sie im Rahmen bestehender Geschäftsbeziehungen unsere Produkte oder Dienstleistungen nutzen.
+
+ Folgende Arten personenbezogenen Daten werden bei uns verarbeitet:
+ • Angaben zur persönlichen Identifikation z.B. Vor- und Nachname, Anschriftendaten, E-Mail-Adresse, Telefonnummer, Faxnummer
+ • Unternehmensbezogene Daten z.B. Firmierung, Abteilung, Tätigkeit
+ • Daten zu Ihrem Online-Verhalten z.B. IP-Adressen, Benutzernamen, Daten zu Ihren Besuchen auf unserer Webseite, in den Kundenportalen oder in der App, ausgeführte Aktionen auf unseren Webseiten und in den Kundenportalen,
+ Ort des Zugriffs
+ • Informationen zu Ihren Interessen und Wünschen, welche Sie uns mitteilen z.B. über unser Kontaktformular oder über sonstige Kommunikationskanäle
+ • Informationen über Ihren beruflichen Werdegang z.B. Berufsausbildung, bisherige Arbeitgeber, sonstige Qualifikationen sowie weitere mit diesen Datenkategorien vergleichbare Informationen.
+
+ Sensible Daten
+ Sensible Daten, also besondere Kategorien personenbezogener Daten wie z.B. Informationen zur Religions- oder Gewerkschaftszugehörigkeit, werden über diesen Weg nicht erhoben.
+
+ Nutzung von Cookies
+ Was sind Cookies?
+ Cookies sind Dateien, die von unserer Webseite oder von den Kundenportalen auf Ihren Computer abgelegt werden, während Sie die Seite aufrufen. Diese Dateien speichern Informationen, die Ihre Nutzung dieser Seite effizienter gestalten. Wir verwenden als Webanalysedienst Matomo(PIWIK), um das Nutzungsverhalten auf der Webseite und in den Kundenportalen zu analysieren. Für diese Analyse werden die durch den Cookie erzeugten Nutzungsinformationen (einschließlich der gekürzten IP-Adresse des Nutzers) an unsere Server übertragen und zu Nutzungsanalysezwecken gespeichert. Die Nutzungsanalyse verwenden wir, um die eigenen Webseiten, die Kundenportale, die Kundenansprache und sonstige Werbemaßnahmen zu optimieren sowie zu Marktforschungszwecken. Die IP-Adresse der Nutzer wird bei diesem Vorgang umgehend verkürzt, so dass die Identifikation der Nutzer über die IP-Adresse nicht mehr möglich ist. Jeder Nutzer, der mit der Speicherung und Auswertung seiner anonymisierten Nutzerdaten zu seinem Besuch auf unserer Webseite nicht einverstanden ist, kann dieser Speicherung und Nutzung jederzeit widersprechen. Eine anonymisierte Nutzung der Kundenportale ist nicht möglich.
+ Wofür verarbeiten wir Ihre personenbezogenen Daten – und auf Basis welcher Rechtsgrundlage?
+
+ Vertragserfüllung
+ Wir verarbeiten Ihre Daten, um unsere Verträge erfüllen zu können. Das gilt ebenso für Angaben, die Sie uns gegenüber im Rahmen vorvertraglicher Korrespondenz machen. Die konkreten Zwecke der Datenverarbeitung hängen vom jeweiligen Produkt und oder dem von Ihnen gestellten Antrag ab.
+
+ Durchführung des Vertragsverhältnisses
+ Zur Durchführung des Vertragsverhältnisses benötigen wir Ihren Namen, Ihre Anschrift, Ihre Telefonnummer bzw. Ihre E-Mail-Adresse, damit wir Sie kontaktieren können.
+
+ Anbieten von Waren- und Dienstleistungen
+ Wir benötigen Ihre personenbezogenen Daten ebenfalls, um prüfen zu können, ob und welche Produkte und Dienstleistungen wir Ihnen anbieten können und dürfen. Einzelheiten zu den jeweiligen Zwecken der Datenverarbeitung können Sie den Vertragsunterlagen und unseren Allgemeinen Geschäftsbedingungen entnehmen.
+
+ Durchführung des Bewerbungsverfahrens
+ Wir verarbeiten Ihre Daten, die Sie uns im Rahmen Ihrer Bewerbung übersandt haben, um zu prüfen, ob Ihre fachlichen Qualifikationen für die ausgeschriebene Stelle geeignet sind. Wir nutzen Ihre Informationen lediglich für das Bewerbungsverfahren und überführen diese bei einem Vertragsschluss in Ihre Personalakte. Falls es nicht zu einer Übereinkunft kommen sollte, werden Ihre Informationen gelöscht bzw. vernichtet. Wir werden Ihre Bewerberinformationen für keine anderen Zwecke verwenden als für die Durchführung des Bewerbungsverfahrens.
+
+ Datenverarbeitung und -analyse zu Marketingzwecken
+ Ihre Bedürfnisse sind uns wichtig, und wir versuchen, Ihnen Informationen zu Produkten und Dienstleistungen zu geben, die genau zu Ihnen passen. Dafür verwenden wir die Erkenntnisse aus unserer gemeinsamen Geschäftsbeziehung sowie aus der Marktforschung. Wesentliches Ziel ist dabei die Anpassung unserer Produktvorschläge an Ihre Bedürfnisse. In diesem Zusammenhang garantieren wir, dass wir die Daten immer in Übereinstimmung mit geltendem Datenschutzrecht verarbeiten. Wichtig: Sie können jederzeit der Nutzung Ihrer personenbezogenen Daten zu diesem Zweck widersprechen.
+
+ Was analysieren und verarbeiten wir konkret?
+ • Ergebnisse unserer Marketingaktionen, um die Effizienz und Relevanz unserer Kampagnen zu messen;
+ • Informationen aus Ihren Besuchen auf unserer Webseite;
+ • Wir analysieren den möglichen Bedarf unserer Produkte und Dienstleistungen.
+ Maßnahmen, die Ihrer Sicherheit dienen
+
+ Wir nutzen Ihre personenbezogenen Daten unter anderem in den folgenden Fällen:
+ • Um Sie bzw. Ihr Unternehmen vor betrügerischen Aktivitäten zu schützen, analysieren wir Ihre Daten. Dies kann z.B. vorkommen, wenn Sie Opfer eines Identitätsdiebstahls geworden sind oder sich Unberechtigte auf andere Weise Zugriff auf Ihr Benutzerkonto verschafft haben;
+ • Um die Zuverlässigkeit unserer Webanwendungen zu verbessern, arbeitet unser IT-Support eng mit Ihnen im Falle von technischen Problemen zusammen. In diesem Zusammenhang werten wir auch Protokollierungen von Seitenzugriffen, durchgeführten Aktionen usw. aus;
+ • Um die IT-Sicherheit gewährleisten zu können;
+ • Um im Falle möglicher Rechtsstreitigkeiten Sachverhalte erfassen und nachweisen zu können.
+ Aufgrund Ihrer Einwilligung
+ Sofern Sie in die Verarbeitung Ihrer personenbezogenen Daten für einen oder mehrere konkretisierte Zwecke eingewilligt haben, ist die Verarbeitung Ihrer Daten durch uns zulässig. Sie können diese Einwilligung mit Blick auf die Zukunft jederzeit widerrufen, ohne dass Ihnen hierfür andere als die Übermittlungskosten nach den Basistarifen (Kosten Ihres Internet-Anschlusses) entstehen. Der Widerruf der Einwilligung berührt jedoch nicht die Rechtmäßigkeit der bis zum Widerruf erfolgten Verarbeitungen. Aufgrund gesetzlicher Vorgaben oder im öffentlichen Interesse
+ Als Unternehmen unterliegen wir den unterschiedlichsten gesetzlichen Anforderungen (bspw. aus der Steuergesetzgebung).
+ Um unseren gesetzlichen Verpflichtungen nachzukommen, verarbeiten wir Ihre personenbezogenen Daten.
+
+ Wohin wir Daten übermitteln und warum Datennutzung innerhalb MVZ Dr. Stein
+ Innerhalb von MVZ Dr. Stein erhalten nur die Stellen Zugriff auf Ihre personenbezogenen Daten, die diese benötigen, um unsere vertraglichen oder gesetzlichen Verpflichtungen zu erfüllen, oder um unsere berechtigten Interessen zu wahren.
+
+ Datennutzung außerhalb MVZ Dr. Stein
+ Wir achten den Schutz Ihrer personenbezogenen Daten und geben Informationen über Sie nur dann weiter, wenn gesetzliche Bestimmungen dies gebieten, Sie eingewilligt haben, oder zur Erfüllung vertraglicher Verpflichtungen. Bei folgenden Empfängern kommt eine gesetzliche Verpflichtung zur Weitergabe Ihrer personenbezogenen Daten beispielsweise in Betracht:
+ - Öffentliche Stellen oder Aufsichtsbehörden, z.B. Steuerbehörden, Zollbehörden;
+ - Justiz- und Strafverfolgungsbehörden, z.B. Polizei, Gerichte, Staatsanwaltschaft;
+ - Anwälte oder Notare, z.B. in Rechtsstreitigkeiten;
+ - Wirtschaftsprüfer.
+ Damit wir unsere vertraglichen Verpflichtungen erfüllen können, kooperieren wir mit anderen Unternehmen.
+ Dazu gehören:
+ - Transportdienstleister und Speditionen;
+ - Veranstalter und Schulungsdienstleister, wenn Sie sich über uns für bestimmte Messen oder Events angemeldet haben;
+ - Banken und Finanzdienstleister zur Abwicklung aller finanziellen Angelegenheiten.
+
+ Eigene Dienstleister
+ Um unseren Betrieb effizient gestalten zu können, greifen wir auf die Dienste externer Dienstleister zurück, die zur Erfüllung der beschriebenen Zwecke personenbezogene Daten von Ihnen erhalten können, darunter IT-Dienstleister, Druck- und Telekommunikationsdienstleister, Inkasso-, Beratungs- oder Vertriebsunternehmen.
+
+ Befund-Applikation (APP)
+ Wenn Sie Nutzer der Befund-App sind, verarbeiten wir die folgenden Daten für die Bereitstellung der App und der Befunde sowie zur Wahrung der Sicherheit bei dem Betrieb der App:
+ - Fingerprint und mit FaceID (Sicheres Öffnen der APP).
+ - Kennung und Passwort (Zur Anmeldung am Dienst)
+ - Mac-Adresse (hin und wieder auch Hardware-Adresse Ihres mobilen Endgerätes genannt) und Mobilnummer (zur Wahrung der Sicherheit bei der Anmeldung)
+ - Zur Anzeige der Befunde wird an Apple und Google eine Pushnachricht gesendet.
+ Der Inhalt ist nur die APP-ID, die Geräte-ID und die Labor-Tagesnummer.
+ - Die APP greift auf die Kamera und auf die Bilder zu. (Zum Scannen von Auftragsbarcodes). Die Befunddaten verbleiben auch bei einem Abruf der Daten auf unseren eigenen Servern, die sich in Deutschland befinden. Sofern Sie die Daten nicht aus dem Ausland heraus abrufen, ist eine Übermittlung in Drittsaaten nicht geplant und auch technisch nicht erforderlich. Die Verbindung zwischen der App und unseren Servern ist nach dem Stand der Technik gesichert. Wir weisen an dieser Stelle noch einmal darauf hin, dass der sichere Betrieb der Befund-App zu einem erheblichen Teil davon abhängt, dass Sie ihre Zugangsdaten geheim halten und die Zugangsdaten nicht auf dem Gerät, mit dem Sie die Befund-App nutzen, speichern. Im Falle einer Wartung und Pflege der Systeme hat gegebenenfalls der Hersteller der Befund-App Zugang zu den gespeicherten personenbezogenen Daten. Wir haben mit dem Hersteller einen entsprechenden Vertrag zur Auftragsverarbeitung gemäß Artikel 28 Datenschutz-Grundverordnung (DS-GVO) geschlossen.
+ Wichtig: Wir achten genau auf Ihre personenbezogenen Daten! Um sicherzustellen, dass bei den Dienstleistern dieselben datenschutzrechtlichen Standards wie in unserem Haus eingehalten werden, haben wir entsprechende Verträge zur Auftragsverarbeitung abgeschlossen.
+ Diese Verträge regeln u.a.:
+ - dass Dritte nur Zugriff auf die Daten erhalten, die sie zur Erledigung der an sich übertragenen Aufgaben benötigen;
+ - dass bei den Dienstleistern nur Mitarbeiter Zugriff auf Ihre Daten erhalten, die sich explizit zur Einhaltung der datenschutzrechtlichen Regelungen verpflichtet haben;
+ - dass bei den Dienstleistern technische und organisatorische Maßnahmen eingehalten werden, welche die Datensicherheit und den Datenschutz gewährleisten;
+ - was mit den Daten geschieht, wenn das Geschäftsverhältnis zwischen dem Dienstleister und uns beendet wird. Bei Dienstleistern, die ihren Sitz außerhalb des Europäischen Wirtschaftsraums (EWR) haben, nehmen wir spezielle Sicherheitsmaßnahmen (z.B. durch die Verwendung besonderer Vertragsklauseln) vor, um zu gewährleisten, dass die Daten mit demselben Maß an Umsicht behandelt werden wie im EWR. Wir überprüfen alle unsere Dienstleister regelmäßig auf die Einhaltung unserer Vorgaben.
+ Ganz wichtig: Auf keinen Fall verkaufen wir Ihre personenbezogenen Daten an Dritte!
+
+ Sind Sie verpflichtet, uns personenbezogene Daten zur Verfügung zu stellen?
+ Im Kontext der Geschäftsbeziehung zwischen Ihnen und MVZ Dr. Stein benötigen wir von Ihnen folgende Kategorien personenbezogener Daten:
+ - alle notwendigen Daten für die Aufnahme und die Durchführung einer Geschäftsbeziehung;
+ - Daten, die zur Erfüllung von vertraglichen Pflichten benötigt werden;
+ - Daten, zu deren Erhebung wir gesetzlich verpflichtet sind.
+ Ohne diese Daten ist es uns nicht möglich, Verträge mit Ihnen einzugehen oder durchzuführen. Löschfristen Gemäß den geltenden Datenschutzbestimmungen speichern wir Ihre personenbezogenen Daten nicht länger, als wir sie für die Zwecke der jeweiligen Verarbeitung benötigen. Sofern die Daten nicht mehr zur Erfüllung vertraglicher oder gesetzlicher Pflichten benötigt werden, werden sie von uns regelmäßig gelöscht, außer, ihre befristete Aufbewahrung ist weiter notwendig.
+ Folgende Gründe können für eine weitere Aufbewahrung vorliegen:
+ - Es müssen handels- bzw. steuerrechtliche Aufbewahrungspflichten eingehalten werden:
+ Die Fristen zur Aufbewahrung vorrangig nach den Regelungen des Handelsgesetzbuches und der Abgabenordnung liegen bei bis zu 10 Jahren.
+ - Zum Erhalt von Beweismitteln im Falle rechtlicher Streitigkeiten im Rahmen der gesetzlichen Verjährungsvorschriften: Verjährungsfristen können im Zivilrecht bis zu 30 Jahre betragen, wobei die regelmäßige Verjährung nach drei Jahren eintritt.
+
+ Ihre Rechte
+ Im Rahmen der Verarbeitung Ihrer personenbezogenen Daten stehen Ihnen auch bestimmte Rechte zu. Genaueres ergibt sich aus den entsprechenden Regelungen der Datenschutz-Grundverordnung (dort in den Artikeln 15 bis 21). Recht auf Auskunft und Berichtigung Sie haben das Recht, von uns darüber Auskunft zu erhalten, welche Ihrer personenbezogenen Daten wir verarbeiten. Sofern diese Informationen nicht (mehr) stimmen sollten, können Sie von uns die Berichtigung der Daten verlangen, bei unvollständigen Angaben deren Ergänzung. Sofern wir Ihre Daten an Dritte weitergegeben haben, informieren wir die entsprechenden Dritten bei entsprechender Rechtslage.
+
+ Recht auf Löschung
+ Unter folgenden Umständen können Sie die unverzügliche Löschung Ihrer personenbezogenen Daten verlangen:
+ - Wenn Ihre personenbezogenen Daten nicht länger für die Zwecke, für die sie erhoben wurden, benötigt werden;
+ - Wenn Sie Ihre Einwilligung widerrufen haben und es an einer sonstigen Rechtsgrundlage zur Datenverarbeitung fehlt;
+ - Wenn Sie der Verarbeitung widersprechen und es keine vorrangigen berechtigten Gründe für eine Datenverarbeitung gibt;
+ - Wenn Ihre Daten unrechtmäßig verarbeitet werden;
+ - Wenn Ihre personenbezogenen Daten zur Erfüllung gesetzlicher Pflichten gelöscht werden müssen.
+ Beachten Sie bitte, dass wir vor der Löschung Ihrer Daten prüfen müssen, ob kein legitimer Grund zur Verarbeitung Ihrer personenbezogenen Daten vorliegt.
+
+ Recht auf Einschränkung der Verarbeitung („Recht auf Sperrung“)
+ Aus einem der folgenden Gründe können Sie von uns die Einschränkung der Verarbeitung Ihrer personenbezogenen Daten verlangen:
+ - Wenn Sie die Richtigkeit der Daten bestreiten, bis wir die Gelegenheit hatten, uns von der Richtigkeit der Daten zu überzeugen;
+ - Wenn die Daten unrechtmäßig verarbeitet werden, Sie aber anstelle der Löschung lediglich die Einschränkung der Nutzung der personenbezogenen Daten verlangen;
+ - Wenn wir die personenbezogenen Daten zwar nicht mehr für die Zwecke der Verarbeitung benötigen, Sie diese aber noch zur Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen benötigen;
+ - Wenn Sie Widerspruch gegen die Verarbeitung eingelegt haben und noch nicht feststeht, ob Ihre berechtigen Interessen gegenüber unseren überwiegen.
+ Recht auf Widerspruch
+ Einzelfallbezogenes Widerspruchsrecht Sofern die Verarbeitung im öffentlichen Interesse oder auf Grundlage einer Interessenabwägung erfolgt, haben Sie das Recht, aus Gründen, die sich aus Ihrer besonderen Situation ergeben, Widerspruch gegen die Verarbeitung einzulegen. Bei erfolgtem Widerspruch werden wir Ihre personenbezogenen Daten nicht weiter verarbeiten, es sei denn, wir können zwingende schutzwürdige Gründe für die Verarbeitung Ihrer Daten nachweisen, die Ihren Interessen, Rechten und Freiheiten überwiegen, oder weil Ihre personenbezogenen Daten der Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen dienen. Der Widerspruch steht der Rechtmäßigkeit der bis zum Widerspruch erfolgten Verarbeitung nicht entgegen.
+
+ Werbewiderspruch
+ In den Fällen, in denen Ihre personenbezogenen Daten für Werbemaßnahmen verwendet werden, können Sie jederzeit gegen diese Form der Verarbeitung Widerspruch einlegen. Wir werden dann Ihre personenbezogenen Daten nicht länger für diese Zwecke verarbeiten. Der Widerspruch kann formfrei erfolgen und sollte adressiert werden an: info(at)labor-stein.de
+
+ Recht auf Datenübertragbarkeit
+ Sie haben das Recht, personenbezogene Daten, die Sie uns zur Verarbeitung gegeben haben, auf Anfrage in einem übertragbaren und maschinenlesbaren Format zu erhalten. Recht auf Beschwerde bei der Aufsichtsbehörde (Art. 77 DS-GVO) Wir versuchen, Ihre Anfragen und Ansprüche immer schnellstmöglich zu bearbeiten, um Ihre Rechte entsprechend zu wahren. Je nach Häufigkeit der Anfragen kann es jedoch sein, dass bis zu 30 Tage vergehen, ehe wir Sie über Ihr Anliegen weiter informieren können. Falls es länger dauern sollte, werden wir Sie zeitnah über die Gründe für die Verzögerung benachrichtigen und das weitere Verfahren mit Ihnen besprechen. In einigen Fällen dürfen oder können wir Ihnen keine Auskunft geben. Sofern rechtlich zulässig, teilen wir Ihnen den Grund für die Verweigerung der Auskunft mit. Sofern Sie dennoch nicht mit unseren Antworten und Reaktionen zufrieden sind oder der Ansicht sind, dass wir gegen geltendes Datenschutzrecht verstoßen, steht es Ihnen frei, sowohl bei unserem Datenschutzbeauftragten als auch bei der zuständigen Aufsichtsbehörde Beschwerde einzureichen.
+ Die für uns zuständige Aufsichtsbehörde ist:
+
+ Landesbeauftragte für Datenschutz und Informationsfreiheit Nordrhein-Westfalen
+ Postfach 20 04 44
+ 40102 Düsseldorf
+ Tel.: 0211/38424-0
+ Fax: 0211/38424-10
+ E-Mail: poststelle(at)ldi.nrw.de
+
+ Matomo Statistikauswertung
+ Die folgenden von uns verwendeten Tracking-Maßnahmen werden gemäß Artikel 6 Absatz 1 Buchstabe f der DSGVO durchgeführt. Durch die Tracking-Maßnahmen wollen wir die bedarfsgerechte Gestaltung und laufende Optimierung unserer Website sicherstellen. Wir verwenden diese Tracking-Maßnahmen auch, um die Nutzung unserer Website statistisch zu erfassen und zu bewerten, wie wir unseren Service optimieren können. Diese Interessen können gemäß der vorgenannten Regelung als legitim angesehen werden. Wir verwenden die Open-Source-Software Matomo, um die Nutzung unserer Website zu analysieren und statistisch auszuwerten. Hierbei werden Cookies verwendet. Die durch den Cookie erzeugten Informationen über die Benutzung der Website werden an unseren Server übermittelt und in pseudonymen Benutzerprofilen zusammengefasst. Die Informationen werden verwendet, um die Nutzung unserer Website zu bewerten und eine bedarfsgerechte Gestaltung unserer Website zu ermöglichen. Informationen werden nicht an Dritte weitergegeben. Die IP-Adresse wird in keinem Fall mit anderen Daten des Benutzers in Verbindung gebracht. Die IP-Adressen werden anonymisiert, so dass eine Zuordnung nicht möglich ist (IP-Maskierung). Ihre Tracking-Optionen werden in der Cookie-Richtlinie festgelegt. Bitte wählen Sie die bevorzugte Option mithilfe des Cookie-Banners oben auf dieser Website. Sie können Ihre Einstellungen jederzeit ändern, indem Sie auf das kleine Cookie-Richtlinienbanner oben links auf der Website klicken.
+
+

+

Version
+ Diese Datenschutzerklärung ist vom Stand 30.04.2019.
+ Frühere Versionen der Datenschutzerklärung sind über unseren Datenschutzbeauftragten erhältlich.
+ Nutzungsbedingungen
+ 1. Inhalt des Onlineangebotes
+ Der Autor übernimmt keinerlei Gewähr für die Aktualität, Korrektheit, Vollständigkeit oder Qualität der bereitgestellten Informationen. Haftungsansprüche gegen den Autor, welche sich auf Schäden materieller oder ideeller Art beziehen, die durch die Nutzung oder Nichtnutzung der dargebotenen Informationen bzw. durch die Nutzung fehlerhafter und unvollständiger Informationen verursacht wurden sind grundsätzlich ausgeschlossen, sofern seitens des Autors kein nachweislich vorsätzliches oder grob varlässiges Verschulden vorliegt. Alle Angebote sind freibleibend und unverbindlich. Der Autor behält es sich ausdrücklich vor, Teile der Seiten oder das gesamte Angebot ohne gesonderte Ankündigung zu verändern, zu ergänzen, zu löschen oder die Veröffentlichung zeitweise oder entgültig einzustellen.
+ 2. Verweise und Links
+ Bei direkten oder indirekten Verweisen auf fremde Internetseiten ("Links"), die außerhalb des Verantwortungsbereiches des Autors liegen, würde eine Haftungsverpflichtung ausschließlich in dem Fall in Kraft treten, in dem der Autor von den Inhalten Kenntnis hat und es ihm technisch möglich und zumutbar wäre, die Nutzung im Falle rechtswidriger Inhalte zu verhindern. Der Autor erklärt daher ausdrücklich, dass zum Zeitpunkt der Linksetzung die entsprechenden verlinkten Seiten frei von illegalen Inhalten waren. Der Autor hat keinerlei Einfluss auf die aktuelle und zukünftige gestaltung und auf die Inhalte der gelinkten/verknüpften Seiten. Deshalb distanziert er sich hiermit ausdrücklich von allen Inhalten aller gelinkten/verknüpften Seiten, die nach der Linksetzung verändert wurden. Diese Feststellung gilt für alle innerhalb des eigenen Internetangebotes gesetzten Links und Verweise sowie für Fremdeinträge in vom Autor eingerichteten Gästebüchern, Diskussionsforen und Mailinglisten. Für illegale, fehlerhafte oder unvollständige Inhalte und insbesondere für Schäden, die aus der Nutzung oder Nichtnutzung solcherart dargebotener Informationen entstehen, haftet allein der Anbieter der Seite, auf welche verwiesen wurde, nicht derjenige, der über Links auf die jeweilige Veröffentlichung lediglich verweist.
+ 3. Urheber- und Kennzeichenrecht
+ Der Autor ist bestrebt, in allen Publikationen die Urheberrechte der verwendeten Grafiken, Tondokumente, Videosequenzen und Texte zu beachten, von ihm selbst erstellte Grafiken, Tondokumente, Videosequenzen und Texte zu nutzen oder auf lizenzfreie Grafiken, Tondokumente, Viedeosequenzen und Texte zurückzugreifen. Alle innerhalb des Internetangebotes genannten und ggf. durch dritte geschützten Marken- und Warenzeichen unterliegen uneingeschränkt den Bestimmungen des jeweils gültigen Kennzeichenrechts und den Besitzrechten der jeweiligen eingetragenenEigentümer. Allein aufgrund der bloßen Nennung ist nicht der Schluß zu ziehen, dass Markenzeichen nicht durch die Rechte Dritter geschützt sind! Das Copyright für veröffentlichte, vom Autor selbst erstellte Objekte bleibt allein beim Autor der Seiten. Eine Vervielfältigung oder Verwendung solcher Grafiken, Tondokumente, Videosequenzen und Texte in anderen elektronischen oder gedruckten Publikationenist ohne ausdrückliche Zustimmung des Autors nicht gestattet.
+ 4. Datenschutz
+ Sofern innerhalb des Internetangebotes die Möglichkeit zur Eingabe persönlicher oder geschäftlicher Daten (Emailadressen, Namen, Anschriften) besteht, so erfolgt die Preisgabe dieser Daten seitens des Nutzers auf ausdrücklich freiwilliger Basis. Die Inanspruchnahme und Bezahlung aller angebotenen Dienste ist -soweit technisch möglich und zumutbar - auch ohne Angabe solcher Daten bzw. unter Angabe anonymisierter Daten oder eines Pseudonyms gestattet.
+ 5. Rechtswirksamkeit dieses Haftungsausschlusses
+ Dieser Haftungsausschluss ist als Teil des Internetangebotes zu betrachten, von dem aus auf diese Seite verwiesen wurde. Sofern Teile oder einzelne Formulierungen dieses Textes der geltenden Rechtslage nicht, nicht mehr oder nicht vollständig entsprechen sollten, bleiben die übrigen Teile des Dokumentes in ihrem Inhalt und ihrer Gültigkeit davon unberührt.  

+

 

+ + + \ No newline at end of file diff --git a/Befund/Files/splash_screen_logo.png b/Befund/Files/splash_screen_logo.png new file mode 100644 index 0000000..4d93b40 Binary files /dev/null and b/Befund/Files/splash_screen_logo.png differ diff --git a/Befund/Files/splash_screen_logo_x2.png b/Befund/Files/splash_screen_logo_x2.png new file mode 100644 index 0000000..51fdd80 Binary files /dev/null and b/Befund/Files/splash_screen_logo_x2.png differ diff --git a/Befund/Files/splash_screen_x3.png b/Befund/Files/splash_screen_x3.png new file mode 100644 index 0000000..bede3ea Binary files /dev/null and b/Befund/Files/splash_screen_x3.png differ diff --git a/Befund/Info.plist b/Befund/Info.plist new file mode 100644 index 0000000..9ca201a --- /dev/null +++ b/Befund/Info.plist @@ -0,0 +1,35 @@ + + + + + CFBundleLocalizations + + de + en + + LSMinimumSystemVersion + 12.5 + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + + diff --git a/Befund/SceneDelegate.swift b/Befund/SceneDelegate.swift new file mode 100644 index 0000000..b12dfa5 --- /dev/null +++ b/Befund/SceneDelegate.swift @@ -0,0 +1,57 @@ +// +// SceneDelegate.swift +// Befund +// +// Created by Irakli Abetschkhrischwili on 29.04.22. +// Copyright © 2022 MVZ Dr. Stein und Kollegen. All rights reserved. + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + guard let scene = (scene as? UIWindowScene) else { return } + + let window = UIWindow(windowScene: scene) + + let storyboard = UIStoryboard(name: "Main", bundle: nil) + + let settings = Core.Models.Settings.loadFromFile(atPath: Core.System.SettingsPath()) + let flagInitialized = (settings != nil && settings?.labor != nil) + let flagAGB = (settings != nil && (settings?.policyAGBExplained ?? false)) + + let pre = Locale.current.language.languageCode?.identifier + Core.Lang.SetLanguage(lang: settings?.lang ?? (pre != "de" ? Core.Lang.Languages.EN : Core.Lang.Languages.DE)) + settings?.save(atPath: Core.System.SettingsPath()) + + if(!flagAGB) + { + window.rootViewController = storyboard.instantiateViewController(withIdentifier: "AGBPolicy") + } + else + { + + if (!flagInitialized) + { + window.rootViewController = storyboard.instantiateViewController(withIdentifier: "SelectLabor") + } + else + { + window.rootViewController = storyboard.instantiateViewController(withIdentifier: "Main") + + } + } + + window.makeKeyAndVisible() + + self.window = window + + self.window?.overrideUserInterfaceStyle = .light + + } + +} + diff --git a/Befund/Screens/.DS_Store b/Befund/Screens/.DS_Store new file mode 100644 index 0000000..ca3cc67 Binary files /dev/null and b/Befund/Screens/.DS_Store differ diff --git a/Befund/Screens/Base.lproj/LaunchScreen.storyboard b/Befund/Screens/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..a4a3671 --- /dev/null +++ b/Befund/Screens/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Befund/Screens/Base.lproj/Main.storyboard b/Befund/Screens/Base.lproj/Main.storyboard new file mode 100644 index 0000000..cc3fe30 --- /dev/null +++ b/Befund/Screens/Base.lproj/Main.storyboard @@ -0,0 +1,4232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Befund/ic_downloading.gif b/Befund/ic_downloading.gif new file mode 100644 index 0000000..24e97ca Binary files /dev/null and b/Befund/ic_downloading.gif differ diff --git a/BefundUITests/BefundUITests.swift b/BefundUITests/BefundUITests.swift new file mode 100644 index 0000000..4d0a20a --- /dev/null +++ b/BefundUITests/BefundUITests.swift @@ -0,0 +1,42 @@ +// +// BefundUITests.swift +// BefundUITests +// +// Created by ikoabe on 29.04.22. +// + +import XCTest + +class BefundUITests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // UI tests must launch the application that they test. + let app = XCUIApplication() + app.launch() + + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testLaunchPerformance() throws { + if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { + // This measures how long it takes to launch your application. + measure(metrics: [XCTApplicationLaunchMetric()]) { + XCUIApplication().launch() + } + } + } +} diff --git a/BefundUITests/BefundUITestsLaunchTests.swift b/BefundUITests/BefundUITestsLaunchTests.swift new file mode 100644 index 0000000..3fbb66c --- /dev/null +++ b/BefundUITests/BefundUITestsLaunchTests.swift @@ -0,0 +1,32 @@ +// +// BefundUITestsLaunchTests.swift +// BefundUITests +// +// Created by ikoabe on 29.04.22. +// + +import XCTest + +class BefundUITestsLaunchTests: XCTestCase { + + override class var runsForEachTargetApplicationUIConfiguration: Bool { + true + } + + override func setUpWithError() throws { + continueAfterFailure = false + } + + func testLaunch() throws { + let app = XCUIApplication() + app.launch() + + // Insert steps here to perform after app launch but before taking a screenshot, + // such as logging into a test account or navigating somewhere in the app + + let attachment = XCTAttachment(screenshot: app.screenshot()) + attachment.name = "Launch Screen" + attachment.lifetime = .keepAlways + add(attachment) + } +}