From 2553a699d3c54a6ca1567569e833f7f8a237d9b0 Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Sun, 2 Feb 2014 14:28:19 +0100 Subject: [PATCH] Preparations for version 0.5 release --- README.md | 14 ++++++++++++++ qml/pages/ExportPage.qml | 4 ++-- rpm/harbour-sailotp.yaml | 20 ++++++++++---------- src/harbour-sailotp.cpp | 2 ++ 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 43776f8..237f292 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,16 @@ The item can be unstared by tapping the star icon again on the main view. From the main view a token can be copied to the clipboard by tapping on it. +From the pulley menu the token database can be exported to a file for backup purposes. The backup is a AES-256-CBC encrypted and +Base64 encoded file containing a JSON-representation of the database. It can be decrypted with openssl using the following command: + + openssl enc -d -a -aes-256-cbc -in + +if you need the information outside of SailOTP. + +Importing the file is also possible from the pulley menu. If a file contains tokens that are already in the database +(title and secret of the token match an existing one), these tokens will not be added again. + ## Known Limitations At the moment the only way to insert new entries into the app is to insert the @@ -43,6 +53,10 @@ SailOTP uses the SHA-1 and HMAC-Implementation from https://github.com/Caligatio/jsSHA +SailOTP also uses the AES-Implementation from + +https://github.com/mdp/gibberish-aes + The implementation of the TOTP-algorithm was inspired by: http://blog.tinisles.com/2011/10/google-authenticator-one-time-password-algorithm-in-javascript/ diff --git a/qml/pages/ExportPage.qml b/qml/pages/ExportPage.qml index f496e70..7d56ec4 100644 --- a/qml/pages/ExportPage.qml +++ b/qml/pages/ExportPage.qml @@ -52,7 +52,7 @@ Dialog { function creFileName() { var date = new Date(); - return("/home/nemo/sailotp_"+date.getFullYear()+fillNum(date.getMonth()+1)+fillNum(date.getDate())+".aes"); + return(XDG_HOME_DIR + "/sailotp_"+date.getFullYear()+fillNum(date.getMonth()+1)+fillNum(date.getDate())+".aes"); } function checkFileName(file) { @@ -95,7 +95,7 @@ Dialog { TextField { id: fileName width: parent.width - text: mode == "export" ? creFileName() : "/home/nemo/"; + text: mode == "export" ? creFileName() : XDG_HOME_DIR + "/"; label: "Filename" placeholderText: mode == "import" ? "File to import" : "File to export" focus: true diff --git a/rpm/harbour-sailotp.yaml b/rpm/harbour-sailotp.yaml index 92484d7..162cb15 100644 --- a/rpm/harbour-sailotp.yaml +++ b/rpm/harbour-sailotp.yaml @@ -15,19 +15,19 @@ QMakeOptions: - VERSION=%{version} - RELEASE=%{release} PkgConfigBR: -- Qt5Quick -- Qt5Qml -- Qt5Core - sailfishapp >= 0.0.10 +- Qt5Core +- Qt5Qml +- Qt5Quick Requires: - sailfishsilica-qt5 >= 0.10.9 Files: -- '%{_bindir}' -- '%{_datadir}/%{name}/qml' -- '%{_datadir}/applications/%{name}.desktop' -- '%{_datadir}/icons/hicolor/86x86/apps/%{name}.png' -- /usr/bin -- /usr/share/harbour-sailotp -- /usr/share/applications - /usr/share/icons/hicolor/86x86/apps +- /usr/share/applications +- /usr/share/harbour-sailotp +- /usr/bin +- '%{_datadir}/icons/hicolor/86x86/apps/%{name}.png' +- '%{_datadir}/applications/%{name}.desktop' +- '%{_datadir}/%{name}/qml' +- '%{_bindir}' PkgBR: [] diff --git a/src/harbour-sailotp.cpp b/src/harbour-sailotp.cpp index 16a6177..d1bc1ce 100644 --- a/src/harbour-sailotp.cpp +++ b/src/harbour-sailotp.cpp @@ -45,8 +45,10 @@ int main(int argc, char *argv[]) qmlRegisterType("harbour.sailotp.FileIO", 1, 0, "FileIO"); view->setSource(SailfishApp::pathTo("qml/harbour-sailotp.qml")); + view->rootContext()->setContextProperty("XDG_HOME_DIR", QStandardPaths::writableLocation(QStandardPaths::HomeLocation)); view->show(); + return app->exec(); }