Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #41

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

Dev #41

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified app/release.keystore
Binary file not shown.
2 changes: 0 additions & 2 deletions app/src/main/java/io/nekohasekai/sfa/bg/BoxService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ class BoxService(
}

DefaultNetworkMonitor.start()
Libbox.registerLocalDNSTransport(LocalResolver)
Libbox.setMemoryLimit(!Settings.disableMemoryLimit)

val newService = try {
Expand Down Expand Up @@ -263,7 +262,6 @@ class BoxService(
}
commandServer?.setService(null)
boxService = null
Libbox.registerLocalDNSTransport(null)
DefaultNetworkMonitor.stop()

commandServer?.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import android.util.Log
import androidx.annotation.RequiresApi
import io.nekohasekai.libbox.InterfaceUpdateListener
import io.nekohasekai.libbox.Libbox
import io.nekohasekai.libbox.LocalDNSTransport
import io.nekohasekai.libbox.NetworkInterfaceIterator
import io.nekohasekai.libbox.PlatformInterface
import io.nekohasekai.libbox.StringIterator
Expand All @@ -20,6 +21,9 @@ import java.net.Inet6Address
import java.net.InetSocketAddress
import java.net.InterfaceAddress
import java.net.NetworkInterface
import java.security.KeyStore
import kotlin.io.encoding.Base64
import kotlin.io.encoding.ExperimentalEncodingApi
import io.nekohasekai.libbox.NetworkInterface as LibboxNetworkInterface

interface PlatformInterfaceWrapper : PlatformInterface {
Expand Down Expand Up @@ -169,6 +173,27 @@ interface PlatformInterfaceWrapper : PlatformInterface {
return WIFIState(ssid, wifiInfo.bssid)
}

override fun localDNSTransport(): LocalDNSTransport? {
return LocalResolver
}

@OptIn(ExperimentalEncodingApi::class)
override fun systemCertificates(): StringIterator {
val certificates = mutableListOf<String>()
val keyStore = KeyStore.getInstance("AndroidCAStore")
if (keyStore != null) {
keyStore.load(null, null);
val aliases = keyStore.aliases()
while (aliases.hasMoreElements()) {
val cert = keyStore.getCertificate(aliases.nextElement())
certificates.add(
"-----BEGIN CERTIFICATE-----\n" + Base64.encode(cert.encoded) + "\n-----END CERTIFICATE-----"
)
}
}
return StringArray(certificates.iterator())
}

private class InterfaceArray(private val iterator: Iterator<LibboxNetworkInterface>) :
NetworkInterfaceIterator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ class DashboardFragment : Fragment(R.layout.fragment_dashboard) {
builder.setPositiveButton(R.string.ok) { _, _ ->
loopShowDeprecatedNotes(notes)
}
builder.setNeutralButton(R.string.service_error_deprecated_warning_documentation) { _, _ ->
requireContext().launchCustomTab(note.migrationLink)
loopShowDeprecatedNotes(notes)
if (!note.migrationLink.isNullOrBlank()) {
builder.setNeutralButton(R.string.service_error_deprecated_warning_documentation) { _, _ ->
requireContext().launchCustomTab(note.migrationLink)
loopShowDeprecatedNotes(notes)
}
}
builder.show()
}
Expand Down
6 changes: 3 additions & 3 deletions version.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION_CODE=478
VERSION_NAME=1.11.3
GO_VERSION=go1.23.5
VERSION_CODE=484
VERSION_NAME=1.12.0-alpha.11
GO_VERSION=go1.24.0