1
0
Fork 0
mirror of https://github.com/seiichiro0185/sailotp.git synced 2024-12-22 03:32:30 +00:00

Version 1.3

Added SteamGuard-Support contributed by Robin Appelman
This commit is contained in:
seiichiro 2015-12-06 19:37:41 +01:00
parent c0f811d5f6
commit c02691d634
15 changed files with 291 additions and 199 deletions

View file

@ -21,6 +21,8 @@ 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.
It is also possible to generate tokens for SteamGuard (Steams TOTP-Variant for 2-Factor-Auth). To use this feature, one will have to activate it using the original Steam Android app. After activating it one can get the secret code from '/opt/alien/data/data/com.valvesoftware.android.steam.community/files/Steamguard-$STEAMID'. This file contains json data, including the OTP-URL in the form 'otpauth://totp/Steam:$STEAM_USERNAME?secret=$SECRET&issuer=Steam'. The code from this URL can be added manually using the 'Steam Guard'-OTP-Type in SailOTP.
## Contact and Issues
If you find any bugs or want to suggest a feature, feel free to use Githubs

View file

@ -12,26 +12,36 @@
<translation type="vanished">Copyright: Stefan Brand&lt;br/&gt;Lizenz: BSD (3-Klausel)</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="65"/>
<location filename="../qml/pages/About.qml" line="68"/>
<source>A Simple Sailfish OTP Generator
(RFC 6238/4226 compatible)</source>
<translation>Ein einfacher Sailfish OTP-Generator
(RFC 6238/4226-kompatibel)</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="74"/>
<location filename="../qml/pages/About.qml" line="77"/>
<source>Copyright: Stefan Brand
License: BSD (3-clause)</source>
<translation>Copyright: Stefan Brand
Lizenz: BSD (3-Klausel)</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="92"/>
<location filename="../qml/pages/About.qml" line="95"/>
<source>SailOTP uses the following third party libs:</source>
<translation>SailOTP verwendet folgende externe Bibliotheken:</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="103"/>
<location filename="../qml/pages/About.qml" line="106"/>
<source>Contributors:</source>
<translation>Mitwirkende:</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="106"/>
<source>Support</source>
<translation>Unterstützung</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="117"/>
<source>Translators:</source>
<translation>Übersetzer:</translation>
</message>
@ -39,67 +49,72 @@ Lizenz: BSD (3-Klausel)</translation>
<context>
<name>AddOTP</name>
<message>
<location filename="../qml/pages/AddOTP.qml" line="66"/>
<location filename="../qml/pages/AddOTP.qml" line="68"/>
<source>Show QR-Code</source>
<translation>QR-Code anzeigen</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="69"/>
<location filename="../qml/pages/AddOTP.qml" line="71"/>
<source>Can&apos;t create QR-Code from incomplete settings!</source>
<translation>Ein QR-Code kann nur mit vollständigen Einstellungen erzeugt werden!</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="82"/>
<location filename="../qml/pages/AddOTP.qml" line="84"/>
<source>Save</source>
<translation>Speichern</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="82"/>
<location filename="../qml/pages/AddOTP.qml" line="84"/>
<source>Add</source>
<translation>Hinzufügen</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="87"/>
<location filename="../qml/pages/AddOTP.qml" line="89"/>
<source>Type</source>
<translation>Typ</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="89"/>
<location filename="../qml/pages/AddOTP.qml" line="91"/>
<source>Time-based (TOTP)</source>
<translation>Zeitbasiert (TOTP)</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="90"/>
<location filename="../qml/pages/AddOTP.qml" line="92"/>
<source>Counter-based (HOTP)</source>
<translation>Zählerbasiert (HOTP)</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="96"/>
<location filename="../qml/pages/AddOTP.qml" line="93"/>
<source>Steam Guard</source>
<translation>Steam Guard</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="99"/>
<source>Title</source>
<translation>Titel</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="97"/>
<location filename="../qml/pages/AddOTP.qml" line="100"/>
<source>Title for the OTP</source>
<translation>Titel für das Token</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="109"/>
<location filename="../qml/pages/AddOTP.qml" line="112"/>
<source>Secret (at least 16 characters)</source>
<translation>Schlüssel (mindestens 16 Zeichen)</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="111"/>
<location filename="../qml/pages/AddOTP.qml" line="114"/>
<source>Secret OTP Key</source>
<translation>Geheimer Schlüssel</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="123"/>
<location filename="../qml/pages/AddOTP.qml" line="126"/>
<source>Next Counter Value</source>
<translation>Nächster Zählerwert</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="125"/>
<location filename="../qml/pages/AddOTP.qml" line="128"/>
<source>Next Value of the Counter</source>
<translation>Nächster Wert für den Zähler</translation>
</message>
@ -107,114 +122,114 @@ Lizenz: BSD (3-Klausel)</translation>
<context>
<name>ExportPage</name>
<message>
<location filename="../qml/pages/ExportPage.qml" line="61"/>
<location filename="../qml/pages/ExportPage.qml" line="63"/>
<source>File already exists, choose &quot;Overwrite existing&quot; to overwrite it.</source>
<translation>Datei existiert, aktiviere &quot;Existierende überschreiben&quot; um sie zu ersetzen.</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="70"/>
<location filename="../qml/pages/ExportPage.qml" line="72"/>
<source>Given file does not exist!</source>
<translation>Gewählte Datei existiert nicht!</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="89"/>
<location filename="../qml/pages/ExportPage.qml" line="105"/>
<location filename="../qml/pages/ExportPage.qml" line="91"/>
<location filename="../qml/pages/ExportPage.qml" line="107"/>
<source>Export</source>
<translation>Export</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="89"/>
<location filename="../qml/pages/ExportPage.qml" line="105"/>
<location filename="../qml/pages/ExportPage.qml" line="91"/>
<location filename="../qml/pages/ExportPage.qml" line="107"/>
<source>Import</source>
<translation>Import</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="112"/>
<location filename="../qml/pages/ExportPage.qml" line="114"/>
<source>Filename</source>
<translation>Dateiname</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="113"/>
<location filename="../qml/pages/ExportPage.qml" line="115"/>
<source>File to import</source>
<translation>Aus Datei importieren</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="113"/>
<location filename="../qml/pages/ExportPage.qml" line="115"/>
<source>File to export</source>
<translation>In Datei exportieren</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="126"/>
<location filename="../qml/pages/ExportPage.qml" line="128"/>
<source>Overwrite existing</source>
<translation>Existierende überschreiben</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="132"/>
<location filename="../qml/pages/ExportPage.qml" line="134"/>
<source>Password</source>
<translation>Passwort</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="133"/>
<location filename="../qml/pages/ExportPage.qml" line="135"/>
<source>Password for the file</source>
<translation>Passwort für die Datei</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="146"/>
<location filename="../qml/pages/ExportPage.qml" line="148"/>
<source>Passwords don&apos;t match!</source>
<translation>Passwörter nicht identisch!</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="146"/>
<location filename="../qml/pages/ExportPage.qml" line="148"/>
<source>Passwords match!</source>
<translation>Passwörter identisch!</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="147"/>
<location filename="../qml/pages/ExportPage.qml" line="149"/>
<source>Repeated Password for the file</source>
<translation>Passwort wiederholen</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="171"/>
<location filename="../qml/pages/ExportPage.qml" line="173"/>
<source>Here you can Import Tokens from a file. Put in the file location and the password you used on export. Pull left to start the import.</source>
<translation>Hier können Tokens aus einer Datei importiert werden. Gib die Datei und das beim Export gewählte Passwort ein. Nach links ziehen um zu starten.</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="187"/>
<location filename="../qml/pages/ExportPage.qml" line="189"/>
<source>Here you can export Tokens to a file. The exported file will be encrypted with AES-256-CBC and Base64 encoded. Choose a strong password, the file will contain the secrets used to generate the Tokens for your accounts. Pull left to start the export.</source>
<translation>Hier können Tokens in eine Datei exportiert werden. Die Datei wird mit AES-256-CBC verschlüsselt und Base64-kodiert. Wähle ein starkes Passwort, die Datei enthält die geheimen Schlüssel zur Erzeugung der Tokens für deine Accounts. Nach links ziehen um zu starten.</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="209"/>
<location filename="../qml/pages/ExportPage.qml" line="211"/>
<source>Error writing to file </source>
<translation>Fehler beim Schreiben der Datei</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="211"/>
<location filename="../qml/pages/ExportPage.qml" line="213"/>
<source>Token Database exported to </source>
<translation>Datenbank exportiert nach </translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="214"/>
<location filename="../qml/pages/ExportPage.qml" line="216"/>
<source>Could not encrypt tokens. Error: </source>
<translation>Fehler beim Verschlüsseln. Fehler: </translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="217"/>
<location filename="../qml/pages/ExportPage.qml" line="219"/>
<source>Could not read tokens from Database</source>
<translation>Datenbank konnte nicht gelesen werden</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="228"/>
<location filename="../qml/pages/ExportPage.qml" line="230"/>
<source>Tokens imported from </source>
<translation>Tokens importiert aus </translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="233"/>
<location filename="../qml/pages/ExportPage.qml" line="235"/>
<source>Unable to decrypt file, did you use the right password?</source>
<translation>Fehler beim entschlüsseln, falsches Passwort?</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="236"/>
<location filename="../qml/pages/ExportPage.qml" line="238"/>
<source>Could not read from file </source>
<translation>Datei konnte nicht gelesen werden</translation>
</message>
@ -222,7 +237,7 @@ Lizenz: BSD (3-Klausel)</translation>
<context>
<name>MainView</name>
<message>
<location filename="../qml/pages/MainView.qml" line="104"/>
<location filename="../qml/pages/MainView.qml" line="106"/>
<source>About</source>
<translation>Über</translation>
</message>
@ -235,57 +250,57 @@ Lizenz: BSD (3-Klausel)</translation>
<translation type="vanished">Datenbank importieren</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="108"/>
<location filename="../qml/pages/MainView.qml" line="110"/>
<source>Export / Import</source>
<translation>Export / Import</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="112"/>
<location filename="../qml/pages/MainView.qml" line="114"/>
<source>Add Token</source>
<translation>Token hinzufügen</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="138"/>
<location filename="../qml/pages/MainView.qml" line="144"/>
<source>Nothing here</source>
<translation>Hier ist nichts</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="139"/>
<location filename="../qml/pages/MainView.qml" line="145"/>
<source>Pull down to add a OTP</source>
<translation>Nach unten ziehen zum hinzufügen</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="150"/>
<location filename="../qml/pages/MainView.qml" line="156"/>
<source>Deleting</source>
<translation>Lösche</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="166"/>
<location filename="../qml/pages/MainView.qml" line="172"/>
<source>Token for </source>
<translation>Token für </translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="166"/>
<location filename="../qml/pages/MainView.qml" line="172"/>
<source> copied to clipboard</source>
<translation> kopiert</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="234"/>
<location filename="../qml/pages/MainView.qml" line="240"/>
<source>Move up</source>
<translation>Nach oben</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="239"/>
<location filename="../qml/pages/MainView.qml" line="245"/>
<source>Move down</source>
<translation>Nach unten</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="244"/>
<location filename="../qml/pages/MainView.qml" line="250"/>
<source>Edit</source>
<translation>Bearbeiten</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="250"/>
<location filename="../qml/pages/MainView.qml" line="256"/>
<source>Delete</source>
<translation>Löschen</translation>
</message>
@ -293,7 +308,7 @@ Lizenz: BSD (3-Klausel)</translation>
<context>
<name>QRPage</name>
<message>
<location filename="../qml/pages/QRPage.qml" line="71"/>
<location filename="../qml/pages/QRPage.qml" line="73"/>
<source>Can&apos;t create QR-Code from incomplete settings!</source>
<translation>Ein QR-Code kann nur mit vollständigen Einstellungen erzeugt werden!</translation>
</message>
@ -301,32 +316,32 @@ Lizenz: BSD (3-Klausel)</translation>
<context>
<name>ScanOTP</name>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="52"/>
<location filename="../qml/pages/ScanOTP.qml" line="54"/>
<source>Can&apos;t access temporary directory</source>
<translation>Kein Zugriff auf temporäres Verzeichnis.</translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="62"/>
<location filename="../qml/pages/ScanOTP.qml" line="64"/>
<source>Add manually</source>
<translation>Manuell hinzufügen</translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="69"/>
<location filename="../qml/pages/ScanOTP.qml" line="71"/>
<source>Scan Code</source>
<translation>Code scannen</translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="69"/>
<location filename="../qml/pages/ScanOTP.qml" line="71"/>
<source>Scanning...</source>
<translation>scanne...</translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="95"/>
<location filename="../qml/pages/ScanOTP.qml" line="97"/>
<source>No valid Token data found.</source>
<translation>Kein gültiges Token gefunden.</translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="136"/>
<location filename="../qml/pages/ScanOTP.qml" line="138"/>
<source>Tap the picture to start / stop scanning. Pull down to add Token manually.</source>
<translation>Vorschau antippen um den Scan zu starten / zu stoppen. Nach unten ziehen um manuell hinzu zu fügen.</translation>
</message>

View file

@ -4,24 +4,34 @@
<context>
<name>About</name>
<message>
<location filename="../qml/pages/About.qml" line="65"/>
<location filename="../qml/pages/About.qml" line="68"/>
<source>A Simple Sailfish OTP Generator
(RFC 6238/4226 compatible)</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="74"/>
<location filename="../qml/pages/About.qml" line="77"/>
<source>Copyright: Stefan Brand
License: BSD (3-clause)</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="92"/>
<location filename="../qml/pages/About.qml" line="95"/>
<source>SailOTP uses the following third party libs:</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="103"/>
<location filename="../qml/pages/About.qml" line="106"/>
<source>Contributors:</source>
<translation>Contributor:</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="106"/>
<source>Support</source>
<translation>support</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="117"/>
<source>Translators:</source>
<translation>Translators:</translation>
</message>
@ -29,67 +39,72 @@ License: BSD (3-clause)</source>
<context>
<name>AddOTP</name>
<message>
<location filename="../qml/pages/AddOTP.qml" line="66"/>
<location filename="../qml/pages/AddOTP.qml" line="68"/>
<source>Show QR-Code</source>
<translation>Show QR-Code</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="69"/>
<location filename="../qml/pages/AddOTP.qml" line="71"/>
<source>Can&apos;t create QR-Code from incomplete settings!</source>
<translation>Can&apos;t create QR-Code from incomplete settings!</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="82"/>
<location filename="../qml/pages/AddOTP.qml" line="84"/>
<source>Save</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="82"/>
<location filename="../qml/pages/AddOTP.qml" line="84"/>
<source>Add</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="87"/>
<location filename="../qml/pages/AddOTP.qml" line="89"/>
<source>Type</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="89"/>
<location filename="../qml/pages/AddOTP.qml" line="91"/>
<source>Time-based (TOTP)</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="90"/>
<location filename="../qml/pages/AddOTP.qml" line="92"/>
<source>Counter-based (HOTP)</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="96"/>
<location filename="../qml/pages/AddOTP.qml" line="93"/>
<source>Steam Guard</source>
<translation>Steam Guard</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="99"/>
<source>Title</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="97"/>
<location filename="../qml/pages/AddOTP.qml" line="100"/>
<source>Title for the OTP</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="109"/>
<location filename="../qml/pages/AddOTP.qml" line="112"/>
<source>Secret (at least 16 characters)</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="111"/>
<location filename="../qml/pages/AddOTP.qml" line="114"/>
<source>Secret OTP Key</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="123"/>
<location filename="../qml/pages/AddOTP.qml" line="126"/>
<source>Next Counter Value</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="125"/>
<location filename="../qml/pages/AddOTP.qml" line="128"/>
<source>Next Value of the Counter</source>
<translation></translation>
</message>
@ -97,114 +112,114 @@ License: BSD (3-clause)</source>
<context>
<name>ExportPage</name>
<message>
<location filename="../qml/pages/ExportPage.qml" line="61"/>
<location filename="../qml/pages/ExportPage.qml" line="63"/>
<source>File already exists, choose &quot;Overwrite existing&quot; to overwrite it.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="70"/>
<location filename="../qml/pages/ExportPage.qml" line="72"/>
<source>Given file does not exist!</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="89"/>
<location filename="../qml/pages/ExportPage.qml" line="105"/>
<location filename="../qml/pages/ExportPage.qml" line="91"/>
<location filename="../qml/pages/ExportPage.qml" line="107"/>
<source>Export</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="89"/>
<location filename="../qml/pages/ExportPage.qml" line="105"/>
<location filename="../qml/pages/ExportPage.qml" line="91"/>
<location filename="../qml/pages/ExportPage.qml" line="107"/>
<source>Import</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="112"/>
<location filename="../qml/pages/ExportPage.qml" line="114"/>
<source>Filename</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="113"/>
<location filename="../qml/pages/ExportPage.qml" line="115"/>
<source>File to import</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="113"/>
<location filename="../qml/pages/ExportPage.qml" line="115"/>
<source>File to export</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="126"/>
<location filename="../qml/pages/ExportPage.qml" line="128"/>
<source>Overwrite existing</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="132"/>
<location filename="../qml/pages/ExportPage.qml" line="134"/>
<source>Password</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="133"/>
<location filename="../qml/pages/ExportPage.qml" line="135"/>
<source>Password for the file</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="146"/>
<location filename="../qml/pages/ExportPage.qml" line="148"/>
<source>Passwords don&apos;t match!</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="146"/>
<location filename="../qml/pages/ExportPage.qml" line="148"/>
<source>Passwords match!</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="147"/>
<location filename="../qml/pages/ExportPage.qml" line="149"/>
<source>Repeated Password for the file</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="171"/>
<location filename="../qml/pages/ExportPage.qml" line="173"/>
<source>Here you can Import Tokens from a file. Put in the file location and the password you used on export. Pull left to start the import.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="187"/>
<location filename="../qml/pages/ExportPage.qml" line="189"/>
<source>Here you can export Tokens to a file. The exported file will be encrypted with AES-256-CBC and Base64 encoded. Choose a strong password, the file will contain the secrets used to generate the Tokens for your accounts. Pull left to start the export.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="209"/>
<location filename="../qml/pages/ExportPage.qml" line="211"/>
<source>Error writing to file </source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="211"/>
<location filename="../qml/pages/ExportPage.qml" line="213"/>
<source>Token Database exported to </source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="214"/>
<location filename="../qml/pages/ExportPage.qml" line="216"/>
<source>Could not encrypt tokens. Error: </source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="217"/>
<location filename="../qml/pages/ExportPage.qml" line="219"/>
<source>Could not read tokens from Database</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="228"/>
<location filename="../qml/pages/ExportPage.qml" line="230"/>
<source>Tokens imported from </source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="233"/>
<location filename="../qml/pages/ExportPage.qml" line="235"/>
<source>Unable to decrypt file, did you use the right password?</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="236"/>
<location filename="../qml/pages/ExportPage.qml" line="238"/>
<source>Could not read from file </source>
<translation></translation>
</message>
@ -212,62 +227,62 @@ License: BSD (3-clause)</source>
<context>
<name>MainView</name>
<message>
<location filename="../qml/pages/MainView.qml" line="104"/>
<location filename="../qml/pages/MainView.qml" line="106"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="108"/>
<location filename="../qml/pages/MainView.qml" line="110"/>
<source>Export / Import</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="112"/>
<location filename="../qml/pages/MainView.qml" line="114"/>
<source>Add Token</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="138"/>
<location filename="../qml/pages/MainView.qml" line="144"/>
<source>Nothing here</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="139"/>
<location filename="../qml/pages/MainView.qml" line="145"/>
<source>Pull down to add a OTP</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="150"/>
<location filename="../qml/pages/MainView.qml" line="156"/>
<source>Deleting</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="166"/>
<location filename="../qml/pages/MainView.qml" line="172"/>
<source>Token for </source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="166"/>
<location filename="../qml/pages/MainView.qml" line="172"/>
<source> copied to clipboard</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="234"/>
<location filename="../qml/pages/MainView.qml" line="240"/>
<source>Move up</source>
<translation>Move up</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="239"/>
<location filename="../qml/pages/MainView.qml" line="245"/>
<source>Move down</source>
<translation>Move down</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="244"/>
<location filename="../qml/pages/MainView.qml" line="250"/>
<source>Edit</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="250"/>
<location filename="../qml/pages/MainView.qml" line="256"/>
<source>Delete</source>
<translation></translation>
</message>
@ -275,7 +290,7 @@ License: BSD (3-clause)</source>
<context>
<name>QRPage</name>
<message>
<location filename="../qml/pages/QRPage.qml" line="71"/>
<location filename="../qml/pages/QRPage.qml" line="73"/>
<source>Can&apos;t create QR-Code from incomplete settings!</source>
<translation>Can&apos;t create QR-Code from incomplete settings!</translation>
</message>
@ -283,32 +298,32 @@ License: BSD (3-clause)</source>
<context>
<name>ScanOTP</name>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="52"/>
<location filename="../qml/pages/ScanOTP.qml" line="54"/>
<source>Can&apos;t access temporary directory</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="62"/>
<location filename="../qml/pages/ScanOTP.qml" line="64"/>
<source>Add manually</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="69"/>
<location filename="../qml/pages/ScanOTP.qml" line="71"/>
<source>Scan Code</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="69"/>
<location filename="../qml/pages/ScanOTP.qml" line="71"/>
<source>Scanning...</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="95"/>
<location filename="../qml/pages/ScanOTP.qml" line="97"/>
<source>No valid Token data found.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="136"/>
<location filename="../qml/pages/ScanOTP.qml" line="138"/>
<source>Tap the picture to start / stop scanning. Pull down to add Token manually.</source>
<translation></translation>
</message>

View file

@ -4,26 +4,36 @@
<context>
<name>About</name>
<message>
<location filename="../qml/pages/About.qml" line="65"/>
<location filename="../qml/pages/About.qml" line="68"/>
<source>A Simple Sailfish OTP Generator
(RFC 6238/4226 compatible)</source>
<translation>En enkel Sailfish OTP-generator
(RFC 6238/4226-kompatibel)</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="74"/>
<location filename="../qml/pages/About.qml" line="77"/>
<source>Copyright: Stefan Brand
License: BSD (3-clause)</source>
<translation>Copyright: Stefan Brand
Licens: BSD (3-clause)</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="92"/>
<location filename="../qml/pages/About.qml" line="95"/>
<source>SailOTP uses the following third party libs:</source>
<translation>SailOTP använder följande tredjeparts bibliotek:</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="103"/>
<location filename="../qml/pages/About.qml" line="106"/>
<source>Contributors:</source>
<translation>Medarbetare:</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="106"/>
<source>Support</source>
<translation>försörjning</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="117"/>
<source>Translators:</source>
<translation>Översättare:</translation>
</message>
@ -31,67 +41,72 @@ Licens: BSD (3-clause)</translation>
<context>
<name>AddOTP</name>
<message>
<location filename="../qml/pages/AddOTP.qml" line="66"/>
<location filename="../qml/pages/AddOTP.qml" line="68"/>
<source>Show QR-Code</source>
<translation>Visa QR-kod</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="69"/>
<location filename="../qml/pages/AddOTP.qml" line="71"/>
<source>Can&apos;t create QR-Code from incomplete settings!</source>
<translation>Kan inte skapa QR-kod från ofullständiga inställningar!</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="82"/>
<location filename="../qml/pages/AddOTP.qml" line="84"/>
<source>Save</source>
<translation>Spara</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="82"/>
<location filename="../qml/pages/AddOTP.qml" line="84"/>
<source>Add</source>
<translation>Lägg till</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="87"/>
<location filename="../qml/pages/AddOTP.qml" line="89"/>
<source>Type</source>
<translation>Typ</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="89"/>
<location filename="../qml/pages/AddOTP.qml" line="91"/>
<source>Time-based (TOTP)</source>
<translation>Tidsbaserad (TOTP)</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="90"/>
<location filename="../qml/pages/AddOTP.qml" line="92"/>
<source>Counter-based (HOTP)</source>
<translation>Räknarbaserad (HOTP)</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="96"/>
<location filename="../qml/pages/AddOTP.qml" line="93"/>
<source>Steam Guard</source>
<translation>Steam Guard</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="99"/>
<source>Title</source>
<translation>Namn</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="97"/>
<location filename="../qml/pages/AddOTP.qml" line="100"/>
<source>Title for the OTP</source>
<translation>Namn OTP:n</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="109"/>
<location filename="../qml/pages/AddOTP.qml" line="112"/>
<source>Secret (at least 16 characters)</source>
<translation>Hemlighet (Minst 16 tecken)</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="111"/>
<location filename="../qml/pages/AddOTP.qml" line="114"/>
<source>Secret OTP Key</source>
<translation>Hemlig OTP-nyckel</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="123"/>
<location filename="../qml/pages/AddOTP.qml" line="126"/>
<source>Next Counter Value</source>
<translation>Nästa räknarvärde</translation>
</message>
<message>
<location filename="../qml/pages/AddOTP.qml" line="125"/>
<location filename="../qml/pages/AddOTP.qml" line="128"/>
<source>Next Value of the Counter</source>
<translation>Nästa värde räknaren</translation>
</message>
@ -99,114 +114,114 @@ Licens: BSD (3-clause)</translation>
<context>
<name>ExportPage</name>
<message>
<location filename="../qml/pages/ExportPage.qml" line="61"/>
<location filename="../qml/pages/ExportPage.qml" line="63"/>
<source>File already exists, choose &quot;Overwrite existing&quot; to overwrite it.</source>
<translation>Filen finns redan. Välj &quot;Skriv över befintlig&quot; för att skriva över den.</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="70"/>
<location filename="../qml/pages/ExportPage.qml" line="72"/>
<source>Given file does not exist!</source>
<translation>Angiven fil finns inte!</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="89"/>
<location filename="../qml/pages/ExportPage.qml" line="105"/>
<location filename="../qml/pages/ExportPage.qml" line="91"/>
<location filename="../qml/pages/ExportPage.qml" line="107"/>
<source>Export</source>
<translation>Exportera</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="89"/>
<location filename="../qml/pages/ExportPage.qml" line="105"/>
<location filename="../qml/pages/ExportPage.qml" line="91"/>
<location filename="../qml/pages/ExportPage.qml" line="107"/>
<source>Import</source>
<translation>Importera</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="112"/>
<location filename="../qml/pages/ExportPage.qml" line="114"/>
<source>Filename</source>
<translation>Filnamn</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="113"/>
<location filename="../qml/pages/ExportPage.qml" line="115"/>
<source>File to import</source>
<translation>Fil att importera</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="113"/>
<location filename="../qml/pages/ExportPage.qml" line="115"/>
<source>File to export</source>
<translation>Fil att exportera</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="126"/>
<location filename="../qml/pages/ExportPage.qml" line="128"/>
<source>Overwrite existing</source>
<translation>Skriv över befintlig</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="132"/>
<location filename="../qml/pages/ExportPage.qml" line="134"/>
<source>Password</source>
<translation>Lösenord</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="133"/>
<location filename="../qml/pages/ExportPage.qml" line="135"/>
<source>Password for the file</source>
<translation>Lösenord för filen</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="146"/>
<location filename="../qml/pages/ExportPage.qml" line="148"/>
<source>Passwords don&apos;t match!</source>
<translation>Lösenorden stämmer inte!</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="146"/>
<location filename="../qml/pages/ExportPage.qml" line="148"/>
<source>Passwords match!</source>
<translation>Lösenorden stämmer!</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="147"/>
<location filename="../qml/pages/ExportPage.qml" line="149"/>
<source>Repeated Password for the file</source>
<translation>Upprepat lösenord för filen</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="171"/>
<location filename="../qml/pages/ExportPage.qml" line="173"/>
<source>Here you can Import Tokens from a file. Put in the file location and the password you used on export. Pull left to start the import.</source>
<translation>Här kan du importera Token från en fil. Ange filens sökväg och lösenordet du angav vid exporten. Svep åt vänster för att starta importen.</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="187"/>
<location filename="../qml/pages/ExportPage.qml" line="189"/>
<source>Here you can export Tokens to a file. The exported file will be encrypted with AES-256-CBC and Base64 encoded. Choose a strong password, the file will contain the secrets used to generate the Tokens for your accounts. Pull left to start the export.</source>
<translation>Här kan du exportera Token till en fil. Den exporterade filen kommer att krypteras med AES-256-CBC och Base64. Välj ett starkt lösenord, filen kommer att innehålla hemligheterna som användes för att generera Token för ditt konto. Svep åt vänster för att starta exporten.</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="209"/>
<location filename="../qml/pages/ExportPage.qml" line="211"/>
<source>Error writing to file </source>
<translation>Fel vid skrivning till fil </translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="211"/>
<location filename="../qml/pages/ExportPage.qml" line="213"/>
<source>Token Database exported to </source>
<translation>Token-databas exporterad till </translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="214"/>
<location filename="../qml/pages/ExportPage.qml" line="216"/>
<source>Could not encrypt tokens. Error: </source>
<translation>Kunde inte kryptera token. Fel: </translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="217"/>
<location filename="../qml/pages/ExportPage.qml" line="219"/>
<source>Could not read tokens from Database</source>
<translation>Kunde inte läsa in token från databasen</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="228"/>
<location filename="../qml/pages/ExportPage.qml" line="230"/>
<source>Tokens imported from </source>
<translation>Token importerad från </translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="233"/>
<location filename="../qml/pages/ExportPage.qml" line="235"/>
<source>Unable to decrypt file, did you use the right password?</source>
<translation>Kunde inte dekryptera filen. Angav du rätt lösenord?</translation>
</message>
<message>
<location filename="../qml/pages/ExportPage.qml" line="236"/>
<location filename="../qml/pages/ExportPage.qml" line="238"/>
<source>Could not read from file </source>
<translation>Kunde inte läsa från fil </translation>
</message>
@ -214,62 +229,62 @@ Licens: BSD (3-clause)</translation>
<context>
<name>MainView</name>
<message>
<location filename="../qml/pages/MainView.qml" line="104"/>
<location filename="../qml/pages/MainView.qml" line="106"/>
<source>About</source>
<translation>Om</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="108"/>
<location filename="../qml/pages/MainView.qml" line="110"/>
<source>Export / Import</source>
<translation>Export / Import</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="112"/>
<location filename="../qml/pages/MainView.qml" line="114"/>
<source>Add Token</source>
<translation>Lägg till Token</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="138"/>
<location filename="../qml/pages/MainView.qml" line="144"/>
<source>Nothing here</source>
<translation>Inget här</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="139"/>
<location filename="../qml/pages/MainView.qml" line="145"/>
<source>Pull down to add a OTP</source>
<translation>Dra neråt för att lägga till en OTP</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="150"/>
<location filename="../qml/pages/MainView.qml" line="156"/>
<source>Deleting</source>
<translation>Tar bort</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="166"/>
<location filename="../qml/pages/MainView.qml" line="172"/>
<source>Token for </source>
<translation>Token för </translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="166"/>
<location filename="../qml/pages/MainView.qml" line="172"/>
<source> copied to clipboard</source>
<translation>kopierad till urklipp</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="234"/>
<location filename="../qml/pages/MainView.qml" line="240"/>
<source>Move up</source>
<translation>Flytta upp</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="239"/>
<location filename="../qml/pages/MainView.qml" line="245"/>
<source>Move down</source>
<translation>Flytta ner</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="244"/>
<location filename="../qml/pages/MainView.qml" line="250"/>
<source>Edit</source>
<translation>Redigera</translation>
</message>
<message>
<location filename="../qml/pages/MainView.qml" line="250"/>
<location filename="../qml/pages/MainView.qml" line="256"/>
<source>Delete</source>
<translation>Ta bort</translation>
</message>
@ -277,7 +292,7 @@ Licens: BSD (3-clause)</translation>
<context>
<name>QRPage</name>
<message>
<location filename="../qml/pages/QRPage.qml" line="71"/>
<location filename="../qml/pages/QRPage.qml" line="73"/>
<source>Can&apos;t create QR-Code from incomplete settings!</source>
<translation>Kan inte skapa QR-kod från ofullständiga inställningar!</translation>
</message>
@ -285,32 +300,32 @@ Licens: BSD (3-clause)</translation>
<context>
<name>ScanOTP</name>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="52"/>
<location filename="../qml/pages/ScanOTP.qml" line="54"/>
<source>Can&apos;t access temporary directory</source>
<translation>Kan inte komma åt temp-mapp</translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="62"/>
<location filename="../qml/pages/ScanOTP.qml" line="64"/>
<source>Add manually</source>
<translation>Lägg till manuellt</translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="69"/>
<location filename="../qml/pages/ScanOTP.qml" line="71"/>
<source>Scan Code</source>
<translation>Skanna kod</translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="69"/>
<location filename="../qml/pages/ScanOTP.qml" line="71"/>
<source>Scanning...</source>
<translation>Skannar...</translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="95"/>
<location filename="../qml/pages/ScanOTP.qml" line="97"/>
<source>No valid Token data found.</source>
<translation>Ingen giltig Token-data hittades.</translation>
</message>
<message>
<location filename="../qml/pages/ScanOTP.qml" line="136"/>
<location filename="../qml/pages/ScanOTP.qml" line="138"/>
<source>Tap the picture to start / stop scanning. Pull down to add Token manually.</source>
<translation>Tryck bilden för att starta / stoppa skanning. Dra neråt för att lägga till Token manuellt.</translation>
</message>

View file

@ -43,7 +43,7 @@ CoverBackground {
var curDate = new Date();
if (lOTP.text == "------" || curDate.getSeconds() == 30 || curDate.getSeconds() == 0 || (curDate.getTime() - lastUpdated > 2000)) {
appWin.coverOTP = OTP.calcOTP(appWin.coverSecret, "TOTP", 0);
appWin.coverOTP = OTP.calcOTP(appWin.coverSecret, appWin.coverType, 0);
}
// Change color of the OTP to red if less than 5 seconds left
@ -59,7 +59,7 @@ CoverBackground {
Timer {
interval: 1000
// Timer runs only when cover is visible and favourite is set
running: !Qt.application.active && appWin.coverSecret != "" && appWin.coverType == "TOTP"
running: !Qt.application.active && appWin.coverSecret != "" && (appWin.coverType == "TOTP" || appWin.coverType == "TOTP_STEAM")
repeat: true
onTriggered: updateOTP();
}
@ -107,7 +107,7 @@ CoverBackground {
if (index < 0) index = appWin.listModel.count - 1
appWin.setCover(index);
DB.setFav(appWin.coverTitle, appWin.coverSecret)
if (appWin.coverType == "TOTP") updateOTP();
if (appWin.coverType == "TOTP" || appWin.coverType == "TOTP_STEAM") updateOTP();
}
}
}
@ -118,7 +118,7 @@ CoverBackground {
if (index >= appWin.listModel.count) index = 0
appWin.setCover(index);
DB.setFav(appWin.coverTitle, appWin.coverSecret)
if (appWin.coverType == "TOTP") updateOTP();
if (appWin.coverType == "TOTP" || appWin.coverType == "TOTP_STEAM") updateOTP();
}
}
}

View file

@ -63,6 +63,11 @@ function leftpad(str, len, pad) {
return str;
}
// characters steam uses to generate the final code
var steamChars = ['2', '3', '4', '5', '6', '7', '8', '9', 'B', 'C',
'D', 'F', 'G', 'H', 'J', 'K', 'M', 'N', 'P', 'Q',
'R', 'T', 'V', 'W', 'X', 'Y']
// *** Main Function *** //
// Calculate an OTP-Value from the given secret
@ -75,7 +80,7 @@ function calcOTP(secret, type, counter) {
var key = base32tohex(secret);
var factor = "";
if (type == "TOTP") {
if (type.substr(0, 4) == "TOTP") {
// Get current Time in UNIX Timestamp format (Seconds since 01.01.1970 00:00 UTC)
var epoch = Math.round(new Date().getTime() / 1000.0);
// Get last full 30 / 60 Seconds and convert to HEX
@ -92,8 +97,19 @@ function calcOTP(secret, type, counter) {
// Finally convert the HMAC-Value to the corresponding 6-digit token
var offset = hex2dec(hmac.substring(hmac.length - 1));
var otp = (hex2dec(hmac.substr(offset * 2, 8)) & hex2dec('7fffffff')) + '';
otp = (otp).substr(otp.length - 6, 6);
var code = hex2dec(hmac.substr(offset * 2, 8)) & hex2dec('7fffffff');
var otp = '';
// Steam has it's own way of creating the code from the result
if (type == "TOTP_STEAM") {
for (var i = 0; i < 5; i++) {
otp += steamChars[code % steamChars.length];
code = Math.floor(code/steamChars.length);
}
} else {
otp = code + '';
otp = (otp).substr(otp.length - 6, 6);
}
} catch (e) {
otp = "Invalid Secret!"
}

View file

@ -200,13 +200,10 @@ function changeOTP(title, secret, type, counter, oldtitle, oldsecret) {
db.transaction(
function(tx) {
if (checkOTP(title, secret)) {
console.log("Token " + title + " is already in DB");
} else {
tx.executeSql("UPDATE OTPStorage SET title=?, secret=?, type=?, counter=? WHERE title=? and secret=?;", [title, secret, type, counter, oldtitle, oldsecret]);
console.log("Token " + title + " modified.");
}
});
);
}
function changeOTPSort(title, secret, sort) {

View file

@ -33,6 +33,9 @@ import Sailfish.Silica 1.0
// Define the Layout of the About Page
Page {
id: aboutPage
allowedOrientations: Orientation.All
SilicaFlickable {
id: flickable
anchors.fill: parent
@ -93,6 +96,17 @@ Page {
color: "white"
}
TextArea {
id: contributors
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
font.pixelSize: Theme.fontSizeSmall
horizontalAlignment: TextEdit.Center
readOnly: true
text: qsTr("Contributors:")+"\n\nRobin Appelman: SteamGuard "+qsTr("Support")
color: "white"
}
TextArea {
id: translators
anchors.horizontalCenter: parent.horizontalCenter

View file

@ -36,6 +36,8 @@ import "../lib/storage.js" as DB // Import the storage library for Config-Access
Dialog {
id: addOTP
allowedOrientations: Orientation.All
// We get the Object of the parent page on call to refresh it after adding a new Entry
property QtObject parentPage: null
@ -65,7 +67,7 @@ Dialog {
MenuItem {
text: qsTr("Show QR-Code")
onClicked: {
if ((paramType == "TOTP" && (otpLabel.text == "" || otpSecret.text == "")) || (paramType == "HOTP" && (otpLabel.text == "" || otpSecret.text == "" || otpCounter.text <= 0))) {
if (((paramType == "TOTP" || paramType == "TOTP_STEAM") && (otpLabel.text == "" || otpSecret.text == "")) || (paramType == "HOTP" && (otpLabel.text == "" || otpSecret.text == "" || otpCounter.text <= 0))) {
notify.show(qsTr("Can't create QR-Code from incomplete settings!"), 4000);
} else {
pageStack.push(Qt.resolvedUrl("QRPage.qml"), {paramLabel: otpLabel.text, paramKey: otpSecret.text, paramType: paramType, paramCounter: otpCounter.text});
@ -88,6 +90,7 @@ Dialog {
menu: ContextMenu {
MenuItem { text: qsTr("Time-based (TOTP)"); onClicked: { paramType = "TOTP" } }
MenuItem { text: qsTr("Counter-based (HOTP)"); onClicked: { paramType = "HOTP" } }
MenuItem { text: qsTr("Steam Guard"); onClicked: { paramType = "TOTP_STEAM" } }
}
}
TextField {
@ -113,8 +116,8 @@ Dialog {
horizontalAlignment: TextInput.AlignLeft
EnterKey.enabled: text.length > 15
EnterKey.iconSource: paramType == "TOTP" ? "image://theme/icon-m-enter-accept" : "image://theme/icon-m-enter-next"
EnterKey.onClicked: paramType == "TOTP" ? addOTP.accept() : otpCounter.focus = true
EnterKey.iconSource: paramType == "HOTP" ? "image://theme/icon-m-enter-next" : "image://theme/icon-m-enter-accept"
EnterKey.onClicked: paramType == "HOTP" ? otpCounter.focus = true : addOTP.accept()
}
TextField {
id: otpCounter
@ -135,7 +138,7 @@ Dialog {
}
// Check if we can Save
canAccept: otpLabel.text.length > 0 && otpSecret.text.length >= 16 && (paramType == "TOTP" || otpCounter.text.length > 0) ? true : false
canAccept: otpLabel.text.length > 0 && otpSecret.text.length >= 16 && (paramType == "TOTP" || paramType == "TOTP_STEAM" || otpCounter.text.length > 0) ? true : false
// Save if page is Left with Add
onDone: {

View file

@ -38,6 +38,8 @@ import "../lib/gibberish-aes.js" as Gibberish //Import AES encryption library
Dialog {
id: exportPage
allowedOrientations: Orientation.All
// We get the Object of the parent page on call to refresh it after adding a new Entry
property QtObject parentPage: null
property string mode: "import"

View file

@ -36,6 +36,8 @@ import "../lib/crypto.js" as OTP
Page {
id: mainPage
allowedOrientations: Orientation.All
// This holds the time of the last update of the page as Unix Timestamp (in Milliseconds)
property double lastUpdated: 0
@ -70,10 +72,10 @@ Page {
// Iterate over all List entries
for (var i=0; i<appWin.listModel.count; i++) {
if (appWin.listModel.get(i).type == "TOTP") {
if (appWin.listModel.get(i).type == "TOTP" || appWin.listModel.get(i).type == "TOTP_STEAM" ) {
// Only update on full 30 / 60 Seconds or if last run of the Functions is more than 2s in the past (e.g. app was in background)
if (appWin.listModel.get(i).otp == "------" || seconds == 30 || seconds == 0 || (curDate.getTime() - lastUpdated > 2000)) {
var curOTP = OTP.calcOTP(appWin.listModel.get(i).secret, "TOTP")
var curOTP = OTP.calcOTP(appWin.listModel.get(i).secret, appWin.listModel.get(i).type)
appWin.listModel.setProperty(i, "otp", curOTP);
}
} else if (appWin.coverType == "HOTP" && (curDate.getTime() - lastUpdated > 2000) && appWin.listModel.get(i).fav == 1) {
@ -119,16 +121,20 @@ Page {
width: parent.width
maximumValue: 29
anchors.top: parent.top
anchors.topMargin: 48
anchors.topMargin: 36 * Theme.pixelRatio
// Only show when there are enries
visible: appWin.listModel.count
}
SilicaListView {
id: otpList
header: PageHeader {
title: "SailOTP"
}
anchors.fill: parent
model: appWin.listModel
width: parent.width

View file

@ -33,6 +33,8 @@ import Sailfish.Silica 1.0
Page {
id: qrpage
allowedOrientations: Orientation.All
property string paramType: ""
property string paramLabel: ""
property string paramKey: ""

View file

@ -37,6 +37,8 @@ import "../lib/urldecoder.js" as URL
Page {
id: scanPage
allowedOrientations: Orientation.All
property QtObject parentPage: null
property bool scanning: false

View file

@ -1,3 +1,6 @@
* Sun Dec 06 2015 Stefan Brand <sailfish@seiichiro0185.org> 1.3-1
- Added SteamGuard OTP Type (Thanks to Robin Appelman)
* Sat May 30 2015 Stefan Brand <sailfish@seiichiro0185.org> 1.2-1
- Added Swedish translation (Thanks to Åke Engelbrektson)

View file

@ -1,6 +1,6 @@
Name: harbour-sailotp
Summary: SailOTP
Version: 1.2
Version: 1.3
Release: 1
Group: Security
URL: https://github.com/seiichiro0185/sailotp/