Marino Faggiana 1 éve
szülő
commit
e425d6b86c

+ 0 - 12
Nextcloud.xcodeproj/project.pbxproj

@@ -140,7 +140,6 @@
 		F7148059262ED52200693E51 /* NCSectionHeaderMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F78ACD57219048040088454D /* NCSectionHeaderMenu.xib */; };
 		F714805E262ED52900693E51 /* NCSectionFooter.xib in Resources */ = {isa = PBXBuildFile; fileRef = F78ACD53219047D40088454D /* NCSectionFooter.xib */; };
 		F7148063262ED66200693E51 /* NCEmptyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7239876253D86D300257F49 /* NCEmptyView.xib */; };
-		F716B75F26F09DF600D37EFC /* NCKTVHTTPCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = F716B75E26F09DF600D37EFC /* NCKTVHTTPCache.swift */; };
 		F717402D24F699A5000C87D5 /* NCFavorite.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F717402B24F699A5000C87D5 /* NCFavorite.storyboard */; };
 		F717402E24F699A5000C87D5 /* NCFavorite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F717402C24F699A5000C87D5 /* NCFavorite.swift */; };
 		F718C24E254D507B00C5C256 /* NCViewerMediaDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F718C24D254D507B00C5C256 /* NCViewerMediaDetailView.swift */; };
@@ -328,10 +327,6 @@
 		F76D3CF12428B40E005DFA87 /* NCViewerPDFSearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76D3CF02428B40E005DFA87 /* NCViewerPDFSearch.swift */; };
 		F76D3CF32428B94E005DFA87 /* NCViewerPDFSearchCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F76D3CF22428B94E005DFA87 /* NCViewerPDFSearchCell.xib */; };
 		F76D3CF52428D0C1005DFA87 /* NCViewerPDF.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F76D3CF42428D0C0005DFA87 /* NCViewerPDF.storyboard */; };
-		F76DA93F277B75870082465B /* KTVCocoaHTTPServer.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F70B867E2642CF5400ED5349 /* KTVCocoaHTTPServer.xcframework */; };
-		F76DA940277B75870082465B /* KTVCocoaHTTPServer.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F70B867E2642CF5400ED5349 /* KTVCocoaHTTPServer.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		F76DA941277B75870082465B /* KTVHTTPCache.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F70B86792642CF5300ED5349 /* KTVHTTPCache.xcframework */; };
-		F76DA942277B75870082465B /* KTVHTTPCache.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F70B86792642CF5300ED5349 /* KTVHTTPCache.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F76DA95B277B75A90082465B /* TOPasscodeViewController.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F70B86822642CF5500ED5349 /* TOPasscodeViewController.xcframework */; };
 		F76DA95C277B75A90082465B /* TOPasscodeViewController.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F70B86822642CF5500ED5349 /* TOPasscodeViewController.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F76DA963277B760E0082465B /* Queuer in Frameworks */ = {isa = PBXBuildFile; productRef = F76DA962277B760E0082465B /* Queuer */; };
@@ -668,9 +663,7 @@
 			dstSubfolderSpec = 10;
 			files = (
 				F7792DE629EEE02D005930CE /* MobileVLCKit.xcframework in Embed Frameworks */,
-				F76DA942277B75870082465B /* KTVHTTPCache.xcframework in Embed Frameworks */,
 				F76DA95C277B75A90082465B /* TOPasscodeViewController.xcframework in Embed Frameworks */,
-				F76DA940277B75870082465B /* KTVCocoaHTTPServer.xcframework in Embed Frameworks */,
 			);
 			name = "Embed Frameworks";
 			runOnlyForDeploymentPostprocessing = 0;
@@ -837,7 +830,6 @@
 		F7151A811D477A4B00E6AF45 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
 		F7169A301EE59BB70086BD69 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = "<group>"; };
 		F7169A4C1EE59C640086BD69 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Localizable.strings; sourceTree = "<group>"; };
-		F716B75E26F09DF600D37EFC /* NCKTVHTTPCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCKTVHTTPCache.swift; sourceTree = "<group>"; };
 		F716FE7723795E5000FABE50 /* NCCommunication.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NCCommunication.framework; path = Carthage/Build/iOS/NCCommunication.framework; sourceTree = "<group>"; };
 		F717402B24F699A5000C87D5 /* NCFavorite.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCFavorite.storyboard; sourceTree = "<group>"; };
 		F717402C24F699A5000C87D5 /* NCFavorite.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCFavorite.swift; sourceTree = "<group>"; };
@@ -1333,7 +1325,6 @@
 			buildActionMask = 2147483647;
 			files = (
 				F7D56B1A2972405500FA46C4 /* Mantis in Frameworks */,
-				F76DA941277B75870082465B /* KTVHTTPCache.xcframework in Frameworks */,
 				F7ED547C25EEA65400956C55 /* QRCodeReader in Frameworks */,
 				F788ECC7263AAAFA00ADC67F /* MarkdownKit in Frameworks */,
 				F77BC3EB293E5268005F2B08 /* Swifter in Frameworks */,
@@ -1358,7 +1349,6 @@
 				F72DA9B425F53E4E00B87DB1 /* SwiftRichString in Frameworks */,
 				F74E7720277A2EF40013B958 /* XLForm in Frameworks */,
 				F73ADD1C265546890069EA0D /* SwiftEntryKit in Frameworks */,
-				F76DA93F277B75870082465B /* KTVCocoaHTTPServer.xcframework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1882,7 +1872,6 @@
 				F79EDAA126B004980007D134 /* NCPlayer.swift */,
 				F732D23227CF8AED000B0F1B /* NCPlayerToolBar.xib */,
 				F79EDA9F26B004980007D134 /* NCPlayerToolBar.swift */,
-				F716B75E26F09DF600D37EFC /* NCKTVHTTPCache.swift */,
 			);
 			path = NCPlayer;
 			sourceTree = "<group>";
@@ -3247,7 +3236,6 @@
 				AF4BF61927562A4B0081CEEF /* NCManageDatabase+Metadata.swift in Sources */,
 				F78A18B623CDD07D00F681F3 /* NCViewerRichWorkspaceWebView.swift in Sources */,
 				AFA2AC8527849604008E1EA7 /* NCActivityCommentView.swift in Sources */,
-				F716B75F26F09DF600D37EFC /* NCKTVHTTPCache.swift in Sources */,
 				AFCE353727E4ED7B00FEA6C2 /* NCShareCells.swift in Sources */,
 				AF36077127BFA4E8001A243D /* ParallelWorker.swift in Sources */,
 				F75A9EE623796C6F0044CFCE /* NCNetworking.swift in Sources */,

+ 0 - 1
iOSClient/AppDelegate.swift

@@ -580,7 +580,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         if serverVersionMajor > 0 {
             NextcloudKit.shared.setup(nextcloudVersion: serverVersionMajor)
         }
-        NCKTVHTTPCache.shared.restartProxy(user: user, password: password)
 
         DispatchQueue.main.async {
             if UIApplication.shared.applicationState != .background && accountTestBackup != accountTest {

+ 1 - 1
iOSClient/Settings/Acknowledgements.rtf

@@ -75,7 +75,7 @@ Copyright (c) Xmartlabs ( http://xmartlabs.com )\
 __________________________________\
 \
 
-\f1\b KTVHTTPCache
+\f1\b VLC
 \f0\b0 \
 \
 MIT License\

+ 0 - 2
iOSClient/Settings/CCAdvanced.m

@@ -405,8 +405,6 @@
 
     [CCUtility removeDocumentsDirectory];
     [CCUtility removeTemporaryDirectory];
-
-    [[NCKTVHTTPCache shared] deleteAllCache];
     
     [CCUtility createDirectoryStandard];
 

+ 0 - 2
iOSClient/Utility/NCUtility.swift

@@ -29,7 +29,6 @@ import CoreMedia
 import Photos
 
 #if !EXTENSION
-import KTVHTTPCache
 import SVGKit
 #endif
 
@@ -213,7 +212,6 @@ class NCUtility: NSObject {
 
         URLCache.shared.memoryCapacity = 0
         URLCache.shared.diskCapacity = 0
-        KTVHTTPCache.cacheDeleteAllCaches()
 
         NCManageDatabase.shared.clearDatabase(account: nil, removeAccount: true)
 

+ 0 - 148
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCKTVHTTPCache.swift

@@ -1,148 +0,0 @@
-//
-//  NCKTVHTTPCache.swift
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 28/10/2020.
-//  Copyright © 2020 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This 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.
-//
-//  This 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.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-import UIKit
-import KTVHTTPCache
-
-class NCKTVHTTPCache: NSObject {
-    @objc static let shared: NCKTVHTTPCache = {
-        let instance = NCKTVHTTPCache()
-        instance.setupHTTPCache()
-        return instance
-    }()
-
-    func getVideoURL(metadata: tableMetadata) -> (url: URL?, isProxy: Bool) {
-
-        if CCUtility.fileProviderStorageExists(metadata) || metadata.isDirectoryE2EE {
-
-            return (URL(fileURLWithPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)), false)
-
-        } else {
-
-            guard let stringURL = (metadata.serverUrl + "/" + metadata.fileName).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { return (nil, false) }
-
-            return (NCKTVHTTPCache.shared.getProxyURL(stringURL: stringURL), true)
-        }
-    }
-
-    func restartProxy(user: String, password: String) {
-
-        if KTVHTTPCache.proxyIsRunning() {
-            KTVHTTPCache.proxyStop()
-        }
-
-        startProxy(user: user, password: password)
-    }
-
-    private func startProxy(user: String, password: String) {
-
-        guard let authData = (user + ":" + password).data(using: .utf8) else { return }
-
-        let authValue = "Basic " + authData.base64EncodedString(options: [])
-        KTVHTTPCache.downloadSetAdditionalHeaders(["Authorization": authValue, "User-Agent": CCUtility.getUserAgent()])
-
-        if !KTVHTTPCache.proxyIsRunning() {
-            do {
-                try KTVHTTPCache.proxyStart()
-            } catch let error {
-                print("Proxy Start error : \(error)")
-            }
-        }
-    }
-
-    private func stopProxy() {
-
-        if KTVHTTPCache.proxyIsRunning() {
-            KTVHTTPCache.proxyStop()
-        }
-    }
-
-    func getProxyURL(stringURL: String) -> URL {
-
-        return KTVHTTPCache.proxyURL(withOriginalURL: URL(string: stringURL))
-    }
-
-    func getCacheCompleteFileURL(videoURL: URL?) -> URL? {
-
-        return KTVHTTPCache.cacheCompleteFileURL(with: videoURL)
-    }
-
-    func deleteCache(videoURL: URL?) {
-
-        KTVHTTPCache.cacheDelete(with: videoURL)
-    }
-
-    @objc func deleteAllCache() {
-
-        KTVHTTPCache.cacheDeleteAllCaches()
-    }
-
-    func saveCache(metadata: tableMetadata) {
-
-        if !CCUtility.fileProviderStorageExists(metadata) {
-
-            guard let stringURL = (metadata.serverUrl + "/" + metadata.fileName).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { return }
-
-            let videoURL = URL(string: stringURL)
-            guard let url = KTVHTTPCache.cacheCompleteFileURL(with: videoURL) else { return }
-
-            CCUtility.copyFile(atPath: url.path, toPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView))
-            NCManageDatabase.shared.addLocalFile(metadata: metadata)
-            KTVHTTPCache.cacheDelete(with: videoURL)
-
-            NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource, userInfo: ["serverUrl": metadata.serverUrl])
-        }
-    }
-
-    func getDownloadStatusCode(metadata: tableMetadata) -> Int {
-
-        guard let stringURL = (metadata.serverUrl + "/" + metadata.fileName).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { return 0 }
-        let url = URL(string: stringURL)
-        return KTVHTTPCache.downloadStatusCode(url)
-    }
-
-    private func setupHTTPCache() {
-
-        KTVHTTPCache.cacheSetMaxCacheLength(NCGlobal.shared.maxHTTPCache)
-
-        if ProcessInfo.processInfo.environment["SIMULATOR_DEVICE_NAME"] != nil {
-            KTVHTTPCache.logSetConsoleLogEnable(true)
-        }
-
-        do {
-            try KTVHTTPCache.proxyStart()
-        } catch let error {
-            print("Proxy Start error : \(error)")
-        }
-
-        KTVHTTPCache.encodeSetURLConverter { url -> URL? in
-            print("URL Filter received URL : " + String(describing: url))
-            return url
-        }
-
-        KTVHTTPCache.downloadSetUnacceptableContentTypeDisposer { url, contentType -> Bool in
-            print("Unsupport Content-Type Filter received URL : " + String(describing: url) + " " + String(describing: contentType))
-            return false
-        }
-    }
-}