mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2024-11-25 23:06:09 +03:00
fix: fix startup crash
This commit is contained in:
parent
ecf03507e6
commit
b091a87a37
@ -38,14 +38,17 @@ class MainApplication : Application() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun extractGeoFiles() {
|
private fun extractGeoFiles() {
|
||||||
val geoipFile = File(filesDir, "clash/geoip.metadb")
|
val clashDir = File(filesDir, "clash")
|
||||||
|
clashDir.mkdirs();
|
||||||
|
|
||||||
|
val geoipFile = File(clashDir, "geoip.metadb")
|
||||||
if(!geoipFile.exists()) {
|
if(!geoipFile.exists()) {
|
||||||
FileOutputStream(geoipFile).use {
|
FileOutputStream(geoipFile).use {
|
||||||
assets.open("geoip.metadb").copyTo(it);
|
assets.open("geoip.metadb").copyTo(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val geositeFile = File(filesDir, "clash/geosite.dat")
|
val geositeFile = File(clashDir, "geosite.dat")
|
||||||
if(!geositeFile.exists()) {
|
if(!geositeFile.exists()) {
|
||||||
FileOutputStream(geositeFile).use {
|
FileOutputStream(geositeFile).use {
|
||||||
assets.open("geosite.dat").copyTo(it);
|
assets.open("geosite.dat").copyTo(it);
|
||||||
|
Loading…
Reference in New Issue
Block a user