source upload

This commit is contained in:
Razor12911
2022-01-17 22:16:47 +02:00
parent 12936d065b
commit 098e8c48de
1778 changed files with 1206749 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="%package%"
android:versionCode="%versionCode%"
android:versionName="%versionName%"
android:installLocation="%installLocation%">
<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" />
<%uses-permission%>
<uses-feature android:glEsVersion="0x00020000" android:required="True"/>
<application android:persistent="%persistent%"
android:restoreAnyVersion="%restoreAnyVersion%"
android:label="%label%"
android:debuggable="%debuggable%"
android:largeHeap="%largeHeap%"
android:icon="%icon%"
android:theme="%theme%"
android:hardwareAccelerated="%hardwareAccelerated%">
<%application-meta-data%>
<%services%>
<!-- Our activity is a subclass of the built-in NativeActivity framework class.
This will take care of integrating with our NDK code. -->
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
android:label="%activityLabel%"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
android:launchMode="singleTask">
<!-- Tell NativeActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="%libNameValue%" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<%activity%>
<%receivers%>
</application>
</manifest>
<!-- END_INCLUDE(manifest) -->

View File

@@ -0,0 +1,434 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Condition="Exists('$(BDS)\bin\CodeGear.Deployment.targets')" Project="$(BDS)\bin\CodeGear.Deployment.targets"/>
<ProjectExtensions>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<PropertyGroup>
<DeviceId Condition="'$(Platform)'=='Android'">CB512EA59X</DeviceId>
<DeviceId Condition="'$(Platform)'=='Android64'"/>
</PropertyGroup>
<ItemGroup Condition="'$(Platform)'=='Win32'">
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Win32__Demos\Cipher_FMX.exe" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\</RemoteDir>
<RemoteName>Cipher_FMX.exe</RemoteName>
<DeployClass>ProjectOutput</DeployClass>
<Operation>0</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
<Required>True</Required>
</DeployFile>
</ItemGroup>
<ItemGroup Condition="'$(Platform)'=='Win64'"/>
<ItemGroup Condition="'$(Platform)'=='Android'">
<DeployFile Include="CryptoIcon_48.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-mdpi\</RemoteDir>
<RemoteName>ic_launcher.png</RemoteName>
<DeployClass>Android_LauncherIcon48</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\classes.dex" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\classes\</RemoteDir>
<RemoteName>classes.dex</RemoteName>
<DeployClass>AndroidClassesDexFile</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-hdpi\</RemoteDir>
<RemoteName>ic_notification.png</RemoteName>
<DeployClass>Android_NotificationIcon36</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="$(BDS)\lib\android\debug\mips\libnative-activity.so" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\library\lib\mips\</RemoteDir>
<RemoteName>libCipher_FMX.so</RemoteName>
<DeployClass>AndroidLibnativeMipsFile</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\splash_image_def.xml" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable\</RemoteDir>
<RemoteName>splash_image_def.xml</RemoteName>
<DeployClass>AndroidSplashImageDef</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="CryptoIcon_96.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-xhdpi\</RemoteDir>
<RemoteName>ic_launcher.png</RemoteName>
<DeployClass>Android_LauncherIcon96</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="CryptoIcon_36.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-ldpi\</RemoteDir>
<RemoteName>ic_launcher.png</RemoteName>
<DeployClass>Android_LauncherIcon36</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="Crypto_640_480.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-large\</RemoteDir>
<RemoteName>splash_image.png</RemoteName>
<DeployClass>Android_SplashImage640</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\strings.xml" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\values\</RemoteDir>
<RemoteName>strings.xml</RemoteName>
<DeployClass>Android_Strings</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-xxxhdpi\</RemoteDir>
<RemoteName>ic_notification.png</RemoteName>
<DeployClass>Android_NotificationIcon96</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\AndroidManifest.xml" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\</RemoteDir>
<RemoteName>AndroidManifest.xml</RemoteName>
<DeployClass>ProjectAndroidManifest</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="$(BDS)\lib\android\debug\armeabi\libnative-activity.so" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\library\lib\armeabi\</RemoteDir>
<RemoteName>libCipher_FMX.so</RemoteName>
<DeployClass>AndroidLibnativeArmeabiFile</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\styles-v21.xml" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\values-v21\</RemoteDir>
<RemoteName>styles.xml</RemoteName>
<DeployClass>AndroidSplashStylesV21</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-mdpi\</RemoteDir>
<RemoteName>ic_notification.png</RemoteName>
<DeployClass>Android_NotificationIcon24</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="Crypto_470_320.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-normal\</RemoteDir>
<RemoteName>splash_image.png</RemoteName>
<DeployClass>Android_SplashImage470</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-xhdpi\</RemoteDir>
<RemoteName>ic_notification.png</RemoteName>
<DeployClass>Android_NotificationIcon48</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="CryptoIcon_72.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-hdpi\</RemoteDir>
<RemoteName>ic_launcher.png</RemoteName>
<DeployClass>Android_LauncherIcon72</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-xxhdpi\</RemoteDir>
<RemoteName>ic_notification.png</RemoteName>
<DeployClass>Android_NotificationIcon72</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="CryptoIcon_144.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-xxhdpi\</RemoteDir>
<RemoteName>ic_launcher.png</RemoteName>
<DeployClass>Android_LauncherIcon144</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\colors.xml" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\values\</RemoteDir>
<RemoteName>colors.xml</RemoteName>
<DeployClass>Android_Colors</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="CryptoIcon_192.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-xxxhdpi\</RemoteDir>
<RemoteName>ic_launcher.png</RemoteName>
<DeployClass>Android_LauncherIcon192</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\libCipher_FMX.so" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\library\lib\armeabi-v7a\</RemoteDir>
<RemoteName>libCipher_FMX.so</RemoteName>
<DeployClass>ProjectOutput</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
<Required>True</Required>
</DeployFile>
<DeployFile Include="Crypto_426_320.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-small\</RemoteDir>
<RemoteName>splash_image.png</RemoteName>
<DeployClass>Android_SplashImage426</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="Android\Debug\classes.dex" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\classes\</RemoteDir>
<RemoteName>classes.dex</RemoteName>
<DeployClass>AndroidClassesDexFile</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="$(NDKBasePath)\prebuilt\android-arm\gdbserver\gdbserver" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\library\lib\armeabi-v7a\</RemoteDir>
<RemoteName>gdbserver</RemoteName>
<DeployClass>AndroidGDBServer</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\styles.xml" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\values\</RemoteDir>
<RemoteName>styles.xml</RemoteName>
<DeployClass>AndroidSplashStyles</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="Crypto_960_720.png" Condition="'$(Config)'=='Debug'">
<RemoteDir>Cipher_FMX\res\drawable-xlarge\</RemoteDir>
<RemoteName>splash_image.png</RemoteName>
<DeployClass>Android_SplashImage960</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
</ItemGroup>
<ItemGroup Condition="'$(Platform)'=='Android64'">
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android64__Demos\splash_image_def.xml" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\drawable\</RemoteDir>
<RemoteName>splash_image_def.xml</RemoteName>
<DeployClass>AndroidSplashImageDef</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android64__Demos\libCipher_FMX.so" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\library\lib\arm64-v8a\</RemoteDir>
<RemoteName>libCipher_FMX.so</RemoteName>
<DeployClass>ProjectOutput</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
<Required>True</Required>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android64__Demos\classes.dex" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\classes\</RemoteDir>
<RemoteName>classes.dex</RemoteName>
<DeployClass>AndroidClassesDexFile</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="Crypto_960_720.png" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\drawable-xlarge\</RemoteDir>
<RemoteName>splash_image.png</RemoteName>
<DeployClass>Android_SplashImage960</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android64__Demos\styles.xml" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\values\</RemoteDir>
<RemoteName>styles.xml</RemoteName>
<DeployClass>AndroidSplashStyles</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="CryptoIcon_48.png" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\drawable-mdpi\</RemoteDir>
<RemoteName>ic_launcher.png</RemoteName>
<DeployClass>Android_LauncherIcon48</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="Crypto_426_320.png" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\drawable-small\</RemoteDir>
<RemoteName>splash_image.png</RemoteName>
<DeployClass>Android_SplashImage426</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android64__Demos\AndroidManifest.xml" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\</RemoteDir>
<RemoteName>AndroidManifest.xml</RemoteName>
<DeployClass>ProjectAndroidManifest</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="Crypto_470_320.png" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\drawable-normal\</RemoteDir>
<RemoteName>splash_image.png</RemoteName>
<DeployClass>Android_SplashImage470</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="Crypto_640_480.png" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\drawable-large\</RemoteDir>
<RemoteName>splash_image.png</RemoteName>
<DeployClass>Android_SplashImage640</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="CryptoIcon_96.png" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\drawable-xhdpi\</RemoteDir>
<RemoteName>ic_launcher.png</RemoteName>
<DeployClass>Android_LauncherIcon96</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="CryptoIcon_192.png" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\drawable-xxxhdpi\</RemoteDir>
<RemoteName>ic_launcher.png</RemoteName>
<DeployClass>Android_LauncherIcon192</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="CryptoIcon_36.png" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\drawable-ldpi\</RemoteDir>
<RemoteName>ic_launcher.png</RemoteName>
<DeployClass>Android_LauncherIcon36</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android64__Demos\styles-v21.xml" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\values-v21\</RemoteDir>
<RemoteName>styles.xml</RemoteName>
<DeployClass>AndroidSplashStylesV21</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android64__Demos\colors.xml" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\values\</RemoteDir>
<RemoteName>colors.xml</RemoteName>
<DeployClass>Android_Colors</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="CryptoIcon_72.png" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\drawable-hdpi\</RemoteDir>
<RemoteName>ic_launcher.png</RemoteName>
<DeployClass>Android_LauncherIcon72</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="CryptoIcon_144.png" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\drawable-xxhdpi\</RemoteDir>
<RemoteName>ic_launcher.png</RemoteName>
<DeployClass>Android_LauncherIcon144</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android64__Demos\strings.xml" Condition="'$(Config)'=='Release'">
<RemoteDir>Cipher_FMX\res\values\</RemoteDir>
<RemoteName>strings.xml</RemoteName>
<DeployClass>Android_Strings</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,14 @@
program Cipher_FMX;
uses
System.StartUpCopy,
FMX.Forms,
MainForm in 'MainForm.pas' {FormMain};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TFormMain, FormMain);
Application.Run;
end.

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -0,0 +1,91 @@
inherited MainForm_LgXhdpiPh: TMainForm_LgXhdpiPh
ClientHeight = 695
ClientWidth = 450
DesignerMasterStyle = 0
inherited VertScrollBox1: TVertScrollBox
Size.Width = 450.000000000000000000
Size.Height = 695.000000000000000000
Viewport.Width = 445.000000000000000000
Viewport.Height = 695.000000000000000000
inherited LayoutTop: TLayout
inherited Label2: TLabel
Size.Width = 124.000000000000000000
Size.Height = 22.000000000000000000
end
inherited ComboBoxHashFunction: TComboBox
TabOrder = 3
end
inherited Label5: TLabel
Size.Width = 139.000000000000000000
Size.Height = 22.000000000000000000
end
inherited ComboBoxInputFormatting: TComboBox
TabOrder = 4
end
inherited Label6: TLabel
Size.Width = 178.000000000000000000
Size.Height = 22.000000000000000000
end
inherited ComboBoxOutputFormatting: TComboBox
TabOrder = 6
end
inherited Label1: TLabel
Size.Width = 119.000000000000000000
Size.Height = 22.000000000000000000
end
inherited EditKey: TEdit
TabOrder = 15
Size.Height = 32.000000000000000000
end
inherited Label3: TLabel
Size.Width = 81.000000000000000000
Size.Height = 22.000000000000000000
end
inherited Edit1: TEdit
TabOrder = 14
Size.Height = 32.000000000000000000
end
inherited Label4: TLabel
Size.Width = 79.000000000000000000
Size.Height = 22.000000000000000000
end
inherited EditFiller: TEdit
TabOrder = 13
Size.Height = 32.000000000000000000
end
inherited Label7: TLabel
Size.Width = 103.000000000000000000
Size.Height = 22.000000000000000000
end
inherited Label8: TLabel
Size.Width = 139.000000000000000000
Size.Height = 22.000000000000000000
end
inherited StringGrid1: TStringGrid
Viewport.Width = 380.000000000000000000
Viewport.Height = 68.000000000000000000
inherited StringColumn1: TStringColumn
Size.Width = 250.000000000000000000
end
end
inherited Label9: TLabel
Size.Width = 139.000000000000000000
Size.Height = 22.000000000000000000
end
inherited Label10: TLabel
Size.Width = 139.000000000000000000
Size.Height = 22.000000000000000000
end
inherited EditPlainText: TEdit
Size.Height = 32.000000000000000000
end
inherited EditCipherText: TEdit
Size.Height = 32.000000000000000000
end
inherited Label11: TLabel
Size.Width = 88.000000000000000000
Size.Height = 22.000000000000000000
end
end
end
end

View File

@@ -0,0 +1,304 @@
object FormMain: TFormMain
Left = 0
Top = 0
ActiveControl = ComboBoxCipherAlgorithm
Caption = 'FMX Cipher Demo'
ClientHeight = 711
ClientWidth = 425
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
OnCreate = FormCreate
OnResize = FormResize
DesignerMasterStyle = 0
object VertScrollBox1: TVertScrollBox
Align = Client
Size.Width = 425.000000000000000000
Size.Height = 711.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'scrollboxstyle'
TabOrder = 0
Viewport.Width = 409.000000000000000000
Viewport.Height = 711.000000000000000000
object LayoutTop: TLayout
Size.Width = 425.000000000000000000
Size.Height = 1170.000000000000000000
Size.PlatformDefault = False
TabOrder = 0
object Label2: TLabel
AutoSize = True
Position.X = 16.000000000000000000
Position.Y = 16.000000000000000000
Size.Width = 82.000000000000000000
Size.Height = 16.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'labelstyle'
TextSettings.WordWrap = False
Text = 'Cipher function'
end
object ComboBoxCipherAlgorithm: TComboBox
Anchors = [akLeft, akTop, akRight]
Position.X = 16.000000000000000000
Position.Y = 44.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 32.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'comboboxstyle'
TabOrder = 0
OnChange = ComboBoxCipherAlgorithmChange
end
object Label5: TLabel
AutoSize = True
Position.X = 16.000000000000000000
Position.Y = 88.000000000000000000
Size.Width = 91.000000000000000000
Size.Height = 16.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'labelstyle'
TextSettings.WordWrap = False
Text = 'Input is in format'
end
object ComboBoxInputFormatting: TComboBox
Anchors = [akLeft, akTop, akRight]
Position.X = 16.000000000000000000
Position.Y = 116.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 32.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'comboboxstyle'
TabOrder = 1
end
object Label6: TLabel
AutoSize = True
Position.X = 16.000000000000000000
Position.Y = 160.000000000000000000
Size.Width = 119.000000000000000000
Size.Height = 16.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'labelstyle'
TextSettings.WordWrap = False
Text = 'Desired output format'
end
object ComboBoxOutputFormatting: TComboBox
Anchors = [akLeft, akTop, akRight]
Position.X = 16.000000000000000000
Position.Y = 188.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 32.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'comboboxstyle'
TabOrder = 2
end
object Label1: TLabel
AutoSize = True
Position.X = 16.000000000000000000
Position.Y = 240.000000000000000000
Size.Width = 117.000000000000000000
Size.Height = 16.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'labelstyle'
TextSettings.WordWrap = False
Text = 'Encryption key (ASCII)'
end
object EditKey: TEdit
Touch.InteractiveGestures = [LongTap, DoubleTap]
Anchors = [akLeft, akTop, akRight]
StyleLookup = 'editstyle'
TabOrder = 3
Position.X = 16.000000000000000000
Position.Y = 272.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
end
object Label3: TLabel
AutoSize = True
Position.X = 16.000000000000000000
Position.Y = 312.000000000000000000
Size.Width = 130.000000000000000000
Size.Height = 16.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'labelstyle'
TextSettings.WordWrap = False
Text = 'Init vector (hexadecimal)'
end
object EditInitVector: TEdit
Touch.InteractiveGestures = [LongTap, DoubleTap]
Anchors = [akLeft, akTop, akRight]
StyleLookup = 'editstyle'
TabOrder = 4
Position.X = 16.000000000000000000
Position.Y = 344.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
end
object Label4: TLabel
AutoSize = True
Position.X = 16.000000000000000000
Position.Y = 384.000000000000000000
Size.Width = 128.000000000000000000
Size.Height = 16.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'labelstyle'
TextSettings.WordWrap = False
Text = 'Filler byte (hexadecimal)'
end
object EditFiller: TEdit
Touch.InteractiveGestures = [LongTap, DoubleTap]
Anchors = [akLeft, akTop, akRight]
StyleLookup = 'editstyle'
TabOrder = 5
Position.X = 16.000000000000000000
Position.Y = 408.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
end
object Label7: TLabel
AutoSize = True
Position.X = 16.000000000000000000
Position.Y = 448.000000000000000000
Size.Width = 69.000000000000000000
Size.Height = 16.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'labelstyle'
TextSettings.WordWrap = False
Text = 'Cipher mode'
end
object ComboBoxChainingMethod: TComboBox
Anchors = [akLeft, akTop, akRight]
Position.X = 16.000000000000000000
Position.Y = 476.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 32.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'comboboxstyle'
TabOrder = 6
end
object CheckBoxLiveCalc: TCheckBox
Anchors = [akLeft, akTop, akRight]
Position.X = 16.000000000000000000
Position.Y = 528.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 19.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'checkboxstyle'
TabOrder = 7
Text = 'Live calculation'
end
object Label8: TLabel
AutoSize = True
Position.X = 16.000000000000000000
Position.Y = 568.000000000000000000
Size.Width = 93.000000000000000000
Size.Height = 16.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'labelstyle'
TextSettings.WordWrap = False
Text = 'Cipher properties'
end
object StringGridContext: TStringGrid
Anchors = [akLeft, akTop, akRight]
CanFocus = True
ClipChildren = True
Position.X = 16.000000000000000000
Position.Y = 600.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 100.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'gridstyle'
TabOrder = 8
Viewport.Width = 365.000000000000000000
Viewport.Height = 75.000000000000000000
object StringColumn1: TStringColumn
Header = 'Property'
Size.Width = 250.000000000000000000
end
object StringColumn2: TStringColumn
Header = 'Value'
end
end
object Label9: TLabel
AutoSize = True
Position.X = 16.000000000000000000
Position.Y = 720.000000000000000000
Size.Width = 49.000000000000000000
Size.Height = 16.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'labelstyle'
TextSettings.WordWrap = False
Text = 'Plain text'
end
object Label10: TLabel
AutoSize = True
Position.X = 16.000000000000000000
Position.Y = 784.000000000000000000
Size.Width = 58.000000000000000000
Size.Height = 16.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'labelstyle'
TextSettings.WordWrap = False
Text = 'Cipher text'
end
object EditPlainText: TEdit
Touch.InteractiveGestures = [LongTap, DoubleTap]
Anchors = [akLeft, akTop, akRight]
StyleLookup = 'editstyle'
TabOrder = 9
Position.X = 16.000000000000000000
Position.Y = 752.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
OnChangeTracking = EditPlainTextChangeTracking
end
object EditCipherText: TEdit
Touch.InteractiveGestures = [LongTap, DoubleTap]
Anchors = [akLeft, akTop, akRight]
StyleLookup = 'editstyle'
TabOrder = 10
Position.X = 16.000000000000000000
Position.Y = 816.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
end
object ButtonEncrypt: TButton
Anchors = [akLeft, akTop, akRight]
Position.X = 16.000000000000000000
Position.Y = 864.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 33.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'buttonstyle'
TabOrder = 11
Text = 'Encrypt'
OnClick = ButtonEncryptClick
end
object ButtonDecrypt: TButton
Anchors = [akLeft, akTop, akRight]
Position.X = 16.000000000000000000
Position.Y = 920.000000000000000000
Size.Width = 385.000000000000000000
Size.Height = 33.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'buttonstyle'
TabOrder = 12
Text = 'Decrypt'
OnClick = ButtonDecryptClick
end
object LabelVersion: TLabel
AutoSize = True
Position.X = 16.000000000000000000
Position.Y = 968.000000000000000000
Size.Width = 178.000000000000000000
Size.Height = 16.000000000000000000
Size.PlatformDefault = False
StyleLookup = 'labelstyle'
TextSettings.WordWrap = False
Text = #169' 2018-2021 by Team DEC V%0:s'
end
end
end
end

View File

@@ -0,0 +1,397 @@
{*****************************************************************************
The DEC team (see file NOTICE.txt) licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. A copy of this licence is found in the root directory of
this project in the file LICENCE.txt or alternatively at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*****************************************************************************}
unit MainForm;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Layouts,
FMX.StdCtrls, FMX.ListBox, FMX.Controls.Presentation, FMX.Edit, System.Rtti,
{$IF RTLVersion < 31}
{$ELSE}
FMX.Grid.Style,
{$ENDIF}
FMX.Grid, FMX.ScrollBox, DECCipherBase, DECFormatBase;
type
/// <summary>
/// Form of the cross platform FMX Cipher demo
/// </summary>
TFormMain = class(TForm)
VertScrollBox1: TVertScrollBox;
LayoutTop: TLayout;
Label2: TLabel;
ComboBoxCipherAlgorithm: TComboBox;
Label5: TLabel;
ComboBoxInputFormatting: TComboBox;
Label6: TLabel;
ComboBoxOutputFormatting: TComboBox;
Label1: TLabel;
EditKey: TEdit;
Label3: TLabel;
EditInitVector: TEdit;
Label4: TLabel;
EditFiller: TEdit;
Label7: TLabel;
ComboBoxChainingMethod: TComboBox;
CheckBoxLiveCalc: TCheckBox;
Label8: TLabel;
StringGridContext: TStringGrid;
StringColumn1: TStringColumn;
StringColumn2: TStringColumn;
Label9: TLabel;
Label10: TLabel;
EditPlainText: TEdit;
EditCipherText: TEdit;
ButtonEncrypt: TButton;
ButtonDecrypt: TButton;
LabelVersion: TLabel;
procedure FormResize(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ComboBoxCipherAlgorithmChange(Sender: TObject);
procedure ButtonEncryptClick(Sender: TObject);
procedure EditPlainTextChangeTracking(Sender: TObject);
procedure ButtonDecryptClick(Sender: TObject);
private
procedure InitFormatCombos;
procedure InitCipherCombo;
procedure InitCipherModes;
procedure ShowErrorMessage(ErrorMsg: string);
function GetSelectedCipherMode: TCipherMode;
function GetSettings(var InputFormatting : TDECFormatClass;
var OutputFormatting : TDECFormatClass): Boolean;
function GetCipherAlgorithm(var Cipher: TDECCipher): Boolean;
public
end;
var
FormMain: TFormMain;
implementation
uses
System.TypInfo, Generics.Collections, FMX.Platform,
DECBaseClass, DECFormat, DECCipherModes,
DECCipherFormats, DECCiphers, DECUtil
{$IFDEF Android}
,
Androidapi.JNI.GraphicsContentViewText,
Androidapi.Helpers,
Androidapi.JNI.App
{$ENDIF};
{$R *.fmx}
procedure TFormMain.ButtonDecryptClick(Sender: TObject);
var
Cipher : TDECCipher;
InputFormatting : TDECFormatClass;
OutputFormatting : TDECFormatClass;
InputBuffer : TBytes;
OutputBuffer : TBytes;
begin
if not GetSettings(InputFormatting, OutputFormatting) then
exit;
if ComboBoxCipherAlgorithm.ItemIndex >= 0 then
begin
if not GetCipherAlgorithm(Cipher) then
exit;
try
InputBuffer := System.SysUtils.BytesOf(EditCipherText.Text);
if InputFormatting.IsValid(InputBuffer) then
begin
OutputBuffer := (Cipher as TDECFormattedCipher).DecodeBytes(InputFormatting.Decode(InputBuffer));
EditPlainText.Text := string(DECUtil.BytesToRawString(OutputFormatting.Encode(OutputBuffer)));
end
else
ShowErrorMessage('Input has wrong format');
finally
Cipher.Free;
end;
end
else
ShowErrorMessage('No cipher algorithm selected');
end;
procedure TFormMain.ButtonEncryptClick(Sender: TObject);
var
Cipher : TDECCipher;
InputFormatting : TDECFormatClass;
OutputFormatting : TDECFormatClass;
InputBuffer : TBytes;
OutputBuffer : TBytes;
begin
if not GetSettings(InputFormatting, OutputFormatting) then
exit;
if ComboBoxCipherAlgorithm.ItemIndex >= 0 then
begin
if not GetCipherAlgorithm(Cipher) then
exit;
try
InputBuffer := System.SysUtils.BytesOf(EditPlainText.Text);
if InputFormatting.IsValid(InputBuffer) then
begin
OutputBuffer := (Cipher as TDECFormattedCipher).EncodeBytes(InputFormatting.Decode(InputBuffer));
EditCipherText.Text := string(DECUtil.BytesToRawString(OutputFormatting.Encode(OutputBuffer)));
end
else
ShowErrorMessage('Input has wrong format');
finally
Cipher.Free;
end;
end
else
ShowErrorMessage('No cipher algorithm selected');
end;
function TFormMain.GetSettings(var InputFormatting : TDECFormatClass;
var OutputFormatting : TDECFormatClass): Boolean;
begin
result := false;
if ComboBoxInputFormatting.ItemIndex >= 0 then
begin
// Find the class type of the selected formatting class and create an instance of it
InputFormatting := TDECFormat.ClassByName(
ComboBoxInputFormatting.Items[ComboBoxInputFormatting.ItemIndex]);
end
else
begin
ShowErrorMessage('No input format selected');
exit;
end;
if ComboBoxOutputFormatting.ItemIndex >= 0 then
begin
// Find the class type of the selected formatting class and create an instance of it
OutputFormatting := TDECFormat.ClassByName(
ComboBoxOutputFormatting.Items[ComboBoxOutputFormatting.ItemIndex]);
end
else
begin
ShowErrorMessage('No output format selected');
exit;
end;
if EditKey.Text.IsEmpty or EditInitVector.Text.IsEmpty or EditFiller.Text.IsEmpty then
begin
ShowErrorMessage('No key, initialization vector or filler byte given');
exit;
end;
result := true;
end;
function TFormMain.GetCipherAlgorithm(var Cipher : TDECCipher):Boolean;
begin
result := false;
// Find the class type of the selected cipher class and create an instance of it
Cipher := TDECCipher.ClassByName(
ComboBoxCipherAlgorithm.Items[ComboBoxCipherAlgorithm.ItemIndex]).Create;
if TFormat_HEX.IsValid(RawByteString(EditInitVector.Text)) and
TFormat_HEX.IsValid(RawByteString(EditFiller.Text)) then
begin
Cipher.Init(RawByteString(EditKey.Text),
TFormat_HEX.Decode(RawByteString(EditInitVector.Text)),
StrToInt('0x' + EditFiller.Text));
Cipher.Mode := GetSelectedCipherMode;
end
else
begin
ShowErrorMessage('Init vector or filler byte not given in hexadecimal representation');
exit;
end;
result := true;
end;
function TFormMain.GetSelectedCipherMode:TCipherMode;
begin
// Determine selected block chaining method via RTTI (runtime type information)
result := TCipherMode(System.TypInfo.GetEnumValue(
TypeInfo(TCipherMode),
ComboBoxChainingMethod.Items[ComboBoxChainingMethod.ItemIndex]));
end;
procedure TFormMain.ShowErrorMessage(ErrorMsg: string);
{$IF RTLVersion > 30}
var
AsyncDlg : IFMXDialogServiceASync;
{$ENDIF}
begin
{$IF RTLVersion > 30}
if TPlatformServices.Current.SupportsPlatformService(IFMXDialogServiceAsync,
IInterface(AsyncDlg)) then
AsyncDlg.MessageDialogAsync(Translate(ErrorMsg),
TMsgDlgType.mtError, [TMsgDlgBtn.mbOk], TMsgDlgBtn.mbOk, 0,
procedure (const AResult: TModalResult)
begin
end);
{$ELSE}
MessageDlg(Translate(ErrorMsg),
TMsgDlgType.mtError, [TMsgDlgBtn.mbOk], 0);
{$ENDIF}
end;
procedure TFormMain.ComboBoxCipherAlgorithmChange(Sender: TObject);
var
Context : TCipherContext;
begin
Context := TDECCipher.ClassByName(
ComboBoxCipherAlgorithm.Items[ComboBoxCipherAlgorithm.ItemIndex]).Context;
StringGridContext.RowCount := 7;
StringGridContext.Cells[0, 0] := 'Key size (bit)';
StringGridContext.Cells[0, 1] := 'Block size (bit)';
StringGridContext.Cells[0, 2] := 'Buffer size (bit)';
StringGridContext.Cells[0, 3] := 'User size (bit)';
StringGridContext.Cells[0, 4] := 'User save';
StringGridContext.Cells[0, 5] := 'Cipher mode';
StringGridContext.Cells[0, 6] := 'Cipher key';
StringGridContext.Cells[1, 0] := IntToStr(Context.KeySize*8);
StringGridContext.Cells[1, 1] := IntToStr(Context.BlockSize*8);
StringGridContext.Cells[1, 2] := IntToStr(Context.BufferSize*8);
StringGridContext.Cells[1, 3] := IntToStr(Context.AdditionalBufferSize*8);
StringGridContext.Cells[1, 4] := BoolToStr(Context.NeedsAdditionalBufferBackup, true);
if ctBlock in Context.CipherType then
StringGridContext.Cells[1, 5] := 'block cipher'
else
StringGridContext.Cells[1, 5] := 'stream cipher';
if ctSymmetric in Context.CipherType then
StringGridContext.Cells[1, 6] := 'symmetric'
else
StringGridContext.Cells[1, 6] := 'asymmetric';
end;
procedure TFormMain.EditPlainTextChangeTracking(Sender: TObject);
begin
if CheckBoxLiveCalc.IsChecked then
ButtonEncryptClick(self)
end;
procedure TFormMain.FormCreate(Sender: TObject);
var
AppService : IFMXApplicationService;
begin
if TPlatformServices.Current.SupportsPlatformService(IFMXApplicationService,
IInterface(AppService)) then
LabelVersion.Text := format(LabelVersion.Text, [AppService.AppVersion])
else
LabelVersion.Text := format(LabelVersion.Text, ['']);
InitFormatCombos;
InitCipherCombo;
InitCipherModes;
end;
procedure TFormMain.FormResize(Sender: TObject);
begin
LayoutTop.Width := VertScrollBox1.Width;
end;
procedure TFormMain.InitFormatCombos;
var
MyClass : TPair<Int64, TDECClass>;
Formats : TStringList;
CopyIdx : Integer;
begin
Formats := TStringList.Create;
try
for MyClass in TDECFormat.ClassList do
Formats.Add(MyClass.Value.ClassName);
Formats.Sort;
ComboBoxInputFormatting.Items.AddStrings(Formats);
ComboBoxOutputFormatting.Items.AddStrings(Formats);
if Formats.Count > 0 then
begin
if Formats.Find('TFormat_Copy', CopyIdx) then
begin
ComboBoxInputFormatting.ItemIndex := CopyIdx;
ComboBoxOutputFormatting.ItemIndex := CopyIdx;
end
else
begin
ComboBoxInputFormatting.ItemIndex := 0;
ComboBoxOutputFormatting.ItemIndex := 0;
end;
end;
finally
Formats.Free;
end;
end;
procedure TFormMain.InitCipherCombo;
var
MyClass : TPair<Int64, TDECClass>;
Ciphers : TStringList;
begin
Ciphers := TStringList.Create;
try
// Alternatively you can use TDECCipher.ClassList.GetClassList(Ciphers); but
// then it's harder to remove TCipher_Null from the list
for MyClass in TDECCipher.ClassList do
begin
if (MyClass.Value <> TCipher_Null) then
Ciphers.Add(MyClass.Value.ClassName);
end;
Ciphers.Sort;
ComboBoxCipherAlgorithm.Items.AddStrings(Ciphers);
if Ciphers.Count > 0 then
ComboBoxCipherAlgorithm.ItemIndex := 0;
finally
Ciphers.Free;
end;
end;
procedure TFormMain.InitCipherModes;
var
Mode : TCipherMode;
begin
for Mode := low(TCipherMode) to high(TCipherMode) do
begin
ComboBoxChainingMethod.Items.Add(System.TypInfo.GetEnumName(
TypeInfo(TCipherMode),
Integer(Mode)));
end;
if ComboBoxChainingMethod.Items.Count > 0 then
ComboBoxChainingMethod.ItemIndex := 0;
end;
end.