Skip to content

Commit 08d03cf

Browse files
authored
Merge pull request #12 from TomTasche/development
v1.5
2 parents f49feb9 + 690528c commit 08d03cf

192 files changed

Lines changed: 29891 additions & 1033 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

OpenDocumentReader.xcodeproj/project.pbxproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,28 +159,28 @@
159159
isa = PBXContainerItemProxy;
160160
containerPortal = E26C38EA2250D91C009C484A /* odr.xcodeproj */;
161161
proxyType = 1;
162-
remoteGlobalIDString = DA4E7B9938AA4102BE60C872;
162+
remoteGlobalIDString = 0F8A108E2C594911A247D0AC;
163163
remoteInfo = glog;
164164
};
165165
E26C39322250D976009C484A /* PBXContainerItemProxy */ = {
166166
isa = PBXContainerItemProxy;
167167
containerPortal = E26C38EA2250D91C009C484A /* odr.xcodeproj */;
168168
proxyType = 1;
169-
remoteGlobalIDString = 59E861706DE74FBE83A95540;
169+
remoteGlobalIDString = 38511368D2F6490DAC6010ED;
170170
remoteInfo = miniz;
171171
};
172172
E26C39342250D976009C484A /* PBXContainerItemProxy */ = {
173173
isa = PBXContainerItemProxy;
174174
containerPortal = E26C38EA2250D91C009C484A /* odr.xcodeproj */;
175175
proxyType = 1;
176-
remoteGlobalIDString = 96B2CCC9BADA4F4CA7A6D6C1;
176+
remoteGlobalIDString = 9BC43A20109B4428920064F9;
177177
remoteInfo = odrlib;
178178
};
179179
E26C39362250D976009C484A /* PBXContainerItemProxy */ = {
180180
isa = PBXContainerItemProxy;
181181
containerPortal = E26C38EA2250D91C009C484A /* odr.xcodeproj */;
182182
proxyType = 1;
183-
remoteGlobalIDString = 7D68283BF0F54F51963794E4;
183+
remoteGlobalIDString = 02E9C2F28FAF47A7B44B0EB1;
184184
remoteInfo = tinyxml2;
185185
};
186186
E2CDC4BA226A407500E9FCED /* PBXContainerItemProxy */ = {
@@ -215,7 +215,7 @@
215215
isa = PBXContainerItemProxy;
216216
containerPortal = E26C38EA2250D91C009C484A /* odr.xcodeproj */;
217217
proxyType = 1;
218-
remoteGlobalIDString = D98AA50E7908420CAD0D441E;
218+
remoteGlobalIDString = CBE800DAB4894B91A1AB68A8;
219219
remoteInfo = "cryptopp-object";
220220
};
221221
/* End PBXContainerItemProxy section */
@@ -656,6 +656,7 @@
656656
);
657657
inputPaths = (
658658
"${SRCROOT}/Pods/Target Support Files/Pods-OpenDocumentReader/Pods-OpenDocumentReader-frameworks.sh",
659+
"${BUILT_PRODUCTS_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework",
659660
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
660661
"${BUILT_PRODUCTS_DIR}/ScrollableSegmentedControl/ScrollableSegmentedControl.framework",
661662
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
@@ -664,6 +665,7 @@
664665
outputFileListPaths = (
665666
);
666667
outputPaths = (
668+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMSessionFetcher.framework",
667669
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
668670
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ScrollableSegmentedControl.framework",
669671
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",

OpenDocumentReader/DocumentBrowserViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ class DocumentBrowserViewController: UIDocumentBrowserViewController, UIDocument
8282

8383
documentViewController.document = doc
8484

85+
let shortenedDocumentUrl = documentURL.absoluteString.prefix(49) + ".." + documentURL.absoluteString.suffix(49)
8586
Analytics.logEvent(AnalyticsEventViewItem, parameters: [
86-
AnalyticsParameterItemName: documentURL.absoluteString
87+
AnalyticsParameterItemName: shortenedDocumentUrl
8788
])
8889

8990
doc.open { [weak self](success) in

OpenDocumentReader/DocumentViewController.swift

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class DocumentViewController: UIViewController, DocumentDelegate {
3131
}
3232
}
3333

34+
private var EXTENSION_WHITELIST = ["pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "rtf", "rtfd.zip", "csv", "txt", "jpg", "jpeg", "png", "gif", "svg", "pages", "pages.zip", "numbers", "numbers.zip", "key", "key.zip", "mp3", "mp4", "flv", "mkv", "3gp", "aac", "bmp", "css", "htm", "html", "js", "json", "mpeg", "oga", "ogv", "sh", "tif", "tiff", "weba", "webm", "webp", "xhtml", "xml"]
35+
3436
@IBOutlet weak var segmentedControl: ScrollableSegmentedControl!
3537
private var initialSelect = false
3638

@@ -195,7 +197,22 @@ class DocumentViewController: UIViewController, DocumentDelegate {
195197
}
196198

197199
func documentLoadingError(_ doc: Document) {
198-
self.webview.loadHTMLString("<html><h1>Error</h1>Failed to load given document. Please try another one while we are working hard to support as many documents as possible. Feel free to contact us via tomtasche@gmail.com for further questions.</html>", baseURL: nil)
200+
let fileType = doc.fileURL.pathExtension.lowercased()
201+
for type in EXTENSION_WHITELIST {
202+
if (!fileType.starts(with: type)) {
203+
continue;
204+
}
205+
206+
self.webview.loadFileURL(doc.fileURL, allowingReadAccessTo: doc.fileURL)
207+
208+
progressBar.isHidden = true
209+
210+
Analytics.logEvent("load_pdf", parameters: nil)
211+
212+
return;
213+
}
214+
215+
self.webview.loadHTMLString("<html><h1>Error</h1>Failed to load given document. Please try another one while we are working hard to support as many documents as possible. Feel free to contact us via support@opendocument.app for further questions.</html>", baseURL: nil)
199216

200217
Analytics.logEvent("load_error", parameters: nil)
201218
}

OpenDocumentReader/Info.plist

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<key>CFBundleTypeIconFiles</key>
1313
<array/>
1414
<key>CFBundleTypeName</key>
15-
<string>ODF</string>
15+
<string>ODT</string>
1616
<key>CFBundleTypeRole</key>
1717
<string>Viewer</string>
1818
<key>LSHandlerRank</key>
@@ -22,6 +22,23 @@
2222
<string>public.zip-archive</string>
2323
</array>
2424
</dict>
25+
<dict>
26+
<key>CFBundleTypeIconFiles</key>
27+
<array/>
28+
<key>CFBundleTypeName</key>
29+
<string>Others</string>
30+
<key>CFBundleTypeRole</key>
31+
<string>Viewer</string>
32+
<key>LSHandlerRank</key>
33+
<string>Alternate</string>
34+
<key>LSItemContentTypes</key>
35+
<array>
36+
<string>public.text</string>
37+
<string>public.image</string>
38+
<string>public.audiovisual-content</string>
39+
<string>public.composite-content</string>
40+
</array>
41+
</dict>
2542
</array>
2643
<key>CFBundleExecutable</key>
2744
<string>$(EXECUTABLE_NAME)</string>
@@ -34,9 +51,9 @@
3451
<key>CFBundlePackageType</key>
3552
<string>APPL</string>
3653
<key>CFBundleShortVersionString</key>
37-
<string>1.3</string>
54+
<string>1.5</string>
3855
<key>CFBundleVersion</key>
39-
<string>6</string>
56+
<string>8</string>
4057
<key>LSRequiresIPhoneOS</key>
4158
<true/>
4259
<key>UILaunchStoryboardName</key>
@@ -63,9 +80,5 @@
6380
</array>
6481
<key>UISupportsDocumentBrowser</key>
6582
<true/>
66-
<key>UTImportedTypeDeclarations</key>
67-
<array>
68-
<dict/>
69-
</array>
7083
</dict>
7184
</plist>

Podfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
# Uncomment the next line to define a global platform for your project
2-
# platform :ios, '9.0'
1+
platform :ios, '11.0'
32

43
target 'OpenDocumentReader' do
5-
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
64
use_frameworks!
75

86
# Pods for OpenDocumentReader
9-
pod 'ScrollableSegmentedControl', '~> 1.4.0'
7+
pod 'ScrollableSegmentedControl'
108
pod 'Firebase/Core'
11-
pod 'Fabric', '~> 1.9.0'
12-
pod 'Crashlytics', '~> 3.12.0'
9+
pod 'Firebase/Storage'
10+
pod 'Fabric'
11+
pod 'Crashlytics'
1312
end

Podfile.lock

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,88 +2,105 @@ PODS:
22
- Crashlytics (3.12.0):
33
- Fabric (~> 1.9.0)
44
- Fabric (1.9.0)
5-
- Firebase/Core (5.17.0):
5+
- Firebase/Core (5.20.2):
66
- Firebase/CoreOnly
7-
- FirebaseAnalytics (= 5.6.0)
8-
- Firebase/CoreOnly (5.17.0):
9-
- FirebaseCore (= 5.3.0)
10-
- FirebaseAnalytics (5.6.0):
11-
- FirebaseCore (~> 5.3)
12-
- FirebaseInstanceID (~> 3.5)
13-
- GoogleAppMeasurement (= 5.6.0)
7+
- FirebaseAnalytics (= 5.8.1)
8+
- Firebase/CoreOnly (5.20.2):
9+
- FirebaseCore (= 5.4.1)
10+
- Firebase/Storage (5.20.2):
11+
- Firebase/CoreOnly
12+
- FirebaseStorage (= 3.1.1)
13+
- FirebaseAnalytics (5.8.1):
14+
- FirebaseCore (~> 5.4)
15+
- FirebaseInstanceID (~> 3.8)
16+
- GoogleAppMeasurement (= 5.8.1)
1417
- GoogleUtilities/AppDelegateSwizzler (~> 5.2)
1518
- GoogleUtilities/MethodSwizzler (~> 5.2)
1619
- GoogleUtilities/Network (~> 5.2)
1720
- "GoogleUtilities/NSData+zlib (~> 5.2)"
1821
- nanopb (~> 0.3)
19-
- FirebaseCore (5.3.0):
22+
- FirebaseAuthInterop (1.0.0)
23+
- FirebaseCore (5.4.1):
24+
- GoogleUtilities/Environment (~> 5.2)
2025
- GoogleUtilities/Logger (~> 5.2)
21-
- FirebaseInstanceID (3.5.0):
22-
- FirebaseCore (~> 5.3)
23-
- GoogleUtilities/Environment (~> 5.3)
24-
- GoogleUtilities/UserDefaults (~> 5.3)
25-
- GoogleAppMeasurement (5.6.0):
26+
- FirebaseInstanceID (3.8.1):
27+
- FirebaseCore (~> 5.2)
28+
- GoogleUtilities/Environment (~> 5.2)
29+
- GoogleUtilities/UserDefaults (~> 5.2)
30+
- FirebaseStorage (3.1.1):
31+
- FirebaseAuthInterop (~> 1.0)
32+
- FirebaseCore (~> 5.2)
33+
- GTMSessionFetcher/Core (~> 1.1)
34+
- GoogleAppMeasurement (5.8.1):
2635
- GoogleUtilities/AppDelegateSwizzler (~> 5.2)
2736
- GoogleUtilities/MethodSwizzler (~> 5.2)
2837
- GoogleUtilities/Network (~> 5.2)
2938
- "GoogleUtilities/NSData+zlib (~> 5.2)"
3039
- nanopb (~> 0.3)
31-
- GoogleUtilities/AppDelegateSwizzler (5.3.7):
40+
- GoogleUtilities/AppDelegateSwizzler (5.8.0):
3241
- GoogleUtilities/Environment
3342
- GoogleUtilities/Logger
3443
- GoogleUtilities/Network
35-
- GoogleUtilities/Environment (5.3.7)
36-
- GoogleUtilities/Logger (5.3.7):
44+
- GoogleUtilities/Environment (5.8.0)
45+
- GoogleUtilities/Logger (5.8.0):
3746
- GoogleUtilities/Environment
38-
- GoogleUtilities/MethodSwizzler (5.3.7):
47+
- GoogleUtilities/MethodSwizzler (5.8.0):
3948
- GoogleUtilities/Logger
40-
- GoogleUtilities/Network (5.3.7):
49+
- GoogleUtilities/Network (5.8.0):
4150
- GoogleUtilities/Logger
4251
- "GoogleUtilities/NSData+zlib"
4352
- GoogleUtilities/Reachability
44-
- "GoogleUtilities/NSData+zlib (5.3.7)"
45-
- GoogleUtilities/Reachability (5.3.7):
53+
- "GoogleUtilities/NSData+zlib (5.8.0)"
54+
- GoogleUtilities/Reachability (5.8.0):
4655
- GoogleUtilities/Logger
47-
- GoogleUtilities/UserDefaults (5.3.7):
56+
- GoogleUtilities/UserDefaults (5.8.0):
4857
- GoogleUtilities/Logger
58+
- GTMSessionFetcher/Core (1.2.1)
4959
- nanopb (0.3.901):
5060
- nanopb/decode (= 0.3.901)
5161
- nanopb/encode (= 0.3.901)
5262
- nanopb/decode (0.3.901)
5363
- nanopb/encode (0.3.901)
54-
- ScrollableSegmentedControl (1.4.0)
64+
- ScrollableSegmentedControl (1.5.0)
5565

5666
DEPENDENCIES:
57-
- Crashlytics (~> 3.12.0)
58-
- Fabric (~> 1.9.0)
67+
- Crashlytics
68+
- Fabric
5969
- Firebase/Core
60-
- ScrollableSegmentedControl (~> 1.4.0)
70+
- Firebase/Storage
71+
- ScrollableSegmentedControl
6172

6273
SPEC REPOS:
6374
https://github.com/cocoapods/specs.git:
6475
- Crashlytics
6576
- Fabric
6677
- Firebase
6778
- FirebaseAnalytics
79+
- FirebaseAuthInterop
6880
- FirebaseCore
6981
- FirebaseInstanceID
82+
- FirebaseStorage
7083
- GoogleAppMeasurement
7184
- GoogleUtilities
85+
- GTMSessionFetcher
7286
- nanopb
7387
- ScrollableSegmentedControl
7488

7589
SPEC CHECKSUMS:
7690
Crashlytics: 07fb167b1694128c1c9a5a5cc319b0e9c3ca0933
7791
Fabric: f988e33c97f08930a413e08123064d2e5f68d655
78-
Firebase: 59d557e064217fab6a03ff00baa73c06e73832e6
79-
FirebaseAnalytics: 75e4bbc6417d190cc98ec1f17c41a4fad4c2c976
80-
FirebaseCore: c0c4befb82374d6aef64d800e569f47625352edc
81-
FirebaseInstanceID: 4522aad88f69297622062c0e9ffccdee3dd9b151
82-
GoogleAppMeasurement: 008e04ecd8efedd97a693aea8634aefe220bd26e
83-
GoogleUtilities: 111a012f4c3a29c9e7c954c082fafd6ee3c999c0
92+
Firebase: 0c8cf33f266410c61ab3e2265cfa412200351d9c
93+
FirebaseAnalytics: ece1aa57a4f43c64d53a648b5a5e05151aae947b
94+
FirebaseAuthInterop: 0ffa57668be100582bb7643d4fcb7615496c41fc
95+
FirebaseCore: f1a9a8be1aee4bf71a2fc0f4096df6788bdfda61
96+
FirebaseInstanceID: a122b0c258720cf250551bb2bedf48c699f80d90
97+
FirebaseStorage: 6162ef4322502b818d9de0ec552f5226d283de43
98+
GoogleAppMeasurement: ffe513e90551844a739e7bcbb1d2aca1c28a4338
99+
GoogleUtilities: 04fce34bcd5620c1ee76fb79172105c74a4df335
100+
GTMSessionFetcher: 32aeca0aa144acea523e1c8e053089dec2cb98ca
84101
nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
85-
ScrollableSegmentedControl: 56f7baa7f1d7e622e00abb9d6658856c2d52dd4b
102+
ScrollableSegmentedControl: 2e64bbe8968a7fcd8aae5014434481464fcdfe60
86103

87-
PODFILE CHECKSUM: 76cec4a0a9956dc3041288e8ec2f9b666e1c9fdb
104+
PODFILE CHECKSUM: 56c1b56208f1c9800f198a7615d0b3919b381711
88105

89106
COCOAPODS: 1.5.3

Pods/Firebase/CoreOnly/Sources/Firebase.h

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/Modules/module.modulemap

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

0 commit comments

Comments
 (0)