Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarmer08 committed Nov 2, 2023
1 parent 8cb0c13 commit bd122ab
Show file tree
Hide file tree
Showing 6 changed files with 324 additions and 320 deletions.
39 changes: 20 additions & 19 deletions src/constants.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
module.exports = Object.freeze({
// Crypto Secrets
fordAppKey : '275965684684dbdaf29a0ed9', // Required for Locks
fordAppSecret : '4deekof1ba311c5c33a9cb8e12787e8c', // Required for Locks
oliveSigningSecret : 'wyze_app_secret_key_132', // Required for the thermostat
oliveAppId : '9319141212m2ik', // Required for the thermostat
appInfo : 'wyze_android_2.19.14', // Required for the thermostat
// Crypto Secrets
fordAppKey: "275965684684dbdaf29a0ed9", // Required for Locks
fordAppSecret: "4deekof1ba311c5c33a9cb8e12787e8c", // Required for Locks
oliveSigningSecret: "wyze_app_secret_key_132", // Required for the thermostat
oliveAppId: "9319141212m2ik", // Required for the thermostat
appInfo: "wyze_android_2.19.14", // Required for the thermostat

// App emulation constants
phoneId : 'wyze_developer_api',
appName : 'com.hualai.WyzeCam',
appVer : 'wyze_developer_api',
appVersion : 'wyze_developer_api',
sc : 'wyze_developer_api',
sv : 'wyze_developer_api',
authApiKey : 'WMXHYf79Nr5gIlt3r0r7p9Tcw5bvs6BB4U8O8nGJ',
userAgent : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15',
// App emulation constants
phoneId: "wyze_developer_api",
appName: "com.hualai.WyzeCam",
appVer: "wyze_developer_api",
appVersion: "wyze_developer_api",
sc: "wyze_developer_api",
sv: "wyze_developer_api",
authApiKey: "WMXHYf79Nr5gIlt3r0r7p9Tcw5bvs6BB4U8O8nGJ",
userAgent:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15",

//URLs
authBaseUrl: 'https://auth-prod.api.wyze.com',
apiBaseUrl: 'https://api.wyzecam.com'
})
//URLs
authBaseUrl: "https://auth-prod.api.wyze.com",
apiBaseUrl: "https://api.wyzecam.com",
});
18 changes: 9 additions & 9 deletions src/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ function olive_create_signature(payload, access_token) {
let body

if (typeof payload === "object") {
body = Object.keys(payload)
.sort()
.map(key => `${key}=${payload[key]}`)
.join("&")
body = Object.keys(payload)
.sort()
.map(key => `${key}=${payload[key]}`)
.join("&")
} else {
body = payload
body = payload
}

const access_key = `${access_token}${constants.oliveSigningSecret}`
Expand All @@ -70,10 +70,10 @@ function ford_create_signature(url_path, request_method, payload) {
let string_buf = request_method + url_path

Object.keys(payload)
.sort()
.forEach(key => {
string_buf += `${key}=${payload[key]}&`
})
.sort()
.forEach(key => {
string_buf += `${key}=${payload[key]}&`
})

string_buf = string_buf.slice(0, -1)
string_buf += constants.fordAppSecret
Expand Down
Loading

0 comments on commit bd122ab

Please sign in to comment.