diff --git a/lib/lfrfid/protocols/protocol_indala224.c b/lib/lfrfid/protocols/protocol_indala224.c index 553509669..15dd96e7e 100644 --- a/lib/lfrfid/protocols/protocol_indala224.c +++ b/lib/lfrfid/protocols/protocol_indala224.c @@ -84,7 +84,9 @@ static bool protocol_indala224_decoder_feed_internal(bool polarity, uint32_t tim size_t bit_count = (time / INDALA224_US_PER_BIT); bool result = false; - if(bit_count < INDALA224_ENCODED_BIT_SIZE) { + // A payload of all zeros holds the PSK2 carrier phase for a whole frame, so a run of + // exactly INDALA224_ENCODED_BIT_SIZE bits is legitimate and must not be discarded. + if(bit_count <= INDALA224_ENCODED_BIT_SIZE) { for(size_t i = 0; i < bit_count; i++) { bit_lib_push_bit(data, INDALA224_ENCODED_DATA_SIZE, polarity); if(protocol_indala224_can_be_decoded(data)) { diff --git a/scripts/fbt/appmanifest.py b/scripts/fbt/appmanifest.py index bb83b24ff..0070e2d9e 100644 --- a/scripts/fbt/appmanifest.py +++ b/scripts/fbt/appmanifest.py @@ -120,6 +120,19 @@ class FlipperApplication: raise FlipperManifestException( f"Invalid appid '{self.appid}'. Must match regex '{self.APP_ID_REGEX}'" ) + + # Reject float explicitly. Python float literals silently drop trailing + # zeros (1.10 becomes 1.1), so a float is never a safe way to write a + # version number. Surface the problem here with a clear message rather + # than letting a cryptic "'float' object is not iterable" TypeError + # appear deep in the build step (see flipperdevices/flipperzero-ufbt#52). + if isinstance(self.fap_version, float): + raise FlipperManifestException( + f"Invalid fap_version {self.fap_version!r}: floats are not accepted " + f"because Python drops trailing zeros (1.10 becomes 1.1). " + f'Write the version as a string ("1.0") or a tuple ((1, 0)).' + ) + if isinstance(self.fap_version, str): try: self.fap_version = tuple(int(v) for v in self.fap_version.split(".")) @@ -127,8 +140,15 @@ class FlipperApplication: raise FlipperManifestException( f"Invalid version '{self.fap_version}'. Must be in the form 'major.minor'" ) - if len(self.fap_version) < 2: - raise ValueError("Not enough version components") + elif isinstance(self.fap_version, (tuple, list)): + self.fap_version = tuple(self.fap_version) + else: + raise FlipperManifestException( + f"Invalid fap_version {self.fap_version!r}: expected a string like " + f'"1.2" or a tuple like (1, 2), got {type(self.fap_version).__name__}' + ) + if len(self.fap_version) < 2: + raise ValueError("Not enough version components") class AppManager: