Skip to content

Commit

Permalink
fixed readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Owais Shaikh committed May 19, 2021
1 parent 4baa091 commit 66f56d4
Show file tree
Hide file tree
Showing 23 changed files with 702 additions and 645 deletions.
92 changes: 67 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,67 @@
[![Wear OS](https://img.shields.io/badge/Made%20for-WearOS-4285f4.svg?style=flat&logo=wear%20os)](https://wearos.google.com/)
[![Wear OS](https://img.shields.io/badge/Made%20for-WearOS-4285f4.svg?style=flat&logo=wear%20os)](https://wearos.google.com)
[![License](https://img.shields.io/badge/License-MIT-purple)](LICENSE)
[![Maintenance](https://img.shields.io/badge/Maintained-Yes-green.svg)](https://gitlab.com/ThomasCat/wristkey/activity)
[![Version](https://img.shields.io/badge/Version-1.2-orange.svg)](https://gitlab.com/ThomasCat/wristkey/-/releases)
[![Kotlin](https://img.shields.io/badge/Made%20with-Kotlin-7f52ff.svg)](https://kotlinlang.org/)
[![Maintenance](https://img.shields.io/badge/Maintained-Yes-green.svg)](https://gitlab.com/ThomasCat/wristkey/activity)
[![Tag](https://img.shields.io/github/v/tag/4f77616973/Wristkey?label=Version)](https://gitlab.com/ThomasCat/wristkey/tags)
[![Download APK](https://img.shields.io/badge/Download%20APK-Click%20Here!-blue)](app/release/app-release.apk)

# Wristkey

Wristkey is a sideloadable / standalone two-factor authentication application for Wear OS. I made this app as a fun project (and because the LG G Watch (W100) I wear doesn't support internet access when paired with iOS).
Wristkey is a sideloadable / standalone two-factor authentication application for Wear OS. I made this app as a fun project (and because the LG G Watch W100 I wear doesn't support internet access when paired with iOS).

[Get the latest release APK here](app/release/app-release.apk)

<img src = screenshots/home.png alt="screenshot">
<img src = screenshots/settings.png alt="screenshot">

## Importing
## Adding items

Wristkey supports both Bitwarden and Google Authenticator importing for ease-of-use, though the procedures differ slightly for each. For Bitwarden, a JSON file is parsed and the ```totp``` field is extracted from each login. For Google Authenticator, a QR code image file is scanned, the base64 string in it is converted from Google's protobuf format and the ```secret``` field is extracted from ```OtpParameters```.

<img src = screenshots/settings2.png alt="screenshot">
<img src = screenshots/addscreen.png alt="screenshot">

### Transferring data

### Enable ADB Debugging
#### Via phone

1. Enable ADB Debugging by going to Settings → System → About and tapping 'Build Number' 7 times.
If your watch is paired to an Android phone, you can use a third-party Wear OS file manager like [Nav Explorer](https://play.google.com/store/apps/details?id=com.turndapage.navexplorer) to transfer your PNG / JSON files from your phone's storage to your watch.

#### Via ADB

1. Enable ADB Debugging on your watch by going to Settings → System → About and tapping 'Build Number' 7 times.

2. Go back and tap on Developer Settings, then scroll down and enable "ADB Debugging".

3. Connect your watch to your computer. If prompted on watch, tap 'Always allow from this computer'.
3. Make sure Wristkey has storage permissions. On your watch, go to Settings → Apps & notifications → App info → Wristkey → Permissions and enable 'Storage'.

4. Make sure Wristkey has storage permissions. On your watch, go to Settings → Apps & notifications → App info → Wristkey → Permissions and enable 'Storage'.
##### ADB over USB

### Bitwarden import
1. Connect your watch to your computer via USB. When prompted on watch, tap 'Always allow from this computer'.

<img src = screenshots/bitwardenimport.png alt="screenshot">
##### ADB over Bluetooth

1. Download your Bitwarden Vault in an unencrypted JSON format from the Bitwarden Desktop website.
1. Enable Bluetooth Debugging on your watch by going to Settings → System → About and tapping 'Build Number' 7 times.

2. Open a terminal on your computer and place this JSON file on the main directory of your watch (/sdcard/) via the following command
2. Now on your Android phone / tablet, open the Wear OS app and tap the top right mennu button and tap on 'Settings'.

```adb push <bitwarden json filename> /sdcard/```
3. Enable 'Debugging over Bluetooth'. You’ll should see

3. On your watch, open Wristkey, tap the settings icon '⚙️', then scroll down and tap *Import from Bitwarden*.
```
Host: disconnected
Target: connected
```
4. After your accounts are imported, delete the JSON file from your watch via the following commands
4. Connect your Android phone / tablet to your computer via USB. Then open a new terminal and run the following commands
```
adb shell
cd /sdcard/
rm <bitwarden filename>.json
exit
adb forward tcp:4444 localabstract:/adb-hub
adb connect localhost:4444
```
5. On your phone, the Wear OS app should display
```
Host: connected
Target: connected
```
### Google Authenticator import
Expand Down Expand Up @@ -78,7 +91,28 @@ Wristkey supports both Bitwarden and Google Authenticator importing for ease-of-
exit
```
## Manual entry
### Bitwarden import
<img src = screenshots/bitwardenimport.png alt="screenshot">
1. Download your Bitwarden Vault in an unencrypted JSON format from the Bitwarden Desktop website.
2. Open a terminal on your computer and place this JSON file on the main directory of your watch (/sdcard/) via the following command
```adb push <bitwarden json filename> /sdcard/```
3. On your watch, open Wristkey, tap the settings icon '⚙️', then scroll down and tap *Import from Bitwarden*.
4. After your accounts are imported, delete the JSON file from your watch via the following commands
```
adb shell
cd /sdcard/
rm <bitwarden filename>.json
exit
```
### Manual entry
1. Tap the '+' button to manually add a login. The default settings are for Google Authenticator codes (SHA-1, 6 digits, time-based).
Expand All @@ -87,7 +121,7 @@ Wristkey supports both Bitwarden and Google Authenticator importing for ease-of-
<img src = screenshots/add.png alt="screenshot">
<img src = screenshots/add2.png alt="screenshot">
### Generate QR Code
## Generate QR Code
To transfer a code from your watch to the Authenticator app on your phone, just press and hold the 2FA code number on your watch. You can then scan the QR code that is displayed on your watch screen.
Expand All @@ -114,7 +148,11 @@ To prevent data extraction, snooping and theft, make sure you delete the JSON an
### In-app storage
All sensitive data on Wristkey (including the secrets to generate OTPs) is encrypted with 256-bit AES-GCM encryption, with the keys coming from your watch's Keystore. No backdoor on my end. ;)
All sensitive data (including secrets to generate OTPs) is stored encrypted [using 256-bit AES encryption](https://developer.android.com/reference/androidx/security/crypto/EncryptedSharedPreferences), with the decryption key [stored locally](https://developer.android.com/training/articles/keystore) on your watch. No backdoor on my end. ;)
### Privacy
Wristkey can be set to unlock after entering your watch's password / PIN / Pattern. To enable screen locking for the app, go to your watch's Settings → Personalization → Screen Lock and set a PIN / Pattern / Password. Wristkey doesn't use Wear OS's Ambient Mode to prevent bystanders from peeking at your 2FA codes and enhance privacy.
## Acknowledgements
Expand All @@ -134,6 +172,10 @@ Please star and support the developers below for their hard work.
[Aegis (for the ```.protobuf``` file that made Google Authenticator imports possible)](https://github.com/beemdevelopment/Aegis/blob/master/app/src/main/proto/google_auth.proto)
### License
[Roland Kurmann - extract_otp_secret_keys (to extract Google Authenticator data)](https://github.com/scito/extract_otp_secret_keys)
[Chaquo Ltd - Chaquopy (to run Python to decode protobuf3 data)](https://github.com/chaquo/chaquopy)
## License
[Copyright (c) 2021 Owais Shaikh](LICENSE)
16 changes: 15 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.chaquo.python'
}

apply plugin: 'com.android.application'
apply plugin: 'com.chaquo.python'

android {
compileSdkVersion 29
buildToolsVersion "30.0.3"
Expand All @@ -14,6 +18,17 @@ android {
versionCode 1
versionName "1.2"

ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}

python {
pip {
// A pip requirement specifier, with or without a version number:
install "protobuf"
}
}

}

buildTypes {
Expand Down Expand Up @@ -58,7 +73,6 @@ dependencies {
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidmads.library.qrgenearator:QRGenearator:1.0.3'
implementation 'com.google.protobuf:protobuf-java:3.10.0'
implementation 'com.google.zxing:core:3.3.3'
compileOnly 'com.google.android.wearable:wearable:2.8.1'
implementation "androidx.security:security-crypto:1.1.0-alpha03"
Expand Down
Binary file modified app/build/outputs/apk/debug/app-debug.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/build/outputs/apk/debug/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.owais.wristkey",
"applicationId": "com.wristkey",
"variantName": "debug",
"elements": [
{
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.owais.wristkey",
"applicationId": "com.wristkey",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 1,
"versionName": "1.1",
"versionName": "1.2",
"outputFile": "app-release.apk"
}
]
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />

<application
android:allowBackup="false"
Expand All @@ -32,6 +33,7 @@
<activity
android:name=".BitwardenJSONImport"
android:label="@string/title_activity_bitwarden_jsonimport" />

<activity
android:name=".MainActivity"
android:label="@string/app_name">
Expand All @@ -47,6 +49,10 @@
<activity
android:name=".AddActivity"
android:label="Add account" />

<activity
android:name=".ManualEntryActivity"
android:label="Add account" />
<activity
android:name=".AboutActivity"
android:label="About" />
Expand Down
Loading

0 comments on commit 66f56d4

Please sign in to comment.