Skip to content

Commit

Permalink
Release 1.1.8302
Browse files Browse the repository at this point in the history
Version 1.1.8303
-----------------------------------------------------------------
Frontend related changes
- Feature: Added chiptypes. These are:
  + NTAG
  + DESFIRE light
  + DESFIRE EV3
  + DESFIRE is now identified including memory size
    e.g.: Desfire EV1 is now displayed as: Desfire EV1 (8K)
- Feature: Added new Task "Common Tasks" -> "Execute external Program"
  + User Input: In the Textbox "Program to Execute (with Arguments)"
  one might insert the Program to execute. Loading Files with the default
  Application is supported too.
  Example 1 (Shell Execute):
  "C:\path to\app file with spaces in filename.bat" arg1 %DATE %CHIPTYPE
  Will execute the batch with the arguments arg1 01.01.2022 DesfireEV18k
  Example 2:
  "C:\path to\non executable file.pdf"
  Will open the file by using the default application (i.e. Adobe Reader)
- Feature: Add one "Internal Variable" (see ver. 0.1.8231):
  Usage:
  + %n will add an integer number of length 1 to a pdf formfield
    the integer counts up +1 each time the variable itself has been used.
	Example: $JobNumber-%nn in the "Fieldvalue" Textbox will take the
	external argument $Jobnumer=Job1234 and fill the pdf formfield with
	Job1234-01
- Improvement: Set Elatec COM-Port as "USB" leads to "AutoDetect"

Backend related changes
- Fix: Rename Project Files after they have been saved is now possible
- Fix: Extended Reader Timeout (5 Sec). Elatec TWN4 Readers are slower than PCSC
- Fix: Closing Dialogs will no longer minimize Main Window
  • Loading branch information
c3rebro committed Sep 25, 2022
1 parent f8302d5 commit 3b356b0
Show file tree
Hide file tree
Showing 16 changed files with 102 additions and 71 deletions.
2 changes: 1 addition & 1 deletion RFiDGear/DataAccessLayer/Local/CustomConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public static IEnumerable<string> GenerateStringSequence(int n1, int n2)
{
while (n1 <= n2)
{
yield return n1++.ToString();
yield return n1++.ToString(CultureInfo.CurrentCulture);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public DatabaseReaderWriter()
foreach(string file in Directory.GetFiles(appDataPath))
{
FileInfo fi = new FileInfo(file);
if (fi.Extension.ToLower().Contains("rfprj"))
if (fi.Extension.ToLower(CultureInfo.CurrentCulture).Contains("rfprj"))
{
fi.Delete();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Log4CSharp;

using System;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Text;
Expand Down Expand Up @@ -101,7 +102,7 @@ public SettingsReaderWriter()
doc.DocumentElement.AppendChild(PayLoadElem);
doc.DocumentElement.AppendChild(InfoTextElem);

CheckIntervalElem.InnerText = _updateInterval.ToString();
CheckIntervalElem.InnerText = _updateInterval.ToString(CultureInfo.CurrentCulture);
RemoteConfigUriElem.InnerText = _updateURL;
SecurityTokenElem.InnerText = _securityToken;
BaseUriElem.InnerText = _baseUri;
Expand Down
14 changes: 11 additions & 3 deletions RFiDGear/DataAccessLayer/Remote/FromIO/ElatecNetProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,24 +122,29 @@ public override ERROR WriteMifareClassicSingleBlock(int _blockNumber, string _aK
return WriteMifareClassicSingleSector(
CustomConverter.GetSectorNumberFromChipBasedDataBlockNumber(_blockNumber), _aKey, _bKey, buffer);
}

public override ERROR ReadMifareClassicSingleSector(int sectorNumber, string aKey, string bKey)
{
return readWriteAccessOnClassicSector(sectorNumber, aKey, bKey, null);
}

public override ERROR WriteMifareClassicSingleSector(int sectorNumber, string aKey, string bKey, byte[] buffer)
{
return readWriteAccessOnClassicSector(sectorNumber, aKey, bKey, buffer);
}

public override ERROR WriteMifareClassicWithMAD(int _madApplicationID, int _madStartSector,
string _aKeyToUse, string _bKeyToUse, string _aKeyToWrite, string _bKeyToWrite,
string _madAKeyToUse, string _madBKeyToUse, string _madAKeyToWrite, string _madBKeyToWrite,
byte[] buffer, byte _madGPB, SectorAccessBits _sab, bool _useMADToAuth = false, bool _keyToWriteUseMAD = false)
string _madAKeyToUse, string _madBKeyToUse, string _madAKeyToWrite,
string _madBKeyToWrite, byte[] buffer, byte _madGPB, SectorAccessBits _sab,
bool _useMADToAuth, bool _keyToWriteUseMAD)
{
throw new NotImplementedException();
}

public override ERROR ReadMifareClassicWithMAD(int madApplicationID, string _aKeyToUse,
string _bKeyToUse, string _madAKeyToUse, string _madBKeyToUse, int _length, byte _madGPB,
bool _useMADToAuth = true, bool _aiToUseIsMAD = false)
bool _useMADToAuth, bool _aiToUseIsMAD)
{
throw new NotImplementedException();
}
Expand Down Expand Up @@ -239,13 +244,15 @@ public override ERROR GetMiFareDESFireChipAppIDs(string _appMasterKey, DESFireKe

return ERROR.NoError;
}

public override ERROR CreateMifareDesfireFile(string _appMasterKey, DESFireKeyType _keyTypeAppMasterKey, FileType_MifareDesfireFileType _fileType, DESFireAccessRights _accessRights, EncryptionMode _encMode,
int _appID, int _fileNo, int _fileSize,
int _minValue = 0, int _maxValue = 1000, int _initValue = 0, bool _isValueLimited = false,
int _maxNbOfRecords = 100)
{
throw new NotImplementedException();
}

public override ERROR ReadMiFareDESFireChipFile(string _appMasterKey, DESFireKeyType _keyTypeAppMasterKey,
string _appReadKey, DESFireKeyType _keyTypeAppReadKey, int _readKeyNo,
string _appWriteKey, DESFireKeyType _keyTypeAppWriteKey, int _writeKeyNo,
Expand All @@ -254,6 +261,7 @@ public override ERROR ReadMiFareDESFireChipFile(string _appMasterKey, DESFireKey
{
throw new NotImplementedException();
}

public override ERROR WriteMiFareDESFireChipFile(string _cardMasterKey, DESFireKeyType _keyTypeCardMasterKey,
string _appMasterKey, DESFireKeyType _keyTypeAppMasterKey,
string _appReadKey, DESFireKeyType _keyTypeAppReadKey, int _readKeyNo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,6 @@ public override ERROR ChangeMifareDesfireApplicationKey(
};
CustomConverter.FormatMifareDesfireKeyStringWithSpacesEachByte(_applicationMasterKeyTarget);
applicationMasterKeyTarget.Value = CustomConverter.DesfireKeyToCheck;
//applicationMasterKeyTarget.KeyVersion = applicationMasterKeyTarget.KeyVersion = 1;

if (readerUnit.ConnectToReader())
{
Expand Down
6 changes: 4 additions & 2 deletions RFiDGear/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Resources;
#region Using directives
using System;
using System.Reflection;
Expand All @@ -12,7 +13,7 @@
[assembly: AssemblyConfiguration("x86")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RFiDGear")]
[assembly: AssemblyCopyright("Copyright 2016")]
[assembly: AssemblyCopyright("Copyright 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
Expand All @@ -24,5 +25,6 @@
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.*")]
[assembly: Guid("a34bc413-e349-4fd1-8b90-2eb95a333436")]
[assembly: NeutralResourcesLanguage("en")]
4 changes: 2 additions & 2 deletions RFiDGear/RFiDGear.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<ApplicationIcon>Resources\logo.ico</ApplicationIcon>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
Expand All @@ -37,8 +38,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<ApplicationVersion>1.1.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion RFiDGear/RFiDGear.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<StartWorkingDirectory>D:\Seafile\Dokumente Privat\Steven\Projekte\Software\Windows\RFIDGear\RFiDGear\bin\Debug\</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup>
<PublishUrlHistory />
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
Expand Down
22 changes: 15 additions & 7 deletions RFiDGear/View/AboutView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@
xmlns:v="clr-namespace:RFiDGear.View"
Title="{Binding Caption}"
Width="300"
Height="400"

ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterScreen">
<Window.Resources>
<dal:ResourceLoader x:Key="Localization" />
</Window.Resources>
<Grid Margin="0,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="142" />
<RowDefinition Height="142" />
<RowDefinition Height="42" />
<RowDefinition Height="120" />
<RowDefinition Height="36" />
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
Expand All @@ -28,14 +30,20 @@
<TextBlock
Grid.Row="1"
Grid.ColumnSpan="3"
Margin="10,9,10,11"
Margin="10,8.8,9.6,10.4"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Focusable="False"
FontSize="14"
Text="{Binding AboutText, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
TextAlignment="Center"
TextWrapping="Wrap" />
<TextBlock Grid.Row="2" Grid.ColumnSpan="3" Margin="0,0,0,0" Grid.RowSpan="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<Hyperlink NavigateUri="https://github.com/c3rebro/RFiDGear/releases" RequestNavigate="Hyperlink_RequestNavigate">
Changelog
</Hyperlink>
</TextBlock>

<Image
x:Name="image"
Grid.Column="1"
Expand All @@ -44,12 +52,12 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
Opacity="1"
Source="/Resources/splash.png" />
Source="/Resources/splash.png" Margin="0.4,27,0,26.2" />
<Button
Grid.Row="2"
Grid.Row="3"
Grid.Column="1"
Width="80"
Margin="0,10,0,0"
Margin="5.4,5,5,0"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Command="{Binding OkCommand}"
Expand Down
9 changes: 9 additions & 0 deletions RFiDGear/View/AboutView.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -24,5 +25,13 @@ public AboutView()
{
InitializeComponent();
}

private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
// for .NET Core you need to add UseShellExecute = true
// see https://docs.microsoft.com/dotnet/api/system.diagnostics.processstartinfo.useshellexecute#property-value
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows.Controls;
using System.Globalization;
using System.Windows.Input;
using System.Xml.Serialization;

Expand Down Expand Up @@ -464,7 +465,7 @@ public string ChildNodeHeader
break;

default:
if(Enum.GetName(typeof(CARD_TYPE), _cardType).ToLower().Contains("desfire"))
if(Enum.GetName(typeof(CARD_TYPE), _cardType).ToLower(CultureInfo.CurrentCulture).Contains("desfire"))
{
childNodeHeader = string.Format("AppID: {0}", appModel.appID);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Globalization;
using System.Windows.Controls;
using System.Windows.Input;
using System.Xml.Serialization;
Expand Down Expand Up @@ -373,7 +374,7 @@ private void MifareDesfireQuickCheck()
RFiDChipGrandChildLayerViewModel grandChild = Children.First(x => x.AppID == appID).Children.First(y => (y.DesfireFile != null ? y.DesfireFile.FileID : -1) == fileID);

grandChild.Children.Add(new RFiDChipGrandGrandChildLayerViewModel(string.Format("FileType: {0}", Enum.GetName(typeof(FileType_MifareDesfireFileType), device.DesfireFileSettings.FileType)), grandChild));
grandChild.Children.Add(new RFiDChipGrandGrandChildLayerViewModel(string.Format("FileSize: {0}Bytes", device.DesfireFileSettings.dataFile.fileSize.ToString()), grandChild));
grandChild.Children.Add(new RFiDChipGrandGrandChildLayerViewModel(string.Format("FileSize: {0}Bytes", device.DesfireFileSettings.dataFile.fileSize.ToString(CultureInfo.CurrentCulture)), grandChild));
grandChild.Children.Add(new RFiDChipGrandGrandChildLayerViewModel(string.Format("EncryptionMode: {0}", Enum.GetName(typeof(EncryptionMode), device.DesfireFileSettings.comSett)), grandChild));
grandChild.Children.Add(new RFiDChipGrandGrandChildLayerViewModel(string.Format("Read: {0}", Enum.GetName(typeof(TaskAccessRights), (device.DesfireFileSettings.accessRights[1] & 0xF0) >> 4)), grandChild));
grandChild.Children.Add(new RFiDChipGrandGrandChildLayerViewModel(string.Format("Write: {0}", Enum.GetName(typeof(TaskAccessRights), device.DesfireFileSettings.accessRights[1] & 0x0F)), grandChild));
Expand Down Expand Up @@ -831,7 +832,7 @@ private void LoadChildren()
break;

default:
if(Enum.GetName(typeof(CARD_TYPE), CardType).ToLower().Contains("desfire"))
if(Enum.GetName(typeof(CARD_TYPE), CardType).ToLower(CultureInfo.CurrentCulture).Contains("desfire"))
{
_children.Add(new RFiDChipChildLayerViewModel(new MifareDesfireAppModel(0), this, CardType, dialogs));
}
Expand Down
25 changes: 12 additions & 13 deletions RFiDGear/ViewModel/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -843,25 +843,24 @@ private void OnNewExecuteQuickCheckCommand()

ReadChipCommand.Execute(null);

if (treeViewParentNodes != null && !treeViewParentNodes.Any(x => x.IsSelected) && treeViewParentNodes.Count > 0)
if (treeViewParentNodes != null && treeViewParentNodes.Any(x => x.IsSelected) && treeViewParentNodes.Count > 0)
{
treeViewParentNodes.FirstOrDefault().IsSelected = true;
}

if (treeViewParentNodes.Single(x => x.IsSelected == true).CardType == CARD_TYPE.Mifare1K ||
treeViewParentNodes.Single(x => x.IsSelected == true).CardType == CARD_TYPE.Mifare2K ||
treeViewParentNodes.Single(x => x.IsSelected == true).CardType == CARD_TYPE.Mifare4K)
{
treeViewParentNodes.Single(x => x.IsSelected == true).ExecuteClassicQuickCheckCommand.Execute(null);
} // Mifare Classic
if (treeViewParentNodes.Single(x => x.IsSelected == true).CardType == CARD_TYPE.Mifare1K ||
treeViewParentNodes.Single(x => x.IsSelected == true).CardType == CARD_TYPE.Mifare2K ||
treeViewParentNodes.Single(x => x.IsSelected == true).CardType == CARD_TYPE.Mifare4K)
{
treeViewParentNodes.Single(x => x.IsSelected == true).ExecuteClassicQuickCheckCommand.Execute(null);
} // Mifare Classic

else if (Enum.GetName(typeof(CARD_TYPE), treeViewParentNodes.Single(x => x.IsSelected == true).CardType).ToLower().Contains("desfire"))
{
treeViewParentNodes.Single(x => x.IsSelected == true).ExecuteDesfireQuickCheckCommand.Execute(null);
} // Mifare Desfire
else if (Enum.GetName(typeof(CARD_TYPE), treeViewParentNodes.Single(x => x.IsSelected == true).CardType).ToLower(CultureInfo.CurrentCulture).Contains("desfire"))
{
treeViewParentNodes.Single(x => x.IsSelected == true).ExecuteDesfireQuickCheckCommand.Execute(null);
} // Mifare Desfire
}

Mouse.OverrideCursor = null;

}
catch
{
Expand Down
Loading

0 comments on commit 3b356b0

Please sign in to comment.