Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github
.yarn
node_modules
build
src/serviceWorker.js
24 changes: 24 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"env": {
"browser": true,
"es2020": true,
"node": true
},
"extends": [
"plugin:react/recommended",
"airbnb"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 11,
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"react/prop-types": 0
}
}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,12 @@ yarn-error.log*

.idea
.idea/*
.vscode/*
dist/*

.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
1 change: 1 addition & 0 deletions .yarn/plugins/yarn-up-all-plugin.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports={name:"yarn-up-all-plugin",factory:a=>{const{Configuration:b,Project:c}=a("@yarnpkg/core"),{Cli:d,Command:e}=a("clipanion"),f=a("yup"),g=a("@yarnpkg/plugin-essentials"),h=(a,b)=>a?`@${a}/${b}`:b,i=(a,b)=>{const c=[...a.values()];return b?c.filter(a=>{const c=h(a[1].scope,a[1].name);return!b.includes(c)}):c};class j extends e{async execute(){if(!g.default.commands)throw new Error("Yarn commands are not available!");const a=await b.find(this.context.cwd,this.context.plugins),{workspace:e}=await c.find(a,this.context.cwd),f=[...e.manifest.dependencies,...e.manifest.devDependencies],j=i(f,this.exclude?this.exclude.split(" "):null),k=j.map(a=>h(a[1].scope,a[1].name)),l=d.from(g.default.commands);return l.runExit(["up",...k],this.context)}}return j.addOption("exclude",e.String("--exclude")),j.addPath("up-all"),j.schema=f.object().shape({exclude:f.string()}),j.usage=e.Usage({description:"Yarn2 plugin that will upgrade all dependencies to their latest version with one simple command",details:"This command will upgrade all dependencies to their latest version",examples:[["Upgrade all dependencies","yarn up-all"],["Upgrade all dependencies but exclude a single dependency","yarn up-all --exclude react-dom"],["Upgrade all dependencies but exclude multiple dependencies","yarn up-all --exclude \"react-dom react-router\""]]}),{commands:[j]}}};
55 changes: 55 additions & 0 deletions .yarn/releases/yarn-2.2.2.cjs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/yarn-up-all-plugin.cjs
spec: "https://github.com/e5mode/yarn-up-all/releases/download/1.0.2/index.js"

yarnPath: .yarn/releases/yarn-2.2.2.cjs
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

# DeadHash

![GitHub package.json version](https://img.shields.io/github/package-json/v/CodeDead/DeadHash-js)
![GitHub](https://img.shields.io/github/license/CodeDead/DeadHash-Js)
![GitHub Releases (by Release)](https://img.shields.io/github/downloads/CodeDead/DeadHash-js/2.0.4/total)

DeadHash is a free and open-source utility to calculate file and text hashes. The following hash calculations are supported:
* MD4
* MD5
* SHA1
* SHA224
* SHA256
* SHA3
* SHA384
* SHA512
* RIPEMD160
Expand Down
Binary file removed assets/Icon-512x512.png
Binary file not shown.
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deadhash",
"version": "2.0.4",
"version": "2.1.0",
"description": "File and text hash calculator",
"homepage": "./",
"private": true,
Expand All @@ -18,13 +18,13 @@
"nsis",
"portable"
],
"icon": "assets/Icon-512x512.png"
"icon": "public/logo512.png"
},
"linux": {
"target": [
"AppImage"
],
"icon": "assets/Icon-512x512.png"
"icon": "public/logo512.png"
},
"nsis": {
"license": "LICENSE",
Expand All @@ -38,14 +38,13 @@
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"cross-env": "^7.0.2",
"crypto-js": "^4.0.0",
"electron-is-dev": "^1.2.0",
"react": "^16.13.1",
"react-contexify": "^4.1.1",
"react-dom": "^16.13.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1"
"react-scripts": "^3.4.3"
},
"scripts": {
"react-start": "react-scripts start",
Expand All @@ -57,9 +56,6 @@
"build": "yarn react-build && yarn electron-build -wl",
"start": "concurrently \"cross-env BROWSER=none yarn react-start\" \"wait-on http://localhost:3000 && electron .\""
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
Expand All @@ -73,9 +69,14 @@
]
},
"devDependencies": {
"concurrently": "^5.2.0",
"electron": "^9.1.0",
"electron-builder": "^22.7.0",
"wait-on": "^5.1.0"
"concurrently": "^5.3.0",
"electron": "^10.1.3",
"electron-builder": "^22.8.1",
"eslint-config-airbnb": "^18.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.21.2",
"eslint-plugin-react-hooks": "^4.1.2",
"wait-on": "^5.2.0"
}
}
Binary file removed public/Icon-512x512.png
Binary file not shown.
184 changes: 131 additions & 53 deletions public/electron.js
Original file line number Diff line number Diff line change
@@ -1,77 +1,155 @@
const electron = require("electron");
const app = electron.app;
const ipcMain = electron.ipcMain;
const BrowserWindow = electron.BrowserWindow;
const path = require("path");
const isDev = require("electron-is-dev");
// eslint-disable-next-line import/no-extraneous-dependencies
const electron = require('electron');

const { app } = electron;
const { ipcMain } = electron;
const { BrowserWindow } = electron;
const path = require('path');
const isDev = require('electron-is-dev');

let mainWindow;
let fileWorkerWindow;
let textWorkerWindow;

const createWindow = () => {
mainWindow = new BrowserWindow({
webPreferences: {
nodeIntegration: true
},
frame: false,
title: "DeadHash",
width: 960,
height: 520,
icon: path.join(__dirname, '../build/Icon-512x512.png')
});

if (isDev) {
mainWindow.webContents.openDevTools();
} else {
electron.Menu.setApplicationMenu(null);
}
mainWindow = new BrowserWindow({
webPreferences: {
nodeIntegration: true,
},
frame: false,
title: 'DeadHash',
width: 960,
height: 520,
icon: path.join(__dirname, '../build/logo512.png'),
});

fileWorkerWindow = new BrowserWindow({
show: isDev,
icon: path.join(__dirname, '../build/logo512.png'),
webPreferences: { nodeIntegration: true },
});

textWorkerWindow = new BrowserWindow({
show: isDev,
icon: path.join(__dirname, '../build/logo512.png'),
webPreferences: { nodeIntegration: true },
});

mainWindow.removeMenu();
mainWindow.loadURL(isDev ? "http://localhost:3000" : `file://${path.join(__dirname, "../build/index.html")}`);
mainWindow.on("closed", () => (mainWindow = null));
if (isDev) {
mainWindow.webContents.openDevTools();
fileWorkerWindow.webContents.openDevTools();
textWorkerWindow.webContents.openDevTools();
} else {
electron.Menu.setApplicationMenu(null);
}

mainWindow.webContents.on('new-window', (event, arg) => {
event.preventDefault();
electron.shell.openExternal(arg);
});
mainWindow.removeMenu();
mainWindow.loadURL(isDev ? 'http://localhost:3000' : `file://${path.join(__dirname, '../build/index.html')}`);
mainWindow.on('closed', () => {
mainWindow = null;
if (fileWorkerWindow) fileWorkerWindow.close();
if (textWorkerWindow) textWorkerWindow.close();
});

mainWindow.on("maximize", () => {
mainWindow.webContents.send("window-maximized");
});
fileWorkerWindow.loadURL(`file://${path.join(__dirname, isDev ? './workers/FileWorker/index.html' : '../build/workers/FileWorker/index.html')}`);
fileWorkerWindow.on('closed', () => {
fileWorkerWindow = null;
if (textWorkerWindow) textWorkerWindow.close();
if (mainWindow) mainWindow.close();
});

mainWindow.on("unmaximize", () => {
mainWindow.webContents.send("window-unmaximized");
})
textWorkerWindow.loadURL(`file://${path.join(__dirname, isDev ? './workers/TextWorker/index.html' : '../build/workers/TextWorker/index.html')}`);
textWorkerWindow.on('closed', () => {
textWorkerWindow = null;
if (fileWorkerWindow) fileWorkerWindow.close();
if (mainWindow) mainWindow.close();
});

mainWindow.webContents.on('new-window', (event, arg) => {
event.preventDefault();
electron.shell.openExternal(arg);
});

mainWindow.on('maximize', () => {
mainWindow.webContents.send('window-maximized');
});

mainWindow.on('unmaximize', () => {
mainWindow.webContents.send('window-unmaximized');
});
};

app.whenReady().then(createWindow);
app.whenReady()
.then(createWindow);

app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
app.quit();
}
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});

app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});

ipcMain.on("handle-close", () => {
mainWindow.close();
ipcMain.on('handle-close', () => {
if (mainWindow) mainWindow.close();
});

ipcMain.on("handle-maximize", () => {
if (!mainWindow.isMaximized()) {
mainWindow.maximize();
ipcMain.on('handle-maximize', () => {
if (mainWindow) {
if (mainWindow.isMaximized()) {
mainWindow.unmaximize();
} else {
mainWindow.unmaximize();
mainWindow.maximize();
}
}
});

ipcMain.on("handle-minimize", () => {
ipcMain.on('handle-minimize', () => {
if (mainWindow) {
mainWindow.minimize();
}
});

ipcMain.on('get-version', (e) => {
e.reply('get-version-reply', app.getVersion());
});

ipcMain.on('calculate-file-hash', (e, data) => {
if (fileWorkerWindow) {
fileWorkerWindow.webContents.send('calculate-file-hash', data);
}
});

ipcMain.on('file-hash-calculated', (e, data) => {
if (mainWindow) {
mainWindow.webContents.send('file-hash-calculated', data);
}
});

ipcMain.on('file-hash-calculation-error', (e, data) => {
if (mainWindow) {
mainWindow.webContents.send('file-hash-calculation-error', data);
}
});

ipcMain.on('calculate-text-hash', (e, data) => {
if (textWorkerWindow) {
textWorkerWindow.webContents.send('calculate-text-hash', data);
}
});

ipcMain.on('text-hash-calculated', (e, data) => {
if (mainWindow) {
mainWindow.webContents.send('text-hash-calculated', data);
}
});

ipcMain.on("get-version", (e) => {
e.reply('get-version-reply', app.getVersion());
ipcMain.on('text-hash-calculation-error', (e, data) => {
if (mainWindow) {
mainWindow.webContents.send('text-hash-calculation-error', data);
}
});
2 changes: 0 additions & 2 deletions public/robots.txt

This file was deleted.

Loading