瀏覽代碼

1.去掉YCDownloadSession 下载

huangxiaodong 11 月之前
父節點
當前提交
cd886569d1
共有 62 個文件被更改,包括 2707 次插入6440 次删除
  1. 1 1
      创维盒子/Podfile
  2. 1 10
      创维盒子/Podfile.lock
  3. 0 1
      创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloadDB.h
  4. 0 1
      创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloadItem.h
  5. 0 1
      创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloadManager.h
  6. 0 1
      创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloadSession.h
  7. 0 1
      创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloadTask.h
  8. 0 1
      创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloadUtils.h
  9. 0 1
      创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloader.h
  10. 0 1
      创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloadDB.h
  11. 0 1
      创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloadItem.h
  12. 0 1
      创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloadManager.h
  13. 0 1
      创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloadSession.h
  14. 0 1
      创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloadTask.h
  15. 0 1
      创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloadUtils.h
  16. 0 1
      创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloader.h
  17. 1 10
      创维盒子/Pods/Manifest.lock
  18. 2609 2842
      创维盒子/Pods/Pods.xcodeproj/project.pbxproj
  19. 0 58
      创维盒子/Pods/Pods.xcodeproj/xcuserdata/xdh.xcuserdatad/xcschemes/YCDownloadSession.xcscheme
  20. 0 5
      创维盒子/Pods/Pods.xcodeproj/xcuserdata/xdh.xcuserdatad/xcschemes/xcschememanagement.plist
  21. 1 1
      创维盒子/Pods/Target Support Files/Pods-双子星云手机Tests/Pods-双子星云手机Tests.debug.xcconfig
  22. 1 1
      创维盒子/Pods/Target Support Files/Pods-双子星云手机Tests/Pods-双子星云手机Tests.release.xcconfig
  23. 0 25
      创维盒子/Pods/Target Support Files/Pods-计算器/Pods-计算器-acknowledgements.markdown
  24. 0 31
      创维盒子/Pods/Target Support Files/Pods-计算器/Pods-计算器-acknowledgements.plist
  25. 3 3
      创维盒子/Pods/Target Support Files/Pods-计算器/Pods-计算器.debug.xcconfig
  26. 3 3
      创维盒子/Pods/Target Support Files/Pods-计算器/Pods-计算器.release.xcconfig
  27. 0 25
      创维盒子/Pods/Target Support Files/Pods-隐私保护-双子星云手机UITests/Pods-隐私保护-双子星云手机UITests-acknowledgements.markdown
  28. 0 31
      创维盒子/Pods/Target Support Files/Pods-隐私保护-双子星云手机UITests/Pods-隐私保护-双子星云手机UITests-acknowledgements.plist
  29. 3 3
      创维盒子/Pods/Target Support Files/Pods-隐私保护-双子星云手机UITests/Pods-隐私保护-双子星云手机UITests.debug.xcconfig
  30. 3 3
      创维盒子/Pods/Target Support Files/Pods-隐私保护-双子星云手机UITests/Pods-隐私保护-双子星云手机UITests.release.xcconfig
  31. 0 25
      创维盒子/Pods/Target Support Files/Pods-隐私保护/Pods-隐私保护-acknowledgements.markdown
  32. 0 31
      创维盒子/Pods/Target Support Files/Pods-隐私保护/Pods-隐私保护-acknowledgements.plist
  33. 3 3
      创维盒子/Pods/Target Support Files/Pods-隐私保护/Pods-隐私保护.debug.xcconfig
  34. 3 3
      创维盒子/Pods/Target Support Files/Pods-隐私保护/Pods-隐私保护.release.xcconfig
  35. 0 5
      创维盒子/Pods/Target Support Files/YCDownloadSession/YCDownloadSession-dummy.m
  36. 0 12
      创维盒子/Pods/Target Support Files/YCDownloadSession/YCDownloadSession-prefix.pch
  37. 0 12
      创维盒子/Pods/Target Support Files/YCDownloadSession/YCDownloadSession.debug.xcconfig
  38. 0 12
      创维盒子/Pods/Target Support Files/YCDownloadSession/YCDownloadSession.release.xcconfig
  39. 0 21
      创维盒子/Pods/YCDownloadSession/LICENSE
  40. 0 214
      创维盒子/Pods/YCDownloadSession/README.md
  41. 0 49
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadDB.h
  42. 0 626
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadDB.m
  43. 0 31
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadSession.h
  44. 0 82
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadTask.h
  45. 0 343
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadTask.m
  46. 0 46
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadUtils.h
  47. 0 85
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadUtils.m
  48. 0 123
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloader.h
  49. 0 495
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloader.m
  50. 0 61
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/YCDownloadItem.h
  51. 0 255
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/YCDownloadItem.m
  52. 0 164
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/YCDownloadManager.h
  53. 0 420
      创维盒子/Pods/YCDownloadSession/YCDownloadSession/YCDownloadManager.m
  54. 3 2
      创维盒子/双子星云手机/AppDelegate/SceneDelegate.m
  55. 1 1
      创维盒子/双子星云手机/Class/Set/ChangeDevice/QRCodeScanForChangeDeviceViewController.m
  56. 1 1
      创维盒子/双子星云手机/Class/Set/uploadFile/mixDownloadManager/mixDownloadQueue.m
  57. 1 4
      创维盒子/双子星云手机/Class/Set/uploadFile/receiveView/boxDownloadFileRecordCell.h
  58. 0 7
      创维盒子/双子星云手机/Class/Set/uploadFile/receiveView/boxDownloadFileRecordCell.m
  59. 6 106
      创维盒子/双子星云手机/Class/Set/uploadFile/receiveView/receiveDownloadRecordTableView.m
  60. 2 4
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/boxDownloadFileManager.h
  61. 61 130
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/boxDownloadFileManager.m
  62. 0 1
      创维盒子/双子星云手机/CloudPlayer/PlayerViewController.h

+ 1 - 1
创维盒子/Podfile

@@ -30,7 +30,7 @@ def all_Pods
   pod 'WechatOpenSDK'
 
   pod 'SDCycleScrollView','>= 1.82'
-  pod 'YCDownloadSession'
+  #pod 'YCDownloadSession'
 end
 
 target '隐私保护' do

+ 1 - 10
创维盒子/Podfile.lock

@@ -51,12 +51,6 @@ PODS:
   - SVProgressHUD (2.2.5)
   - TZImagePickerController (3.6.7)
   - WechatOpenSDK (2.0.4)
-  - YCDownloadSession (2.0.3):
-    - YCDownloadSession/Core (= 2.0.3)
-    - YCDownloadSession/Mgr (= 2.0.3)
-  - YCDownloadSession/Core (2.0.3)
-  - YCDownloadSession/Mgr (2.0.3):
-    - YCDownloadSession/Core
 
 DEPENDENCIES:
   - AFNetworking
@@ -74,7 +68,6 @@ DEPENDENCIES:
   - SDCycleScrollView (>= 1.82)
   - TZImagePickerController
   - WechatOpenSDK
-  - YCDownloadSession
 
 SPEC REPOS:
   trunk:
@@ -94,7 +87,6 @@ SPEC REPOS:
     - SVProgressHUD
     - TZImagePickerController
     - WechatOpenSDK
-    - YCDownloadSession
 
 EXTERNAL SOURCES:
   RayProxy:
@@ -118,8 +110,7 @@ SPEC CHECKSUMS:
   SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
   TZImagePickerController: 679ae9fa11e189a9a81291ae96f0a4463be8edc1
   WechatOpenSDK: 290989072e87b79d52225a01bb4e5e58f6f88593
-  YCDownloadSession: a95e2449c6d01af8ba0d5977ce79a9f596f4245d
 
-PODFILE CHECKSUM: 40eefe9c28218c56e2841a152219087225f08167
+PODFILE CHECKSUM: f1f28522ad1d586855c419eeea66eaa2ff43652d
 
 COCOAPODS: 1.11.3

+ 0 - 1
创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloadDB.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/Core/YCDownloadDB.h

+ 0 - 1
创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloadItem.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/YCDownloadItem.h

+ 0 - 1
创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloadManager.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/YCDownloadManager.h

+ 0 - 1
创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloadSession.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/Core/YCDownloadSession.h

+ 0 - 1
创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloadTask.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/Core/YCDownloadTask.h

+ 0 - 1
创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloadUtils.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/Core/YCDownloadUtils.h

+ 0 - 1
创维盒子/Pods/Headers/Private/YCDownloadSession/YCDownloader.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/Core/YCDownloader.h

+ 0 - 1
创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloadDB.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/Core/YCDownloadDB.h

+ 0 - 1
创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloadItem.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/YCDownloadItem.h

+ 0 - 1
创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloadManager.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/YCDownloadManager.h

+ 0 - 1
创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloadSession.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/Core/YCDownloadSession.h

+ 0 - 1
创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloadTask.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/Core/YCDownloadTask.h

+ 0 - 1
创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloadUtils.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/Core/YCDownloadUtils.h

+ 0 - 1
创维盒子/Pods/Headers/Public/YCDownloadSession/YCDownloader.h

@@ -1 +0,0 @@
-../../../YCDownloadSession/YCDownloadSession/Core/YCDownloader.h

+ 1 - 10
创维盒子/Pods/Manifest.lock

@@ -51,12 +51,6 @@ PODS:
   - SVProgressHUD (2.2.5)
   - TZImagePickerController (3.6.7)
   - WechatOpenSDK (2.0.4)
-  - YCDownloadSession (2.0.3):
-    - YCDownloadSession/Core (= 2.0.3)
-    - YCDownloadSession/Mgr (= 2.0.3)
-  - YCDownloadSession/Core (2.0.3)
-  - YCDownloadSession/Mgr (2.0.3):
-    - YCDownloadSession/Core
 
 DEPENDENCIES:
   - AFNetworking
@@ -74,7 +68,6 @@ DEPENDENCIES:
   - SDCycleScrollView (>= 1.82)
   - TZImagePickerController
   - WechatOpenSDK
-  - YCDownloadSession
 
 SPEC REPOS:
   trunk:
@@ -94,7 +87,6 @@ SPEC REPOS:
     - SVProgressHUD
     - TZImagePickerController
     - WechatOpenSDK
-    - YCDownloadSession
 
 EXTERNAL SOURCES:
   RayProxy:
@@ -118,8 +110,7 @@ SPEC CHECKSUMS:
   SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
   TZImagePickerController: 679ae9fa11e189a9a81291ae96f0a4463be8edc1
   WechatOpenSDK: 290989072e87b79d52225a01bb4e5e58f6f88593
-  YCDownloadSession: a95e2449c6d01af8ba0d5977ce79a9f596f4245d
 
-PODFILE CHECKSUM: 40eefe9c28218c56e2841a152219087225f08167
+PODFILE CHECKSUM: f1f28522ad1d586855c419eeea66eaa2ff43652d
 
 COCOAPODS: 1.11.3

文件差異過大導致無法顯示
+ 2609 - 2842
创维盒子/Pods/Pods.xcodeproj/project.pbxproj


+ 0 - 58
创维盒子/Pods/Pods.xcodeproj/xcuserdata/xdh.xcuserdatad/xcschemes/YCDownloadSession.xcscheme

@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Scheme
-   LastUpgradeVersion = "1240"
-   version = "1.3">
-   <BuildAction
-      parallelizeBuildables = "YES"
-      buildImplicitDependencies = "YES">
-      <BuildActionEntries>
-         <BuildActionEntry
-            buildForTesting = "YES"
-            buildForRunning = "YES"
-            buildForProfiling = "YES"
-            buildForArchiving = "YES"
-            buildForAnalyzing = "YES">
-            <BuildableReference
-               BuildableIdentifier = "primary"
-               BlueprintIdentifier = "2F3F6D93C031BBC98CE5D8CD29C3DAD0"
-               BuildableName = "libYCDownloadSession.a"
-               BlueprintName = "YCDownloadSession"
-               ReferencedContainer = "container:Pods.xcodeproj">
-            </BuildableReference>
-         </BuildActionEntry>
-      </BuildActionEntries>
-   </BuildAction>
-   <TestAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      shouldUseLaunchSchemeArgsEnv = "YES">
-      <Testables>
-      </Testables>
-   </TestAction>
-   <LaunchAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      launchStyle = "0"
-      useCustomWorkingDirectory = "NO"
-      ignoresPersistentStateOnLaunch = "NO"
-      debugDocumentVersioning = "YES"
-      debugServiceExtension = "internal"
-      allowLocationSimulation = "YES">
-   </LaunchAction>
-   <ProfileAction
-      buildConfiguration = "Release"
-      shouldUseLaunchSchemeArgsEnv = "YES"
-      savedToolIdentifier = ""
-      useCustomWorkingDirectory = "NO"
-      debugDocumentVersioning = "YES">
-   </ProfileAction>
-   <AnalyzeAction
-      buildConfiguration = "Debug">
-   </AnalyzeAction>
-   <ArchiveAction
-      buildConfiguration = "Release"
-      revealArchiveInOrganizer = "YES">
-   </ArchiveAction>
-</Scheme>

+ 0 - 5
创维盒子/Pods/Pods.xcodeproj/xcuserdata/xdh.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -104,11 +104,6 @@
 			<key>isShown</key>
 			<false/>
 		</dict>
-		<key>YCDownloadSession.xcscheme</key>
-		<dict>
-			<key>isShown</key>
-			<false/>
-		</dict>
 		<key>lottie-ios-OC.xcscheme</key>
 		<dict>
 			<key>isShown</key>

文件差異過大導致無法顯示
+ 1 - 1
创维盒子/Pods/Target Support Files/Pods-双子星云手机Tests/Pods-双子星云手机Tests.debug.xcconfig


文件差異過大導致無法顯示
+ 1 - 1
创维盒子/Pods/Target Support Files/Pods-双子星云手机Tests/Pods-双子星云手机Tests.release.xcconfig


+ 0 - 25
创维盒子/Pods/Target Support Files/Pods-计算器/Pods-计算器-acknowledgements.markdown

@@ -313,31 +313,6 @@ SOFTWARE.
 Copyright 2020 tencent.com. All rights reserved.
 
 
-## YCDownloadSession
-
-MIT License
-
-Copyright (c) 2017 WangZhen
-
-Permission 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:
-
-The 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.
-
-
 ## lottie-ios-OC
 
                                  Apache License

+ 0 - 31
创维盒子/Pods/Target Support Files/Pods-计算器/Pods-计算器-acknowledgements.plist

@@ -416,37 +416,6 @@ SOFTWARE.
 		</dict>
 		<dict>
 			<key>FooterText</key>
-			<string>MIT License
-
-Copyright (c) 2017 WangZhen
-
-Permission 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:
-
-The 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.
-</string>
-			<key>License</key>
-			<string>MIT</string>
-			<key>Title</key>
-			<string>YCDownloadSession</string>
-			<key>Type</key>
-			<string>PSGroupSpecifier</string>
-		</dict>
-		<dict>
-			<key>FooterText</key>
 			<string>                                 Apache License
                            Version 2.0, January 2004
                         http://www.apache.org/licenses/

文件差異過大導致無法顯示
+ 3 - 3
创维盒子/Pods/Target Support Files/Pods-计算器/Pods-计算器.debug.xcconfig


文件差異過大導致無法顯示
+ 3 - 3
创维盒子/Pods/Target Support Files/Pods-计算器/Pods-计算器.release.xcconfig


+ 0 - 25
创维盒子/Pods/Target Support Files/Pods-隐私保护-双子星云手机UITests/Pods-隐私保护-双子星云手机UITests-acknowledgements.markdown

@@ -313,31 +313,6 @@ SOFTWARE.
 Copyright 2020 tencent.com. All rights reserved.
 
 
-## YCDownloadSession
-
-MIT License
-
-Copyright (c) 2017 WangZhen
-
-Permission 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:
-
-The 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.
-
-
 ## lottie-ios-OC
 
                                  Apache License

+ 0 - 31
创维盒子/Pods/Target Support Files/Pods-隐私保护-双子星云手机UITests/Pods-隐私保护-双子星云手机UITests-acknowledgements.plist

@@ -416,37 +416,6 @@ SOFTWARE.
 		</dict>
 		<dict>
 			<key>FooterText</key>
-			<string>MIT License
-
-Copyright (c) 2017 WangZhen
-
-Permission 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:
-
-The 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.
-</string>
-			<key>License</key>
-			<string>MIT</string>
-			<key>Title</key>
-			<string>YCDownloadSession</string>
-			<key>Type</key>
-			<string>PSGroupSpecifier</string>
-		</dict>
-		<dict>
-			<key>FooterText</key>
 			<string>                                 Apache License
                            Version 2.0, January 2004
                         http://www.apache.org/licenses/

文件差異過大導致無法顯示
+ 3 - 3
创维盒子/Pods/Target Support Files/Pods-隐私保护-双子星云手机UITests/Pods-隐私保护-双子星云手机UITests.debug.xcconfig


文件差異過大導致無法顯示
+ 3 - 3
创维盒子/Pods/Target Support Files/Pods-隐私保护-双子星云手机UITests/Pods-隐私保护-双子星云手机UITests.release.xcconfig


+ 0 - 25
创维盒子/Pods/Target Support Files/Pods-隐私保护/Pods-隐私保护-acknowledgements.markdown

@@ -313,31 +313,6 @@ SOFTWARE.
 Copyright 2020 tencent.com. All rights reserved.
 
 
-## YCDownloadSession
-
-MIT License
-
-Copyright (c) 2017 WangZhen
-
-Permission 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:
-
-The 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.
-
-
 ## lottie-ios-OC
 
                                  Apache License

+ 0 - 31
创维盒子/Pods/Target Support Files/Pods-隐私保护/Pods-隐私保护-acknowledgements.plist

@@ -416,37 +416,6 @@ SOFTWARE.
 		</dict>
 		<dict>
 			<key>FooterText</key>
-			<string>MIT License
-
-Copyright (c) 2017 WangZhen
-
-Permission 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:
-
-The 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.
-</string>
-			<key>License</key>
-			<string>MIT</string>
-			<key>Title</key>
-			<string>YCDownloadSession</string>
-			<key>Type</key>
-			<string>PSGroupSpecifier</string>
-		</dict>
-		<dict>
-			<key>FooterText</key>
 			<string>                                 Apache License
                            Version 2.0, January 2004
                         http://www.apache.org/licenses/

文件差異過大導致無法顯示
+ 3 - 3
创维盒子/Pods/Target Support Files/Pods-隐私保护/Pods-隐私保护.debug.xcconfig


文件差異過大導致無法顯示
+ 3 - 3
创维盒子/Pods/Target Support Files/Pods-隐私保护/Pods-隐私保护.release.xcconfig


+ 0 - 5
创维盒子/Pods/Target Support Files/YCDownloadSession/YCDownloadSession-dummy.m

@@ -1,5 +0,0 @@
-#import <Foundation/Foundation.h>
-@interface PodsDummy_YCDownloadSession : NSObject
-@end
-@implementation PodsDummy_YCDownloadSession
-@end

+ 0 - 12
创维盒子/Pods/Target Support Files/YCDownloadSession/YCDownloadSession-prefix.pch

@@ -1,12 +0,0 @@
-#ifdef __OBJC__
-#import <UIKit/UIKit.h>
-#else
-#ifndef FOUNDATION_EXPORT
-#if defined(__cplusplus)
-#define FOUNDATION_EXPORT extern "C"
-#else
-#define FOUNDATION_EXPORT extern
-#endif
-#endif
-#endif
-

+ 0 - 12
创维盒子/Pods/Target Support Files/YCDownloadSession/YCDownloadSession.debug.xcconfig

@@ -1,12 +0,0 @@
-CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
-CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YCDownloadSession
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YCDownloadSession" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/YCDownloadSession"
-PODS_BUILD_DIR = ${BUILD_DIR}
-PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
-PODS_ROOT = ${SRCROOT}
-PODS_TARGET_SRCROOT = ${PODS_ROOT}/YCDownloadSession
-PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
-PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
-SKIP_INSTALL = YES
-USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

+ 0 - 12
创维盒子/Pods/Target Support Files/YCDownloadSession/YCDownloadSession.release.xcconfig

@@ -1,12 +0,0 @@
-CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
-CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YCDownloadSession
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YCDownloadSession" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/YCDownloadSession"
-PODS_BUILD_DIR = ${BUILD_DIR}
-PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
-PODS_ROOT = ${SRCROOT}
-PODS_TARGET_SRCROOT = ${PODS_ROOT}/YCDownloadSession
-PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
-PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
-SKIP_INSTALL = YES
-USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

+ 0 - 21
创维盒子/Pods/YCDownloadSession/LICENSE

@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2017 WangZhen
-
-Permission 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:
-
-The 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.

+ 0 - 214
创维盒子/Pods/YCDownloadSession/README.md

@@ -1,214 +0,0 @@
-# [YCDownloadSession](https://onezens.github.io/YCDownloadSession/)
-
-[![Platform](https://img.shields.io/badge/platform-iOS-yellowgreen.svg)](https://github.com/onezens/YCDownloadSession)
-[![Support](https://img.shields.io/badge/support-iOS%208%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)
-[![CocoaPods](http://img.shields.io/cocoapods/v/YCDownloadSession.svg?style=flat)](https://cocoapods.org/pods/YCDownloadSession)
-[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
-[![Build Status](https://travis-ci.com/onezens/YCDownloadSession.svg?branch=master)](https://travis-ci.com/onezens/YCDownloadSession)
-[![996.icu](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu)
-[![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE)
-
-
-
-## 通过Cocoapods安装
-
-安装Cocoapods
-
-```
-$ brew install ruby
-$ sudo gem install cocoapods
-```
-
-**Podfile**
-
-分成主要两个包:
-
-- `Core` : YCDownloader 只有下载器
-- `Mgr`  : YCDownloader , YCDownloadManager 所有
-
-```
-source 'https://github.com/CocoaPods/Specs.git'
-platform :ios, '8.0'
-
-target 'TargetName' do
-    pod 'YCDownloadSession', '~> 2.0.2', :subspecs => ['Core', 'Mgr']
-end
-```
-
-然后安装依赖库:
-
-```
-$ pod install
-```
-
-提示错误 `[!] Unable to find a specification for YCDownloadSession ` 解决办法:
-
-```
-$ pod repo update master
-```
-## 通过Carthage安装
-安装carthage:
-
-```
-brew install carthage
-```
-添加下面配置到`Cartfile`里:
-
-```
-github "onezens/YCDownloadSession"
-```
-安装, 然后添加Framework到项目:
-
-```
-carthage update --platform ios
-```
-
-## 用法
-
-**引用头文件**
-
-```
-#import <YCDownloadSession.h>
-```
-
-
-**AppDelegate设置后台下载成功回调方法**
-
-```
--(void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler{
-    [[YCDownloader downloader] addCompletionHandler:completionHandler identifier:identifier];
-}
-```
-
-### 下载器 `YCDownloader`
-
-创建下载任务
-
-```
-YCDownloadTask *task = [[YCDownloader downloader] downloadWithUrl:@"download_url" progress:^(NSProgress * _Nonnull progress, YCDownloadTask * _Nonnull task) {
-    NSLog(@"progress: %f", progress.fractionCompleted); 
-} completion:^(NSString * _Nullable localPath, NSError * _Nullable error) {
-    // handler download task completed callback
-}];
-```
-
-开始下载任务:
-
-```
-[[YCDownloader downloader] resumeTask:self.downloadTask];
-```
-
-暂停下载任务:
-
-```
-[[YCDownloader downloader] pauseTask:self.downloadTask];
-```
-
-删除下载任务:
-
-```
-[[YCDownloader downloader] cancelTask:self.downloadTask];
-```
-
-异常退出应用后,恢复之前正在进行的任务的回调
-
-```
-/**
- 恢复下载任务,继续下载任务,主要用于app异常退出状态恢复,继续下载任务的回调设置
-
- @param tid 下载任务的taskId
- @param progress 下载进度回调
- @param completion 下载成功失败回调
- @return 下载任务task
- */
-- (nullable YCDownloadTask *)resumeDownloadTaskWithTid:(NSString *)tid progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion;
-```
-
-### 下载任务管理器`YCDownloadManager`
-
-设置任务管理器配置
-
-```
-NSString *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true).firstObject;
-path = [path stringByAppendingPathComponent:@"download"];
-YCDConfig *config = [YCDConfig new];
-config.saveRootPath = path;
-config.uid = @"100006";
-config.maxTaskCount = 3;
-config.taskCachekMode = YCDownloadTaskCacheModeKeep;
-config.launchAutoResumeDownload = true;
-[YCDownloadManager mgrWithConfig:config];
-```
-
-下载任务相关通知
-
-```
-//某一个YCDownloadItem下载成功通知
-[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(downloadTaskFinishedNoti:) name:kDownloadTaskFinishedNoti object:nil];
-//mgr 管理的所有任务完成通知
-[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(downloadAllTaskFinished) name:kDownloadTaskAllFinishedNoti object:nil];
-```
-
-开始下载任务
-
-```
-YCDownloadItem *item = [YCDownloadItem itemWithUrl:model.mp4_url fileId:model.file_id];
-item.extraData = ...;
-[YCDownloadManager startDownloadWithItem:item];
-```
-下载相关控制
-
-```
-/**
-暂停一个后台下载任务
-     
-@param item 创建的下载任务item
-*/
-+ (void)pauseDownloadWithItem:(nonnull YCDownloadItem *)item;
-    
-/**
-继续开始一个后台下载任务
-     
-@param item 创建的下载任务item
-*/
-+ (void)resumeDownloadWithItem:(nonnull YCDownloadItem *)item;
-    
-/**
-删除一个后台下载任务,同时会删除当前任务下载的缓存数据
-     
-@param item 创建的下载任务item
-*/
-+ (void)stopDownloadWithItem:(nonnull YCDownloadItem *)item;
-```
-蜂窝煤网络访问控制
-
-```
-/**
-是否允许蜂窝煤网络下载,以及网络状态变为蜂窝煤是否允许下载,必须把所有的downloadTask全部暂停,然后重新创建。否则,原先创建的
-下载task依旧在网络切换为蜂窝煤网络时会继续下载
-     
-@param isAllow 是否允许蜂窝煤网络下载
-*/
-+ (void)allowsCellularAccess:(BOOL)isAllow;
-    
-/**
-获取是否允许蜂窝煤访问
-*/
-+ (BOOL)isAllowsCellularAccess;
-```
-
-## 使用效果图
-
-单文件下载测试
-
-![单文件下载测试](http://src.onezen.cc/demo/download/1.gif)
-
-多视频下载测试
-
-![多视频下载测试](http://src.onezen.cc/demo/download/2.gif)
-  
-下载通知
-
-![下载通知](http://src.onezen.cc/demo/download/4.png)
-
-

+ 0 - 49
创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadDB.h

@@ -1,49 +0,0 @@
-//
-//  YCDownloadDB.h
-//  YCDownloadSession
-//
-//  Created by wz on 2019/4/3.
-//  Copyright © 2019 onezen.cc. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "YCDownloadTask.h"
-
-#ifndef YCDownload_Mgr_Item
-#if __has_include(<YCDownloadItem.h>)
-#define YCDownload_Mgr_Item 1
-#import <YCDownloadItem.h>
-#elif __has_include("YCDownloadItem.h")
-#define YCDownload_Mgr_Item 1
-#import "YCDownloadItem.h"
-#else
-#define YCDownload_Mgr_Item 0
-#endif
-#endif
-
-@interface YCDownloadDB : NSObject
-
-+ (NSArray <YCDownloadTask *> *)fetchAllDownloadTasks;
-+ (YCDownloadTask *)taskWithTid:(NSString *)tid;
-+ (NSArray <YCDownloadTask *> *)taskWithUrl:(NSString *)url;
-+ (NSArray <YCDownloadTask *> *)taskWithStid:(NSInteger)stid; //TODO: add url
-+ (void)removeAllTasks;
-+ (BOOL)removeTask:(YCDownloadTask *)task;
-+ (BOOL)saveTask:(YCDownloadTask *)task;
-+ (void)saveAllData;
-
-@end
-
-#if YCDownload_Mgr_Item
-@interface YCDownloadDB(item)
-+ (NSArray <YCDownloadItem *> *)fetchAllDownloadItemWithUid:(NSString *)uid;
-+ (NSArray <YCDownloadItem *> *)fetchAllDownloadedItemWithUid:(NSString *)uid;
-+ (NSArray <YCDownloadItem *> *)fetchAllDownloadingItemWithUid:(NSString *)uid;
-+ (NSArray <YCDownloadItem *> *)itemsWithUrl:(NSString *)downloadUrl uid:(NSString *)uid;
-+ (YCDownloadItem *)itemWithTaskId:(NSString *)taskId;
-+ (YCDownloadItem *)itemWithFid:(NSString *)fid uid:(NSString *)uid;
-+ (void)removeAllItemsWithUid:(NSString *)uid;
-+ (BOOL)removeItemWithTaskId:(NSString *)taskId;
-+ (BOOL)saveItem:(YCDownloadItem *)item;
-@end
-#endif

+ 0 - 626
创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadDB.m

@@ -1,626 +0,0 @@
-//
-//  YCDownloadDB.m
-//  YCDownloadSession
-//
-//  Created by wz on 2019/4/3.
-//  Copyright © 2019 onezen.cc. All rights reserved.
-//
-
-#import "YCDownloadDB.h"
-#import "YCDownloadUtils.h"
-#import <sqlite3.h>
-
-#define kYCDownloadVersionKey @"YCDownloadVersionKey"
-#define kYCDownloadDbMinUpgradeVerion @"2.0.2" //数据库的表和字段更新需要改变版本号
-
-#if YCDownload_Mgr_Item
-@interface YCDownloadItem(YCDownloadDB)
-@property (nonatomic, assign) NSInteger pid;
-@property (nonatomic, copy) NSString *fileExtension;
-@property (nonatomic, copy) NSString *rootPath;
-@property (nonatomic, assign, readonly) NSUInteger createTime;
-+ (instancetype)itemWithDict:(NSDictionary *)dict;
-
-@end
-#endif
-
-@interface YCDownloadTask(YCDownloadDB)
-@property (nonatomic, assign) NSInteger pid;
-@property (nonatomic, assign, readonly) NSUInteger createTime;
-+ (instancetype)taskWithDict:(NSDictionary *)dict;
-@end
-
-typedef NS_ENUM(NSUInteger, YCDownloadDBValueType) {
-    YCDownloadDBValueTypeNull,
-    YCDownloadDBValueTypeString,
-    YCDownloadDBValueTypeNumber,
-    YCDownloadDBValueTypeData
-};
-
-@implementation YCDownloadDB
-
-static sqlite3 *_db;
-static dispatch_queue_t _dbQueue;
-//tasks
-static const char* allTaskKeys[] = {"taskId", "downloadURL", "stid", "priority", "fileSize", "downloadedSize", "version", "tmpName", "resumeData", "extraData", "createTime"};
-static NSMutableDictionary <NSString* ,YCDownloadTask *> *_memCacheTasks;
-
-#if YCDownload_Mgr_Item
-//items
-static const char* allItemKeys[] = {"fileId", "taskId", "downloadURL", "uid", "fileType", "fileExtension", "rootPath", "fileSize", "downloadedSize", "downloadStatus", "extraData", "version", "createTime", "enableSpeed"};
-static NSMutableDictionary <NSString* ,YCDownloadItem *> *_memCacheItems;
-#endif
-
-#pragma mark - init db
-+ (void)initialize {
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        [self initDatabase];
-    });
-}
-
-#pragma makr - db Handler
-+ (void)initDatabase{
-    _dbQueue = dispatch_queue_create("YCDownloadDB_Queue", DISPATCH_QUEUE_SERIAL);
-    NSString *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true).firstObject;
-    path = [path stringByAppendingPathComponent:@"YCDownload"];
-    [YCDownloadUtils createPathIfNotExist:path];
-    path = [path stringByAppendingPathComponent:@"YCDownload.db"];
-    if (sqlite3_open(path.UTF8String, &_db) != SQLITE_OK) {
-        NSLog(@"[db error]");
-        return;
-    }
-    NSString *sql = @"CREATE TABLE IF NOT EXISTS downloadItem (pid integer PRIMARY KEY AUTOINCREMENT,taskId text not null unique,fileId text, downloadURL text,uid text,fileType text,fileExtension text,rootPath text,fileSize integer,downloadedSize integer,downloadStatus integer,extraData BLOB, version text not null, createTime integer); \n"
-    "CREATE TABLE IF NOT EXISTS downloadTask (pid integer PRIMARY KEY AUTOINCREMENT,taskId text not null unique, downloadURL text, stid integer, priority float, enableSpeed integer, fileSize INTEGER, downloadedSize INTEGER, version text not null, tmpName text, resumeData BLOB, extraData BLOB, createTime integer);";
-    
-    [self performBlock:^BOOL{ return [self execSql:sql]; } sync:true] ? NSLog(@"[init db success]") : false;
-    [self compatibleDatabase];
-    _memCacheTasks = [NSMutableDictionary dictionary];
-#if YCDownload_Mgr_Item
-    _memCacheItems = [NSMutableDictionary dictionary];
-#endif
-}
-
-//数据库表字段变更
-+ (void)compatibleDatabase {
-    NSString *localVersion = [[NSUserDefaults standardUserDefaults] valueForKey:kYCDownloadVersionKey];
-    NSString *curVersion = [YCDownloadTask downloaderVerison];
-    if ([curVersion compare:localVersion options:NSNumericSearch] == NSOrderedDescending){
-        [[NSUserDefaults standardUserDefaults] setValue:curVersion forKey:kYCDownloadVersionKey];
-        if ([kYCDownloadDbMinUpgradeVerion compare:localVersion options:NSNumericSearch] == NSOrderedDescending) {
-            NSString *sql = @"ALTER table downloadItem add enableSpeed integer;";
-            [self performBlock:^BOOL{ return [self execSql:sql]; } sync:true] ? NSLog(@"[compatible db success]") : false;
-        }
-    }
-}
-
-+ (BOOL)performBlock:(BOOL (^)(void))block sync:(BOOL)sync {
-    __block BOOL result = false;
-    if (sync) {
-        dispatch_sync(_dbQueue, ^{
-            result = block();
-        });
-    }else{
-        dispatch_async(_dbQueue, ^{
-            block();
-        });
-        result = true;
-    }
-    return result;
-}
-
-+ (BOOL)execSql:(NSString *)sql {
-    char *error = NULL;
-    sqlite3_exec(_db, sql.UTF8String, NULL, NULL, &error);
-    error ? NSLog(@"[execSql error] %s", error) : false;
-    return error == NULL;
-}
-//while (sqlite3_step(stmt) == SQLITE_ROW) {}
-+ (void)selectSql:(NSString *)sql results:(void (^)(sqlite3_stmt *stmt))results {
-    sqlite3_stmt *stmt;
-    if (sqlite3_prepare_v2(_db, sql.UTF8String, -1, &stmt, NULL) == SQLITE_OK) {
-        results(stmt);
-    }
-}
-
-+ (id)objectWithStmt:(sqlite3_stmt *)stmt idx:(int)idx {
-    int type = sqlite3_column_type(stmt, idx);
-    id ocObj = nil;
-    switch (type) {
-        case SQLITE_INTEGER:
-            ocObj = [NSNumber numberWithLongLong:sqlite3_column_int64(stmt, idx)];
-            break;
-        case SQLITE_FLOAT:
-            ocObj = [NSNumber numberWithDouble:sqlite3_column_double(stmt, idx)];
-            break;
-        case SQLITE_BLOB:
-        {
-            const char *dataBuffer = sqlite3_column_blob(stmt, idx);
-            int dataSize = sqlite3_column_bytes(stmt, idx);
-            ocObj = [NSData dataWithBytes:dataBuffer length:dataSize];
-        }
-            break;
-        case SQLITE_NULL:
-            break;
-        default:
-        {
-            const char *value = (const char *)sqlite3_column_text(stmt, idx);
-            ocObj = [[NSString alloc] initWithUTF8String:value];
-        }
-            break;
-    }
-    return ocObj;
-}
-
-+ (NSArray *)selectSql:(NSString *)sql {
-    NSMutableArray *arrM;
-    sqlite3_stmt *stmt;
-    if (sqlite3_prepare_v2(_db, sql.UTF8String, -1, &stmt, NULL) == SQLITE_OK) {
-        arrM = [NSMutableArray array];
-        while (sqlite3_step(stmt) == SQLITE_ROW) {
-            NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
-            int count = sqlite3_column_count(stmt);
-            for (int i=0; i<count; i++) {
-                const char *key = sqlite3_column_name(stmt, i);
-                id ocObj = [self objectWithStmt:stmt idx:i];
-                [dictM setValue:ocObj forKey:[[NSString alloc] initWithUTF8String:key]];
-            }
-            [arrM addObject:dictM];
-        }
-    }
-    return arrM;
-}
-
-+ (YCDownloadDBValueType)getTypeWithValue:(id)value {
-    YCDownloadDBValueType type = YCDownloadDBValueTypeNull;
-    if ([value isKindOfClass:[NSString class]]) {
-        type = YCDownloadDBValueTypeString;
-    }else if ([value isKindOfClass:[NSNumber class]]){
-        type = YCDownloadDBValueTypeNumber;
-    }else if ([value isKindOfClass:[NSData class]]){
-        type = YCDownloadDBValueTypeData;
-    }
-    return type;
-}
-
-+ (void)execTransactionSql:(NSArray *)sqls{
-    @try{
-        char *error;
-        if (sqlite3_exec(_db, "BEGIN", NULL, NULL, &error)==SQLITE_OK) {
-            NSLog(@"启动事务成功");
-            sqlite3_free(error);
-            sqlite3_stmt *statement;
-            for (int i = 0; i<sqls.count; i++) {
-                if (sqlite3_prepare_v2(_db,[[sqls objectAtIndex:i] UTF8String], -1, &statement,NULL)==SQLITE_OK) {
-                    if (sqlite3_step(statement)!=SQLITE_DONE) sqlite3_finalize(statement);
-                }
-            }
-            if (sqlite3_exec(_db, "COMMIT", NULL, NULL, &error)==SQLITE_OK)   NSLog(@"提交事务成功");
-            sqlite3_free(error);
-        }
-        else sqlite3_free(error);
-    } @catch(NSException *e) {
-        char *error;
-        if (sqlite3_exec(_db, "ROLLBACK", NULL, NULL, &error)==SQLITE_OK)  NSLog(@"回滚事务成功");
-        sqlite3_free(error);
-    }
-}
-
-+ (void)getSqlWithKeys:(const char **)keys count:(int)count  obj:(id)obj oldItem:(NSDictionary *)oldItem enumerateBlock:(void (^)(YCDownloadDBValueType type, NSString *key, id value,  int idx))enumerateBlock{
-    for (int i=0; i<count; i++) {
-        YCDownloadDBValueType type = YCDownloadDBValueTypeNull;
-        NSString *key = [NSString stringWithUTF8String:keys[i]];
-        id value = [obj valueForKey:[NSString stringWithFormat:@"_%@", key]];
-        BOOL isEqual = false;
-        id oValue = [oldItem valueForKey:key];
-        if ([value isKindOfClass:[NSString class]]) {
-            isEqual = oValue && [value isEqualToString:oValue];
-            type = YCDownloadDBValueTypeString;
-        }else if ([value isKindOfClass:[NSNumber class]]){
-            isEqual = (oValue && [value isEqualToNumber:oValue]) || (oValue==nil && [value isEqualToNumber:@0]);
-            type = YCDownloadDBValueTypeNumber;
-        }else if ([value isKindOfClass:[NSData class]]){
-            isEqual = oValue && [value isEqualToData:oValue];
-            type = YCDownloadDBValueTypeData;
-        }else if(value != oValue){
-            isEqual = false;
-        }else{
-            NSAssert(value==nil && oValue==nil, @"cls err");
-            isEqual = true;
-        }
-        if (!isEqual) {
-            enumerateBlock(value ? type : [self getTypeWithValue:oValue], key, value, i);
-        }
-    }
-}
-
-#pragma mark - Handler
-
-+ (void)saveAllData {
-    [self performBlock:^BOOL{
-        //fixme: transaction
-        [_memCacheTasks enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, YCDownloadTask * _Nonnull obj, BOOL * _Nonnull stop) {
-            [self saveDownloadTask:obj];
-        }];
-#if YCDownload_Mgr_Item
-        [_memCacheItems enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, YCDownloadItem * _Nonnull obj, BOOL * _Nonnull stop) {
-            [self saveDownloadItem:obj];
-        }];
-#endif
-        return true;
-    } sync:false];
-}
-
-
-#pragma mark - item
-#if YCDownload_Mgr_Item
-+ (YCDownloadItem *)itemWithDict:(NSDictionary *)dict {
-    if(!dict) return nil;
-    NSString *taskId = [dict valueForKey:@"taskId"];
-    NSAssert(taskId, @"taskId can not nil!");
-    if(!taskId) return nil;
-    YCDownloadItem *item = _memCacheItems[taskId];
-    if (item && ![item.taskId isEqualToString:taskId]){
-        _memCacheItems[taskId] = nil;
-        return nil;
-    }
-    if (!item) {
-        item = [YCDownloadItem itemWithDict:dict];
-        _memCacheItems[taskId] = item;
-    }
-    
-    return item;
-}
-
-+ (NSArray <YCDownloadItem *> *)fetchAllDownloadItemWithUid:(NSString *)uid {
-    __block NSMutableArray *results = [NSMutableArray array];
-    [self performBlock:^BOOL{
-        NSString *sql = [NSString stringWithFormat:@"select * from downloadItem where uid == '%@' ORDER BY createTime",uid];
-        NSArray *rel = [self selectSql:sql];
-        [rel enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-            YCDownloadItem *item = [self itemWithDict:obj];
-            if(item) [results addObject:item];
-        }];
-        return true;
-    } sync:true];
-    return results;
-}
-
-+ (NSArray <YCDownloadItem *> *)fetchAllDownloadedItemWithUid:(NSString *)uid {
-    __block NSMutableArray *results = [NSMutableArray array];
-    [self performBlock:^BOOL{
-        NSString *sql = [NSString stringWithFormat:@"select * from downloadItem where downloadStatus == %lu and uid == '%@' ORDER BY createTime", (unsigned long)YCDownloadStatusFinished, uid];
-        NSArray *rel = [self selectSql:sql];
-        [rel enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-            YCDownloadItem *item = [self itemWithDict:obj];
-            if(item) [results addObject:item];
-        }];
-        return true;
-    } sync:true];
-    return results;
-}
-
-+ (NSArray <YCDownloadItem *> *)fetchAllDownloadingItemWithUid:(NSString *)uid {
-    __block NSMutableArray *results = [NSMutableArray array];
-    [self performBlock:^BOOL{
-        NSString *sql = [NSString stringWithFormat:@"select * from downloadItem where downloadStatus != %lu and uid == '%@' ORDER BY createTime",(unsigned long)YCDownloadStatusFinished, uid];
-        NSArray *rel = [self selectSql:sql];
-        [rel enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-            YCDownloadItem *item = [self itemWithDict:obj];
-            if(item) [results addObject:item];
-        }];
-        return true;
-    } sync:true];
-    return results;
-}
-
-+ (YCDownloadItem *)itemWithTaskId:(NSString *)taskId {
-    __block YCDownloadItem *item = _memCacheItems[taskId];
-    if(!item){
-        [self performBlock:^BOOL{
-            NSString *sql = [NSString stringWithFormat:@"select * from downloadItem where taskId == '%@'", taskId];
-            NSArray *rel = [self selectSql:sql];
-            item = [self itemWithDict:rel.firstObject];
-            return true;
-        } sync:true];
-    }
-    return item;
-}
-
-+ (NSArray *)itemsWithUrl:(NSString *)downloadUrl uid:(NSString *)uid{
-    NSMutableArray *items = [NSMutableArray array];
-    [self performBlock:^BOOL{
-        NSString *sql = [NSString stringWithFormat:@"select * from downloadItem where downloadURL == '%@' and uid == '%@'", downloadUrl, uid];
-        NSArray *rel = [self selectSql:sql];
-        [rel enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-            YCDownloadItem *item = [self itemWithDict:rel.firstObject];
-            if(item) [items addObject:item];
-        }];
-        
-        return true;
-    } sync:true];
-    return items;
-}
-
-+ (YCDownloadItem *)itemWithFid:(NSString *)fid uid:(NSString *)uid{
-    __block YCDownloadItem *item = nil;
-    [self performBlock:^BOOL{
-        NSString *sql = [NSString stringWithFormat:@"select * from downloadItem where fileId == '%@' and uid == '%@'", fid, uid];
-        NSArray *rel = [self selectSql:sql];
-        item = [self itemWithDict:rel.firstObject];
-        return true;
-    } sync:true];
-    return item;
-}
-
-+ (void)removeAllItemsWithUid:(NSString *)uid {
-    [self performBlock:^BOOL{
-        NSString *sql = [NSString stringWithFormat:@"delete from downloadItem where uid == '%@'",uid];
-        BOOL result = [self execSql:sql];
-        if (result)  [_memCacheItems removeAllObjects];
-        return result;
-    } sync:false];
-}
-
-+ (BOOL)removeItemWithTaskId:(NSString *)taskId {
-    if(!taskId) return true;
-    return [self performBlock:^BOOL{
-        NSString *sql = [NSString stringWithFormat:@"delete from downloadItem where taskId == '%@'", taskId];
-        BOOL result = [self execSql:sql];
-        if(result) [_memCacheItems removeObjectForKey:taskId];
-        return result;
-    } sync:true];
-}
-
-+ (BOOL)updateItemExtraData:(YCDownloadItem *)item {
-    BOOL result = false;
-    NSString *sql_data = [NSString stringWithFormat:@"update downloadItem set extraData=? where taskId == '%@'", item.taskId];
-    sqlite3_stmt *stmt = NULL;
-    if (sqlite3_prepare_v2(_db, [sql_data UTF8String], -1, &stmt, NULL) == SQLITE_OK) {
-        sqlite3_bind_blob64(stmt, 1, [item.extraData bytes], [item.extraData length], NULL);
-        if (sqlite3_step(stmt) == SQLITE_DONE) {
-            return result;
-        }
-    }
-    return result;
-}
-
-+ (BOOL)updateItem:(YCDownloadItem *)item withResults:(NSArray *)results {
-    NSMutableString *updateSql = [NSMutableString string];
-    int count = sizeof(allItemKeys) / sizeof(allItemKeys[0]);
-    [self getSqlWithKeys:allItemKeys count:count obj:item oldItem:results.firstObject enumerateBlock:^(YCDownloadDBValueType type, NSString *key, id value, int idx) {
-        if (type == YCDownloadDBValueTypeData) {
-            [self updateItemExtraData:item];
-        }else if (type == YCDownloadDBValueTypeNumber){
-            [updateSql appendFormat:@"%@%@=%@", updateSql.length !=0 ? @", " : @"", key, [value stringValue]];
-        }else if(type == YCDownloadDBValueTypeNull){
-            [updateSql appendFormat:@"%@%@=null",updateSql.length !=0 ? @", " : @"", key];
-        }else{
-            NSAssert([value isKindOfClass:[NSString class]], @"cls error");
-            [updateSql appendFormat:@"%@%@='%@'",updateSql.length !=0 ? @", " : @"",  key, value];
-        }
-    }];
-    if(updateSql.length>0){
-        NSString *sql = [NSString stringWithFormat:@"update downloadItem set %@ where taskId == '%@'", updateSql, item.taskId];
-        return [self execSql:sql];
-    }
-    return true;
-    
-}
-
-+ (BOOL)saveDownloadItem:(YCDownloadItem *)item {
-    NSString *sql = [NSString stringWithFormat:@"select * from downloadItem WHERE taskId == '%@'", item.taskId];
-    NSArray *results = [self selectSql:sql];
-    BOOL result = false;
-    if (results.count==0) {
-        _memCacheItems[item.taskId] = item;
-        NSMutableString *insertSqlKeys = [NSMutableString string];
-        NSMutableString *insertSqlValues = [NSMutableString string];
-        int count = sizeof(allItemKeys) / sizeof(allItemKeys[0]);
-        [self getSqlWithKeys:allItemKeys count:count obj:item oldItem:nil enumerateBlock:^(YCDownloadDBValueType type, NSString *key, id value, int idx) {
-            if (type == YCDownloadDBValueTypeNumber){
-                [insertSqlKeys appendFormat:@"%@%@", insertSqlKeys.length!=0 ? @", ": @"", key];
-                [insertSqlValues appendFormat:@"%@%@", insertSqlValues.length!=0 ? @", " : @"", [value stringValue]];
-            }else if(type == YCDownloadDBValueTypeString){
-                [insertSqlKeys appendFormat:@"%@%@", insertSqlKeys.length!=0 ? @", ": @"", key];
-                [insertSqlValues appendFormat:@"%@'%@'", insertSqlValues.length!=0 ? @", " : @"", value];
-            }
-        }];
-        sql = [NSString stringWithFormat:@"insert into downloadItem(%@) VALUES(%@)", insertSqlKeys, insertSqlValues];
-        result = [self execSql:sql];
-        if(result && item.extraData){
-            NSString *sql_data = [NSString stringWithFormat:@"update downloadItem set extraData=? where taskId == '%@'", item.taskId];
-            sqlite3_stmt *stmt = NULL;
-            if (sqlite3_prepare_v2(_db, [sql_data UTF8String], -1, &stmt, NULL) == SQLITE_OK) {
-                sqlite3_bind_blob64(stmt, 1, [item.extraData bytes], [item.extraData length], NULL);
-                if (sqlite3_step(stmt) == SQLITE_DONE) {
-                    return result;
-                }
-            }
-            result = false;
-        }
-    }else{
-        result = [self updateItem:item withResults:results];
-    }
-    return result;
-}
-
-+ (BOOL)saveItem:(YCDownloadItem *)item {
-    return [self performBlock:^BOOL{
-        return [self saveDownloadItem:item];
-    } sync:true];
-}
-#endif
-
-#pragma mark - task
-
-+ (YCDownloadTask *)taskWithDict:(NSDictionary *)dict {
-    if(!dict) return nil;
-    NSString *taskId = [dict valueForKey:@"taskId"];
-    NSAssert(taskId, @"taskId can not nil!");
-    if(!taskId) return nil;
-    YCDownloadTask *task = [_memCacheTasks valueForKey:taskId];
-    if (task && ![task.taskId isEqualToString:taskId]) {
-        _memCacheTasks[taskId] = nil;
-        return nil;
-    }
-    if (!task) {
-        task = [YCDownloadTask taskWithDict:dict];
-        _memCacheTasks[taskId] = task;
-    }
-    return task;
-}
-
-+ (YCDownloadTask *)taskWithTid:(NSString *)tid {
-    if(!tid) return nil;
-    __block YCDownloadTask *task = [_memCacheTasks valueForKey:tid];
-    if(!task){
-        [self performBlock:^BOOL{
-            NSString *sql = [NSString stringWithFormat:@"select * from downloadTask where taskId == '%@'", tid];
-            NSArray *rel = [self selectSql:sql];
-            task = [self taskWithDict:rel.firstObject];
-            return true;
-        } sync:true];
-    }
-    return task;
-}
-
-+ (NSArray <YCDownloadTask *> *)taskWithUrl:(NSString *)url {
-    NSMutableArray *tasks = [NSMutableArray array];
-    [self performBlock:^BOOL{
-        NSString *sql = [NSString stringWithFormat:@"select * from downloadTask where downloadURL == '%@'", url];
-        NSArray *rel = [self selectSql:sql];
-        [rel enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-            YCDownloadTask *task = [self taskWithDict:obj];
-            [tasks addObject:task];
-        }];
-        return true;
-    } sync:true];
-    return tasks;
-}
-
-+ (NSArray *)taskWithStid:(NSInteger)stid {
-    NSMutableArray *tasks = [NSMutableArray array];
-    [self performBlock:^BOOL{
-        NSString *sql = [NSString stringWithFormat:@"select * from downloadTask where stid == %ld", (long)stid];
-        NSArray *rel = [self selectSql:sql];
-        [rel enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-            YCDownloadTask *task = [self taskWithDict:rel.firstObject];
-            [tasks addObject:task];
-        }];
-        return true;
-    } sync:true];
-    return tasks;
-}
-
-+ (void)removeAllTasks {
-    [self performBlock:^BOOL{
-        BOOL result = [self execSql:@"delete from downloadTask"];
-        if(result) [_memCacheTasks removeAllObjects];
-        return result;
-    } sync:false];
-}
-
-+ (BOOL)removeTask:(YCDownloadTask *)task {
-    if(!task) return true;
-    return [self performBlock:^BOOL{
-        NSString *sql = [NSString stringWithFormat:@"delete from downloadTask where taskId == '%@'", task.taskId];
-        BOOL result = [self execSql:sql];
-        if(result) [_memCacheTasks removeObjectForKey:task.taskId];
-        return result;
-    } sync:false];
-}
-
-+ (BOOL)updateTask:(YCDownloadTask *)task withResults:(NSArray *)results {
-    NSMutableString *updateSql = [NSMutableString string];
-    int count = sizeof(allTaskKeys) /sizeof(allTaskKeys[0]);
-    [self getSqlWithKeys:allTaskKeys count:count obj:task oldItem:results.firstObject enumerateBlock:^(YCDownloadDBValueType type, NSString *key, id value, int idx) {
-        if (type == YCDownloadDBValueTypeData) {
-            if([key isEqualToString:@"extraData"]){
-                [self updateTaskDataWithTid:task.taskId data:task.extraData dataKey:key];
-            }else if ([key isEqualToString:@"resumeData"]){
-                [self updateTaskDataWithTid:task.taskId data:task.resumeData dataKey:key];
-            }else{
-                NSLog(@"[Warn] new data key for task : %@", key);
-            }
-            
-        }else if (type == YCDownloadDBValueTypeNumber){
-            [updateSql appendFormat:@"%@%@=%@", updateSql.length !=0 ? @", " : @"", key, [value stringValue]];
-        }else if(type == YCDownloadDBValueTypeNull){
-            [updateSql appendFormat:@"%@%@=null",updateSql.length !=0 ? @", " : @"", key];
-        }else{
-            NSAssert([value isKindOfClass:[NSString class]], @"cls error");
-            [updateSql appendFormat:@"%@%@='%@'",updateSql.length !=0 ? @", " : @"",  key, value];
-        }
-    }];
-    if (updateSql.length>0) {
-        NSString *sql = [NSString stringWithFormat:@"update downloadTask set %@ where taskId == '%@'", updateSql, task.taskId];
-        return [self execSql:sql];
-    }
-    return true;
-}
-
-+ (BOOL)updateTaskDataWithTid:(NSString *)tid data:(NSData *)data dataKey:(NSString *)dataKey{
-    BOOL result = false;
-    NSString *sql = [NSString stringWithFormat:@"update downloadTask set %@=? where taskId == '%@'", dataKey,tid];
-    sqlite3_stmt *stmt = NULL;
-    if (sqlite3_prepare_v2(_db, [sql UTF8String], -1, &stmt, NULL) == SQLITE_OK) {
-        sqlite3_bind_blob64(stmt, 1, [data bytes], [data length], NULL);
-        if (sqlite3_step(stmt) == SQLITE_DONE) {
-            return result;
-        }
-    }
-    return result;
-}
-+ (NSArray <YCDownloadTask *> *)fetchAllDownloadTasks {
-    __block NSMutableArray *results = [NSMutableArray array];
-    [self performBlock:^BOOL{
-        NSArray *rel = [self selectSql:@"select * from downloadTask"];
-        [rel enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-            YCDownloadTask *task = [self taskWithDict:obj];
-            [results addObject:task];
-        }];
-        return true;
-    } sync:true];
-    return results;
-}
-
-+ (BOOL)saveDownloadTask:(YCDownloadTask *)task {
-    NSString *sql = [NSString stringWithFormat:@"select * from downloadTask WHERE taskId == '%@'", task.taskId];
-    NSArray *results = [self selectSql:sql];
-    BOOL result = false;
-    if (results.count==0) {
-        _memCacheTasks[task.taskId] = task;
-        NSMutableString *insertSqlKeys = [NSMutableString string];
-        NSMutableString *insertSqlValues = [NSMutableString string];
-        int count = sizeof(allTaskKeys) / sizeof(allTaskKeys[0]);
-        [self getSqlWithKeys:allTaskKeys count:count obj:task oldItem:nil enumerateBlock:^(YCDownloadDBValueType type, NSString *key, id value, int idx) {
-            if (type == YCDownloadDBValueTypeNumber){
-                [insertSqlKeys appendFormat:@"%@%@", insertSqlKeys.length!=0 ? @", ": @"", key];
-                [insertSqlValues appendFormat:@"%@%@", insertSqlValues.length!=0 ? @", " : @"", [value stringValue]];
-            }else if(type == YCDownloadDBValueTypeString){
-                [insertSqlKeys appendFormat:@"%@%@", insertSqlKeys.length!=0 ? @", ": @"", key];
-                [insertSqlValues appendFormat:@"%@'%@'", insertSqlValues.length!=0 ? @", " : @"", value];
-            }
-        }];
-        sql = [NSString stringWithFormat:@"insert into downloadTask(%@) VALUES(%@)", insertSqlKeys, insertSqlValues];
-        result = [self execSql:sql];
-        if(result && task.resumeData){
-            result = [self updateTaskDataWithTid:task.taskId data:task.resumeData dataKey:@"resumeData"];
-        }
-        if (result && task.extraData) {
-            result = [self updateTaskDataWithTid:task.taskId data:task.extraData dataKey:@"extraData"];
-        }
-    }else{
-        result = [self updateTask:task withResults:results];
-    }
-    return result;
-}
-
-+ (BOOL)saveTask:(YCDownloadTask *)task {
-    return [self performBlock:^BOOL{
-        return [self saveDownloadTask:task];
-    } sync:true];
-}
-
-@end

+ 0 - 31
创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadSession.h

@@ -1,31 +0,0 @@
-//
-//  YCDownloadSession.h
-//  YCDownloadSession
-//
-//  Created by wz on 17/3/14.
-//  Copyright © 2017年 onezen.cc. All rights reserved.
-//  Contact me: http://www.onezen.cc/about/
-//  Github:     https://github.com/onezens/YCDownloadSession
-//
-//
-
-#ifndef YCDownload_H
-#define YCDownload_H
-
-#import "YCDownloader.h"
-#import "YCDownloadDB.h"
-#import "YCDownloadUtils.h"
-
-#ifndef YCDownload_Manager
-#if __has_include(<YCDownloadManager.h>)   &&  __has_include(<YCDownloadItem.h>)
-#define YCDownload_Manager 1
-#import <YCDownloadManager.h>
-#elif __has_include("YCDownloadManager.h") &&  __has_include("YCDownloadItem.h")
-#define YCDownload_Manager 1
-#import "YCDownloadManager.h"
-#else
-#define YCDownload_Manager 0
-#endif
-#endif
-
-#endif

+ 0 - 82
创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadTask.h

@@ -1,82 +0,0 @@
-//
-//  YCDownloadTask.h
-//  YCDownloadSession
-//
-//  Created by wz on 17/3/15.
-//  Copyright © 2017年 onezen.cc. All rights reserved.
-//  Contact me: http://www.onezen.cc/about/
-//  Github:     https://github.com/onezens/YCDownloadSession
-//
-
-#import <UIKit/UIKit.h>
-@class YCDownloadTask;
-
-typedef void (^YCCompletionHandler)(NSString  * _Nullable localPath, NSError * _Nullable error);
-typedef void (^YCProgressHandler)(NSProgress * _Nonnull progress,YCDownloadTask * _Nonnull task);
-
-#pragma mark - YCDownloadTask
-
-@interface YCDownloadTask : NSObject
-
-@property (nonatomic, strong, nullable) NSData *resumeData;
-@property (nonatomic, copy, readonly, nonnull) NSString *taskId;
-@property (nonatomic, copy, readonly, nonnull) NSString *downloadURL;
-@property (nonatomic, assign, readonly) int64_t fileSize;
-@property (nonatomic, assign) int64_t downloadedSize;
-@property (nonatomic, copy, nonnull) NSString *version;
-/**
- default value: NSURLSessionTaskPriorityDefault
- option: NSURLSessionTaskPriorityDefault NSURLSessionTaskPriorityLow NSURLSessionTaskPriorityHigh
- poiority float value range: 0.0 - 1.0
- */
-@property (nonatomic, assign, readonly) float priority;
-@property (nonatomic, assign, readonly) BOOL isRunning;
-@property (nonatomic, strong, readonly, nonnull) NSProgress *progress;
-@property (nonatomic, copy, nullable) YCProgressHandler progressHandler;
-@property (nonatomic, copy, nullable) YCCompletionHandler completionHandler;
-@property (nonatomic, strong, nonnull) NSData *extraData;
-
-/**
- if no downloadTask, state = -1
- */
-@property (nonatomic, assign, readonly) NSURLSessionTaskState state;
-
-#pragma mark - method
-- (void)updateTask;
-
-+ (nonnull instancetype)taskWithRequest:(nonnull NSURLRequest *)request progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion;
-
-+ (nonnull instancetype)taskWithRequest:(nonnull NSURLRequest *)request progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion priority:(float)priority;
-
-+ (nonnull NSString *)downloaderVerison;
-
-@end
-
-
-#pragma mark - YCResumeData
-@interface YCResumeData: NSObject
-
-@property (nonatomic, copy) NSString *downloadUrl;
-@property (nonatomic, strong) NSMutableURLRequest *currentRequest;
-@property (nonatomic, strong) NSMutableURLRequest *originalRequest;
-@property (nonatomic, assign) NSInteger downloadSize;
-@property (nonatomic, copy) NSString *resumeTag;
-@property (nonatomic, assign) NSInteger resumeInfoVersion;
-@property (nonatomic, strong) NSDate *downloadDate;
-@property (nonatomic, copy) NSString *tempName;
-@property (nonatomic, copy) NSString *resumeRange;
-
-- (instancetype)initWithResumeData:(NSData *)resumeData;
-
-+ (NSURLSessionDownloadTask *)downloadTaskWithCorrectResumeData:(NSData *)resumeData urlSession:(NSURLSession *)urlSession;
-
-/**
- 清除 NSURLSessionResumeByteRange 字段
- 修正iOS11.0 iOS11.1 多次暂停继续 文件大小不对的问题(iOS11.2官方已经修复)
- 
- @param resumeData 原始resumeData
- @return 清除后resumeData
- */
-+ (NSData *)cleanResumeData:(NSData *)resumeData;
-@end
-

+ 0 - 343
创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadTask.m

@@ -1,343 +0,0 @@
-//
-//  YCDownloadTask.m
-//  YCDownloadSession
-//
-//  Created by wz on 17/3/15.
-//  Copyright © 2017年 onezen.cc. All rights reserved.
-//  Contact me: http://www.onezen.cc/about/
-//  Github:     https://github.com/onezens/YCDownloadSession
-//
-
-#import "YCDownloadTask.h"
-#import "YCDownloadUtils.h"
-
-@interface YCDownloadTask()
-@property (nonatomic, assign) NSInteger pid;
-@property (nonatomic, assign) NSInteger stid;
-@property (nonatomic, copy) NSString *tmpName;
-@property (nonatomic, assign) BOOL needToRestart;
-@property (nonatomic, strong) NSURLRequest *request;
-@property (nonatomic, assign, readonly) BOOL isFinished;
-@property (nonatomic, assign, readonly) BOOL isSupportRange;
-@property (nonatomic, assign, readonly) NSUInteger createTime;
-@property (nonatomic, strong) NSURLSessionDownloadTask *downloadTask;
-@property (nonatomic, assign) BOOL isDeleted;
-@end
-
-
-@implementation YCDownloadTask
-
-@synthesize progress = _progress;
-
-- (instancetype)init {
-    NSAssert(false, @"use - (instancetype)initWithRequest:(NSURLRequest *)request progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion");
-    return nil;
-}
-
-- (instancetype)initWithPrivate{
-    if (self = [super init]) {
-        _createTime = [YCDownloadUtils sec_timestamp];
-        _version = [YCDownloadTask downloaderVerison];
-    }
-    return self;
-}
-
-- (instancetype)initWithRequest:(NSURLRequest *)request progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion priority:(float)priority{
-    if (self = [self initWithPrivate]) {
-        NSString *url = request.URL.absoluteString;
-        _request = request;
-        _downloadURL = url;
-        _taskId = [YCDownloadTask taskIdForUrl:url fileId:[NSUUID UUID].UUIDString];
-        _priority = priority ? priority : NSURLSessionTaskPriorityDefault;
-        _progressHandler = progress;
-        _completionHandler = completion;
-    }
-    return self;
-}
-
-+ (instancetype)taskWithDict:(NSMutableDictionary *)dict {
-    YCDownloadTask *task = [[self alloc] initWithPrivate];
-    [task setValuesForKeysWithDictionary:dict];
-    return task;
-}
-
-+ (instancetype)taskWithRequest:(NSURLRequest *)request progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion {
-    return [[self alloc] initWithRequest:request progress:progress completion:completion priority:0];
-}
-
-+ (instancetype)taskWithRequest:(NSURLRequest *)request progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion priority:(float)priority {
-    return [[self alloc] initWithRequest:request progress:progress completion:completion priority:priority];
-}
-
-#pragma mark - public
-
-- (void)updateTask {
-    _fileSize = [_downloadTask.response expectedContentLength];
-}
-
-#pragma mark - setter
-
-- (void)setDownloadTask:(NSURLSessionDownloadTask *)downloadTask {
-    NSAssert(downloadTask==nil || [downloadTask isKindOfClass:[NSURLSessionDownloadTask class]], @"downloadTask class", downloadTask.class);
-    _downloadTask = downloadTask;
-    downloadTask.priority = self.priority;
-}
-
-
-#pragma mark - getter
-
-- (NSURLSessionTaskState)state {
-    return self.downloadTask ? self.downloadTask.state : -1;
-}
-
-- (NSProgress *)progress {
-    if (!_progress) {
-        _progress = [NSProgress progressWithTotalUnitCount:NSURLSessionTransferSizeUnknown];
-    }
-    return _progress;
-}
-    
-- (BOOL)isSupportRange {
-    if([self.downloadTask.response isKindOfClass:[NSHTTPURLResponse class]]){
-        NSHTTPURLResponse *response = (NSHTTPURLResponse *)self.downloadTask.response;
-        NSString *rangeHeader = [response.allHeaderFields valueForKey:@"Accept-Ranges"];
-        NSString *etag = [response.allHeaderFields valueForKey:@"ETag"];
-        return rangeHeader.length>0 && etag.length>0;
-    }
-    return true;
-}
-
-- (BOOL)isRunning {
-    return self.downloadTask && self.downloadTask.state == NSURLSessionTaskStateRunning;
-}
-
-- (NSInteger)stid {
-    return self.downloadTask ? self.downloadTask.taskIdentifier : _stid;
-}
-
-- (BOOL)isFinished {
-    return self.fileSize != 0 && self.fileSize == self.downloadedSize;
-}
-
-- (NSString *)description {
-    return [NSString stringWithFormat:@"<YCDownloadTask: %p>{ taskId: %@, url: %@, stid: %ld}", self, self.taskId, self.downloadURL, (long)self.stid];
-}
-
-+ (NSString *)taskIdForUrl:(NSString *)url fileId:(NSString *)fileId {
-    NSString *name = [YCDownloadUtils md5ForString:fileId.length>0 ? [NSString stringWithFormat:@"%@-%@",url, fileId] : url];
-    return name;
-}
-
-+ (NSString *)downloaderVerison {
-    return @"2.0.3";
-}
-
-@end
-
-
-#pragma mark -- YCResumeData implementation
-
-static NSString * const kNSURLSessionDownloadURL = @"NSURLSessionDownloadURL";
-static NSString * const kNSURLSessionResumeInfoTempFileName = @"NSURLSessionResumeInfoTempFileName";
-static NSString * const kNSURLSessionResumeBytesReceived = @"NSURLSessionResumeBytesReceived";
-static NSString * const kNSURLSessionResumeCurrentRequest = @"NSURLSessionResumeCurrentRequest";
-static NSString * const kNSURLSessionResumeOriginalRequest = @"NSURLSessionResumeOriginalRequest";
-static NSString * const kNSURLSessionResumeEntityTag = @"NSURLSessionResumeEntityTag";
-static NSString * const kNSURLSessionResumeByteRange = @"NSURLSessionResumeByteRange";
-static NSString * const kNSURLSessionResumeInfoVersion = @"NSURLSessionResumeInfoVersion";
-static NSString * const kNSURLSessionResumeServerDownloadDate = @"NSURLSessionResumeServerDownloadDate";
-
-
-@interface YCResumeData()
-
-@end
-
-@implementation YCResumeData
-
-- (instancetype)initWithResumeData:(NSData *)resumeData {
-    if (self = [super init]) {
-        [self decodeResumeData:resumeData];
-    }
-    return self;
-}
-
-
-- (void)decodeResumeData:(NSData *)resumeData {
-    
-    id resumeDataObj = [NSPropertyListSerialization propertyListWithData:resumeData options:0 format:0 error:nil];
-    if ([resumeDataObj isKindOfClass:[NSDictionary class]]) {
-        NSDictionary *resumeDict = resumeDataObj;
-        NSString *downloadUrl = [resumeDict valueForKey:kNSURLSessionDownloadURL];
-        NSString *tempName = [resumeDict valueForKey:kNSURLSessionResumeInfoTempFileName];
-        NSNumber *downloadSize = [resumeDict valueForKey:kNSURLSessionResumeBytesReceived];
-        NSData *currentReqData = [resumeDict valueForKey:kNSURLSessionResumeCurrentRequest];
-        NSData *originalReqData = [resumeDict valueForKey:kNSURLSessionResumeOriginalRequest];
-        NSString *resumeTag = [resumeDict valueForKey:kNSURLSessionResumeEntityTag];
-        NSString *resumeRange = [resumeDict valueForKey:kNSURLSessionResumeByteRange];
-        NSNumber *resumeInfoVersion = [resumeDict valueForKey:kNSURLSessionResumeInfoVersion];
-        NSString *downloadDate = [resumeDict valueForKey:kNSURLSessionResumeServerDownloadDate];
-        
-        
-        _downloadUrl = downloadUrl;
-        _tempName = tempName;
-        _downloadSize = downloadSize.integerValue;
-        _resumeTag = resumeTag;
-        _resumeRange = resumeRange;
-        _resumeInfoVersion = resumeInfoVersion.integerValue;
-        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
-        _downloadDate = [formatter dateFromString:downloadDate];
-        
-        [NSKeyedUnarchiver unarchiveObjectWithData:currentReqData];
-        [NSKeyedUnarchiver unarchiveObjectWithData:originalReqData];
-    }
-}
-
-
-+ (NSData *)correctRequestData:(NSData *)data
-{
-    if (!data) {
-        return nil;
-    }
-    // return the same data if it's correct
-    if ([NSKeyedUnarchiver unarchiveObjectWithData:data] != nil) {
-        return data;
-    }
-    NSMutableDictionary *archive = [[NSPropertyListSerialization propertyListWithData:data options:NSPropertyListMutableContainersAndLeaves format:nil error:nil] mutableCopy];
-    
-    if (!archive) {
-        return nil;
-    }
-    NSInteger k = 0;
-    id objectss = archive[@"$objects"];
-    while ([objectss[1] objectForKey:[NSString stringWithFormat:@"$%ld",(long)k]] != nil) {
-        k += 1;
-    }
-    NSInteger i = 0;
-    while ([archive[@"$objects"][1] objectForKey:[NSString stringWithFormat:@"__nsurlrequest_proto_prop_obj_%ld",(long)i]] != nil) {
-        NSMutableArray *arr = archive[@"$objects"];
-        NSMutableDictionary *dic = arr[1];
-        id obj = [dic objectForKey:[NSString stringWithFormat:@"__nsurlrequest_proto_prop_obj_%ld",(long)i]];
-        if (obj) {
-            [dic setValue:obj forKey:[NSString stringWithFormat:@"$%ld",(long)(i+k)]];
-            [dic removeObjectForKey:[NSString stringWithFormat:@"__nsurlrequest_proto_prop_obj_%ld",(long)i]];
-            [arr replaceObjectAtIndex:1 withObject:dic];
-            archive[@"$objects"] = arr;
-        }
-        i++;
-    }
-    if ([archive[@"$objects"][1] objectForKey:@"__nsurlrequest_proto_props"] != nil) {
-        NSMutableArray *arr = archive[@"$objects"];
-        NSMutableDictionary *dic = arr[1];
-        id obj = [dic objectForKey:@"__nsurlrequest_proto_props"];
-        if (obj) {
-            [dic setValue:obj forKey:[NSString stringWithFormat:@"$%ld",(long)(i+k)]];
-            [dic removeObjectForKey:@"__nsurlrequest_proto_props"];
-            [arr replaceObjectAtIndex:1 withObject:dic];
-            archive[@"$objects"] = arr;
-        }
-    }
-    // Rectify weird "NSKeyedArchiveRootObjectKey" top key to NSKeyedArchiveRootObjectKey = "root"
-    if ([archive[@"$top"] objectForKey:@"NSKeyedArchiveRootObjectKey"] != nil) {
-        [archive[@"$top"] setObject:archive[@"$top"][@"NSKeyedArchiveRootObjectKey"] forKey: NSKeyedArchiveRootObjectKey];
-        [archive[@"$top"] removeObjectForKey:@"NSKeyedArchiveRootObjectKey"];
-    }
-    // Reencode archived object
-    NSData *result = [NSPropertyListSerialization dataWithPropertyList:archive format:NSPropertyListBinaryFormat_v1_0 options:0 error:nil];
-    return result;
-}
-
-+ (NSMutableDictionary *)getResumeDictionary:(NSData *)data
-{
-    NSMutableDictionary *iresumeDictionary = nil;
-    if (YC_DEVICE_VERSION >= 10) {
-        id root = nil;
-        id  keyedUnarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
-        @try {
-            if (@available(iOS 9.0, *)) {
-                root = [keyedUnarchiver decodeTopLevelObjectForKey:@"NSKeyedArchiveRootObjectKey" error:nil];
-            } else {
-                root = [keyedUnarchiver decodeObjectForKey:@"NSKeyedArchiveRootObjectKey"];
-            }
-            if (root == nil) {
-                if (@available(iOS 9.0, *)) {
-                    root = [keyedUnarchiver decodeTopLevelObjectForKey:NSKeyedArchiveRootObjectKey error:nil];
-                } else {
-                    root = [keyedUnarchiver decodeObjectForKey:NSKeyedArchiveRootObjectKey];
-                }
-            }
-        } @catch(NSException *exception) {
-            
-        }
-        [keyedUnarchiver finishDecoding];
-        iresumeDictionary = [root mutableCopy];
-    }
-    
-    if (iresumeDictionary == nil) {
-        iresumeDictionary = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListMutableContainersAndLeaves format:nil error:nil];
-    }
-    return iresumeDictionary;
-}
-
-+ (NSData *)correctResumeData:(NSData *)data
-{
-    if (YC_DEVICE_VERSION >= 11.2) {
-        return data;
-    }
-    NSString *kResumeCurrentRequest = kNSURLSessionResumeCurrentRequest;
-    NSString *kResumeOriginalRequest = kNSURLSessionResumeOriginalRequest;
-    if (data == nil) {
-        return  nil;
-    }
-    NSMutableDictionary *resumeDictionary = [YCResumeData getResumeDictionary:data];
-    if (resumeDictionary == nil) {
-        return nil;
-    }
-    resumeDictionary[kResumeCurrentRequest] =  [YCResumeData correctRequestData: resumeDictionary[kResumeCurrentRequest]];
-    resumeDictionary[kResumeOriginalRequest] = [YCResumeData correctRequestData:resumeDictionary[kResumeOriginalRequest]];
-    NSData *result = [NSPropertyListSerialization dataWithPropertyList:resumeDictionary format:NSPropertyListXMLFormat_v1_0 options:0 error:nil];
-    return result;
-}
-
-
-+ (NSURLSessionDownloadTask *)downloadTaskWithCorrectResumeData:(NSData *)resumeData urlSession:(NSURLSession *)urlSession {
-    NSString *kResumeCurrentRequest = kNSURLSessionResumeCurrentRequest;
-    NSString *kResumeOriginalRequest = kNSURLSessionResumeOriginalRequest;
-    
-    NSData *cData = [YCResumeData correctResumeData:resumeData];
-    cData = cData ? cData:resumeData;
-    NSURLSessionDownloadTask *task = [urlSession downloadTaskWithResumeData:cData];
-    NSMutableDictionary *resumeDic = [YCResumeData getResumeDictionary:cData];
-    if (resumeDic) {
-        if (task.originalRequest == nil) {
-            NSData *originalReqData = resumeDic[kResumeOriginalRequest];
-            NSURLRequest *originalRequest = [NSKeyedUnarchiver unarchiveObjectWithData:originalReqData ];
-            if (originalRequest) {
-                [task setValue:originalRequest forKey:@"originalRequest"];
-            }
-        }
-        if (task.currentRequest == nil) {
-            NSData *currentReqData = resumeDic[kResumeCurrentRequest];
-            NSURLRequest *currentRequest = [NSKeyedUnarchiver unarchiveObjectWithData:currentReqData];
-            if (currentRequest) {
-                [task setValue:currentRequest forKey:@"currentRequest"];
-            }
-        }
-    }
-    return task;
-}
-
-+ (NSData *)cleanResumeData:(NSData *)resumeData {
-    NSString *dataString = [[NSString alloc] initWithData:resumeData encoding:NSUTF8StringEncoding];
-    if ([dataString containsString:@"<key>NSURLSessionResumeByteRange</key>"]) {
-        NSRange rangeKey = [dataString rangeOfString:@"<key>NSURLSessionResumeByteRange</key>"];
-        NSString *headStr = [dataString substringToIndex:rangeKey.location];
-        NSString *backStr = [dataString substringFromIndex:rangeKey.location];
-        
-        NSRange rangeValue = [backStr rangeOfString:@"</string>\n\t"];
-        NSString *tailStr = [backStr substringFromIndex:rangeValue.location + rangeValue.length];
-        dataString = [headStr stringByAppendingString:tailStr];
-    }
-    return [dataString dataUsingEncoding:NSUTF8StringEncoding];
-}
-
-@end

+ 0 - 46
创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadUtils.h

@@ -1,46 +0,0 @@
-//
-//  YCDownloadUtils.h
-//  YCDownloadSession
-//
-//  Created by wz on 2018/6/22.
-//  Copyright © 2018年 onezen.cc. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-#define YC_DEVICE_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
-
-@interface YCDownloadUtils : NSObject
-
-/**
- 获取当前手机的空闲磁盘空间
- */
-+ (int64_t)fileSystemFreeSize;
-
-/**
- 将文件的字节大小,转换成更加容易识别的大小KB,MB,GB
- */
-+ (NSString *)fileSizeStringFromBytes:(int64_t)byteSize;
-
-/**
- 字符串md5加密
- 
- @param string 需要MD5加密的字符串
- @return MD5后的值
- */
-+ (NSString *)md5ForString:(NSString *)string;
-
-/**
- 创建路径
- */
-+ (void)createPathIfNotExist:(NSString *)path;
-
-+ (int64_t)fileSizeWithPath:(NSString *)path;
-
-+ (NSString *)urlStrWithDownloadTask:(NSURLSessionDownloadTask *)downloadTask;
-
-+ (NSUInteger)sec_timestamp;
-
-@end
-
-

+ 0 - 85
创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloadUtils.m

@@ -1,85 +0,0 @@
-//
-//  YCDownloadUtils.m
-//  YCDownloadSession
-//
-//  Created by wz on 2018/6/22.
-//  Copyright © 2018年 onezen.cc. All rights reserved.
-//
-
-#import "YCDownloadUtils.h"
-#import <CommonCrypto/CommonDigest.h>
-
-#define kCommonUtilsGigabyte (1024 * 1024 * 1024)
-#define kCommonUtilsMegabyte (1024 * 1024)
-#define kCommonUtilsKilobyte 1024
-
-@implementation YCDownloadUtils
-
-+ (int64_t)fileSystemFreeSize {
-    int64_t totalFreeSpace = 0;
-    NSError *error = nil;
-    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-    NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error: &error];
-    
-    if (dictionary) {
-        NSNumber *freeFileSystemSizeInBytes = [dictionary objectForKey:NSFileSystemFreeSize];
-        totalFreeSpace = [freeFileSystemSizeInBytes longLongValue];
-    }
-    return totalFreeSpace;
-}
-
-+ (NSString *)fileSizeStringFromBytes:(int64_t)byteSize {
-    if (kCommonUtilsGigabyte <= byteSize) {
-        return [NSString stringWithFormat:@"%@GB", [self numberStringFromDouble:(double)byteSize / kCommonUtilsGigabyte]];
-    }
-    if (kCommonUtilsMegabyte <= byteSize) {
-        return [NSString stringWithFormat:@"%@MB", [self numberStringFromDouble:(double)byteSize / kCommonUtilsMegabyte]];
-    }
-    if (kCommonUtilsKilobyte <= byteSize) {
-        return [NSString stringWithFormat:@"%@KB", [self numberStringFromDouble:(double)byteSize / kCommonUtilsKilobyte]];
-    }
-    return [NSString stringWithFormat:@"%luB", (unsigned long)byteSize];
-}
-
-+ (NSString *)numberStringFromDouble:(const double)num {
-    NSInteger section = round((num - (NSInteger)num) * 100);
-    if (section % 10) {
-        return [NSString stringWithFormat:@"%.2f", num];
-    }
-    if (section > 0) {
-        return [NSString stringWithFormat:@"%.1f", num];
-    }
-    return [NSString stringWithFormat:@"%.0f", num];
-}
-
-+ (NSString *)md5ForString:(NSString *)string {
-    const char *str = [string UTF8String];
-    if (str == NULL) str = "";
-    unsigned char r[CC_MD5_DIGEST_LENGTH];
-    CC_MD5(str, (CC_LONG)strlen(str), r);
-    NSString *md5Result = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
-                           r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15]];
-    return md5Result;
-}
-
-+ (void)createPathIfNotExist:(NSString *)path {
-    if(![[NSFileManager defaultManager] fileExistsAtPath:path]){
-        [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:true attributes:nil error:nil];
-    }
-}
-+ (int64_t)fileSizeWithPath:(NSString *)path {
-    if(![[NSFileManager defaultManager] fileExistsAtPath:path]) return 0;
-    NSDictionary *dic = [[NSFileManager defaultManager] attributesOfItemAtPath:path error:nil];
-    return dic ? (int64_t)[dic fileSize] : 0;
-}
-
-+ (NSString *)urlStrWithDownloadTask:(NSURLSessionDownloadTask *)downloadTask {
-    return downloadTask.originalRequest.URL.absoluteString ? : downloadTask.currentRequest.URL.absoluteString;
-}
-
-+ (NSUInteger)sec_timestamp {
-    return (NSUInteger)[[NSDate date] timeIntervalSince1970];
-}
-
-@end
-

+ 0 - 123
创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloader.h

@@ -1,123 +0,0 @@
-//
-//  YCDownload.h
-//  YCDownloadSession
-//
-//  Created by wz on 2018/8/27.
-//  Copyright © 2018 onezen.cc. All rights reserved.
-//  Contact me: http://www.onezen.cc/about/
-//  Github:     https://github.com/onezens/YCDownloadSession
-//
-
-#import <Foundation/Foundation.h>
-#import "YCDownloadTask.h"
-typedef void (^BGCompletedHandler)(void);
-
-/**
- 下载完成后的数据处理行为
- - YCDownloadTaskCacheModeDefault: 下载完成后,删除库中的下载数据
- - YCDownloadTaskCacheModeKeep: 下载完成后,不删除库中的下载数据
- */
-typedef NS_ENUM(NSUInteger, YCDownloadTaskCacheMode) {
-    YCDownloadTaskCacheModeDefault,
-    YCDownloadTaskCacheModeKeep
-};
-
-@protocol YCDownloader <NSObject>
-/**
- 单利downloader
- */
-+ (nonnull instancetype)downloader;
-@end
-
-@interface YCDownloader : NSObject <YCDownloader>
-/**
- 是否允许蜂窝煤网络下载
- */
-@property (nonatomic, assign) BOOL allowsCellularAccess;
-
-/**
- 下载完成后的数据处理行为
- */
-@property (nonatomic, assign) YCDownloadTaskCacheMode taskCachekMode;
-
-/**
- 单利downloader
- */
-+ (nonnull instancetype)downloader;
-
-/**
- 通过url开始创建下载任务,手动调用resumeTask:开始下载
-
- @param url 下载url
- @param progress 下载进度
- @param completion 下载成功或者失败回调
- @return 下载任务的task
- */
-- (nonnull YCDownloadTask *)downloadWithUrl:(nonnull NSString *)url progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion;
-
-/**
- 通过request对象创建下载任务,可以自定义header等请求信息,手动调用resumeTask:开始下载
-
- @param request request 对象
- @param progress 下载进度回调
- @param completion 下载成功失败回调
- @return 下载任务task
- */
-- (nonnull YCDownloadTask *)downloadWithRequest:(nonnull NSURLRequest *)request progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion;
-
-/**
- 通过request对象进行创建下载任务,可以自定义header等请求信息,手动调用resumeTask:开始下载
- 
- @param request request 对象
- @param progress 下载进度回调
- @param completion 下载成功失败回调
- @param priority 下载任务优先级,默认是 NSURLSessionTaskPriorityDefault, 取值范围0~1
- @return 下载任务task
- */
-- (nonnull YCDownloadTask *)downloadWithRequest:(nonnull NSURLRequest *)request progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion priority:(float)priority;
-
-
-/**
- 恢复下载任务,继续下载任务,主要用于app异常退出状态恢复,继续下载任务的回调设置
-
- @param tid 下载任务的taskId
- @param progress 下载进度回调
- @param completion 下载成功失败回调
- @return 下载任务task
- */
-- (nullable YCDownloadTask *)resumeDownloadTaskWithTid:(NSString *)tid progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion;
-
-/**
- 继续下载任务
-
- @param task 需要继续的task
- @return 是否继续下载成功,失败后可冲洗下载
- */
-- (BOOL)resumeTask:(nonnull YCDownloadTask *)task;
-
-
-/**
- 暂停下载任务
-
- @param task 需要暂停的task
- */
-- (void)pauseTask:(nonnull YCDownloadTask *)task;
-
-/**
- 暂停下载任务
- 
- @param task 需要删除的task
- */
-- (void)cancelTask:(nonnull YCDownloadTask *)task;
-
-/**
- 后台某一下载任务完成时,第一次在AppDelegate中的 -(void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler
- 回调方法中调用该方法。多个task,一个session,只调用一次AppDelegate的回调方法。
- completionHandler 回调执行后,app被系统唤醒的状态会变为休眠状态。
- 
- @param handler 后台任务结束后的调用的处理方法
- @param identifier background session 的标识
- */
--(void)addCompletionHandler:(BGCompletedHandler)handler identifier:(nonnull NSString *)identifier;
-
-@end

+ 0 - 495
创维盒子/Pods/YCDownloadSession/YCDownloadSession/Core/YCDownloader.m

@@ -1,495 +0,0 @@
-//
-//  YCDownloader.m
-//  YCDownloadSession
-//
-//  Created by wz on 2018/8/27.
-//  Copyright © 2018 onezen.cc. All rights reserved.
-//  Contact me: http://www.onezen.cc/about/
-//  Github:     https://github.com/onezens/YCDownloadSession
-//
-
-#import "YCDownloader.h"
-#import "YCDownloadUtils.h"
-#import "YCDownloadTask.h"
-#import "YCDownloadDB.h"
-
-typedef void(^BGRecreateSessionBlock)(void);
-static NSString * const kIsAllowCellar = @"kIsAllowCellar";
-
-@interface YCDownloadTask(Downloader)
-@property (nonatomic, assign) NSInteger pid;
-@property (nonatomic, assign) NSInteger stid;
-@property (nonatomic, assign) BOOL isDeleted;
-@property (nonatomic, copy) NSString *tmpName;
-@property (nonatomic, assign) BOOL needToRestart;
-@property (nonatomic, strong) NSURLRequest *request;
-@property (nonatomic, assign, readonly) BOOL isFinished;
-@property (nonatomic, assign, readonly) BOOL isSupportRange;
-@property (nonatomic, strong) NSURLSessionDownloadTask *downloadTask;
-@end
-
-@interface YCDownloader()<NSURLSessionDelegate>
-{
-    BGRecreateSessionBlock _bgRCSBlock;
-    dispatch_source_t _timerSource;
-}
-@property (nonatomic, strong) NSURLSession *session;
-@property (nonatomic, assign) BOOL isNeedCreateSession;
-@property (nonatomic, strong) NSMutableDictionary <NSURLSessionDownloadTask *, YCDownloadTask *> *memCache;
-@property (nonatomic, copy) BGCompletedHandler completedHandler;
-@property (nonatomic, strong) NSMutableArray <YCDownloadTask *> *bgRCSTasks;
-@end
-
-@implementation YCDownloader
-
-#pragma mark - init
-
-+ (instancetype)downloader {
-    static dispatch_once_t onceToken;
-    static YCDownloader *_downloader;
-    dispatch_once(&onceToken, ^{
-        _downloader = [[self alloc] initWithPrivate];
-    });
-    return _downloader;
-}
-
-- (instancetype)initWithPrivate {
-    if (self = [super init]) {
-        NSLog(@"[YCDownloader init]");
-        _session = [self backgroundUrlSession];
-        _memCache = [NSMutableDictionary dictionary];
-        _bgRCSTasks = [NSMutableArray array];
-        [self recoveryExceptionTasks];
-        [self addNotification];
-    }
-    return self;
-}
-
-
-- (instancetype)init {
-    NSAssert(false, @"use +[YCDownloader downloader] instead!");
-    return nil;
-}
-- (NSString *)backgroundSessionIdentifier {
-    NSString *bundleId = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];
-    NSString *identifier = [NSString stringWithFormat:@"%@.BGS.YCDownloader", bundleId];
-    return identifier;
-}
-
-- (NSURLSession *)backgroundUrlSession {
-    NSURLSession *session = nil;
-    NSString *identifier = [self backgroundSessionIdentifier];
-    NSURLSessionConfiguration* sessionConfig = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:identifier];
-    sessionConfig.allowsCellularAccess = [[NSUserDefaults standardUserDefaults] boolForKey:kIsAllowCellar];
-    session = [NSURLSession sessionWithConfiguration:sessionConfig delegate:self delegateQueue:[NSOperationQueue mainQueue]];
-    return session;
-}
-
-- (NSInteger)sessionTaskIdWithDownloadTask:(NSURLSessionDownloadTask *)downloadTask {
-    return downloadTask.taskIdentifier;
-}
-
-- (void)recoveryExceptionTasks {
-    NSMutableDictionary *dictM = [self.session valueForKey:@"tasks"];
-    [dictM.copy enumerateKeysAndObjectsUsingBlock:^(NSNumber *_Nonnull key, NSURLSessionDownloadTask *obj, BOOL * _Nonnull stop) {
-        YCDownloadTask *task = [YCDownloadDB taskWithStid:key.integerValue].firstObject;
-        task ? [self memCacheDownloadTask:obj task:task] : [obj cancel];
-        if (task.downloadTask && task.downloadTask.state != NSURLSessionTaskStateRunning) {
-            [self pauseTask:task];
-        }
-    }];
-}
-- (void)addNotification {
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillBecomActive) name:UIApplicationDidBecomeActiveNotification object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillResignActive) name:UIApplicationWillResignActiveNotification object:nil];
-}
-
-#pragma mark - event
-
-- (void)appWillBecomActive {
-    [self endTimer];
-    if (self.completedHandler) self.completedHandler();
-    self.completedHandler = nil;
-    _bgRCSBlock = nil;
-}
-
-- (void)appWillResignActive {
-    [YCDownloadDB saveAllData];
-}
-
-#pragma mark - download handler
-- (NSURLRequest *)requestWithUrlStr:(NSString *)urlStr {
-    NSURL *url = [NSURL URLWithString:urlStr];
-    return [NSMutableURLRequest requestWithURL:url];;
-}
-
-- (YCDownloadTask *)downloadWithUrl:(NSString *)url progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion {
-    NSURLRequest *request = [self requestWithUrlStr:url];
-    return [self downloadWithRequest:request progress:progress completion:completion];
-}
-
-- (YCDownloadTask *)downloadWithRequest:(NSURLRequest *)request progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion{
-    return [self downloadWithRequest:request progress:progress completion:completion priority:0];
-}
-
-- (YCDownloadTask *)downloadWithRequest:(NSURLRequest *)request progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion priority:(float)priority{
-    YCDownloadTask *task = [YCDownloadTask taskWithRequest:request progress:progress completion:completion];
-    [self saveDownloadTask:task];
-    return task;
-}
-
-- (YCDownloadTask *)resumeDownloadTaskWithTid:(NSString *)tid progress:(YCProgressHandler)progress completion:(YCCompletionHandler)completion {
-    YCDownloadTask *task = [YCDownloadDB taskWithTid:tid];
-    task.completionHandler = completion;
-    task.progressHandler = progress;
-    [self resumeTask:task];
-    return task;
-}
-
-- (BOOL)resumeTask:(YCDownloadTask *)task {
-    if(!task) return false;
-    if (self.isNeedCreateSession) {
-        //fix crash: #25 #35 Attempted to create a task in a session that has been invalidated
-        [self.bgRCSTasks addObject:task];
-        return true;
-    }
-    if (!task.resumeData && task.downloadTask.state == NSURLSessionTaskStateSuspended){
-        [task.downloadTask resume];
-        NSError *err = nil;
-        BOOL success = [self checkDownloadTaskState:task.downloadTask task:task error:&err];
-        if(!success) NSLog(@"[resumeTask] task resume failed: %@", err);
-        return success;
-    }else if (task.downloadTask && self.memCache[task.downloadTask] && task.downloadTask.state == NSURLSessionTaskStateRunning) {
-        return true;
-    }else if (!task.resumeData && task.downloadTask){
-        NSError *error = [NSError errorWithDomain:@"resume NSURLSessionDownloadTask error state" code:10004 userInfo:nil];
-        [self completionDownloadTask:task localPath:nil error:error];
-        NSLog(@"[resumeTask] task resume failed: %@", error);
-        return false;
-    }else if (!task.resumeData){
-        if (!task.request) {
-            NSURLRequest *request = [self requestWithUrlStr:task.downloadURL];
-            task.request = request;
-        }
-        NSURLSessionDownloadTask *downloadTask = [self.session downloadTaskWithRequest:task.request];
-        [self memCacheDownloadTask:downloadTask task:task];
-        task.downloadTask = downloadTask;
-        [task.downloadTask resume];
-        NSError *err = nil;
-        BOOL success = [self checkDownloadTaskState:task.downloadTask task:task error:&err];
-        if(!success) NSLog(@"[resumeTask] task resume failed: %@", err);
-        return success;
-    }
-    
-    NSURLSessionDownloadTask *downloadTask = nil;
-    @try {
-        downloadTask = [YCResumeData downloadTaskWithCorrectResumeData:task.resumeData urlSession:self.session];
-    } @catch (NSException *exception) {
-        NSError *error = [NSError errorWithDomain:exception.description code:10002 userInfo:exception.userInfo];
-        [self completionDownloadTask:task localPath:nil error:error];
-        NSLog(@"[resumeTask] task resume failed: %@", error);
-        return false;
-    }
-    if (!downloadTask) {
-        NSError *error = [NSError errorWithDomain:@"resume NSURLSessionDownloadTask nil!" code:10003 userInfo:nil];
-        [self completionDownloadTask:task localPath:nil error:error];
-        NSLog(@"[resumeTask] task resume failed: %@", error);
-        return false;
-    }
-    [self memCacheDownloadTask:downloadTask task:task];
-    [downloadTask resume];
-    NSError *err = nil;
-    if (![self checkDownloadTaskState:downloadTask task:task error:&err]) {
-        NSLog(@"[resumeTask] task resume failed: %@", err);
-        return false;
-    }
-    NSLog(@"[resumeTask] task resume success");
-    task.resumeData = nil;
-    return true;
-}
-
-- (BOOL)checkDownloadTaskState:(NSURLSessionDownloadTask *)downloadTask task:(YCDownloadTask *)task error:(NSError **)err {
-    if (downloadTask && downloadTask.state != NSURLSessionTaskStateRunning) {
-        NSError *error = [NSError errorWithDomain:[NSString stringWithFormat:@"task resume failed, downloadTask.state error : %ld", (long)downloadTask.state] code:10006 userInfo:nil];
-        [self completionDownloadTask:task localPath:nil error:error];
-        if(err) *err = error;
-        return false;
-    }
-    return true;
-}
-
-- (void)pauseTask:(YCDownloadTask *)task{
-    [task.downloadTask cancelByProducingResumeData:^(NSData * _Nullable resumeData) { }];
-}
-
-- (void)cancelTask:(YCDownloadTask *)task{
-    task.isDeleted = true;
-    [task.downloadTask cancel];
-}
-
-#pragma mark - recreate session
-
-- (void)prepareRecreateSession {
-    if (self.isNeedCreateSession) return;
-    self.isNeedCreateSession = true;
-    [[YCDownloadDB fetchAllDownloadTasks] enumerateObjectsUsingBlock:^(YCDownloadTask * _Nonnull task, NSUInteger idx, BOOL * _Nonnull stop) {
-        if (task.downloadTask && task.downloadTask.state == NSURLSessionTaskStateRunning) {
-            task.needToRestart = true;
-            [self pauseTask:task];
-        }
-    }];
-    [_session invalidateAndCancel];
-}
-- (void)recreateSession {
-    
-    _session = [self backgroundUrlSession];
-    //恢复正在下载的task状态
-    [[YCDownloadDB fetchAllDownloadTasks] enumerateObjectsUsingBlock:^(YCDownloadTask * _Nonnull task, NSUInteger idx, BOOL * _Nonnull stop) {
-        task.downloadTask = nil;
-        if (task.needToRestart) {
-            task.needToRestart = false;
-            [self resumeTask:task];
-        }
-    }];
-    NSLog(@"[recreateSession] recreate Session success");
-}
-
-#pragma mark - setter & getter
-
-- (void)setAllowsCellularAccess:(BOOL)allowsCellularAccess {
-    if ([self allowsCellularAccess] != allowsCellularAccess) {
-        [[NSUserDefaults standardUserDefaults] setBool:allowsCellularAccess forKey:kIsAllowCellar];
-        [self prepareRecreateSession];
-    }
-}
-
-- (BOOL)allowsCellularAccess {
-    return [[NSUserDefaults standardUserDefaults] boolForKey:kIsAllowCellar];
-}
-
-#pragma mark - cache
-
-- (void)memCacheDownloadTask:(NSURLSessionDownloadTask *)downloadTask  task:(YCDownloadTask *)task{
-    task.downloadTask = downloadTask;
-    //record taskId for coldLaunch recovery download
-    task.stid = [self sessionTaskIdWithDownloadTask:downloadTask];
-    [self.memCache setObject:task forKey:downloadTask];
-    [self saveDownloadTask:task];
-}
-
-- (void)removeMembCacheTask:(NSURLSessionDownloadTask *)downloadTask task:(YCDownloadTask *)task {
-    task.stid = -1;
-    [self.memCache removeObjectForKey:downloadTask];
-}
-
-- (void)completionDownloadTask:(YCDownloadTask *)task localPath:(NSString *)localPath error:(NSError *)error {
-    if(task.downloadTask) [self removeMembCacheTask:task.downloadTask task:task];
-    task.completionHandler? task.completionHandler(localPath, error) : false;
-    if (self.taskCachekMode == YCDownloadTaskCacheModeDefault && task.completionHandler) {
-        [self removeDownloadTask:task];
-    }else{
-        task.stid = -1;
-        [self saveDownloadTask:task];
-    }
-    task.downloadTask = nil;
-}
-
-- (void)removeDownloadTask:(YCDownloadTask *)task {
-    [YCDownloadDB removeTask:task];
-}
-
-- (void)saveDownloadTask:(YCDownloadTask *)task {
-    [YCDownloadDB saveTask:task];
-}
-
-- (YCDownloadTask *)taskWithSessionTask:(NSURLSessionDownloadTask *)downloadTask {
-    NSAssert(downloadTask, @"taskWithSessionTask downloadTask can not nil!");
-    if (!downloadTask)  return nil;
-    __block YCDownloadTask *task = [self.memCache objectForKey:downloadTask];
-    NSString *url = [YCDownloadUtils urlStrWithDownloadTask:downloadTask];
-    if (!task) {
-        NSArray <YCDownloadTask *>* tasks = [YCDownloadDB taskWithStid:[self sessionTaskIdWithDownloadTask:downloadTask]];
-        [tasks enumerateObjectsUsingBlock:^(YCDownloadTask * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-            if ([obj.downloadURL isEqualToString:url]) {
-                task = obj;
-                *stop = true;
-            }
-        }];
-    }
-    if (!task) {
-        NSArray *tasks = [YCDownloadDB taskWithUrl:url];
-        //fixme: optimize logic for multible tasks for same url
-        [tasks enumerateObjectsUsingBlock:^(YCDownloadTask * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-            if (obj.downloadTask == nil && downloadTask.taskIdentifier == obj.stid) {
-                task = obj;
-                *stop = true;
-            }
-        }];
-        if (!task) task = tasks.firstObject;
-    }
-    NSAssert(task, @"taskWithSessionTask task can not nil!");
-    return task;
-}
-
-#pragma mark - Handler
-
-- (void)startTimer {
-    [self endTimer];
-    dispatch_source_t timerSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());
-    _timerSource = timerSource;
-    double interval = 1 * NSEC_PER_SEC;
-    dispatch_source_set_timer(timerSource, dispatch_time(DISPATCH_TIME_NOW, interval), interval, 0);
-    __weak typeof(self) weakself = self;
-    dispatch_source_set_event_handler(timerSource, ^{
-        [weakself callTimer];
-    });
-    dispatch_resume(_timerSource);
-}
-
-- (void)endTimer {
-    if(_timerSource) dispatch_source_cancel(_timerSource);
-    _timerSource = nil;
-}
-
-- (void)callTimer {
-    NSLog(@"[callTimer] background time remain: %f", [UIApplication sharedApplication].backgroundTimeRemaining);
-    //TODO: optimeze the logic for background session
-    if ([UIApplication sharedApplication].backgroundTimeRemaining < 15 && !_bgRCSBlock) {
-        NSLog(@"[callTimer] background time will up, need to call completed hander!");
-        __weak typeof(self) weakSelf = self;
-        _bgRCSBlock = ^{
-            [weakSelf endBGCompletedHandler];
-        };
-        [self prepareRecreateSession];
-    }
-}
-
-- (void)callBgCompletedHandler {
-    if (self.completedHandler) {
-        self.completedHandler();
-        self.completedHandler = nil;
-    }
-}
-
-- (void)endBGCompletedHandler{
-    
-    if(!self.completedHandler) return;
-    [self.bgRCSTasks.copy enumerateObjectsUsingBlock:^(YCDownloadTask *obj, NSUInteger idx, BOOL * _Nonnull stop) {
-        [self resumeTask:obj];
-        NSLog(@"[session invalidated] fix pass!");
-    }];
-    [self.bgRCSTasks removeAllObjects];
-    [self endTimer];
-    [self callBgCompletedHandler];
-}
-
--(void)addCompletionHandler:(BGCompletedHandler)handler identifier:(NSString *)identifier{
-    if ([[self backgroundSessionIdentifier] isEqualToString:identifier]) {
-        self.completedHandler = handler;
-        //fix a crash in backgroud. for:  reason: backgroundDownload owner pid:252 preventSuspend  preventThrottleDownUI  preventIdleSleep  preventSuspendOnSleep
-        [self startTimer];
-    }
-}
-
-#pragma mark - NSURLSession delegate
-
-- (void)URLSession:(NSURLSession *)session didBecomeInvalidWithError:(nullable NSError *)error {
-    if (self.isNeedCreateSession) {
-        self.isNeedCreateSession = false;
-        [self recreateSession];
-        if (_bgRCSBlock) {
-            _bgRCSBlock();
-            _bgRCSBlock = nil;
-        }
-    }
-}
-
-- (NSInteger)statusCodeWithDownloadTask:(NSURLSessionDownloadTask *)downloadTask {
-    if ([downloadTask.response isKindOfClass:[NSHTTPURLResponse class]]) {
-        NSHTTPURLResponse *response = (NSHTTPURLResponse *)downloadTask.response;
-        return response.statusCode;
-    }
-    return -1;
-}
-
-- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location {
-    YCDownloadTask *task = [self taskWithSessionTask:downloadTask];
-
-    NSInteger statusCode = [self statusCodeWithDownloadTask:downloadTask];
-    if (!(statusCode == 200 || statusCode == 206)) {
-        task.downloadedSize = 0;
-        NSLog(@"[didFinishDownloadingToURL] http status code error: %ld", (long)statusCode);
-        //NSError *error = [NSError errorWithDomain:@"http status code error" code:11002 userInfo:nil];
-        NSError *error = [NSError errorWithDomain:@"http status code error" code:statusCode userInfo:nil];
-        [self completionDownloadTask:task localPath:nil error:error];
-        return;
-    }
-    
-    NSString *localPath = [location path];
-    if (task.fileSize==0) [task updateTask];
-    int64_t fileSize = [YCDownloadUtils fileSizeWithPath:localPath];
-    NSError *error = nil;
-    if (fileSize>0 && fileSize != task.fileSize) {
-        NSString *errStr = [NSString stringWithFormat:@"[YCDownloader didFinishDownloadingToURL] fileSize Error, task fileSize: %lld tmp fileSize: %lld", task.fileSize, fileSize];
-        NSLog(@"%@",errStr);
-        error = [NSError errorWithDomain:errStr code:11001 userInfo:nil];
-        localPath = nil;
-    }else{
-        task.downloadedSize = fileSize;
-    }
-    [self completionDownloadTask:task localPath:localPath error:error];
-}
-
-- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite {
-    NSInteger statusCode = [self statusCodeWithDownloadTask:downloadTask];
-    
-    if (!(statusCode == 200 || statusCode == 206)) {
-        //hxd add 20240605
-        NSError *error = [NSError errorWithDomain:@"http status code error" code:statusCode userInfo:nil];
-        YCDownloadTask *task = [self taskWithSessionTask:downloadTask];
-        [self completionDownloadTask:task localPath:nil error:error];
-        return;
-    }
-    YCDownloadTask *task = [self taskWithSessionTask:downloadTask];
-    if (!task) {
-        [downloadTask cancel];
-        NSAssert(false,@"didWriteData task nil!");
-    }
-    task.downloadedSize = totalBytesWritten;
-    if(task.fileSize==0) [task updateTask];
-    task.progress.totalUnitCount = totalBytesExpectedToWrite>0 ? totalBytesExpectedToWrite : task.fileSize;
-    task.progress.completedUnitCount = totalBytesWritten;
-    if(task.progressHandler) task.progressHandler(task.progress, task);
-}
-
-- (void)URLSession:(NSURLSession *)session task:(NSURLSessionDownloadTask *)downloadTask didCompleteWithError:(NSError *)error {
-    if (!error) return;
-    YCDownloadTask *task = [self taskWithSessionTask:downloadTask];
-    if(task.isDeleted) return;
-    // check whether resume data are available
-    NSData *resumeData = [error.userInfo objectForKey:NSURLSessionDownloadTaskResumeData];
-    if (resumeData) {
-        //can resume
-        if (YC_DEVICE_VERSION >= 11.0f && YC_DEVICE_VERSION < 11.2f) {
-            //修正iOS11 多次暂停继续 文件大小不对的问题
-            resumeData = [YCResumeData cleanResumeData:resumeData];
-        }
-        //通过之前保存的resumeData,获取断点的NSURLSessionTask,调用resume恢复下载
-        task.resumeData = resumeData;
-        id resumeDataObj = [NSPropertyListSerialization propertyListWithData:resumeData options:0 format:0 error:nil];
-        if ([resumeDataObj isKindOfClass:[NSDictionary class]]) {
-            NSDictionary *resumeDict = resumeDataObj;
-            task.tmpName = [resumeDict valueForKey:@"NSURLSessionResumeInfoTempFileName"];
-        }
-        task.resumeData = resumeData;
-        [self saveDownloadTask:task];
-        [self removeMembCacheTask:downloadTask task:task];
-        task.downloadTask = nil;
-    }else{
-        //cannot resume
-        NSLog(@"[didCompleteWithError] : %@",error);
-        [self completionDownloadTask:task localPath:nil error:error];
-    }
-}
-
-@end

+ 0 - 61
创维盒子/Pods/YCDownloadSession/YCDownloadSession/YCDownloadItem.h

@@ -1,61 +0,0 @@
-//
-//  YCDownloadItem.h
-//  YCDownloadSession
-//
-//  Created by wz on 17/7/28.
-//  Copyright © 2017年 onezen.cc. All rights reserved.
-//  Contact me: http://www.onezen.cc/about/
-//  Github:     https://github.com/onezens/YCDownloadSession
-//
-
-#import <Foundation/Foundation.h>
-#import "YCDownloadTask.h"
-@class YCDownloadItem;
-
-extern NSString * const kDownloadTaskFinishedNoti;
-extern NSString * const kDownloadTaskDownloadingNoti;
-typedef NS_ENUM(NSUInteger, YCDownloadStatus) {
-    YCDownloadStatusUnknow,
-    YCDownloadStatusWaiting,
-    YCDownloadStatusDownloading,
-    YCDownloadStatusPaused,
-    YCDownloadStatusFailed,
-    YCDownloadStatusFinished
-};
-
-@protocol YCDownloadItemDelegate <NSObject>
-
-@optional
-- (void)downloadItemStatusChanged:(nonnull YCDownloadItem *)item;
-- (void)downloadItem:(nonnull YCDownloadItem *)item downloadedSize:(int64_t)downloadedSize totalSize:(int64_t)totalSize;
-- (void)downloadItem:(nonnull YCDownloadItem *)item speed:(NSUInteger)speed speedDesc:(NSString *)speedDesc;
-@end
-
-@interface YCDownloadItem : NSObject
-
--(nonnull instancetype)initWithUrl:(nonnull NSString *)url fileId:(nullable NSString *)fileId;
-+(nonnull instancetype)itemWithUrl:(nonnull NSString *)url fileId:(nullable NSString *)fileId;
-
-@property (nonatomic, copy, nonnull) NSString *taskId;
-@property (nonatomic, copy, readonly, nullable) NSString *fileId;
-@property (nonatomic, copy, readonly, nonnull) NSString *downloadURL;
-@property (nonatomic, copy, readonly, nonnull) NSString *version;
-@property (nonatomic, assign, readonly) int64_t fileSize;
-@property (nonatomic, assign, readonly) int64_t downloadedSize;
-@property (nonatomic, weak, nullable) id <YCDownloadItemDelegate> delegate;
-@property (nonatomic, assign) BOOL enableSpeed;
-@property (nonatomic, strong, nullable) NSData *extraData;
-@property (nonatomic, assign, readwrite) YCDownloadStatus downloadStatus;
-@property (nonatomic, copy, readonly, nullable) YCProgressHandler progressHandler;
-@property (nonatomic, copy, readonly, nullable) YCCompletionHandler completionHandler;
-/**
- 下载的文件在沙盒保存的类型,默认为video.可指定为pdf,image,等自定义类型
- */
-@property (nonatomic, copy, nullable) NSString *fileType;
-@property (nonatomic, copy, nullable) NSString *uid;
-@property (nonatomic, copy, nonnull) NSString *saveRootPath;
-/**文件沙盒保存路径*/
-@property (nonatomic, copy, readonly, nonnull) NSString *savePath;
-
-@end
-

+ 0 - 255
创维盒子/Pods/YCDownloadSession/YCDownloadSession/YCDownloadItem.m

@@ -1,255 +0,0 @@
-//
-//  YCDownloadItem.m
-//  YCDownloadSession
-//
-//  Created by wz on 17/7/28.
-//  Copyright © 2017年 onezen.cc. All rights reserved.
-//  Contact me: http://www.onezen.cc/about/
-//  Github:     https://github.com/onezens/YCDownloadSession
-//
-
-#import "YCDownloadItem.h"
-#import "YCDownloadUtils.h"
-#import "YCDownloadDB.h"
-
-NSString * const kDownloadTaskFinishedNoti = @"kDownloadTaskFinishedNoti";
-NSString * const kDownloadTaskDownloadingNoti = @"kDownloadTaskDownloadingNoti";
-
-@interface YCDownloadTask(Downloader)
-@property (nonatomic, strong) NSURLSessionDownloadTask *downloadTask;
-@end
-
-@interface YCDownloadItem()
-@property (nonatomic, copy) NSString *rootPath;
-@property (nonatomic, assign) NSInteger pid;
-@property (nonatomic, assign) BOOL isRemoved;
-@property (nonatomic, assign) BOOL noNeedStartNext;
-@property (nonatomic, copy) NSString *fileExtension;
-@property (nonatomic, assign, readonly) NSUInteger createTime;
-@property (nonatomic, assign) uint64_t preDSize;
-@property (nonatomic, strong) NSTimer *speedTimer;
-@end
-
-@implementation YCDownloadItem
-
-#pragma mark - init
-
-- (instancetype)initWithPrivate{
-    if (self = [super init]) {
-        _createTime = [YCDownloadUtils sec_timestamp];
-        _version = [YCDownloadTask downloaderVerison];
-    }
-    return self;
-}
-
-- (instancetype)initWithUrl:(NSString *)url fileId:(NSString *)fileId {
-    if (self = [self initWithPrivate]) {
-        _downloadURL = url;
-        _fileId = fileId;
-    }
-    return self;
-}
-+ (instancetype)itemWithDict:(NSDictionary *)dict {
-    YCDownloadItem *item = [[YCDownloadItem alloc] initWithPrivate];
-    [item setValuesForKeysWithDictionary:dict];
-    return item;
-}
-+ (instancetype)itemWithUrl:(NSString *)url fileId:(NSString *)fileId {
-    return [[YCDownloadItem alloc] initWithUrl:url fileId:fileId];
-}
-
-//设置一个变量 让下载通知不要发那么频发
-static int  YCDownloadingNotI = 0;
-#pragma mark - Handler
-- (void)downloadProgress:(YCDownloadTask *)task downloadedSize:(int64_t)downloadedSize fileSize:(int64_t)fileSize {
-    
-    NSLog(@"下载中:%@",task.downloadURL);
-    
-    if (self.fileSize==0)  _fileSize = fileSize;
-    if (!self.fileExtension) [self setFileExtensionWithTask:task];
-    _downloadedSize = downloadedSize;
-    if ([self.delegate respondsToSelector:@selector(downloadItem:downloadedSize:totalSize:)]) {
-        [self.delegate downloadItem:self downloadedSize:downloadedSize totalSize:fileSize];
-    }
-    
-    //hxd add not 20240603
-    if(YCDownloadingNotI == 0){
-        [[NSNotificationCenter defaultCenter] postNotificationName:kDownloadTaskDownloadingNoti object:self];
-    }
-    else if(YCDownloadingNotI >= 10){
-        YCDownloadingNotI = 0;
-        return;
-    }
-    
-    YCDownloadingNotI++;
-}
-
-- (void)downloadStatusChanged:(YCDownloadStatus)status downloadTask:(YCDownloadTask *)task {
-    _downloadStatus = status;
-    if ([self.delegate respondsToSelector:@selector(downloadItemStatusChanged:)]) {
-        [self.delegate downloadItemStatusChanged:self];
-    }
-    //通知优先级最后,不与上面的finished重合
-    if (status == YCDownloadStatusFinished || status == YCDownloadStatusFailed) {
-        [YCDownloadDB saveItem:self];
-        [[NSNotificationCenter defaultCenter] postNotificationName:kDownloadTaskFinishedNoti object:self];
-    }
-    [self calculaterSpeedWithStatus:status];
-}
-
-- (void)speedTimerRun {
-    uint64_t size = self.downloadedSize> self.preDSize ? self.downloadedSize - self.preDSize : 0;
-    if (size == 0) {
-        [self.delegate downloadItem:self speed:0 speedDesc:@"0KB/s"];
-    }else{
-        NSString *ss = [NSString stringWithFormat:@"%@/s",[YCDownloadUtils fileSizeStringFromBytes:size]];
-        [self.delegate downloadItem:self speed:size speedDesc:ss];
-    }
-    self.preDSize = self.downloadedSize;
-    //NSLog(@"[speedTimerRun] %@ dsize: %llu pdsize: %llu", ss, self.downloadedSize, self.preDownloadedSize);
-}
-
-- (void)invalidateSpeedTimer {
-    [self.speedTimer invalidate];
-    self.speedTimer = nil;
-}
-
-- (void)calculaterSpeedWithStatus:(YCDownloadStatus)status {
-    //计算下载速度
-    if (!self.enableSpeed) return;
-    if (status != YCDownloadStatusDownloading) {
-        [self invalidateSpeedTimer];
-        [self.delegate downloadItem:self speed:0 speedDesc:@"0KB/s"];
-    }else{
-        [self.speedTimer fire];
-    }
-}
-
-#pragma mark - getter & setter
-
-- (void)setDownloadStatus:(YCDownloadStatus)downloadStatus {
-    _downloadStatus = downloadStatus;
-    if ([self.delegate respondsToSelector:@selector(downloadItemStatusChanged:)]) {
-        [self.delegate downloadItemStatusChanged:self];
-    }
-    [self calculaterSpeedWithStatus:downloadStatus];
-}
-
-- (void)setSaveRootPath:(NSString *)saveRootPath {
-    NSString *path = [saveRootPath stringByReplacingOccurrencesOfString:NSHomeDirectory() withString:@""];
-    _rootPath = path;
-}
-
-- (NSString *)saveRootPath {
-    NSString *rootPath = self.rootPath;
-    if(!rootPath){
-        rootPath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, true).firstObject;
-        rootPath = [rootPath stringByAppendingPathComponent:@"YCDownload"];
-    }else{
-        rootPath = [NSHomeDirectory() stringByAppendingPathComponent:rootPath];
-    }
-    return rootPath;
-}
-
-
-- (void)setFileExtensionWithTask:(YCDownloadTask *)task {
-    NSURLResponse *oriResponse =task.downloadTask.response;
-    if ([oriResponse isKindOfClass:[NSHTTPURLResponse class]]) {
-        NSHTTPURLResponse *response = (NSHTTPURLResponse *)oriResponse;
-        NSString *extension = [[response.allHeaderFields valueForKey:@"Content-Type"] componentsSeparatedByString:@"/"].lastObject;
-        if ([extension containsString:@";"]) {
-            extension = [extension componentsSeparatedByString:@";"].firstObject;
-        }
-        if(extension.length==0) extension = response.suggestedFilename.pathExtension;
-        _fileExtension = extension;
-    }else{
-        NSLog(@"[warning] downloadTask response class type error: %@", oriResponse);
-    }
-}
-
-- (YCProgressHandler)progressHandler {
-    __weak typeof(self) weakSelf = self;
-    return ^(NSProgress *progress, YCDownloadTask *task){
-        if(weakSelf.downloadStatus == YCDownloadStatusWaiting){
-            [weakSelf downloadStatusChanged:YCDownloadStatusDownloading downloadTask:nil];
-        }
-        [weakSelf downloadProgress:task downloadedSize:progress.completedUnitCount fileSize:(progress.totalUnitCount>0 ? progress.totalUnitCount : 0)];
-    };
-}
-
-- (YCCompletionHandler)completionHandler {
-    __weak typeof(self) weakSelf = self;
-    return ^(NSString *localPath, NSError *error){
-        YCDownloadTask *task = [YCDownloadDB taskWithTid:self.taskId];
-        if (error) {
-            NSLog(@"[Item completionHandler] error : %@", error);
-            [weakSelf downloadStatusChanged:YCDownloadStatusFailed downloadTask:nil];
-            if(!weakSelf.isRemoved) [YCDownloadDB saveItem:weakSelf];
-            return ;
-        }
-        
-        // bg completion ,maybe had no extension
-        if (!self.fileExtension) [self setFileExtensionWithTask:task];
-        NSError *saveError = nil;
-        if([[NSFileManager defaultManager] fileExistsAtPath:self.savePath]){
-            NSLog(@"[Item completionHandler] Warning file Exist at path: %@ and replaced it!", weakSelf.savePath);
-            [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil];
-        }
-        
-        if([[NSFileManager defaultManager] moveItemAtPath:localPath toPath:self.savePath error:&saveError]){
-            NSAssert(self.fileExtension, @"file extension can not nil!");
-            int64_t fileSize = [YCDownloadUtils fileSizeWithPath:weakSelf.savePath];
-            self->_downloadedSize = fileSize;
-            self->_fileSize = fileSize;
-            [weakSelf downloadStatusChanged:YCDownloadStatusFinished downloadTask:nil];
-        }else{
-            [weakSelf downloadStatusChanged:YCDownloadStatusFailed downloadTask:nil];
-            NSLog(@"[Item completionHandler] move file failed error: %@ \nlocalPath: %@ \nsavePath:%@", saveError,localPath,self.savePath);
-        }
-        
-    };
-}
-
-- (NSTimer *)speedTimer {
-    if (!_speedTimer) {
-        
-        //_speedTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(speedTimerRun) userInfo:nil repeats:true];
-    }
-    return _speedTimer;
-}
-
-#pragma mark - public
-
-- (NSString *)compatibleKey {
-    return [YCDownloadTask downloaderVerison];
-}
-
-- (NSString *)saveUidDirectory {
-    return [[self saveRootPath] stringByAppendingPathComponent:self.uid];
-}
-
-- (NSString *)saveDirectory {
-    NSString *path = [self saveUidDirectory];
-    path = [path stringByAppendingPathComponent:(self.fileType ? self.fileType : @"data")];
-    [YCDownloadUtils createPathIfNotExist:path];
-    return path;
-}
-
-- (NSString *)saveName {
-    NSString *saveName = self.fileId ? self.fileId : self.taskId;
-    return [saveName stringByAppendingPathExtension: self.fileExtension.length>0 ? self.fileExtension : @"data"];
-}
-
-- (NSString *)savePath {
-    return [[self saveDirectory] stringByAppendingPathComponent:[self saveName]];
-}
-
-- (NSString *)description {
-    return [NSString stringWithFormat:@"<YCDownloadTask: %p>{taskId: %@, url: %@ fileId: %@}", self, self.taskId, self.downloadURL, self.fileId];
-}
-
--(void)dealloc {
-    [self invalidateSpeedTimer];
-}
-
-@end

+ 0 - 164
创维盒子/Pods/YCDownloadSession/YCDownloadSession/YCDownloadManager.h

@@ -1,164 +0,0 @@
-//
-//  YCDownloadManager.h
-//  YCDownloadSession
-//
-//  Created by wz on 17/3/24.
-//  Copyright © 2017年 onezen.cc. All rights reserved.
-//  Contact me: http://www.onezen.cc/about/
-//  Github:     https://github.com/onezens/YCDownloadSession
-//
-
-
-#import <UIKit/UIKit.h>
-#import "YCDownloadItem.h"
-#import "YCDownloader.h"
-
-@interface YCDConfig: NSObject
-/**
- 设置用户标识
- */
-@property (nonatomic, copy, nullable) NSString *uid;
-
-/**
- 文件保存根路径,默认是Library/Cache/YCDownload目录,系统磁盘不足时,会被系统清理
- 更多信息:https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW2
- */
-@property (nonatomic, copy, nullable) NSString *saveRootPath;
-
-/**
- 最大下载任务个数
- */
-@property (nonatomic, assign) NSUInteger maxTaskCount;
-
-
-@property (nonatomic, assign) YCDownloadTaskCacheMode taskCachekMode;
-
-/**
- 冷启动是否自动恢复下载中的任务,否则会暂停所有任务
- */
-@property (nonatomic, assign) BOOL launchAutoResumeDownload;
-
-@end
-
-
-@interface YCDownloadManager : NSObject
-
-/**
- 下载管理配置
- */
-+ (void)mgrWithConfig:(nonnull YCDConfig *)config;
-
-
-/**
- 切换用户,更新uid
- */
-+ (void)updateUid:(NSString *)uid;
-
-/**
- 开始/创建一个后台下载任务。
- 
- @param item 下载信息的item
- */
-+ (void)startDownloadWithItem:(nonnull YCDownloadItem *)item;
-
-/**
- 开始/创建一个后台下载任务。
- 
- @param item 下载信息的item
- @param priority 下载任务的task,默认:NSURLSessionTaskPriorityDefault 可选参数:NSURLSessionTaskPriorityLow  NSURLSessionTaskPriorityHigh NSURLSessionTaskPriorityDefault 范围:0.0-1.1
- */
-+ (void)startDownloadWithItem:(nonnull YCDownloadItem *)item priority:(float)priority;
-
-
-/**
- 开始/创建一个后台下载任务。
-
- @param downloadURLString 下载的资源的url
- */
-+ (void)startDownloadWithUrl:(nonnull NSString *)downloadURLString;
-
-/**
- 开始/创建一个后台下载任务。
- 
- @param downloadURLString 下载的资源的url, 不可以为空
- @param fileId 非资源的标识,可以为空,用作下载文件保存的名称
- @param priority 下载任务的task,默认:NSURLSessionTaskPriorityDefault 可选参数:NSURLSessionTaskPriorityLow  NSURLSessionTaskPriorityHigh NSURLSessionTaskPriorityDefault 范围:0.0-1.1
- @param extraData item对应的需要存储在本地数据库中的信息
- */
-+ (void)startDownloadWithUrl:(nonnull NSString *)downloadURLString fileId:(nullable NSString *)fileId  priority:(float)priority extraData:(nullable NSData *)extraData;
-
-/**
- 暂停一个后台下载任务
- 
- @param item 创建的下载任务item
- */
-+ (void)pauseDownloadWithItem:(nonnull YCDownloadItem *)item;
-
-/**
- 继续开始一个后台下载任务
- 
- @param item 创建的下载任务item
- */
-+ (void)resumeDownloadWithItem:(nonnull YCDownloadItem *)item;
-
-/**
- 删除一个后台下载任务,同时会删除当前任务下载的缓存数据
- 
- @param item 创建的下载任务item
- */
-+ (void)stopDownloadWithItem:(nonnull YCDownloadItem *)item;
-
-/**
- 暂停所有的下载
- */
-+ (void)pauseAllDownloadTask;
-
-/**
- 开始所有的下载
- */
-+ (void)resumeAllDownloadTask;
-
-/**
- 清空所有的下载文件缓存,YCDownloadManager所管理的所有文件,不包括YCDownloadSession单独下载的文件
- */
-+ (void)removeAllCache;
-
-/**
- 获取所有的未完成的下载item
- */
-+ (nonnull NSArray *)downloadList;
-
-/**
- 获取所有已完成的下载item
- */
-+ (nonnull NSArray *)finishList;
-
-/**
- 根据fileId获取item
- */
-+ (nullable YCDownloadItem *)itemWithFileId:(NSString *)fid;
-
-/**
- 根据downloadUrl获取item
- */
-+ (nonnull NSArray *)itemsWithDownloadUrl:(nonnull NSString *)downloadUrl;
-
-/**
- 获取所有下载数据所占用的磁盘空间,不包括YCDownloadSession单独下载的文件
- */
-+ (int64_t)videoCacheSize;
-
-/**
- 是否允许蜂窝煤网络下载,以及网络状态变为蜂窝煤是否允许下载,必须把所有的downloadTask全部暂停,然后重新创建。否则,原先创建的
- 下载task依旧在网络切换为蜂窝煤网络时会继续下载
- 
- @param isAllow 是否允许蜂窝煤网络下载
- */
-+ (void)allowsCellularAccess:(BOOL)isAllow;
-
-/**
- 获取是否允许蜂窝煤访问
- */
-+ (BOOL)isAllowsCellularAccess;
-
-@end

+ 0 - 420
创维盒子/Pods/YCDownloadSession/YCDownloadSession/YCDownloadManager.m

@@ -1,420 +0,0 @@
-//
-//  YCDownloadManager.m
-//  YCDownloadSession
-//
-//  Created by wz on 17/3/24.
-//  Copyright © 2017年 onezen.cc. All rights reserved.
-//  Contact me: http://www.onezen.cc/about/
-//  Github:     https://github.com/onezens/YCDownloadSession
-//
-
-#import "YCDownloadManager.h"
-#import "YCDownloadUtils.h"
-#import "YCDownloader.h"
-#import "YCDownloadDB.h"
-
-#define YCDownloadMgr [YCDownloadManager manager]
-
-@interface YCDownloader(Mgr)
-- (void)endBGCompletedHandler;
-@end
-
-
-@interface YCDownloadItem(Mgr)
-@property (nonatomic, assign) BOOL isRemoved;
-@property (nonatomic, assign) BOOL noNeedStartNext;
-@end
-
-@interface YCDownloadManager ()
-{
-    NSString *_uniqueId;
-}
-@property (nonatomic, strong) NSMutableArray <YCDownloadItem *> *waitItems;
-@property (nonatomic, strong) NSMutableArray <YCDownloadItem *> *runItems;
-@property (nonatomic, strong) YCDConfig *config;
-@end
-
-@implementation YCDownloadManager
-
-static id _instance;
-
-#pragma mark - init
-
-+ (void)mgrWithConfig:(YCDConfig *)config {
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        _instance = [[self alloc] init];
-        YCDownloadMgr.config = config;
-        [YCDownloadMgr initManager];
-    });
-}
-
-+ (instancetype)manager {
-    NSAssert(_instance, @"please set config: [YCDownloadManager mgrWithConfig:config];");
-    return _instance;
-}
-
-- (instancetype)init {
-    if (self = [super init]) {
-        [self addNotification];
-        _runItems  = [NSMutableArray array];
-        _waitItems = [NSMutableArray array];
-    }
-    return self;
-}
-
-- (void)initManager{
-    [self setUid:self.config.uid];
-    [YCDownloader downloader].taskCachekMode = self.config.taskCachekMode;
-    [self restoreItems];
-}
-
-- (void)addNotification {
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(downloadTaskFinishNoti:) name:kDownloadTaskFinishedNoti object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillTerminate) name:UIApplicationWillTerminateNotification object:nil];
-}
-
-- (void)restoreItems {
-    [[YCDownloadDB fetchAllDownloadItemWithUid:self.uid] enumerateObjectsUsingBlock:^(YCDownloadItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-        [self downloadFinishedWithItem:obj];
-        YCDownloadTask *task = [self taskWithItem:obj];
-        if (obj.downloadStatus == YCDownloadStatusDownloading || ( task.isRunning && self.config.launchAutoResumeDownload)) {
-            obj.downloadStatus = YCDownloadStatusDownloading;
-            task.completionHandler = obj.completionHandler;
-            task.progressHandler = obj.progressHandler;
-            if (task.state != NSURLSessionTaskStateRunning) {
-                obj.downloadStatus = YCDownloadStatusPaused;
-            }
-            [self.runItems addObject:obj];
-        }
-        if(self.config.launchAutoResumeDownload){
-            if(obj.downloadStatus == YCDownloadStatusWaiting){
-                [self.waitItems addObject:obj];
-            }
-        }else{
-            if (obj.downloadStatus == YCDownloadStatusWaiting || obj.downloadStatus==YCDownloadStatusDownloading) {
-                [self pauseDownloadWithItem:obj];
-            }
-        }
-    }];
-    if (self.config.launchAutoResumeDownload && self.waitItems.count>0) {
-        [self resumeDownloadWithItem:self.waitItems.firstObject];
-    }
-    [YCDownloadDB saveAllData];
-}
-
-#pragma mark - public
-
-+ (void)updateUid:(NSString *)uid {
-    [YCDownloadMgr setUid:uid];
-}
-
-+ (void)startDownloadWithUrl:(NSString *)downloadURLString{
-    [self startDownloadWithUrl:downloadURLString fileId:nil priority:NSURLSessionTaskPriorityDefault extraData:nil];
-}
-
-+ (void)startDownloadWithUrl:(NSString *)downloadURLString fileId:(NSString *)fileId  priority:(float)priority extraData:(NSData *)extraData {
-    [YCDownloadMgr startDownloadWithUrl:downloadURLString fileId:fileId priority:priority extraData:extraData];
-}
-
-+ (void)startDownloadWithItem:(YCDownloadItem *)item {
-    [YCDownloadMgr startDownloadWithItem:item priority:NSURLSessionTaskPriorityDefault];
-}
-
-+ (void)startDownloadWithItem:(YCDownloadItem *)item priority:(float)priority {
-    [YCDownloadMgr startDownloadWithItem:item priority:priority];
-}
-
-
-+ (void)pauseDownloadWithItem:(YCDownloadItem *)item {
-    [YCDownloadMgr pauseDownloadWithItem:item];
-}
-
-+ (void)resumeDownloadWithItem:(YCDownloadItem *)item {
-    [YCDownloadMgr resumeDownloadWithItem:item];
-}
-
-+ (void)stopDownloadWithItem:(YCDownloadItem *)item {
-    [YCDownloadMgr stopDownloadWithItem:item];
-}
-
-+ (void)pauseAllDownloadTask {
-    [YCDownloadMgr pauseAllDownloadTask];
-}
-
-+ (void)resumeAllDownloadTask {
-    [YCDownloadMgr resumeAllDownloadTask];
-}
-
-+ (void)removeAllCache {
-    [YCDownloadMgr removeAllCache];
-}
-
-+ (YCDownloadItem *)itemWithFileId:(NSString *)fid {
-    return [YCDownloadMgr itemWithFileId:fid];
-}
-
-+ (NSArray *)itemsWithDownloadUrl:(NSString *)downloadUrl {
-    return [YCDownloadMgr itemsWithDownloadUrl:downloadUrl];
-}
-
-+ (NSArray *)downloadList {
-    return [YCDownloadDB fetchAllDownloadingItemWithUid:YCDownloadMgr.uid];
-}
-+ (NSArray *)finishList {
-    return [YCDownloadDB fetchAllDownloadedItemWithUid:YCDownloadMgr.uid];
-}
-
-#pragma mark - setter or getter
-
-+(BOOL)isAllowsCellularAccess{
-    return [YCDownloadMgr isAllowsCellularAccess];
-}
-+(void)allowsCellularAccess:(BOOL)isAllow {
-    [YCDownloadMgr allowsCellularAccess:isAllow];
-}
-
-- (void)setUid:(NSString *)uid {
-    if ([_uniqueId isEqualToString:uid]) return;
-    [self pauseAllDownloadTask];
-    _uniqueId = uid;
-}
-
-- (NSString *)uid {
-    return _uniqueId ? : @"YCDownloadUID";
-}
-
-#pragma mark - Handler
-
-- (void)appWillTerminate {
-    [self pauseAllDownloadTask];
-}
-
-- (void)saveDownloadItem:(YCDownloadItem *)item {
-    [YCDownloadDB saveItem:item];
-}
-
-- (void)downloadTaskFinishNoti:(NSNotification *)noti {
-    YCDownloadItem *item = noti.object;
-    [self.runItems removeObject:item];
-    [self startNextDownload];
-    if (self.runItems.count==0 && self.waitItems.count==0) {
-        NSLog(@"[startNextDownload] all download task finished");
-        [[YCDownloader downloader] endBGCompletedHandler];
-    }
-}
-- (void)startNextDownload {
-    YCDownloadItem *item = self.waitItems.firstObject;
-    if (!item) return;
-    [self.waitItems removeObject:item];
-    [self resumeDownloadWithItem:item];
-}
-
-+ (int64_t)videoCacheSize {
-    int64_t size = 0;
-    NSArray *downloadList = [self downloadList];
-    NSArray *finishList = [self finishList];
-    for (YCDownloadTask *task in downloadList) {
-        size += task.downloadedSize;
-    }
-    for (YCDownloadTask *task in finishList) {
-        size += task.fileSize;
-    }
-    return size;
-}
-
-- (BOOL)canResumeDownload {
-    return self.runItems.count<self.config.maxTaskCount;
-}
-
-#pragma mark - private
-
-- (void)startDownloadWithItem:(YCDownloadItem *)item priority:(float)priority{
-    if(!item) return;
-    YCDownloadItem *oldItem = [YCDownloadDB itemWithTaskId:item.taskId];
-    if (oldItem && [self downloadFinishedWithItem:oldItem]) {
-        NSLog(@"[startDownloadWithItem] detect item finished!");
-        [self startNextDownload];
-        return;
-    }
-    item.downloadStatus = YCDownloadStatusWaiting;
-    item.uid = self.uid;
-    item.saveRootPath = self.config.saveRootPath;
-    //item.fileType = item.fileType ? : @"video";
-    item.fileType = item.fileType ? : @"video";
-    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:item.downloadURL]];
-    YCDownloadTask *task = [[YCDownloader downloader] downloadWithRequest:request progress:item.progressHandler completion:item.completionHandler priority:priority];
-    item.taskId = task.taskId;
-    
-    //hxd 20240605 item 修复变多
-    if(oldItem){
-        [YCDownloadDB removeItemWithTaskId:oldItem.taskId];
-    }
-    
-    [YCDownloadDB saveItem:item];
-    [self resumeDownloadWithItem:item];
-}
-
-- (void)startDownloadWithUrl:(NSString *)downloadURLString fileId:(NSString *)fileId  priority:(float)priority extraData:(NSData *)extraData {
-    YCDownloadItem *item = [YCDownloadItem itemWithUrl:downloadURLString fileId:fileId];
-    item.extraData = extraData;
-    [self startDownloadWithItem:item priority:priority];
-}
-
-- (BOOL)downloadFinishedWithItem:(YCDownloadItem *)item {
-    int64_t localFileSize = [YCDownloadUtils fileSizeWithPath:item.savePath];
-    BOOL fileFinished = localFileSize>0 && localFileSize == item.fileSize;
-    if (fileFinished) {
-        [item setValue:@(localFileSize) forKey:@"_downloadedSize"];
-        item.downloadStatus = YCDownloadStatusFinished;
-        return true;
-    }
-    if (item.downloadStatus == YCDownloadStatusFinished){
-        NSLog(@"[downloadFinishedWithItem] status finished to failed, reason: savePath error! %@", item.savePath);
-        item.downloadStatus = YCDownloadStatusFailed;
-    }
-    if ([[NSFileManager defaultManager] fileExistsAtPath:item.savePath]) {
-        [[NSFileManager defaultManager] removeItemAtPath:item.savePath error:nil];
-    }
-    return false;
-}
-
-- (YCDownloadItem *)itemWithTaskId:(NSString *)taskId {
-    return [YCDownloadDB itemWithTaskId:taskId];
-}
-
-- (void)removeItemWithTaskId:(NSString *)taskId {
-    [YCDownloadDB removeItemWithTaskId:taskId];
-}
-
-- (YCDownloadTask *)taskWithItem:(YCDownloadItem *)item {
-    NSAssert(item.taskId, @"item taskid not nil");
-    YCDownloadTask *task = nil;
-    task = [YCDownloadDB taskWithTid:item.taskId];
-    return task;
-}
-
-- (void)resumeDownloadWithItem:(YCDownloadItem *)item{
-    if ([self downloadFinishedWithItem:item]) {
-        NSLog(@"[resumeDownloadWithItem] detect item finished : %@", item);
-        //hxd add 20240605
-        [[NSNotificationCenter defaultCenter] postNotificationName:kDownloadTaskFinishedNoti object:item];
-        
-        [self startNextDownload];
-        return;
-    }
-    if (![self canResumeDownload]) {
-        item.downloadStatus = YCDownloadStatusWaiting;
-        [self.waitItems addObject:item];
-        return;
-    }
-    
-    //hxd add 20240604
-    if(item.downloadedSize == item.fileSize
-       && item.fileSize > 0){
-        item.downloadStatus = YCDownloadStatusFinished;
-        [[NSNotificationCenter defaultCenter] postNotificationName:kDownloadTaskFinishedNoti object:item];
-        return;
-    }
-    
-    item.downloadStatus = YCDownloadStatusDownloading;
-    YCDownloadTask *task = [self taskWithItem:item];
-    task.completionHandler = item.completionHandler;
-    task.progressHandler = item.progressHandler;
-    if([[YCDownloader downloader] resumeTask:task]) {
-        [self.runItems addObject:item];
-        return;
-    }
-    else{//hxd add 20240604 task又是为nil
-        [YCDownloadManager startDownloadWithItem:item];
-    }
-    //[self startDownloadWithItem:item priority:task.priority];
-}
-
-
-- (void)pauseDownloadWithItem:(YCDownloadItem *)item {
-    item.downloadStatus = YCDownloadStatusPaused;
-    YCDownloadTask *task = [self taskWithItem:item];
-    [[YCDownloader downloader] pauseTask:task];
-    [self saveDownloadItem:item];
-    [self.runItems removeObject:item];
-    [self.waitItems removeObject:item];
-    if(!item.noNeedStartNext) [self startNextDownload];
-}
-
-- (void)stopDownloadWithItem:(YCDownloadItem *)item {
-    if (item == nil)  return;
-    item.isRemoved = true;
-    YCDownloadTask *task  = [self taskWithItem:item];
-    [[YCDownloader downloader] cancelTask:task];
-    BOOL isExist = [[NSFileManager defaultManager] fileExistsAtPath:item.savePath];
-    NSLog(@"[remove item] isExist : %d path: %@", isExist, item.savePath);
-    [[NSFileManager defaultManager] removeItemAtPath:item.savePath error:nil];
-    [self removeItemWithTaskId:item.taskId];
-    [YCDownloadDB removeTask:task];
-    [self.runItems removeObject:item];
-    [self.waitItems removeObject:item];
-    if(!item.noNeedStartNext) [self startNextDownload];
-}
-
-- (void)pauseAllDownloadTask {
-    [[YCDownloadDB fetchAllDownloadingItemWithUid:self.uid] enumerateObjectsUsingBlock:^(YCDownloadItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-        if (obj.downloadStatus == YCDownloadStatusWaiting || obj.downloadStatus == YCDownloadStatusDownloading) {
-            obj.noNeedStartNext = true;
-            [self pauseDownloadWithItem:obj];
-        }
-    }];
-}
-
-- (void)removeAllCache {
-    [[YCDownloadDB fetchAllDownloadItemWithUid:self.uid] enumerateObjectsUsingBlock:^(YCDownloadItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-        obj.noNeedStartNext = true;
-        [self stopDownloadWithItem:obj];
-    }];
-}
-
-- (void)resumeAllDownloadTask{
-    NSArray <YCDownloadItem *> *downloading = [YCDownloadDB fetchAllDownloadingItemWithUid:self.uid];
-    [downloading enumerateObjectsUsingBlock:^(YCDownloadItem *item, NSUInteger idx, BOOL * _Nonnull stop) {
-//        if (item.downloadStatus == YCDownloadStatusPaused || item.downloadStatus == YCDownloadStatusFailed) {
-//            [self resumeDownloadWithItem:item];
-//        }
-        
-        //hxd change 20240601
-        if (item.downloadStatus != YCDownloadStatusFinished) {
-            [self resumeDownloadWithItem:item];
-        }
-    }];
-    [YCDownloadDB saveAllData];
-}
-
--(void)allowsCellularAccess:(BOOL)isAllow {
-    [YCDownloader downloader].allowsCellularAccess = isAllow;
-}
-
-- (BOOL)isAllowsCellularAccess {
-    return [YCDownloader downloader].allowsCellularAccess;
-}
-
-- (YCDownloadItem *)itemWithFileId:(NSString *)fid {
-    return [YCDownloadDB itemWithFid:fid uid:self.uid];
-}
-
-- (NSArray *)itemsWithDownloadUrl:(NSString *)downloadUrl {
-    return [YCDownloadDB itemsWithUrl:downloadUrl uid:self.uid];
-}
-
--(void)dealloc {
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-}
-
-@end
-
-
-@implementation YCDConfig
-
-- (NSUInteger)maxTaskCount {
-    return _maxTaskCount ? _maxTaskCount : 1;
-}
-
-@end

+ 3 - 2
创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

@@ -36,6 +36,7 @@
 #import "queryOneShareModel.h"
 #import "boxSaveFileManager.h"
 #import "boxDownloadFileManager.h"
+#import "mixDownloadManager.h"
 
 @interface SceneDelegate ()<SetUsePWDViewControllerDelegate,GuideViewControllerDelegate>
 @property(nonatomic, strong)   CalculatorViewController *calculatorVC;
@@ -790,7 +791,7 @@
     [[backupsFileManager shareInstance] suspendBackupsFileFun];
     
     //frp的下载
-    [YCDownloadManager pauseAllDownloadTask];
+    [[mixDownloadManager shareManager] suspendAllDownloadTask];
     
     NSString *uid =[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn;
     if(uid){
@@ -800,7 +801,7 @@
         uid = @"";
     }
     
-    [YCDownloadManager updateUid:uid];
+    [mixDownloadManager shareManager].uid = uid;
 }
 
 #pragma mark 上报版本号信息

+ 1 - 1
创维盒子/双子星云手机/Class/Set/ChangeDevice/QRCodeScanForChangeDeviceViewController.m

@@ -281,7 +281,7 @@ bool isDownType22 = YES;
     [[uploadFileManager shareInstance] suspendUploadFileFun:YES withModel:nil];
     [[downloadManager shareInstance] suspendDownloadFileFun:YES withModel:nil];
     [[backupsFileManager shareInstance] suspendBackupsFileFun];
-    [[boxDownloadFileManager shareInstance] suspendDownloadFileFun:YES withModel:nil withItem:nil];
+    [[boxDownloadFileManager shareInstance] suspendDownloadFileFun:YES withModel:nil];
     
     NSString *resStr = resultStr;
     if(resStr.length > 22)

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/mixDownloadManager/mixDownloadQueue.m

@@ -172,7 +172,7 @@
     [self.operations enumerateObjectsUsingBlock:^(mixDownloadOperation * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
         
         mixDownloadOperation *operation = (mixDownloadOperation *)obj;
-        if (operation.currentSize != operation.totalSize) { // 暂停未完成的下载任务
+        if (operation.currentSize != operation.totalSize || operation.currentSize ==0) { // 暂停未完成的下载任务
             if (!operation.dataTask) { // 给plist里的任务添加dataTask 添加到operations
                 operation.dataTask = [self.session mix_downloadDataTaskWithURLString:operation.url startSize:operation.currentSize];
             }

+ 1 - 4
创维盒子/双子星云手机/Class/Set/uploadFile/receiveView/boxDownloadFileRecordCell.h

@@ -7,15 +7,12 @@
 
 #import <UIKit/UIKit.h>
 #import "queryOneShareModel.h"
-//#import "YCDownloadSession.h"
-#import <YCDownloadSession.h>
 NS_ASSUME_NONNULL_BEGIN
 
-@interface boxDownloadFileRecordCell : UITableViewCell<YCDownloadItemDelegate>
+@interface boxDownloadFileRecordCell : UITableViewCell
 @property(nonatomic,strong) ShareFileDataModel * curShareFileDataModel;
 @property (nonatomic,assign) BOOL isEditType;
 @property (nonatomic,assign) BOOL isSelectType;
-@property (nonatomic, strong) YCDownloadItem *item;
 
 @property (nonatomic,copy) void (^didLongPressClick)(void);
 //点击按钮

+ 0 - 7
创维盒子/双子星云手机/Class/Set/uploadFile/receiveView/boxDownloadFileRecordCell.m

@@ -639,10 +639,6 @@
     });
 }
 
-#pragma mark 下载代理
-- (void)downloadItemStatusChanged:(YCDownloadItem *)item {
-    //[self setDownloadStatus:item.downloadStatus];
-}
 
 - (void)downloadItem:(mixDownloadOperation *)model downloadedSize:(int64_t)downloadedSize totalSize:(int64_t)totalSize {
     
@@ -676,8 +672,5 @@
 
 }
 
-- (void)downloadItem:(YCDownloadItem *)item speed:(NSUInteger)speed speedDesc:(NSString *)speedDesc {
-    //self.speedLbl.text = speedDesc;
-}
 
 @end

+ 6 - 106
创维盒子/双子星云手机/Class/Set/uploadFile/receiveView/receiveDownloadRecordTableView.m

@@ -10,7 +10,6 @@
 #import "boxDownloadFileRecordCell.h"
 #import "UIScrollView+EmptyDataSet.h"
 #import "uploadFileRecordTableViewHeadView.h"
-#import <YCDownloadSession.h>
 #import "mixDownloadManager.h"
 
 @interface receiveDownloadRecordTableView()<UITableViewDataSource,UITableViewDelegate,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
@@ -34,7 +33,6 @@
         
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(downloadTaskFinishedNoti:) name:nasDownloadTaskFinishedNotification object:nil];
         
-        //[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(downloadTaskDownloadingNoti:) name:kDownloadTaskDownloadingNoti object:nil];
     }
     return self;
 }
@@ -580,11 +578,11 @@
     
     if(isSuspendType){
         HLog(@"supendDownloadWithUrl");
-        [[boxDownloadFileManager shareInstance] suspendDownloadFileFun:NO withModel:model withItem:cell.item];
+        [[boxDownloadFileManager shareInstance] suspendDownloadFileFun:NO withModel:model];
     }
     else{
         HLog(@"startDownLoadWithUrl");
-        [[boxDownloadFileManager shareInstance] reDownloadFileFunBy:@[model] withAll:NO withItem:cell.item];
+        [[boxDownloadFileManager shareInstance] reDownloadFileFunBy:@[model] withAll:NO];
 
     }
     
@@ -605,7 +603,7 @@
     [[boxDownloadFileManager shareInstance] updataBoxSaveDataInFailBy:model];
     
     boxDownloadFileRecordCell * cell = [self cellForRowAtIndexPath:indexPath];
-    [[boxDownloadFileManager shareInstance] reDownloadFileFunBy:@[model] withAll:NO withItem:cell.item];
+    [[boxDownloadFileManager shareInstance] reDownloadFileFunBy:@[model] withAll:NO];
     
 }
 
@@ -622,7 +620,7 @@
             dataModel.downloadBoxStateType = downloadBoxStateSuspend;
         }
         
-        [[boxDownloadFileManager shareInstance] suspendDownloadFileFun:YES withModel:nil withItem:nil];
+        [[boxDownloadFileManager shareInstance] suspendDownloadFileFun:YES withModel:nil];
         
         [self reloadData];
     }
@@ -632,7 +630,7 @@
             dataModel.downloadBoxStateType = downloadBoxStateDownloadloading;
         }
         
-        [[boxDownloadFileManager shareInstance] reDownloadFileFunBy:nil withAll:YES withItem:nil];
+        [[boxDownloadFileManager shareInstance] reDownloadFileFunBy:nil withAll:YES];
         [self reloadData];
     }
 }
@@ -718,77 +716,6 @@
 }
 
 
-#pragma mark 下载通知
-- (void)downloadTaskDownloadingNoti:(NSNotification *)notification
-{
-    YCDownloadItem *item = notification.object;
-    if(!item)return;
-    
-    if (item.downloadStatus != YCDownloadStatusDownloading) {
-        return;
-    }
-    
-    //解码
-    NSString * urlString = [item.downloadURL stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
-    //HLog(@"下载中:%lld --- %lld \n%@\n%@",downloadedSize,totalSize,urlString,_curShareFileDataModel.fileUrl);
-    
-    boxDownloadFileRecordCell * curCell= nil;
-    
-    for (ShareFileDataModel*model in _downloadingArr) {
-        if([model.fileUrl isEqualToString:urlString]){
-            //model.downloadBoxStateType = downloadBoxStateDownloadloading;
-            model.currentSize = item.downloadedSize;
-            model.curTimeInterval = [[NSDate date] timeIntervalSince1970];
-            
-            NSArray *subViews = [self subviews];
-            
-            for (boxDownloadFileRecordCell *cell in subViews) {
-                if([cell isKindOfClass:[boxDownloadFileRecordCell class]]){
-                    ShareFileDataModel* preModel = cell.curShareFileDataModel;
-                    if(preModel && [preModel.fileUrl isEqualToString:model.fileUrl]){
-                        curCell = cell;
-                        break;
-                    }
-                }
-            }
-            
-            break;
-        }
-    }
-    
-    //[self reloadData];
-    //[self reloadSections:[[NSIndexSet alloc] initWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
-    
-    if(curCell){
-        NSIndexPath *index = [self indexPathForCell:curCell];
-        if(index){
-            [self reloadRowsAtIndexPaths:@[index] withRowAnimation:UITableViewRowAnimationNone];
-        }
-        else{
-            [self reloadData];
-        }
-    }
-    else{
-        [self reloadData];
-    }
-
-}
-
-
-
-//- (void)downloadTaskExeEnd:(NSNotification *)notification
-//{
-//    SGDownloadOperation *model = notification.userInfo.allValues.firstObject;
-//
-//    KWeakSelf
-//    mainBlock(^{
-//        [weakSelf handldDownloadDoneDataBy:model];
-//        [weakSelf handldDownloadDoneToSaveBy:model];
-//        
-//    });
-//    HLog(@"下载成功 %@",model.fileName);
-//}
-
 //- (void)downloadTaskExeError:(NSNotification *)notification
 //{
 //    SGDownloadOperation *model = notification.userInfo.allValues.firstObject;
@@ -812,34 +739,7 @@
     }
     
     //重新下载
-    //[YCDownloadManager resumeAllDownloadTask];
-    
-    NSArray *allDownItemArr = [YCDownloadManager downloadList];
-    //HLog(@"allDownItemArr:%@",allDownItemArr);
-    for (YCDownloadItem *item in allDownItemArr) {
-        //HLog(@"downloadStatus:%ld",item.downloadStatus);
-        if (item.downloadStatus != YCDownloadStatusFailed
-            && item.downloadStatus != YCDownloadStatusFinished
-            && item.downloadStatus != YCDownloadStatusPaused) {
-            //[YCDownloadManager startDownloadWithItem:item];
-            [YCDownloadManager resumeDownloadWithItem:item];
-        }
-        else if (item.downloadStatus == YCDownloadStatusPaused){
-            //查询数据库 看下这个model 是什么状态
-            
-            NSString * urlString = [item.downloadURL stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
-            for (ShareFileDataModel*dataModel in _downloadingArr) {
-                //HLog(@"22222222 %@\n%@",urlString,dataModel.fileUrl);
-                if([urlString isEqualToString:dataModel.fileUrl]){
-                    if(dataModel.downloadBoxStateType != downloadBoxStateSuspend){
-                        [YCDownloadManager resumeDownloadWithItem:item];
-                    }
-                    break;
-                }
-            }
-            
-        }
-    }
+    [[mixDownloadManager shareManager] startAllDownloadTask];
 }
 
 #pragma mark 下载失败数据回调处理

+ 2 - 4
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/boxDownloadFileManager.h

@@ -8,8 +8,6 @@
 #import <Foundation/Foundation.h>
 #import "queryOneShareModel.h"
 #import "uploadFileManager.h"
-#import <YCDownloadSession.h>
-
 #import "mixDownloadManager.h"
 
 NS_ASSUME_NONNULL_BEGIN
@@ -39,9 +37,9 @@ NS_ASSUME_NONNULL_BEGIN
 - (void)beginDownloadFilesByUrls:(NSArray *)urlArr;
 
 #pragma mark 全部暂停 或者暂停某一个
-- (void)suspendDownloadFileFun:(BOOL)isSuspendAll withModel:(ShareFileDataModel*)dataModel withItem:(YCDownloadItem*)item;
+- (void)suspendDownloadFileFun:(BOOL)isSuspendAll withModel:(ShareFileDataModel*)dataModel;
 #pragma mark 重新开始下载 arr 目前只支持一个的情况
-- (void)reDownloadFileFunBy:(NSMutableArray*)arr withAll:(BOOL)isAllType withItem:(YCDownloadItem*)item;
+- (void)reDownloadFileFunBy:(NSMutableArray*)arr withAll:(BOOL)isAllType;
 //- (void)reDownloadFileFunBy:(ShareFileDataModel*)dataModel;
 @end
 

+ 61 - 130
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/boxDownloadFileManager.m

@@ -39,18 +39,7 @@ static boxDownloadFileManager * cur_boxDownloadFileShareInstance = nil;
 
 - (void)initDownloadManagerFun
 {
-    NSString *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true).firstObject;
-    path = [path stringByAppendingPathComponent:@"download"];
-    YCDConfig *config = [YCDConfig new];
-    config.saveRootPath = path;
-    //config.uid = @"100006";
-    config.uid = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn;
-    HLog(@"%@",config.uid);
-    config.maxTaskCount = 1;
-    config.taskCachekMode = YCDownloadTaskCacheModeKeep;//YCDownloadTaskCacheModeDefault;
-    config.launchAutoResumeDownload = NO;
-    [YCDownloadManager mgrWithConfig:config];
-    [YCDownloadManager allowsCellularAccess:YES];
+    //[mixDownloadManager shareManager]
     
     [self delItemInDoneTaskFun];
 }
@@ -58,61 +47,61 @@ static boxDownloadFileManager * cur_boxDownloadFileShareInstance = nil;
 #pragma mark 删除已经完成和删除文件的任务
 - (void)delItemInDoneTaskFun
 {
-    NSArray *allDownItemArr = [YCDownloadManager downloadList];
-   
-    for (YCDownloadItem *item in allDownItemArr) {
-        if (item.downloadStatus == YCDownloadStatusFinished) {
-            NSString *savePath =  item.savePath;
-            
-            if (![[NSFileManager defaultManager] fileExistsAtPath:savePath]){
-                [YCDownloadManager stopDownloadWithItem:item];
-            }
-        }
-    }
+//    NSArray *allDownItemArr = [YCDownloadManager downloadList];
+//   
+//    for (YCDownloadItem *item in allDownItemArr) {
+//        if (item.downloadStatus == YCDownloadStatusFinished) {
+//            NSString *savePath =  item.savePath;
+//            
+//            if (![[NSFileManager defaultManager] fileExistsAtPath:savePath]){
+//                [YCDownloadManager stopDownloadWithItem:item];
+//            }
+//        }
+//    }
 }
 
 #pragma mark 删除多余的任务 比如数据删除了 但是任务还在
 - (void)checkDownloadTaskFun{
-    NSArray *allDownItemArr = [YCDownloadManager downloadList];
-   
-    NSArray* downloadingArr = nil;
-    NSArray* downloadingFail = nil;
-    if(_databaseArr && _databaseArr.count == 3){
-        downloadingArr = _databaseArr[0];
-        downloadingFail = _databaseArr[2];
-    }
-    
-    for (YCDownloadItem *item in allDownItemArr) {
-        
-        BOOL isNeedStopType = YES;
-        
-        //解码
-        NSString * urlString = [item.downloadURL stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
-        
-        if(downloadingArr && downloadingArr.count > 0){
-            for (ShareFileDataModel*dataModel in downloadingArr) {
-                if([urlString isEqualToString:dataModel.fileUrl]){
-                    isNeedStopType = NO;
-                }
-            }
-        }
-        
-        if(downloadingFail && downloadingFail.count > 0){
-            for (ShareFileDataModel*dataModel in downloadingFail) {
-                if([urlString isEqualToString:dataModel.fileUrl]){
-                    if(item.downloadedSize >0){
-                        isNeedStopType = NO;
-                    }
-                }
-            }
-        }
-        
-        if(isNeedStopType){
-            HLog(@"停止多的下载任务:%@",item.downloadURL);
-            [YCDownloadManager stopDownloadWithItem:item];
-        }
-        
-    }
+//    NSArray *allDownItemArr = [YCDownloadManager downloadList];
+//   
+//    NSArray* downloadingArr = nil;
+//    NSArray* downloadingFail = nil;
+//    if(_databaseArr && _databaseArr.count == 3){
+//        downloadingArr = _databaseArr[0];
+//        downloadingFail = _databaseArr[2];
+//    }
+//    
+//    for (YCDownloadItem *item in allDownItemArr) {
+//        
+//        BOOL isNeedStopType = YES;
+//        
+//        //解码
+//        NSString * urlString = [item.downloadURL stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+//        
+//        if(downloadingArr && downloadingArr.count > 0){
+//            for (ShareFileDataModel*dataModel in downloadingArr) {
+//                if([urlString isEqualToString:dataModel.fileUrl]){
+//                    isNeedStopType = NO;
+//                }
+//            }
+//        }
+//        
+//        if(downloadingFail && downloadingFail.count > 0){
+//            for (ShareFileDataModel*dataModel in downloadingFail) {
+//                if([urlString isEqualToString:dataModel.fileUrl]){
+//                    if(item.downloadedSize >0){
+//                        isNeedStopType = NO;
+//                    }
+//                }
+//            }
+//        }
+//        
+//        if(isNeedStopType){
+//            HLog(@"停止多的下载任务:%@",item.downloadURL);
+//            [YCDownloadManager stopDownloadWithItem:item];
+//        }
+//        
+//    }
 }
 
 //添加保存记录
@@ -281,11 +270,7 @@ static boxDownloadFileManager * cur_boxDownloadFileShareInstance = nil;
         NSString *urlString = dataModel.fileUrl;
         NSString *requestURLEncodedString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
         
-        NSArray *allDownItemArr = [YCDownloadManager itemsWithDownloadUrl:requestURLEncodedString];
-        for (YCDownloadItem *item in allDownItemArr) {
-            [YCDownloadManager stopDownloadWithItem:item];
-        }
-        
+        [[mixDownloadManager shareManager] cancelDownloadWithUrl:requestURLEncodedString];
     }
     
 }
@@ -428,7 +413,7 @@ static boxDownloadFileManager * cur_boxDownloadFileShareInstance = nil;
 }
 
 #pragma mark 全部暂停 或者暂停某一个
-- (void)suspendDownloadFileFun:(BOOL)isSuspendAll withModel:(ShareFileDataModel*)dataModel withItem:(YCDownloadItem*)item
+- (void)suspendDownloadFileFun:(BOOL)isSuspendAll withModel:(ShareFileDataModel*)dataModel
 {
     if(isSuspendAll){//全部暂停
         
@@ -445,36 +430,14 @@ static boxDownloadFileManager * cur_boxDownloadFileShareInstance = nil;
             }
         }
         
-        [YCDownloadManager pauseAllDownloadTask];
+        [[mixDownloadManager shareManager] suspendAllDownloadTask];
     }
     else if(dataModel){//暂停指定任务
         NSString *urlString = dataModel.fileUrl;
         NSString *requestURLEncodedString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
         HLog(@"%@",urlString);
-        if(item && [item.downloadURL isEqualToString:requestURLEncodedString]){
-            [YCDownloadManager pauseDownloadWithItem:item];
-        }
-        else{
-            NSArray *allDownItemArr = [YCDownloadManager itemsWithDownloadUrl:requestURLEncodedString];
         
-            if(allDownItemArr.count == 1){
-                YCDownloadItem *item = allDownItemArr.firstObject;
-                [YCDownloadManager pauseDownloadWithItem:item];
-            }
-            else{
-                HLog(@"%ld\n%@",allDownItemArr.count,allDownItemArr);
-
-                for (YCDownloadItem *item in allDownItemArr) {
-                    if (item.downloadStatus == YCDownloadStatusFinished) {//这里有问题
-                        [YCDownloadManager stopDownloadWithItem:item];
-                    }
-                    else{
-                        [YCDownloadManager pauseDownloadWithItem:item];
-                    }
-                }
-            }
-            
-        }
+        [[mixDownloadManager shareManager] supendDownloadWithUrl:requestURLEncodedString];
         
         //2.修改状态
         if (_databaseArr && _databaseArr.count == 3) {
@@ -496,20 +459,11 @@ static boxDownloadFileManager * cur_boxDownloadFileShareInstance = nil;
 }
 
 #pragma mark 重新开始下载
-- (void)reDownloadFileFunBy:(NSMutableArray*)arr withAll:(BOOL)isAllType withItem:(YCDownloadItem*)item
+- (void)reDownloadFileFunBy:(NSMutableArray*)arr withAll:(BOOL)isAllType
 {
  
     if(isAllType){
-        //[YCDownloadManager resumeAllDownloadTask];
-
-        NSArray *allDownItemArr = [YCDownloadManager downloadList];
-        for (YCDownloadItem *item in allDownItemArr) {
-            if (item.downloadStatus != YCDownloadStatusFailed
-                && item.downloadStatus != YCDownloadStatusFinished) {
-                //[YCDownloadManager startDownloadWithItem:item];
-                [YCDownloadManager resumeDownloadWithItem:item];
-            }
-        }
+        [[mixDownloadManager shareManager] startAllDownloadTask];
         
         if (_databaseArr && _databaseArr.count == 3) {
             NSMutableArray *downloadingArr = _databaseArr[0];
@@ -541,32 +495,9 @@ static boxDownloadFileManager * cur_boxDownloadFileShareInstance = nil;
         NSString *urlString = dataModel.fileUrl;
         NSString *requestURLEncodedString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
         HLog(@"%@",urlString);
-        if (item && [item.downloadURL isEqualToString:requestURLEncodedString]) {
-            [YCDownloadManager resumeDownloadWithItem:item];
-        }
-        else
-        {
-            NSArray *allDownItemArr = [YCDownloadManager itemsWithDownloadUrl:requestURLEncodedString];
-            
-            if(allDownItemArr.count == 0){
-                [self beginDownloadFilesByUrls:arr];
-            }
-            else if(allDownItemArr.count == 1){
-                YCDownloadItem *item = allDownItemArr.firstObject;
-                [YCDownloadManager resumeDownloadWithItem:item];
-            }
-            else{
-                for (YCDownloadItem *item in allDownItemArr) {
-                    if (item.downloadStatus != YCDownloadStatusFinished) {
-                        [YCDownloadManager resumeDownloadWithItem:item];
-                    }
-                    else{
-                        [YCDownloadManager stopDownloadWithItem:item];
-                    }
-                }
-            }
-            
-        }
+        
+        [[mixDownloadManager shareManager] startDownLoadWithUrl:requestURLEncodedString];
+        
     }
 }
 

+ 0 - 1
创维盒子/双子星云手机/CloudPlayer/PlayerViewController.h

@@ -30,7 +30,6 @@
 #import "AudioSessionObject.h"
 #import "addLogObject.h"
 #import "ComontAlretType2ViewController.h"
-#import <YCDownloadSession.h>
 #import "mixDownloadManager.h"
 
 @protocol PlayerViewControllerDelegate <NSObject>