fix(android): keep the ETag only when the decryption that followed succeeded

The harness stored the ETag on download, so a first attempt with no password left a valid tag behind: the next call answered 304 and there was nothing to decrypt, precisely when the right password had just been typed. Sending If-None-Match without holding the matching plaintext trades a download for having no data - the real client needs the same rule, the tag belonging to the cached vault.

Also drops an em dash from an exception message: Delphi reads a BOM-less source as ANSI and it reached the device as mojibake.
This commit is contained in:
r-zakarya
2026-08-15 00:06:30 +01:00
parent ccab734d61
commit a641669150
2 changed files with 12 additions and 7 deletions
+3 -1
View File
@@ -330,7 +330,9 @@ begin
// AEADBadTagException surfaces here: wrong password, or altered bytes.
// Both are indistinguishable by design — that is what authentication means.
on E: Exception do
raise EPMACrypto.Create('Decryption failed — wrong password or corrupt file');
// Message en pur ASCII : un tiret cadratin dans une source lue en ANSI
// par Delphi ressort en mojibake sur l'appareil.
raise EPMACrypto.Create('Decryption failed - wrong password or corrupt file');
end;
end;
{$ELSE}