-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix few bugs, testing security test
- Loading branch information
Showing
5 changed files
with
137 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
{ | ||
"version": "2.0.12", | ||
"name": "Sveltecord", | ||
"description": "Discord Client for KaiOS written in svelte.", | ||
"launch_path": "/index.html", | ||
"icons": { | ||
"56": "/css/56px.png", | ||
"112": "/css/112px.png" | ||
}, | ||
"developer": { | ||
"name": "Cyan", | ||
"url": "https://github.com/cyan-2048/Discord4KaiOS" | ||
}, | ||
"origin": "app://sveltecord.cyankindasus.com", | ||
"type": "privileged", | ||
"permissions": { | ||
"systemXHR": { | ||
"description": "Required to access Discord's Server" | ||
}, | ||
"video-capture": { | ||
"description": "Reading Codes using the Camera" | ||
}, | ||
"desktop-notification": {} | ||
}, | ||
"installs_allowed_from": ["*"], | ||
"locales": { | ||
"en-US": { | ||
"name": "Sveltecord", | ||
"subtitle": "Discord Client for KaiOS", | ||
"description": "Sveltecord is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Discord™, or any of its subsidiaries or its affiliates." | ||
} | ||
}, | ||
"default_locale": "en" | ||
"version": "2.0.13", | ||
"name": "Sveltecord", | ||
"description": "Discord Client for KaiOS written in svelte.", | ||
"launch_path": "/index.html", | ||
"icons": { | ||
"56": "/css/56px.png", | ||
"112": "/css/112px.png" | ||
}, | ||
"developer": { | ||
"name": "Cyan", | ||
"url": "https://github.com/cyan-2048/Discord4KaiOS" | ||
}, | ||
"origin": "app://sveltecord.cyankindasus.com", | ||
"type": "privileged", | ||
"permissions": { | ||
"systemXHR": { | ||
"description": "Required to access Discord's Server" | ||
}, | ||
"video-capture": { | ||
"description": "Reading Codes using the Camera" | ||
}, | ||
"desktop-notification": {} | ||
}, | ||
"installs_allowed_from": ["*"], | ||
"locales": { | ||
"en-US": { | ||
"name": "Sveltecord", | ||
"subtitle": "Discord Client for KaiOS", | ||
"description": "Sveltecord is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Discord™, or any of its subsidiaries or its affiliates." | ||
} | ||
}, | ||
"default_locale": "en" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { xhr } from "./helper"; | ||
|
||
async function getFile(url) { | ||
const resp = await fetch(url); | ||
return digest(await resp.arrayBuffer()); | ||
} | ||
|
||
async function digest(buffer) { | ||
const hashBuffer = await crypto.subtle.digest("SHA-256", buffer); // hash the message | ||
const hashArray = Array.from(new Uint8Array(hashBuffer)); // convert buffer to byte array | ||
const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join(""); // convert bytes to hex string | ||
return hashHex; | ||
} | ||
|
||
export async function checkSecurity({ main_page, bundle }) { | ||
if (_main_page == main_page && _bundle == bundle) { | ||
return true; | ||
} | ||
throw new Error("Security check failed"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters