Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Require SQLCipher for mobile kernel builds https://github.com/siyuan-note/siyuan/issues/18034

Danielfa87cdbcfc4c
diff --git a/kernel/harmony/build-win.sh b/kernel/harmony/build-win.sh
index 8ffd1ca0fe..4a09147116 100755
--- a/kernel/harmony/build-win.sh
+++ b/kernel/harmony/build-win.sh
@@ -24,4 +24,4 @@ export GOARCH=amd64
export CGO_CFLAGS="-I${LOG_ADAPTOR_HOME}/include -g -O2 `$LLVMCONFIG --cflags` --target=x86_64-linux-ohos --sysroot=$OHOS_NDK_HOME/native/sysroot"
export CGO_LDFLAGS="--target=x86_64-linux-ohos -fuse-ld=lld -L${LOG_ADAPTOR_HOME}/dist/x86_64"
-go build -tags fts5 -ldflags "-s -w" -buildmode=c-shared -o libkernel.so .
+go build -tags "fts5 sqlcipher" -ldflags "-s -w" -buildmode=c-shared -o libkernel.so .
diff --git a/kernel/harmony/build.sh b/kernel/harmony/build.sh
index 06e82bd35a..ff08f5cf9b 100755
--- a/kernel/harmony/build.sh
+++ b/kernel/harmony/build.sh
@@ -24,5 +24,5 @@ export GOARCH=arm64
export CGO_CFLAGS="-I${LOG_ADAPTOR_HOME}/include -g -O2 `$LLVMCONFIG --cflags` --target=aarch64-linux-ohos --sysroot=$OHOS_NDK_HOME/native/sysroot"
export CGO_LDFLAGS="--target=aarch64-linux-ohos -fuse-ld=lld -L${LOG_ADAPTOR_HOME}/dist/arm64-v8a"
-go build -tags fts5 -ldflags "-s -w" -buildmode=c-shared -o libkernel.so .
-#go build -tags fts5 -buildmode=c-shared -o libkernel.so .
+go build -tags "fts5 sqlcipher" -ldflags "-s -w" -buildmode=c-shared -o libkernel.so .
+#go build -tags "fts5 sqlcipher" -buildmode=c-shared -o libkernel.so .
diff --git a/kernel/harmony/sqlcipher_required.go b/kernel/harmony/sqlcipher_required.go
new file mode 100644
index 0000000000..12077f3a3f
--- /dev/null
+++ b/kernel/harmony/sqlcipher_required.go
@@ -0,0 +1,22 @@
+// SiYuan - Refactor your thinking
+// Copyright (c) 2020-present, b3log.org
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+//go:build android && !sqlcipher && !libsqlcipher
+
+package main
+
+// HarmonyOS 内核必须启用 SQLCipher,否则无法打开加密笔记本。
+var _ = sqlcipher_or_libsqlcipher_build_tag_required
diff --git a/kernel/mobile/sqlcipher_required.go b/kernel/mobile/sqlcipher_required.go
new file mode 100644
index 0000000000..bc09f292b0
--- /dev/null
+++ b/kernel/mobile/sqlcipher_required.go
@@ -0,0 +1,22 @@
+// SiYuan - Refactor your thinking
+// Copyright (c) 2020-present, b3log.org
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+//go:build (android || ios) && !sqlcipher && !libsqlcipher
+
+package mobile
+
+// 移动端内核必须启用 SQLCipher,否则无法打开加密笔记本。
+var _ = sqlcipher_or_libsqlcipher_build_tag_required