diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5272b86a..27a8f5b2 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -41,6 +41,7 @@ task("downloadGeoFiles") { "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat" to "geosite.dat", // "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country.mmdb" to "country.mmdb", "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb" to "ASN.mmdb", + "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/BundleMRS.7z" to "BundleMRS.7z", ) doLast { diff --git a/app/src/main/java/com/github/kr328/clash/MainApplication.kt b/app/src/main/java/com/github/kr328/clash/MainApplication.kt index 93f9b74b..9242d722 100644 --- a/app/src/main/java/com/github/kr328/clash/MainApplication.kt +++ b/app/src/main/java/com/github/kr328/clash/MainApplication.kt @@ -68,6 +68,16 @@ class MainApplication : Application() { assets.open("ASN.mmdb").copyTo(it) } } + + val bundleMRSFile = File(clashDir, "BundleMRS.7z") + if (bundleMRSFile.exists() && bundleMRSFile.lastModified() < updateDate) { + bundleMRSFile.delete() + } + if (!bundleMRSFile.exists()) { + FileOutputStream(bundleMRSFile).use { + assets.open("BundleMRS.7z").copyTo(it) + } + } } fun finalize() {