This commit is contained in:
Liang Ding 2023-01-04 19:33:02 +08:00
parent a99cb898c4
commit 02a2934909
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 6 additions and 10 deletions

View file

@ -32,16 +32,16 @@ import (
_ "golang.org/x/mobile/bind" _ "golang.org/x/mobile/bind"
) )
func StartKernelFast(container, appDir, workspaceDir, nativeLibDir, privateDataDir, localIP string) { func StartKernelFast(container, appDir, workspaceBaseDir, localIPs string) {
go server.Serve(true) go server.Serve(true)
} }
func StartKernel(container, appDir, workspaceDir, nativeLibDir, privateDataDir, timezoneID, localIPs, lang string) { func StartKernel(container, appDir, workspaceBaseDir, timezoneID, localIPs, lang string) {
SetTimezone(container, appDir, timezoneID) SetTimezone(container, appDir, timezoneID)
util.Mode = "prod" util.Mode = "prod"
util.LocalIPs = strings.Split(localIPs, ",") util.LocalIPs = strings.Split(localIPs, ",")
util.BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, lang) util.BootMobile(container, appDir, workspaceBaseDir, lang)
model.InitConf() model.InitConf()
go server.Serve(false) go server.Serve(false)

View file

@ -176,9 +176,6 @@ var (
IconsPath string // 配置目录下的外观目录下的 icons/ 路径 IconsPath string // 配置目录下的外观目录下的 icons/ 路径
SnippetsPath string // 数据目录下的 snippets/ 路径 SnippetsPath string // 数据目录下的 snippets/ 路径
AndroidNativeLibDir string // Android 库路径
AndroidPrivateDataDir string // Android 私有数据路径
UIProcessIDs = sync.Map{} // UI 进程 ID UIProcessIDs = sync.Map{} // UI 进程 ID
IsNewbie bool // 是否是第一次安装 IsNewbie bool // 是否是第一次安装

View file

@ -28,13 +28,14 @@ import (
"github.com/siyuan-note/logging" "github.com/siyuan-note/logging"
) )
func BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, lang string) { func BootMobile(container, appDir, workspaceBaseDir, lang string) {
IncBootProgress(3, "Booting...") IncBootProgress(3, "Booting...")
rand.Seed(time.Now().UTC().UnixNano()) rand.Seed(time.Now().UTC().UnixNano())
initMime() initMime()
initHttpClient() initHttpClient()
HomeDir = filepath.Join(workspaceDir, "home") workspaceDir := filepath.Join(workspaceBaseDir, "siyuan")
HomeDir = filepath.Join(workspaceBaseDir, "home")
userHomeConfDir := filepath.Join(HomeDir, ".config", "siyuan") userHomeConfDir := filepath.Join(HomeDir, ".config", "siyuan")
if !gulu.File.IsExist(userHomeConfDir) { if !gulu.File.IsExist(userHomeConfDir) {
os.MkdirAll(userHomeConfDir, 0755) os.MkdirAll(userHomeConfDir, 0755)
@ -54,8 +55,6 @@ func BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, l
DBPath = filepath.Join(TempDir, DBName) DBPath = filepath.Join(TempDir, DBName)
HistoryDBPath = filepath.Join(TempDir, "history.db") HistoryDBPath = filepath.Join(TempDir, "history.db")
BlockTreePath = filepath.Join(TempDir, "blocktree.msgpack") BlockTreePath = filepath.Join(TempDir, "blocktree.msgpack")
AndroidNativeLibDir = nativeLibDir
AndroidPrivateDataDir = privateDataDir
LogPath = filepath.Join(TempDir, "siyuan.log") LogPath = filepath.Join(TempDir, "siyuan.log")
logging.SetLogPath(LogPath) logging.SetLogPath(LogPath)
AppearancePath = filepath.Join(ConfDir, "appearance") AppearancePath = filepath.Join(ConfDir, "appearance")