Skip to content

Commit

Permalink
feat: Cache file
Browse files Browse the repository at this point in the history
  • Loading branch information
purofle committed Feb 15, 2024
1 parent 8605008 commit 0c3c42a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
13 changes: 7 additions & 6 deletions app/src/main/java/io/nekohasekai/sagernet/fmt/ConfigBuilder.kt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
}
}

Expand Down
25 changes: 15 additions & 10 deletions app/src/main/java/moe/matsuri/nb4a/SingBoxOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public static class MyOptions extends SingBoxOption {
public RouteOptions route;

public ExperimentalOptions experimental;

}

// paste generate output here
Expand All @@ -56,16 +57,6 @@ public static class ClashAPIOptions extends SingBoxOption {

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;

}
Expand Down Expand Up @@ -304,10 +295,24 @@ public static class ExperimentalOptions extends SingBoxOption {

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
Expand Down

0 comments on commit 0c3c42a

Please sign in to comment.