fix(android): overload both Cipher.init declarations, restore CRLF line endings

Delphi refuses a second declaration when the first is not marked overload, so the three-argument init was reported as too many parameters. Also adds Androidapi.Jni to silence the non-inlined TJavaArray.Length hints.

My ASCII normalisation had rewritten the sources in LF, which RAD Studio flags on every unit; a .gitattributes rule now pins CRLF for Pascal sources so git does not undo it.
This commit is contained in:
r-zakarya
2026-08-15 00:49:37 +01:00
parent 9649dac7b2
commit 1e7477cdd6
3 changed files with 14 additions and 3 deletions
+4 -2
View File
@@ -62,7 +62,7 @@ implementation
{$IF DEFINED(ANDROID)}
uses
Androidapi.JNIBridge, Androidapi.JNI.JavaTypes, Androidapi.Helpers;
Androidapi.Jni, Androidapi.JNIBridge, Androidapi.JNI.JavaTypes, Androidapi.Helpers;
{$ENDIF}
const
@@ -213,7 +213,9 @@ type
[JavaSignature('javax/crypto/Cipher')]
JCipherX = interface(JObject)
['{3D2B1C4E-5F60-7B82-9DA4-192031425364}']
procedure init(opmode: Integer; key: JKeyX); cdecl;
// Les DEUX surcharges doivent porter la directive : Delphi refuse une
// seconde declaration si la premiere ne l'a pas.
procedure init(opmode: Integer; key: JKeyX); cdecl; overload;
procedure init(opmode: Integer; key: JKeyX; params: JAlgorithmParameterSpecX); cdecl; overload;
function doFinal(input: TJavaArray<Byte>): TJavaArray<Byte>; cdecl;
function getIV: TJavaArray<Byte>; cdecl;