├── Logo.heic
├── Logo.xcf
├── preview.png
├── JKM Logo.png
├── Logo_rund.png
├── Icons
├── icon-1024.png
├── icon-20.png
├── icon-29.png
├── icon-40.png
├── icon-60.png
├── icon-76.png
├── icon-29@2x.png
├── icon-29@3x.png
├── icon-40@2x.png
├── icon-60@2x.png
├── icon-60@3x.png
├── icon-76@2x.png
└── icon-83,5@2x.png
├── MensaGuthaben
├── Assets.xcassets
│ ├── Contents.json
│ └── AppIcon.appiconset
│ │ ├── icon-20.png
│ │ ├── icon-29.png
│ │ ├── icon-40.png
│ │ ├── icon-41.png
│ │ ├── icon-42.png
│ │ ├── icon-60.png
│ │ ├── icon-76.png
│ │ ├── icon-1024.png
│ │ ├── icon-29@2x.png
│ │ ├── icon-29@3x.png
│ │ ├── icon-40@2x.png
│ │ ├── icon-40@3x.png
│ │ ├── icon-60@3x.png
│ │ ├── icon-76@2x.png
│ │ ├── icon-29@2x-1.png
│ │ ├── icon-40@2x-1.png
│ │ ├── icon-40@3x-1.png
│ │ ├── icon-83,5@2x.png
│ │ └── Contents.json
├── Preview Content
│ └── Preview Assets.xcassets
│ │ └── Contents.json
├── de.lproj
│ ├── LaunchScreen.strings
│ ├── InfoPlist.strings
│ └── Localizable.strings
├── MensaGuthaben.entitlements
├── Base.lproj
│ ├── InfoPlist.strings
│ ├── Localizable.strings
│ └── LaunchScreen.storyboard
├── Views
│ ├── Helpers
│ │ ├── TextRow.swift
│ │ ├── CheckboxSettingRow.swift
│ │ ├── DarkmodeTextColor.swift
│ │ ├── BalanceView.swift
│ │ ├── HttpLinkRow.swift
│ │ └── ChartsContainer.swift
│ ├── AddCanteenView.swift
│ ├── HistoryDetailView.swift
│ ├── LegalView.swift
│ ├── OpenSourceLicencesView.swift
│ ├── SupportedCanteensView.swift
│ ├── MainView.swift
│ ├── HistoryView.swift
│ └── SettingsView.swift
├── Classes
│ ├── CardScannerDelegate.swift
│ ├── Settings.swift
│ ├── HistoryDatabase.swift
│ └── CardScanner.swift
├── Models
│ ├── Cards.swift
│ ├── HistoryEntry.swift
│ ├── Balance.swift
│ └── HistoryData.swift
├── AppDelegate.swift
├── Info.plist
└── SceneDelegate.swift
├── MensaGuthaben.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── swiftpm
│ │ └── Package.resolved
└── project.pbxproj
├── .gitignore
├── README.md
└── LICENSE
/Logo.heic:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Logo.heic
--------------------------------------------------------------------------------
/Logo.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Logo.xcf
--------------------------------------------------------------------------------
/preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/preview.png
--------------------------------------------------------------------------------
/JKM Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/JKM Logo.png
--------------------------------------------------------------------------------
/Logo_rund.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Logo_rund.png
--------------------------------------------------------------------------------
/Icons/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-1024.png
--------------------------------------------------------------------------------
/Icons/icon-20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-20.png
--------------------------------------------------------------------------------
/Icons/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-29.png
--------------------------------------------------------------------------------
/Icons/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-40.png
--------------------------------------------------------------------------------
/Icons/icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-60.png
--------------------------------------------------------------------------------
/Icons/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-76.png
--------------------------------------------------------------------------------
/Icons/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-29@2x.png
--------------------------------------------------------------------------------
/Icons/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-29@3x.png
--------------------------------------------------------------------------------
/Icons/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-40@2x.png
--------------------------------------------------------------------------------
/Icons/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-60@2x.png
--------------------------------------------------------------------------------
/Icons/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-60@3x.png
--------------------------------------------------------------------------------
/Icons/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-76@2x.png
--------------------------------------------------------------------------------
/Icons/icon-83,5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/Icons/icon-83,5@2x.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/MensaGuthaben/Preview Content/Preview Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/MensaGuthaben/de.lproj/LaunchScreen.strings:
--------------------------------------------------------------------------------
1 |
2 | /* Class = "UILabel"; text = "MensaBalance"; ObjectID = "JGq-ja-n4W"; */
3 | "JGq-ja-n4W.text" = "MensaGuthaben";
4 |
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-20.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-29.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-41.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-41.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-42.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-42.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-60.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-1024.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-29@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-29@2x-1.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-40@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-40@2x-1.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-40@3x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-40@3x-1.png
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-83,5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheJKM/MensaGuthaben-iOS/HEAD/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/icon-83,5@2x.png
--------------------------------------------------------------------------------
/MensaGuthaben.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MensaGuthaben.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/MensaGuthaben/MensaGuthaben.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.developer.nfc.readersession.formats
6 |
7 | TAG
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/MensaGuthaben/Base.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /*
2 | InfoPlist.strings
3 | MensaGuthaben
4 |
5 | Created by Johannes Kreutz on 04.02.20.
6 | Copyright © 2020 - 2021 Johannes Kreutz. All rights reserved.
7 |
8 | This file is part of MensaGuthaben.
9 |
10 | MensaGuthaben is free software: you can redistribute it and/or modify
11 | it under the terms of the GNU General Public License as published by
12 | the Free Software Foundation, either version 3 of the License, or
13 | (at your option) any later version.
14 |
15 | MensaGuthaben is distributed in the hope that it will be useful,
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | GNU General Public License for more details.
19 |
20 | You should have received a copy of the GNU General Public License
21 | along with MensaGuthaben. If not, see .
22 | */
23 |
24 | "CFBundleDisplayName" = "MensaBalance";
25 | "NSHumanReadableCopyright" = "2019 - 2021 Johannes Kreutz. All rights reserved.";
26 |
--------------------------------------------------------------------------------
/MensaGuthaben/de.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /*
2 | InfoPlist.strings
3 | MensaGuthaben
4 |
5 | Created by Johannes Kreutz on 04.02.20.
6 | Copyright © 2020 - 2021 Johannes Kreutz. All rights reserved.
7 |
8 | This file is part of MensaGuthaben.
9 |
10 | MensaGuthaben is free software: you can redistribute it and/or modify
11 | it under the terms of the GNU General Public License as published by
12 | the Free Software Foundation, either version 3 of the License, or
13 | (at your option) any later version.
14 |
15 | MensaGuthaben is distributed in the hope that it will be useful,
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | GNU General Public License for more details.
19 |
20 | You should have received a copy of the GNU General Public License
21 | along with MensaGuthaben. If not, see .
22 | */
23 |
24 | "CFBundleDisplayName" = "MensaGuthaben";
25 | "NSHumanReadableCopyright" = "2019 - 2021 Johannes Kreutz. Alle Rechte vorbehalten.";
26 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/Helpers/TextRow.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TextRow.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 24.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | struct TextRow: View {
27 | let title: String
28 |
29 | var body: some View {
30 | Text("\(title)")
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/MensaGuthaben/Classes/CardScannerDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CardScannerDelegate.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 26.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import Foundation
25 |
26 | protocol CardScannerDelegate {
27 | func newDataAvailable(current: Int, previous: Int, card: Int)
28 | func sessionCancel()
29 | }
30 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/Helpers/CheckboxSettingRow.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CheckboxSettingRow.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 24.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | struct CheckboxSettingRow: View {
27 | @Binding var toggle: Bool
28 | let title: String
29 |
30 | var body: some View {
31 | Toggle(isOn: $toggle) {
32 | Text("\(title)")
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/MensaGuthaben/Models/Cards.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Cards.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 22.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import Foundation
25 |
26 | struct Card {
27 | let applicationId: UInt32
28 | let fileId: UInt8
29 | }
30 |
31 | class Cards {
32 | static let c = [
33 | "InterCard": Card(applicationId: 0x5F8415, fileId: 1),
34 | "MagnaCarta": Card(applicationId: 0xF080F3, fileId: 2)
35 | ]
36 | }
37 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/Helpers/DarkmodeTextColor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DarkmodeTextColor.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 27.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | extension Color {
27 |
28 | static let lightTextColor = Color(white: 0.0)
29 |
30 | static let darkTextColor = Color(white: 1.0)
31 |
32 | static func textColor(for colorScheme: ColorScheme) -> Color {
33 | return colorScheme == .dark ? darkTextColor : lightTextColor
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/Helpers/BalanceView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BalanceView.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 27.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | struct BalanceView: View {
27 | let title: String
28 | let balance: String
29 |
30 | var body: some View {
31 | HStack(alignment: .bottom) {
32 | Text("\(title)")
33 | .font(.system(size: 20))
34 | Spacer()
35 | Text("\(balance)")
36 | .font(.system(size: 40))
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/AddCanteenView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AddCanteenView.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 24.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | struct AddCanteenView: View {
27 | var body: some View {
28 | List {
29 | TextRow(title: "Not yet implemented.")
30 | }.listStyle(GroupedListStyle())
31 | .navigationBarTitle("add.title")
32 | }
33 | }
34 |
35 | struct AddCanteenView_Previews: PreviewProvider {
36 | static var previews: some View {
37 | AddCanteenView()
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/MensaGuthaben/Models/HistoryEntry.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HistoryEntry.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 22.09.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import Foundation
25 |
26 | class HistoryEntry: Identifiable {
27 |
28 | // MARK: Properties
29 | var id: Int32
30 | var balance: Balance = Balance()
31 | var card: String
32 | var date: Int32
33 |
34 | // MARK: Initialization
35 | init(id: Int32, current: Int32, previous: Int32, card: String, date: Int32) {
36 | self.id = id
37 | self.balance.setCurrent(current: Int(current))
38 | self.balance.setPrevious(previous: Int(previous))
39 | self.card = card
40 | self.date = date
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/MensaGuthaben.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved:
--------------------------------------------------------------------------------
1 | {
2 | "pins" : [
3 | {
4 | "identity" : "charts",
5 | "kind" : "remoteSourceControl",
6 | "location" : "https://github.com/danielgindi/Charts",
7 | "state" : {
8 | "revision" : "07b23476ad52b926be772f317d8f1d4511ee8d02",
9 | "version" : "4.1.0"
10 | }
11 | },
12 | {
13 | "identity" : "jkdesfirereader",
14 | "kind" : "remoteSourceControl",
15 | "location" : "https://github.com/TheJKM/JKDesFireReader",
16 | "state" : {
17 | "revision" : "7861369b7c65d1f62a2c9b79934f3a461c2fc175",
18 | "version" : "1.0.0"
19 | }
20 | },
21 | {
22 | "identity" : "promisekit",
23 | "kind" : "remoteSourceControl",
24 | "location" : "https://github.com/mxcl/PromiseKit",
25 | "state" : {
26 | "revision" : "a739d4effcbafd177a699bac8a7ff343f4d0706c",
27 | "version" : "6.22.0"
28 | }
29 | },
30 | {
31 | "identity" : "swift-algorithms",
32 | "kind" : "remoteSourceControl",
33 | "location" : "https://github.com/apple/swift-algorithms",
34 | "state" : {
35 | "revision" : "b14b7f4c528c942f121c8b860b9410b2bf57825e",
36 | "version" : "1.0.0"
37 | }
38 | },
39 | {
40 | "identity" : "swift-numerics",
41 | "kind" : "remoteSourceControl",
42 | "location" : "https://github.com/apple/swift-numerics",
43 | "state" : {
44 | "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b",
45 | "version" : "1.0.2"
46 | }
47 | }
48 | ],
49 | "version" : 2
50 | }
51 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/Helpers/HttpLinkRow.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HttpLinkRow.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 25.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | struct HttpLinkRow: View {
27 | @Environment(\.colorScheme) var colorScheme: ColorScheme
28 |
29 | let url: String
30 | let title: String
31 |
32 | var body: some View {
33 | Button(action: {
34 | if let url = URL(string: self.url) {
35 | UIApplication.shared.open(url)
36 | }
37 | }) {
38 | HStack {
39 | Text("\(title)")
40 | .foregroundColor(.textColor(for: self.colorScheme))
41 | Spacer()
42 | Image(systemName: "chevron.right")
43 | .foregroundColor(.gray)
44 | .font(Font.system(size: 18, weight: .semibold))
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/MensaGuthaben/Models/Balance.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CardValue.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 22.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import Foundation
25 |
26 | class Balance: ObservableObject {
27 |
28 | // MARK: Properties
29 |
30 | @Published var current: String
31 | @Published var previous: String
32 | @Published var currentDouble: Double
33 |
34 | // MARK: Initialization
35 |
36 | init() {
37 | self.current = "-,--€"
38 | self.previous = "-,--€"
39 | self.currentDouble = 0.0
40 | }
41 |
42 | // MARK: Private helpers
43 |
44 | private func convertToEuroValue(data: Int) -> String {
45 | return String(format: "%.2f", Double(data) / 1000).replacingOccurrences(of: ".", with: ",") + "€"
46 | }
47 |
48 | // MARK: Setters
49 |
50 | func setCurrent(current: Int) {
51 | self.current = convertToEuroValue(data: current)
52 | self.currentDouble = Double(current) / 1000
53 | }
54 |
55 | func setPrevious(previous: Int) {
56 | self.previous = convertToEuroValue(data: previous)
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/HistoryDetailView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HistoryDetailView.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 23.09.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | struct HistoryDetailView: View {
27 | let current: String
28 | let previous: String
29 | let date: String
30 | let card: String
31 |
32 | var body: some View {
33 | List {
34 | Section(header: Text("historyDetail.balance")) {
35 | Text(self.current)
36 | }
37 | Section(header: Text("historyDetail.last")) {
38 | Text(self.previous)
39 | }
40 | Section(header: Text("historyDetail.timestamp")) {
41 | Text(self.date)
42 | }
43 | Section(header: Text("historyDetail.id")) {
44 | Text(self.card)
45 | }
46 | }.listStyle(GroupedListStyle())
47 | .navigationBarTitle(self.date)
48 | }
49 | }
50 |
51 | struct HistoryDetailView_Previews: PreviewProvider {
52 | static var previews: some View {
53 | HistoryDetailView(current: "-,--€", previous: "-,--€", date: "23.09.2019 21:03", card: "1234567890")
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/LegalView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LegalView.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 24.08.19.
6 | // Copyright © 2019 - 2022 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | struct LegalView: View {
27 | var body: some View {
28 | List {
29 | Section(header: Text("legal.disclaimertitle")) {
30 | TextRow(title: NSLocalizedString("legal.disclaimer", comment: ""))
31 | .font(.system(size: 14))
32 | }
33 | Section(header: Text("legal.licensetitle")) {
34 | TextRow(title: NSLocalizedString("legal.license", comment: ""))
35 | .font(.system(size: 14))
36 | }
37 | Section(header: Text("legal.third")) {
38 | TextRow(title: NSLocalizedString("legal.oss", comment: ""))
39 | .font(.system(size: 14))
40 | NavigationLink("legal.osstitle", destination: OpenSourceLicencesView())
41 | }
42 | }.listStyle(GroupedListStyle())
43 | .navigationBarTitle("legal.title")
44 | }
45 | }
46 |
47 | struct LegalView_Previews: PreviewProvider {
48 | static var previews: some View {
49 | LegalView()
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/MensaGuthaben/Models/HistoryData.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HistoryData.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 22.09.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import Foundation
25 | import Combine
26 |
27 | class HistoryData: ObservableObject {
28 |
29 | // MARK: Combine helpers
30 | var objectWillChange = PassthroughSubject()
31 |
32 | // MARK: Properties
33 | @Published var data: [HistoryEntry]
34 | @Published var myData: [HistoryEntry] = []
35 |
36 | // MARK: Initialization
37 | init() {
38 | self.data = []
39 | self.myData = []
40 | }
41 |
42 | init(data: [HistoryEntry]) {
43 | self.data = data
44 | updateMyData(data: data)
45 | }
46 |
47 | // MARK: Private helpers
48 | private func updateMyData(data: [HistoryEntry]) {
49 | self.myData = []
50 | data.forEach { entry in
51 | if (entry.card == UserDefaults.myCard || UserDefaults.myCard == "0") {
52 | self.myData.append(entry)
53 | }
54 | }
55 | }
56 |
57 | // MARK: Setters
58 | func set(data: [HistoryEntry]) {
59 | self.data = data
60 | updateMyData(data: data)
61 | objectWillChange.send()
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/MensaGuthaben/Classes/Settings.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Settings.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 30.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import Foundation
25 |
26 | extension UserDefaults {
27 |
28 | private struct Keys {
29 | static let autoScanDisabled = "autoScanDisabled"
30 | static let myCard = "myCard"
31 | }
32 |
33 | static var autoScanDisabled: Bool {
34 | get {
35 | return UserDefaults.standard.bool(forKey: Keys.autoScanDisabled)
36 | }
37 | set {
38 | UserDefaults.standard.set(newValue, forKey: Keys.autoScanDisabled)
39 | }
40 | }
41 |
42 | static var myCard: String {
43 | get {
44 | return UserDefaults.standard.string(forKey: Keys.myCard) ?? "0"
45 | }
46 | set {
47 | UserDefaults.standard.set(newValue, forKey: Keys.myCard)
48 | }
49 | }
50 |
51 | }
52 |
53 | class SettingsStore: ObservableObject {
54 |
55 | @Published var autoScan: Bool = !UserDefaults.autoScanDisabled {
56 | didSet {
57 | UserDefaults.autoScanDisabled = !self.autoScan
58 | }
59 | }
60 |
61 | @Published var myCard: String = UserDefaults.myCard {
62 | didSet {
63 | UserDefaults.myCard = self.myCard
64 | }
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # ---> macOS
2 | .DS_Store
3 | .AppleDouble
4 | .LSOverride
5 |
6 | # Icon must end with two \r
7 | Icon
8 |
9 |
10 | # Thumbnails
11 | ._*
12 |
13 | # Files that might appear in the root of a volume
14 | .DocumentRevisions-V100
15 | .fseventsd
16 | .Spotlight-V100
17 | .TemporaryItems
18 | .Trashes
19 | .VolumeIcon.icns
20 |
21 | # Directories potentially created on remote AFP share
22 | .AppleDB
23 | .AppleDesktop
24 | Network Trash Folder
25 | Temporary Items
26 | .apdisk
27 |
28 | # Xcode
29 | #
30 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
31 |
32 | ## Build generated
33 | build/
34 | DerivedData/
35 |
36 | ## Various settings
37 | *.pbxuser
38 | !default.pbxuser
39 | *.mode1v3
40 | !default.mode1v3
41 | *.mode2v3
42 | !default.mode2v3
43 | *.perspectivev3
44 | !default.perspectivev3
45 | xcuserdata/
46 |
47 | ## Other
48 | *.moved-aside
49 | *.xccheckout
50 | *.xcscmblueprint
51 |
52 | ## Obj-C/Swift specific
53 | *.hmap
54 | *.ipa
55 | *.dSYM.zip
56 | *.dSYM
57 |
58 | ## Playgrounds
59 | timeline.xctimeline
60 | playground.xcworkspace
61 |
62 | # Swift Package Manager
63 | #
64 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
65 | # Packages/
66 | # Package.pins
67 | # Package.resolved
68 | .build/
69 |
70 | # CocoaPods
71 | #
72 | # We recommend against adding the Pods directory to your .gitignore. However
73 | # you should judge for yourself, the pros and cons are mentioned at:
74 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
75 | #
76 | # Pods/
77 |
78 | # Carthage
79 | #
80 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
81 | # Carthage/Checkouts
82 |
83 | Carthage/Build
84 |
85 | # fastlane
86 | #
87 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
88 | # screenshots whenever they are needed.
89 | # For more information about the recommended setup visit:
90 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
91 |
92 | fastlane/report.xml
93 | fastlane/Preview.html
94 | fastlane/screenshots/**/*.png
95 | fastlane/test_output
96 |
--------------------------------------------------------------------------------
/MensaGuthaben/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 22.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import UIKit
25 |
26 | @UIApplicationMain
27 | class AppDelegate: UIResponder, UIApplicationDelegate {
28 |
29 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
30 | // Override point for customization after application launch.
31 | return true
32 | }
33 |
34 | // MARK: UISceneSession Lifecycle
35 |
36 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
37 | // Called when a new scene session is being created.
38 | // Use this method to select a configuration to create the new scene with.
39 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
40 | }
41 |
42 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) {
43 | // Called when the user discards a scene session.
44 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
45 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
46 | }
47 |
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/MensaGuthaben/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en_US
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | $(MARKETING_VERSION)
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | LSRequiresIPhoneOS
22 |
23 | NFCReaderUsageDescription
24 | Wir benoetigen Zugriff auf die NFC-Schnittstelle, um deine Karte zu lesen.
25 | UIApplicationSceneManifest
26 |
27 | UIApplicationSupportsMultipleScenes
28 |
29 | UISceneConfigurations
30 |
31 | UIWindowSceneSessionRoleApplication
32 |
33 |
34 | UISceneConfigurationName
35 | Default Configuration
36 | UISceneDelegateClassName
37 | $(PRODUCT_MODULE_NAME).SceneDelegate
38 |
39 |
40 |
41 |
42 | UILaunchStoryboardName
43 | LaunchScreen
44 | UIRequiredDeviceCapabilities
45 |
46 | nfc
47 |
48 | UIRequiresFullScreen
49 |
50 | UISupportedInterfaceOrientations
51 |
52 | UIInterfaceOrientationPortrait
53 | UIInterfaceOrientationLandscapeLeft
54 | UIInterfaceOrientationLandscapeRight
55 |
56 | UISupportedInterfaceOrientations~ipad
57 |
58 | UIInterfaceOrientationPortrait
59 | UIInterfaceOrientationPortraitUpsideDown
60 | UIInterfaceOrientationLandscapeLeft
61 | UIInterfaceOrientationLandscapeRight
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/MensaGuthaben/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "icon-41.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "icon-60.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29@2x-1.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "icon-29@3x.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "icon-40@2x.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "icon-40@3x.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "icon-40@3x-1.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "icon-60@3x.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "size" : "20x20",
53 | "idiom" : "ipad",
54 | "filename" : "icon-20.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "icon-40.png",
61 | "scale" : "2x"
62 | },
63 | {
64 | "size" : "29x29",
65 | "idiom" : "ipad",
66 | "filename" : "icon-29.png",
67 | "scale" : "1x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "icon-29@2x.png",
73 | "scale" : "2x"
74 | },
75 | {
76 | "size" : "40x40",
77 | "idiom" : "ipad",
78 | "filename" : "icon-42.png",
79 | "scale" : "1x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "icon-40@2x-1.png",
85 | "scale" : "2x"
86 | },
87 | {
88 | "size" : "76x76",
89 | "idiom" : "ipad",
90 | "filename" : "icon-76.png",
91 | "scale" : "1x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "icon-76@2x.png",
97 | "scale" : "2x"
98 | },
99 | {
100 | "size" : "83.5x83.5",
101 | "idiom" : "ipad",
102 | "filename" : "icon-83,5@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "1024x1024",
107 | "idiom" : "ios-marketing",
108 | "filename" : "icon-1024.png",
109 | "scale" : "1x"
110 | }
111 | ],
112 | "info" : {
113 | "version" : 1,
114 | "author" : "xcode"
115 | }
116 | }
--------------------------------------------------------------------------------
/MensaGuthaben/Views/OpenSourceLicencesView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // OpenSourceLicencesView.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 24.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | struct OpenSourceLicencesView: View {
27 | var body: some View {
28 | List {
29 | Section(header: Text("PROMISEKIT")) {
30 | TextRow(title: "Copyright 2016-present, Max Howell; mxcl@me.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.").font(.system(size: 14))
31 | }
32 | Section(header: Text("CHARTS")) {
33 | TextRow(title: "Copyright 2016 Daniel Cohen Gindi & Philipp Jahoda\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.").font(.system(size: 14))
34 | }
35 | }.listStyle(GroupedListStyle())
36 | .navigationBarTitle("oss.third")
37 | }
38 | }
39 |
40 | struct OpenSourceLicencesView_Previews: PreviewProvider {
41 | static var previews: some View {
42 | OpenSourceLicencesView()
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MensaGuthaben for iOS
2 | This is a simple tool to read the current balance on your canteen prepaid card, made possible by CoreNFC in iOS 13 and made with SwiftUI. Simply place your card at the top of your iPhone!
3 |
4 | [](https://apps.apple.com/de/app/mensaguthaben/id1479619088)
5 |
6 | 
7 |
8 | # Compatibility
9 | You will need an iPhone 7 or newer running iOS 13 or newer.
10 |
11 | The app is tested with the following universities:
12 | - HS Aschaffenburg
13 | - Uni Bamberg
14 | - Uni Bochum
15 | - TU Braunschweig
16 | - TU Darmstadt
17 | - h_da Darmstadt
18 | - TU Dresden Emeal
19 | - Hochschule Furtwangen
20 | - Westfälische Hochschule Gelsenkirchen
21 | - Uni Gießen
22 | - Uni Greifswald
23 | - Uni Hannover
24 | - HS Hannover
25 | - TU Ilmenau
26 | - HS Koblenz
27 | - Uni Koblenz
28 | - Uni Köln
29 | - FH Köln
30 | - Uni Leipzig
31 | - HfWU Nürtingen-Geislingen
32 | - Uni Saarland
33 | - Studentenwerk Schleswig-Holstein (Flensburg, Heide, Kiel, Lübeck, Wedel)
34 | - HDM Stuttgart
35 | - Uni Stuttgart
36 | - Uni Ulm
37 | - FH Würzburg
38 | - Uni Würzburg
39 | - HAW Würzburg-Schweinfurt
40 |
41 | However, it should also work with the cards of these universities, but they are not tested yet. If you successfully scanned some of these (or another) card, please let me know!
42 | - Uni Bayreuth (only print balance)
43 | - Uni Bielefeld (only newer cards)
44 | - FH Brandenburg
45 | - Uni Bremen
46 | - HS Bremerhaven
47 | - TU Clausthal
48 | - HS Freiburg
49 | - DH Gera Eisenbach
50 | - MLU Halle
51 | - HAW Hamburg
52 | - Uni Heidelberg
53 | - Uni Hohenheim (only newer cards)
54 | - Uni Lüneburg
55 | - Uni Magdeburg
56 | - DHBW Mosbach
57 | - HS Offenburg
58 | - Uni Osnabrück
59 | - HS Osnabrück
60 | - HS für Gestaltung Schwäbisch Gmünd
61 | - HS Zittau/Görlitz
62 |
63 | Thanks to all contributors of [this](https://github.com/jakobwenzel/MensaGuthaben) android app, which worked as a source for this list and some card data. Thanks to all who tested their cards and contributed to this list!
64 |
65 | # Contributing
66 | - If you find a bug or want to provide some feedback/ideas, please open an issue.
67 | - If you want to add a new card of an unsupported university / canteen, please open an issue. I plan to add a feature to scan such cards, so we can easily find the required data.
68 | - If you want to contribute code, please open a pull request.
69 |
70 | # Privacy
71 | This app does neither collect any data nor does it connect to any web service.
72 |
73 | # Licence
74 | Licensed under the GNU General Public License v3.
75 |
76 | This program is free software: you can redistribute it and/or modify
77 | it under the terms of the GNU General Public License as published by
78 | the Free Software Foundation, either version 3 of the License, or
79 | (at your option) any later version.
80 |
81 | This program is distributed in the hope that it will be useful,
82 | but WITHOUT ANY WARRANTY; without even the implied warranty of
83 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84 | GNU General Public License for more details.
85 |
86 | You should have received a copy of the GNU General Public License
87 | along with this program. If not, see .
88 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/SupportedCanteensView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SupportedCanteensView.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 24.08.19.
6 | // Copyright © 2019 - 2023 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | struct SupportedCanteensView: View {
27 | let supported: [String] = ["HS Aschaffenburg", "Uni Bamberg", "Uni Bochum", "TU Braunschweig", "TU Darmstadt", "h_da Darmstadt", "TU Dresden Emeal", "Hochschule Furtwangen", "Westfälische Hochschule Gelsenkirchen", "Uni Gießen", "Uni Greifswald", "Uni Hannover", "HS Hannover", "TU Ilmenau", "HS Koblenz", "Uni Koblenz", "Uni Köln", "FH Köln", "Uni Leipzig", "HfWU Nürtingen-Geislingen", "Uni Saarland", "Studentenwerk Schleswig-Holstein (Flensburg, Heide, Kiel, Lübeck, Wedel)", "HDM Stuttgart", "Uni Stuttgart", "Uni Ulm", "FH Würzburg", "Uni Würzburg", "HAW Würzburg-Schweinfurt"]
28 | let untested: [String] = ["Uni Bayreuth (nur Druckguthaben)", "Uni Bielefeld (nur neuere Karten)", "FH Brandenburg", "Uni Bremen", "HS Bremerhaven", "TU Clausthal", "HS Freiburg", "DH Gera Eisenbach", "MLU Halle", "HAW Hamburg", "Uni Heidelberg", "Uni Hohenheim (nur neuere Karten)", "Uni Lüneburg", "Uni Magdeburg", "DHBW Mosbach", "HS Offenburg", "Uni Osnabrück", "HS Osnabrück", "HS für Gestaltung Schwäbisch Gmünd", "HS Zittau/Görlitz"]
29 |
30 | private func getSupported() -> String {
31 | var supportedString: String = ""
32 | for x in supported {
33 | if (supportedString != "") {
34 | supportedString += "\n"
35 | }
36 | supportedString += "\u{2022} \(x)"
37 | }
38 | return supportedString
39 | }
40 | private func getUntested() -> String {
41 | var untestedString: String = ""
42 | for x in untested {
43 | if (untestedString != "") {
44 | untestedString += "\n"
45 | }
46 | untestedString += "\u{2022} \(x)"
47 | }
48 | return untestedString
49 | }
50 |
51 | var body: some View {
52 | List {
53 | Section(header: Text("supported.tested")) {
54 | TextRow(title: getSupported())
55 | .font(.system(size: 14))
56 | }
57 | Section(header: Text("supported.untested")) {
58 | TextRow(title: NSLocalizedString("supported.infotext", comment: ""))
59 | HttpLinkRow(url: "https://github.com/TheJKM/MensaGuthaben-iOS", title: NSLocalizedString("supported.github", comment: ""))
60 | HttpLinkRow(url: "mailto:mensaguthaben@jkm-marburg.de", title: NSLocalizedString("supported.email", comment: ""))
61 | TextRow(title: getUntested())
62 | .font(.system(size: 14))
63 | }
64 | }.listStyle(GroupedListStyle())
65 | .navigationBarTitle("supported.title")
66 | }
67 | }
68 |
69 | struct SupportedCanteensView_Previews: PreviewProvider {
70 | static var previews: some View {
71 | SupportedCanteensView()
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/MainView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MainView.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 22.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | struct MainView: View {
27 | @State private var showSettingsModal: Bool = false
28 | @EnvironmentObject var balance: Balance
29 | @EnvironmentObject var settings: SettingsStore
30 | @EnvironmentObject var historyData: HistoryData
31 | let sceneDelegate: SceneDelegate
32 |
33 | var body: some View {
34 | NavigationView {
35 | VStack {
36 | ScrollView(.vertical, showsIndicators: false) {
37 | VStack(alignment: .leading) {
38 | BalanceView(title: NSLocalizedString("main.actual", comment: ""), balance: self.balance.current)
39 | BalanceView(title: NSLocalizedString("main.previous", comment: ""), balance: self.balance.previous)
40 | HStack {
41 | Button(action: {
42 | self.sceneDelegate.scanCard()
43 | }) {
44 | Text("main.scan")
45 | .foregroundColor(.white)
46 | .frame(maxWidth: .infinity)
47 | }
48 | .padding()
49 | .background(Color.blue)
50 | .cornerRadius(10)
51 | }.padding(.bottom, 15).padding(.top, 5)
52 | VStack {
53 | HStack {
54 | Text("main.history").font(.system(size: 15)).foregroundColor(.gray)
55 | Spacer()
56 | }
57 | HStack {
58 | ChartsContainer(historyData: self.historyData.myData).frame(height: 200.0)
59 | }
60 | }
61 | HStack {
62 | NavigationLink("main.showfull", destination: HistoryView(sceneDelegate: sceneDelegate))
63 | .foregroundColor(.blue)
64 | .frame(maxWidth: .infinity)
65 | .padding()
66 | .cornerRadius(10)
67 | .overlay(
68 | RoundedRectangle(cornerRadius: 10).stroke(Color.blue, lineWidth: 2)
69 | )
70 | }.padding(.leading, 2).padding(.trailing, 2)
71 | }
72 | }.padding()
73 | }
74 | .navigationBarTitle("title")
75 | .navigationBarItems(trailing: Button(action: {
76 | self.showSettingsModal = true
77 | }) {
78 | Image(systemName: "line.horizontal.3")
79 | Text("")
80 | }).sheet(isPresented: $showSettingsModal, onDismiss: {self.showSettingsModal = false}, content: {
81 | SettingsView(sceneDelegate: self.sceneDelegate).environmentObject(self.settings)
82 | })
83 | }
84 | }
85 | }
86 |
87 | struct MainView_Previews: PreviewProvider {
88 | static var previews: some View {
89 | MainView(sceneDelegate: SceneDelegate())
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/Helpers/ChartsContainer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ChartsContainer.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 24.09.19.
6 | // Copyright © 2019 - 2022 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 | import Charts
26 |
27 | struct ChartsContainer: UIViewRepresentable {
28 | let historyData: [HistoryEntry]
29 |
30 | // MARK: View Representable functions
31 | func makeUIView(context: UIViewRepresentableContext) -> LineChartView {
32 | // Create and configure line chart
33 | let lineChartView: LineChartView = LineChartView()
34 | lineChartView.translatesAutoresizingMaskIntoConstraints = false
35 | lineChartView.animate(xAxisDuration: 0.5, yAxisDuration: 0.5, easingOption: .easeOutSine)
36 | lineChartView.noDataTextColor = UIColor.label
37 | lineChartView.noDataText = NSLocalizedString("charts.less", comment: "")
38 | lineChartView.isUserInteractionEnabled = false
39 | lineChartView.legend.enabled = false
40 | lineChartView.xAxis.enabled = false
41 | lineChartView.leftAxis.enabled = false
42 | lineChartView.rightAxis.enabled = false
43 | lineChartView.minOffset = 15
44 | // Create initial data
45 | setupChartData(chart: lineChartView)
46 | return lineChartView
47 | }
48 |
49 | func updateUIView(_ uiView: LineChartView, context: UIViewRepresentableContext) {
50 | setupChartData(chart: uiView)
51 | }
52 |
53 | // MARK: Chart data setup
54 | func setupChartData(chart: LineChartView) {
55 | // Create point array
56 | var entry: [ChartDataEntry] = []
57 | var c: Int = (historyData.count > 7) ? 7 : (historyData.count - 1)
58 | while (c >= 0) {
59 | entry.append(ChartDataEntry(x: Double(10 - c), y: historyData[c].balance.currentDouble))
60 | c -= 1
61 | }
62 | // Create and configure chart data set
63 | let dataSet: LineChartDataSet = LineChartDataSet(entries: entry, label: "balance history")
64 | let data: LineChartData = LineChartData(dataSet: dataSet)
65 | data.setDrawValues(true)
66 | dataSet.colors = [UIColor.systemBlue]
67 | dataSet.setCircleColor(UIColor.systemBlue)
68 | dataSet.circleHoleColor = UIColor.systemBlue
69 | dataSet.circleRadius = 6.0
70 | // Gradient colors
71 | let gradientColors = [UIColor.systemBlue.cgColor, UIColor.clear.cgColor] as CFArray
72 | guard let gradient = CGGradient.init(colorsSpace: CGColorSpaceCreateDeviceRGB(), colors: gradientColors, locations: [1.0, 0.0]) else {
73 | return
74 | }
75 | dataSet.fill = LinearGradientFill(gradient: gradient, angle: 90.0)
76 | dataSet.drawFilledEnabled = true
77 | dataSet.label = "Test"
78 | // Setup formatter
79 | dataSet.valueFormatter = ChartFormatter()
80 | dataSet.valueFont = .systemFont(ofSize: 10.0)
81 | dataSet.valueTextColor = .label
82 | // Apply data to chart
83 | if (entry.count > 1) {
84 | chart.data = data
85 | }
86 | }
87 |
88 | }
89 |
90 | class ChartFormatter: ValueFormatter {
91 |
92 | func stringForValue(_ value: Double, entry: ChartDataEntry, dataSetIndex: Int, viewPortHandler: ViewPortHandler?) -> String {
93 | return String(format: "%.2f", value).replacingOccurrences(of: ".", with: ",")
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/HistoryView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HistoryView.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 22.09.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | struct HistoryView: View {
27 | @State private var deleteSheet = false
28 | @State private var displayMode = 1
29 | @EnvironmentObject var historyData: HistoryData
30 | @EnvironmentObject var settings: SettingsStore
31 | let sceneDelegate: SceneDelegate
32 |
33 | private func getDateString(timestamp: Int32) -> String {
34 | let date: Date = Date(timeIntervalSince1970: Double(timestamp))
35 | let dateFormatter: DateFormatter = DateFormatter()
36 | dateFormatter.timeZone = TimeZone(abbreviation: TimeZone.current.identifier)
37 | dateFormatter.locale = NSLocale.current
38 | dateFormatter.dateFormat = "dd.MM.yyyy HH:mm"
39 | return dateFormatter.string(from: date)
40 | }
41 |
42 | private func createList() -> [HistoryEntry] {
43 | var showData: [HistoryEntry] = []
44 | self.historyData.data.forEach { entry in
45 | if (self.displayMode == 2 || self.settings.myCard == entry.card) {
46 | showData.append(entry)
47 | }
48 | }
49 | return showData
50 | }
51 |
52 | private func getDeleteId(index: Int) -> Int32 {
53 | if (self.displayMode == 2) {
54 | return self.historyData.data[index].id
55 | } else {
56 | var count: Int = 0
57 | for entry in self.historyData.data {
58 | if (count == index) {
59 | return entry.id
60 | }
61 | if (self.settings.myCard == entry.card) {
62 | count += 1
63 | }
64 | }
65 | }
66 | return 0
67 | }
68 |
69 | var body: some View {
70 | VStack {
71 | Picker("history.mode", selection: $displayMode) {
72 | Text("history.my").tag(1)
73 | Text("history.all").tag(2)
74 | }
75 | .pickerStyle(SegmentedPickerStyle())
76 | .padding(.horizontal)
77 |
78 | List {
79 | ForEach(self.createList(), id: \.id) { entry in
80 | NavigationLink("\(entry.balance.current) (\(self.getDateString(timestamp: entry.date)))", destination: HistoryDetailView(current: entry.balance.current, previous: entry.balance.previous, date: self.getDateString(timestamp: entry.date), card: entry.card))
81 | }.onDelete { (IndexSet) in
82 | self.sceneDelegate.deleteEntry(id: self.getDeleteId(index: IndexSet.first!))
83 | }
84 | }
85 | }
86 | .navigationBarTitle("history.title")
87 | .navigationBarItems(trailing: Button(action: {
88 | self.deleteSheet = true
89 | }) {
90 | Image(systemName: "trash.fill")
91 | })
92 | .actionSheet(isPresented: $deleteSheet) {
93 | ActionSheet(title: Text("history.deleteQuestion"), buttons: [
94 | .destructive(Text("history.delete"), action: {
95 | self.sceneDelegate.deleteFullHistory()
96 | }),
97 | .cancel(Text("history.cancel"))
98 | ])
99 | }
100 | }
101 | }
102 |
103 | let historyDataDemo: HistoryData = HistoryData(data: [HistoryEntry(id: 1, current: 10, previous: 10, card: "12345", date: 13424234)])
104 |
105 | struct HistoryView_Previews: PreviewProvider {
106 | static var previews: some View {
107 | HistoryView(sceneDelegate: SceneDelegate())
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/MensaGuthaben/Base.lproj/Localizable.strings:
--------------------------------------------------------------------------------
1 | /*
2 | Localizable.strings
3 | MensaGuthaben
4 |
5 | Created by Johannes Kreutz on 01.12.19.
6 | Copyright © 2019 - 2021 Johannes Kreutz. All rights reserved.
7 |
8 | This file is part of MensaGuthaben.
9 |
10 | MensaGuthaben is free software: you can redistribute it and/or modify
11 | it under the terms of the GNU General Public License as published by
12 | the Free Software Foundation, either version 3 of the License, or
13 | (at your option) any later version.
14 |
15 | MensaGuthaben is distributed in the hope that it will be useful,
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | GNU General Public License for more details.
19 |
20 | You should have received a copy of the GNU General Public License
21 | along with MensaGuthaben. If not, see .
22 | */
23 |
24 | // App wide strings
25 | "title" = "MensaBalance";
26 |
27 | // Main view
28 | "main.actual" = "Current balance";
29 | "main.previous" = "Previous transaction";
30 | "main.scan" = "Scan again";
31 | "main.history" = "HISTORY";
32 | "main.showfull" = "Show full history";
33 |
34 | // Charts view
35 | "charts.less" = "Not enough scans.";
36 |
37 | // Settings view
38 | "settings.autoscan" = "Auto-scan on open";
39 | "settings.mycard" = "MY CARD";
40 | "settings.idexplanation" = "At first scan your card's ID was stored. With the ID you can filter the history, if you scanned your friend's cards.";
41 | "settings.reset" = "Re-set my card's ID";
42 | "settings.support" = "SUPPORT";
43 | "settings.supported" = "Supported canteens";
44 | "settings.addmy" = "Add my canteen";
45 | "settings.about" = "ABOUT THE APP";
46 | "settings.legal" = "Legal infos";
47 | "settings.githublink" = "MensaBalance on GitHub";
48 | "settings.title" = "Settings";
49 | "settings.done" = "Done";
50 |
51 | // Legal view
52 | "legal.disclaimertitle" = "DISCLAIMER";
53 | "legal.disclaimer" = "No liability for the content of external links.\nTHE SOFTWARE IS PROVIDED WITHOUT ANY EXPLICIT OR IMPLICIT GUARANTY, INCLUDING THE GUARANTY RELATING TO THE USE FOR THE DESIGNATED OR A PERTICULAR PURPOSE AS WELL AS INFRINGEMENTS OF ANY KIND, BUT NOT LIMITED TO THAT. THE AUTHORS OR OWNERS OF COPYRIGHT ARE NOT TO BE HELD LIABLE IN ANY CASE FOR DAMAGE OR DEMANDS OF ANY KIND, WETHER RESULTING FROM THE PERFORMANCE OF A CONTRACT, TORT OR OTHERWISE IN CONNECTION WITH THE SOFTWARE OR OTHER USE OF THE SOFTWARE.";
54 | "legal.licensetitle" = "LICENSE";
55 | "legal.license" = "MensaBalance iOS\nCopyright (C) 2019 - 2022 Johannes Kreutz.\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not, see .";
56 | "legal.third" = "THIRD PARTIES";
57 | "legal.oss" = "MensaBalance uses OpenSource-software, whose licences are viewable here.";
58 | "legal.osstitle" = "OpenSource-licenses";
59 | "legal.title" = "Legal";
60 |
61 | // OpenSource licence view
62 | "oss.third" = "Third party licences";
63 |
64 | // Supported canteens view
65 | "supported.tested" = "TESTED CARDS";
66 | "supported.untested" = "NON-TESTED CARDS";
67 | "supported.infotext" = "The following cards should work with the app, although they're not tested yet. You used the app successfully with one of those, or another card? Write us:";
68 | "supported.github" = "On GitHub";
69 | "supported.email" = "Per E-Mail";
70 | "supported.title" = "Supported canteens";
71 |
72 | // Add canteen view
73 | "add.title" = "Add canteen";
74 |
75 | // History view
76 | "history.mode" = "View mode";
77 | "history.my" = "My card";
78 | "history.all" = "All";
79 | "history.title" = "History";
80 | "history.deleteQuestion" = "Do you really want to delete the whole history?";
81 | "history.delete" = "Delete";
82 | "history.cancel" = "Cancel";
83 |
84 | // History detail view
85 | "historyDetail.balance" = "BALANCE";
86 | "historyDetail.last" = "LAST TRANSACTION";
87 | "historyDetail.timestamp" = "TIMESTAMP";
88 | "historyDetail.id" = "CARD-ID";
89 |
90 | // Reading session
91 | "reader.subtitle" = "Please put your card at the top of your iPhone.";
92 | "reader.failed" = "Sorry, reading your card failed.";
93 | "reader.unknown" = "Sorry, reading your card failed: Unknown card";
94 | "reader.error" = "Sorry, reading your card failed: Error on reading";
95 | "reader.code" = "Sorry, reading your card failed. (Error code ";
96 |
--------------------------------------------------------------------------------
/MensaGuthaben/de.lproj/Localizable.strings:
--------------------------------------------------------------------------------
1 | /*
2 | Localizable.strings
3 | MensaGuthaben
4 |
5 | Created by Johannes Kreutz on 01.12.19.
6 | Copyright © 2019 - 2021 Johannes Kreutz. All rights reserved.
7 |
8 | This file is part of MensaGuthaben.
9 |
10 | MensaGuthaben is free software: you can redistribute it and/or modify
11 | it under the terms of the GNU General Public License as published by
12 | the Free Software Foundation, either version 3 of the License, or
13 | (at your option) any later version.
14 |
15 | MensaGuthaben is distributed in the hope that it will be useful,
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | GNU General Public License for more details.
19 |
20 | You should have received a copy of the GNU General Public License
21 | along with MensaGuthaben. If not, see .
22 | */
23 |
24 | // App wide strings
25 | "title" = "MensaGuthaben";
26 |
27 | // Main view
28 | "main.actual" = "Aktuelles Guthaben";
29 | "main.previous" = "Letzte Transaktion";
30 | "main.scan" = "Erneut scannen";
31 | "main.history" = "VERLAUF";
32 | "main.showfull" = "Ganzen Verlauf anzeigen";
33 |
34 | // Charts view
35 | "charts.less" = "Nicht genug Scans vorhanden.";
36 |
37 | // Settings view
38 | "settings.autoscan" = "Beim Öffnen scannen";
39 | "settings.mycard" = "MEINE KARTE";
40 | "settings.idexplanation" = "Beim ersten Scan wurde die ID deiner Karte gespeichert. Anhand dieser ID kannst du den Verlauf filtern, falls du auch Karten von Freunden gescannt hast.";
41 | "settings.reset" = "Meine Karten-ID neu setzen";
42 | "settings.support" = "SUPPORT";
43 | "settings.supported" = "Unterstützte Mensen";
44 | "settings.addmy" = "Meine Mensa hinzufügen";
45 | "settings.about" = "ÜBER DIE APP";
46 | "settings.legal" = "Rechtliches";
47 | "settings.githublink" = "MensaGuthaben auf GitHub";
48 | "settings.title" = "Einstellungen";
49 | "settings.done" = "Fertig";
50 |
51 | // Legal view
52 | "legal.disclaimertitle" = "HAFTUNGSAUSSCHLUSS";
53 | "legal.disclaimer" = "Keine Haftung für die Inhalte externer Links.\nDIE SOFTWARE WIRD OHNE JEDE AUSDRÜCKLICHE ODER IMPLIZIERTE GARANTIE BEREITGESTELLT, EINSCHLIESSLICH DER GARANTIE ZUR BENUTZUNG FÜR DEN VORGESEHENEN ODER EINEM BESTIMMTEN ZWECK SOWIE JEGLICHER RECHTSVERLETZUNG, JEDOCH NICHT DARAUF BESCHRÄNKT. IN KEINEM FALL SIND DIE AUTOREN ODER COPYRIGHTINHABER FÜR JEGLICHEN SCHADEN ODER SONSTIGE ANSPRÜCHE HAFTBAR ZU MACHEN, OB INFOLGE DER ERFÜLLUNG EINES VERTRAGES, EINES DELIKTES ODER ANDERS IM ZUSAMMENHANG MIT DER SOFTWARE ODER SONSTIGER VERWENDUNG DER SOFTWARE ENTSTANDEN.";
54 | "legal.licensetitle" = "LIZENZ";
55 | "legal.license" = "MensaGuthaben iOS\nCopyright (C) 2019 - 2022 Johannes Kreutz.\n\nDieses Programm ist freie Software. Sie können es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation veröffentlicht, weitergeben und/oder modifizieren, entweder gemäß Version 3 der Lizenz oder (nach Ihrer Option) jeder späteren Version.\n\nDie Veröffentlichung dieses Programms erfolgt in der Hoffnung, dass es Ihnen von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar ohne die implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT FÜR EINEN BESTIMMTEN ZWECK. Details finden Sie in der GNU General Public License.\n\nSie sollten ein Exemplar der GNU General Public License zusammen mit diesem Programm erhalten haben. Falls nicht, siehe http://www.gnu.org/licenses/.";
56 | "legal.third" = "DRITTANBIETER";
57 | "legal.oss" = "MensaGuthaben nutzt OpenSource-Software, deren Lizenztexte hier einsehbar sind.";
58 | "legal.osstitle" = "OpenSource-Lizenzen";
59 | "legal.title" = "Rechtliches";
60 |
61 | // OpenSource licence view
62 | "oss.third" = "Drittanbieterlizenzen";
63 |
64 | // Supported canteens view
65 | "supported.tested" = "GETESTETE KARTEN";
66 | "supported.untested" = "UNGETESTETE KARTEN";
67 | "supported.infotext" = "Die Karten folgender Mensen sollten mit der App funktionieren, wurden jedoch noch nicht getestet. Du hast die App erfolgreich mit einer Karte dieser Mensen oder einer hier nicht genannten Mensa genutzt? Schreib uns:";
68 | "supported.github" = "Auf GitHub";
69 | "supported.email" = "Per E-Mail";
70 | "supported.title" = "Unterstützte Mensen";
71 |
72 | // Add canteen view
73 | "add.title" = "Mensa hinzufügen";
74 |
75 | // History view
76 | "history.mode" = "Anzeigemodus";
77 | "history.my" = "Meine Karte";
78 | "history.all" = "Alle";
79 | "history.title" = "Verlauf";
80 | "history.deleteQuestion" = "Möchtest du den gesamten Verlauf wirklich löschen?";
81 | "history.delete" = "Löschen";
82 | "history.cancel" = "Abbrechen";
83 |
84 | // History detail view
85 | "historyDetail.balance" = "GUTHABEN";
86 | "historyDetail.last" = "LETZTE TRANSAKTION";
87 | "historyDetail.timestamp" = "ZEITSTEMPEL";
88 | "historyDetail.id" = "KARTEN-ID";
89 |
90 | // Reading session
91 | "reader.subtitle" = "Bitte halte deine Mensakarte an die Oberkante deines iPhone.";
92 | "reader.failed" = "Leider konnte deine Karte nicht gelesen werden.";
93 | "reader.unknown" = "Leider konnte deine Karte nicht gelesen werden: Unbekannte Karte";
94 | "reader.error" = "Leider konnte deine Karte nicht gelesen werden: Fehler beim Lesen";
95 | "reader.code" = "Leider konnte deine Karte nicht gelesen werden. (Fehlercode ";
96 |
--------------------------------------------------------------------------------
/MensaGuthaben/Views/SettingsView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SettingsView.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 24.08.19.
6 | // Copyright © 2019 - 2023 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import SwiftUI
25 |
26 | struct SettingsView: View {
27 | @Environment(\.presentationMode) var presentationMode: Binding
28 | @Environment(\.colorScheme) var colorScheme: ColorScheme
29 | @EnvironmentObject var settings: SettingsStore
30 | let sceneDelegate: SceneDelegate
31 |
32 | let appVersion: String = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String
33 |
34 | private func getBuildString() -> String {
35 | let appBuild: String = Bundle.main.infoDictionary!["CFBundleVersion"] as! String
36 | let buildNumberParts: [String] = appBuild.components(separatedBy: ".")
37 | let convertMidPart: [String:String] = ["0": "A", "1": "B", "2": "C", "3": "D", "4": "E", "5": "F", "6": "G", "7": "H", "8": "I", "9": "J", "10": "K", "11": "L", "12": "M", "13": "N", "14": "O", "15": "P", "16": "Q", "17": "R", "18": "S", "19": "T", "20": "U", "21": "V", "22": "W", "23": "X", "24": "Y", "25": "Z"]
38 | return buildNumberParts[0] + (convertMidPart[buildNumberParts[1]] ?? "A") + buildNumberParts[2]
39 | }
40 |
41 | private func getCompileTimeString() -> String {
42 | var compileDate:Date {
43 | let bundleName = Bundle.main.infoDictionary!["CFBundleName"] as? String ?? "Info.plist"
44 | if let infoPath = Bundle.main.path(forResource: bundleName, ofType: nil),
45 | let infoAttr = try? FileManager.default.attributesOfItem(atPath: infoPath),
46 | let infoDate = infoAttr[FileAttributeKey.creationDate] as? Date {
47 | return infoDate
48 | }
49 | return Date()
50 | }
51 | let format = DateFormatter()
52 | format.dateFormat = "dd.MM.yyyy HH:mm"
53 | return format.string(from: compileDate)
54 | }
55 |
56 | var body: some View {
57 | NavigationView {
58 | List {
59 | Section {
60 | CheckboxSettingRow(toggle: $settings.autoScan, title: NSLocalizedString("settings.autoscan", comment: ""))
61 | }
62 | Section(header: Text("settings.mycard")) {
63 | HStack {
64 | Text("ID").foregroundColor(.gray)
65 | Spacer()
66 | Text(settings.myCard)
67 | }
68 | TextRow(title: NSLocalizedString("settings.idexplanation", comment: ""))
69 | Button(action: {
70 | self.sceneDelegate.updateMyCard()
71 | }) {
72 | HStack {
73 | Text("settings.reset")
74 | .foregroundColor(.textColor(for: self.colorScheme))
75 | Spacer()
76 | Image(systemName: "chevron.right")
77 | .foregroundColor(.gray)
78 | .font(Font.system(size: 18, weight: .semibold))
79 | }
80 | }
81 | }
82 | Section(header: Text("settings.support")) {
83 | NavigationLink("settings.supported", destination: SupportedCanteensView())
84 | //NavigationLink("settings.addmy", destination: AddCanteenView())
85 | }
86 | Section(header: Text("settings.about")) {
87 | TextRow(title: "© 2019 - 2023 Johannes Kreutz.\nAlle Rechte vorbehalten.\nVersion \(appVersion) Build \(getBuildString())\n(compiled \(getCompileTimeString()))")
88 | NavigationLink("settings.legal", destination: LegalView())
89 | }
90 | Section(header: Text("OPEN SOURCE"), footer: Text("Made with ❤ and some code on the 🚂 between Marburg and Darmstadt.")
91 | .font(.system(size: 13))
92 | .italic()) {
93 | HttpLinkRow(url: "https://github.com/TheJKM/MensaGuthaben-iOS", title: NSLocalizedString("settings.githublink", comment: ""))
94 | }
95 | }.listStyle(GroupedListStyle())
96 | .navigationBarTitle("settings.title")
97 | .navigationBarItems(trailing: Button(action: {
98 | self.presentationMode.wrappedValue.dismiss()
99 | }) {
100 | Text("settings.done").bold()
101 | })
102 | }
103 | }
104 | }
105 |
106 | struct SettingsView_Previews: PreviewProvider {
107 | static var previews: some View {
108 | SettingsView(sceneDelegate: SceneDelegate())
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/MensaGuthaben/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/MensaGuthaben/Classes/HistoryDatabase.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SQLiteDatabase.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 21.09.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import Foundation
25 | import SQLite3
26 |
27 | // Error cases
28 | enum HistoryError: Error {
29 | case OpenDatabase(message: String)
30 | case Prepare(message: String)
31 | case Step(message: String)
32 | case Bind(message: String)
33 | case Select(message: String)
34 | }
35 |
36 | // SQLite class
37 | class HistoryDatabase {
38 |
39 | // MARK: Properties
40 | private let db: OpaquePointer?
41 |
42 | // MARK: Initialization
43 | init(db: OpaquePointer) {
44 | self.db = db
45 | self.setupTable()
46 | }
47 |
48 | // MARK: Static database opening
49 | static func open() throws -> HistoryDatabase {
50 | let fileURL = try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
51 | .appendingPathComponent("history.sqlite")
52 |
53 | var db: OpaquePointer? = nil
54 | if (sqlite3_open(fileURL.path, &db) == SQLITE_OK) {
55 | return HistoryDatabase(db: db!)
56 | } else {
57 | defer {
58 | if (db != nil) {
59 | sqlite3_close(db)
60 | }
61 | }
62 | throw HistoryError.OpenDatabase(message: String(cString: sqlite3_errmsg(db)))
63 | }
64 | }
65 |
66 | // MARK: Error handling
67 | var errorMessage: String {
68 | return String(cString: sqlite3_errmsg(db))
69 | }
70 |
71 | // MARK: Private helpers
72 | private func setupTable() {
73 | sqlite3_exec(db, "CREATE TABLE IF NOT EXISTS history (id integer primary key autoincrement, current integer, previous integer, card text, date integer)", nil, nil, nil)
74 | }
75 |
76 | // MARK: Public functions
77 | func prepare(command: String) throws -> OpaquePointer {
78 | var statement: OpaquePointer? = nil
79 | guard sqlite3_prepare_v2(db, command, -1, &statement, nil) == SQLITE_OK else {
80 | throw HistoryError.Prepare(message: errorMessage)
81 | }
82 | return statement!
83 | }
84 |
85 | func insertScan(current: Int32, previous: Int32, date: Int32, card: String) throws {
86 | let statement: OpaquePointer = try self.prepare(command: "INSERT INTO history (current, previous, card, date) VALUES (?, ?, ?, ?)")
87 | if (sqlite3_bind_int(statement, 1, current) != SQLITE_OK) {
88 | throw HistoryError.Bind(message: errorMessage)
89 | }
90 | if (sqlite3_bind_int(statement, 2, previous) != SQLITE_OK) {
91 | throw HistoryError.Bind(message: errorMessage)
92 | }
93 | if (sqlite3_bind_text(statement, 3, NSString(string: card).utf8String, -1, nil) != SQLITE_OK) {
94 | throw HistoryError.Bind(message: errorMessage)
95 | }
96 | if (sqlite3_bind_int(statement, 4, date) != SQLITE_OK) {
97 | throw HistoryError.Bind(message: errorMessage)
98 | }
99 | if (sqlite3_step(statement) != SQLITE_DONE) {
100 | throw HistoryError.Step(message: errorMessage)
101 | }
102 | }
103 |
104 | func getHistory(full: Bool = false) throws -> [HistoryEntry] {
105 | var statementExtension: String = ""
106 | if (full) {
107 | statementExtension = " LIMIT 10"
108 | }
109 | let statement: OpaquePointer = try self.prepare(command: "SELECT * FROM history ORDER BY date DESC" + statementExtension)
110 | var result: [HistoryEntry] = []
111 | while (sqlite3_step(statement) == SQLITE_ROW) {
112 | if let cString = sqlite3_column_text(statement, 3) {
113 | result.append(HistoryEntry(id: sqlite3_column_int(statement, 0), current: sqlite3_column_int(statement, 1), previous: sqlite3_column_int(statement, 2), card: String(cString: cString), date: sqlite3_column_int(statement, 4)))
114 | } else {
115 | throw HistoryError.Select(message: errorMessage)
116 | }
117 | }
118 | return result
119 | }
120 |
121 | func deleteEntry(id: Int32) throws {
122 | let statement: OpaquePointer = try self.prepare(command: "DELETE FROM history WHERE id = ?")
123 | if (sqlite3_bind_int(statement, 1, id) != SQLITE_OK) {
124 | throw HistoryError.Bind(message: errorMessage)
125 | }
126 | if (sqlite3_step(statement) != SQLITE_DONE) {
127 | throw HistoryError.Step(message: errorMessage)
128 | }
129 | }
130 |
131 | func clear() throws {
132 | let statement: OpaquePointer = try self.prepare(command: "DELETE FROM history")
133 | if (sqlite3_step(statement) != SQLITE_DONE) {
134 | throw HistoryError.Step(message: errorMessage)
135 | }
136 | }
137 |
138 | // MARK: Object destroying
139 | deinit {
140 | sqlite3_close(db)
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/MensaGuthaben/Classes/CardScanner.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CardScanner.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 25.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import Foundation
25 | import PromiseKit
26 | import JKDesFireReader
27 |
28 | class CardScanner: JKDesFireReaderDelegate {
29 |
30 | // MARK: Properties
31 |
32 | let delegate: CardScannerDelegate
33 | var reader: JKDesFireReader? = nil
34 |
35 | // MARK: Initialization
36 |
37 | init(delegate: CardScannerDelegate) {
38 | self.delegate = delegate
39 | }
40 |
41 | // MARK: Control reader session
42 |
43 | func scan() {
44 | // Only start a new scanning session if there is no session open
45 | guard reader == nil else {
46 | return
47 | }
48 | reader = JKDesFireReader(start: false, delegate: self)
49 | reader?.setSessionInfoText(text: NSLocalizedString("reader.subtitle", comment: ""))
50 | reader?.setErrorInfoText(text: NSLocalizedString("reader.failed", comment: ""))
51 |
52 | // Start session
53 | if !(reader?.createReaderSession())! {
54 | print("Error creating reader session in JKDesFireReader.")
55 | }
56 | }
57 |
58 | func sessionRunning() -> Bool {
59 | return reader == nil ? false : true
60 | }
61 |
62 | // MARK: Delegate functions
63 |
64 | func didDetectDesFireTag() {
65 | firstly {
66 | (reader?.listApplications())!
67 | }.done { response in
68 | var cardKnown: Bool = false
69 | var appId: UInt32 = 0
70 | var fileId: UInt8 = 0
71 |
72 | // Check if we know an application id
73 | for id in response {
74 | if self.isCardValid(card: id) {
75 | cardKnown = true
76 | appId = id
77 | fileId = self.getFileId(card: id)!
78 | }
79 | }
80 |
81 | // Show error message if card is unknown
82 | guard cardKnown else {
83 | self.reader?.stopRunningSession(errorMessage: NSLocalizedString("reader.unknown", comment: "") + " (ERR_APPLICATION_NOT_FOUND).")
84 | self.delegate.sessionCancel()
85 | return
86 | }
87 |
88 | // Select application
89 | firstly {
90 | (self.reader?.selectApplication(applicationId: appId))!
91 | }.done { application in
92 | var fileFound: Bool = false
93 |
94 | // Check if the wanted file is available
95 | for file in application.getFiles() {
96 | if (file == fileId) {
97 | fileFound = true
98 | }
99 | }
100 |
101 | // Show error message if card is unknown
102 | guard fileFound else {
103 | self.reader?.stopRunningSession(errorMessage: NSLocalizedString("reader.unknown", comment: "") + " (ERR_FILE_NOT_FOUND).")
104 | self.delegate.sessionCancel()
105 | return
106 | }
107 |
108 | // Get file settings
109 | application.getFileSettings(fileId: fileId)
110 | .done { settings in
111 | var lastTransaction: Int = 0
112 |
113 | if let valueSettings = settings as? JKDesFireValueFileSettings {
114 | lastTransaction = valueSettings.getValue()
115 | } else {
116 | self.reader?.stopRunningSession(errorMessage: NSLocalizedString("reader.error", comment: "") + " (ERR_NO_VALUE_FILE).")
117 | self.delegate.sessionCancel()
118 | }
119 |
120 | // Read value
121 | application.getValue(fileId: fileId)
122 | .done { value in
123 | self.delegate.newDataAvailable(current: value.getValue(), previous: lastTransaction, card: (self.reader?.getTagId())!)
124 | self.reader?.stopRunningSession()
125 | }.catch { error in
126 | self.reader?.stopRunningSession(errorMessage: NSLocalizedString("reader.error", comment: "") + " (ERR_READ_VALUE).")
127 | self.delegate.sessionCancel()
128 | }
129 | }.catch { error in
130 | self.reader?.stopRunningSession(errorMessage: NSLocalizedString("reader.error", comment: "") + " (ERR_READ_FILE_SETTINGS).")
131 | self.delegate.sessionCancel()
132 | }
133 |
134 | }.catch { error in
135 | self.reader?.stopRunningSession(errorMessage: NSLocalizedString("reader.error", comment: "") + " (ERR_SELECT_APPLICATION).")
136 | self.delegate.sessionCancel()
137 | }
138 |
139 | }.catch { error in
140 | print("Error getting application list: " + error.localizedDescription)
141 | self.reader?.stopRunningSession(errorMessage: NSLocalizedString("reader.code", comment: "") + error.localizedDescription + ")")
142 | self.delegate.sessionCancel()
143 | }
144 | }
145 |
146 | func tagDetectionError(error: JKDesFirePublicError) {
147 | print("Error detecting tag: " + error.localizedDescription)
148 | self.reader?.stopRunningSession(errorMessage: NSLocalizedString("reader.code", comment: "") + error.localizedDescription + ")")
149 | self.delegate.sessionCancel()
150 | }
151 |
152 | // MARK: Private helpers
153 |
154 | private func isCardValid(card: UInt32) -> Bool {
155 | return getCard(id: card) != nil ? true : false
156 | }
157 |
158 | private func getFileId(card: UInt32) -> UInt8? {
159 | let c: Card? = getCard(id: card)
160 | if (c != nil) {
161 | return c!.fileId
162 | }
163 | return nil
164 | }
165 |
166 | private func getCard(id: UInt32) -> Card? {
167 | for (_, card) in Cards.c {
168 | if (card.applicationId == id) {
169 | return card
170 | }
171 | }
172 | return nil
173 | }
174 |
175 | }
176 |
--------------------------------------------------------------------------------
/MensaGuthaben/SceneDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SceneDelegate.swift
3 | // MensaGuthaben
4 | //
5 | // Created by Johannes Kreutz on 22.08.19.
6 | // Copyright © 2019 Johannes Kreutz. All rights reserved.
7 | //
8 | // This file is part of MensaGuthaben.
9 | //
10 | // MensaGuthaben is free software: you can redistribute it and/or modify
11 | // it under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 3 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // MensaGuthaben is distributed in the hope that it will be useful,
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with MensaGuthaben. If not, see .
22 | //
23 |
24 | import UIKit
25 | import SwiftUI
26 |
27 | class SceneDelegate: UIResponder, UIWindowSceneDelegate, CardScannerDelegate {
28 |
29 | // MARK: Properties
30 |
31 | var window: UIWindow?
32 | var cardScanner: CardScanner?
33 | let balance: Balance = Balance()
34 | let settings: SettingsStore = SettingsStore()
35 | var history: HistoryDatabase?
36 | let historyData: HistoryData = HistoryData()
37 | var nextScanIsMyUpdate: Bool = false
38 |
39 | // MARK: Delegate functions
40 |
41 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
42 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
43 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
44 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
45 |
46 | // Create the SwiftUI view that provides the window contents.
47 | let mainView = MainView(sceneDelegate: self).environmentObject(self.balance).environmentObject(self.settings).environmentObject(self.historyData)
48 |
49 | // Use a UIHostingController as window root view controller.
50 | if let windowScene = scene as? UIWindowScene {
51 | let window = UIWindow(windowScene: windowScene)
52 | window.rootViewController = UIHostingController(rootView: mainView)
53 | self.window = window
54 | window.makeKeyAndVisible()
55 | }
56 |
57 | // Connect to history database
58 | do {
59 | try self.history = HistoryDatabase.open()
60 | try self.historyData.set(data: self.history!.getHistory())
61 | }
62 | catch {
63 | print("Error opening history database: \(error)")
64 | }
65 |
66 | // Start scanning session if auto scan is enabled
67 | if (settings.autoScan) {
68 | self.scanCard()
69 | }
70 | // Demo data creation for screenshots
71 | /*let values: [Int32] = [14500, 12250, 8300, 5520, 25520, 21100, 19200, 16750]
72 | var timestamp: Int32 = Int32(NSDate().timeIntervalSince1970)
73 | values.forEach { value in
74 | do {
75 | try self.history?.insertScan(current: value, previous: Int32(1230), date: timestamp, card: String("XYZ"))
76 | }
77 | catch {
78 | print("Error storing scan in history: \(error)")
79 | }
80 | timestamp += 86400
81 | }*/
82 | }
83 |
84 | func sceneDidDisconnect(_ scene: UIScene) {
85 | // Called as the scene is being released by the system.
86 | // This occurs shortly after the scene enters the background, or when its session is discarded.
87 | // Release any resources associated with this scene that can be re-created the next time the scene connects.
88 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
89 | }
90 |
91 | func sceneDidBecomeActive(_ scene: UIScene) {
92 | // Called when the scene has moved from an inactive state to an active state.
93 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
94 | }
95 |
96 | func sceneWillResignActive(_ scene: UIScene) {
97 | // Called when the scene will move from an active state to an inactive state.
98 | // This may occur due to temporary interruptions (ex. an incoming phone call).
99 | }
100 |
101 | func sceneWillEnterForeground(_ scene: UIScene) {
102 | // Called as the scene transitions from the background to the foreground.
103 | // Use this method to undo the changes made on entering the background.
104 | }
105 |
106 | func sceneDidEnterBackground(_ scene: UIScene) {
107 | // Called as the scene transitions from the foreground to the background.
108 | // Use this method to save data, release shared resources, and store enough scene-specific state information
109 | // to restore the scene back to its current state.
110 | }
111 |
112 | // MARK: Card Scanner delegate functions
113 |
114 | func newDataAvailable(current: Int, previous: Int, card: Int) {
115 | cardScanner = nil
116 | self.balance.setCurrent(current: current)
117 | self.balance.setPrevious(previous: previous)
118 | let timestamp: Int32 = Int32(NSDate().timeIntervalSince1970)
119 | if (!nextScanIsMyUpdate) {
120 | do {
121 | try self.history?.insertScan(current: Int32(current), previous: Int32(previous), date: timestamp, card: String(card))
122 | }
123 | catch {
124 | print("Error storing scan in history: \(error)")
125 | }
126 | }
127 | if (settings.myCard == "0" || self.nextScanIsMyUpdate) {
128 | settings.myCard = String(card)
129 | self.nextScanIsMyUpdate = false
130 | }
131 | loadFromMemory()
132 | }
133 |
134 | func sessionCancel() {
135 | cardScanner = nil
136 | }
137 |
138 | // MARK: Scan card
139 |
140 | func scanCard() {
141 | guard cardScanner == nil || !cardScanner!.sessionRunning() else {
142 | return
143 | }
144 | cardScanner = CardScanner(delegate: self)
145 | cardScanner?.scan()
146 | }
147 |
148 | func updateMyCard() {
149 | self.nextScanIsMyUpdate = true
150 | self.scanCard()
151 | }
152 |
153 | // MARK: History functions
154 |
155 | func loadFromMemory() {
156 | do {
157 | try self.historyData.set(data: self.history!.getHistory())
158 | }
159 | catch {
160 | print("Error loading history: \(error)")
161 | }
162 | }
163 |
164 | func deleteFullHistory() {
165 | guard self.history != nil else {
166 | return
167 | }
168 | do {
169 | try self.history!.clear()
170 | }
171 | catch {
172 | print("Error clearing history: \(error)")
173 | }
174 | loadFromMemory()
175 | }
176 |
177 | func deleteEntry(id: Int32) {
178 | guard self.history != nil else {
179 | return
180 | }
181 | do {
182 | try self.history!.deleteEntry(id: id)
183 | }
184 | catch {
185 | print("Error deleting history entry: \(error)")
186 | }
187 | loadFromMemory()
188 | }
189 |
190 | // MARK: Getters
191 |
192 | func getSettings() -> SettingsStore {
193 | return self.settings
194 | }
195 |
196 | }
197 |
198 |
--------------------------------------------------------------------------------
/MensaGuthaben.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 54;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 8F0DA53D2319C80B0021FB7E /* Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F0DA53C2319C80B0021FB7E /* Settings.swift */; };
11 | 8F3430582336C8C600951B79 /* HistoryDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F3430572336C8C600951B79 /* HistoryDatabase.swift */; };
12 | 8F3E6EA8233AB1E60080FAD7 /* ChartsContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F3E6EA7233AB1E60080FAD7 /* ChartsContainer.swift */; };
13 | 8F401511230F3EE600F2F31D /* Balance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F401510230F3EE600F2F31D /* Balance.swift */; };
14 | 8F401513230F3FC200F2F31D /* Cards.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F401512230F3FC200F2F31D /* Cards.swift */; };
15 | 8F511C9C2315D9C30046E1A0 /* BalanceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F511C9B2315D9C30046E1A0 /* BalanceView.swift */; };
16 | 8F625A43230F2FA500EF3F92 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F625A42230F2FA500EF3F92 /* AppDelegate.swift */; };
17 | 8F625A45230F2FA500EF3F92 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F625A44230F2FA500EF3F92 /* SceneDelegate.swift */; };
18 | 8F625A47230F2FA500EF3F92 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F625A46230F2FA500EF3F92 /* MainView.swift */; };
19 | 8F625A49230F2FA600EF3F92 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8F625A48230F2FA600EF3F92 /* Assets.xcassets */; };
20 | 8F625A4C230F2FA600EF3F92 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8F625A4B230F2FA600EF3F92 /* Preview Assets.xcassets */; };
21 | 8F625A4F230F2FA600EF3F92 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8F625A4D230F2FA600EF3F92 /* LaunchScreen.storyboard */; };
22 | 8F6DF9162337BB1D00BA1B96 /* HistoryEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F6DF9152337BB1D00BA1B96 /* HistoryEntry.swift */; };
23 | 8FA970D823148B8800F37DE7 /* CardScannerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FA970D723148B8800F37DE7 /* CardScannerDelegate.swift */; };
24 | 8FA970DD231499AC00F37DE7 /* DarkmodeTextColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FA970DC231499AC00F37DE7 /* DarkmodeTextColor.swift */; };
25 | 8FBBC0D123380CA700A59286 /* HistoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FBBC0D023380CA700A59286 /* HistoryView.swift */; };
26 | 8FBBC0D32338164300A59286 /* HistoryData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FBBC0D22338164300A59286 /* HistoryData.swift */; };
27 | 8FC4B7F428E5966100100E82 /* PromiseKit in Frameworks */ = {isa = PBXBuildFile; productRef = 8FC4B7F328E5966100100E82 /* PromiseKit */; };
28 | 8FC4B7F728E5969200100E82 /* Charts in Frameworks */ = {isa = PBXBuildFile; productRef = 8FC4B7F628E5969200100E82 /* Charts */; };
29 | 8FD4FF802311B13200541DC6 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD4FF7F2311B13200541DC6 /* SettingsView.swift */; };
30 | 8FD4FF822311D2EF00541DC6 /* LegalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD4FF812311D2EF00541DC6 /* LegalView.swift */; };
31 | 8FD4FF842311D40600541DC6 /* OpenSourceLicencesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD4FF832311D40600541DC6 /* OpenSourceLicencesView.swift */; };
32 | 8FD4FF862311D4A400541DC6 /* SupportedCanteensView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD4FF852311D4A400541DC6 /* SupportedCanteensView.swift */; };
33 | 8FD4FF882311D4AD00541DC6 /* AddCanteenView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD4FF872311D4AD00541DC6 /* AddCanteenView.swift */; };
34 | 8FD4FF8B2311D55500541DC6 /* TextRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD4FF8A2311D55500541DC6 /* TextRow.swift */; };
35 | 8FD4FF8D2311D56500541DC6 /* CheckboxSettingRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD4FF8C2311D56500541DC6 /* CheckboxSettingRow.swift */; };
36 | 8FD4FF8F23131DA100541DC6 /* HttpLinkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD4FF8E23131DA100541DC6 /* HttpLinkRow.swift */; };
37 | 8FD4FF91231323AA00541DC6 /* CardScanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD4FF90231323AA00541DC6 /* CardScanner.swift */; };
38 | 8FD4FFA02313280100541DC6 /* Logo_rund.png in Resources */ = {isa = PBXBuildFile; fileRef = 8FD4FF9F2313280100541DC6 /* Logo_rund.png */; };
39 | 8FD4FFA223132C4A00541DC6 /* JKM Logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 8FD4FFA123132C4A00541DC6 /* JKM Logo.png */; };
40 | 8FDE3ECB23394D9B0027064C /* HistoryDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FDE3ECA23394D9B0027064C /* HistoryDetailView.swift */; };
41 | 8FE6720F28E71A150022C5AC /* JKDesFireReader in Frameworks */ = {isa = PBXBuildFile; productRef = 8FE6720E28E71A150022C5AC /* JKDesFireReader */; };
42 | 8FF0B2D223EA20970025A746 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8FF0B2D023EA20970025A746 /* Localizable.strings */; };
43 | 8FF0B2D623EA210B0025A746 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8FF0B2D423EA210B0025A746 /* InfoPlist.strings */; };
44 | /* End PBXBuildFile section */
45 |
46 | /* Begin PBXFileReference section */
47 | 8F0DA53C2319C80B0021FB7E /* Settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Settings.swift; sourceTree = ""; };
48 | 8F3430572336C8C600951B79 /* HistoryDatabase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryDatabase.swift; sourceTree = ""; };
49 | 8F3E6EA7233AB1E60080FAD7 /* ChartsContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChartsContainer.swift; sourceTree = ""; };
50 | 8F401510230F3EE600F2F31D /* Balance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Balance.swift; sourceTree = ""; };
51 | 8F401512230F3FC200F2F31D /* Cards.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cards.swift; sourceTree = ""; };
52 | 8F511C9B2315D9C30046E1A0 /* BalanceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceView.swift; sourceTree = ""; };
53 | 8F625A3F230F2FA500EF3F92 /* MensaGuthaben.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MensaGuthaben.app; sourceTree = BUILT_PRODUCTS_DIR; };
54 | 8F625A42230F2FA500EF3F92 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
55 | 8F625A44230F2FA500EF3F92 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; };
56 | 8F625A46230F2FA500EF3F92 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = ""; };
57 | 8F625A48230F2FA600EF3F92 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
58 | 8F625A4B230F2FA600EF3F92 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; };
59 | 8F625A4E230F2FA600EF3F92 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
60 | 8F625A50230F2FA600EF3F92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
61 | 8F6DF9152337BB1D00BA1B96 /* HistoryEntry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryEntry.swift; sourceTree = ""; };
62 | 8FA970D723148B8800F37DE7 /* CardScannerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardScannerDelegate.swift; sourceTree = ""; };
63 | 8FA970D9231491FB00F37DE7 /* MensaGuthaben.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MensaGuthaben.entitlements; sourceTree = ""; };
64 | 8FA970DC231499AC00F37DE7 /* DarkmodeTextColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DarkmodeTextColor.swift; sourceTree = ""; };
65 | 8FBBC0D023380CA700A59286 /* HistoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryView.swift; sourceTree = ""; };
66 | 8FBBC0D22338164300A59286 /* HistoryData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryData.swift; sourceTree = ""; };
67 | 8FBC70482508194200FD0198 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/LaunchScreen.strings; sourceTree = ""; };
68 | 8FBC70492508194200FD0198 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; };
69 | 8FBC704A2508194200FD0198 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InfoPlist.strings; sourceTree = ""; };
70 | 8FD4FF7F2311B13200541DC6 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; };
71 | 8FD4FF812311D2EF00541DC6 /* LegalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegalView.swift; sourceTree = ""; };
72 | 8FD4FF832311D40600541DC6 /* OpenSourceLicencesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenSourceLicencesView.swift; sourceTree = ""; };
73 | 8FD4FF852311D4A400541DC6 /* SupportedCanteensView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportedCanteensView.swift; sourceTree = ""; };
74 | 8FD4FF872311D4AD00541DC6 /* AddCanteenView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddCanteenView.swift; sourceTree = ""; };
75 | 8FD4FF8A2311D55500541DC6 /* TextRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextRow.swift; sourceTree = ""; };
76 | 8FD4FF8C2311D56500541DC6 /* CheckboxSettingRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckboxSettingRow.swift; sourceTree = ""; };
77 | 8FD4FF8E23131DA100541DC6 /* HttpLinkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HttpLinkRow.swift; sourceTree = ""; };
78 | 8FD4FF90231323AA00541DC6 /* CardScanner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardScanner.swift; sourceTree = ""; };
79 | 8FD4FF9F2313280100541DC6 /* Logo_rund.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Logo_rund.png; sourceTree = SOURCE_ROOT; };
80 | 8FD4FFA123132C4A00541DC6 /* JKM Logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "JKM Logo.png"; sourceTree = SOURCE_ROOT; };
81 | 8FDE3ECA23394D9B0027064C /* HistoryDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryDetailView.swift; sourceTree = ""; };
82 | 8FF0B2D123EA20970025A746 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; };
83 | 8FF0B2D523EA210B0025A746 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/InfoPlist.strings; sourceTree = ""; };
84 | /* End PBXFileReference section */
85 |
86 | /* Begin PBXFrameworksBuildPhase section */
87 | 8F625A3C230F2FA500EF3F92 /* Frameworks */ = {
88 | isa = PBXFrameworksBuildPhase;
89 | buildActionMask = 2147483647;
90 | files = (
91 | 8FC4B7F728E5969200100E82 /* Charts in Frameworks */,
92 | 8FC4B7F428E5966100100E82 /* PromiseKit in Frameworks */,
93 | 8FE6720F28E71A150022C5AC /* JKDesFireReader in Frameworks */,
94 | );
95 | runOnlyForDeploymentPostprocessing = 0;
96 | };
97 | /* End PBXFrameworksBuildPhase section */
98 |
99 | /* Begin PBXGroup section */
100 | 8F0B3ABF2339074B00482B54 /* Classes */ = {
101 | isa = PBXGroup;
102 | children = (
103 | 8FA970D723148B8800F37DE7 /* CardScannerDelegate.swift */,
104 | 8FD4FF90231323AA00541DC6 /* CardScanner.swift */,
105 | 8F0DA53C2319C80B0021FB7E /* Settings.swift */,
106 | 8F3430572336C8C600951B79 /* HistoryDatabase.swift */,
107 | );
108 | path = Classes;
109 | sourceTree = "";
110 | };
111 | 8F40150F230F3ED900F2F31D /* Models */ = {
112 | isa = PBXGroup;
113 | children = (
114 | 8F401510230F3EE600F2F31D /* Balance.swift */,
115 | 8F401512230F3FC200F2F31D /* Cards.swift */,
116 | 8F6DF9152337BB1D00BA1B96 /* HistoryEntry.swift */,
117 | 8FBBC0D22338164300A59286 /* HistoryData.swift */,
118 | );
119 | path = Models;
120 | sourceTree = "";
121 | };
122 | 8F625A36230F2FA500EF3F92 = {
123 | isa = PBXGroup;
124 | children = (
125 | 8F625A41230F2FA500EF3F92 /* MensaGuthaben */,
126 | 8F625A40230F2FA500EF3F92 /* Products */,
127 | );
128 | sourceTree = "";
129 | };
130 | 8F625A40230F2FA500EF3F92 /* Products */ = {
131 | isa = PBXGroup;
132 | children = (
133 | 8F625A3F230F2FA500EF3F92 /* MensaGuthaben.app */,
134 | );
135 | name = Products;
136 | sourceTree = "";
137 | };
138 | 8F625A41230F2FA500EF3F92 /* MensaGuthaben */ = {
139 | isa = PBXGroup;
140 | children = (
141 | 8FA970D9231491FB00F37DE7 /* MensaGuthaben.entitlements */,
142 | 8FD4FF7E2311B10200541DC6 /* Views */,
143 | 8F40150F230F3ED900F2F31D /* Models */,
144 | 8F0B3ABF2339074B00482B54 /* Classes */,
145 | 8F625A42230F2FA500EF3F92 /* AppDelegate.swift */,
146 | 8F625A44230F2FA500EF3F92 /* SceneDelegate.swift */,
147 | 8F625A48230F2FA600EF3F92 /* Assets.xcassets */,
148 | 8F625A4D230F2FA600EF3F92 /* LaunchScreen.storyboard */,
149 | 8FD4FF9F2313280100541DC6 /* Logo_rund.png */,
150 | 8FD4FFA123132C4A00541DC6 /* JKM Logo.png */,
151 | 8F625A50230F2FA600EF3F92 /* Info.plist */,
152 | 8F625A4A230F2FA600EF3F92 /* Preview Content */,
153 | 8FF0B2D023EA20970025A746 /* Localizable.strings */,
154 | 8FF0B2D423EA210B0025A746 /* InfoPlist.strings */,
155 | );
156 | path = MensaGuthaben;
157 | sourceTree = "";
158 | };
159 | 8F625A4A230F2FA600EF3F92 /* Preview Content */ = {
160 | isa = PBXGroup;
161 | children = (
162 | 8F625A4B230F2FA600EF3F92 /* Preview Assets.xcassets */,
163 | );
164 | path = "Preview Content";
165 | sourceTree = "";
166 | };
167 | 8FD4FF7E2311B10200541DC6 /* Views */ = {
168 | isa = PBXGroup;
169 | children = (
170 | 8FD4FF892311D53F00541DC6 /* Helpers */,
171 | 8F625A46230F2FA500EF3F92 /* MainView.swift */,
172 | 8FD4FF7F2311B13200541DC6 /* SettingsView.swift */,
173 | 8FD4FF812311D2EF00541DC6 /* LegalView.swift */,
174 | 8FD4FF832311D40600541DC6 /* OpenSourceLicencesView.swift */,
175 | 8FD4FF852311D4A400541DC6 /* SupportedCanteensView.swift */,
176 | 8FD4FF872311D4AD00541DC6 /* AddCanteenView.swift */,
177 | 8FBBC0D023380CA700A59286 /* HistoryView.swift */,
178 | 8FDE3ECA23394D9B0027064C /* HistoryDetailView.swift */,
179 | );
180 | path = Views;
181 | sourceTree = "";
182 | };
183 | 8FD4FF892311D53F00541DC6 /* Helpers */ = {
184 | isa = PBXGroup;
185 | children = (
186 | 8FD4FF8A2311D55500541DC6 /* TextRow.swift */,
187 | 8FD4FF8C2311D56500541DC6 /* CheckboxSettingRow.swift */,
188 | 8FD4FF8E23131DA100541DC6 /* HttpLinkRow.swift */,
189 | 8FA970DC231499AC00F37DE7 /* DarkmodeTextColor.swift */,
190 | 8F511C9B2315D9C30046E1A0 /* BalanceView.swift */,
191 | 8F3E6EA7233AB1E60080FAD7 /* ChartsContainer.swift */,
192 | );
193 | path = Helpers;
194 | sourceTree = "";
195 | };
196 | /* End PBXGroup section */
197 |
198 | /* Begin PBXNativeTarget section */
199 | 8F625A3E230F2FA500EF3F92 /* MensaGuthaben */ = {
200 | isa = PBXNativeTarget;
201 | buildConfigurationList = 8F625A53230F2FA600EF3F92 /* Build configuration list for PBXNativeTarget "MensaGuthaben" */;
202 | buildPhases = (
203 | 8F625A3B230F2FA500EF3F92 /* Sources */,
204 | 8F625A3C230F2FA500EF3F92 /* Frameworks */,
205 | 8F625A3D230F2FA500EF3F92 /* Resources */,
206 | );
207 | buildRules = (
208 | );
209 | dependencies = (
210 | );
211 | name = MensaGuthaben;
212 | packageProductDependencies = (
213 | 8FC4B7F328E5966100100E82 /* PromiseKit */,
214 | 8FC4B7F628E5969200100E82 /* Charts */,
215 | 8FE6720E28E71A150022C5AC /* JKDesFireReader */,
216 | );
217 | productName = MensaGuthaben;
218 | productReference = 8F625A3F230F2FA500EF3F92 /* MensaGuthaben.app */;
219 | productType = "com.apple.product-type.application";
220 | };
221 | /* End PBXNativeTarget section */
222 |
223 | /* Begin PBXProject section */
224 | 8F625A37230F2FA500EF3F92 /* Project object */ = {
225 | isa = PBXProject;
226 | attributes = {
227 | LastSwiftUpdateCheck = 1100;
228 | LastUpgradeCheck = 1250;
229 | ORGANIZATIONNAME = "JKM Software";
230 | TargetAttributes = {
231 | 8F625A3E230F2FA500EF3F92 = {
232 | CreatedOnToolsVersion = 11.0;
233 | };
234 | };
235 | };
236 | buildConfigurationList = 8F625A3A230F2FA500EF3F92 /* Build configuration list for PBXProject "MensaGuthaben" */;
237 | compatibilityVersion = "Xcode 12.0";
238 | developmentRegion = en;
239 | hasScannedForEncodings = 0;
240 | knownRegions = (
241 | en,
242 | Base,
243 | de,
244 | );
245 | mainGroup = 8F625A36230F2FA500EF3F92;
246 | packageReferences = (
247 | 8FC4B7F228E5966100100E82 /* XCRemoteSwiftPackageReference "PromiseKit" */,
248 | 8FC4B7F528E5969200100E82 /* XCRemoteSwiftPackageReference "Charts" */,
249 | 8FE6720D28E71A150022C5AC /* XCRemoteSwiftPackageReference "JKDesFireReader" */,
250 | );
251 | productRefGroup = 8F625A40230F2FA500EF3F92 /* Products */;
252 | projectDirPath = "";
253 | projectRoot = "";
254 | targets = (
255 | 8F625A3E230F2FA500EF3F92 /* MensaGuthaben */,
256 | );
257 | };
258 | /* End PBXProject section */
259 |
260 | /* Begin PBXResourcesBuildPhase section */
261 | 8F625A3D230F2FA500EF3F92 /* Resources */ = {
262 | isa = PBXResourcesBuildPhase;
263 | buildActionMask = 2147483647;
264 | files = (
265 | 8F625A4F230F2FA600EF3F92 /* LaunchScreen.storyboard in Resources */,
266 | 8FF0B2D623EA210B0025A746 /* InfoPlist.strings in Resources */,
267 | 8FF0B2D223EA20970025A746 /* Localizable.strings in Resources */,
268 | 8FD4FFA02313280100541DC6 /* Logo_rund.png in Resources */,
269 | 8F625A4C230F2FA600EF3F92 /* Preview Assets.xcassets in Resources */,
270 | 8FD4FFA223132C4A00541DC6 /* JKM Logo.png in Resources */,
271 | 8F625A49230F2FA600EF3F92 /* Assets.xcassets in Resources */,
272 | );
273 | runOnlyForDeploymentPostprocessing = 0;
274 | };
275 | /* End PBXResourcesBuildPhase section */
276 |
277 | /* Begin PBXSourcesBuildPhase section */
278 | 8F625A3B230F2FA500EF3F92 /* Sources */ = {
279 | isa = PBXSourcesBuildPhase;
280 | buildActionMask = 2147483647;
281 | files = (
282 | 8F401513230F3FC200F2F31D /* Cards.swift in Sources */,
283 | 8FDE3ECB23394D9B0027064C /* HistoryDetailView.swift in Sources */,
284 | 8F6DF9162337BB1D00BA1B96 /* HistoryEntry.swift in Sources */,
285 | 8F625A43230F2FA500EF3F92 /* AppDelegate.swift in Sources */,
286 | 8FD4FF8F23131DA100541DC6 /* HttpLinkRow.swift in Sources */,
287 | 8F401511230F3EE600F2F31D /* Balance.swift in Sources */,
288 | 8FD4FF91231323AA00541DC6 /* CardScanner.swift in Sources */,
289 | 8FD4FF8B2311D55500541DC6 /* TextRow.swift in Sources */,
290 | 8F3E6EA8233AB1E60080FAD7 /* ChartsContainer.swift in Sources */,
291 | 8FBBC0D123380CA700A59286 /* HistoryView.swift in Sources */,
292 | 8F0DA53D2319C80B0021FB7E /* Settings.swift in Sources */,
293 | 8FD4FF842311D40600541DC6 /* OpenSourceLicencesView.swift in Sources */,
294 | 8FBBC0D32338164300A59286 /* HistoryData.swift in Sources */,
295 | 8F511C9C2315D9C30046E1A0 /* BalanceView.swift in Sources */,
296 | 8FD4FF862311D4A400541DC6 /* SupportedCanteensView.swift in Sources */,
297 | 8FD4FF882311D4AD00541DC6 /* AddCanteenView.swift in Sources */,
298 | 8FD4FF802311B13200541DC6 /* SettingsView.swift in Sources */,
299 | 8FA970D823148B8800F37DE7 /* CardScannerDelegate.swift in Sources */,
300 | 8F3430582336C8C600951B79 /* HistoryDatabase.swift in Sources */,
301 | 8FD4FF8D2311D56500541DC6 /* CheckboxSettingRow.swift in Sources */,
302 | 8F625A45230F2FA500EF3F92 /* SceneDelegate.swift in Sources */,
303 | 8FA970DD231499AC00F37DE7 /* DarkmodeTextColor.swift in Sources */,
304 | 8F625A47230F2FA500EF3F92 /* MainView.swift in Sources */,
305 | 8FD4FF822311D2EF00541DC6 /* LegalView.swift in Sources */,
306 | );
307 | runOnlyForDeploymentPostprocessing = 0;
308 | };
309 | /* End PBXSourcesBuildPhase section */
310 |
311 | /* Begin PBXVariantGroup section */
312 | 8F625A4D230F2FA600EF3F92 /* LaunchScreen.storyboard */ = {
313 | isa = PBXVariantGroup;
314 | children = (
315 | 8F625A4E230F2FA600EF3F92 /* Base */,
316 | 8FBC70482508194200FD0198 /* de */,
317 | );
318 | name = LaunchScreen.storyboard;
319 | sourceTree = "";
320 | };
321 | 8FF0B2D023EA20970025A746 /* Localizable.strings */ = {
322 | isa = PBXVariantGroup;
323 | children = (
324 | 8FF0B2D123EA20970025A746 /* Base */,
325 | 8FBC70492508194200FD0198 /* de */,
326 | );
327 | name = Localizable.strings;
328 | sourceTree = "";
329 | };
330 | 8FF0B2D423EA210B0025A746 /* InfoPlist.strings */ = {
331 | isa = PBXVariantGroup;
332 | children = (
333 | 8FF0B2D523EA210B0025A746 /* Base */,
334 | 8FBC704A2508194200FD0198 /* de */,
335 | );
336 | name = InfoPlist.strings;
337 | sourceTree = "";
338 | };
339 | /* End PBXVariantGroup section */
340 |
341 | /* Begin XCBuildConfiguration section */
342 | 8F625A51230F2FA600EF3F92 /* Debug */ = {
343 | isa = XCBuildConfiguration;
344 | buildSettings = {
345 | ALWAYS_SEARCH_USER_PATHS = NO;
346 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
347 | CLANG_ANALYZER_NONNULL = YES;
348 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
349 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
350 | CLANG_CXX_LIBRARY = "libc++";
351 | CLANG_ENABLE_MODULES = YES;
352 | CLANG_ENABLE_OBJC_ARC = YES;
353 | CLANG_ENABLE_OBJC_WEAK = YES;
354 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
355 | CLANG_WARN_BOOL_CONVERSION = YES;
356 | CLANG_WARN_COMMA = YES;
357 | CLANG_WARN_CONSTANT_CONVERSION = YES;
358 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
359 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
360 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
361 | CLANG_WARN_EMPTY_BODY = YES;
362 | CLANG_WARN_ENUM_CONVERSION = YES;
363 | CLANG_WARN_INFINITE_RECURSION = YES;
364 | CLANG_WARN_INT_CONVERSION = YES;
365 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
366 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
367 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
368 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
369 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
370 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
371 | CLANG_WARN_STRICT_PROTOTYPES = YES;
372 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
373 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
374 | CLANG_WARN_UNREACHABLE_CODE = YES;
375 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
376 | COPY_PHASE_STRIP = NO;
377 | DEBUG_INFORMATION_FORMAT = dwarf;
378 | ENABLE_STRICT_OBJC_MSGSEND = YES;
379 | ENABLE_TESTABILITY = YES;
380 | GCC_C_LANGUAGE_STANDARD = gnu11;
381 | GCC_DYNAMIC_NO_PIC = NO;
382 | GCC_NO_COMMON_BLOCKS = YES;
383 | GCC_OPTIMIZATION_LEVEL = 0;
384 | GCC_PREPROCESSOR_DEFINITIONS = (
385 | "DEBUG=1",
386 | "$(inherited)",
387 | );
388 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
389 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
390 | GCC_WARN_UNDECLARED_SELECTOR = YES;
391 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
392 | GCC_WARN_UNUSED_FUNCTION = YES;
393 | GCC_WARN_UNUSED_VARIABLE = YES;
394 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
395 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
396 | MTL_FAST_MATH = YES;
397 | ONLY_ACTIVE_ARCH = YES;
398 | SDKROOT = iphoneos;
399 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
400 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
401 | };
402 | name = Debug;
403 | };
404 | 8F625A52230F2FA600EF3F92 /* Release */ = {
405 | isa = XCBuildConfiguration;
406 | buildSettings = {
407 | ALWAYS_SEARCH_USER_PATHS = NO;
408 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
409 | CLANG_ANALYZER_NONNULL = YES;
410 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
411 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
412 | CLANG_CXX_LIBRARY = "libc++";
413 | CLANG_ENABLE_MODULES = YES;
414 | CLANG_ENABLE_OBJC_ARC = YES;
415 | CLANG_ENABLE_OBJC_WEAK = YES;
416 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
417 | CLANG_WARN_BOOL_CONVERSION = YES;
418 | CLANG_WARN_COMMA = YES;
419 | CLANG_WARN_CONSTANT_CONVERSION = YES;
420 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
421 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
422 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
423 | CLANG_WARN_EMPTY_BODY = YES;
424 | CLANG_WARN_ENUM_CONVERSION = YES;
425 | CLANG_WARN_INFINITE_RECURSION = YES;
426 | CLANG_WARN_INT_CONVERSION = YES;
427 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
428 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
429 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
430 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
431 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
432 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
433 | CLANG_WARN_STRICT_PROTOTYPES = YES;
434 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
435 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
436 | CLANG_WARN_UNREACHABLE_CODE = YES;
437 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
438 | COPY_PHASE_STRIP = NO;
439 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
440 | ENABLE_NS_ASSERTIONS = NO;
441 | ENABLE_STRICT_OBJC_MSGSEND = YES;
442 | GCC_C_LANGUAGE_STANDARD = gnu11;
443 | GCC_NO_COMMON_BLOCKS = YES;
444 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
445 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
446 | GCC_WARN_UNDECLARED_SELECTOR = YES;
447 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
448 | GCC_WARN_UNUSED_FUNCTION = YES;
449 | GCC_WARN_UNUSED_VARIABLE = YES;
450 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
451 | MTL_ENABLE_DEBUG_INFO = NO;
452 | MTL_FAST_MATH = YES;
453 | SDKROOT = iphoneos;
454 | SWIFT_COMPILATION_MODE = wholemodule;
455 | SWIFT_OPTIMIZATION_LEVEL = "-O";
456 | VALIDATE_PRODUCT = YES;
457 | };
458 | name = Release;
459 | };
460 | 8F625A54230F2FA600EF3F92 /* Debug */ = {
461 | isa = XCBuildConfiguration;
462 | buildSettings = {
463 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
464 | CODE_SIGN_ENTITLEMENTS = MensaGuthaben/MensaGuthaben.entitlements;
465 | CODE_SIGN_IDENTITY = "Apple Development";
466 | CODE_SIGN_STYLE = Automatic;
467 | CURRENT_PROJECT_VERSION = 1.3.32;
468 | DEVELOPMENT_ASSET_PATHS = "\"MensaGuthaben/Preview Content\"";
469 | DEVELOPMENT_TEAM = EBQF48FD36;
470 | ENABLE_PREVIEWS = YES;
471 | FRAMEWORK_SEARCH_PATHS = (
472 | "$(inherited)",
473 | "$(PROJECT_DIR)",
474 | "$(PROJECT_DIR)/MensaGuthaben/Frameworks",
475 | );
476 | INFOPLIST_FILE = MensaGuthaben/Info.plist;
477 | IPHONEOS_DEPLOYMENT_TARGET = 14.0;
478 | LD_RUNPATH_SEARCH_PATHS = (
479 | "$(inherited)",
480 | "@executable_path/Frameworks",
481 | );
482 | MARKETING_VERSION = 1.3.1;
483 | PRODUCT_BUNDLE_IDENTIFIER = com.johanneskreutz.mensaguthaben;
484 | PRODUCT_NAME = "$(TARGET_NAME)";
485 | PROVISIONING_PROFILE_SPECIFIER = "";
486 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
487 | SUPPORTS_MACCATALYST = NO;
488 | SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
489 | SWIFT_VERSION = 5.0;
490 | TARGETED_DEVICE_FAMILY = 1;
491 | };
492 | name = Debug;
493 | };
494 | 8F625A55230F2FA600EF3F92 /* Release */ = {
495 | isa = XCBuildConfiguration;
496 | buildSettings = {
497 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
498 | CODE_SIGN_ENTITLEMENTS = MensaGuthaben/MensaGuthaben.entitlements;
499 | CODE_SIGN_IDENTITY = "Apple Development";
500 | CODE_SIGN_STYLE = Automatic;
501 | CURRENT_PROJECT_VERSION = 1.3.32;
502 | DEVELOPMENT_ASSET_PATHS = "\"MensaGuthaben/Preview Content\"";
503 | DEVELOPMENT_TEAM = EBQF48FD36;
504 | ENABLE_PREVIEWS = YES;
505 | FRAMEWORK_SEARCH_PATHS = (
506 | "$(inherited)",
507 | "$(PROJECT_DIR)",
508 | "$(PROJECT_DIR)/MensaGuthaben/Frameworks",
509 | );
510 | INFOPLIST_FILE = MensaGuthaben/Info.plist;
511 | IPHONEOS_DEPLOYMENT_TARGET = 14.0;
512 | LD_RUNPATH_SEARCH_PATHS = (
513 | "$(inherited)",
514 | "@executable_path/Frameworks",
515 | );
516 | MARKETING_VERSION = 1.3.1;
517 | PRODUCT_BUNDLE_IDENTIFIER = com.johanneskreutz.mensaguthaben;
518 | PRODUCT_NAME = "$(TARGET_NAME)";
519 | PROVISIONING_PROFILE_SPECIFIER = "";
520 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
521 | SUPPORTS_MACCATALYST = NO;
522 | SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
523 | SWIFT_VERSION = 5.0;
524 | TARGETED_DEVICE_FAMILY = 1;
525 | };
526 | name = Release;
527 | };
528 | /* End XCBuildConfiguration section */
529 |
530 | /* Begin XCConfigurationList section */
531 | 8F625A3A230F2FA500EF3F92 /* Build configuration list for PBXProject "MensaGuthaben" */ = {
532 | isa = XCConfigurationList;
533 | buildConfigurations = (
534 | 8F625A51230F2FA600EF3F92 /* Debug */,
535 | 8F625A52230F2FA600EF3F92 /* Release */,
536 | );
537 | defaultConfigurationIsVisible = 0;
538 | defaultConfigurationName = Release;
539 | };
540 | 8F625A53230F2FA600EF3F92 /* Build configuration list for PBXNativeTarget "MensaGuthaben" */ = {
541 | isa = XCConfigurationList;
542 | buildConfigurations = (
543 | 8F625A54230F2FA600EF3F92 /* Debug */,
544 | 8F625A55230F2FA600EF3F92 /* Release */,
545 | );
546 | defaultConfigurationIsVisible = 0;
547 | defaultConfigurationName = Release;
548 | };
549 | /* End XCConfigurationList section */
550 |
551 | /* Begin XCRemoteSwiftPackageReference section */
552 | 8FC4B7F228E5966100100E82 /* XCRemoteSwiftPackageReference "PromiseKit" */ = {
553 | isa = XCRemoteSwiftPackageReference;
554 | repositoryURL = "https://github.com/mxcl/PromiseKit";
555 | requirement = {
556 | kind = upToNextMajorVersion;
557 | minimumVersion = 6.0.0;
558 | };
559 | };
560 | 8FC4B7F528E5969200100E82 /* XCRemoteSwiftPackageReference "Charts" */ = {
561 | isa = XCRemoteSwiftPackageReference;
562 | repositoryURL = "https://github.com/danielgindi/Charts";
563 | requirement = {
564 | kind = upToNextMajorVersion;
565 | minimumVersion = 4.0.0;
566 | };
567 | };
568 | 8FE6720D28E71A150022C5AC /* XCRemoteSwiftPackageReference "JKDesFireReader" */ = {
569 | isa = XCRemoteSwiftPackageReference;
570 | repositoryURL = "https://github.com/TheJKM/JKDesFireReader";
571 | requirement = {
572 | kind = upToNextMajorVersion;
573 | minimumVersion = 1.0.0;
574 | };
575 | };
576 | /* End XCRemoteSwiftPackageReference section */
577 |
578 | /* Begin XCSwiftPackageProductDependency section */
579 | 8FC4B7F328E5966100100E82 /* PromiseKit */ = {
580 | isa = XCSwiftPackageProductDependency;
581 | package = 8FC4B7F228E5966100100E82 /* XCRemoteSwiftPackageReference "PromiseKit" */;
582 | productName = PromiseKit;
583 | };
584 | 8FC4B7F628E5969200100E82 /* Charts */ = {
585 | isa = XCSwiftPackageProductDependency;
586 | package = 8FC4B7F528E5969200100E82 /* XCRemoteSwiftPackageReference "Charts" */;
587 | productName = Charts;
588 | };
589 | 8FE6720E28E71A150022C5AC /* JKDesFireReader */ = {
590 | isa = XCSwiftPackageProductDependency;
591 | package = 8FE6720D28E71A150022C5AC /* XCRemoteSwiftPackageReference "JKDesFireReader" */;
592 | productName = JKDesFireReader;
593 | };
594 | /* End XCSwiftPackageProductDependency section */
595 | };
596 | rootObject = 8F625A37230F2FA500EF3F92 /* Project object */;
597 | }
598 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------