1234567891011121314151617181920212223242526272829303132333435 |
- import UIKit
- let h5_path = "webhtml"
- class H5Manager: NSObject {
-
- class func checkIsUse() -> Bool {
-
- let searchPaths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
- let documentFolderPath = searchPaths[0]
- let dbFilePath = documentFolderPath + "/\(h5_path)/manifest.json"
- let fm = FileManager.default
- let isExist = fm.fileExists(atPath: dbFilePath)
-
- if isExist {
- try! fm.removeItem(atPath: documentFolderPath + "/\(h5_path)")
- print("===delele==\(documentFolderPath + "/\(h5_path)")====success")
- } else {
- }
- try! fm.createDirectory(atPath: documentFolderPath + "/\(h5_path)", withIntermediateDirectories: true, attributes: nil)
- let backupDbPath = Bundle.main.path(forResource: h5_path, ofType: "zip")
- SSZipArchive.unzipFile(atPath: backupDbPath!, toDestination: documentFolderPath + "/\(h5_path)")
- print("==H5 0k==")
- return true
- }
- }
|