diff --git a/README.md b/README.md index 470b0d05c65f6d75ae650d7302577dcec8bf203a..656e8bc829c13604d8d289b3eb554553daa9f5a3 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,9 @@ augustctl A node.js module to operate an [August Smart Lock](http://www.august.com/), via BLE. -Prerequisties -============= +**This is not developed or officially support by August, it works for me but use at your own risk!** + +## Prerequisties Same as for [noble](https://github.com/sandeepmistry/noble). @@ -12,29 +13,51 @@ On Linux, you will need [bluez 5](http://www.bluez.org/). Also tested and working on OSX Yosemite. -Install -======= +## Install npm install augustctl -Configuration -============= +## Configuration + +It's necessary to have an `offlineKey` and corresponding `offlineKeyOffset` that are recognized by your lock. These can be sourced from an Android phone that is already associated with the lock. + +On an iPhone, these items are most likely stored in the Keychain, so presumably on a jailbroken phone they can be accessed but it's not currently known how. + +### All Phones + +It's a little more typing, but on a non-rooted phone, you can open the official app and go to the keychain view (the list of all your "houses"), click on the gear to access the settings, and long click on the application version to access the debug setttings. As of v1.0.4.1, the password for the debug menu is `KryspyKym`. In the debug settings display, you should see a JSON object with the offlineKey and offlineKeyOffset. + +Place these in a file named `config.json`, which should look something like this: + + { "offlineKey": "0123456789abcdef0123456789abcdef", "offlineKeyOffset": 1 } -It's necessary to have an `offlineKey` and corresponding `offlineKeyOffset` that are recognized by your lock. These can be sourced from an Android phone that is already associated with the lock. The phone needs to be rooted. +Be careful when transcribing the key - one small error and it will not work. -You'll need to copy the `/data/data/com.august.app/shared_prefs/LockSettingsPreferences.xml` file from your phone to your computer. Many file manager apps, or an adb shell, will let you access it, as long as your phone is rooted. +Note: You can also enable Auto-Unlock for Android in the debug menu! -Run this file through the [tools/decrypt_preferences.js](tools/decrypt_preferences.js) script to extract the necessary key. +### Rooted Phone - mkdir $HOME/.config - node tools/decrypt_preferences.js LockSettingsPreferences.xml > $HOME/.config/augustctl.json +If the phone is rooted, you can copy the `/data/data/com.august.app/shared_prefs/LockSettingsPreferences.xml` file from your phone to your computer. Many file manager apps, or an adb shell, will let you access it, as long as your phone is rooted. -The decrypted JSON object itself works fine as a configuration file, as long as you only have one lock. +Run this file through the [tools/decrypt_preferences.js](tools/decrypt_preferences.js) script to view the JSON representation of the preferences. The script output can be used directly as your configuration file. -Usage -===== + node tools/decrypt_preferences.js LockSettingsPreferences.xml > config.json -Assuming you've extracted your offline key and offset into a configuration file, as above, just: +The configuration file location can be explicitly set via the AUGUSTCTL_CONFIG environment variable. + +## Usage + +Assuming you've configured your offline key and offset, as above, just: augustctl unlock augustctl lock + +That's it! + +Alternatively, a simple HTTP API server is available. From a checked out installation: + + npm start + +## License + +[MIT](LICENSE)