diff options
author | Minteck <46352972+Minteck@users.noreply.github.com> | 2021-07-07 22:21:32 +0200 |
---|---|---|
committer | Minteck <46352972+Minteck@users.noreply.github.com> | 2021-07-07 22:21:32 +0200 |
commit | f3e78ef8dbf6d89999fdfe1a4022ef97c67a7514 (patch) | |
tree | b267804712a4e5a2a8968d6eeee3cea7ca6d1f81 /app.js | |
parent | adabd5f0b2d7326958126dc960bf4ef09c9a4e4f (diff) | |
download | kartik-client-f3e78ef8dbf6d89999fdfe1a4022ef97c67a7514.tar.gz kartik-client-f3e78ef8dbf6d89999fdfe1a4022ef97c67a7514.tar.bz2 kartik-client-f3e78ef8dbf6d89999fdfe1a4022ef97c67a7514.zip |
21.07
Diffstat (limited to 'app.js')
-rw-r--r-- | app.js | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -317,6 +317,33 @@ const { app, BrowserWindow } = require('electron'); }) load.loadFile("./views/load.html"); setTimeout(() => { + console.log(" * Checking signatures"); + + sigdb = require("./bin/signatures.json"); + total = Object.keys(sigdb).length; + processed = 0; + for (file in sigdb) { + if (fs.existsSync(file)) { + try { + hash = require('crypto').createHash('sha512').update(fs.readFileSync(file)).digest('base64'); + if (hash !== sigdb[file]) { + require('electron').dialog.showMessageBoxSync( + { + type: "warning", + title: "Source modification detected", + message: "File " + file + " has been flagged as modified. If this is normal, please run the signing process again.\n\nExpected: " + sigdb[file] + "\nGot: " + hash + "\n\nYou are running a modified version of Kartik, do not expect to get support!" + } + ) + } + } catch (e) { + console.warn(" ! Could not compute hash for " + file); + } + } + + processed++; + load.webContents.send('progress', (processed/total)*100); + } + console.log(" * Generating resources pack"); require('./modding/resources'); console.log(" * Starting Kartik Modding Platform"); |