Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@ For a list of all changes please click [here](CHANGELOG.md).
- Fitbit example project [sdk-bart](https://github.com/Fitbit/sdk-bart)
- Settings file transfer code from [fitbit-file-transfer-settings](https://github.com/KiezelPay/fitbit-file-transfer-settings)

# Setup

To build this for the old Versa 2, you first need to:

- `npx create-fitbit-app tmp --sdk-version 4.3.0`
- `cp tmp/node_modules fitbit-authenticator`
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cp -a actually

- `cd fitbit-authenticator && npx fitbit`
- `build-and-install`

More details: [FitBit SDK Getting Started](https://dev.fitbit.com/getting-started/)
5 changes: 3 additions & 2 deletions app/tokens.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fs from "fs";
import fs from "fs";
import {FILE_NAME} from "../common/globals.js";
import {base32ToUint8Array} from "../common/util.js";

Expand All @@ -18,6 +18,7 @@ export function AuthToken() {
AuthToken.prototype.convertTokensToUint8Array = function() {
let changed = false;
for (let i in this.file.data) {
if (typeof this.file.data[i] == "undefined") continue;
if (typeof this.file.data[i]["token"] == "string") {
this.file.data[i]["token"] = base32ToUint8Array(this.file.data[i]["token"]);
changed = true;
Expand Down Expand Up @@ -77,4 +78,4 @@ AuthToken.prototype.deleteToken = function(tokenNames) {

AuthToken.prototype.reloadTokens = function() {
return this.file;
}
}
4 changes: 2 additions & 2 deletions common/globals.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const TOKEN_LIST = "token_list"; //displayed in settings
export const FILE_NAME = "tokens.json"; //internal token storage
export const FILE_NAME = "tokens.cbor"; //internal token storage
export const TOKEN_SECRETS = "token_secrets"; //stored internally (old)
export const TOKEN_NUM = 10;

Expand Down Expand Up @@ -33,4 +33,4 @@ export const FONTS = [
{name: "Colfax-Regular"},
{name: "Fabrikat-Bold"},
{name: "Seville-Condensed"}
]
]
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"buildTargets": [
"meson",
"higgs",
"gemini"
"gemini",
"mira"
],
"i18n": {
"en": {
Expand Down