deprecate and strip pref manager extension; rebuild pigeons;

This commit is contained in:
Fabian Freund
2026-04-16 08:08:26 +02:00
parent b3576d4b49
commit 560a0b51be
21 changed files with 3497 additions and 3367 deletions
@@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v26.1.7), do not edit directly.
// Autogenerated from Pigeon (v26.3.2), do not edit directly.
// See also: https://pub.dev/packages/pigeon
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
@@ -37,36 +37,150 @@ private object TorApiPigeonUtils {
)
}
}
fun doubleEquals(a: Double, b: Double): Boolean {
// Normalize -0.0 to 0.0 and handle NaN equality.
return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN())
}
fun floatEquals(a: Float, b: Float): Boolean {
// Normalize -0.0 to 0.0 and handle NaN equality.
return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN())
}
fun doubleHash(d: Double): Int {
// Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes.
val normalized = if (d == 0.0) 0.0 else d
val bits = java.lang.Double.doubleToLongBits(normalized)
return (bits xor (bits ushr 32)).toInt()
}
fun floatHash(f: Float): Int {
// Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes.
val normalized = if (f == 0.0f) 0.0f else f
return java.lang.Float.floatToIntBits(normalized)
}
fun deepEquals(a: Any?, b: Any?): Boolean {
if (a === b) {
return true
}
if (a == null || b == null) {
return false
}
if (a is ByteArray && b is ByteArray) {
return a.contentEquals(b)
return a.contentEquals(b)
}
if (a is IntArray && b is IntArray) {
return a.contentEquals(b)
return a.contentEquals(b)
}
if (a is LongArray && b is LongArray) {
return a.contentEquals(b)
return a.contentEquals(b)
}
if (a is DoubleArray && b is DoubleArray) {
return a.contentEquals(b)
if (a.size != b.size) return false
for (i in a.indices) {
if (!doubleEquals(a[i], b[i])) return false
}
return true
}
if (a is FloatArray && b is FloatArray) {
if (a.size != b.size) return false
for (i in a.indices) {
if (!floatEquals(a[i], b[i])) return false
}
return true
}
if (a is Array<*> && b is Array<*>) {
return a.size == b.size &&
a.indices.all{ deepEquals(a[it], b[it]) }
if (a.size != b.size) return false
for (i in a.indices) {
if (!deepEquals(a[i], b[i])) return false
}
return true
}
if (a is List<*> && b is List<*>) {
return a.size == b.size &&
a.indices.all{ deepEquals(a[it], b[it]) }
if (a.size != b.size) return false
val iterA = a.iterator()
val iterB = b.iterator()
while (iterA.hasNext() && iterB.hasNext()) {
if (!deepEquals(iterA.next(), iterB.next())) return false
}
return true
}
if (a is Map<*, *> && b is Map<*, *>) {
return a.size == b.size && a.all {
(b as Map<Any?, Any?>).contains(it.key) &&
deepEquals(it.value, b[it.key])
if (a.size != b.size) return false
for (entry in a) {
val key = entry.key
var found = false
for (bEntry in b) {
if (deepEquals(key, bEntry.key)) {
if (deepEquals(entry.value, bEntry.value)) {
found = true
break
} else {
return false
}
}
}
if (!found) return false
}
return true
}
if (a is Double && b is Double) {
return doubleEquals(a, b)
}
if (a is Float && b is Float) {
return floatEquals(a, b)
}
return a == b
}
fun deepHash(value: Any?): Int {
return when (value) {
null -> 0
is ByteArray -> value.contentHashCode()
is IntArray -> value.contentHashCode()
is LongArray -> value.contentHashCode()
is DoubleArray -> {
var result = 1
for (item in value) {
result = 31 * result + doubleHash(item)
}
result
}
is FloatArray -> {
var result = 1
for (item in value) {
result = 31 * result + floatHash(item)
}
result
}
is Array<*> -> {
var result = 1
for (item in value) {
result = 31 * result + deepHash(item)
}
result
}
is List<*> -> {
var result = 1
for (item in value) {
result = 31 * result + deepHash(item)
}
result
}
is Map<*, *> -> {
var result = 0
for (entry in value) {
result += ((deepHash(entry.key) * 31) xor deepHash(entry.value))
}
result
}
is Double -> doubleHash(value)
is Float -> floatHash(value)
else -> value.hashCode()
}
}
}
/**
@@ -145,15 +259,25 @@ data class TorConfiguration (
)
}
override fun equals(other: Any?): Boolean {
if (other !is TorConfiguration) {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
return TorApiPigeonUtils.deepEquals(toList(), other.toList()) }
val other = other as TorConfiguration
return TorApiPigeonUtils.deepEquals(this.transport, other.transport) && TorApiPigeonUtils.deepEquals(this.bridgeLines, other.bridgeLines) && TorApiPigeonUtils.deepEquals(this.entryNodeCountries, other.entryNodeCountries) && TorApiPigeonUtils.deepEquals(this.exitNodeCountries, other.exitNodeCountries) && TorApiPigeonUtils.deepEquals(this.strictNodes, other.strictNodes)
}
override fun hashCode(): Int = toList().hashCode()
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + TorApiPigeonUtils.deepHash(this.transport)
result = 31 * result + TorApiPigeonUtils.deepHash(this.bridgeLines)
result = 31 * result + TorApiPigeonUtils.deepHash(this.entryNodeCountries)
result = 31 * result + TorApiPigeonUtils.deepHash(this.exitNodeCountries)
result = 31 * result + TorApiPigeonUtils.deepHash(this.strictNodes)
return result
}
}
/**
@@ -194,15 +318,25 @@ data class TorStatus (
)
}
override fun equals(other: Any?): Boolean {
if (other !is TorStatus) {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
return TorApiPigeonUtils.deepEquals(toList(), other.toList()) }
val other = other as TorStatus
return TorApiPigeonUtils.deepEquals(this.isRunning, other.isRunning) && TorApiPigeonUtils.deepEquals(this.socksPort, other.socksPort) && TorApiPigeonUtils.deepEquals(this.bootstrapProgress, other.bootstrapProgress) && TorApiPigeonUtils.deepEquals(this.currentCircuit, other.currentCircuit) && TorApiPigeonUtils.deepEquals(this.exitNodeCountry, other.exitNodeCountry)
}
override fun hashCode(): Int = toList().hashCode()
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + TorApiPigeonUtils.deepHash(this.isRunning)
result = 31 * result + TorApiPigeonUtils.deepHash(this.socksPort)
result = 31 * result + TorApiPigeonUtils.deepHash(this.bootstrapProgress)
result = 31 * result + TorApiPigeonUtils.deepHash(this.currentCircuit)
result = 31 * result + TorApiPigeonUtils.deepHash(this.exitNodeCountry)
return result
}
}
/**
@@ -235,15 +369,23 @@ data class TorLogMessage (
)
}
override fun equals(other: Any?): Boolean {
if (other !is TorLogMessage) {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
return TorApiPigeonUtils.deepEquals(toList(), other.toList()) }
val other = other as TorLogMessage
return TorApiPigeonUtils.deepEquals(this.severity, other.severity) && TorApiPigeonUtils.deepEquals(this.message, other.message) && TorApiPigeonUtils.deepEquals(this.timestamp, other.timestamp)
}
override fun hashCode(): Int = toList().hashCode()
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + TorApiPigeonUtils.deepHash(this.severity)
result = 31 * result + TorApiPigeonUtils.deepHash(this.message)
result = 31 * result + TorApiPigeonUtils.deepHash(this.timestamp)
return result
}
}
private open class TorApiPigeonCodec : StandardMessageCodec() {
override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {