From 02a2934909dcea8146300ca46123d7a243eb17b7 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 4 Jan 2023 19:33:02 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=A4=9A=E5=B7=A5=E4=BD=9C=E7=A9=BA=E9=97=B4=20https:?= =?UTF-8?q?//github.com/siyuan-note/siyuan/issues/4642?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/mobile/kernel.go | 6 +++--- kernel/util/working.go | 3 --- kernel/util/working_mobile.go | 7 +++---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/kernel/mobile/kernel.go b/kernel/mobile/kernel.go index 58c2101ef..411c6a15a 100644 --- a/kernel/mobile/kernel.go +++ b/kernel/mobile/kernel.go @@ -32,16 +32,16 @@ import ( _ "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) } -func StartKernel(container, appDir, workspaceDir, nativeLibDir, privateDataDir, timezoneID, localIPs, lang string) { +func StartKernel(container, appDir, workspaceBaseDir, timezoneID, localIPs, lang string) { SetTimezone(container, appDir, timezoneID) util.Mode = "prod" util.LocalIPs = strings.Split(localIPs, ",") - util.BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, lang) + util.BootMobile(container, appDir, workspaceBaseDir, lang) model.InitConf() go server.Serve(false) diff --git a/kernel/util/working.go b/kernel/util/working.go index c48d5e6f4..e84f8c524 100644 --- a/kernel/util/working.go +++ b/kernel/util/working.go @@ -176,9 +176,6 @@ var ( IconsPath string // 配置目录下的外观目录下的 icons/ 路径 SnippetsPath string // 数据目录下的 snippets/ 路径 - AndroidNativeLibDir string // Android 库路径 - AndroidPrivateDataDir string // Android 私有数据路径 - UIProcessIDs = sync.Map{} // UI 进程 ID IsNewbie bool // 是否是第一次安装 diff --git a/kernel/util/working_mobile.go b/kernel/util/working_mobile.go index 8af63af6f..de565f00f 100644 --- a/kernel/util/working_mobile.go +++ b/kernel/util/working_mobile.go @@ -28,13 +28,14 @@ import ( "github.com/siyuan-note/logging" ) -func BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, lang string) { +func BootMobile(container, appDir, workspaceBaseDir, lang string) { IncBootProgress(3, "Booting...") rand.Seed(time.Now().UTC().UnixNano()) initMime() initHttpClient() - HomeDir = filepath.Join(workspaceDir, "home") + workspaceDir := filepath.Join(workspaceBaseDir, "siyuan") + HomeDir = filepath.Join(workspaceBaseDir, "home") userHomeConfDir := filepath.Join(HomeDir, ".config", "siyuan") if !gulu.File.IsExist(userHomeConfDir) { os.MkdirAll(userHomeConfDir, 0755) @@ -54,8 +55,6 @@ func BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, l DBPath = filepath.Join(TempDir, DBName) HistoryDBPath = filepath.Join(TempDir, "history.db") BlockTreePath = filepath.Join(TempDir, "blocktree.msgpack") - AndroidNativeLibDir = nativeLibDir - AndroidPrivateDataDir = privateDataDir LogPath = filepath.Join(TempDir, "siyuan.log") logging.SetLogPath(LogPath) AppearancePath = filepath.Join(ConfDir, "appearance")