Add workaround for bulkBarrierPreWrite: unaligned arguments panic
This commit is contained in:
@@ -77,7 +77,7 @@ class VPNService : VpnService(), PlatformInterfaceWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (options.autoRoute) {
|
if (options.autoRoute) {
|
||||||
builder.addDnsServer(options.dnsServerAddress)
|
builder.addDnsServer(options.dnsServerAddress.value)
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
val inet4RouteAddress = options.inet4RouteAddress
|
val inet4RouteAddress = options.inet4RouteAddress
|
||||||
|
|||||||
@@ -4,9 +4,16 @@ import android.net.IpPrefix
|
|||||||
import android.os.Build
|
import android.os.Build
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import io.nekohasekai.libbox.RoutePrefix
|
import io.nekohasekai.libbox.RoutePrefix
|
||||||
|
import io.nekohasekai.libbox.StringBox
|
||||||
import io.nekohasekai.libbox.StringIterator
|
import io.nekohasekai.libbox.StringIterator
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
|
|
||||||
|
val StringBox?.unwrap: String
|
||||||
|
get() {
|
||||||
|
if (this == null) return ""
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
fun Iterable<String>.toStringIterator(): StringIterator {
|
fun Iterable<String>.toStringIterator(): StringIterator {
|
||||||
return object : StringIterator {
|
return object : StringIterator {
|
||||||
val iterator = iterator()
|
val iterator = iterator()
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import io.nekohasekai.sfa.database.Profile
|
|||||||
import io.nekohasekai.sfa.database.ProfileManager
|
import io.nekohasekai.sfa.database.ProfileManager
|
||||||
import io.nekohasekai.sfa.databinding.ActivityEditProfileContentBinding
|
import io.nekohasekai.sfa.databinding.ActivityEditProfileContentBinding
|
||||||
import io.nekohasekai.sfa.ktx.errorDialogBuilder
|
import io.nekohasekai.sfa.ktx.errorDialogBuilder
|
||||||
|
import io.nekohasekai.sfa.ktx.unwrap
|
||||||
import io.nekohasekai.sfa.ui.shared.AbstractActivity
|
import io.nekohasekai.sfa.ui.shared.AbstractActivity
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
@@ -84,7 +85,7 @@ class EditProfileContentActivity : AbstractActivity<ActivityEditProfileContentBi
|
|||||||
R.id.action_format -> {
|
R.id.action_format -> {
|
||||||
lifecycleScope.launch(Dispatchers.IO) {
|
lifecycleScope.launch(Dispatchers.IO) {
|
||||||
runCatching {
|
runCatching {
|
||||||
val content = Libbox.formatConfig(binding.editor.text.toString())
|
val content = Libbox.formatConfig(binding.editor.text.toString()).unwrap
|
||||||
if (binding.editor.text.toString() != content) {
|
if (binding.editor.text.toString() != content) {
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
binding.editor.setTextContent(content)
|
binding.editor.setTextContent(content)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package io.nekohasekai.sfa.utils
|
|||||||
|
|
||||||
import io.nekohasekai.libbox.Libbox
|
import io.nekohasekai.libbox.Libbox
|
||||||
import io.nekohasekai.sfa.BuildConfig
|
import io.nekohasekai.sfa.BuildConfig
|
||||||
|
import io.nekohasekai.sfa.ktx.unwrap
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
|
|
||||||
class HTTPClient : Closeable {
|
class HTTPClient : Closeable {
|
||||||
@@ -30,7 +31,7 @@ class HTTPClient : Closeable {
|
|||||||
request.setUserAgent(userAgent)
|
request.setUserAgent(userAgent)
|
||||||
request.setURL(url)
|
request.setURL(url)
|
||||||
val response = request.execute()
|
val response = request.execute()
|
||||||
return response.contentString
|
return response.content.unwrap
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun close() {
|
override fun close() {
|
||||||
|
|||||||
Reference in New Issue
Block a user