Skip to content

Commit

Permalink
[foilnotes] Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
monich committed Jan 5, 2019
0 parents commit b2df564
Show file tree
Hide file tree
Showing 65 changed files with 8,949 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
harbour-foilnotes.pro.user
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "harbour-lib"]
path = harbour-lib
url = https://github.com/monich/harbour-lib.git
[submodule "foil"]
path = foil
url = https://github.com/monich/foil.git
[submodule "libglibutil"]
path = libglibutil
url = https://github.com/monich/libglibutil.git
30 changes: 30 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Copyright (C) 2018-2019 Jolla Ltd.
Copyright (C) 2018-2019 Slava Monich <[email protected]>

You may use this file under the terms of the BSD license as follows:

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. Neither the names of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Notes encryption application for Sailfish OS

![icon](icons/86x86/harbour-foilnotes.png)

**Foil Notes** allows you to encrypt some notes from Sailfish
OS Notes database with a password stronger than the lock code.
Strictly speaking, each note is encrypted with a unique random
256-bit AES key which in turn is encrypted with an RSA key which
in turn is encrypted with your password. If the bad guys get your
encrypted notes, they would have to crack the AES key (different
for each note) or the RSA key (shared by all notes but harder to
crack) in order to extract the content. If they get the encrypted
RSA key as well, then they can brute force your password. So in
the end, the encryption is as strong as your password.

The format of the encrypted file is described
[here](https://github.com/monich/foil/blob/master/libfoilmsg/README).
193 changes: 193 additions & 0 deletions app.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
NAME = foilnotes

openrepos {
PREFIX = openrepos
DEFINES += OPENREPOS
} else {
PREFIX = harbour
}

TARGET = $${PREFIX}-$${NAME}
CONFIG += sailfishapp link_pkgconfig
PKGCONFIG += sailfishapp mlite5 glib-2.0 gobject-2.0 libcrypto
QT += qml quick sql

QMAKE_CXXFLAGS += -Wno-unused-parameter -Wno-psabi
QMAKE_CFLAGS += -Wno-unused-parameter

app_settings {
# This path is hardcoded in jolla-settings
TRANSLATIONS_PATH = /usr/share/translations
} else {
TRANSLATIONS_PATH = /usr/share/$${TARGET}/translations
}

CONFIG(debug, debug|release) {
DEFINES += DEBUG HARBOUR_DEBUG
}

# Directories
HARBOUR_LIB_REL = harbour-lib
HARBOUR_LIB_DIR = $${_PRO_FILE_PWD_}/$${HARBOUR_LIB_REL}
HARBOUR_LIB_INCLUDE = $${HARBOUR_LIB_DIR}/include
HARBOUR_LIB_SRC = $${HARBOUR_LIB_DIR}/src
HARBOUR_LIB_QML = $${HARBOUR_LIB_DIR}/qml

LIBGLIBUTIL_DIR = $${_PRO_FILE_PWD_}/libglibutil
LIBGLIBUTIL_INCLUDE = $${LIBGLIBUTIL_DIR}/include

FOIL_DIR = $${_PRO_FILE_PWD_}/foil
LIBFOIL_DIR = $${FOIL_DIR}/libfoil
LIBFOIL_INCLUDE = $${LIBFOIL_DIR}/include
LIBFOIL_SRC = $${LIBFOIL_DIR}/src

LIBFOILMSG_DIR = $${FOIL_DIR}/libfoilmsg
LIBFOILMSG_INCLUDE = $${LIBFOILMSG_DIR}/include
LIBFOILMSG_SRC = $${LIBFOILMSG_DIR}/src

# Libraries
LIBS += -ldl

OTHER_FILES += \
*.desktop \
qml/*.qml \
qml/images/*.svg \
icons/*.svg \
translations/*.ts

INCLUDEPATH += \
src \
$${LIBFOIL_SRC} \
$${LIBFOIL_INCLUDE} \
$${LIBFOILMSG_INCLUDE} \
$${LIBGLIBUTIL_INCLUDE}

HEADERS += \
src/FoilNotes.h \
src/FoilNotesBaseModel.h \
src/FoilNotesDefs.h \
src/FoilNotesHints.h \
src/FoilNotesModel.h \
src/FoilNotesOrganizeModel.h \
src/FoilNotesPlaintextModel.h \
src/FoilNotesSearchModel.h \
src/FoilNotesSettings.h

SOURCES += \
src/FoilNotes.cpp \
src/FoilNotesBaseModel.cpp \
src/FoilNotesHints.cpp \
src/FoilNotesModel.cpp \
src/FoilNotesOrganizeModel.cpp \
src/FoilNotesPlaintextModel.cpp \
src/FoilNotesSearchModel.cpp \
src/FoilNotesSettings.cpp \
src/main.cpp

SOURCES += \
$${LIBFOIL_SRC}/*.c \
$${LIBFOIL_SRC}/openssl/*.c \
$${LIBFOILMSG_SRC}/*.c \
$${LIBGLIBUTIL_DIR}/src/*.c

HEADERS += \
$${LIBFOIL_INCLUDE}/*.h \
$${LIBFOILMSG_INCLUDE}/*.h \
$${LIBGLIBUTIL_INCLUDE}/*.h

# harbour-lib

INCLUDEPATH += \
$${HARBOUR_LIB_DIR}/include

HEADERS += \
$${HARBOUR_LIB_INCLUDE}/HarbourDebug.h \
$${HARBOUR_LIB_INCLUDE}/HarbourImageProvider.h \
$${HARBOUR_LIB_INCLUDE}/HarbourSystemState.h \
$${HARBOUR_LIB_INCLUDE}/HarbourTask.h \
$${HARBOUR_LIB_INCLUDE}/HarbourTheme.h \
$${HARBOUR_LIB_SRC}/HarbourMce.h

SOURCES += \
$${HARBOUR_LIB_SRC}/HarbourImageProvider.cpp \
$${HARBOUR_LIB_SRC}/HarbourMce.cpp \
$${HARBOUR_LIB_SRC}/HarbourSystemState.cpp \
$${HARBOUR_LIB_SRC}/HarbourTask.cpp \
$${HARBOUR_LIB_SRC}/HarbourTheme.cpp

HARBOUR_QML_COMPONENTS = \
$${HARBOUR_LIB_QML}/HarbourFitLabel.qml \
$${HARBOUR_LIB_QML}/HarbourHorizontalSwipeHint.qml\
$${HARBOUR_LIB_QML}/HarbourIconTextButton.qml \
$${HARBOUR_LIB_QML}/HarbourPasswordInputField.qml \
$${HARBOUR_LIB_QML}/HarbourShakeAnimation.qml

OTHER_FILES += $${HARBOUR_QML_COMPONENTS}

qml_components.files = $${HARBOUR_QML_COMPONENTS}
qml_components.path = /usr/share/$${TARGET}/qml/harbour
INSTALLS += qml_components

# Icons
ICON_SIZES = 86 108 128 256
for(s, ICON_SIZES) {
icon_target = icon$${s}
icon_dir = icons/$${s}x$${s}
$${icon_target}.files = $${icon_dir}/$${TARGET}.png
$${icon_target}.path = /usr/share/icons/hicolor/$${s}x$${s}/apps
equals(PREFIX, "openrepos") {
$${icon_target}.extra = cp $${icon_dir}/harbour-$${NAME}.png $$eval($${icon_target}.files)
$${icon_target}.CONFIG += no_check_exist
}
INSTALLS += $${icon_target}
}

# Desktop file
equals(PREFIX, "openrepos") {
desktop.extra = sed s/harbour/openrepos/g harbour-$${NAME}.desktop > $${TARGET}.desktop
desktop.CONFIG += no_check_exist
}

# Translations
TRANSLATION_SOURCES = \
$${_PRO_FILE_PWD_}/qml

defineTest(addTrFile) {
in = $${_PRO_FILE_PWD_}/translations/harbour-$$1
out = $${OUT_PWD}/translations/$${PREFIX}-$$1

s = $$replace(1,-,_)
lupdate_target = lupdate_$$s
lrelease_target = lrelease_$$s

$${lupdate_target}.commands = lupdate -noobsolete $${TRANSLATION_SOURCES} -ts \"$${in}.ts\" && \
mkdir -p \"$${OUT_PWD}/translations\" && [ \"$${in}.ts\" != \"$${out}.ts\" ] && \
cp -af \"$${in}.ts\" \"$${out}.ts\" || :

$${lrelease_target}.target = $${out}.qm
$${lrelease_target}.depends = $${lupdate_target}
$${lrelease_target}.commands = lrelease -idbased \"$${out}.ts\"

QMAKE_EXTRA_TARGETS += $${lrelease_target} $${lupdate_target}
PRE_TARGETDEPS += $${out}.qm
qm.files += $${out}.qm

export($${lupdate_target}.commands)
export($${lrelease_target}.target)
export($${lrelease_target}.depends)
export($${lrelease_target}.commands)
export(QMAKE_EXTRA_TARGETS)
export(PRE_TARGETDEPS)
export(qm.files)
}

LANGUAGES = ru

addTrFile($${NAME})
for(l, LANGUAGES) {
addTrFile($${NAME}-$$l)
}

qm.path = $$TRANSLATIONS_PATH
qm.CONFIG += no_check_exist
INSTALLS += qm
1 change: 1 addition & 0 deletions foil
Submodule foil added at 859ee1
6 changes: 6 additions & 0 deletions harbour-foilnotes.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Desktop Entry]
Type=Application
Name=Foil Notes
X-Nemo-Application-Type=silica-qt5
Icon=harbour-foilnotes
Exec=harbour-foilnotes
6 changes: 6 additions & 0 deletions harbour-foilnotes.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TEMPLATE = subdirs
SUBDIRS = app

app.file = app.pro

OTHER_FILES += README.md LICENSE rpm/*.spec
1 change: 1 addition & 0 deletions harbour-lib
Submodule harbour-lib added at 7e6c54
Binary file added icons/108x108/harbour-foilnotes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/128x128/harbour-foilnotes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/256x256/harbour-foilnotes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/86x86/harbour-foilnotes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b2df564

Please sign in to comment.