mirror of
https://github.com/Corewala/Buran
synced 2025-03-11 22:53:08 +00:00
Fixed a bunch of warnings
Spring cleaning I guess
This commit is contained in:
parent
d504df9cd3
commit
1d2be092f1
4 changed files with 7 additions and 10 deletions
|
@ -40,7 +40,6 @@ class BuranHistory(private val db: BuranAbstractDatabase): HistoryDatasource {
|
|||
|
||||
override fun add(uri: Uri, onAdded: () -> Unit) {
|
||||
if(!uri.toString().startsWith("gemini://")){
|
||||
onAdded
|
||||
return
|
||||
}
|
||||
GlobalScope.launch(Dispatchers.IO){
|
||||
|
|
|
@ -8,7 +8,6 @@ import corewala.buran.OppenURI
|
|||
import corewala.buran.io.GemState
|
||||
import corewala.buran.io.database.history.BuranHistory
|
||||
import corewala.buran.io.keymanager.BuranKeyManager
|
||||
import corewala.toURI
|
||||
import corewala.toUri
|
||||
import java.io.*
|
||||
import java.lang.IllegalStateException
|
||||
|
@ -58,7 +57,7 @@ class GeminiDatasource(private val context: Context, val history: BuranHistory):
|
|||
private fun geminiRequest(uri: URI, onUpdate: (state: GemState) -> Unit, clientCertPassword: String?){
|
||||
val protocol = "TLS"
|
||||
|
||||
initSSLFactory(protocol!!, clientCertPassword)
|
||||
initSSLFactory(protocol, clientCertPassword)
|
||||
|
||||
val socket: SSLSocket?
|
||||
try {
|
||||
|
|
|
@ -5,7 +5,6 @@ import android.content.SharedPreferences
|
|||
import android.net.Uri
|
||||
import androidx.preference.PreferenceManager
|
||||
import corewala.buran.Buran
|
||||
import corewala.buran.R
|
||||
import java.io.FileNotFoundException
|
||||
import java.io.IOException
|
||||
import java.security.KeyStore
|
||||
|
@ -29,10 +28,10 @@ class BuranKeyManager(val context: Context, val onKeyError: (error: String) -> U
|
|||
try {
|
||||
context.contentResolver?.openInputStream(uri)?.use {
|
||||
try {
|
||||
keyStore.load(it, clientCertPassword?.toCharArray())
|
||||
keyStore.load(it, clientCertPassword.toCharArray())
|
||||
val keyManagerFactory: KeyManagerFactory =
|
||||
KeyManagerFactory.getInstance("X509")
|
||||
keyManagerFactory.init(keyStore, clientCertPassword?.toCharArray())
|
||||
keyManagerFactory.init(keyStore, clientCertPassword.toCharArray())
|
||||
return@use keyManagerFactory
|
||||
} catch (ioe: IOException) {
|
||||
onKeyError("${ioe.message}")
|
||||
|
|
|
@ -85,7 +85,7 @@ class GemActivity : AppCompatActivity() {
|
|||
|
||||
lateinit var adapter: AbstractGemtextAdapter
|
||||
|
||||
private val onLink: (link: URI, longTap: Boolean, adapterPosition: Int) -> Unit = { uri, longTap, position: Int ->
|
||||
private val onLink: (link: URI, longTap: Boolean, adapterPosition: Int) -> Unit = { uri, longTap, _: Int ->
|
||||
if(longTap){
|
||||
val globalURI = if(!uri.toString().contains("//") and !uri.toString().contains(":")){
|
||||
(omniTerm.getCurrent() + uri.toString()).replace("//", "/").replace("gemini:/", "gemini://")
|
||||
|
@ -232,7 +232,7 @@ class GemActivity : AppCompatActivity() {
|
|||
binding.addressEdit.requestFocus()
|
||||
}
|
||||
|
||||
binding.addressEdit.setOnFocusChangeListener { v, hasFocus ->
|
||||
binding.addressEdit.setOnFocusChangeListener { _, hasFocus ->
|
||||
|
||||
val addressPaddingRight = resources.getDimensionPixelSize(R.dimen.def_address_right_margin)
|
||||
|
||||
|
@ -435,11 +435,11 @@ class GemActivity : AppCompatActivity() {
|
|||
loadingView(false)
|
||||
builder
|
||||
.setTitle(state.header.meta)
|
||||
.setPositiveButton(getString(R.string.confirm).toUpperCase()){ dialog, which ->
|
||||
.setPositiveButton(getString(R.string.confirm).toUpperCase()){ _, _ ->
|
||||
gemRequest("${state.uri}?${Uri.encode(editText.text.toString())}")
|
||||
editText.hideKeyboard()
|
||||
}
|
||||
.setNegativeButton(getString(R.string.cancel).toUpperCase()){ dialog, which ->
|
||||
.setNegativeButton(getString(R.string.cancel).toUpperCase()){ _, _ ->
|
||||
editText.hideKeyboard()
|
||||
}
|
||||
.setView(dialogLayout)
|
||||
|
|
Loading…
Add table
Reference in a new issue