Refactor shared

This commit is contained in:
problematicconsumer
2024-01-15 17:17:05 +03:30
parent df98c5cab2
commit 8c90556e6a
9 changed files with 118 additions and 111 deletions

View File

@@ -4,13 +4,13 @@ import (
"encoding/json"
"os"
"github.com/hiddify/libcore/shared"
"github.com/hiddify/libcore/config"
_ "github.com/sagernet/gomobile"
"github.com/sagernet/sing-box/option"
)
func Parse(path string, tempPath string, debug bool) error {
return shared.ParseConfig(path, tempPath, debug)
return config.ParseConfig(path, tempPath, debug)
}
func BuildConfig(path string, configOptionsJson string) (string, error) {
@@ -23,10 +23,10 @@ func BuildConfig(path string, configOptionsJson string) (string, error) {
if err != nil {
return "", err
}
configOptions := &shared.ConfigOptions{}
configOptions := &config.ConfigOptions{}
err = json.Unmarshal([]byte(configOptionsJson), configOptions)
if err != nil {
return "", nil
}
return shared.BuildConfigJson(*configOptions, options)
return config.BuildConfigJson(*configOptions, options)
}