diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 9900007e38..5c266ab220 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -172,6 +172,11 @@
android:configChanges="uiMode"
android:exported="false"
android:label="@string/meta_features" />
+
() {
startActivity(OverrideSettingsActivity::class.intent)
SettingsDesign.Request.StartMetaFeature ->
startActivity(MetaFeatureSettingsActivity::class.intent)
+ SettingsDesign.Request.StartWebDav ->
+ startActivity(WebDavSettingsActivity::class.intent)
}
}
}
diff --git a/app/src/main/java/com/github/kr328/clash/WebDavSettingsActivity.kt b/app/src/main/java/com/github/kr328/clash/WebDavSettingsActivity.kt
new file mode 100644
index 0000000000..3a67e9a7f7
--- /dev/null
+++ b/app/src/main/java/com/github/kr328/clash/WebDavSettingsActivity.kt
@@ -0,0 +1,131 @@
+package com.github.kr328.clash
+
+import com.github.kr328.clash.common.log.Log
+import com.github.kr328.clash.common.util.VergeBackup
+import com.github.kr328.clash.common.util.WebDavClient
+import com.github.kr328.clash.design.R
+import com.github.kr328.clash.design.WebDavSettingsDesign
+import com.github.kr328.clash.design.store.UiStore
+import com.github.kr328.clash.service.model.Profile
+import com.github.kr328.clash.util.withProfile
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.isActive
+import kotlinx.coroutines.selects.select
+import kotlinx.coroutines.withContext
+import java.io.FileNotFoundException
+
+class WebDavSettingsActivity : BaseActivity() {
+ override suspend fun main() {
+ val uiStore = UiStore(this)
+ val design = WebDavSettingsDesign(this, uiStore)
+
+ setContentDesign(design)
+
+ while (isActive) {
+ select {
+ events.onReceive {
+ }
+ design.requests.onReceive {
+ when (it) {
+ WebDavSettingsDesign.Request.Sync -> sync(uiStore, design)
+ }
+ }
+ }
+ }
+ }
+
+ private suspend fun sync(uiStore: UiStore, design: WebDavSettingsDesign) {
+ val url = uiStore.webdavUrl.trim()
+
+ if (url.isEmpty()) {
+ design.showSyncFailed(getString(R.string.webdav_not_configured))
+ return
+ }
+
+ design.setSyncing(true)
+
+ try {
+ val client = WebDavClient(
+ url,
+ uiStore.webdavUsername.trim(),
+ uiStore.webdavPassword.trim()
+ )
+
+ val latest = withContext(Dispatchers.IO) { listLatestBackup(client) }
+ ?: throw FileNotFoundException(getString(R.string.webdav_no_backup))
+
+ val zip = withContext(Dispatchers.IO) { client.download(latest) }
+
+ val remoteProfiles = withContext(Dispatchers.IO) { VergeBackup.parseRemoteProfiles(zip) }
+
+ if (remoteProfiles.isEmpty()) {
+ throw FileNotFoundException(getString(R.string.webdav_no_subscription))
+ }
+
+ val existing = withProfile { queryAll() }
+
+ var updated = 0
+ var created = 0
+ var failed = 0
+
+ for (remote in remoteProfiles) {
+ val match = existing.firstOrNull { it.name == remote.name }
+
+ try {
+ if (match != null) {
+ withProfile {
+ patch(match.uuid, remote.name, remote.url, match.interval, match.ageSecretKey)
+ }
+
+ try {
+ withProfile { commit(match.uuid) }
+ updated++
+ } catch (e: Exception) {
+ runCatching { withProfile { release(match.uuid) } }
+ throw e
+ }
+ } else {
+ val uuid = withProfile {
+ create(Profile.Type.Url, remote.name, remote.url, null)
+ }
+
+ try {
+ withProfile { commit(uuid) }
+ created++
+ } catch (e: Exception) {
+ runCatching { withProfile { delete(uuid) } }
+ throw e
+ }
+ }
+ } catch (e: Exception) {
+ failed++
+
+ Log.w("Sync profile ${remote.name} failed", e)
+ }
+ }
+
+ uiStore.webdavLastSync = (System.currentTimeMillis() / 1000).toInt()
+
+ design.showSyncResult(updated, created, failed)
+ } catch (e: Exception) {
+ Log.w("WebDAV sync failed", e)
+
+ design.showSyncFailed(e.message ?: e.javaClass.simpleName)
+ } finally {
+ design.setSyncing(false)
+ }
+ }
+
+ // Verge stores backups in a "clash-verge-rev-backup" subdirectory under the
+ // configured WebDAV URL; fall back to it when the URL itself has no backups
+ private fun listLatestBackup(client: WebDavClient): String? {
+ val root = runCatching { client.listBackupFiles() }
+
+ val files = root.getOrDefault(emptyList()).ifEmpty {
+ runCatching { client.listBackupFiles(VergeBackup.BACKUP_DIR) }
+ .getOrElse { root.getOrThrow() }
+ }
+
+ return files.lastOrNull()
+ }
+}
diff --git a/common/src/main/java/com/github/kr328/clash/common/util/VergeBackup.kt b/common/src/main/java/com/github/kr328/clash/common/util/VergeBackup.kt
new file mode 100644
index 0000000000..d813e6d58a
--- /dev/null
+++ b/common/src/main/java/com/github/kr328/clash/common/util/VergeBackup.kt
@@ -0,0 +1,92 @@
+package com.github.kr328.clash.common.util
+
+import java.io.ByteArrayInputStream
+import java.io.FileNotFoundException
+import java.util.zip.ZipInputStream
+
+data class VergeProfile(
+ val name: String,
+ val url: String,
+)
+
+object VergeBackup {
+ // Directory Verge creates under the configured WebDAV URL to store backups
+ // (clash-verge-rev/src-tauri/src/utils/dirs.rs BACKUP_DIR)
+ const val BACKUP_DIR = "clash-verge-rev-backup"
+
+ fun parseRemoteProfiles(zip: ByteArray): List {
+ ZipInputStream(ByteArrayInputStream(zip)).use { stream ->
+ while (true) {
+ val entry = stream.nextEntry ?: break
+
+ if (entry.name == "profiles.yaml") {
+ return parseProfilesYaml(stream.readBytes().decodeToString())
+ }
+ }
+ }
+
+ throw FileNotFoundException("profiles.yaml not found in backup")
+ }
+
+ internal fun parseProfilesYaml(text: String): List {
+ val profiles = mutableListOf()
+
+ var inItems = false
+ var type: String? = null
+ var name: String? = null
+ var url: String? = null
+
+ fun unquote(value: String): String {
+ return value.trim()
+ .removeSurrounding("\"")
+ .removeSurrounding("'")
+ }
+
+ fun flush() {
+ val n = name
+ val u = url
+
+ if (type == "remote" && !n.isNullOrEmpty() && !u.isNullOrEmpty()) {
+ profiles.add(VergeProfile(n, u))
+ }
+
+ type = null
+ name = null
+ url = null
+ }
+
+ for (line in text.lines()) {
+ val trimmed = line.trim()
+
+ when {
+ !inItems && line.trimEnd() == "items:" -> inItems = true
+
+ inItems && trimmed.startsWith("- ") -> {
+ flush()
+
+ val kv = trimmed.removePrefix("- ")
+ when {
+ kv.startsWith("type:") -> type = unquote(kv.removePrefix("type:"))
+ kv.startsWith("name:") -> name = unquote(kv.removePrefix("name:")).takeIf { it != "null" }
+ kv.startsWith("url:") -> url = unquote(kv.removePrefix("url:"))
+ }
+ }
+
+ inItems && line.startsWith(" ") -> when {
+ trimmed.startsWith("type:") -> type = unquote(trimmed.removePrefix("type:"))
+ trimmed.startsWith("name:") -> name = unquote(trimmed.removePrefix("name:")).takeIf { it != "null" }
+ trimmed.startsWith("url:") -> url = unquote(trimmed.removePrefix("url:"))
+ }
+
+ inItems -> {
+ flush()
+ inItems = false
+ }
+ }
+ }
+
+ flush()
+
+ return profiles
+ }
+}
diff --git a/common/src/main/java/com/github/kr328/clash/common/util/WebDavClient.kt b/common/src/main/java/com/github/kr328/clash/common/util/WebDavClient.kt
new file mode 100644
index 0000000000..c9e83d21b5
--- /dev/null
+++ b/common/src/main/java/com/github/kr328/clash/common/util/WebDavClient.kt
@@ -0,0 +1,138 @@
+package com.github.kr328.clash.common.util
+
+import android.util.Base64
+import java.io.IOException
+import java.net.HttpURLConnection
+import java.net.Socket
+import java.net.URL
+import java.net.URLDecoder
+import javax.net.ssl.HttpsURLConnection
+import javax.net.ssl.SSLSocket
+import javax.net.ssl.SSLSocketFactory
+
+class WebDavClient(
+ private val baseUrl: String,
+ private val username: String,
+ private val password: String,
+) {
+ private fun basicAuthorization(): String {
+ val token = Base64.encodeToString("$username:$password".toByteArray(), Base64.NO_WRAP)
+
+ return "Basic $token"
+ }
+
+ // HttpURLConnection cannot send WebDAV extension methods: setRequestMethod
+ // rejects PROPFIND and no reflection hack survives OEM HttpURLConnection
+ // implementations (verified on-device: the request went out as GET, which
+ // jianguoyun answers with 403). Send PROPFIND over a plain socket instead.
+ private fun propfind(url: URL): String {
+ val port = url.port.takeIf { it != -1 } ?: url.defaultPort
+ val requestPath = url.path
+
+ val socket: Socket = if (url.protocol == "https") {
+ SSLSocketFactory.getDefault().createSocket(url.host, port) as SSLSocket
+ } else {
+ Socket(url.host, port)
+ }
+
+ socket.soTimeout = 30_000
+
+ socket.use { s ->
+ if (s is SSLSocket) {
+ s.startHandshake()
+
+ if (!HttpsURLConnection.getDefaultHostnameVerifier().verify(url.host, s.session)) {
+ throw IOException("hostname mismatch: ${url.host}")
+ }
+ }
+
+ val host = url.host + (if (port == url.defaultPort) "" else ":$port")
+
+ val request = buildString {
+ append("PROPFIND ").append(requestPath).append(" HTTP/1.1\r\n")
+ append("Host: ").append(host).append("\r\n")
+ append("Authorization: ").append(basicAuthorization()).append("\r\n")
+ append("Depth: 1\r\n")
+ append("Content-Length: 0\r\n")
+ append("Connection: close\r\n")
+ append("\r\n")
+ }
+
+ s.getOutputStream().apply {
+ write(request.toByteArray())
+ flush()
+ }
+
+ val response = s.getInputStream().readBytes().decodeToString()
+ val status = response.substringBefore("\r\n")
+ val code = status.split(" ").getOrNull(1)?.toIntOrNull()
+ ?: throw IOException("malformed response: ${status.take(60)}")
+
+ if (code != 207) {
+ val body = response.substringAfter("\r\n\r\n", "")
+
+ throw IOException(
+ if (body.isBlank()) "HTTP $code" else "HTTP $code: ${body.take(200)}"
+ )
+ }
+
+ return response.substringAfter("\r\n\r\n", "")
+ }
+ }
+
+ private fun open(path: String): HttpURLConnection {
+ val url = baseUrl.trimEnd('/') + "/" + path.trimStart('/')
+
+ val connection = URL(url).openConnection() as HttpURLConnection
+ connection.requestMethod = "GET"
+ connection.connectTimeout = 15_000
+ connection.readTimeout = 60_000
+ connection.setRequestProperty("User-Agent", "ClashMetaForAndroid")
+ connection.setRequestProperty("Authorization", basicAuthorization())
+
+ return connection
+ }
+
+ fun listBackupFiles(path: String = ""): List {
+ val dir = path.trim('/')
+ val url = URL(baseUrl.trimEnd('/') + (if (dir.isEmpty()) "/" else "/$dir/"))
+ val xml = propfind(url)
+
+ val basePath = url.path.trimEnd('/')
+ val prefix = if (dir.isEmpty()) "" else "$dir/"
+
+ val hrefRegex = Regex("<(?:[A-Za-z]+:)?href[^>]*>([^<]+)(?:[A-Za-z]+:)?href>")
+
+ return hrefRegex.findAll(xml)
+ .mapNotNull { match ->
+ val href = URLDecoder.decode(match.groupValues[1], "UTF-8")
+
+ if (href.trimEnd('/') == basePath)
+ return@mapNotNull null // the directory itself
+
+ val name = href.trimEnd('/').removePrefix(basePath).trim('/')
+
+ name.takeIf { it.isNotEmpty() }?.let { prefix + it }
+ }
+ .filter { it.contains("-backup-") && it.endsWith(".zip") }
+ .distinct()
+ .sorted()
+ .toList()
+ }
+
+ fun download(path: String): ByteArray {
+ val connection = open(path)
+
+ return try {
+ val code = connection.responseCode
+
+ if (code !in 200..299) {
+ throw IOException("HTTP $code")
+ }
+
+ connection.inputStream.use { it.readBytes() }
+ } finally {
+ connection.disconnect()
+ }
+ }
+}
diff --git a/design/src/main/java/com/github/kr328/clash/design/SettingsDesign.kt b/design/src/main/java/com/github/kr328/clash/design/SettingsDesign.kt
index 0536a587cd..6222796188 100644
--- a/design/src/main/java/com/github/kr328/clash/design/SettingsDesign.kt
+++ b/design/src/main/java/com/github/kr328/clash/design/SettingsDesign.kt
@@ -10,7 +10,7 @@ import com.github.kr328.clash.design.util.root
class SettingsDesign(context: Context) : Design(context) {
enum class Request {
- StartApp, StartNetwork, StartOverride, StartMetaFeature,
+ StartApp, StartNetwork, StartOverride, StartMetaFeature, StartWebDav,
}
private val binding = DesignSettingsBinding
diff --git a/design/src/main/java/com/github/kr328/clash/design/WebDavSettingsDesign.kt b/design/src/main/java/com/github/kr328/clash/design/WebDavSettingsDesign.kt
new file mode 100644
index 0000000000..880a6ba02b
--- /dev/null
+++ b/design/src/main/java/com/github/kr328/clash/design/WebDavSettingsDesign.kt
@@ -0,0 +1,104 @@
+package com.github.kr328.clash.design
+
+import android.content.Context
+import android.view.View
+import com.github.kr328.clash.design.databinding.DesignSettingsCommonBinding
+import com.github.kr328.clash.design.preference.*
+import com.github.kr328.clash.design.store.UiStore
+import com.github.kr328.clash.design.util.applyFrom
+import com.github.kr328.clash.design.util.bindAppBarElevation
+import com.github.kr328.clash.design.util.layoutInflater
+import com.github.kr328.clash.design.util.root
+import java.text.SimpleDateFormat
+import java.util.*
+
+class WebDavSettingsDesign(
+ context: Context,
+ uiStore: UiStore,
+) : Design(context) {
+ enum class Request {
+ Sync,
+ }
+
+ private val binding = DesignSettingsCommonBinding
+ .inflate(context.layoutInflater, context.root, false)
+
+ private lateinit var syncPreference: ClickablePreference
+
+ override val root: View
+ get() = binding.root
+
+ init {
+ binding.surface = surface
+
+ binding.activityBarLayout.applyFrom(context)
+
+ binding.scrollRoot.bindAppBarElevation(binding.activityBarLayout)
+
+ val screen = preferenceScreen(context) {
+ category(R.string.webdav_server)
+
+ editableText(
+ value = uiStore::webdavUrl,
+ adapter = NullableTextAdapter.NonNullString,
+ title = R.string.webdav_url,
+ icon = R.drawable.ic_baseline_domain,
+ placeholder = R.string.webdav_url_placeholder,
+ )
+
+ editableText(
+ value = uiStore::webdavUsername,
+ adapter = NullableTextAdapter.NonNullString,
+ title = R.string.webdav_username,
+ icon = R.drawable.ic_baseline_key,
+ )
+
+ editableText(
+ value = uiStore::webdavPassword,
+ adapter = NullableTextAdapter.NonNullString,
+ title = R.string.webdav_password,
+ icon = R.drawable.ic_baseline_key,
+ )
+
+ category(R.string.webdav_sync)
+
+ syncPreference = clickable(
+ title = R.string.webdav_sync_now,
+ icon = R.drawable.ic_baseline_sync,
+ ) {
+ clicked {
+ requests.trySend(Request.Sync)
+ }
+ }
+
+ if (uiStore.webdavLastSync > 0) {
+ val format = SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault())
+ val date = Date(uiStore.webdavLastSync * 1000L)
+
+ syncPreference.summary =
+ context.getString(R.string.webdav_last_sync, format.format(date))
+ }
+
+ tips(R.string.webdav_tips)
+ }
+
+ binding.content.addView(screen.root)
+ }
+
+ fun setSyncing(syncing: Boolean) {
+ syncPreference.enabled = !syncing
+
+ if (syncing) {
+ syncPreference.summary = context.getText(R.string.webdav_syncing)
+ }
+ }
+
+ fun showSyncResult(updated: Int, created: Int, failed: Int) {
+ syncPreference.summary =
+ context.getString(R.string.webdav_sync_result, updated, created, failed)
+ }
+
+ fun showSyncFailed(message: String) {
+ syncPreference.summary = context.getString(R.string.webdav_sync_failed, message)
+ }
+}
diff --git a/design/src/main/java/com/github/kr328/clash/design/preference/Value.kt b/design/src/main/java/com/github/kr328/clash/design/preference/Value.kt
index cf2dcb79fc..1d1f05f0a5 100644
--- a/design/src/main/java/com/github/kr328/clash/design/preference/Value.kt
+++ b/design/src/main/java/com/github/kr328/clash/design/preference/Value.kt
@@ -28,6 +28,16 @@ interface NullableTextAdapter {
return text
}
}
+
+ val NonNullString = object : NullableTextAdapter {
+ override fun from(value: String): String? {
+ return value
+ }
+
+ override fun to(text: String?): String {
+ return text?.trim() ?: ""
+ }
+ }
}
}
diff --git a/design/src/main/java/com/github/kr328/clash/design/store/UiStore.kt b/design/src/main/java/com/github/kr328/clash/design/store/UiStore.kt
index ddc9d600fd..504e61ba60 100644
--- a/design/src/main/java/com/github/kr328/clash/design/store/UiStore.kt
+++ b/design/src/main/java/com/github/kr328/clash/design/store/UiStore.kt
@@ -78,6 +78,26 @@ class UiStore(context: Context) {
defaultValue = false,
)
+ var webdavUrl: String by store.string(
+ key = "webdav_url",
+ defaultValue = "",
+ )
+
+ var webdavUsername: String by store.string(
+ key = "webdav_username",
+ defaultValue = "",
+ )
+
+ var webdavPassword: String by store.string(
+ key = "webdav_password",
+ defaultValue = "",
+ )
+
+ var webdavLastSync: Int by store.int(
+ key = "webdav_last_sync",
+ defaultValue = 0,
+ )
+
companion object {
private const val PREFERENCE_NAME = "ui"
diff --git a/design/src/main/res/layout/design_settings.xml b/design/src/main/res/layout/design_settings.xml
index 885ec4a5c8..1366b69062 100644
--- a/design/src/main/res/layout/design_settings.xml
+++ b/design/src/main/res/layout/design_settings.xml
@@ -56,6 +56,13 @@
app:icon="@drawable/ic_baseline_meta"
app:text="@string/meta_features" />
+
+
diff --git a/design/src/main/res/values-ja-rJP/strings.xml b/design/src/main/res/values-ja-rJP/strings.xml
index 359bde73b0..94dcffc1ba 100644
--- a/design/src/main/res/values-ja-rJP/strings.xml
+++ b/design/src/main/res/values-ja-rJP/strings.xml
@@ -266,4 +266,19 @@
Override Destination
カメラのアクセスが制限されています。設定から有効にしてください。
システムで予期しない例外が発生しました。
+
+ WebDAV 同期
+ WebDAV サーバー
+ サーバーアドレス
+ ユーザー名
+ パスワード
+ 今すぐ同期
+ 同期中…
+ 最終同期:%s
+ 同期完了 · 更新 %1$d 件、新規 %2$d 件、失敗 %3$d 件
+ 同期失敗:%s
+ WebDAV サーバーアドレスが空です
+ WebDAV 上にバックアップファイルが見つかりません
+ バックアップにサブスクリプションが見つかりません
+ WebDAV 上の Clash Verge Rev デスクトップバックアップからサブスクリプションを同期します。名前で照合され、既存のプロファイルは更新、新規は作成されます。
diff --git a/design/src/main/res/values-ko-rKR/strings.xml b/design/src/main/res/values-ko-rKR/strings.xml
index 132f264aee..6c559f5777 100644
--- a/design/src/main/res/values-ko-rKR/strings.xml
+++ b/design/src/main/res/values-ko-rKR/strings.xml
@@ -266,4 +266,19 @@
Override Destination
카메라 접근이 제한되었습니다. 설정에서 허용해 주세요.
처리되지 않은 시스템 예외가 발생했습니다.
+
+ WebDAV 동기화
+ WebDAV 서버
+ 서버 주소
+ 사용자 이름
+ 비밀번호
+ 지금 동기화
+ 동기화 중…
+ 마지막 동기화: %s
+ 동기화 완료 · %1$d개 업데이트, %2$d개 생성, %3$d개 실패
+ 동기화 실패: %s
+ WebDAV 서버 주소가 비어 있습니다
+ WebDAV에서 백업 파일을 찾을 수 없습니다
+ 백업에서 구독을 찾을 수 없습니다
+ WebDAV의 Clash Verge Rev 데스크톱 백업에서 구독을 동기화합니다. 이름으로 매칭되며 기존 프로필은 업데이트, 새 항목은 생성됩니다.
diff --git a/design/src/main/res/values-ru/strings.xml b/design/src/main/res/values-ru/strings.xml
index 196cf995a6..dfba1029e5 100644
--- a/design/src/main/res/values-ru/strings.xml
+++ b/design/src/main/res/values-ru/strings.xml
@@ -330,4 +330,19 @@
Override Destination
Доступ к камере ограничен. Разрешите его в настройках.
Произошла не обрабатываемая системная ошибка.
+
+ Синхронизация WebDAV
+ Сервер WebDAV
+ Адрес сервера
+ Имя пользователя
+ Пароль
+ Синхронизировать сейчас
+ Синхронизация…
+ Последняя синхронизация: %s
+ Синхронизация завершена · обновлено: %1$d, создано: %2$d, ошибок: %3$d
+ Ошибка синхронизации: %s
+ Адрес сервера WebDAV не указан
+ На WebDAV не найден файл резервной копии
+ В резервной копии не найдены подписки
+ Синхронизация подписок из резервной копии Clash Verge Rev на сервере WebDAV. Профили сопоставляются по имени: существующие обновляются, новые создаются.
diff --git a/design/src/main/res/values-vi/strings.xml b/design/src/main/res/values-vi/strings.xml
index 2122523830..52a17ff98f 100644
--- a/design/src/main/res/values-vi/strings.xml
+++ b/design/src/main/res/values-vi/strings.xml
@@ -253,4 +253,19 @@
Nhập từ Mã QR
Quyền truy cập camera bị hạn chế. Vui lòng bật trong Cài đặt.
Đã xảy ra ngoại lệ hệ thống không xử lý được.
+
+ Đồng bộ WebDAV
+ Máy chủ WebDAV
+ Địa chỉ máy chủ
+ Tên người dùng
+ Mật khẩu
+ Đồng bộ ngay
+ Đang đồng bộ…
+ Đồng bộ lần cuối: %s
+ Đồng bộ hoàn tất · cập nhật %1$d, tạo mới %2$d, thất bại %3$d
+ Đồng bộ thất bại: %s
+ Địa chỉ máy chủ WebDAV đang trống
+ Không tìm thấy tệp sao lưu trên WebDAV
+ Không tìm thấy gói đăng ký nào trong bản sao lưu
+ Đồng bộ các gói đăng ký từ bản sao lưu Clash Verge Rev trên máy chủ WebDAV. Hồ sơ được khớp theo tên: hồ sơ đã có sẽ được cập nhật, hồ sơ mới sẽ được tạo.
diff --git a/design/src/main/res/values-zh-rHK/strings.xml b/design/src/main/res/values-zh-rHK/strings.xml
index d0c8209653..498d3e8787 100644
--- a/design/src/main/res/values-zh-rHK/strings.xml
+++ b/design/src/main/res/values-zh-rHK/strings.xml
@@ -263,4 +263,19 @@
Override Destination
相機權限受限,請前往設定開啟。
發生系統未知異常,操作失敗。
+
+ WebDAV 同步
+ WebDAV 伺服器
+ 伺服器位址
+ 使用者名稱
+ 密碼
+ 立即同步
+ 同步中…
+ 最近同步:%s
+ 同步完成 · 更新 %1$d 個,新增 %2$d 個,失敗 %3$d 個
+ 同步失敗:%s
+ WebDAV 伺服器位址為空
+ WebDAV 上未找到備份檔案
+ 備份中未找到訂閱
+ 從 WebDAV 上的 Clash Verge Rev 桌面端備份同步訂閱。按名稱匹配:已存在的設定檔會更新,新的會建立。
diff --git a/design/src/main/res/values-zh-rTW/strings.xml b/design/src/main/res/values-zh-rTW/strings.xml
index 0be9bb2118..f7395a2bf4 100644
--- a/design/src/main/res/values-zh-rTW/strings.xml
+++ b/design/src/main/res/values-zh-rTW/strings.xml
@@ -263,4 +263,19 @@
Override Destination
相機權限受限,請前往設定開啟。
發生系統未知異常,操作失敗。
+
+ WebDAV 同步
+ WebDAV 伺服器
+ 伺服器位址
+ 使用者名稱
+ 密碼
+ 立即同步
+ 同步中…
+ 最近同步:%s
+ 同步完成 · 更新 %1$d 個,新增 %2$d 個,失敗 %3$d 個
+ 同步失敗:%s
+ WebDAV 伺服器位址為空
+ WebDAV 上未找到備份檔案
+ 備份中未找到訂閱
+ 從 WebDAV 上的 Clash Verge Rev 桌面端備份同步訂閱。按名稱匹配:已存在的設定檔會更新,新的會建立。
diff --git a/design/src/main/res/values-zh/strings.xml b/design/src/main/res/values-zh/strings.xml
index ee7daf75e1..caeb2a092f 100644
--- a/design/src/main/res/values-zh/strings.xml
+++ b/design/src/main/res/values-zh/strings.xml
@@ -282,4 +282,19 @@
启动 Clash 服务
停止 Clash
停止 Clash 服务
+
+ WebDAV 同步
+ WebDAV 服务器
+ 服务器地址
+ 用户名
+ 密码
+ 立即同步
+ 同步中…
+ 最近同步:%s
+ 同步完成 · 更新 %1$d 个,新增 %2$d 个,失败 %3$d 个
+ 同步失败:%s
+ WebDAV 服务器地址为空
+ WebDAV 上未找到备份文件
+ 备份中未找到订阅
+ 从 WebDAV 上的 Clash Verge Rev 桌面端备份同步订阅。按名称匹配:已存在的配置会更新,新的会创建。
diff --git a/design/src/main/res/values/strings.xml b/design/src/main/res/values/strings.xml
index a2f951e679..e78a3d5882 100644
--- a/design/src/main/res/values/strings.xml
+++ b/design/src/main/res/values/strings.xml
@@ -373,4 +373,20 @@
Start Clash service
Stop Clash
Stop Clash service
+
+ WebDAV Sync
+ WebDAV Server
+ Server Address
+ https://dav.example.com/path/to/backup
+ Username
+ Password
+ Sync Now
+ Syncing…
+ Last sync: %s
+ Sync complete · %1$d updated, %2$d created, %3$d failed
+ Sync failed: %s
+ WebDAV server address is empty
+ No backup file found on WebDAV
+ No subscription found in backup
+ Sync subscriptions from the Clash Verge Rev backup on your WebDAV server. Profiles are matched by name: existing ones are updated, new ones are created.