我刚刚发现锁盒3.6.0应该支持Android。然而,当我查看我的调色板时,我发现编解码器只支持win32和win64。
我怎样才能让它也适用于我的android应用程序?
我使用德尔菲XE7,并且已经遵循了包中提供的安装说明。对于windows应用程序来说,它工作得很好。
发布于 2015-01-13 05:03:26
你有两个选择:
(1)运行时间
您可以始终在运行时创建组件。关于如何做到这一点,有一个网站上的例子,我在下面复制这个示例的一个片段。只需将ShowMessage()函数替换为任何适当的..。
procedure EncryptAStream( Plaintext, Ciphertext: TStream);
var
Codec1: TCodec;
CryptographicLibrary1: TCryptographicLibrary;
begin
ShowMessage( 'Demonstration of How to Encrypt a Stream with TurboPower LockBox 3.');
Codec1 := TCodec.Create( nil);
CryptographicLibrary1 := TCryptographicLibrary.Create( nil);
Codec1.CryptoLibrary := CryptographicLibrary1;
Codec1.StreamCipherId := uTPLb_Constants.BlockCipher_ProgId;
Codec1.BlockCipherId := 'native.AES-256';
Codec1.ChainModeId := uTPLb_Constants.CBC_ProgId;
Codec1.Password := 'my utf-16le password';
// Codec1.Reset; Reset if you are continuing from a previous encryption operation.
Codec1.EncryptStream( Plaintext, Ciphertext);
// Codec1.Burn; Burn if you need to purge memory of sensitive data.
Ciphertext.Position := 0;
ShowMessageFmt(
'The ciphertext for AES-256 with CBC chaining'#13#10 +
' of plaintext ''banana'' (UTF-8 encoding),'#13#10 +
' and password ''my utf-16le password'' (UTF-16LE encoding),'#13#10 +
' prepended by 64 bit nonce, (being the IV),'#13#10 +
' and rendered for display in base64 is ...'#13#10 +
'%s', [Stream_to_Base64( Ciphertext)]);
Codec1.Free;
CryptographicLibrary1.Free;
end;(2)设计时间
需要稍加调整,才能将组件放到Android的调色板上。这将在即将发布的TPLockbox 3的下一个版本中为您完成,但就目前而言,这是一个过程.
vcl运行时需求中删除TPLB3、vclimg和dbrtl。libTP_LockBox3_XE7.so,其中XE7是编译器版本的位置标记。这是整件事的关键。属性声明组件应该在调色板上显示的平台。如果没有声明,我相信默认的是pidWin32 or pidWin64,但我不能指向任何官方文档来支持这一点。
save-all才能成功编译。您应该实际检查这个目录。例如,它应该有一个名为TPLB3.AES.dcu的文件和另一个名为TPLB3.AES.so的文件。
https://stackoverflow.com/questions/27755707
复制相似问题