mirror of
https://github.com/kalarina-bit/Sparkledns.git
synced 2026-11-22 07:36:09 +00:00
Compare commits
21
Commits
399fc5ea36
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f972989c42 | ||
|
|
72e3a45995 | ||
|
|
eccc98b3aa | ||
|
|
e36b9de154 | ||
|
|
7f02ec606c | ||
|
|
430d7b8d59 | ||
|
|
361d82a4ed | ||
|
|
005768f18a | ||
|
|
a6f22ddfb2 | ||
|
|
572e5e224b | ||
|
|
92dfd31faf | ||
|
|
3b4d9b049b | ||
|
|
618a9403c7 | ||
|
|
582511607c | ||
|
|
d6f77045e3 | ||
|
|
f3000b7706 | ||
|
|
3c026aaec3 | ||
|
|
1818973abc | ||
|
|
f6a98b8785 | ||
|
|
1fb87a1e99 | ||
|
|
667b1b2dc5 |
@@ -1,28 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Something doesn't work as expected
|
||||
title: "[Bug] "
|
||||
---
|
||||
|
||||
**What happened**
|
||||
|
||||
|
||||
**Steps to reproduce**
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
**What you expected**
|
||||
|
||||
|
||||
**Environment**
|
||||
|
||||
- App version:
|
||||
- Installed from: Gitea / F-Droid
|
||||
- Device and Android version:
|
||||
- DoH server in use:
|
||||
- Network: Wi-Fi / mobile data
|
||||
|
||||
**Screenshots or logs** (optional — please remove domains you don't want to share)
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
---
|
||||
name: DoH server or blocklist
|
||||
about: Suggest a DoH server or blocklist preset
|
||||
title: "[Preset] "
|
||||
---
|
||||
|
||||
- Type: DoH server / blocklist
|
||||
- Name:
|
||||
- URL:
|
||||
- Homepage or documentation:
|
||||
- Privacy policy (DoH servers) or license (blocklists):
|
||||
- Donation page (DoH servers, optional):
|
||||
|
||||
- [ ] DoH server: public and supports RFC 8484
|
||||
- [ ] Blocklist: public and actively maintained
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea that fits the app
|
||||
title: "[Feature] "
|
||||
---
|
||||
|
||||
<!-- Please check the "Out of scope" list in CONTRIBUTING.md before opening this. -->
|
||||
|
||||
**What problem does this solve**
|
||||
|
||||
|
||||
**Proposed solution**
|
||||
|
||||
|
||||
**Alternatives you considered**
|
||||
|
||||
|
||||
- [ ] I'd like to implement this myself
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
name: Translation fix
|
||||
about: Report a wrong or awkward translation
|
||||
title: "[Translation] "
|
||||
---
|
||||
|
||||
<!-- Currently supported: English, Russian. For a new language, open a feature request first. -->
|
||||
|
||||
- Language:
|
||||
- Screen or place in the app:
|
||||
- Current text:
|
||||
- Suggested text:
|
||||
@@ -1,17 +0,0 @@
|
||||
## What does this change
|
||||
|
||||
|
||||
## Related issue
|
||||
|
||||
Closes #
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] Discussed in an issue first (not needed for small fixes)
|
||||
- [ ] `./gradlew assembleDebug` builds
|
||||
- [ ] Tested on a device or emulator (Android version: )
|
||||
- [ ] DNS queries only go to the selected DoH server
|
||||
- [ ] No ads, analytics, trackers or Google Play Services / Firebase dependencies
|
||||
- [ ] New strings added to `values/strings.xml` (missing translations noted below)
|
||||
- [ ] Screenshots added for UI changes
|
||||
- [ ] I agree that my contribution is licensed under GPL-3.0-or-later
|
||||
@@ -0,0 +1 @@
|
||||
ko_fi: skysparkle
|
||||
@@ -19,7 +19,7 @@ title: "[Bug] "
|
||||
**Environment**
|
||||
|
||||
- App version:
|
||||
- Installed from: Gitea / GitHub / F-Droid / Google Play
|
||||
- Installed from: GitHub / F-Droid / Google Play
|
||||
- Device and Android version:
|
||||
- DoH server in use:
|
||||
- Network: Wi-Fi / mobile data
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Main repository on git.skysparkle.cc
|
||||
url: https://git.skysparkle.cc/kalarina/Sparkledns
|
||||
about: This GitHub repository is a mirror. Issues are welcome here and on Gitea.
|
||||
- name: Support the project on Ko-fi
|
||||
url: https://ko-fi.com/skysparkle
|
||||
about: Donations keep the apps and the Skysparkle server running.
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# Builds unsigned release APK and AAB. Download them from the run's "Artifacts" and sign locally.
|
||||
name: Build unsigned release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ["v*"]
|
||||
paths-ignore: ["**.md", "fastlane/**", ".github/ISSUE_TEMPLATE/**"]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: build-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
NAME: SparkleDNS
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
chmod +x gradlew
|
||||
./gradlew --no-daemon clean assembleRelease bundleRelease
|
||||
|
||||
- name: Collect files
|
||||
run: |
|
||||
ver=$(grep -oP 'versionName = "\K[^"]+' app/build.gradle.kts)
|
||||
mkdir out
|
||||
cp app/build/outputs/apk/release/app-release-unsigned.apk "out/$NAME-v$ver-unsigned.apk"
|
||||
cp app/build/outputs/bundle/release/app-release.aab "out/$NAME-v$ver-unsigned.aab"
|
||||
cp app/build/outputs/mapping/release/mapping.txt "out/$NAME-v$ver-mapping.txt"
|
||||
git log -1 --format="Commit %h, %ci: %s" > out/BUILD-INFO.txt
|
||||
echo "VER=$ver" >> "$GITHUB_ENV"
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.NAME }}-v${{ env.VER }}-unsigned
|
||||
path: out/
|
||||
retention-days: 30
|
||||
+1
-1
@@ -4,7 +4,7 @@ Thanks for wanting to help! This guide explains where to contribute, what fits t
|
||||
|
||||
## Where to contribute
|
||||
|
||||
Issues and pull requests go to the repository on [Gitea](https://git.skysparkle.cc/kalarina/Sparkledns).
|
||||
Issues and pull requests go to the repository on [GitHub](https://github.com/kalarina-bit/Sparkledns).
|
||||
|
||||
## Ways to help
|
||||
|
||||
|
||||
@@ -9,8 +9,12 @@
|
||||
A local VPN that captures only DNS traffic and sends every query to the DoH server you choose (RFC 8484). Everything else goes through your normal connection.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://ko-fi.com/skysparkle"><img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="Support me on Ko-fi"></a>
|
||||
</p>
|
||||
|
||||
> [!IMPORTANT]
|
||||
> **SparkleDNS is coming to Google Play!** The app is now in closed testing there ahead of the public release. Ideas, wishes and suggestions for improvement are very welcome — send them wherever is easiest for you: an issue on [Gitea](https://git.skysparkle.cc/kalarina/Sparkledns/issues) or [GitHub](https://github.com/kalarina-bit/Sparkledns/issues), or an email to [cuken107@proton.me](mailto:cuken107@proton.me).
|
||||
> **SparkleDNS is coming to Google Play!** The app is now in closed testing there ahead of the public release. Ideas, wishes and suggestions for improvement are very welcome — send them wherever is easiest for you: an [issue on GitHub](https://github.com/kalarina-bit/Sparkledns/issues), or an email to [cuken107@proton.me](mailto:cuken107@proton.me).
|
||||
|
||||
> [!NOTE]
|
||||
> **Looking for designers!** SparkleDNS is looking for volunteer designers to help with icons, logos, animations, cover art (store graphics) and UI design. This is unpaid help for an open-source project. If you're interested, write to [cuken107@proton.me](mailto:cuken107@proton.me).
|
||||
@@ -21,15 +25,14 @@
|
||||
|
||||
<p align="center">
|
||||
<a href="https://f-droid.org/packages/cc.skysparkle.sparkledns/"><img src="assets/get-it-on%20(1).png" height="56" alt="Get it on F-Droid"></a>
|
||||
<a href="https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://git.skysparkle.cc/kalarina/Sparkledns"><img src="assets/badge_obtainium.png" height="56" alt="Get it on Obtainium"></a>
|
||||
<a href="https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://github.com/kalarina-bit/Sparkledns"><img src="assets/badge_obtainium.png" height="56" alt="Get it on Obtainium"></a>
|
||||
<a href="https://github.com/kalarina-bit/Sparkledns/releases/latest"><img src="assets/get-it-on-github.png" height="56" alt="Get it on GitHub"></a>
|
||||
<a href="https://git.skysparkle.cc/kalarina/Sparkledns/releases"><img src="assets/get-it-on-gitea.png" height="56" alt="Get it on Gitea"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/screenshots/1-private-dns-left.png" width="160" alt="Private DNS in one tap"><img src="assets/screenshots/2-private-dns-right.png" width="160" alt="You're protected">
|
||||
<img src="assets/screenshots/3-see-every-request.png" width="160" alt="See every request">
|
||||
<img src="assets/screenshots/4-block-ads-and-trackers.png" width="160" alt="Block ads and trackers">
|
||||
<img src="assets/screenshots/4-block-trackers-and-malware.png" width="160" alt="Block trackers and malware">
|
||||
</p>
|
||||
|
||||
> [!TIP]
|
||||
@@ -48,8 +51,8 @@
|
||||
## <img src="assets/icon-install.png" width="32" alt=""> Installation
|
||||
|
||||
- **[F-Droid](https://f-droid.org/packages/cc.skysparkle.sparkledns/)** — install and update through the F-Droid client.
|
||||
- **[Obtainium](https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://git.skysparkle.cc/kalarina/Sparkledns)** — installs the APK straight from Gitea releases and keeps it up to date.
|
||||
- **Manually** — download the latest APK from [GitHub](https://github.com/kalarina-bit/Sparkledns/releases/latest) or [Gitea](https://git.skysparkle.cc/kalarina/Sparkledns/releases), allow installs from unknown sources for the app you open it with (Settings → Apps → Special access → Install unknown apps), then open the `.apk` and confirm.
|
||||
- **[Obtainium](https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://github.com/kalarina-bit/Sparkledns)** — installs the APK straight from GitHub releases and keeps it up to date.
|
||||
- **Manually** — download the latest APK from [GitHub Releases](https://github.com/kalarina-bit/Sparkledns/releases/latest), allow installs from unknown sources for the app you open it with (Settings → Apps → Special access → Install unknown apps), then open the `.apk` and confirm.
|
||||
|
||||
## <img src="assets/icon-verify.png" width="32" alt=""> Verifying a download
|
||||
|
||||
@@ -83,7 +86,23 @@ Requires JDK 17+ and Android SDK 36.
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
Bug reports, DoH server and blocklist suggestions, translation fixes and pull requests are welcome in the [issue tracker](https://git.skysparkle.cc/kalarina/Sparkledns/issues). Please read [CONTRIBUTING.md](CONTRIBUTING.md) first — it explains what fits the project and how to send changes. To open an issue or a pull request, [create an account](https://git.skysparkle.cc/user/sign_up) on this Gitea.
|
||||
Bug reports, DoH server and blocklist suggestions, translation fixes and pull requests are welcome in the [issue tracker](https://github.com/kalarina-bit/Sparkledns/issues). Please read [CONTRIBUTING.md](CONTRIBUTING.md) first — it explains what fits the project and how to send changes.
|
||||
|
||||
## 💙 Sponsor
|
||||
|
||||
<p align="center">
|
||||
<a href="https://skysparkle.cc"><img src="assets/skysparkle.svg" width="72" alt="Skysparkle"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
SparkleDNS is sponsored and supported by <a href="https://skysparkle.cc"><b>Skysparkle</b></a> — independent encrypted DNS from Lithuania and the app’s default DoH server.
|
||||
</p>
|
||||
|
||||
## ☕ Support
|
||||
|
||||
SparkleDNS is free, open source and has no ads. If it is useful to you, you can support the project on [Ko-fi](https://ko-fi.com/skysparkle) — donations pay for the Skysparkle server and the time spent on the apps.
|
||||
|
||||
<a href="https://ko-fi.com/skysparkle"><img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="Support me on Ko-fi"></a>
|
||||
|
||||
## 📄 License
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ android {
|
||||
targetSdk = 36
|
||||
// Single source of truth: the About screen reads these through BuildConfig.
|
||||
// Kept as plain literals so F-Droid can detect new versions. Code = major * 10000 + minor * 100 + patch.
|
||||
versionCode = 10104
|
||||
versionName = "1.1.4"
|
||||
versionCode = 10106
|
||||
versionName = "1.1.6"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
@@ -32,11 +32,22 @@
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<!-- End of the Skysparkle sign-in: the site sends the browser back with a one-time code
|
||||
through an intent:// link that names this package, so Android hands it only to this
|
||||
app. No autoVerify: a link with a package needs no domain verification, and plain
|
||||
visits to skysparkle.cc stay in the browser -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="https" android:host="skysparkle.cc" android:path="/app/callback" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
|
||||
@@ -30,6 +30,7 @@ import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
@@ -53,7 +54,8 @@ import androidx.compose.ui.text.style.TextDecoration
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
private const val PRIVACY_POLICY = "https://skysparkle.cc/privacy?lang=en"
|
||||
private const val SOURCE_CODE = "https://git.skysparkle.cc/kalarina/Sparkledns"
|
||||
private const val SOURCE_CODE = "https://github.com/kalarina-bit/Sparkledns"
|
||||
private const val DONATE = "https://ko-fi.com/skysparkle"
|
||||
|
||||
private const val APACHE_2 = "Apache License 2.0"
|
||||
private const val APACHE_2_URL = "https://www.apache.org/licenses/LICENSE-2.0"
|
||||
@@ -156,6 +158,8 @@ private fun AboutContent(modifier: Modifier, onOpenLicenses: () -> Unit) {
|
||||
}
|
||||
}
|
||||
|
||||
SupportCard(onDonate = { openUrl(context, DONATE) })
|
||||
|
||||
OutlinedButton(onClick = { openUrl(context, PRIVACY_POLICY) }, modifier = Modifier.fillMaxWidth()) {
|
||||
Icon(painterResource(R.drawable.ic_policy), contentDescription = null, modifier = Modifier.size(18.dp))
|
||||
Spacer(Modifier.width(8.dp))
|
||||
@@ -192,6 +196,39 @@ private fun AboutContent(modifier: Modifier, onOpenLicenses: () -> Unit) {
|
||||
}
|
||||
}
|
||||
|
||||
// The server costs money every month; the card asks for help without getting in the way
|
||||
@Composable
|
||||
private fun SupportCard(onDonate: () -> Unit) {
|
||||
Card(Modifier.fillMaxWidth()) {
|
||||
Row(
|
||||
modifier = Modifier.padding(start = 16.dp, top = 16.dp, end = 16.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
// The logo is already at the top of the screen
|
||||
IconBadge(R.drawable.ic_donate, size = 48.dp)
|
||||
Spacer(Modifier.width(14.dp))
|
||||
Column(Modifier.weight(1f)) {
|
||||
Text(stringResource(R.string.support_title), style = MaterialTheme.typography.titleMedium)
|
||||
Text(
|
||||
stringResource(R.string.support_text),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
}
|
||||
Button(
|
||||
onClick = onDonate,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(16.dp),
|
||||
) {
|
||||
Icon(painterResource(R.drawable.ic_donate), contentDescription = null, modifier = Modifier.size(18.dp))
|
||||
Spacer(Modifier.width(8.dp))
|
||||
Text(stringResource(R.string.support_button))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun LicensesScreen(modifier: Modifier, onBack: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
|
||||
@@ -106,7 +106,10 @@ class DohVpnService : VpnService() {
|
||||
if (provider.url.toHttpUrlOrNull()?.isHttps != true) {
|
||||
Log.e(TAG, "Server address is not a valid HTTPS URL, not starting")
|
||||
stopSession()
|
||||
showAlert(R.string.alert_bad_url_title, R.string.alert_bad_url_text)
|
||||
showAlert(
|
||||
R.string.alert_bad_url_title,
|
||||
if (provider.id == Providers.DEFAULT_ID) R.string.alert_no_key_text else R.string.alert_bad_url_text,
|
||||
)
|
||||
stopSelf()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -143,7 +143,8 @@ fun HomeScreen(
|
||||
|
||||
// The server is picked in Settings; this screen is composed anew each time it is shown
|
||||
val selected = remember { prefs.resolve() }
|
||||
val canConnect = selected.id != Providers.CUSTOM_ID || selected.url.toHttpUrlOrNull()?.isHttps == true
|
||||
val canConnect = selected.url.toHttpUrlOrNull()?.isHttps == true
|
||||
val needsKey = selected.id == Providers.DEFAULT_ID && !canConnect
|
||||
val shown = active ?: selected
|
||||
val usesHttp3 = shown.http3 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE
|
||||
|
||||
@@ -223,6 +224,14 @@ fun HomeScreen(
|
||||
onToggle = ::toggle,
|
||||
onOpenServers = onOpenServers,
|
||||
)
|
||||
if (needsKey && !running) {
|
||||
HintCard(
|
||||
text = stringResource(R.string.key_needed),
|
||||
icon = R.drawable.ic_alert,
|
||||
tint = Palette.Accent,
|
||||
action = { TextButton(onClick = onOpenServers) { Text(stringResource(R.string.key_add)) } },
|
||||
)
|
||||
}
|
||||
PrivateDnsWarning(privateDnsHost, prefs)
|
||||
}
|
||||
val stats: @Composable () -> Unit = {
|
||||
|
||||
@@ -33,9 +33,12 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.MutableState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.saveable.Saver
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.painterResource
|
||||
@@ -54,17 +57,42 @@ class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
AppLogo.preload(this)
|
||||
// Opened by the browser at the end of the Skysparkle sign-in (not again after rotation)
|
||||
if (savedInstanceState == null) handleSignIn(intent)
|
||||
enableEdgeToEdge()
|
||||
setContent {
|
||||
MaterialTheme(colorScheme = AppColors) {
|
||||
// There is no Surface at the root, so text and icons without an explicit color
|
||||
// would fall back to black and disappear on the dark background
|
||||
CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onSurface) {
|
||||
AppShell()
|
||||
// First launch: the guide explains the access key before the app opens
|
||||
var onboarded by rememberSaveable { mutableStateOf(Prefs(this@MainActivity).onboardingDone) }
|
||||
if (onboarded) AppShell() else OnboardingScreen(onDone = { onboarded = true })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// singleTask: the sign-in callback reaches the running activity instead of opening a second one
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
setIntent(intent)
|
||||
handleSignIn(intent)
|
||||
}
|
||||
|
||||
// Back from the browser without finishing the sign-in. A real callback arrives in
|
||||
// onNewIntent, which always runs before this
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
SkysparkleSignIn.cancelWaiting()
|
||||
}
|
||||
|
||||
private fun handleSignIn(intent: Intent?) {
|
||||
val uri = intent?.data
|
||||
if (intent?.action == Intent.ACTION_VIEW && SkysparkleSignIn.isCallback(uri)) {
|
||||
SkysparkleSignIn.handle(this, uri!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class TestResult(val ok: Boolean, val text: String)
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
package cc.skysparkle.sparkledns
|
||||
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.animation.AnimatedContent
|
||||
import androidx.compose.animation.fadeIn
|
||||
import androidx.compose.animation.fadeOut
|
||||
import androidx.compose.animation.slideInHorizontally
|
||||
import androidx.compose.animation.slideOutHorizontally
|
||||
import androidx.compose.animation.togetherWith
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.imePadding
|
||||
import androidx.compose.foundation.layout.navigationBarsPadding
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.statusBarsPadding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
// Shown once on first launch: what the app does, then how to get the personal access key
|
||||
// for the Skysparkle server. Skipping leaves the key empty; other servers stay available.
|
||||
@Composable
|
||||
fun OnboardingScreen(onDone: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
val prefs = remember { Prefs(context) }
|
||||
var page by rememberSaveable { mutableIntStateOf(0) }
|
||||
var keyInput by rememberSaveable { mutableStateOf(prefs.skysparkleKey) }
|
||||
val keyValid = SkysparkleKey.parse(keyInput) != null
|
||||
|
||||
fun finish(useKey: Boolean) {
|
||||
if (useKey) {
|
||||
prefs.skysparkleKey = SkysparkleKey.parse(keyInput) ?: ""
|
||||
prefs.providerId = Providers.DEFAULT_ID
|
||||
}
|
||||
prefs.onboardingDone = true
|
||||
onDone()
|
||||
}
|
||||
|
||||
// Signed in from the guide: the key is saved, nothing is left to do here
|
||||
SignInResult { key ->
|
||||
keyInput = key
|
||||
finish(useKey = true)
|
||||
}
|
||||
|
||||
BackHandler(enabled = page > 0) { page-- }
|
||||
|
||||
Box(
|
||||
Modifier
|
||||
.fillMaxSize()
|
||||
.background(Palette.Bg)
|
||||
.statusBarsPadding()
|
||||
.navigationBarsPadding()
|
||||
.imePadding(),
|
||||
contentAlignment = Alignment.TopCenter,
|
||||
) {
|
||||
Column(
|
||||
Modifier
|
||||
.widthIn(max = 520.dp)
|
||||
.fillMaxSize()
|
||||
.padding(horizontal = 24.dp, vertical = 20.dp),
|
||||
) {
|
||||
Dots(count = 2, current = page)
|
||||
AnimatedContent(
|
||||
targetState = page,
|
||||
transitionSpec = {
|
||||
val forward = targetState > initialState
|
||||
(fadeIn(Motion.enterFade) + slideInHorizontally(Motion.slide) { if (forward) it / 4 else -it / 4 }) togetherWith
|
||||
(fadeOut(Motion.exitFade) + slideOutHorizontally(Motion.slide) { if (forward) -it / 4 else it / 4 })
|
||||
},
|
||||
modifier = Modifier.weight(1f),
|
||||
label = "onboarding",
|
||||
) { current ->
|
||||
Column(
|
||||
Modifier
|
||||
.fillMaxSize()
|
||||
.verticalScroll(rememberScrollState())
|
||||
.padding(top = 40.dp, bottom = 16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(14.dp),
|
||||
) {
|
||||
if (current == 0) {
|
||||
Image(
|
||||
bitmap = AppLogo.get(context),
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.size(72.dp)
|
||||
.clip(RoundedCornerShape(20.dp)),
|
||||
)
|
||||
Spacer(Modifier.height(8.dp))
|
||||
Title(stringResource(R.string.onb_welcome_title))
|
||||
Body(stringResource(R.string.onb_welcome_text))
|
||||
Spacer(Modifier.height(8.dp))
|
||||
Step(1, stringResource(R.string.onb_point_encrypt))
|
||||
Step(2, stringResource(R.string.onb_point_block))
|
||||
Step(3, stringResource(R.string.onb_point_independent))
|
||||
} else {
|
||||
Title(stringResource(R.string.onb_key_title))
|
||||
Body(stringResource(R.string.onb_key_text))
|
||||
Spacer(Modifier.height(4.dp))
|
||||
Step(1, stringResource(R.string.onb_key_step1))
|
||||
Step(2, stringResource(R.string.onb_key_step2))
|
||||
Step(3, stringResource(R.string.onb_key_step3))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (page == 0) {
|
||||
Button(
|
||||
onClick = { page = 1 },
|
||||
shape = RoundedCornerShape(16.dp),
|
||||
modifier = Modifier.fillMaxWidth().height(52.dp),
|
||||
) { Text(stringResource(R.string.onb_next), fontWeight = FontWeight.Bold) }
|
||||
} else {
|
||||
// The key comes only from signing in; a successful sign-in closes the guide by itself
|
||||
if (keyValid) {
|
||||
Button(
|
||||
onClick = { finish(useKey = true) },
|
||||
shape = RoundedCornerShape(16.dp),
|
||||
modifier = Modifier.fillMaxWidth().height(52.dp),
|
||||
) { Text(stringResource(R.string.onb_done), fontWeight = FontWeight.Bold) }
|
||||
} else {
|
||||
SignInButton(again = false, shape = RoundedCornerShape(16.dp), modifier = Modifier.fillMaxWidth().height(52.dp))
|
||||
}
|
||||
TextButton(onClick = { finish(useKey = false) }, modifier = Modifier.fillMaxWidth()) {
|
||||
Text(stringResource(R.string.onb_skip), color = Palette.Fg3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Title(text: String) {
|
||||
Text(text, color = Palette.Fg, fontSize = 30.sp, lineHeight = 34.sp, fontWeight = FontWeight.ExtraBold, letterSpacing = (-0.5).sp)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Body(text: String) {
|
||||
Text(text, color = Palette.Fg2, fontSize = 16.sp, lineHeight = 23.sp)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Step(number: Int, text: String) {
|
||||
Row(verticalAlignment = Alignment.Top) {
|
||||
Box(
|
||||
Modifier
|
||||
.size(26.dp)
|
||||
.clip(CircleShape)
|
||||
.background(Palette.AccentSoft),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
Text(number.toString(), color = Palette.Accent, fontSize = 13.sp, fontWeight = FontWeight.Bold)
|
||||
}
|
||||
Spacer(Modifier.width(12.dp))
|
||||
Text(text, color = Palette.Fg, fontSize = 15.sp, lineHeight = 21.sp, modifier = Modifier.padding(top = 2.dp))
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Dots(count: Int, current: Int) {
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
repeat(count) { i ->
|
||||
Box(
|
||||
Modifier
|
||||
.height(4.dp)
|
||||
.width(if (i == current) 22.dp else 10.dp)
|
||||
.clip(CircleShape)
|
||||
.background(if (i == current) Palette.Accent else Palette.Track),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,16 @@ class Prefs(context: Context) {
|
||||
get() = sp.getBoolean(KEY_HTTP3, false)
|
||||
set(value) = sp.edit().putBoolean(KEY_HTTP3, value).apply()
|
||||
|
||||
// Access key for the Skysparkle server, created in the account at skysparkle.cc
|
||||
var skysparkleKey: String
|
||||
get() = sp.getString(KEY_SKYSPARKLE, null) ?: ""
|
||||
set(value) = sp.edit().putString(KEY_SKYSPARKLE, value).apply()
|
||||
|
||||
// The first-launch guide was finished or skipped
|
||||
var onboardingDone: Boolean
|
||||
get() = sp.getBoolean(KEY_ONBOARDING, false)
|
||||
set(value) = sp.edit().putBoolean(KEY_ONBOARDING, value).apply()
|
||||
|
||||
var excludedApps: Set<String>
|
||||
get() = sp.getStringSet(KEY_EXCLUDED, null)?.toSet() ?: emptySet()
|
||||
set(value) = sp.edit().putStringSet(KEY_EXCLUDED, value).apply()
|
||||
@@ -48,12 +58,14 @@ class Prefs(context: Context) {
|
||||
get() = sp.getString(KEY_PRIVATE_DNS, null) ?: ""
|
||||
set(value) = sp.edit().putString(KEY_PRIVATE_DNS, value).apply()
|
||||
|
||||
fun resolve(): DohProvider =
|
||||
if (providerId == Providers.CUSTOM_ID) {
|
||||
// Without a key the Skysparkle entry has an empty address, so it cannot connect
|
||||
fun resolve(): DohProvider = when (providerId) {
|
||||
Providers.CUSTOM_ID ->
|
||||
DohProvider(Providers.CUSTOM_ID, "Custom", customUrl.trim(), parseIps(customBootstrap), customHttp3)
|
||||
} else {
|
||||
Providers.byId(providerId)
|
||||
else -> Providers.byId(providerId).let {
|
||||
if (it.id == Providers.DEFAULT_ID) it.copy(url = SkysparkleKey.url(skysparkleKey)) else it
|
||||
}
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val KEY_PROVIDER = "provider"
|
||||
@@ -61,6 +73,8 @@ class Prefs(context: Context) {
|
||||
const val KEY_BOOTSTRAP = "custom_bootstrap"
|
||||
const val KEY_HTTP3 = "custom_http3"
|
||||
const val KEY_EXCLUDED = "excluded_apps"
|
||||
const val KEY_SKYSPARKLE = "skysparkle_key"
|
||||
const val KEY_ONBOARDING = "onboarding_done"
|
||||
const val KEY_HINTS = "dismissed_hints"
|
||||
const val KEY_PRIVATE_DNS = "dismissed_private_dns"
|
||||
const val KEY_UPDATE_INTERVAL = "update_interval"
|
||||
|
||||
@@ -18,8 +18,9 @@ object Providers {
|
||||
|
||||
// Servers ship with the app; new ones arrive with app updates
|
||||
val builtIn = listOf(
|
||||
// The address is personal: Prefs.resolve() adds the access key from skysparkle.cc
|
||||
DohProvider(
|
||||
"skysparkle", "SkySparkle", "https://blog.skysparkle.cc/dns-query",
|
||||
"skysparkle", "SkySparkle", SkysparkleKey.BASE_URL,
|
||||
http3 = true, policy = "https://skysparkle.cc/privacy?lang=en",
|
||||
),
|
||||
DohProvider(
|
||||
@@ -58,6 +59,23 @@ object Providers {
|
||||
fun byId(id: String): DohProvider = builtIn.firstOrNull { it.id == id } ?: default
|
||||
}
|
||||
|
||||
// Personal access keys for the Skysparkle server. Each account at skysparkle.cc creates its own
|
||||
// keys; the server answers only /dns/<key>, there is no shared public address.
|
||||
object SkysparkleKey {
|
||||
const val BASE_URL = "https://skysparkle.cc/dns/"
|
||||
private val KEY = Regex("^[A-Za-z0-9_-]{24}$")
|
||||
private val IN_URL = Regex("/dns/([A-Za-z0-9_-]{24})(?:[/?#].*)?$")
|
||||
|
||||
// Accepts the key itself or the whole address copied from the account page
|
||||
fun parse(input: String): String? {
|
||||
val text = input.trim()
|
||||
if (KEY.matches(text)) return text
|
||||
return IN_URL.find(text)?.groupValues?.get(1)
|
||||
}
|
||||
|
||||
fun url(key: String): String = parse(key)?.let { BASE_URL + it } ?: ""
|
||||
}
|
||||
|
||||
fun parseIps(raw: String): List<String> =
|
||||
raw.split(',', ';', ' ').map { it.trim() }.filter { it.isNotEmpty() }
|
||||
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
package cc.skysparkle.sparkledns
|
||||
|
||||
import android.content.ClipData
|
||||
import android.content.ClipDescription
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.os.PersistableBundle
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.animation.animateColorAsState
|
||||
@@ -7,6 +14,7 @@ import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.RowScope
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
@@ -21,12 +29,16 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.LocalContentColor
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
@@ -37,6 +49,7 @@ import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.drawBehind
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.Shape
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
@@ -71,6 +84,7 @@ fun SettingsScreen(
|
||||
var customUrl by remember { mutableStateOf(prefs.customUrl) }
|
||||
var customBootstrap by remember { mutableStateOf(prefs.customBootstrap) }
|
||||
var customHttp3 by remember { mutableStateOf(prefs.customHttp3) }
|
||||
var keyInput by remember { mutableStateOf(prefs.skysparkleKey) }
|
||||
var testResult by rememberSaveable(stateSaver = TestResultSaver) { mutableStateOf<TestResult?>(null) }
|
||||
var shownResult by rememberSaveable(stateSaver = TestResultSaver) { mutableStateOf<TestResult?>(null) } // kept while the card animates out
|
||||
var testing by remember { mutableStateOf(false) }
|
||||
@@ -78,8 +92,8 @@ fun SettingsScreen(
|
||||
|
||||
val isCustom = selected == Providers.CUSTOM_ID
|
||||
val customValid = remember(customUrl) { customUrl.trim().toHttpUrlOrNull()?.isHttps == true }
|
||||
val canConnect = !isCustom || customValid
|
||||
val selectedProvider = remember(selected, customUrl, customBootstrap, customHttp3) { prefs.resolve() }
|
||||
val selectedProvider = remember(selected, customUrl, customBootstrap, customHttp3, keyInput) { prefs.resolve() }
|
||||
val canConnect = selectedProvider.url.toHttpUrlOrNull()?.isHttps == true
|
||||
|
||||
// Picking a server never touches a live connection; switching is an explicit action
|
||||
val pendingSwitch = active?.let { it != selectedProvider && canConnect } == true
|
||||
@@ -91,6 +105,13 @@ fun SettingsScreen(
|
||||
testResult = null
|
||||
}
|
||||
|
||||
// Signed in from the key field: the key is already saved, show it and select the server
|
||||
SignInResult { key ->
|
||||
keyInput = key
|
||||
selected = Providers.DEFAULT_ID
|
||||
testResult = null
|
||||
}
|
||||
|
||||
fun runTest() {
|
||||
val provider = prefs.resolve()
|
||||
testing = true
|
||||
@@ -123,6 +144,11 @@ fun SettingsScreen(
|
||||
onDonate = provider.donate?.let { url -> { openUrl(context, url) } },
|
||||
onClick = { select(provider.id) },
|
||||
)
|
||||
if (provider.id == Providers.DEFAULT_ID) {
|
||||
AnimatedVisibility(visible = selected == Providers.DEFAULT_ID, enter = Motion.expandIn, exit = Motion.collapseOut) {
|
||||
KeyField(key = keyInput)
|
||||
}
|
||||
}
|
||||
}
|
||||
ListDivider()
|
||||
ServerRow(
|
||||
@@ -252,6 +278,95 @@ fun SettingsScreen(
|
||||
}
|
||||
}
|
||||
|
||||
// Access key for the Skysparkle server. It comes only from signing in; the address can be
|
||||
// copied to use the same key in a browser or on another device
|
||||
@Composable
|
||||
internal fun KeyField(key: String, modifier: Modifier = Modifier) {
|
||||
val context = LocalContext.current
|
||||
val hasKey = SkysparkleKey.parse(key) != null
|
||||
Column(
|
||||
modifier.padding(start = 16.dp, end = 16.dp, bottom = 16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(6.dp),
|
||||
) {
|
||||
// The line keeps its text while it animates out
|
||||
val shownKey = rememberLast(key.takeIf { hasKey }).orEmpty()
|
||||
AnimatedVisibility(visible = hasKey, enter = Motion.expandIn, exit = Motion.collapseOut) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(
|
||||
stringResource(R.string.key_status, shownKey.take(4)),
|
||||
color = Palette.Fg2,
|
||||
fontSize = 13.sp,
|
||||
modifier = Modifier.weight(1f),
|
||||
)
|
||||
TextButton(onClick = { copyKeyAddress(context, shownKey) }) {
|
||||
Text(stringResource(R.string.key_copy))
|
||||
}
|
||||
}
|
||||
}
|
||||
SignInButton(again = hasKey, modifier = Modifier.fillMaxWidth())
|
||||
}
|
||||
}
|
||||
|
||||
// Starts the browser sign-in; shows progress while the app waits for it. Filled while there is
|
||||
// no key yet; once there is one, signing in again is a rare action and must not compete with
|
||||
// the filled "Switch to" button below the server list
|
||||
@Composable
|
||||
internal fun SignInButton(again: Boolean, modifier: Modifier = Modifier, shape: Shape = RoundedCornerShape(14.dp)) {
|
||||
val context = LocalContext.current
|
||||
val signIn by SkysparkleSignIn.state.collectAsStateWithLifecycle()
|
||||
val working = signIn == SkysparkleSignIn.State.Waiting || signIn == SkysparkleSignIn.State.Exchanging
|
||||
val onClick = { SkysparkleSignIn.start(context) }
|
||||
val content: @Composable RowScope.() -> Unit = {
|
||||
if (working) {
|
||||
CircularProgressIndicator(Modifier.size(16.dp), strokeWidth = 2.dp, color = LocalContentColor.current)
|
||||
Spacer(Modifier.width(10.dp))
|
||||
}
|
||||
Text(
|
||||
stringResource(if (working) R.string.sign_in_working else if (again) R.string.sign_in_again else R.string.sign_in),
|
||||
fontWeight = if (again) null else FontWeight.Bold,
|
||||
)
|
||||
}
|
||||
if (again) {
|
||||
OutlinedButton(onClick = onClick, enabled = !working, shape = shape, modifier = modifier, content = content)
|
||||
} else {
|
||||
Button(onClick = onClick, enabled = !working, shape = shape, modifier = modifier, content = content)
|
||||
}
|
||||
}
|
||||
|
||||
// The key is personal, so the clipboard is told to hide it from previews (Android 13+),
|
||||
// and Android 13+ confirms the copy itself
|
||||
private fun copyKeyAddress(context: Context, key: String) {
|
||||
val clip = ClipData.newPlainText("SkySparkle", SkysparkleKey.url(key))
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
clip.description.extras = PersistableBundle().apply { putBoolean(ClipDescription.EXTRA_IS_SENSITIVE, true) }
|
||||
}
|
||||
context.getSystemService(ClipboardManager::class.java).setPrimaryClip(clip)
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
Toast.makeText(context, R.string.key_copied, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
||||
// Result of the Skysparkle sign-in, shown once on the screen that started it
|
||||
@Composable
|
||||
internal fun SignInResult(onKey: (String) -> Unit) {
|
||||
val context = LocalContext.current
|
||||
val signIn by SkysparkleSignIn.state.collectAsStateWithLifecycle()
|
||||
LaunchedEffect(signIn) {
|
||||
when (val s = signIn) {
|
||||
is SkysparkleSignIn.State.Done -> {
|
||||
onKey(s.key)
|
||||
Toast.makeText(context, R.string.sign_in_done, Toast.LENGTH_SHORT).show()
|
||||
SkysparkleSignIn.consume()
|
||||
}
|
||||
is SkysparkleSignIn.State.Failed -> {
|
||||
Toast.makeText(context, s.message, Toast.LENGTH_LONG).show()
|
||||
SkysparkleSignIn.consume()
|
||||
}
|
||||
else -> Unit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ServerRow(
|
||||
title: String,
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
package cc.skysparkle.sparkledns
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.util.Base64
|
||||
import android.util.Log
|
||||
import androidx.annotation.StringRes
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import okhttp3.MediaType.Companion.toMediaType
|
||||
import okhttp3.Request
|
||||
import okhttp3.RequestBody.Companion.toRequestBody
|
||||
import org.json.JSONObject
|
||||
import java.io.IOException
|
||||
import java.security.MessageDigest
|
||||
import java.security.SecureRandom
|
||||
|
||||
// Sign-in with a Skysparkle account: the app gets its access key without copying it by hand.
|
||||
//
|
||||
// OAuth for native apps (RFC 8252) with PKCE (RFC 7636): the account page opens in the browser,
|
||||
// so the password never passes through the app. After "Connect" the site opens
|
||||
// https://skysparkle.cc/app/callback?code=…&state=… through an intent:// link that names this
|
||||
// package, so Android delivers it only to this app, and the app trades the one-time code for a
|
||||
// new key. Only this app knows the verifier, so even a code that leaked somewhere is useless.
|
||||
object SkysparkleSignIn {
|
||||
private const val CONNECT_URL = "https://skysparkle.cc/app/connect"
|
||||
private const val TOKEN_URL = "https://skysparkle.cc/api/app/token"
|
||||
private const val CALLBACK_HOST = "skysparkle.cc"
|
||||
private const val CALLBACK_PATH = "/app/callback"
|
||||
|
||||
// The browser step must be finished within this time (the site keeps codes for 5 minutes)
|
||||
private const val PENDING_TTL_MS = 30 * 60_000L
|
||||
|
||||
sealed interface State {
|
||||
data object Idle : State
|
||||
data object Waiting : State
|
||||
data object Exchanging : State
|
||||
data class Done(val key: String) : State
|
||||
data class Failed(@StringRes val message: Int) : State
|
||||
}
|
||||
|
||||
private val _state = MutableStateFlow<State>(State.Idle)
|
||||
val state: StateFlow<State> = _state.asStateFlow()
|
||||
|
||||
// Not tied to a screen: rotating or leaving the screen must not cancel the exchange
|
||||
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||
|
||||
fun isCallback(uri: Uri?): Boolean =
|
||||
uri?.scheme == "https" && uri.host == CALLBACK_HOST && uri.path == CALLBACK_PATH
|
||||
|
||||
// Opens the account page. Verifier and state are kept on disk: the system may stop the app
|
||||
// while the browser is in front.
|
||||
fun start(context: Context) {
|
||||
val verifier = randomToken(32)
|
||||
val state = randomToken(24)
|
||||
pending(context).edit()
|
||||
.putString(P_VERIFIER, verifier)
|
||||
.putString(P_STATE, state)
|
||||
.putLong(P_AT, System.currentTimeMillis())
|
||||
.apply()
|
||||
val url = Uri.parse(CONNECT_URL).buildUpon()
|
||||
.appendQueryParameter("challenge", challengeOf(verifier))
|
||||
.appendQueryParameter("state", state)
|
||||
.appendQueryParameter("device", Build.MODEL.take(40))
|
||||
.build()
|
||||
_state.value = State.Waiting
|
||||
try {
|
||||
context.startActivity(Intent(Intent.ACTION_VIEW, url).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
|
||||
} catch (e: RuntimeException) {
|
||||
Log.w("SparkleDNS", "Cannot open the sign-in page", e)
|
||||
_state.value = State.Failed(R.string.no_browser)
|
||||
}
|
||||
}
|
||||
|
||||
// The browser came back to the app: check state, then trade the code for a key.
|
||||
fun handle(context: Context, uri: Uri) {
|
||||
val app = context.applicationContext
|
||||
val p = pending(app)
|
||||
val state = p.getString(P_STATE, null)
|
||||
val verifier = p.getString(P_VERIFIER, null)
|
||||
val fresh = System.currentTimeMillis() - p.getLong(P_AT, 0) < PENDING_TTL_MS
|
||||
if (state == null || verifier == null || !fresh || uri.getQueryParameter("state") != state) {
|
||||
// A link that this app did not start, an old one, or a second tap on "Open SparkleDNS"
|
||||
// while the first code is still being exchanged: ignore it, keep any progress shown
|
||||
cancelWaiting()
|
||||
return
|
||||
}
|
||||
p.edit().clear().apply()
|
||||
if (uri.getQueryParameter("error") != null) {
|
||||
_state.value = State.Idle // "Cancel" on the site
|
||||
return
|
||||
}
|
||||
val code = uri.getQueryParameter("code")
|
||||
if (code.isNullOrEmpty()) {
|
||||
_state.value = State.Failed(R.string.sign_in_failed)
|
||||
return
|
||||
}
|
||||
_state.value = State.Exchanging
|
||||
scope.launch {
|
||||
_state.value = when (val r = exchange(code, verifier)) {
|
||||
is Result.Key -> {
|
||||
Prefs(app).apply {
|
||||
skysparkleKey = r.key
|
||||
providerId = Providers.DEFAULT_ID
|
||||
}
|
||||
State.Done(r.key)
|
||||
}
|
||||
is Result.Error -> State.Failed(r.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The screen showed the result; the next sign-in starts clean
|
||||
fun consume() {
|
||||
val s = _state.value
|
||||
if (s is State.Done || s is State.Failed) _state.value = State.Idle
|
||||
}
|
||||
|
||||
// Returning from the browser without finishing (back button) should not leave a spinner
|
||||
fun cancelWaiting() {
|
||||
if (_state.value == State.Waiting) _state.value = State.Idle
|
||||
}
|
||||
|
||||
private sealed interface Result {
|
||||
class Key(val key: String) : Result
|
||||
class Error(@StringRes val message: Int) : Result
|
||||
}
|
||||
|
||||
private fun exchange(code: String, verifier: String): Result {
|
||||
val body = JSONObject().put("code", code).put("verifier", verifier).toString()
|
||||
.toRequestBody("application/json".toMediaType())
|
||||
val request = Request.Builder().url(TOKEN_URL).post(body).build()
|
||||
return try {
|
||||
Http.client.newCall(request).execute().use { response ->
|
||||
val json = runCatching { JSONObject(response.body.string()) }.getOrNull()
|
||||
val key = json?.optString("key").orEmpty()
|
||||
when {
|
||||
response.isSuccessful && SkysparkleKey.parse(key) != null -> Result.Key(key)
|
||||
json?.optString("error") == "verify_email_first" -> Result.Error(R.string.sign_in_verify)
|
||||
json?.optString("error") == "invalid_grant" -> Result.Error(R.string.sign_in_expired)
|
||||
json?.optString("error") == "account_suspended" -> Result.Error(R.string.sign_in_suspended)
|
||||
else -> Result.Error(R.string.sign_in_failed)
|
||||
}
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
Log.w("SparkleDNS", "Key exchange failed", e)
|
||||
Result.Error(R.string.sign_in_network)
|
||||
} catch (e: RuntimeException) {
|
||||
// Runs in a scope without an exception handler: anything that escaped would crash the app
|
||||
Log.w("SparkleDNS", "Key exchange failed", e)
|
||||
Result.Error(R.string.sign_in_failed)
|
||||
}
|
||||
}
|
||||
|
||||
private fun pending(context: Context) =
|
||||
context.applicationContext.getSharedPreferences("sign_in", Context.MODE_PRIVATE)
|
||||
|
||||
private val random = SecureRandom()
|
||||
|
||||
private fun randomToken(bytes: Int): String =
|
||||
b64url(ByteArray(bytes).also(random::nextBytes))
|
||||
|
||||
private fun challengeOf(verifier: String): String =
|
||||
b64url(MessageDigest.getInstance("SHA-256").digest(verifier.toByteArray(Charsets.US_ASCII)))
|
||||
|
||||
private fun b64url(data: ByteArray): String =
|
||||
Base64.encodeToString(data, Base64.URL_SAFE or Base64.NO_PADDING or Base64.NO_WRAP)
|
||||
|
||||
private const val P_VERIFIER = "verifier"
|
||||
private const val P_STATE = "state"
|
||||
private const val P_AT = "at"
|
||||
}
|
||||
@@ -138,4 +138,35 @@
|
||||
<string name="alert_bad_url_text">Die Serveradresse ist keine gültige HTTPS-URL. Öffne SparkleDNS und prüfe den Server.</string>
|
||||
<string name="alert_lockdown_title">DNS-Server nicht erreichbar</string>
|
||||
<string name="alert_lockdown_text">„Verbindungen ohne VPN blockieren“ ist aktiv, daher erreicht SparkleDNS den DNS-Server nicht und Anfragen schlagen fehl. Schalte es in den VPN-Einstellungen von Android aus.</string>
|
||||
<string name="sign_in">Mit Skysparkle anmelden</string>
|
||||
<string name="sign_in_again">Erneut anmelden</string>
|
||||
<string name="sign_in_working">Anmeldung läuft…</string>
|
||||
<string name="key_status">Schlüssel hinzugefügt: %1$s…</string>
|
||||
<string name="key_copy">Adresse kopieren</string>
|
||||
<string name="key_copied">Adresse kopiert. Füge sie im Browser oder auf einem anderen Gerät ein.</string>
|
||||
<string name="sign_in_done">Angemeldet. Der Schlüssel wurde hinzugefügt.</string>
|
||||
<string name="sign_in_failed">Anmeldung fehlgeschlagen. Bitte versuche es erneut.</string>
|
||||
<string name="sign_in_expired">Die Anmeldung hat zu lange gedauert. Bitte starte sie neu.</string>
|
||||
<string name="sign_in_verify">Bestätige zuerst deine E-Mail-Adresse und melde dich dann erneut an.</string>
|
||||
<string name="sign_in_suspended">Dieses Skysparkle-Konto ist gesperrt.</string>
|
||||
<string name="sign_in_network">Keine Verbindung zu skysparkle.cc. Prüfe das Internet und versuche es erneut.</string>
|
||||
<string name="key_needed">Der SkySparkle-Server braucht einen persönlichen Zugangsschlüssel. Er ist kostenlos: Melde dich mit Skysparkle an, und die App holt den Schlüssel selbst.</string>
|
||||
<string name="key_add">Anmelden</string>
|
||||
<string name="alert_no_key_text">Der SkySparkle-Server braucht einen Zugangsschlüssel. Öffne SparkleDNS und melde dich unter Einstellungen mit Skysparkle an.</string>
|
||||
<string name="onb_welcome_title">Willkommen bei SparkleDNS</string>
|
||||
<string name="onb_welcome_text">Privates DNS für dein ganzes Handy, ohne Server der großen Tech-Konzerne.</string>
|
||||
<string name="onb_point_encrypt">Verschlüsselt jede DNS-Anfrage mit DNS-over-HTTPS</string>
|
||||
<string name="onb_point_block">Blockiert Werbung und Tracker in allen Apps</string>
|
||||
<string name="onb_point_independent">Nur unabhängige Server, nie Google oder Cloudflare</string>
|
||||
<string name="onb_key_title">Hol dir deinen Zugangsschlüssel</string>
|
||||
<string name="onb_key_text">Der SkySparkle-Server arbeitet mit einem persönlichen Schlüssel. Er ist kostenlos: Melde dich an, und die App holt den Schlüssel selbst.</string>
|
||||
<string name="onb_key_step1">Tippe auf „Mit Skysparkle anmelden“ – die Seite öffnet sich im Browser</string>
|
||||
<string name="onb_key_step2">Melde dich an oder erstelle ein kostenloses Konto</string>
|
||||
<string name="onb_key_step3">Tippe auf „Connect“ – du kommst mit dem Schlüssel hierher zurück</string>
|
||||
<string name="onb_next">Weiter</string>
|
||||
<string name="onb_done">Starten</string>
|
||||
<string name="onb_skip">Überspringen, ich wähle einen anderen Server</string>
|
||||
<string name="support_title">SparkleDNS unterstützen</string>
|
||||
<string name="support_text">SparkleDNS ist kostenlos, quelloffen und werbefrei. Spenden finanzieren den Skysparkle-Server und halten die App am Leben.</string>
|
||||
<string name="support_button">Auf Ko-fi spenden</string>
|
||||
</resources>
|
||||
|
||||
@@ -138,4 +138,35 @@
|
||||
<string name="alert_bad_url_text">サーバーのアドレスが有効な HTTPS URL ではありません。SparkleDNS を開いてサーバーを確認してください。</string>
|
||||
<string name="alert_lockdown_title">DNS サーバーに接続できません</string>
|
||||
<string name="alert_lockdown_text">「VPN なしの接続をブロック」がオンのため、SparkleDNS は DNS サーバーに接続できず、名前解決に失敗します。Android の VPN 設定でオフにしてください。</string>
|
||||
<string name="sign_in">Skysparkle でサインイン</string>
|
||||
<string name="sign_in_again">もう一度サインイン</string>
|
||||
<string name="sign_in_working">サインイン中…</string>
|
||||
<string name="key_status">キーを追加済み:%1$s…</string>
|
||||
<string name="key_copy">アドレスをコピー</string>
|
||||
<string name="key_copied">アドレスをコピーしました。ブラウザや他のデバイスに貼り付けてください。</string>
|
||||
<string name="sign_in_done">サインインしました。キーを追加しました。</string>
|
||||
<string name="sign_in_failed">サインインに失敗しました。もう一度お試しください。</string>
|
||||
<string name="sign_in_expired">サインインに時間がかかりすぎました。最初からやり直してください。</string>
|
||||
<string name="sign_in_verify">先にメールアドレスを確認してから、もう一度サインインしてください。</string>
|
||||
<string name="sign_in_suspended">この Skysparkle アカウントは停止されています。</string>
|
||||
<string name="sign_in_network">skysparkle.cc に接続できません。インターネット接続を確認して、もう一度お試しください。</string>
|
||||
<string name="key_needed">SkySparkle サーバーには個人用のアクセスキーが必要です。無料です:Skysparkle でサインインすると、アプリが自動でキーを取得します。</string>
|
||||
<string name="key_add">サインイン</string>
|
||||
<string name="alert_no_key_text">SkySparkle サーバーにはアクセスキーが必要です。SparkleDNS を開き、「設定」で Skysparkle にサインインしてください。</string>
|
||||
<string name="onb_welcome_title">SparkleDNS へようこそ</string>
|
||||
<string name="onb_welcome_text">大手 IT 企業のサーバーを使わない、スマホ全体のプライベート DNS。</string>
|
||||
<string name="onb_point_encrypt">DNS-over-HTTPS ですべての DNS 問い合わせを暗号化</string>
|
||||
<string name="onb_point_block">すべてのアプリで広告とトラッカーをブロック</string>
|
||||
<string name="onb_point_independent">独立系サーバーのみ。Google や Cloudflare は使いません</string>
|
||||
<string name="onb_key_title">アクセスキーを取得</string>
|
||||
<string name="onb_key_text">SkySparkle サーバーは個人用キーで動作します。無料です:サインインすると、アプリが自動でキーを取得します。</string>
|
||||
<string name="onb_key_step1">「Skysparkle でサインイン」をタップ — ブラウザでサイトが開きます</string>
|
||||
<string name="onb_key_step2">サインインするか、無料アカウントを作成</string>
|
||||
<string name="onb_key_step3">「Connect」をタップ — キーを持ってここに戻ります</string>
|
||||
<string name="onb_next">次へ</string>
|
||||
<string name="onb_done">開始</string>
|
||||
<string name="onb_skip">スキップして別のサーバーを選ぶ</string>
|
||||
<string name="support_title">SparkleDNS を応援する</string>
|
||||
<string name="support_text">SparkleDNS は無料・オープンソースで、広告もありません。寄付は Skysparkle サーバーの運営とアプリの開発に使われます。</string>
|
||||
<string name="support_button">Ko-fi で寄付する</string>
|
||||
</resources>
|
||||
|
||||
@@ -138,4 +138,35 @@
|
||||
<string name="alert_bad_url_text">Serverio adresas nėra tinkamas HTTPS adresas. Atidarykite SparkleDNS ir patikrinkite serverį.</string>
|
||||
<string name="alert_lockdown_title">DNS serveris nepasiekiamas</string>
|
||||
<string name="alert_lockdown_text">Įjungta „Blokuoti ryšius be VPN“, todėl SparkleDNS negali pasiekti DNS serverio ir užklausos nepavyksta. Išjunkite tai Android VPN nustatymuose.</string>
|
||||
<string name="sign_in">Prisijungti su Skysparkle</string>
|
||||
<string name="sign_in_again">Prisijungti iš naujo</string>
|
||||
<string name="sign_in_working">Jungiamasi…</string>
|
||||
<string name="key_status">Raktas pridėtas: %1$s…</string>
|
||||
<string name="key_copy">Kopijuoti adresą</string>
|
||||
<string name="key_copied">Adresas nukopijuotas. Įklijuokite jį naršyklėje arba kitame įrenginyje.</string>
|
||||
<string name="sign_in_done">Prisijungta. Raktas pridėtas.</string>
|
||||
<string name="sign_in_failed">Prisijungti nepavyko. Bandykite dar kartą.</string>
|
||||
<string name="sign_in_expired">Prisijungimas užtruko per ilgai. Pradėkite iš naujo.</string>
|
||||
<string name="sign_in_verify">Pirmiausia patvirtinkite el. paštą, tada prisijunkite dar kartą.</string>
|
||||
<string name="sign_in_suspended">Ši Skysparkle paskyra sustabdyta.</string>
|
||||
<string name="sign_in_network">Nėra ryšio su skysparkle.cc. Patikrinkite internetą ir bandykite dar kartą.</string>
|
||||
<string name="key_needed">SkySparkle serveriui reikia asmeninio prieigos rakto. Tai nemokama: prisijunkite su Skysparkle, ir programėlė gaus raktą pati.</string>
|
||||
<string name="key_add">Prisijungti</string>
|
||||
<string name="alert_no_key_text">SkySparkle serveriui reikia prieigos rakto. Atidarykite SparkleDNS ir skiltyje „Nustatymai“ prisijunkite su Skysparkle.</string>
|
||||
<string name="onb_welcome_title">Sveiki atvykę į SparkleDNS</string>
|
||||
<string name="onb_welcome_text">Privatus DNS visam telefonui, be didžiųjų technologijų įmonių serverių.</string>
|
||||
<string name="onb_point_encrypt">Šifruoja kiekvieną DNS užklausą per DNS-over-HTTPS</string>
|
||||
<string name="onb_point_block">Blokuoja reklamas ir sekiklius visose programėlėse</string>
|
||||
<string name="onb_point_independent">Tik nepriklausomi serveriai, jokio Google ar Cloudflare</string>
|
||||
<string name="onb_key_title">Gaukite prieigos raktą</string>
|
||||
<string name="onb_key_text">SkySparkle serveris veikia su asmeniniu raktu. Tai nemokama: prisijunkite, ir programėlė gaus raktą pati.</string>
|
||||
<string name="onb_key_step1">Paspauskite „Prisijungti su Skysparkle“ – svetainė atsidarys naršyklėje</string>
|
||||
<string name="onb_key_step2">Prisijunkite arba susikurkite nemokamą paskyrą</string>
|
||||
<string name="onb_key_step3">Paspauskite „Prijungti“ – grįšite čia su raktu</string>
|
||||
<string name="onb_next">Toliau</string>
|
||||
<string name="onb_done">Pradėti</string>
|
||||
<string name="onb_skip">Praleisti, pasirinksiu kitą serverį</string>
|
||||
<string name="support_title">Paremti SparkleDNS</string>
|
||||
<string name="support_text">SparkleDNS nemokama, atvirojo kodo ir be reklamų. Aukos padengia Skysparkle serverio išlaidas ir padeda programėlei gyvuoti.</string>
|
||||
<string name="support_button">Paaukoti per Ko-fi</string>
|
||||
</resources>
|
||||
|
||||
@@ -138,4 +138,35 @@
|
||||
<string name="alert_bad_url_text">Адрес сервера не является корректным HTTPS-адресом. Откройте SparkleDNS и проверьте сервер.</string>
|
||||
<string name="alert_lockdown_title">DNS-сервер недоступен</string>
|
||||
<string name="alert_lockdown_text">Включено «Блокировать соединения без VPN», поэтому SparkleDNS не может связаться с DNS-сервером и запросы не проходят. Отключите это в настройках VPN Android.</string>
|
||||
<string name="sign_in">Войти через Skysparkle</string>
|
||||
<string name="sign_in_again">Войти заново</string>
|
||||
<string name="sign_in_working">Выполняется вход…</string>
|
||||
<string name="key_status">Ключ добавлен: %1$s…</string>
|
||||
<string name="key_copy">Скопировать адрес</string>
|
||||
<string name="key_copied">Адрес скопирован. Вставьте его в браузер или на другом устройстве.</string>
|
||||
<string name="sign_in_done">Вход выполнен. Ключ добавлен.</string>
|
||||
<string name="sign_in_failed">Не удалось войти. Попробуйте ещё раз.</string>
|
||||
<string name="sign_in_expired">Вход занял слишком много времени. Начните заново.</string>
|
||||
<string name="sign_in_verify">Сначала подтвердите e-mail, затем войдите ещё раз.</string>
|
||||
<string name="sign_in_suspended">Этот аккаунт Skysparkle заблокирован.</string>
|
||||
<string name="sign_in_network">Нет связи с skysparkle.cc. Проверьте интернет и попробуйте ещё раз.</string>
|
||||
<string name="key_needed">Серверу SkySparkle нужен личный ключ доступа. Это бесплатно: войдите через Skysparkle, и приложение получит ключ само.</string>
|
||||
<string name="key_add">Войти</string>
|
||||
<string name="alert_no_key_text">Серверу SkySparkle нужен ключ доступа. Откройте SparkleDNS и войдите через Skysparkle в разделе «Настройки».</string>
|
||||
<string name="onb_welcome_title">Добро пожаловать в SparkleDNS</string>
|
||||
<string name="onb_welcome_text">Приватный DNS для всего телефона, без серверов крупных корпораций.</string>
|
||||
<string name="onb_point_encrypt">Шифрует каждый DNS-запрос через DNS-over-HTTPS</string>
|
||||
<string name="onb_point_block">Блокирует рекламу и трекеры во всех приложениях</string>
|
||||
<string name="onb_point_independent">Только независимые серверы, без Google и Cloudflare</string>
|
||||
<string name="onb_key_title">Получите ключ доступа</string>
|
||||
<string name="onb_key_text">Сервер SkySparkle работает по личному ключу. Это бесплатно: войдите, и приложение получит ключ само.</string>
|
||||
<string name="onb_key_step1">Нажмите «Войти через Skysparkle» — сайт откроется в браузере</string>
|
||||
<string name="onb_key_step2">Войдите или создайте бесплатный аккаунт</string>
|
||||
<string name="onb_key_step3">Нажмите «Connect» — вы вернётесь сюда уже с ключом</string>
|
||||
<string name="onb_next">Далее</string>
|
||||
<string name="onb_done">Начать</string>
|
||||
<string name="onb_skip">Пропустить, выберу другой сервер</string>
|
||||
<string name="support_title">Поддержать SparkleDNS</string>
|
||||
<string name="support_text">SparkleDNS бесплатное, с открытым кодом и без рекламы. Пожертвования оплачивают сервер Skysparkle и помогают приложению развиваться.</string>
|
||||
<string name="support_button">Пожертвовать через Ko-fi</string>
|
||||
</resources>
|
||||
|
||||
@@ -138,4 +138,35 @@
|
||||
<string name="alert_bad_url_text">服务器地址不是有效的 HTTPS 网址。请打开 SparkleDNS 检查服务器。</string>
|
||||
<string name="alert_lockdown_title">无法连接 DNS 服务器</string>
|
||||
<string name="alert_lockdown_text">已开启“屏蔽未使用 VPN 的连接”,SparkleDNS 无法连接 DNS 服务器,解析会失败。请在 Android 的 VPN 设置中关闭该选项。</string>
|
||||
<string name="sign_in">使用 Skysparkle 登录</string>
|
||||
<string name="sign_in_again">重新登录</string>
|
||||
<string name="sign_in_working">正在登录…</string>
|
||||
<string name="key_status">已添加密钥:%1$s…</string>
|
||||
<string name="key_copy">复制地址</string>
|
||||
<string name="key_copied">地址已复制。可粘贴到浏览器或其他设备中。</string>
|
||||
<string name="sign_in_done">已登录,密钥已添加。</string>
|
||||
<string name="sign_in_failed">登录失败,请重试。</string>
|
||||
<string name="sign_in_expired">登录耗时过长,请重新开始。</string>
|
||||
<string name="sign_in_verify">请先确认电子邮箱,然后重新登录。</string>
|
||||
<string name="sign_in_suspended">此 Skysparkle 账户已被暂停。</string>
|
||||
<string name="sign_in_network">无法连接 skysparkle.cc。请检查网络后重试。</string>
|
||||
<string name="key_needed">SkySparkle 服务器需要个人访问密钥。完全免费:使用 Skysparkle 登录,应用会自动获取密钥。</string>
|
||||
<string name="key_add">登录</string>
|
||||
<string name="alert_no_key_text">SkySparkle 服务器需要访问密钥。请打开 SparkleDNS,在“设置”中使用 Skysparkle 登录。</string>
|
||||
<string name="onb_welcome_title">欢迎使用 SparkleDNS</string>
|
||||
<string name="onb_welcome_text">为整部手机提供私密 DNS,不使用大型科技公司的服务器。</string>
|
||||
<string name="onb_point_encrypt">通过 DNS-over-HTTPS 加密每一次 DNS 查询</string>
|
||||
<string name="onb_point_block">在所有应用中拦截广告和跟踪器</string>
|
||||
<string name="onb_point_independent">只使用独立服务器,不用 Google 或 Cloudflare</string>
|
||||
<string name="onb_key_title">获取访问密钥</string>
|
||||
<string name="onb_key_text">SkySparkle 服务器使用个人密钥。完全免费:登录后,应用会自动获取密钥。</string>
|
||||
<string name="onb_key_step1">点击“使用 Skysparkle 登录”——网站将在浏览器中打开</string>
|
||||
<string name="onb_key_step2">登录或创建免费账户</string>
|
||||
<string name="onb_key_step3">点击“Connect”——带着密钥回到这里</string>
|
||||
<string name="onb_next">下一步</string>
|
||||
<string name="onb_done">开始</string>
|
||||
<string name="onb_skip">跳过,我选择其他服务器</string>
|
||||
<string name="support_title">支持 SparkleDNS</string>
|
||||
<string name="support_text">SparkleDNS 免费、开源且无广告。捐助用于支付 Skysparkle 服务器的费用,让应用持续发展。</string>
|
||||
<string name="support_button">通过 Ko-fi 捐助</string>
|
||||
</resources>
|
||||
|
||||
@@ -139,4 +139,35 @@
|
||||
<string name="alert_bad_url_text">The server address is not a valid HTTPS URL. Open SparkleDNS and check the server.</string>
|
||||
<string name="alert_lockdown_title">DNS server unreachable</string>
|
||||
<string name="alert_lockdown_text">\"Block connections without VPN\" is on, so SparkleDNS cannot reach the DNS server and lookups fail. Turn it off in Android VPN settings.</string>
|
||||
<string name="sign_in">Sign in with Skysparkle</string>
|
||||
<string name="sign_in_again">Sign in again</string>
|
||||
<string name="sign_in_working">Signing in…</string>
|
||||
<string name="key_status">Key added: %1$s…</string>
|
||||
<string name="key_copy">Copy address</string>
|
||||
<string name="key_copied">Address copied. Paste it in a browser or on another device.</string>
|
||||
<string name="sign_in_done">Signed in. The key has been added.</string>
|
||||
<string name="sign_in_failed">Sign-in failed. Please try again.</string>
|
||||
<string name="sign_in_expired">The sign-in took too long. Please start again.</string>
|
||||
<string name="sign_in_verify">Confirm your e-mail first, then sign in again.</string>
|
||||
<string name="sign_in_suspended">This Skysparkle account is suspended.</string>
|
||||
<string name="sign_in_network">No connection to skysparkle.cc. Check the internet and try again.</string>
|
||||
<string name="key_needed">The SkySparkle server needs a personal access key. It is free: sign in with Skysparkle and the app gets the key by itself.</string>
|
||||
<string name="key_add">Sign in</string>
|
||||
<string name="alert_no_key_text">The SkySparkle server needs an access key. Open SparkleDNS and sign in with Skysparkle in Settings.</string>
|
||||
<string name="onb_welcome_title">Welcome to SparkleDNS</string>
|
||||
<string name="onb_welcome_text">Private DNS for your whole phone, without big-tech servers.</string>
|
||||
<string name="onb_point_encrypt">Encrypts every DNS lookup with DNS-over-HTTPS</string>
|
||||
<string name="onb_point_block">Blocks ads and trackers in all apps</string>
|
||||
<string name="onb_point_independent">Uses only independent servers, never Google or Cloudflare</string>
|
||||
<string name="onb_key_title">Get your access key</string>
|
||||
<string name="onb_key_text">The SkySparkle server works with a personal key. It is free: sign in, and the app gets the key by itself.</string>
|
||||
<string name="onb_key_step1">Tap “Sign in with Skysparkle” — the site opens in your browser</string>
|
||||
<string name="onb_key_step2">Sign in or create a free account</string>
|
||||
<string name="onb_key_step3">Tap “Connect” — you are back here with the key</string>
|
||||
<string name="onb_next">Next</string>
|
||||
<string name="onb_done">Start</string>
|
||||
<string name="onb_skip">Skip, I\'ll choose another server</string>
|
||||
<string name="support_title">Support SparkleDNS</string>
|
||||
<string name="support_text">SparkleDNS is free, open source and has no ads. Donations pay for the Skysparkle server and keep the app going.</string>
|
||||
<string name="support_button">Donate on Ko-fi</string>
|
||||
</resources>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 139 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 519 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 391 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" rx="22" fill="#09090a"/><g transform="translate(7 7) scale(.86)" fill="#ededea"><path d="M51.70 6.81 L64.50 35.50 L93.19 48.30 L59.30 48.30 L51.70 40.70 Z"/><path transform="rotate(90 50 50)" d="M51.70 6.81 L64.50 35.50 L93.19 48.30 L59.30 48.30 L51.70 40.70 Z"/><path transform="rotate(180 50 50)" d="M51.70 6.81 L64.50 35.50 L93.19 48.30 L59.30 48.30 L51.70 40.70 Z"/><path transform="rotate(270 50 50)" d="M51.70 6.81 L64.50 35.50 L93.19 48.30 L59.30 48.30 L51.70 40.70 Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 581 B |
@@ -0,0 +1 @@
|
||||
• Der SkySparkle-Server nutzt jetzt die Adresse skysparkle.cc/dns-query
|
||||
@@ -0,0 +1,2 @@
|
||||
• Der SkySparkle-Server funktioniert jetzt mit einem persönlichen Schlüssel: Erstelle einen kostenlosen Schlüssel auf skysparkle.cc und gib ihn in den Einstellungen ein
|
||||
• Neue Einführung beim ersten Start erklärt, wie du einen Schlüssel bekommst
|
||||
@@ -0,0 +1 @@
|
||||
• The SkySparkle server now uses the address skysparkle.cc/dns-query
|
||||
@@ -0,0 +1,2 @@
|
||||
• The SkySparkle server now works with a personal key: create a free key at skysparkle.cc and enter it in Settings
|
||||
• New first-launch guide that explains how to get a key
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 519 KiB After Width: | Height: | Size: 391 KiB |
@@ -0,0 +1 @@
|
||||
• SkySparkle サーバーのアドレスが skysparkle.cc/dns-query に変わりました
|
||||
@@ -0,0 +1,2 @@
|
||||
• SkySparkle サーバーは個人キーで利用するようになりました。skysparkle.cc で無料のキーを作成し、設定に入力してください
|
||||
• 初回起動時にキーの取得方法を説明するガイドを追加しました
|
||||
@@ -0,0 +1 @@
|
||||
• SkySparkle serveris dabar naudoja adresą skysparkle.cc/dns-query
|
||||
@@ -0,0 +1,2 @@
|
||||
• SkySparkle serveris dabar veikia su asmeniniu raktu: susikurkite nemokamą raktą skysparkle.cc ir įveskite jį nustatymuose
|
||||
• Naujas pirmojo paleidimo gidas paaiškina, kaip gauti raktą
|
||||
@@ -0,0 +1 @@
|
||||
• Сервер SkySparkle теперь работает по адресу skysparkle.cc/dns-query
|
||||
@@ -0,0 +1,2 @@
|
||||
• Сервер SkySparkle теперь работает по личному ключу: создайте бесплатный ключ на skysparkle.cc и введите его в настройках
|
||||
• Новый гайд при первом запуске объясняет, как получить ключ
|
||||
@@ -0,0 +1 @@
|
||||
• SkySparkle 服务器地址已更改为 skysparkle.cc/dns-query
|
||||
@@ -0,0 +1,2 @@
|
||||
• SkySparkle 服务器现在需要个人密钥:在 skysparkle.cc 免费创建密钥,然后在设置中输入
|
||||
• 新增首次启动引导,说明如何获取密钥
|
||||
Reference in New Issue
Block a user