Release 2.2.0
- Added YubiKey 2FA integration for unlocking databases [#127] - Added TOTP support [#519] - Added CSV import tool [#146, #490] - Added KeePassXC CLI tool [#254] - Added diceware password generator [#373] - Added support for entry references [#370, #378] - Added support for Twofish encryption [#167] - Enabled DEP and ASLR for in-memory protection [#371] - Enabled single instance mode [#510] - Enabled portable mode [#645] - Enabled database lock on screensaver and session lock [#545] - Redesigned welcome screen with common features and recent databases [#292] - Multiple updates to search behavior [#168, #213, #374, #471, #603, #654] - Added auto-type fields {CLEARFIELD}, {SPACE}, {{}, {}} [#267, #427, #480] - Fixed auto-type errors on Linux [#550] - Prompt user prior to executing a cmd:// URL [#235] - Entry attributes can be protected (hidden) [#220] - Added extended ascii to password generator [#538] - Added new database icon to toolbar [#289] - Added context menu entry to empty recycle bin in databases [#520] - Added "apply" button to entry and group edit windows [#624] - Added macOS tray icon and enabled minimize on close [#583] - Fixed issues with unclean shutdowns [#170, #580] - Changed keyboard shortcut to create new database to CTRL+SHIFT+N [#515] - Compare window title to entry URLs [#556] - Implemented inline error messages [#162] - Ignore group expansion and other minor changes when making database "dirty" [#464] - Updated license and copyright information on souce files [#632] - Added contributors list to about dialog [#629]
89
.clang-format
Normal file
@ -0,0 +1,89 @@
|
||||
---
|
||||
Language: Cpp
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: false
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BraceWrapping:
|
||||
AfterClass: true
|
||||
AfterFunction: true
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
ColumnLimit: 120
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
- Regex: '^(<|"(gtest|isl|json)/)'
|
||||
Priority: 3
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
IndentCaseLabels: false
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: All
|
||||
ObjCBlockIndentWidth: 4
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PointerAlignment: Left
|
||||
ReflowComments: true
|
||||
SortIncludes: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
...
|
||||
|
4
.gitattributes
vendored
@ -7,3 +7,7 @@ src/version.h.cmake export-subst
|
||||
snapcraft.yaml export-ignore
|
||||
make_release.sh export-ignore
|
||||
AppImage-Recipe.sh export-ignore
|
||||
|
||||
# github-linguist language hints
|
||||
*.h linguist-language=C++
|
||||
*.cpp linguist-language=C++
|
||||
|
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -3,11 +3,11 @@
|
||||
## Description
|
||||
<!--- Describe your changes in detail -->
|
||||
|
||||
## Motivation and Context
|
||||
## Motivation and context
|
||||
<!--- Why is this change required? What problem does it solve? -->
|
||||
<!--- If it fixes an open issue, please link to the issue here. -->
|
||||
|
||||
## How Has This Been Tested?
|
||||
## How has this been tested?
|
||||
<!--- Please describe in detail how you tested your changes. -->
|
||||
<!--- Include details of your testing environment, and the tests you ran to -->
|
||||
<!--- see how your change affects other areas of the code, etc. -->
|
||||
@ -29,5 +29,6 @@
|
||||
- ✅ I have read the **CONTRIBUTING** document. **[REQUIRED]**
|
||||
- ✅ My code follows the code style of this project. **[REQUIRED]**
|
||||
- ✅ All new and existing tests passed. **[REQUIRED]**
|
||||
- ✅ I have compiled and verified my code with `-DWITH_ASAN=ON`. **[REQUIRED]**
|
||||
- ✅ My change requires a change to the documentation and I have updated it accordingly.
|
||||
- ✅ I have added tests to cover my changes.
|
||||
|
2
.gitignore
vendored
@ -4,3 +4,5 @@ release*/
|
||||
.idea/
|
||||
*.iml
|
||||
*.kdev4
|
||||
|
||||
\.vscode/
|
||||
|
@ -13,15 +13,15 @@ compiler:
|
||||
- gcc
|
||||
|
||||
env:
|
||||
- CONFIG=Release
|
||||
- CONFIG=Debug
|
||||
- CONFIG=Release ASAN_OPTIONS=detect_odr_violation=1:leak_check_at_exit=0
|
||||
- CONFIG=Debug ASAN_OPTIONS=detect_odr_violation=1:leak_check_at_exit=0
|
||||
|
||||
git:
|
||||
depth: 3
|
||||
|
||||
before_install:
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq update; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq install cmake libmicrohttpd10 libmicrohttpd-dev libxi-dev qtbase5-dev libqt5x11extras5-dev qttools5-dev qttools5-dev-tools libgcrypt20-dev zlib1g-dev libxtst-dev xvfb; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq install cmake libclang-common-3.5-dev libxi-dev qtbase5-dev libqt5x11extras5-dev qttools5-dev qttools5-dev-tools libgcrypt20-dev zlib1g-dev libxtst-dev xvfb libyubikey-dev libykpers-1-dev; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew ls | grep -wq cmake || brew install cmake; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew ls | grep -wq qt5 || brew install qt5; fi
|
||||
@ -32,7 +32,7 @@ before_script:
|
||||
- mkdir build && pushd build
|
||||
|
||||
script:
|
||||
- cmake -DCMAKE_BUILD_TYPE=${CONFIG} -DWITH_GUI_TESTS=ON -DWITH_XC_HTTP=ON -DWITH_XC_AUTOTYPE=ON -DWITH_XC_YUBIKEY=ON $CMAKE_ARGS ..
|
||||
- cmake -DCMAKE_BUILD_TYPE=${CONFIG} -DWITH_GUI_TESTS=ON -DWITH_ASAN=ON -DWITH_XC_HTTP=ON -DWITH_XC_AUTOTYPE=ON -DWITH_XC_YUBIKEY=ON $CMAKE_ARGS ..
|
||||
- make -j2
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then make test ARGS+="-E testgui --output-on-failure"; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then xvfb-run -a --server-args="-screen 0 800x600x24" make test ARGS+="-R testgui --output-on-failure"; fi
|
||||
|
33
CHANGELOG
@ -1,3 +1,36 @@
|
||||
2.2.0 (2017-06-23)
|
||||
=========================
|
||||
|
||||
- Added YubiKey 2FA integration for unlocking databases [#127]
|
||||
- Added TOTP support [#519]
|
||||
- Added CSV import tool [#146, #490]
|
||||
- Added KeePassXC CLI tool [#254]
|
||||
- Added diceware password generator [#373]
|
||||
- Added support for entry references [#370, #378]
|
||||
- Added support for Twofish encryption [#167]
|
||||
- Enabled DEP and ASLR for in-memory protection [#371]
|
||||
- Enabled single instance mode [#510]
|
||||
- Enabled portable mode [#645]
|
||||
- Enabled database lock on screensaver and session lock [#545]
|
||||
- Redesigned welcome screen with common features and recent databases [#292]
|
||||
- Multiple updates to search behavior [#168, #213, #374, #471, #603, #654]
|
||||
- Added auto-type fields {CLEARFIELD}, {SPACE}, {{}, {}} [#267, #427, #480]
|
||||
- Fixed auto-type errors on Linux [#550]
|
||||
- Prompt user prior to executing a cmd:// URL [#235]
|
||||
- Entry attributes can be protected (hidden) [#220]
|
||||
- Added extended ascii to password generator [#538]
|
||||
- Added new database icon to toolbar [#289]
|
||||
- Added context menu entry to empty recycle bin in databases [#520]
|
||||
- Added "apply" button to entry and group edit windows [#624]
|
||||
- Added macOS tray icon and enabled minimize on close [#583]
|
||||
- Fixed issues with unclean shutdowns [#170, #580]
|
||||
- Changed keyboard shortcut to create new database to CTRL+SHIFT+N [#515]
|
||||
- Compare window title to entry URLs [#556]
|
||||
- Implemented inline error messages [#162]
|
||||
- Ignore group expansion and other minor changes when making database "dirty" [#464]
|
||||
- Updated license and copyright information on souce files [#632]
|
||||
- Added contributors list to about dialog [#629]
|
||||
|
||||
2.1.4 (2017-04-09)
|
||||
=========================
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
# Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
|
||||
# Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -25,6 +26,9 @@ cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
# Support Visual Studio Code
|
||||
include(CMakeToolsHelpers OPTIONAL)
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
include(CheckCXXSourceCompiles)
|
||||
@ -32,14 +36,21 @@ include(CheckCXXSourceCompiles)
|
||||
option(WITH_TESTS "Enable building of unit tests" ON)
|
||||
option(WITH_GUI_TESTS "Enable building of GUI tests" OFF)
|
||||
option(WITH_DEV_BUILD "Use only for development. Disables/warns about deprecated methods." OFF)
|
||||
option(WITH_COVERAGE "Use to build with coverage tests. (GCC ONLY)." OFF)
|
||||
option(WITH_ASAN "Enable address sanitizer checks (Linux only)" OFF)
|
||||
option(WITH_COVERAGE "Use to build with coverage tests (GCC only)." OFF)
|
||||
option(WITH_APP_BUNDLE "Enable Application Bundle for OS X" ON)
|
||||
|
||||
option(WITH_XC_AUTOTYPE "Include Autotype." OFF)
|
||||
option(WITH_XC_HTTP "Include KeePassHTTP." OFF)
|
||||
option(WITH_XC_YUBIKEY "Include Yubikey support." OFF)
|
||||
option(WITH_XC_AUTOTYPE "Include Auto-Type." ON)
|
||||
option(WITH_XC_HTTP "Include KeePassHTTP and Custom Icon Downloads." OFF)
|
||||
option(WITH_XC_YUBIKEY "Include YubiKey support." OFF)
|
||||
|
||||
set(KEEPASSXC_VERSION "2.1.4")
|
||||
set(KEEPASSXC_VERSION_NUM "2.1.4")
|
||||
# Process ui files automatically from source files
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
set(KEEPASSXC_VERSION_MAJOR "2")
|
||||
set(KEEPASSXC_VERSION_MINOR "2")
|
||||
set(KEEPASSXC_VERSION_PATCH "0")
|
||||
set(KEEPASSXC_VERSION "${KEEPASSXC_VERSION_MAJOR}.${KEEPASSXC_VERSION_MINOR}.${KEEPASSXC_VERSION_PATCH}")
|
||||
|
||||
if("${CMAKE_C_COMPILER}" MATCHES "clang$" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(CMAKE_COMPILER_IS_CLANG 1)
|
||||
@ -68,18 +79,39 @@ endmacro(add_gcc_compiler_flags)
|
||||
|
||||
add_definitions(-DQT_NO_EXCEPTIONS -DQT_STRICT_ITERATORS -DQT_NO_CAST_TO_ASCII)
|
||||
|
||||
add_gcc_compiler_flags("-fno-common -fstack-protector --param=ssp-buffer-size=4")
|
||||
if(WITH_APP_BUNDLE)
|
||||
add_definitions(-DWITH_APP_BUNDLE)
|
||||
endif()
|
||||
|
||||
add_gcc_compiler_flags("-fno-common")
|
||||
add_gcc_compiler_flags("-Wall -Wextra -Wundef -Wpointer-arith -Wno-long-long")
|
||||
add_gcc_compiler_flags("-Wformat=2 -Wmissing-format-attribute")
|
||||
add_gcc_compiler_flags("-fvisibility=hidden")
|
||||
add_gcc_compiler_cxxflags("-fvisibility-inlines-hidden")
|
||||
|
||||
if((CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8.999) OR CMAKE_COMPILER_IS_CLANGXX)
|
||||
add_gcc_compiler_flags("-fstack-protector-strong")
|
||||
else()
|
||||
add_gcc_compiler_flags("-fstack-protector --param=ssp-buffer-size=4")
|
||||
endif()
|
||||
|
||||
add_gcc_compiler_cxxflags("-fno-exceptions -fno-rtti")
|
||||
add_gcc_compiler_cxxflags("-Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual")
|
||||
add_gcc_compiler_cflags("-Wchar-subscripts -Wwrite-strings")
|
||||
if(WITH_ASAN)
|
||||
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
message(FATAL_ERROR "WITH_ASAN is only supported on Linux at the moment.")
|
||||
endif()
|
||||
|
||||
add_gcc_compiler_flags("-fsanitize=address -DWITH_ASAN")
|
||||
|
||||
if(NOT (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9))
|
||||
add_gcc_compiler_flags("-fsanitize=leak -DWITH_LSAN")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
|
||||
if (CMAKE_BUILD_TYPE_LOWER MATCHES (release|relwithdebinfo|minsizerel))
|
||||
if (CMAKE_BUILD_TYPE_LOWER MATCHES "(release|relwithdebinfo|minsizerel)")
|
||||
add_gcc_compiler_flags("-D_FORTIFY_SOURCE=2")
|
||||
endif()
|
||||
|
||||
@ -105,10 +137,14 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
if (CMAKE_COMPILER_IS_CLANGXX)
|
||||
add_gcc_compiler_flags("-Qunused-arguments")
|
||||
endif()
|
||||
add_gcc_compiler_flags("-pie -fPIE")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-add-needed -Wl,--as-needed -Wl,--no-undefined")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro,-z,now")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-add-needed -Wl,--as-needed")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro,-z,now")
|
||||
endif()
|
||||
|
||||
add_gcc_compiler_cxxflags("-std=c++11")
|
||||
@ -127,30 +163,37 @@ if(MINGW)
|
||||
set(CMAKE_RC_COMPILER_INIT windres)
|
||||
enable_language(RC)
|
||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
|
||||
link_libraries(ws2_32 wsock32)
|
||||
if(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
|
||||
# Enable DEP and ASLR
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE OR MINGW)
|
||||
if(APPLE AND WITH_APP_BUNDLE OR MINGW)
|
||||
set(PROGNAME KeePassXC)
|
||||
else()
|
||||
set(PROGNAME keepassxc)
|
||||
endif()
|
||||
|
||||
if(APPLE AND "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local")
|
||||
if(APPLE AND WITH_APP_BUNDLE AND "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local")
|
||||
set(CMAKE_INSTALL_PREFIX "/Applications")
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
set(CLI_INSTALL_DIR ".")
|
||||
set(BIN_INSTALL_DIR ".")
|
||||
set(PLUGIN_INSTALL_DIR ".")
|
||||
set(DATA_INSTALL_DIR "share")
|
||||
elseif(APPLE)
|
||||
elseif(APPLE AND WITH_APP_BUNDLE)
|
||||
set(CLI_INSTALL_DIR "/usr/local/bin")
|
||||
set(BIN_INSTALL_DIR ".")
|
||||
set(PLUGIN_INSTALL_DIR "${PROGNAME}.app/Contents/PlugIns")
|
||||
set(DATA_INSTALL_DIR "${PROGNAME}.app/Contents/Resources")
|
||||
else()
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(CLI_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}")
|
||||
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}")
|
||||
set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/keepassxc")
|
||||
set(DATA_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/keepassxc")
|
||||
@ -161,6 +204,7 @@ if(WITH_TESTS)
|
||||
endif(WITH_TESTS)
|
||||
|
||||
find_package(Qt5Core 5.2 REQUIRED)
|
||||
find_package(Qt5Network 5.2 REQUIRED)
|
||||
find_package(Qt5Concurrent 5.2 REQUIRED)
|
||||
find_package(Qt5Widgets 5.2 REQUIRED)
|
||||
find_package(Qt5Test 5.2 REQUIRED)
|
||||
@ -194,6 +238,13 @@ if(NOT ZLIB_SUPPORTS_GZIP)
|
||||
message(FATAL_ERROR "zlib 1.2.x or higher is required to use the gzip format")
|
||||
endif()
|
||||
|
||||
# Optional
|
||||
if(WITH_XC_YUBIKEY)
|
||||
find_package(YubiKey REQUIRED)
|
||||
|
||||
include_directories(SYSTEM ${YUBIKEY_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
check_cxx_source_compiles("#include <sys/prctl.h>
|
||||
int main() { prctl(PR_SET_DUMPABLE, 0); return 0; }"
|
||||
@ -222,7 +273,6 @@ include(FeatureSummary)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(share)
|
||||
add_subdirectory(utils)
|
||||
if(WITH_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif(WITH_TESTS)
|
||||
@ -232,6 +282,6 @@ if(PRINT_SUMMARY)
|
||||
feature_summary(WHAT ALL)
|
||||
else()
|
||||
# This will only print ENABLED and DISABLED feature
|
||||
print_enabled_features()
|
||||
print_disabled_features()
|
||||
feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
|
||||
feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")
|
||||
endif()
|
||||
|
64
COPYING
@ -1,5 +1,5 @@
|
||||
KeePassX - http://www.keepassx.org/
|
||||
Copyright (C) 2010-2012 Felix Geyer <debfx@fobos.de>
|
||||
KeePassXC - http://www.keepassxc.org/
|
||||
Copyright (C) 2016-2017 KeePassXC Team <team@keepassxc.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -14,9 +14,9 @@ GNU General Public License for more details.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Format-Specification: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: KeePassX
|
||||
Upstream-Contact: Felix Geyer <debfx@fobos.de>
|
||||
Source: http://www.keepassx.org/
|
||||
Upstream-Name: KeePassXC
|
||||
Upstream-Contact: KeePassXC Team <team@keepassxc.org>
|
||||
Source: http://www.keepassxc.org/
|
||||
|
||||
Copyright: 2010-2012, Felix Geyer <debfx@fobos.de>
|
||||
2011-2012, Florian Geyer <blueice@fobos.de>
|
||||
@ -27,20 +27,46 @@ Copyright: 2010-2012, Felix Geyer <debfx@fobos.de>
|
||||
2000-2008, Tom Sato <VEF00200@nifty.ne.jp>
|
||||
2013, Laszlo Papp <lpapp@kde.org>
|
||||
2013, David Faure <faure@kde.org>
|
||||
2016, KeePassXC Team
|
||||
2016-2017, KeePassXC Team <team@keepassxc.org>
|
||||
License: GPL-2 or GPL-3
|
||||
|
||||
Comment: The "KeePassXC Team" in every copyright notice is formed by the following people:
|
||||
- droidmonkey
|
||||
- phoerious
|
||||
- TheZ3ro <io@thezero.org>
|
||||
- louib
|
||||
- weslly
|
||||
Every other contributor is listed on https://github.com/keepassxreboot/keepassxc/graphs/contributors
|
||||
|
||||
Files: cmake/GNUInstallDirs.cmake
|
||||
Copyright: 2011 Nikita Krupen'ko <krnekit@gmail.com>
|
||||
2011 Kitware, Inc.
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: cmake/CodeCoverage.cmake
|
||||
Copyright: 2012 - 2015, Lars Bilke
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: cmake/FindYubiKey.cmake
|
||||
Copyright: 2014 Kyle Manna <kyle@kylemanna.com>
|
||||
License: GPL-2 or GPL-3
|
||||
|
||||
Files: cmake/GenerateProductVersion.cmake
|
||||
Copyright: 2015 halex2005 <akharlov@gmail.com>
|
||||
License: MIT
|
||||
|
||||
Files: cmake/CodeCoverage.cmake
|
||||
Copyright: 2012 - 2015, Lars Bilke
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: share/icons/application/*/apps/keepassxc.png
|
||||
share/icons/application/scalable/apps/keepassxc.svgz
|
||||
share/icons/application/*/apps/keepassxc-dark.png
|
||||
share/icons/application/scalable/apps/keepassxc-dark.svgz
|
||||
share/icons/application/*/apps/keepassxc-locked.png
|
||||
share/icons/application/scalable/apps/keepassxc-locked.svgz
|
||||
share/icons/application/*/apps/keepassxc-unlocked.png
|
||||
share/icons/application/scalable/apps/keepassxc-unlocked.svgz
|
||||
share/icons/application/*/mimetypes/application-x-keepassxc.png
|
||||
share/icons/application/scalable/mimetypes/application-x-keepassxc.svgz
|
||||
Copyright: 2016, Lorenzo Stella <lorenzo.stl@gmail.com>
|
||||
@ -51,6 +77,8 @@ Files: share/icons/application/*/actions/auto-type.png
|
||||
share/icons/application/*/actions/entry-clone.png
|
||||
share/icons/application/*/actions/entry-edit.png
|
||||
share/icons/application/*/actions/entry-new.png
|
||||
share/icons/application/*/actions/group-empty-trash.png
|
||||
share/icons/application/*/actions/help-about.png
|
||||
share/icons/application/*/actions/password-generate.png
|
||||
share/icons/database/C00_Password.png
|
||||
share/icons/database/C01_Package_Network.png
|
||||
@ -136,18 +164,25 @@ Files: share/icons/application/*/actions/application-exit.png
|
||||
share/icons/application/*/actions/document-encrypt.png
|
||||
share/icons/application/*/actions/document-new.png
|
||||
share/icons/application/*/actions/document-open.png
|
||||
share/icons/application/*/actions/document-properties.png
|
||||
share/icons/application/*/actions/document-save.png
|
||||
share/icons/application/*/actions/document-save-as.png
|
||||
share/icons/application/*/actions/edit-clear-locationbar-ltr.png
|
||||
share/icons/application/*/actions/edit-clear-locationbar-rtl.png
|
||||
share/icons/application/*/actions/key-enter.png
|
||||
share/icons/application/*/actions/password-generator.png
|
||||
share/icons/application/*/actions/password-copy.png
|
||||
share/icons/application/*/actions/password-show-*.png
|
||||
share/icons/application/*/actions/system-search.png
|
||||
share/icons/application/*/actions/username-copy.png
|
||||
share/icons/application/*/actions/view-history.png
|
||||
share/icons/application/*/apps/internet-web-browser.png
|
||||
share/icons/application/*/apps/preferences-desktop-icons.png
|
||||
share/icons/application/*/categories/preferences-other.png
|
||||
share/icons/application/*/status/dialog-error.png
|
||||
share/icons/application/*/status/dialog-information.png
|
||||
share/icons/application/*/status/dialog-warning.png
|
||||
share/icons/application/*/status/security-high.png
|
||||
share/icons/svg/*.svgz
|
||||
Copyright: 2007, Nuno Pinheiro <nuno@oxygen-icons.org>
|
||||
2007, David Vignoni <david@icon-king.com>
|
||||
@ -194,7 +229,20 @@ Copyright: 2009-2010, Iowa State University
|
||||
License: Boost-1.0
|
||||
|
||||
Files: src/zxcvbn/zxcvbn.*
|
||||
src/utils/entropy-meter.cpp
|
||||
Copyright: 2015, Tony Evans
|
||||
2016, KeePassXC Team
|
||||
License: BSD 3-clause
|
||||
|
||||
Files: src/http/qhttp/*
|
||||
Copyright: 2014, Amir Zamani
|
||||
License: MIT
|
||||
|
||||
Files: src/gui/KMessageWidget.h
|
||||
src/gui/KMessageWidget.cpp
|
||||
Copyright: 2011 Aurélien Gâteau <agateau@kde.org>
|
||||
2014 Dominik Haumann <dhaumann@kde.org>
|
||||
License: LGPL-2.1
|
||||
|
||||
Files: src/totp/base32.cpp
|
||||
src/totp/base32.h
|
||||
Copyright: 2010 Google Inc.
|
||||
License: Apache 2.0
|
@ -32,10 +32,12 @@ RUN set -x \
|
||||
qt58base \
|
||||
qt58tools \
|
||||
qt58x11extras \
|
||||
libmicrohttpd-dev \
|
||||
libxi-dev \
|
||||
libxtst-dev \
|
||||
zlib1g-dev \
|
||||
libyubikey-dev \
|
||||
libykpers-1-dev \
|
||||
xvfb \
|
||||
wget \
|
||||
file \
|
||||
fuse \
|
||||
|
41
README.md
@ -1,31 +1,33 @@
|
||||
# KeePassXC - KeePass Cross-platform Community Edition
|
||||
# <img src="https://keepassxc.org/logo.png" width="40" height="40"/> KeePassXC [![Travis Build Status](https://travis-ci.org/keepassxreboot/keepassxc.svg?branch=develop)](https://travis-ci.org/keepassxreboot/keepassxc) [![Coverage Status](https://coveralls.io/repos/github/keepassxreboot/keepassxc/badge.svg)](https://coveralls.io/github/keepassxreboot/keepassxc)
|
||||
|
||||
[![Travis Build Status](https://travis-ci.org/keepassxreboot/keepassxc.svg?branch=develop)](https://travis-ci.org/keepassxreboot/keepassxc) [![Coverage Status](https://coveralls.io/repos/github/keepassxreboot/keepassxc/badge.svg)](https://coveralls.io/github/keepassxreboot/keepassxc)
|
||||
KeePass Cross-platform Community Edition
|
||||
|
||||
## About
|
||||
KeePassXC is a fork of [KeePassX](https://www.keepassx.org/) that [aims to incorporate stalled pull requests, features, and bug fixes that have never made it into the main KeePassX repository](https://github.com/keepassxreboot/keepassx/issues/43).
|
||||
[KeePassXC](https://keepassxc.org) is a community fork of [KeePassX](https://www.keepassx.org/) with the goal to extend and improve it with new features and bugfixes to provide a feature-rich, fully cross-platform and modern open-source password manager.
|
||||
|
||||
|
||||
## Additional features compared to KeePassX
|
||||
- Autotype on all three major platforms (Linux, Windows, OS X)
|
||||
- Auto-Type on all three major platforms (Linux, Windows, OS X)
|
||||
- Stand-alone password generator
|
||||
- Password strength meter
|
||||
- Use website's favicons as entry icons
|
||||
- YubiKey HMAC-SHA1 authentication for unlocking databases
|
||||
- Using website favicons as entry icons
|
||||
- Merging of databases
|
||||
- Automatic reload when the database changed on disk
|
||||
- KeePassHTTP support for use with [PassIFox](https://addons.mozilla.org/en-us/firefox/addon/passifox/) in Mozilla Firefox and [chromeIPass](https://chrome.google.com/webstore/detail/chromeipass/ompiailgknfdndiefoaoiligalphfdae) in Google Chrome or Chromium.
|
||||
- KeePassHTTP support for use with [PassIFox](https://addons.mozilla.org/en-us/firefox/addon/passifox/) in Mozilla Firefox and [chromeIPass](https://chrome.google.com/webstore/detail/chromeipass/ompiailgknfdndiefoaoiligalphfdae) in Google Chrome or Chromium, and [passafari](https://github.com/mmichaa/passafari.safariextension/) in Safari.
|
||||
- Many bug fixes
|
||||
|
||||
For a full list of features and changes, read the [CHANGELOG](CHANGELOG) document.
|
||||
|
||||
### Note about KeePassHTTP
|
||||
KeePassHTTP is not a highly secure protocol and has certain flaw which allow an attacker to decrypt your passwords when they manage to intercept communication between a KeePassHTTP server and PassIFox/chromeIPass over a network connection (see [here](https://github.com/pfn/keepasshttp/issues/258) and [here](https://github.com/keepassxreboot/keepassxc/issues/147)). KeePassXC therefore strictly limits communication between itself and the browser plugin to your local computer. As long as your computer is not compromised, your passwords are fairly safe that way, but still use it at your own risk!
|
||||
KeePassHTTP is not a highly secure protocol and has certain flaw which allow an attacker to decrypt your passwords when they manage to intercept communication between a KeePassHTTP server and PassIFox/chromeIPass over a network connection (see [here](https://github.com/pfn/keepasshttp/issues/258) and [here](https://github.com/keepassxreboot/keepassxc/issues/147)). KeePassXC therefore strictly limits communication between itself and the browser plugin to your local computer. As long as your computer is not compromised, your passwords are fairly safe that way, but use it at your own risk!
|
||||
|
||||
### Installation
|
||||
Pre-compiled binaries can be found on the [downloads page](https://keepassxc.org/download). Additionally, individual Linux distributions may ship their own versions, so please check out your distribution's package list to see if KeePassXC is available.
|
||||
|
||||
### Building KeePassXC yourself
|
||||
### Building KeePassXC
|
||||
|
||||
*More detailed instructions are available in the INSTALL file or on the [Wiki page](https://github.com/keepassxreboot/keepassx/wiki/Install-Instruction-from-Source).*
|
||||
*More detailed instructions are available in the INSTALL file or on the [Wiki page](https://github.com/keepassxreboot/keepassxc/wiki/Building-KeePassXC).*
|
||||
|
||||
First, you must download the KeePassXC [source tarball](https://keepassxc.org/download#source) or check out the latest version from our [Git repository](https://github.com/keepassxreboot/keepassxc).
|
||||
|
||||
@ -43,9 +45,9 @@ To update the project from within the project's folder, you can run the followin
|
||||
git pull
|
||||
```
|
||||
|
||||
Once you have downloaded the source code, you can `cd` into the source code directory and build and install KeePassXC with
|
||||
Once you have downloaded the source code, you can `cd` into the source code directory, build and install KeePassXC:
|
||||
|
||||
```
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DWITH_TESTS=OFF ..
|
||||
@ -53,13 +55,24 @@ make -j8
|
||||
sudo make install
|
||||
```
|
||||
|
||||
To enable autotype, add `-DWITH_XC_AUTOTYPE=ON` to the `cmake` command. KeePassHTTP support is compiled in by adding `-DWITH_XC_HTTP=ON`. If these options are not specified, KeePassXC will be built without these plugins.
|
||||
cmake accepts the following options:
|
||||
|
||||
```
|
||||
-DWITH_XC_AUTOTYPE=[ON|OFF] Enable/Disable Auto-Type (default: ON)
|
||||
-DWITH_XC_HTTP=[ON|OFF] Enable/Disable KeePassHTTP and custom icon downloads (default: OFF)
|
||||
-DWITH_XC_YUBIKEY=[ON|OFF] Enable/Disable YubiKey HMAC-SHA1 authentication support (default: OFF)
|
||||
|
||||
-DWITH_TESTS=[ON|OFF] Enable/Disable building of unit tests (default: ON)
|
||||
-DWITH_GUI_TESTS=[ON|OFF] Enable/Disable building of GUI tests (default: OFF)
|
||||
-DWITH_DEV_BUILD=[ON|OFF] Enable/Disable deprecated method warnings (default: OFF)
|
||||
-DWITH_ASAN=[ON|OFF] Enable/Disable address sanitizer checks (Linux only) (default: OFF)
|
||||
-DWITH_COVERAGE=[ON|OFF] Enable/Disable coverage tests (GCC only) (default: OFF)
|
||||
```
|
||||
|
||||
### Contributing
|
||||
|
||||
We are always looking for suggestions how to improve our application. If you find any bugs or have an idea for a new feature, please let us know by opening a report in our [issue tracker](https://github.com/keepassxreboot/keepassxc/issues) on GitHub or write to our [Google Groups](https://groups.google.com/forum/#!forum/keepassx-reboot) forum.
|
||||
We are always looking for suggestions how to improve our application. If you find any bugs or have an idea for a new feature, please let us know by opening a report in our [issue tracker](https://github.com/keepassxreboot/keepassxc/issues) on GitHub or join us on IRC on freenode channels #keepassxc or #keepassxc-dev.
|
||||
|
||||
You can of course also directly contribute your own code. We are happy to accept your pull requests.
|
||||
|
||||
Please read the [CONTRIBUTING](.github/CONTRIBUTING.md) document for further information.
|
||||
Please read the [CONTRIBUTING document](.github/CONTRIBUTING.md) for further information.
|
||||
|
@ -1,3 +1,17 @@
|
||||
# Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 or (at your option)
|
||||
# version 3 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
find_path(GPGERROR_INCLUDE_DIR gpg-error.h)
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
|
||||
find_path(MHD_INCLUDE_DIR microhttpd.h)
|
||||
|
||||
find_library(MHD_LIBRARIES microhttpd)
|
||||
|
||||
mark_as_advanced(MHD_LIBRARIES MHD_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibMicroHTTPD DEFAULT_MSG MHD_LIBRARIES MHD_INCLUDE_DIR)
|
27
cmake/FindYubiKey.cmake
Normal file
@ -0,0 +1,27 @@
|
||||
# Copyright (C) 2014 Kyle Manna <kyle@kylemanna.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 or (at your option)
|
||||
# version 3 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
find_path(YUBIKEY_CORE_INCLUDE_DIR yubikey.h)
|
||||
find_path(YUBIKEY_PERS_INCLUDE_DIR ykcore.h PATH_SUFFIXES ykpers-1)
|
||||
set(YUBIKEY_INCLUDE_DIRS ${YUBIKEY_CORE_INCLUDE_DIR} ${YUBIKEY_PERS_INCLUDE_DIR})
|
||||
|
||||
find_library(YUBIKEY_CORE_LIBRARY yubikey)
|
||||
find_library(YUBIKEY_PERS_LIBRARY ykpers-1)
|
||||
set(YUBIKEY_LIBRARIES ${YUBIKEY_CORE_LIBRARY} ${YUBIKEY_PERS_LIBRARY})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(YubiKey DEFAULT_MSG YUBIKEY_LIBRARIES YUBIKEY_INCLUDE_DIRS)
|
||||
|
||||
mark_as_advanced(YUBIKEY_LIBRARIES YUBIKEY_INCLUDE_DIRS)
|
200
release-tool
@ -16,8 +16,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
echo -e "\e[1m\e[32mKeePassXC\e[0m Release Preparation Helper"
|
||||
echo -e "Copyright (C) 2017 KeePassXC Team <https://keepassxc.org/>\n"
|
||||
printf "\e[1m\e[32mKeePassXC\e[0m Release Preparation Helper\n"
|
||||
printf "Copyright (C) 2017 KeePassXC Team <https://keepassxc.org/>\n\n"
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
@ -37,7 +37,7 @@ DOCKER_CONTAINER_NAME="keepassxc-build-container"
|
||||
CMAKE_OPTIONS=""
|
||||
COMPILER="g++"
|
||||
MAKE_OPTIONS="-j8"
|
||||
BUILD_PLUGINS="autotype"
|
||||
BUILD_PLUGINS="autotype http yubikey"
|
||||
INSTALL_PREFIX="/usr/local"
|
||||
BUILD_SOURCE_TARBALL=true
|
||||
ORIG_BRANCH=""
|
||||
@ -50,19 +50,20 @@ printUsage() {
|
||||
local cmd
|
||||
if [ "" == "$1" ] || [ "help" == "$1" ]; then
|
||||
cmd="COMMAND"
|
||||
elif [ "merge" == "$1" ] || [ "build" == "$1" ] || [ "sign" == "$1" ]; then
|
||||
elif [ "check" == "$1" ] || [ "merge" == "$1" ] || [ "build" == "$1" ] || [ "sign" == "$1" ]; then
|
||||
cmd="$1"
|
||||
else
|
||||
logError "Unknown command: '$1'\n"
|
||||
cmd="COMMAND"
|
||||
fi
|
||||
|
||||
echo -e "\e[1mUsage:\e[0m $(basename $0) $cmd [options]"
|
||||
printf "\e[1mUsage:\e[0m $(basename $0) $cmd [--version x.y.z] [options]\n"
|
||||
|
||||
if [ "COMMAND" == "$cmd" ]; then
|
||||
cat << EOF
|
||||
|
||||
Commands:
|
||||
check Perform a dry-run check, nothing is changed
|
||||
merge Merge release branch into main branch and create release tags
|
||||
build Build and package binary release from sources
|
||||
sign Sign previously compiled release packages
|
||||
@ -126,15 +127,30 @@ EOF
|
||||
}
|
||||
|
||||
logInfo() {
|
||||
echo -e "\e[1m[ \e[34mINFO\e[39m ]\e[0m $1"
|
||||
printf "\e[1m[ \e[34mINFO\e[39m ]\e[0m $1\n"
|
||||
}
|
||||
|
||||
logError() {
|
||||
echo -e "\e[1m[ \e[31mERROR\e[39m ]\e[0m $1" >&2
|
||||
printf "\e[1m[ \e[31mERROR\e[39m ]\e[0m $1\n" >&2
|
||||
}
|
||||
|
||||
init() {
|
||||
if [ "" == "$RELEASE_NAME" ]; then
|
||||
logError "Missing arguments, --version is required!\n"
|
||||
printUsage "check"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "" == "$TAG_NAME" ]; then
|
||||
TAG_NAME="$RELEASE_NAME"
|
||||
fi
|
||||
|
||||
if [ "" == "$SOURCE_BRANCH" ]; then
|
||||
SOURCE_BRANCH="release/${RELEASE_NAME}"
|
||||
fi
|
||||
|
||||
ORIG_CWD="$(pwd)"
|
||||
SRC_DIR="$(realpath "$SRC_DIR")"
|
||||
cd "$SRC_DIR" > /dev/null 2>&1
|
||||
ORIG_BRANCH="$(git rev-parse --abbrev-ref HEAD 2> /dev/null)"
|
||||
cd "$ORIG_CWD"
|
||||
@ -214,15 +230,23 @@ checkTargetBranchExists() {
|
||||
|
||||
checkVersionInCMake() {
|
||||
local app_name_upper="$(echo "$APP_NAME" | tr '[:lower:]' '[:upper:]')"
|
||||
|
||||
grep -q "${app_name_upper}_VERSION \"${RELEASE_NAME}\"" CMakeLists.txt
|
||||
local major_num="$(echo ${RELEASE_NAME} | cut -f1 -d.)"
|
||||
local minor_num="$(echo ${RELEASE_NAME} | cut -f2 -d.)"
|
||||
local patch_num="$(echo ${RELEASE_NAME} | cut -f3 -d.)"
|
||||
|
||||
grep -q "${app_name_upper}_VERSION_MAJOR \"${major_num}\"" CMakeLists.txt
|
||||
if [ $? -ne 0 ]; then
|
||||
exitError "${app_name_upper}_VERSION version not updated to '${RELEASE_NAME}' in CMakeLists.txt!"
|
||||
exitError "${app_name_upper}_VERSION_MAJOR not updated to '${major_num}' in CMakeLists.txt!"
|
||||
fi
|
||||
|
||||
grep -q "${app_name_upper}_VERSION_NUM \"${RELEASE_NAME}\"" CMakeLists.txt
|
||||
grep -q "${app_name_upper}_VERSION_MINOR \"${minor_num}\"" CMakeLists.txt
|
||||
if [ $? -ne 0 ]; then
|
||||
exitError "${app_name_upper}_VERSION_NUM version not updated to '${RELEASE_NAME}' in CMakeLists.txt!"
|
||||
exitError "${app_name_upper}_VERSION_MINOR not updated to '${minor_num}' in CMakeLists.txt!"
|
||||
fi
|
||||
|
||||
grep -q "${app_name_upper}_VERSION_PATCH \"${patch_num}\"" CMakeLists.txt
|
||||
if [ $? -ne 0 ]; then
|
||||
exitError "${app_name_upper}_VERSION_PATCH not updated to '${patch_num}' in CMakeLists.txt!"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -242,11 +266,57 @@ checkTransifexCommandExists() {
|
||||
if [ 0 -ne $? ]; then
|
||||
exitError "Transifex tool 'tx' not installed! Please install it using 'pip install transifex-client'"
|
||||
fi
|
||||
|
||||
command -v lupdate-qt5 > /dev/null
|
||||
if [ 0 -ne $? ]; then
|
||||
exitError "Qt Linguist tool (lupdate-qt5) is not installed! Please install using 'apt install qttools5-dev-tools'"
|
||||
fi
|
||||
}
|
||||
|
||||
checkSnapcraft() {
|
||||
if [ ! -f snapcraft.yaml ]; then
|
||||
echo "No snapcraft file found!"
|
||||
return
|
||||
fi
|
||||
|
||||
grep -qPzo "version: ${RELEASE_NAME}" snapcraft.yaml
|
||||
if [ $? -ne 0 ]; then
|
||||
exitError "snapcraft.yaml has not been updated to the '${RELEASE_NAME}' release!"
|
||||
fi
|
||||
}
|
||||
|
||||
performChecks() {
|
||||
logInfo "Performing basic checks..."
|
||||
|
||||
checkSourceDirExists
|
||||
|
||||
logInfo "Changing to source directory..."
|
||||
cd "${SRC_DIR}"
|
||||
|
||||
logInfo "Validating toolset and repository..."
|
||||
|
||||
checkTransifexCommandExists
|
||||
checkGitRepository
|
||||
checkReleaseDoesNotExist
|
||||
checkWorkingTreeClean
|
||||
checkSourceBranchExists
|
||||
checkTargetBranchExists
|
||||
|
||||
logInfo "Checking out '${SOURCE_BRANCH}'..."
|
||||
git checkout "$SOURCE_BRANCH"
|
||||
|
||||
logInfo "Attempting to find '${RELEASE_NAME}' in various files..."
|
||||
|
||||
checkVersionInCMake
|
||||
checkChangeLog
|
||||
checkSnapcraft
|
||||
|
||||
logInfo "\e[1m\e[32mAll checks passed!\e[0m"
|
||||
}
|
||||
|
||||
# re-implement realpath for OS X (thanks mschrag)
|
||||
# https://superuser.com/questions/205127/
|
||||
if $(command -v realpath > /dev/null); then
|
||||
if ! $(command -v realpath > /dev/null); then
|
||||
realpath() {
|
||||
pushd . > /dev/null
|
||||
if [ -d "$1" ]; then
|
||||
@ -269,6 +339,28 @@ fi
|
||||
|
||||
trap exitTrap SIGINT SIGTERM
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# check command
|
||||
# -----------------------------------------------------------------------
|
||||
check() {
|
||||
while [ $# -ge 1 ]; do
|
||||
local arg="$1"
|
||||
case "$arg" in
|
||||
-v|--version)
|
||||
RELEASE_NAME="$2"
|
||||
shift ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
init
|
||||
|
||||
performChecks
|
||||
|
||||
cleanup
|
||||
|
||||
logInfo "Congrats! You can successfully merge, build, and sign KeepassXC."
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# merge command
|
||||
@ -317,44 +409,9 @@ merge() {
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "" == "$RELEASE_NAME" ]; then
|
||||
logError "Missing arguments, --version is required!\n"
|
||||
printUsage "merge"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "" == "$TAG_NAME" ]; then
|
||||
TAG_NAME="$RELEASE_NAME"
|
||||
fi
|
||||
|
||||
if [ "" == "$SOURCE_BRANCH" ]; then
|
||||
SOURCE_BRANCH="release/${RELEASE_NAME}"
|
||||
fi
|
||||
|
||||
init
|
||||
|
||||
SRC_DIR="$(realpath "$SRC_DIR")"
|
||||
|
||||
logInfo "Performing basic checks..."
|
||||
|
||||
checkSourceDirExists
|
||||
|
||||
logInfo "Changing to source directory..."
|
||||
cd "${SRC_DIR}"
|
||||
|
||||
checkTransifexCommandExists
|
||||
checkGitRepository
|
||||
checkReleaseDoesNotExist
|
||||
checkWorkingTreeClean
|
||||
checkSourceBranchExists
|
||||
checkTargetBranchExists
|
||||
checkVersionInCMake
|
||||
checkChangeLog
|
||||
|
||||
logInfo "All checks pass, getting our hands dirty now!"
|
||||
|
||||
logInfo "Checking out source branch..."
|
||||
git checkout "$SOURCE_BRANCH"
|
||||
performChecks
|
||||
|
||||
logInfo "Updating language files..."
|
||||
./share/translations/update.sh
|
||||
@ -372,15 +429,15 @@ merge() {
|
||||
fi
|
||||
fi
|
||||
|
||||
CHANGELOG=$(grep -Pzo "(?<=${RELEASE_NAME} \(\d{4}-\d{2}-\d{2}\)\n)=+\n\n?(?:.|\n)+?\n(?=\n)" \
|
||||
CHANGELOG | grep -Pzo '(?<=\n\n)(.|\n)+' | tr -d \\0)
|
||||
COMMIT_MSG="Release ${RELEASE_NAME}"
|
||||
|
||||
logInfo "Checking out target branch '${TARGET_BRANCH}'..."
|
||||
git checkout "$TARGET_BRANCH"
|
||||
|
||||
logInfo "Merging '${SOURCE_BRANCH}' into '${TARGET_BRANCH}'..."
|
||||
|
||||
CHANGELOG=$(grep -Pzo "(?<=${RELEASE_NAME} \(\d{4}-\d{2}-\d{2}\)\n)=+\n\n?(?:.|\n)+?\n(?=\n)" \
|
||||
CHANGELOG | grep -Pzo '(?<=\n\n)(.|\n)+' | tr -d \\0)
|
||||
COMMIT_MSG="Release ${RELEASE_NAME}"
|
||||
|
||||
git merge "$SOURCE_BRANCH" --no-ff -m "$COMMIT_MSG" -m "${CHANGELOG}" "$SOURCE_BRANCH" -S"$GPG_GIT_KEY"
|
||||
|
||||
logInfo "Creating tag '${TAG_NAME}'..."
|
||||
@ -466,36 +523,13 @@ build() {
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "" == "$RELEASE_NAME" ]; then
|
||||
logError "Missing arguments, --version is required!\n"
|
||||
printUsage "build"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "" == "$TAG_NAME" ]; then
|
||||
TAG_NAME="$RELEASE_NAME"
|
||||
fi
|
||||
|
||||
init
|
||||
|
||||
SRC_DIR="$(realpath "$SRC_DIR")"
|
||||
init
|
||||
|
||||
performChecks
|
||||
|
||||
OUTPUT_DIR="$(realpath "$OUTPUT_DIR")"
|
||||
|
||||
logInfo "Performing basic checks..."
|
||||
|
||||
checkSourceDirExists
|
||||
|
||||
logInfo "Changing to source directory..."
|
||||
cd "${SRC_DIR}"
|
||||
|
||||
checkTagExists
|
||||
checkGitRepository
|
||||
checkWorkingTreeClean
|
||||
checkOutputDirDoesNotExist
|
||||
|
||||
logInfo "All checks pass, getting our hands dirty now!"
|
||||
|
||||
logInfo "Checking out release tag '${TAG_NAME}'..."
|
||||
git checkout "$TAG_NAME"
|
||||
|
||||
@ -656,7 +690,9 @@ sign() {
|
||||
fi
|
||||
|
||||
logInfo "Creating digest for file '${f}'..."
|
||||
sha256sum "$f" > "${f}.DIGEST"
|
||||
local rp="$(realpath "$f")"
|
||||
local bname="$(basename "$f")"
|
||||
(cd "$(dirname "$rp")"; sha256sum "$bname" > "${bname}.DIGEST")
|
||||
done
|
||||
|
||||
logInfo "All done!"
|
||||
@ -675,7 +711,7 @@ if [ "" == "$MODE" ]; then
|
||||
elif [ "help" == "$MODE" ]; then
|
||||
printUsage "$1"
|
||||
exit
|
||||
elif [ "merge" == "$MODE" ] || [ "build" == "$MODE" ] || [ "sign" == "$MODE" ]; then
|
||||
elif [ "check" == "$MODE" ] || [ "merge" == "$MODE" ] || [ "build" == "$MODE" ] || [ "sign" == "$MODE" ]; then
|
||||
$MODE "$@"
|
||||
else
|
||||
printUsage "$MODE"
|
||||
|
@ -1,4 +1,5 @@
|
||||
# Copyright (C) 2011 Felix Geyer <debfx@fobos.de>
|
||||
# Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -15,6 +16,9 @@
|
||||
|
||||
add_subdirectory(translations)
|
||||
|
||||
file(GLOB wordlists_files "wordlists/*.wordlist")
|
||||
install(FILES ${wordlists_files} DESTINATION ${DATA_INSTALL_DIR}/wordlists)
|
||||
|
||||
file(GLOB DATABASE_ICONS icons/database/*.png)
|
||||
|
||||
install(FILES ${DATABASE_ICONS} DESTINATION ${DATA_INSTALL_DIR}/icons/database)
|
||||
@ -22,10 +26,10 @@ install(FILES ${DATABASE_ICONS} DESTINATION ${DATA_INSTALL_DIR}/icons/database)
|
||||
if(UNIX AND NOT APPLE)
|
||||
install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor
|
||||
FILES_MATCHING PATTERN "keepassx*.png" PATTERN "keepassx*.svgz"
|
||||
PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE)
|
||||
PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE PATTERN "categories" EXCLUDE)
|
||||
install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor
|
||||
FILES_MATCHING PATTERN "application-x-keepassxc.png" PATTERN "application-x-keepassxc.svgz"
|
||||
PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE)
|
||||
PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE PATTERN "categories" EXCLUDE)
|
||||
install(FILES linux/keepassxc.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||
install(FILES linux/keepassxc.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
|
||||
endif(UNIX AND NOT APPLE)
|
||||
@ -86,6 +90,22 @@ add_custom_target(icons
|
||||
COMMAND inkscape -z -w 256 -h 256
|
||||
icons/application/scalable/apps/keepassxc-locked.svgz -e icons/application/256x256/apps/keepassxc-locked.png
|
||||
|
||||
# SVGZ to PNGs for KeePassXC
|
||||
COMMAND inkscape -z -w 16 -h 16
|
||||
icons/application/scalable/apps/keepassxc-unlocked.svgz -e icons/application/16x16/apps/keepassxc-unlocked.png
|
||||
COMMAND inkscape -z -w 24 -h 24
|
||||
icons/application/scalable/apps/keepassxc-unlocked.svgz -e icons/application/24x24/apps/keepassxc-unlocked.png
|
||||
COMMAND inkscape -z -w 32 -h 32
|
||||
icons/application/scalable/apps/keepassxc-unlocked.svgz -e icons/application/32x32/apps/keepassxc-unlocked.png
|
||||
COMMAND inkscape -z -w 48 -h 48
|
||||
icons/application/scalable/apps/keepassxc-unlocked.svgz -e icons/application/48x48/apps/keepassxc-unlocked.png
|
||||
COMMAND inkscape -z -w 64 -h 64
|
||||
icons/application/scalable/apps/keepassxc-unlocked.svgz -e icons/application/64x64/apps/keepassxc-unlocked.png
|
||||
COMMAND inkscape -z -w 128 -h 128
|
||||
icons/application/scalable/apps/keepassxc-unlocked.svgz -e icons/application/128x128/apps/keepassxc-unlocked.png
|
||||
COMMAND inkscape -z -w 256 -h 256
|
||||
icons/application/scalable/apps/keepassxc-unlocked.svgz -e icons/application/256x256/apps/keepassxc-unlocked.png
|
||||
|
||||
# SVGZ to PNGs for KeePassXC MIME-Type
|
||||
COMMAND inkscape -z -w 16 -h 16
|
||||
icons/application/scalable/mimetypes/application-x-keepassxc.svgz -e icons/application/16x16/mimetypes/application-x-keepassxc.png
|
||||
|
BIN
share/icons/application/128x128/apps/keepassxc-unlocked.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
share/icons/application/16x16/actions/group-empty-trash.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
share/icons/application/16x16/actions/message-close.png
Normal file
After Width: | Height: | Size: 457 B |
BIN
share/icons/application/16x16/apps/keepassxc-unlocked.png
Normal file
After Width: | Height: | Size: 880 B |
BIN
share/icons/application/22x22/actions/document-new.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
share/icons/application/22x22/actions/message-close.png
Normal file
After Width: | Height: | Size: 457 B |
BIN
share/icons/application/24x24/apps/keepassxc-unlocked.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
share/icons/application/256x256/apps/keepassxc-unlocked.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
share/icons/application/32x32/actions/document-edit.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
share/icons/application/32x32/actions/document-properties.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
share/icons/application/32x32/actions/key-enter.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
share/icons/application/32x32/actions/view-history.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
share/icons/application/32x32/apps/internet-web-browser.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
share/icons/application/32x32/apps/keepassxc-unlocked.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
share/icons/application/32x32/apps/preferences-desktop-icons.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
share/icons/application/32x32/categories/preferences-other.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
share/icons/application/32x32/status/security-high.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
share/icons/application/48x48/apps/keepassxc-unlocked.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
share/icons/application/64x64/apps/keepassxc-unlocked.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
share/icons/application/scalable/apps/keepassxc-unlocked.svgz
Normal file
BIN
share/icons/svg/document-properties.svgz
Normal file
BIN
share/icons/svg/internet-web-browser.svgz
Normal file
BIN
share/icons/svg/key-enter.svgz
Normal file
65
share/icons/svg/message-close.svg
Normal file
@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
viewBox="0 0 16 16"
|
||||
version="1.1"
|
||||
id="svg6"
|
||||
sodipodi:docname="tab-close.svg"
|
||||
inkscape:version="0.92.1 r">
|
||||
<metadata
|
||||
id="metadata10">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="791"
|
||||
inkscape:window-height="480"
|
||||
id="namedview8"
|
||||
showgrid="false"
|
||||
inkscape:zoom="14.75"
|
||||
inkscape:cx="8"
|
||||
inkscape:cy="8"
|
||||
inkscape:window-x="1301"
|
||||
inkscape:window-y="443"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg6" />
|
||||
<defs
|
||||
id="defs3051">
|
||||
<style
|
||||
type="text/css"
|
||||
id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#f2f2f2;
|
||||
}
|
||||
.ColorScheme-NegativeText {
|
||||
color:#da4453;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
class="ColorScheme-NegativeText"
|
||||
d="M 8,2 A 6,6 0 0 0 2,8 6,6 0 0 0 8,14 6,6 0 0 0 14,8 6,6 0 0 0 8,2 Z M 5.70703,5 8,7.29297 10.29297,5 11,5.70703 8.70703,8 11,10.29297 10.29297,11 8,8.70703 5.70703,11 5,10.29297 7.29297,8 5,5.70703 5.70703,5 Z"
|
||||
id="path4" />
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
BIN
share/icons/svg/preferences-desktop-icons.svgz
Normal file
BIN
share/icons/svg/preferences-other.svgz
Normal file
BIN
share/icons/svg/security-high.svgz
Normal file
BIN
share/icons/svg/view-history.svgz
Normal file
57
share/keepassxc.ini
Normal file
@ -0,0 +1,57 @@
|
||||
[General]
|
||||
ShowToolbar=true
|
||||
RememberLastDatabases=true
|
||||
RememberLastKeyFiles=true
|
||||
OpenPreviousDatabasesOnStartup=true
|
||||
AutoSaveAfterEveryChange=false
|
||||
AutoSaveOnExit=false
|
||||
AutoReloadOnChange=true
|
||||
MinimizeOnCopy=false
|
||||
UseGroupIconOnEntryCreation=true
|
||||
IgnoreGroupExpansion=false
|
||||
AutoTypeEntryTitleMatch=true
|
||||
GlobalAutoTypeKey=0
|
||||
GlobalAutoTypeModifiers=0
|
||||
LastOpenedDatabases=@Invalid()
|
||||
|
||||
[GUI]
|
||||
Language=system
|
||||
ShowTrayIcon=false
|
||||
MinimizeToTray=false
|
||||
MinimizeOnClose=false
|
||||
MinimizeOnStartup=false
|
||||
MainWindowGeometry="@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\x2(\0\0\0\xbd\0\0\x5W\0\0\x3;\0\0\x2\x30\0\0\0\xdc\0\0\x5O\0\0\x3\x33\0\0\0\0\0\0\0\0\a\x80)"
|
||||
SplitterState=@Invalid()
|
||||
EntryListColumnSizes=@Invalid()
|
||||
EntrySearchColumnSizes=@Invalid()
|
||||
|
||||
[security]
|
||||
autotypeask=true
|
||||
clearclipboard=true
|
||||
clearclipboardtimeout=10
|
||||
lockdatabaseidle=false
|
||||
lockdatabaseidlesec=240
|
||||
lockdatabaseminimize=false
|
||||
lockdatabasescreenlock=true
|
||||
passwordscleartext=false
|
||||
passwordsrepeat=false
|
||||
|
||||
[Http]
|
||||
Enabled=false
|
||||
ShowNotification=true
|
||||
BestMatchOnly=false
|
||||
UnlockDatabase=true
|
||||
MatchUrlScheme=true
|
||||
SortByUsername=false
|
||||
Port=19455
|
||||
AlwaysAllowAccess=false
|
||||
AlwaysAllowUpdate=false
|
||||
SearchInAllDatabases=false
|
||||
SupportKphFields=true
|
||||
generator\LowerCase=true
|
||||
generator\UpperCase=true
|
||||
generator\Numbers=true
|
||||
generator\SpecialChars=false
|
||||
generator\ExcludeAlike=true
|
||||
generator\EnsureEvery=true
|
||||
generator\Length=16
|
@ -4,6 +4,8 @@
|
||||
<dict>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>CFBundleAllowMixedLocalizations</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
@ -27,7 +29,7 @@
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${KEEPASSXC_VERSION_NUM}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright 2016 KeePassXC Development Team</string>
|
||||
<string>Copyright 2016-2017 KeePassXC Development Team</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
2384
share/translations/keepassx_fi.ts
Normal file
2390
share/translations/keepassx_kk.ts
Normal file
@ -14,4 +14,4 @@ tx push -s
|
||||
|
||||
echo
|
||||
echo Pulling translations from Transifex
|
||||
tx pull -a --minimum-perc=80
|
||||
tx pull -af --minimum-perc=40
|
||||
|
7776
share/wordlists/eff_large.wordlist
Normal file
@ -1,17 +1,17 @@
|
||||
name: keepassxc
|
||||
version: 2.1.3
|
||||
version: 2.2.0
|
||||
grade: stable
|
||||
summary: community driven port of the windows application “Keepass Password Safe”
|
||||
description: |
|
||||
KeePassXC is an application for people with extremly high demands on secure
|
||||
KeePassXC is an application for people with extremely high demands on secure
|
||||
personal data management. It has a light interface, is cross platform and
|
||||
published under the terms of the GNU General Public License.
|
||||
is published under the terms of the GNU General Public License.
|
||||
confinement: strict
|
||||
|
||||
apps:
|
||||
keepassxc:
|
||||
command: desktop-launch keepassxc
|
||||
plugs: [unity7, opengl, gsettings, home, network, network-bind]
|
||||
plugs: [unity7, x11, opengl, gsettings, home, network, network-bind, removable-media]
|
||||
|
||||
parts:
|
||||
keepassxc:
|
||||
@ -22,6 +22,7 @@ parts:
|
||||
- -DWITH_TESTS=OFF
|
||||
- -DWITH_XC_AUTOTYPE=ON
|
||||
- -DWITH_XC_HTTP=ON
|
||||
- -DWITH_XC_YUBIKEY=ON
|
||||
build-packages:
|
||||
- g++
|
||||
- libgcrypt20-dev
|
||||
@ -30,4 +31,20 @@ parts:
|
||||
- qttools5-dev
|
||||
- qttools5-dev-tools
|
||||
- zlib1g-dev
|
||||
- libxi-dev
|
||||
- libxtst-dev
|
||||
- libyubikey-dev
|
||||
- libykpers-1-dev
|
||||
after: [desktop-qt5]
|
||||
desktop-qt5:
|
||||
# Redefine stage packages to work with Ubuntu 17.04
|
||||
stage-packages:
|
||||
- libxkbcommon0
|
||||
- ttf-ubuntu-font-family
|
||||
- dmz-cursor-theme
|
||||
- light-themes
|
||||
- shared-mime-info
|
||||
- libqt5gui5
|
||||
- libgdk-pixbuf2.0-0
|
||||
- libqt5svg5 # for loading icon themes which are svg
|
||||
- locales-all
|
||||
|
@ -1,4 +1,5 @@
|
||||
# Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
|
||||
# Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -31,6 +32,7 @@ configure_file(version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
|
||||
set(keepassx_SOURCES
|
||||
core/AutoTypeAssociations.cpp
|
||||
core/Config.cpp
|
||||
core/CsvParser.cpp
|
||||
core/Database.cpp
|
||||
core/DatabaseIcons.cpp
|
||||
core/Endian.cpp
|
||||
@ -45,13 +47,20 @@ set(keepassx_SOURCES
|
||||
core/ListDeleter.h
|
||||
core/Metadata.cpp
|
||||
core/PasswordGenerator.cpp
|
||||
core/PassphraseGenerator.cpp
|
||||
core/SignalMultiplexer.cpp
|
||||
core/ScreenLockListener.cpp
|
||||
core/ScreenLockListener.h
|
||||
core/ScreenLockListenerPrivate.h
|
||||
core/ScreenLockListenerPrivate.cpp
|
||||
core/TimeDelta.cpp
|
||||
core/TimeInfo.cpp
|
||||
core/ToDbExporter.cpp
|
||||
core/Tools.cpp
|
||||
core/Translator.cpp
|
||||
core/Uuid.cpp
|
||||
cli/PasswordInput.cpp
|
||||
cli/PasswordInput.h
|
||||
crypto/Crypto.cpp
|
||||
crypto/CryptoHash.cpp
|
||||
crypto/Random.cpp
|
||||
@ -70,8 +79,10 @@ set(keepassx_SOURCES
|
||||
format/KeePass2XmlWriter.cpp
|
||||
gui/AboutDialog.cpp
|
||||
gui/Application.cpp
|
||||
gui/CategoryListWidget.cpp
|
||||
gui/ChangeMasterKeyWidget.cpp
|
||||
gui/Clipboard.cpp
|
||||
gui/CloneDialog.cpp
|
||||
gui/DatabaseOpenWidget.cpp
|
||||
gui/DatabaseRepairWidget.cpp
|
||||
gui/DatabaseSettingsWidget.cpp
|
||||
@ -86,18 +97,24 @@ set(keepassx_SOURCES
|
||||
gui/FileDialog.cpp
|
||||
gui/IconModels.cpp
|
||||
gui/KeePass1OpenWidget.cpp
|
||||
gui/KMessageWidget.cpp
|
||||
gui/LineEdit.cpp
|
||||
gui/MainWindow.cpp
|
||||
gui/MessageBox.cpp
|
||||
gui/MessageWidget.cpp
|
||||
gui/PasswordEdit.cpp
|
||||
gui/PasswordGeneratorWidget.cpp
|
||||
gui/PasswordComboBox.cpp
|
||||
gui/SettingsWidget.cpp
|
||||
gui/SearchWidget.cpp
|
||||
gui/SortFilterHideProxyModel.cpp
|
||||
gui/SetupTotpDialog.cpp
|
||||
gui/TotpDialog.cpp
|
||||
gui/UnlockDatabaseWidget.cpp
|
||||
gui/UnlockDatabaseDialog.cpp
|
||||
gui/WelcomeWidget.cpp
|
||||
gui/csvImport/CsvImportWidget.cpp
|
||||
gui/csvImport/CsvImportWizard.cpp
|
||||
gui/csvImport/CsvParserModel.cpp
|
||||
gui/entry/AutoTypeAssociationsModel.cpp
|
||||
gui/entry/EditEntryWidget.cpp
|
||||
gui/entry/EditEntryWidget_p.h
|
||||
@ -111,50 +128,55 @@ set(keepassx_SOURCES
|
||||
gui/group/GroupView.cpp
|
||||
keys/CompositeKey.cpp
|
||||
keys/CompositeKey_p.h
|
||||
keys/drivers/YubiKey.h
|
||||
keys/FileKey.cpp
|
||||
keys/Key.h
|
||||
keys/PasswordKey.cpp
|
||||
keys/YkChallengeResponseKey.cpp
|
||||
streams/HashedBlockStream.cpp
|
||||
streams/LayeredStream.cpp
|
||||
streams/qtiocompressor.cpp
|
||||
streams/StoreDataStream.cpp
|
||||
streams/SymmetricCipherStream.cpp
|
||||
totp/base32.h
|
||||
totp/base32.cpp
|
||||
totp/totp.h
|
||||
totp/totp.cpp
|
||||
)
|
||||
if(APPLE)
|
||||
set(keepassx_SOURCES ${keepassx_SOURCES}
|
||||
core/ScreenLockListenerMac.h
|
||||
core/ScreenLockListenerMac.cpp
|
||||
)
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set(keepassx_SOURCES ${keepassx_SOURCES}
|
||||
core/ScreenLockListenerDBus.h
|
||||
core/ScreenLockListenerDBus.cpp
|
||||
)
|
||||
endif()
|
||||
if(MINGW)
|
||||
set(keepassx_SOURCES ${keepassx_SOURCES}
|
||||
core/ScreenLockListenerWin.h
|
||||
core/ScreenLockListenerWin.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
set(keepassx_SOURCES_MAINEXE
|
||||
main.cpp
|
||||
)
|
||||
|
||||
set(keepassx_FORMS
|
||||
gui/AboutDialog.ui
|
||||
gui/ChangeMasterKeyWidget.ui
|
||||
gui/DatabaseOpenWidget.ui
|
||||
gui/DatabaseSettingsWidget.ui
|
||||
gui/EditWidget.ui
|
||||
gui/EditWidgetIcons.ui
|
||||
gui/EditWidgetProperties.ui
|
||||
gui/MainWindow.ui
|
||||
gui/PasswordGeneratorWidget.ui
|
||||
gui/SearchWidget.ui
|
||||
gui/SettingsWidgetGeneral.ui
|
||||
gui/SettingsWidgetSecurity.ui
|
||||
gui/WelcomeWidget.ui
|
||||
gui/entry/EditEntryWidgetAdvanced.ui
|
||||
gui/entry/EditEntryWidgetAutoType.ui
|
||||
gui/entry/EditEntryWidgetHistory.ui
|
||||
gui/entry/EditEntryWidgetMain.ui
|
||||
gui/group/EditGroupWidgetMain.ui
|
||||
)
|
||||
|
||||
add_feature_info(KeePassHTTP WITH_XC_HTTP "KeePassHTTP support for ChromeIPass and PassIFox")
|
||||
add_feature_info(Autotype WITH_XC_AUTOTYPE "Auto-type passwords in Input fields")
|
||||
add_feature_info(AutoType WITH_XC_AUTOTYPE "Automatic password typing")
|
||||
add_feature_info(KeePassHTTP WITH_XC_HTTP "Browser integration compatible with ChromeIPass and PassIFox")
|
||||
add_feature_info(YubiKey WITH_XC_YUBIKEY "YubiKey HMAC-SHA1 challenge-response")
|
||||
|
||||
add_subdirectory(http)
|
||||
if(WITH_XC_HTTP)
|
||||
set(keepasshttp_LIB keepasshttp)
|
||||
set(keepasshttp_LIB keepasshttp qhttp Qt5::Network)
|
||||
endif()
|
||||
|
||||
add_subdirectory(autotype)
|
||||
add_subdirectory(cli)
|
||||
|
||||
set(autotype_SOURCES
|
||||
core/Tools.cpp
|
||||
@ -175,7 +197,11 @@ if(MINGW)
|
||||
${CMAKE_SOURCE_DIR}/share/windows/icon.rc)
|
||||
endif()
|
||||
|
||||
qt5_wrap_ui(keepassx_SOURCES ${keepassx_FORMS})
|
||||
if(WITH_XC_YUBIKEY)
|
||||
list(APPEND keepassx_SOURCES keys/drivers/YubiKey.cpp)
|
||||
else()
|
||||
list(APPEND keepassx_SOURCES keys/drivers/YubiKeyStub.cpp)
|
||||
endif()
|
||||
|
||||
add_library(zxcvbn STATIC zxcvbn/zxcvbn.cpp)
|
||||
target_link_libraries(zxcvbn)
|
||||
@ -191,25 +217,27 @@ set_target_properties(keepassx_core PROPERTIES COMPILE_DEFINITIONS KEEPASSX_BUIL
|
||||
target_link_libraries(keepassx_core
|
||||
${keepasshttp_LIB}
|
||||
${autotype_LIB}
|
||||
${YUBIKEY_LIBRARIES}
|
||||
zxcvbn
|
||||
qhttp
|
||||
Qt5::Core
|
||||
Qt5::Network
|
||||
Qt5::Concurrent
|
||||
Qt5::Widgets
|
||||
Qt5::Network
|
||||
${GCRYPT_LIBRARIES}
|
||||
${GPGERROR_LIBRARIES}
|
||||
${ZLIB_LIBRARIES})
|
||||
|
||||
if(APPLE)
|
||||
target_link_libraries(keepassx_core "-framework Foundation")
|
||||
endif()
|
||||
if (UNIX AND NOT APPLE)
|
||||
target_link_libraries(keepassx_core Qt5::DBus)
|
||||
endif()
|
||||
if(MINGW)
|
||||
target_link_libraries(keepassx_core Wtsapi32.lib)
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
string(REPLACE "." ";" VERSION_LIST ${KEEPASSXC_VERSION})
|
||||
list(GET VERSION_LIST 0 KEEPASSXC_VERSION_MAJOR)
|
||||
list(GET VERSION_LIST 1 KEEPASSXC_VERSION_MINOR)
|
||||
list(GET VERSION_LIST 2 KEEPASSXC_VERSION_PATCH)
|
||||
|
||||
include(GenerateProductVersion)
|
||||
generate_product_version(
|
||||
WIN32_ProductVersionFiles
|
||||
@ -221,14 +249,15 @@ if(MINGW)
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable(${PROGNAME} WIN32 MACOSX_BUNDLE ${keepassx_SOURCES_MAINEXE} ${WIN32_ProductVersionFiles})
|
||||
add_executable(${PROGNAME} WIN32 ${keepassx_SOURCES_MAINEXE} ${WIN32_ProductVersionFiles})
|
||||
target_link_libraries(${PROGNAME} keepassx_core)
|
||||
|
||||
set_target_properties(${PROGNAME} PROPERTIES ENABLE_EXPORTS ON)
|
||||
|
||||
if(APPLE)
|
||||
if(APPLE AND WITH_APP_BUNDLE)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/share/macosx/Info.plist.cmake ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
|
||||
set_target_properties(${PROGNAME} PROPERTIES
|
||||
MACOSX_BUNDLE ON
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
|
||||
endif()
|
||||
|
||||
@ -236,7 +265,7 @@ install(TARGETS ${PROGNAME}
|
||||
BUNDLE DESTINATION . COMPONENT Runtime
|
||||
RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT Runtime)
|
||||
|
||||
if(APPLE)
|
||||
if(APPLE AND WITH_APP_BUNDLE)
|
||||
if(QT_MAC_USE_COCOA AND EXISTS "${QT_LIBRARY_DIR}/Resources/qt_menu.nib")
|
||||
install(DIRECTORY "${QT_LIBRARY_DIR}/Resources/qt_menu.nib"
|
||||
DESTINATION "${DATA_INSTALL_DIR}")
|
||||
@ -247,7 +276,7 @@ if(APPLE)
|
||||
set(CPACK_DMG_VOLUME_NAME "${PROGNAME}")
|
||||
set(CPACK_SYSTEM_NAME "OSX")
|
||||
set(CPACK_STRIP_FILES ON)
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION_NUM}")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION}")
|
||||
include(CPack)
|
||||
|
||||
if(NOT DEFINED QT_BINARY_DIR)
|
||||
@ -261,7 +290,12 @@ if(APPLE)
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
string(REPLACE "AMD" "Win" OUTPUT_FILE_POSTFIX "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL "8")
|
||||
set(OUTPUT_FILE_POSTFIX "Win64")
|
||||
else()
|
||||
set(OUTPUT_FILE_POSTFIX "Win32")
|
||||
endif()
|
||||
|
||||
set(CPACK_GENERATOR "ZIP;NSIS")
|
||||
set(CPACK_STRIP_FILES ON)
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION}-${OUTPUT_FILE_POSTFIX}")
|
||||
@ -270,6 +304,7 @@ if(MINGW)
|
||||
set(CPACK_PACKAGE_VENDOR "${PROGNAME} Team")
|
||||
string(REGEX REPLACE "/" "\\\\\\\\" CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/share/windows/installer-header.bmp")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.GPL-2")
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/share/windows/keepassxc.ico")
|
||||
set(CPACK_NSIS_MUI_UNIICON "${CPACK_NSIS_MUI_ICON}")
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "\\\\${PROGNAME}.exe")
|
||||
@ -278,6 +313,7 @@ if(MINGW)
|
||||
set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROGNAME}.lnk' '$INSTDIR\\\\${PROGNAME}.exe'")
|
||||
set(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete '$SMPROGRAMS\\\\$START_MENU\\\\${PROGNAME}.lnk'")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "https://keepassxc.org")
|
||||
set(CPACK_NSIS_DISPLAY_NAME ${PROGNAME})
|
||||
set(CPACK_NSIS_PACKAGE_NAME "${PROGNAME} v${KEEPASSXC_VERSION}")
|
||||
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "../${PROGNAME}.exe")
|
||||
include(CPack)
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -142,6 +143,9 @@ void AutoType::performAutoType(const Entry* entry, QWidget* hideWindow, const QS
|
||||
sequence = customSequence;
|
||||
}
|
||||
|
||||
sequence.replace("{{}", "{LEFTBRACE}");
|
||||
sequence.replace("{}}", "{RIGHTBRACE}");
|
||||
|
||||
QList<AutoTypeAction*> actions;
|
||||
ListDeleter<AutoTypeAction*> actionsDeleter(&actions);
|
||||
|
||||
@ -317,8 +321,6 @@ bool AutoType::parseActions(const QString& sequence, const Entry* entry, QList<A
|
||||
|
||||
|
||||
for (const QChar& ch : sequence) {
|
||||
// TODO: implement support for {{}, {}}
|
||||
|
||||
if (inTmpl) {
|
||||
if (ch == '{') {
|
||||
qWarning("Syntax error in auto-type sequence.");
|
||||
@ -396,6 +398,9 @@ QList<AutoTypeAction*> AutoType::createActionFromTemplate(const QString& tmpl, c
|
||||
else if (tmplName.compare("enter",Qt::CaseInsensitive)==0) {
|
||||
list.append(new AutoTypeKey(Qt::Key_Enter));
|
||||
}
|
||||
else if (tmplName.compare("space",Qt::CaseInsensitive)==0) {
|
||||
list.append(new AutoTypeKey(Qt::Key_Space));
|
||||
}
|
||||
else if (tmplName.compare("up",Qt::CaseInsensitive)==0) {
|
||||
list.append(new AutoTypeKey(Qt::Key_Up));
|
||||
}
|
||||
@ -483,10 +488,10 @@ QList<AutoTypeAction*> AutoType::createActionFromTemplate(const QString& tmpl, c
|
||||
else if (tmplName.compare(")",Qt::CaseInsensitive)==0) {
|
||||
list.append(new AutoTypeChar(')'));
|
||||
}
|
||||
else if (tmplName.compare("{",Qt::CaseInsensitive)==0) {
|
||||
else if (tmplName.compare("leftbrace",Qt::CaseInsensitive)==0) {
|
||||
list.append(new AutoTypeChar('{'));
|
||||
}
|
||||
else if (tmplName.compare("}",Qt::CaseInsensitive)==0) {
|
||||
else if (tmplName.compare("rightbrace",Qt::CaseInsensitive)==0) {
|
||||
list.append(new AutoTypeChar('}'));
|
||||
}
|
||||
else {
|
||||
@ -514,6 +519,14 @@ QList<AutoTypeAction*> AutoType::createActionFromTemplate(const QString& tmpl, c
|
||||
else if (tmplName.compare("clearfield",Qt::CaseInsensitive)==0) {
|
||||
list.append(new AutoTypeClearField());
|
||||
}
|
||||
else if (tmplName.compare("totp", Qt::CaseInsensitive) == 0) {
|
||||
QString totp = entry->totp();
|
||||
if (!totp.isEmpty()) {
|
||||
for (const QChar& ch : totp) {
|
||||
list.append(new AutoTypeChar(ch));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
return list;
|
||||
@ -562,8 +575,9 @@ QString AutoType::autoTypeSequence(const Entry* entry, const QString& windowTitl
|
||||
}
|
||||
}
|
||||
|
||||
if (!match && config()->get("AutoTypeEntryTitleMatch").toBool() && !entry->title().isEmpty()
|
||||
&& windowTitle.contains(entry->title(), Qt::CaseInsensitive)) {
|
||||
if (!match && config()->get("AutoTypeEntryTitleMatch").toBool()
|
||||
&& (windowMatchesTitle(windowTitle, entry->resolvePlaceholder(entry->title()))
|
||||
|| windowMatchesUrl(windowTitle, entry->resolvePlaceholder(entry->url())))) {
|
||||
sequence = entry->defaultAutoTypeSequence();
|
||||
match = true;
|
||||
}
|
||||
@ -594,11 +608,11 @@ QString AutoType::autoTypeSequence(const Entry* entry, const QString& windowTitl
|
||||
group = group->parentGroup();
|
||||
} while (group && (!enableSet || sequence.isEmpty()));
|
||||
|
||||
if (sequence.isEmpty() && (!entry->username().isEmpty() || !entry->password().isEmpty())) {
|
||||
if (entry->username().isEmpty()) {
|
||||
if (sequence.isEmpty() && (!entry->resolvePlaceholder(entry->username()).isEmpty() || !entry->resolvePlaceholder(entry->password()).isEmpty())) {
|
||||
if (entry->resolvePlaceholder(entry->username()).isEmpty()) {
|
||||
sequence = "{PASSWORD}{ENTER}";
|
||||
}
|
||||
else if (entry->password().isEmpty()) {
|
||||
else if (entry->resolvePlaceholder(entry->password()).isEmpty()) {
|
||||
sequence = "{USERNAME}{ENTER}";
|
||||
}
|
||||
else {
|
||||
@ -619,3 +633,22 @@ bool AutoType::windowMatches(const QString& windowTitle, const QString& windowPa
|
||||
return WildcardMatcher(windowTitle).match(windowPattern);
|
||||
}
|
||||
}
|
||||
|
||||
bool AutoType::windowMatchesTitle(const QString& windowTitle, const QString& resolvedTitle)
|
||||
{
|
||||
return !resolvedTitle.isEmpty() && windowTitle.contains(resolvedTitle, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
bool AutoType::windowMatchesUrl(const QString& windowTitle, const QString& resolvedUrl)
|
||||
{
|
||||
if (!resolvedUrl.isEmpty() && windowTitle.contains(resolvedUrl, Qt::CaseInsensitive)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
QUrl url(resolvedUrl);
|
||||
if (url.isValid() && !url.host().isEmpty()) {
|
||||
return windowTitle.contains(url.host(), Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -48,13 +49,13 @@ public:
|
||||
static AutoType* instance();
|
||||
static void createTestInstance();
|
||||
|
||||
public Q_SLOTS:
|
||||
public slots:
|
||||
void performGlobalAutoType(const QList<Database*>& dbList);
|
||||
|
||||
Q_SIGNALS:
|
||||
signals:
|
||||
void globalShortcutTriggered();
|
||||
|
||||
private Q_SLOTS:
|
||||
private slots:
|
||||
void performAutoTypeFromGlobal(Entry* entry, const QString& sequence);
|
||||
void resetInAutoType();
|
||||
void unloadPlugin();
|
||||
@ -66,6 +67,8 @@ private:
|
||||
bool parseActions(const QString& sequence, const Entry* entry, QList<AutoTypeAction*>& actions);
|
||||
QList<AutoTypeAction*> createActionFromTemplate(const QString& tmpl, const Entry* entry);
|
||||
QString autoTypeSequence(const Entry* entry, const QString& windowTitle = QString());
|
||||
bool windowMatchesTitle(const QString& windowTitle, const QString& resolvedTitle);
|
||||
bool windowMatchesUrl(const QString& windowTitle, const QString& resolvedUrl);
|
||||
bool windowMatches(const QString& windowTitle, const QString& windowPattern);
|
||||
|
||||
bool m_inAutoType;
|
||||
|
@ -90,6 +90,4 @@ void AutoTypeExecutor::execDelay(AutoTypeDelay* action)
|
||||
void AutoTypeExecutor::execClearField(AutoTypeClearField* action)
|
||||
{
|
||||
Q_UNUSED(action);
|
||||
|
||||
// TODO: implement
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ void AutoTypeSelectDialog::emitEntryActivated(const QModelIndex& index)
|
||||
|
||||
Entry* entry = m_view->entryFromIndex(index);
|
||||
accept();
|
||||
Q_EMIT entryActivated(entry, m_sequences[entry]);
|
||||
emit entryActivated(entry, m_sequences[entry]);
|
||||
}
|
||||
|
||||
void AutoTypeSelectDialog::entryRemoved()
|
||||
|
@ -33,13 +33,13 @@ public:
|
||||
explicit AutoTypeSelectDialog(QWidget* parent = nullptr);
|
||||
void setEntries(const QList<Entry*>& entries, const QHash<Entry*, QString>& sequences);
|
||||
|
||||
Q_SIGNALS:
|
||||
signals:
|
||||
void entryActivated(Entry* entry, const QString& sequence);
|
||||
|
||||
public Q_SLOTS:
|
||||
public slots:
|
||||
void done(int r) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
private slots:
|
||||
void emitEntryActivated(const QModelIndex& index);
|
||||
void entryRemoved();
|
||||
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
protected:
|
||||
void mouseMoveEvent(QMouseEvent* event) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
private slots:
|
||||
void selectFirstEntry();
|
||||
};
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Lennart Glauer <mail@lennart-glauer.de>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Lennart Glauer <mail@lennart-glauer.de>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Lennart Glauer <mail@lennart-glauer.de>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Lennart Glauer <mail@lennart-glauer.de>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -120,7 +121,7 @@ bool AutoTypePlatformMac::registerGlobalShortcut(Qt::Key key, Qt::KeyboardModifi
|
||||
qWarning("Invalid key code");
|
||||
return false;
|
||||
}
|
||||
uint16 nativeModifiers = qtToNativeModifiers(modifiers);
|
||||
CGEventFlags nativeModifiers = qtToNativeModifiers(modifiers, false);
|
||||
if (::RegisterEventHotKey(nativeKeyCode, nativeModifiers, m_hotkeyId, GetApplicationEventTarget(), 0, &m_hotkeyRef) != noErr) {
|
||||
qWarning("Register hotkey failed");
|
||||
return false;
|
||||
@ -201,7 +202,7 @@ void AutoTypePlatformMac::sendChar(const QChar& ch, bool isKeyDown)
|
||||
// Send key code to active window
|
||||
// see: Quartz Event Services
|
||||
//
|
||||
void AutoTypePlatformMac::sendKey(Qt::Key key, bool isKeyDown)
|
||||
void AutoTypePlatformMac::sendKey(Qt::Key key, bool isKeyDown, Qt::KeyboardModifiers modifiers = 0)
|
||||
{
|
||||
uint16 keyCode = qtToNativeKeyCode(key);
|
||||
if (keyCode == INVALID_KEYCODE) {
|
||||
@ -209,7 +210,9 @@ void AutoTypePlatformMac::sendKey(Qt::Key key, bool isKeyDown)
|
||||
}
|
||||
|
||||
CGEventRef keyEvent = ::CGEventCreateKeyboardEvent(nullptr, keyCode, isKeyDown);
|
||||
CGEventFlags nativeModifiers = qtToNativeModifiers(modifiers, true);
|
||||
if (keyEvent != nullptr) {
|
||||
::CGEventSetFlags(keyEvent, nativeModifiers);
|
||||
::CGEventPost(kCGSessionEventTap, keyEvent);
|
||||
::CFRelease(keyEvent);
|
||||
}
|
||||
@ -317,6 +320,10 @@ uint16 AutoTypePlatformMac::qtToNativeKeyCode(Qt::Key key)
|
||||
case Qt::Key_Period:
|
||||
return kVK_ANSI_Period;
|
||||
|
||||
case Qt::Key_Shift:
|
||||
return kVK_Shift;
|
||||
case Qt::Key_Control:
|
||||
return kVK_Command;
|
||||
case Qt::Key_Backspace:
|
||||
return kVK_Delete;
|
||||
case Qt::Key_Tab:
|
||||
@ -395,21 +402,34 @@ uint16 AutoTypePlatformMac::qtToNativeKeyCode(Qt::Key key)
|
||||
// Translate qt key modifiers to mac os modifiers
|
||||
// see: https://doc.qt.io/qt-5/osx-issues.html#special-keys
|
||||
//
|
||||
uint16 AutoTypePlatformMac::qtToNativeModifiers(Qt::KeyboardModifiers modifiers)
|
||||
CGEventFlags AutoTypePlatformMac::qtToNativeModifiers(Qt::KeyboardModifiers modifiers, bool native)
|
||||
{
|
||||
uint16 nativeModifiers = 0;
|
||||
CGEventFlags nativeModifiers = CGEventFlags(0);
|
||||
|
||||
CGEventFlags shiftMod = CGEventFlags(shiftKey);
|
||||
CGEventFlags cmdMod = CGEventFlags(cmdKey);
|
||||
CGEventFlags optionMod = CGEventFlags(optionKey);
|
||||
CGEventFlags controlMod = CGEventFlags(controlKey);
|
||||
|
||||
if (native) {
|
||||
shiftMod = kCGEventFlagMaskShift;
|
||||
cmdMod = kCGEventFlagMaskCommand;
|
||||
optionMod = kCGEventFlagMaskAlternate;
|
||||
controlMod = kCGEventFlagMaskControl;
|
||||
}
|
||||
|
||||
|
||||
if (modifiers & Qt::ShiftModifier) {
|
||||
nativeModifiers |= shiftKey;
|
||||
nativeModifiers = CGEventFlags(nativeModifiers | shiftMod);
|
||||
}
|
||||
if (modifiers & Qt::ControlModifier) {
|
||||
nativeModifiers |= cmdKey;
|
||||
nativeModifiers = CGEventFlags(nativeModifiers | cmdMod);
|
||||
}
|
||||
if (modifiers & Qt::AltModifier) {
|
||||
nativeModifiers |= optionKey;
|
||||
nativeModifiers = CGEventFlags(nativeModifiers | optionMod);
|
||||
}
|
||||
if (modifiers & Qt::MetaModifier) {
|
||||
nativeModifiers |= controlKey;
|
||||
nativeModifiers = CGEventFlags(nativeModifiers | controlMod);
|
||||
}
|
||||
|
||||
return nativeModifiers;
|
||||
@ -460,7 +480,7 @@ OSStatus AutoTypePlatformMac::hotkeyHandler(EventHandlerCallRef nextHandler, Eve
|
||||
|
||||
if (::GetEventParameter(theEvent, kEventParamDirectObject, typeEventHotKeyID, nullptr, sizeof(hotkeyId), nullptr, &hotkeyId) == noErr
|
||||
&& hotkeyId.id == HOTKEY_ID) {
|
||||
Q_EMIT self->globalShortcutTriggered();
|
||||
emit self->globalShortcutTriggered();
|
||||
}
|
||||
|
||||
return noErr;
|
||||
@ -488,3 +508,25 @@ void AutoTypeExecutorMac::execKey(AutoTypeKey* action)
|
||||
m_platform->sendKey(action->key, false);
|
||||
usleep(25 * 1000);
|
||||
}
|
||||
|
||||
void AutoTypeExecutorMac::execClearField(AutoTypeClearField* action = nullptr)
|
||||
{
|
||||
Q_UNUSED(action);
|
||||
|
||||
m_platform->sendKey(Qt::Key_Control, true, Qt::ControlModifier);
|
||||
m_platform->sendKey(Qt::Key_Up, true, Qt::ControlModifier);
|
||||
m_platform->sendKey(Qt::Key_Up, false, Qt::ControlModifier);
|
||||
m_platform->sendKey(Qt::Key_Control, false);
|
||||
usleep(25 * 1000);
|
||||
m_platform->sendKey(Qt::Key_Shift, true, Qt::ShiftModifier);
|
||||
m_platform->sendKey(Qt::Key_Control, true, Qt::ShiftModifier | Qt::ControlModifier);
|
||||
m_platform->sendKey(Qt::Key_Down, true, Qt::ShiftModifier | Qt::ControlModifier);
|
||||
m_platform->sendKey(Qt::Key_Down, false, Qt::ShiftModifier | Qt::ControlModifier);
|
||||
m_platform->sendKey(Qt::Key_Control, false, Qt::ShiftModifier);
|
||||
m_platform->sendKey(Qt::Key_Shift, false);
|
||||
usleep(25 * 1000);
|
||||
m_platform->sendKey(Qt::Key_Backspace, true);
|
||||
m_platform->sendKey(Qt::Key_Backspace, false);
|
||||
|
||||
usleep(25 * 1000);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Lennart Glauer <mail@lennart-glauer.de>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -49,9 +50,9 @@ public:
|
||||
bool raiseOwnWindow() override;
|
||||
|
||||
void sendChar(const QChar& ch, bool isKeyDown);
|
||||
void sendKey(Qt::Key key, bool isKeyDown);
|
||||
void sendKey(Qt::Key key, bool isKeyDown, Qt::KeyboardModifiers modifiers);
|
||||
|
||||
Q_SIGNALS:
|
||||
signals:
|
||||
void globalShortcutTriggered();
|
||||
|
||||
private:
|
||||
@ -60,7 +61,7 @@ private:
|
||||
EventHotKeyID m_hotkeyId;
|
||||
|
||||
static uint16 qtToNativeKeyCode(Qt::Key key);
|
||||
static uint16 qtToNativeModifiers(Qt::KeyboardModifiers modifiers);
|
||||
static CGEventFlags qtToNativeModifiers(Qt::KeyboardModifiers modifiers, bool native);
|
||||
static int windowLayer(CFDictionaryRef window);
|
||||
static QString windowTitle(CFDictionaryRef window);
|
||||
static OSStatus hotkeyHandler(EventHandlerCallRef nextHandler, EventRef theEvent, void *userData);
|
||||
@ -73,6 +74,7 @@ public:
|
||||
|
||||
void execChar(AutoTypeChar* action) override;
|
||||
void execKey(AutoTypeKey* action) override;
|
||||
void execClearField(AutoTypeClearField* action) override;
|
||||
|
||||
private:
|
||||
AutoTypePlatformMac* const m_platform;
|
||||
|
@ -12,9 +12,15 @@ target_link_libraries(keepassx-autotype-cocoa ${PROGNAME} Qt5::Core Qt5::Widgets
|
||||
if(NOT DEFINED QT_BINARY_DIR)
|
||||
set(QT_BINARY_DIR "/usr/local/opt/qt5/bin" CACHE PATH "QT binary folder")
|
||||
endif()
|
||||
add_custom_command(TARGET keepassx-autotype-cocoa
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libkeepassx-autotype-cocoa.so ${PLUGIN_INSTALL_DIR}
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt ${PROGNAME}.app -executable=${PLUGIN_INSTALL_DIR}/libkeepassx-autotype-cocoa.so -no-plugins
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src
|
||||
COMMENT "Deploying autotype plugin")
|
||||
if(WITH_APP_BUNDLE)
|
||||
add_custom_command(TARGET keepassx-autotype-cocoa
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libkeepassx-autotype-cocoa.so ${PLUGIN_INSTALL_DIR}
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt ${PROGNAME}.app -executable=${PLUGIN_INSTALL_DIR}/libkeepassx-autotype-cocoa.so -no-plugins
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src
|
||||
COMMENT "Deploying autotype plugin")
|
||||
else()
|
||||
install(TARGETS keepassx-autotype-cocoa
|
||||
BUNDLE DESTINATION . COMPONENT Runtime
|
||||
LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR} COMPONENT Runtime)
|
||||
endif()
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
void addActionChar(AutoTypeChar* action);
|
||||
void addActionKey(AutoTypeKey* action);
|
||||
|
||||
Q_SIGNALS:
|
||||
signals:
|
||||
void globalShortcutTriggered();
|
||||
|
||||
private:
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Lennart Glauer <mail@lennart-glauer.de>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -96,7 +97,7 @@ int AutoTypePlatformWin::platformEventFilter(void* event)
|
||||
MSG *msg = static_cast<MSG *>(event);
|
||||
|
||||
if (msg->message == WM_HOTKEY && msg->wParam == HOTKEY_ID) {
|
||||
Q_EMIT globalShortcutTriggered();
|
||||
emit globalShortcutTriggered();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -189,6 +190,10 @@ DWORD AutoTypePlatformWin::qtToNativeKeyCode(Qt::Key key)
|
||||
case Qt::Key_Enter:
|
||||
case Qt::Key_Return:
|
||||
return VK_RETURN; // 0x0D
|
||||
case Qt::Key_Shift:
|
||||
return VK_SHIFT; // 0x10
|
||||
case Qt::Key_Control:
|
||||
return VK_CONTROL; // 0x11
|
||||
case Qt::Key_Pause:
|
||||
return VK_PAUSE; // 0x13
|
||||
case Qt::Key_CapsLock:
|
||||
@ -527,3 +532,24 @@ void AutoTypeExecutorWin::execKey(AutoTypeKey* action)
|
||||
::Sleep(25);
|
||||
}
|
||||
|
||||
void AutoTypeExecutorWin::execClearField(AutoTypeClearField* action = nullptr)
|
||||
{
|
||||
Q_UNUSED(action);
|
||||
|
||||
m_platform->sendKey(Qt::Key_Control, true);
|
||||
m_platform->sendKey(Qt::Key_Home, true);
|
||||
m_platform->sendKey(Qt::Key_Home, false);
|
||||
m_platform->sendKey(Qt::Key_Control, false);
|
||||
::Sleep(25);
|
||||
m_platform->sendKey(Qt::Key_Control, true);
|
||||
m_platform->sendKey(Qt::Key_Shift, true);
|
||||
m_platform->sendKey(Qt::Key_End, true);
|
||||
m_platform->sendKey(Qt::Key_End, false);
|
||||
m_platform->sendKey(Qt::Key_Shift, false);
|
||||
m_platform->sendKey(Qt::Key_Control, false);
|
||||
::Sleep(25);
|
||||
m_platform->sendKey(Qt::Key_Backspace, true);
|
||||
m_platform->sendKey(Qt::Key_Backspace, false);
|
||||
|
||||
::Sleep(25);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Lennart Glauer <mail@lennart-glauer.de>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -45,7 +46,7 @@ public:
|
||||
void sendChar(const QChar& ch, bool isKeyDown);
|
||||
void sendKey(Qt::Key key, bool isKeyDown);
|
||||
|
||||
Q_SIGNALS:
|
||||
signals:
|
||||
void globalShortcutTriggered();
|
||||
|
||||
private:
|
||||
@ -64,6 +65,7 @@ public:
|
||||
|
||||
void execChar(AutoTypeChar* action) override;
|
||||
void execKey(AutoTypeKey* action) override;
|
||||
void execClearField(AutoTypeClearField* action) override;
|
||||
|
||||
private:
|
||||
AutoTypePlatformWin* const m_platform;
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
|
||||
* Copyright (C) 2000-2008 Tom Sato <VEF00200@nifty.ne.jp>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -214,7 +215,7 @@ int AutoTypePlatformX11::platformEventFilter(void* event)
|
||||
&& (!QApplication::activeWindow() || QApplication::activeWindow()->isMinimized())
|
||||
&& m_loaded) {
|
||||
if (type == XCB_KEY_PRESS) {
|
||||
Q_EMIT globalShortcutTriggered();
|
||||
emit globalShortcutTriggered();
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -435,6 +436,8 @@ KeySym AutoTypePlatformX11::keyToKeySym(Qt::Key key)
|
||||
return XK_Tab;
|
||||
case Qt::Key_Enter:
|
||||
return XK_Return;
|
||||
case Qt::Key_Space:
|
||||
return XK_space;
|
||||
case Qt::Key_Up:
|
||||
return XK_Up;
|
||||
case Qt::Key_Down:
|
||||
@ -471,6 +474,12 @@ KeySym AutoTypePlatformX11::keyToKeySym(Qt::Key key)
|
||||
return XK_Print;
|
||||
case Qt::Key_ScrollLock:
|
||||
return XK_Scroll_Lock;
|
||||
case Qt::Key_Shift:
|
||||
return XK_Shift_L;
|
||||
case Qt::Key_Control:
|
||||
return XK_Control_L;
|
||||
case Qt::Key_Alt:
|
||||
return XK_Alt_L;
|
||||
default:
|
||||
if (key >= Qt::Key_F1 && key <= Qt::Key_F16) {
|
||||
return XK_F1 + (key - Qt::Key_F1);
|
||||
@ -721,6 +730,12 @@ bool AutoTypePlatformX11::keysymModifiers(KeySym keysym, int keycode, unsigned i
|
||||
* are set ON, many events will be sent.
|
||||
*/
|
||||
void AutoTypePlatformX11::SendKeyPressedEvent(KeySym keysym)
|
||||
{
|
||||
SendKey(keysym,true);
|
||||
SendKey(keysym,false);
|
||||
}
|
||||
|
||||
void AutoTypePlatformX11::SendKey(KeySym keysym, bool isKeyDown)
|
||||
{
|
||||
Window cur_focus;
|
||||
int revert_to;
|
||||
@ -800,8 +815,11 @@ void AutoTypePlatformX11::SendKeyPressedEvent(KeySym keysym)
|
||||
|
||||
/* press and release key */
|
||||
event.keycode = keycode;
|
||||
SendEvent(&event, KeyPress);
|
||||
SendEvent(&event, KeyRelease);
|
||||
if (isKeyDown) {
|
||||
SendEvent(&event, KeyPress);
|
||||
} else {
|
||||
SendEvent(&event, KeyRelease);
|
||||
}
|
||||
|
||||
/* release the modifiers */
|
||||
SendModifier(&event, press_mask, KeyRelease);
|
||||
@ -831,13 +849,40 @@ AutoTypeExecutorX11::AutoTypeExecutorX11(AutoTypePlatformX11* platform)
|
||||
void AutoTypeExecutorX11::execChar(AutoTypeChar* action)
|
||||
{
|
||||
m_platform->SendKeyPressedEvent(m_platform->charToKeySym(action->character));
|
||||
Tools::wait(25);
|
||||
}
|
||||
|
||||
void AutoTypeExecutorX11::execKey(AutoTypeKey* action)
|
||||
{
|
||||
m_platform->SendKeyPressedEvent(m_platform->keyToKeySym(action->key));
|
||||
Tools::wait(25);
|
||||
}
|
||||
|
||||
void AutoTypeExecutorX11::execClearField(AutoTypeClearField* action = nullptr)
|
||||
{
|
||||
Q_UNUSED(action);
|
||||
|
||||
timespec ts;
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = 25 * 1000 * 1000;
|
||||
|
||||
m_platform->SendKey(m_platform->keyToKeySym(Qt::Key_Control), true);
|
||||
m_platform->SendKeyPressedEvent(m_platform->keyToKeySym(Qt::Key_Home));
|
||||
m_platform->SendKey(m_platform->keyToKeySym(Qt::Key_Control), false);
|
||||
nanosleep(&ts, nullptr);
|
||||
|
||||
m_platform->SendKey(m_platform->keyToKeySym(Qt::Key_Control), true);
|
||||
m_platform->SendKey(m_platform->keyToKeySym(Qt::Key_Shift), true);
|
||||
m_platform->SendKeyPressedEvent(m_platform->keyToKeySym(Qt::Key_End));
|
||||
m_platform->SendKey(m_platform->keyToKeySym(Qt::Key_Shift), false);
|
||||
m_platform->SendKey(m_platform->keyToKeySym(Qt::Key_Control), false);
|
||||
nanosleep(&ts, nullptr);
|
||||
|
||||
m_platform->SendKeyPressedEvent(m_platform->keyToKeySym(Qt::Key_Backspace));
|
||||
nanosleep(&ts, nullptr);
|
||||
}
|
||||
|
||||
|
||||
int AutoTypePlatformX11::initialTimeout()
|
||||
{
|
||||
return 500;
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
|
||||
* Copyright (C) 2000-2008 Tom Sato <VEF00200@nifty.ne.jp>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -58,8 +59,9 @@ public:
|
||||
KeySym keyToKeySym(Qt::Key key);
|
||||
|
||||
void SendKeyPressedEvent(KeySym keysym);
|
||||
void SendKey(KeySym keysym, bool isKeyDown);
|
||||
|
||||
Q_SIGNALS:
|
||||
signals:
|
||||
void globalShortcutTriggered();
|
||||
|
||||
private:
|
||||
@ -126,6 +128,7 @@ public:
|
||||
|
||||
void execChar(AutoTypeChar* action) override;
|
||||
void execKey(AutoTypeKey* action) override;
|
||||
void execClearField(AutoTypeClearField* action) override;
|
||||
|
||||
private:
|
||||
AutoTypePlatformX11* const m_platform;
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
|
||||
# Copyright (C) 2017 KeePassXC Team
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -13,24 +13,33 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
include_directories(../src)
|
||||
set(cli_SOURCES
|
||||
Clip.cpp
|
||||
Clip.h
|
||||
EntropyMeter.cpp
|
||||
EntropyMeter.h
|
||||
Extract.cpp
|
||||
Extract.h
|
||||
List.cpp
|
||||
List.h
|
||||
Merge.cpp
|
||||
Merge.h
|
||||
Show.cpp
|
||||
Show.h)
|
||||
|
||||
add_executable(kdbx-extract kdbx-extract.cpp)
|
||||
target_link_libraries(kdbx-extract
|
||||
add_library(cli STATIC ${cli_SOURCES})
|
||||
target_link_libraries(cli Qt5::Core Qt5::Widgets)
|
||||
|
||||
add_executable(keepassxc-cli keepassxc-cli.cpp)
|
||||
target_link_libraries(keepassxc-cli
|
||||
cli
|
||||
keepassx_core
|
||||
Qt5::Core
|
||||
${GCRYPT_LIBRARIES}
|
||||
${GPGERROR_LIBRARIES}
|
||||
${ZLIB_LIBRARIES})
|
||||
${ZLIB_LIBRARIES}
|
||||
zxcvbn)
|
||||
|
||||
add_executable(kdbx-merge kdbx-merge.cpp)
|
||||
target_link_libraries(kdbx-merge
|
||||
keepassx_core
|
||||
Qt5::Core
|
||||
${GCRYPT_LIBRARIES}
|
||||
${GPGERROR_LIBRARIES}
|
||||
${ZLIB_LIBRARIES})
|
||||
|
||||
|
||||
add_executable(entropy-meter entropy-meter.cpp)
|
||||
target_link_libraries(entropy-meter zxcvbn)
|
||||
install(TARGETS keepassxc-cli
|
||||
BUNDLE DESTINATION . COMPONENT Runtime
|
||||
RUNTIME DESTINATION ${CLI_INSTALL_DIR} COMPONENT Runtime)
|
82
src/cli/Clip.cpp
Normal file
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 or (at your option)
|
||||
* version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <cstdlib>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "Clip.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QCommandLineParser>
|
||||
#include <QStringList>
|
||||
#include <QTextStream>
|
||||
|
||||
#include "gui/UnlockDatabaseDialog.h"
|
||||
#include "core/Database.h"
|
||||
#include "core/Entry.h"
|
||||
#include "core/Group.h"
|
||||
#include "gui/Clipboard.h"
|
||||
|
||||
int Clip::execute(int argc, char** argv)
|
||||
{
|
||||
|
||||
QStringList arguments;
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
arguments << QString(argv[i]);
|
||||
}
|
||||
QTextStream out(stdout);
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription(QCoreApplication::translate("main", "Copy a password to the clipboard"));
|
||||
parser.addPositionalArgument("database", QCoreApplication::translate("main", "Path of the database."));
|
||||
QCommandLineOption guiPrompt(
|
||||
QStringList() << "g"
|
||||
<< "gui-prompt",
|
||||
QCoreApplication::translate("main", "Use a GUI prompt unlocking the database."));
|
||||
parser.addOption(guiPrompt);
|
||||
parser.addPositionalArgument("entry", QCoreApplication::translate("main", "Name of the entry to clip."));
|
||||
parser.process(arguments);
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 2) {
|
||||
QCoreApplication app(argc, argv);
|
||||
parser.showHelp(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
Database* db = nullptr;
|
||||
QApplication app(argc, argv);
|
||||
if (parser.isSet("gui-prompt")) {
|
||||
db = UnlockDatabaseDialog::openDatabasePrompt(args.at(0));
|
||||
} else {
|
||||
db = Database::unlockFromStdin(args.at(0));
|
||||
}
|
||||
|
||||
if (!db) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
QString entryId = args.at(1);
|
||||
Entry* entry = db->rootGroup()->findEntry(entryId);
|
||||
if (!entry) {
|
||||
qCritical("Entry %s not found.", qPrintable(entryId));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
Clipboard::instance()->setText(entry->password());
|
||||
return EXIT_SUCCESS;
|
||||
}
|
27
src/cli/Clip.h
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 or (at your option)
|
||||
* version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KEEPASSXC_CLIP_H
|
||||
#define KEEPASSXC_CLIP_H
|
||||
|
||||
class Clip
|
||||
{
|
||||
public:
|
||||
static int execute(int argc, char** argv);
|
||||
};
|
||||
|
||||
#endif // KEEPASSXC_CLIP_H
|
@ -1,10 +1,21 @@
|
||||
/*
|
||||
Part of this code come from zxcvbn-c example.
|
||||
Copyright (c) 2015, Tony Evans
|
||||
Copyright (c) 2016, KeePassXC Team
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 or (at your option)
|
||||
* version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
See zxcvbn/zxcvbn.cpp for complete COPYRIGHT Notice
|
||||
*/
|
||||
#include "EntropyMeter.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -76,7 +87,7 @@ static void calculate(const char *pwd, int advanced)
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int EntropyMeter::execute(int argc, char **argv)
|
||||
{
|
||||
printf("KeePassXC Entropy Meter, based on zxcvbn-c.\nEnter your password below or pass it as argv\n");
|
||||
printf(" Usage: entropy-meter [-a] [pwd1 pwd2 ...]\n> ");
|
27
src/cli/EntropyMeter.h
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 or (at your option)
|
||||
* version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KEEPASSXC_ENTROPYMETER_H
|
||||
#define KEEPASSXC_ENTROPYMETER_H
|
||||
|
||||
class EntropyMeter
|
||||
{
|
||||
public:
|
||||
static int execute(int argc, char** argv);
|
||||
};
|
||||
|
||||
#endif // KEEPASSXC_ENTROPYMETER_H
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -15,8 +15,11 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <cstdlib>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "Extract.h"
|
||||
|
||||
#include <QCommandLineParser>
|
||||
#include <QCoreApplication>
|
||||
#include <QFile>
|
||||
@ -24,46 +27,41 @@
|
||||
#include <QTextStream>
|
||||
|
||||
#include "core/Database.h"
|
||||
#include "crypto/Crypto.h"
|
||||
#include "format/KeePass2Reader.h"
|
||||
#include "keys/CompositeKey.h"
|
||||
#include "keys/FileKey.h"
|
||||
#include "keys/PasswordKey.h"
|
||||
#include "cli/PasswordInput.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int Extract::execute(int argc, char** argv)
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
QTextStream out(stdout);
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription(QCoreApplication::translate("main",
|
||||
"Extract and print a KeePassXC database file."));
|
||||
parser.addPositionalArgument("database", QCoreApplication::translate("main", "path of the database to extract."));
|
||||
parser.addHelpOption();
|
||||
parser.setApplicationDescription(
|
||||
QCoreApplication::translate("main", "Extract and print the content of a database."));
|
||||
parser.addPositionalArgument("database", QCoreApplication::translate("main", "Path of the database to extract."));
|
||||
parser.process(app);
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 1) {
|
||||
parser.showHelp();
|
||||
return 1;
|
||||
parser.showHelp(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (!Crypto::init()) {
|
||||
qFatal("Fatal error while testing the cryptographic functions:\n%s", qPrintable(Crypto::errorString()));
|
||||
}
|
||||
out << "Insert the database password\n> ";
|
||||
out.flush();
|
||||
|
||||
static QTextStream inputTextStream(stdin, QIODevice::ReadOnly);
|
||||
QString line = inputTextStream.readLine();
|
||||
QString line = PasswordInput::getPassword();
|
||||
CompositeKey key = CompositeKey::readFromLine(line);
|
||||
|
||||
QString databaseFilename = args.at(0);
|
||||
QFile dbFile(databaseFilename);
|
||||
if (!dbFile.exists()) {
|
||||
qCritical("File %s does not exist.", qPrintable(databaseFilename));
|
||||
return 1;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (!dbFile.open(QIODevice::ReadOnly)) {
|
||||
qCritical("Unable to open file %s.", qPrintable(databaseFilename));
|
||||
return 1;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
KeePass2Reader reader;
|
||||
@ -76,15 +74,13 @@ int main(int argc, char **argv)
|
||||
if (reader.hasError()) {
|
||||
if (xmlData.isEmpty()) {
|
||||
qCritical("Error while reading the database:\n%s", qPrintable(reader.errorString()));
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
qWarning("Error while parsing the database:\n%s\n", qPrintable(reader.errorString()));
|
||||
}
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
QTextStream out(stdout);
|
||||
out << xmlData.constData() << "\n";
|
||||
|
||||
return 0;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
27
src/cli/Extract.h
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 or (at your option)
|
||||
* version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KEEPASSXC_EXTRACT_H
|
||||
#define KEEPASSXC_EXTRACT_H
|
||||
|
||||
class Extract
|
||||
{
|
||||
public:
|
||||
static int execute(int argc, char** argv);
|
||||
};
|
||||
|
||||
#endif // KEEPASSXC_EXTRACT_H
|
94
src/cli/List.cpp
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 or (at your option)
|
||||
* version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <cstdlib>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "List.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QCoreApplication>
|
||||
#include <QStringList>
|
||||
#include <QTextStream>
|
||||
|
||||
#include "gui/UnlockDatabaseDialog.h"
|
||||
#include "core/Database.h"
|
||||
#include "core/Entry.h"
|
||||
#include "core/Group.h"
|
||||
#include "keys/CompositeKey.h"
|
||||
|
||||
|
||||
int List::execute(int argc, char** argv)
|
||||
{
|
||||
QStringList arguments;
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
arguments << QString(argv[i]);
|
||||
}
|
||||
QTextStream out(stdout);
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription(QCoreApplication::translate("main", "List database entries."));
|
||||
parser.addPositionalArgument("database", QCoreApplication::translate("main", "Path of the database."));
|
||||
parser.addPositionalArgument("group",
|
||||
QCoreApplication::translate("main", "Path of the group to list. Default is /"),
|
||||
QString("[group]"));
|
||||
QCommandLineOption printUuidsOption(
|
||||
QStringList() << "u"
|
||||
<< "print-uuids",
|
||||
QCoreApplication::translate("main", "Print the UUIDs of the entries and groups."));
|
||||
parser.addOption(printUuidsOption);
|
||||
QCommandLineOption guiPrompt(
|
||||
QStringList() << "g"
|
||||
<< "gui-prompt",
|
||||
QCoreApplication::translate("main", "Use a GUI prompt unlocking the database."));
|
||||
parser.addOption(guiPrompt);
|
||||
parser.process(arguments);
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 1 && args.size() != 2) {
|
||||
QCoreApplication app(argc, argv);
|
||||
parser.showHelp(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
Database* db = nullptr;
|
||||
if (parser.isSet("gui-prompt")) {
|
||||
QApplication app(argc, argv);
|
||||
db = UnlockDatabaseDialog::openDatabasePrompt(args.at(0));
|
||||
} else {
|
||||
QCoreApplication app(argc, argv);
|
||||
db = Database::unlockFromStdin(args.at(0));
|
||||
}
|
||||
|
||||
if (db == nullptr) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
Group* group = db->rootGroup();
|
||||
if (args.size() == 2) {
|
||||
QString groupPath = args.at(1);
|
||||
group = db->rootGroup()->findGroupByPath(groupPath);
|
||||
if (group == nullptr) {
|
||||
qCritical("Cannot find group %s.", qPrintable(groupPath));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
out << group->print(parser.isSet("print-uuids"));
|
||||
out.flush();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
27
src/cli/List.h
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 or (at your option)
|
||||
* version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KEEPASSXC_LIST_H
|
||||
#define KEEPASSXC_LIST_H
|
||||
|
||||
class List
|
||||
{
|
||||
public:
|
||||
static int execute(int argc, char** argv);
|
||||
};
|
||||
|
||||
#endif // KEEPASSXC_LIST_H
|
104
src/cli/Merge.cpp
Normal file
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 or (at your option)
|
||||
* version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include "Merge.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QCoreApplication>
|
||||
#include <QStringList>
|
||||
#include <QTextStream>
|
||||
|
||||
#include "core/Database.h"
|
||||
#include "gui/UnlockDatabaseDialog.h"
|
||||
|
||||
int Merge::execute(int argc, char** argv)
|
||||
{
|
||||
|
||||
QStringList arguments;
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
arguments << QString(argv[i]);
|
||||
}
|
||||
QTextStream out(stdout);
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription(QCoreApplication::translate("main", "Merge two databases."));
|
||||
parser.addPositionalArgument("database1",
|
||||
QCoreApplication::translate("main", "Path of the database to merge into."));
|
||||
parser.addPositionalArgument("database2",
|
||||
QCoreApplication::translate("main", "Path of the database to merge from."));
|
||||
|
||||
QCommandLineOption samePasswordOption(
|
||||
QStringList() << "s"
|
||||
<< "same-password",
|
||||
QCoreApplication::translate("main", "Use the same password for both database files."));
|
||||
|
||||
QCommandLineOption guiPrompt(
|
||||
QStringList() << "g"
|
||||
<< "gui-prompt",
|
||||
QCoreApplication::translate("main", "Use a GUI prompt unlocking the database."));
|
||||
parser.addOption(guiPrompt);
|
||||
|
||||
parser.addOption(samePasswordOption);
|
||||
parser.process(arguments);
|
||||
|
||||
const QStringList args = parser.positionalArguments();
|
||||
if (args.size() != 2) {
|
||||
QCoreApplication app(argc, argv);
|
||||
parser.showHelp(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
Database* db1;
|
||||
Database* db2;
|
||||
|
||||
if (parser.isSet("gui-prompt")) {
|
||||
QApplication app(argc, argv);
|
||||
db1 = UnlockDatabaseDialog::openDatabasePrompt(args.at(0));
|
||||
if (!parser.isSet("same-password")) {
|
||||
db2 = UnlockDatabaseDialog::openDatabasePrompt(args.at(1));
|
||||
} else {
|
||||
db2 = Database::openDatabaseFile(args.at(1), *(db1->key().clone()));
|
||||
}
|
||||
} else {
|
||||
QCoreApplication app(argc, argv);
|
||||
db1 = Database::unlockFromStdin(args.at(0));
|
||||
if (!parser.isSet("same-password")) {
|
||||
db2 = Database::unlockFromStdin(args.at(1));
|
||||
} else {
|
||||
db2 = Database::openDatabaseFile(args.at(1), *(db1->key().clone()));
|
||||
}
|
||||
}
|
||||
if (db1 == nullptr) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (db2 == nullptr) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
db1->merge(db2);
|
||||
QString errorMessage = db1->saveToFile(args.at(0));
|
||||
if (!errorMessage.isEmpty()) {
|
||||
qCritical("Unable to save database to file : %s", qPrintable(errorMessage));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
out << "Successfully merged the database files.\n";
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
}
|