feat: Cache file

This commit is contained in:
purofle 2024-02-04 12:11:11 +08:00
parent 86050082fe
commit 0c3c42aa74
2 changed files with 22 additions and 16 deletions

View File

@ -1,11 +1,7 @@
package io.nekohasekai.sagernet.fmt
import android.widget.Toast
import io.nekohasekai.sagernet.IPv6Mode
import io.nekohasekai.sagernet.Key
import io.nekohasekai.sagernet.R
import io.nekohasekai.sagernet.SagerNet
import io.nekohasekai.sagernet.TunImplementation
import io.nekohasekai.sagernet.*
import io.nekohasekai.sagernet.bg.VpnService
import io.nekohasekai.sagernet.database.DataStore
import io.nekohasekai.sagernet.database.ProxyEntity
@ -170,7 +166,12 @@ fun buildConfig(
clash_api = ClashAPIOptions().apply {
external_controller = "127.0.0.1:9090"
external_ui = "../files/yacd"
cache_file = "../cache/clash.db"
}
cache_file = CacheFile().apply {
enabled = true
store_fakeip = true
path = "../cache/clash.db"
}
}

View File

@ -38,6 +38,7 @@ public class SingBoxOptions {
public RouteOptions route;
public ExperimentalOptions experimental;
}
// paste generate output here
@ -56,16 +57,6 @@ public class SingBoxOptions {
public String default_mode;
public Boolean store_mode;
public Boolean store_selected;
public Boolean store_fakeip;
public String cache_file;
public String cache_id;
// Generate note: option type: public List<String> ModeList;
}
@ -304,10 +295,24 @@ public class SingBoxOptions {
public V2RayAPIOptions v2ray_api;
public CacheFile cache_file;
public DebugOptions debug;
}
public static class CacheFile extends SingBoxOption {
public Boolean enabled;
public Boolean store_fakeip;
public String path;
public String cache_id;
}
public static class HysteriaInboundOptions extends SingBoxOption {
// Generate note: nested type ListenOptions