mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
Don't report fake device data.
This commit is contained in:
@@ -60,11 +60,13 @@ class AppleFactory @Inject constructor(
|
||||
var factory = podFactories.firstOrNull { it.isResponsible(pm) }
|
||||
|
||||
if (factory == null) {
|
||||
Bugs.report(
|
||||
tag = TAG,
|
||||
message = "Unknown proximity message type",
|
||||
exception = IllegalArgumentException("Unknown ProximityMessage: $pm")
|
||||
)
|
||||
if (scanResult.address != "6E:9E:D1:49:D2:6D") {
|
||||
Bugs.report(
|
||||
tag = TAG,
|
||||
message = "Unknown proximity message type",
|
||||
exception = IllegalArgumentException("Unknown ProximityMessage: $pm")
|
||||
)
|
||||
}
|
||||
factory = unknownAppleFactory
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,16 @@ object ProximityPairing {
|
||||
batteryData = setOf(data[4].upperNibble, data[4].lowerNibble),
|
||||
deviceColor = data[7]
|
||||
)
|
||||
|
||||
override fun toString(): String =
|
||||
"ProximityPairing.Message(type=$type, length=$length, data=${
|
||||
data.joinToString(separator = " ") {
|
||||
String.format(
|
||||
"%02X",
|
||||
it
|
||||
)
|
||||
}
|
||||
}"
|
||||
}
|
||||
|
||||
@Reusable
|
||||
|
||||
Reference in New Issue
Block a user