mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-27 22:10:57 -04:00
redirection handling with new version of libkiwix (#125)
This commit is contained in:
parent
e8fb80cd42
commit
00d1b5515b
File diff suppressed because it is too large
Load Diff
@ -24,5 +24,68 @@
|
|||||||
</Locations>
|
</Locations>
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Shared/Procedure/LibraryRefreshProcedure.swift"
|
||||||
|
timestampString = "547074450.8264019"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "108"
|
||||||
|
endingLineNumber = "108"
|
||||||
|
landmarkName = "execute()"
|
||||||
|
landmarkType = "7">
|
||||||
|
<Locations>
|
||||||
|
<Location
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
symbolName = "Kiwix.(ProcessProcedure in _6965C0AAE2F8E23C2E8F87291CBA11F5).__ivar_destroyer"
|
||||||
|
moduleName = "Kiwix"
|
||||||
|
usesParentBreakpointCondition = "Yes"
|
||||||
|
urlString = "file:///Users/chrisli/Developer/Kiwix/Shared/Procedure/LibraryRefreshProcedure.swift"
|
||||||
|
timestampString = "547242682.849393"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "0"
|
||||||
|
endingLineNumber = "0"
|
||||||
|
offsetFromSymbolStart = "4">
|
||||||
|
</Location>
|
||||||
|
<Location
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
symbolName = "Kiwix.(ProcessProcedure in _6965C0AAE2F8E23C2E8F87291CBA11F5).__deallocating_deinit"
|
||||||
|
moduleName = "Kiwix"
|
||||||
|
usesParentBreakpointCondition = "Yes"
|
||||||
|
urlString = "file:///Users/chrisli/Developer/Kiwix/Shared/Procedure/LibraryRefreshProcedure.swift"
|
||||||
|
timestampString = "547242682.851963"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "0"
|
||||||
|
endingLineNumber = "0"
|
||||||
|
offsetFromSymbolStart = "4">
|
||||||
|
</Location>
|
||||||
|
<Location
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
symbolName = "Kiwix.(ProcessProcedure in _6965C0AAE2F8E23C2E8F87291CBA11F5).init(disableAutomaticFinishing: Swift.Bool) -> Kiwix.(ProcessProcedure in _6965C0AAE2F8E23C2E8F87291CBA11F5)"
|
||||||
|
moduleName = "Kiwix"
|
||||||
|
usesParentBreakpointCondition = "Yes"
|
||||||
|
urlString = "file:///Users/chrisli/Developer/Kiwix/Shared/Procedure/LibraryRefreshProcedure.swift"
|
||||||
|
timestampString = "547242682.8541"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "109"
|
||||||
|
endingLineNumber = "109"
|
||||||
|
offsetFromSymbolStart = "16">
|
||||||
|
</Location>
|
||||||
|
</Locations>
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
</Breakpoints>
|
</Breakpoints>
|
||||||
</Bucket>
|
</Bucket>
|
||||||
|
@ -129,10 +129,10 @@ NSMutableDictionary *fileURLs = [[NSMutableDictionary alloc] init]; // [ID: File
|
|||||||
std::string contentPathC = [contentPath cStringUsingEncoding:NSUTF8StringEncoding];
|
std::string contentPathC = [contentPath cStringUsingEncoding:NSUTF8StringEncoding];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
kiwix::Entry entry = reader->getEntryFromUrl(contentPathC);
|
kiwix::Entry entry = reader->getEntryFromPath(contentPathC);
|
||||||
entry = entry.getFinalEntry();
|
entry = entry.getFinalEntry();
|
||||||
|
|
||||||
std::string redirectedContentPathC = entry.getUrl();
|
std::string redirectedContentPathC = entry.getPath();
|
||||||
if (redirectedContentPathC.substr(0, 1) != "/") {
|
if (redirectedContentPathC.substr(0, 1) != "/") {
|
||||||
redirectedContentPathC = "/" + redirectedContentPathC;
|
redirectedContentPathC = "/" + redirectedContentPathC;
|
||||||
}
|
}
|
||||||
@ -158,10 +158,10 @@ NSMutableDictionary *fileURLs = [[NSMutableDictionary alloc] init]; // [ID: File
|
|||||||
std::shared_ptr<kiwix::Reader> reader = found->second;
|
std::shared_ptr<kiwix::Reader> reader = found->second;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
kiwix::Entry entry = reader->getEntryFromUrl([contentURL cStringUsingEncoding:NSUTF8StringEncoding]);
|
kiwix::Entry entry = reader->getEntryFromPath([contentURL cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||||
NSData *data = [NSData dataWithBytes:entry.getContent().data() length:entry.getSize()];
|
NSData *data = [NSData dataWithBytes:entry.getContent().data() length:entry.getSize()];
|
||||||
NSString *mime = [NSString stringWithUTF8String:entry.getMimetype().c_str()];
|
NSString *mime = [NSString stringWithUTF8String:entry.getMimetype().c_str()];
|
||||||
NSNumber *length = [NSNumber numberWithUnsignedInt:entry.getSize()];
|
NSNumber *length = [NSNumber numberWithUnsignedLongLong:entry.getSize()];
|
||||||
return @{@"data": data, @"mime": mime, @"length": length};
|
return @{@"data": data, @"mime": mime, @"length": length};
|
||||||
} catch (kiwix::NoEntry) {
|
} catch (kiwix::NoEntry) {
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.9</string>
|
<string>1.9</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>12</string>
|
<string>16</string>
|
||||||
<key>NSExtension</key>
|
<key>NSExtension</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSExtensionMainStoryboard</key>
|
<key>NSExtensionMainStoryboard</key>
|
||||||
|
@ -256,7 +256,7 @@ class LibraryBookDetailController: UIViewController, UITableViewDelegate, UITabl
|
|||||||
cell.textLabel?.text = NSLocalizedString("Date", comment: "Book Detail Cell")
|
cell.textLabel?.text = NSLocalizedString("Date", comment: "Book Detail Cell")
|
||||||
cell.detailTextLabel?.text = book.dateDescription
|
cell.detailTextLabel?.text = book.dateDescription
|
||||||
case .hasIndex:
|
case .hasIndex:
|
||||||
cell.textLabel?.text = NSLocalizedString("Indexed", comment: "Book Detail Cell")
|
cell.textLabel?.text = NSLocalizedString("Index", comment: "Book Detail Cell")
|
||||||
cell.detailTextLabel?.text = {
|
cell.detailTextLabel?.text = {
|
||||||
if book.state == .local {
|
if book.state == .local {
|
||||||
if ZimMultiReader.shared.hasEmbeddedIndex(id: book.id) {
|
if ZimMultiReader.shared.hasEmbeddedIndex(id: book.id) {
|
||||||
|
@ -110,7 +110,7 @@ class LegacyWebController: UIViewController, UIWebViewDelegate, WebViewControlle
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
} else if url.scheme == "http" || url.scheme == "https" {
|
} else if url.scheme == "http" || url.scheme == "https" {
|
||||||
let policy = ExternalLinkLoadingPolicy(rawValue: Defaults[.externalLinkLoadingPolicy]) ?? .alwaysAsk
|
let policy = ExternalLinkLoadingPolicy(rawValue: Defaults[.externalLinkLoadingPolicy]) ?? .alwaysAsk
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>12</string>
|
<string>16</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>NSAppTransportSecurity</key>
|
<key>NSAppTransportSecurity</key>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user