misc: add update mmdb log

This commit is contained in:
yicheng 2022-06-19 14:57:37 +08:00
parent fd648908fa
commit f80e02b0d9

View File

@ -33,11 +33,13 @@ class ClashResourceManager {
let versionChange = AppVersionUtil.hasVersionChanged || AppVersionUtil.isFirstLaunch
let customMMDBSet = !Settings.mmdbDownloadUrl.isEmpty
if !vaild || (versionChange && customMMDBSet) {
Logger.log("removing new mmdb file")
try? fileManage.removeItem(atPath: destMMDBPath)
}
}
if !fileManage.fileExists(atPath: destMMDBPath) {
Logger.log("installing new mmdb file")
if let mmdbUrl = Bundle.main.url(forResource: "Country.mmdb", withExtension: "gz") {
do {
let data = try Data(contentsOf: mmdbUrl).gunzipped()