Skip to content

Commit

Permalink
v3.1 (#35)
Browse files Browse the repository at this point in the history
* Add IDateProvider

* Fix event filters

* Remove all direct usages of 'Date' function

* Update Testing.FileManager.pas

* Move business logic from TO2Rules to TFileManager

* Move TO2Rule.GetHighlightColors to TFileManager.GetHighlight

* Move business logic from TO2Rule to TFileManager

* Remove IDateProvider/TDateProvider from uO2Rules

* Remove uO2Utils

* Remove TO2Rule.DisplayPasswordStrength property

* uO2Xml -> uXmlFiler

* Build 551

* Update Testing.FileManager.pas

* uXmlFiler -> uXmlSerialization

* Build 552

* Update Testing.FileManager.pas

* Update Testing.FileManager.pas

* Add GetHighlightForField

* Update Testing.FileManager.pas

* Update Testing.FileManager.pas

* Rename GetNextEvent to TryGetNextEvent

* GetHighlight -> TryGetHighlightColors

* Add TryGetNextEvent

* Build 553

* Add Testing.MarkdownLogger

* Update Testing.EncryptionPropsModel.pas

* Update Testing.MarkdownLogger.pas

* Generate test-results.md

* Update Testing.MarkdownLogger.pas

* Update test-results.md

* Update uO2File.pas

* Update uO2Defs.pas

* Update uO2File.pas

* IV

* Update uO2File.pas

* Update uO2File.pas

* Build 554

* HTML Export: add dark style

* HTML Export: external styles

* Add Mono.css

* Build 555

* Update uHTMLExport.pas

* Add files via upload

* Update O2.iss

* Extend copyright

* Build 556

* Add TryGetStyleFileName

* Add files via upload

* Update README.md

* Version 3.1
  • Loading branch information
maurizuki authored Jan 23, 2025
1 parent 56b2930 commit bf12545
Show file tree
Hide file tree
Showing 115 changed files with 15,708 additions and 10,271 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ src/O2/Dictionaries.res
src/O2/Icons.res

# DUnitX output
dunitx-results.xml
src/Tests/Win32/**/dunitx-results.xml
src/Tests/Win32/**/test-results.md
41 changes: 5 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ winget install --id=maurizuki.O2 -e

## Change log

### Version 3.1
- Cryptography enhancement: the cipher algorithm initialization vector is now randomly generated.
- New feature: custom style sheets for *Export to HTML*. Each *.css* file found in the *Styles* folder can be selected in the *Style* menu of the preview window.
- *Export to HTML*: new dark theme added.

### Version 3.0
- Extensive source code rewrite in order to upgrade it to much modern coding techniques. This may or may not cause some bugs 🙂
- *Object notes* view: note text is now displayed using an Edge-based control instead of an Internet Explorer-based one.
Expand All @@ -47,42 +52,6 @@ winget install --id=maurizuki.O2 -e
- Main window, objects view and fields view: objects and fields highlight indicates the strength of the passwords if the fields match rules of type *Password* with the new option *Display password strength*.
- Developed with Embarcadero® Delphi 11.

### Version 2.2.7
- New feature: export events (fields that match rules of type *Expiration date* and *Recurrence*) in *iCalendar* format, compatible with Microsoft Outlook, Google Calendar, Apple Calendar, etc.
- In the *Rule properties* dialog, *Date format* tab, the text field *Date format* has been replaced with a more friendly drop-down list.
- *Help* menu rationalization.

### Version 2.2.6
- Fixed: multiple consecutive white spaces in notes are not preserved during export to HTML.
- Minor improvements.

### Version 2.2.5
- Export to HTML: new page style in three flavors.
- Check for updates: integration with the GitHub REST API.
- Minor improvements.
- Developed with Embarcadero® Delphi 10.4.

### Version 2.2.4
- Fixed: the selections of the search options *Find by tag* and *Find by rule* aren't initialized opening another file.

### Version 2.2.3
- Deprecated cipher and hash algorithms: the cipher algorithms Blowfish, DES, Ice, Thin Ice, Misty1, RC2, RC4, TEA and the hash algorithms MD5 and SHA-1 have been deprecated due to evidences of their lack of security. It's still possible to open files encrypted using the deprecated algorithms, but it's no longer possible to save files encrypted with them.

### Version 2.2.2
- Main window, fields view: added the menu item *Show passwords* to the context menu.
- Developed with Embarcadero® Delphi 10.3.
- Compiled with Jedi VCL 3.50.

### Version 2.2.1
- Some aesthetic retouches to the main window, print preview window and HTML export preview window.
- New style sheet for the HTML export.
- Added the menu item *Documentation* to the *Help* menu: links to the wiki page of the project.

### Version 2.2
- New portable release that installs directly on removable media.
- Added the new feature *Replace role* to the objects menu: replaces the role of the selected objects in their relations.
- Minor bug fixes and improvements.

## Acknowledgements

The development and deployment of O2 were made possible thanks to the following tools:
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ <h5 class="card-title">It's Open Source Software, baby.</h5>

<footer class="mt-auto py-3 bg-light">
<div class="container">
&copy; 2004-2024 Maurizio Basaglia. This software is licensed under an
&copy; 2004-2025 Maurizio Basaglia. This software is licensed under an
<a href="https://www.opensource.org/">Open Source Initiative</a>
approved <a href="https://opensource.org/licenses/MPL-2.0">license</a>.
</div>
Expand Down
141 changes: 141 additions & 0 deletions docs/xml/O2File/30.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="guid">
<xs:restriction base="xs:string">
<xs:pattern value="[{][0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="TO2File">
<xs:complexType>
<xs:sequence>
<xs:element name="Title" type="xs:string"/>
<xs:element name="Description" type="xs:string"/>
<xs:element name="Author" type="xs:string"/>
<xs:element name="Objects">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ObjectID" type="guid"/>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Tag" type="xs:string"/>
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="FieldName" type="xs:string"/>
<xs:element name="FieldValue" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Text">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TextType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="ttPlainText"/>
<xs:enumeration value="ttCommonMark"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Relations">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="RelationID" type="guid"/>
<xs:element name="ObjectID1" type="guid"/>
<xs:element name="ObjectID2" type="guid"/>
<xs:element name="Role1" type="xs:string"/>
<xs:element name="Role2" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Rules">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
<xs:element name="RuleType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="rtHyperLink"/>
<xs:enumeration value="rtEmail"/>
<xs:enumeration value="rtPassword"/>
<xs:enumeration value="rtExpirationDate"/>
<xs:enumeration value="rtRecurrence"/>
<xs:enumeration value="rtHighlight"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="FieldName" type="xs:string"/>
<xs:element name="FieldValue" type="xs:string"/>
<xs:element name="Params">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ParamName">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Mask"/>
<xs:enumeration value="DisplayMask"/>
<xs:enumeration value="DateSeparator"/>
<xs:enumeration value="ShortDateFormat"/>
<xs:enumeration value="DaysBefore"/>
<xs:enumeration value="DaysAfter"/>
<xs:enumeration value="Color"/>
<xs:enumeration value="TextColor"/>
<xs:enumeration value="DisplayPasswordStrength"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ParamValue" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Active">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="False"/>
<xs:enumeration value="True"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
9 changes: 9 additions & 0 deletions release.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
$AppExeFilePath = ".\src\O2\o2.exe"
$SetupScriptFilePath = ".\setup\O2.iss"
$VersionInfoFilePath = ".\sf_net\upd8r.xml"
$TestResultsFilePath = ".\test-results.md"

# Run the tests

.\src\Tests\Win32\Release\O2TestProject.exe -xml:$TestResultsFilePath

if ($LASTEXITCODE -ne 0) {
Exit 1
}

# Compress the main executable file

Expand Down
Binary file modified setup/AddressBook.o2
Binary file not shown.
6 changes: 5 additions & 1 deletion setup/O2.iss
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#define AppName "O2"
#define AppVersion GetFileProductVersion("..\src\O2\O2.exe")
#define Copyright "(C) 2004-2024 Maurizio Basaglia. All rights reserved."
#define Copyright "(C) 2004-2025 Maurizio Basaglia. All rights reserved."

#define SetupDir "setup"
#define AppExeDir "src\O2"
#define LauncherDir "src\Launcher"
#define LicenseDir "setup"
#define ReadmeDir "setup"
#define ExamplesDir "setup"
#define StylesDir "src\O2\Styles"

#define AppExeFile "o2.exe"
#define LauncherFile "O2Portable.exe"
Expand Down Expand Up @@ -46,6 +47,7 @@ Name: custom; Description: Custom installation; Flags: iscustom
[Components]
Name: program; Description: {#AppName}; Types: full compact custom; Flags: fixed
Name: examples; Description: Examples; Types: full
Name: styles; Description: Styles; Types: full
Name: languages; Description: Languages; Types: full
Name: languages\en; Description: English; Types: full compact custom; Flags: fixed
Name: languages\it; Description: Italian; Types: full
Expand All @@ -65,6 +67,8 @@ Source: {#LicenseDir}\{#LicenseFile}; DestDir: {app}; Components: program
Source: {#ReadmeDir}\{#ReadmeFile}; DestDir: {app}; Components: program
Source: {#ExamplesDir}\AddressBook.o2; DestDir: {app}\Examples; Components: examples
Source: {#ExamplesDir}\PasswordWallet.o2; DestDir: {app}\Examples; Components: examples
Source: {#StylesDir}\Blocks.css; DestDir: {app}\Styles; Components: styles
Source: {#StylesDir}\Mono.css; DestDir: {app}\Styles; Components: styles
Source: {#AppExeDir}\o2.ENU; DestDir: {app}; Components: languages\en; Flags: ignoreversion
Source: {#AppExeDir}\o2.ITA; DestDir: {app}; Components: languages\it; Flags: ignoreversion

Expand Down
Binary file modified setup/PasswordWallet.o2
Binary file not shown.
Binary file modified setup/ReadMe.rtf
Binary file not shown.
4 changes: 2 additions & 2 deletions sf_net/upd8r.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<AppName>O2</AppName>
<AppVersion>
<MajorVersion>3</MajorVersion>
<MinorVersion>0</MinorVersion>
<MinorVersion>1</MinorVersion>
<Release>0</Release>
<Build>550</Build>
<Build>557</Build>
</AppVersion>
<DownloadURL>https://github.com/maurizuki/O2/releases/latest</DownloadURL>
</Update>
2 changes: 1 addition & 1 deletion src/Launcher/O2Portable.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{ The initial Contributor is Maurizio Basaglia. }
{ }
{ Portions created by the initial Contributor are Copyright (C) }
{ 2004-2024 the initial Contributor. All rights reserved. }
{ 2004-2025 the initial Contributor. All rights reserved. }
{ }
{ Contributor(s): }
{ }
Expand Down
3 changes: 2 additions & 1 deletion src/Launcher/O2Portable.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_MajorVer>3</VerInfo_MajorVer>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=The O2 Project;FileDescription=O2 Portable;FileVersion=3.0.0.0;InternalName=AppLauncher;LegalCopyright=(C) 2004-2024 Maurizio Basaglia. All rights reserved.;LegalTrademarks=;OriginalFilename=O2Portable.exe;ProductName=O2;ProductVersion=3.0;Comments=</VerInfo_Keys>
<VerInfo_Keys>CompanyName=The O2 Project;FileDescription=O2 Portable;FileVersion=3.1.0.0;InternalName=AppLauncher;LegalCopyright=(C) 2004-2025 Maurizio Basaglia. All rights reserved.;LegalTrademarks=;OriginalFilename=O2Portable.exe;ProductName=O2;ProductVersion=3.1;Comments=</VerInfo_Keys>
<DCC_OutputDRCFile>true</DCC_OutputDRCFile>
<VerInfo_MinorVer>1</VerInfo_MinorVer>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_DependencyCheckOutputName>O2Portable.exe</DCC_DependencyCheckOutputName>
Expand Down
Binary file modified src/Launcher/O2Portable.res
Binary file not shown.
2 changes: 1 addition & 1 deletion src/O2/DataModel/uO2Classes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{ The initial Contributor is Maurizio Basaglia. }
{ }
{ Portions created by the initial Contributor are Copyright (C) }
{ 2004-2024 the initial Contributor. All rights reserved. }
{ 2004-2025 the initial Contributor. All rights reserved. }
{ }
{ Contributor(s): }
{ }
Expand Down
26 changes: 14 additions & 12 deletions src/O2/DataModel/uO2Defs.pas
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{ The initial Contributor is Maurizio Basaglia. }
{ }
{ Portions created by the initial Contributor are Copyright (C) }
{ 2004-2024 the initial Contributor. All rights reserved. }
{ 2004-2025 the initial Contributor. All rights reserved. }
{ }
{ Contributor(s): }
{ }
Expand All @@ -18,25 +18,16 @@
interface

uses
Classes, SysUtils;
SysUtils;

const
O2FileGUID: TGUID = '{ABBB4FE2-9C21-450E-80B0-469DFD8A8BFC}';
O2FileVersion: WordRec = (Lo: 3; Hi: 2); // 2.3
O2FileVersion: WordRec = (Lo: 0; Hi: 3); // 3.0

type
TO2Cipher = Byte;
TO2Hash = Byte;

TO2FileHeader = packed record
ContentType: TGUID;
Version: Word;
Encrypted: Boolean;
Cipher: TO2Cipher;
Hash: TO2Hash;
CRC32: Longword;
end;

const

{ Supported ciphers IDs }
Expand Down Expand Up @@ -94,11 +85,17 @@ interface
ohSHA1
];

var
O2FileSchemaLocation: string;

function CipherToIdent(Cipher: Longint; var Ident: string): Boolean;
function HashToIdent(Hash: Longint; var Ident: string): Boolean;

implementation

uses
Classes;

const
Ciphers: array[0..19] of TIdentMapEntry = (
(Value: ocNone; Name: 'ocNone'),
Expand Down Expand Up @@ -145,4 +142,9 @@ function HashToIdent(Hash: Longint; var Ident: string): Boolean;
Result := IntToIdent(Hash, Ident, Hashes);
end;

initialization
O2FileSchemaLocation := Format(
'https://maurizuki.github.io/O2/xml/O2File/%d%d.xsd',
[O2FileVersion.Hi, O2FileVersion.Lo]);

end.
Loading

0 comments on commit bf12545

Please sign in to comment.