mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-16 19:26:12 -04:00
Distinguish between UNKNOWN and missing profile
This commit modifies the `AppleFactory` to correctly handle `PodDevice.Model.UNKNOWN`. Previously, if a device's model was `UNKNOWN`, it wouldn't match any profile and `isIRKMatch` would be false. This change ensures that `isIRKMatch` reflects the actual IRK match status, regardless of whether a specific profile is found. Devices with an `UNKNOWN` model can now match profiles that are also marked as `UNKNOWN`, allowing for generic profile matching when the specific model isn't identified.
This commit is contained in:
@@ -98,7 +98,7 @@ class AppleFactory @Inject constructor(
|
|||||||
meta = ApplePods.AppleMeta(),
|
meta = ApplePods.AppleMeta(),
|
||||||
)
|
)
|
||||||
profile = profiles
|
profile = profiles
|
||||||
.filter { it.model == tempDevice.model }
|
.filter { it.model == PodDevice.Model.UNKNOWN || it.model == tempDevice.model }
|
||||||
.filter { it.minimumSignalQuality <= tempDevice.signalQuality }
|
.filter { it.minimumSignalQuality <= tempDevice.signalQuality }
|
||||||
.firstOrNull()
|
.firstOrNull()
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ class AppleFactory @Inject constructor(
|
|||||||
scanResult = scanResult,
|
scanResult = scanResult,
|
||||||
payload = payload,
|
payload = payload,
|
||||||
meta = ApplePods.AppleMeta(
|
meta = ApplePods.AppleMeta(
|
||||||
isIRKMatch = profile != null,
|
isIRKMatch = isIrkMatch,
|
||||||
profile = profile,
|
profile = profile,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user