mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 18:45:19 +00:00
PR feedback
This commit is contained in:
parent
83ea71de24
commit
7a8e1309fb
@ -1,10 +1,15 @@
|
|||||||
package network.loki.messenger.libsession_util.util
|
package network.loki.messenger.libsession_util.util
|
||||||
|
|
||||||
object BlindKeyAPI {
|
object BlindKeyAPI {
|
||||||
init {
|
private val loadLibrary by lazy {
|
||||||
System.loadLibrary("session_util")
|
System.loadLibrary("session_util")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init {
|
||||||
|
// Ensure the library is loaded at initialization
|
||||||
|
loadLibrary
|
||||||
|
}
|
||||||
|
|
||||||
external fun blindVersionKeyPair(ed25519SecretKey: ByteArray): KeyPair
|
external fun blindVersionKeyPair(ed25519SecretKey: ByteArray): KeyPair
|
||||||
external fun blindVersionSign(ed25519SecretKey: ByteArray, timestamp: Long): ByteArray
|
external fun blindVersionSign(ed25519SecretKey: ByteArray, timestamp: Long): ByteArray
|
||||||
}
|
}
|
@ -151,11 +151,12 @@ object FileServerApi {
|
|||||||
val result = send(request).await()
|
val result = send(request).await()
|
||||||
|
|
||||||
// map out the result
|
// map out the result
|
||||||
val json = JsonUtil.fromJson(result, Map::class.java)
|
return JsonUtil.fromJson(result, Map::class.java).let {
|
||||||
val statusCode = json.getOrDefault("status_code", 0) as Int
|
VersionData(
|
||||||
val version = json.getOrDefault("result", "") as String
|
statusCode = it["status_code"] as? Int ?: 0,
|
||||||
val updated = json.getOrDefault("updated", 0.0) as Double
|
version = it["result"] as? String ?: "",
|
||||||
|
updated = it["updated"] as? Double ?: 0.0
|
||||||
return VersionData(statusCode, version, updated)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user