Skip to content

Commit

Permalink
Merge pull request #27 from guanlisheng/upgrade2v4
Browse files Browse the repository at this point in the history
Cipher auto-detect to support both SQLiteStudio and Database Browser for SQLite (DB4S)
  • Loading branch information
guanlisheng authored Mar 14, 2024
2 parents c567962 + cd49a52 commit e90729d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/attachdbdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pour plus de détails.

#include <wx/valtext.h>
#include <wx/filedlg.h>
#include <wx/filename.h>
/*---------------------------------------------------------------------------*/
#include "attachdbdlg.h"
#include "wxsqliteplusapp.h"
Expand Down Expand Up @@ -199,6 +200,12 @@ void wxAttachDbDlg::OnAttachbtnClick(wxCommandEvent& event)
if (fileDialog.ShowModal() == wxID_OK)
{
m_EdFilename->SetValue(fileDialog.GetPath());

wxString alias = wxFileName(fileDialog.GetPath()).GetName().Lower();
alias.Replace((" "), ("_"));
alias.Replace(("\""), (""));
alias.Replace(("'"), (""));
m_EdAlias->SetValue(alias);
}
}
/*---------------------------------------------------------------------------*/
Expand Down
24 changes: 24 additions & 0 deletions src/sqliteplusframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,30 @@ void wxSQLitePlusFrame::Init()
wxSQLite3CipherAes128* aes128 = new wxSQLite3CipherAes128;
this->m_Cipher.push_back(aes128);

wxSQLite3CipherSQLCipher* sqlCipher1 = new wxSQLite3CipherSQLCipher();
sqlCipher1->InitializeVersionDefault(1);
this->m_Cipher.push_back(sqlCipher1);

wxSQLite3CipherSQLCipher* sqlCipher2 = new wxSQLite3CipherSQLCipher();
sqlCipher2->InitializeVersionDefault(2);
sqlCipher2->SetFastKdfIter(4000);
sqlCipher2->SetHmacSaltMask(0);
this->m_Cipher.push_back(sqlCipher2);

wxSQLite3CipherSQLCipher* sqlCipher2be = new wxSQLite3CipherSQLCipher();
sqlCipher2be->InitializeVersionDefault(2);
sqlCipher2be->SetHmacPgNo(2);
this->m_Cipher.push_back(sqlCipher2be);

wxSQLite3CipherSQLCipher* sqlCipher2le = new wxSQLite3CipherSQLCipher();
sqlCipher2le->InitializeVersionDefault(2);
this->m_Cipher.push_back(sqlCipher2le);

wxSQLite3CipherSQLCipher* sqlCipher3 = new wxSQLite3CipherSQLCipher();
sqlCipher3->InitializeVersionDefault(3);
sqlCipher3->SetLegacy(true);
this->m_Cipher.push_back(sqlCipher3);

wxSQLite3CipherSQLCipher* sqlCipher4 = new wxSQLite3CipherSQLCipher();
sqlCipher4->InitializeVersionDefault(4);
sqlCipher4->SetLegacy(true);
Expand Down
2 changes: 1 addition & 1 deletion src/wxsqliteplusapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ wxString wxSQLitePlusApp::GetFileDescription() const
/*---------------------------------------------------------------------------*/
wxString wxSQLitePlusApp::GetFileVersion() const
{
return "0.3.7";
return "0.3.8";
}
/*---------------------------------------------------------------------------*/
wxString wxSQLitePlusApp::GetInternalName() const
Expand Down

0 comments on commit e90729d

Please sign in to comment.