Skip to content

Commit

Permalink
authme 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Oct 29, 2020
1 parent e373815 commit 176648e
Show file tree
Hide file tree
Showing 12 changed files with 536 additions and 53 deletions.
2 changes: 1 addition & 1 deletion app/export/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1>Authme</h1>
<h2>Export</h2>
<p class="text3">You can export everything form your saved config.</p>
<button class="button1" onclick="hide()">Close</button>
<h3>Export</h3>
<h3>Start export</h3>
<p class="text3">If you saved your config you can export the secrects and the QR codes.</p>
<button class="button1" id="but0" onclick="exp()">Export</button>
<br />
Expand Down
9 changes: 8 additions & 1 deletion app/settings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,17 @@ <h3>Close app to tray</h3>
<p class="text3">On closing the app will not quit. You can open the app from the tray menu. Windows only.</p>
<button class="button1" id="but2" onclick="tray()">-</button>
<br />
<h3>Open folders</h3>
<p class="text3">
You can open your Authme folder (this is where you unpackaged your app) and your settings folder (this is where the app stores the
settings).
</p>
<button class="button1" id="but3" onclick="folder0()">Authme folder</button>
<button class="button1" id="but4" onclick="folder1()">Settings folder</button>
<h3>Clear data</h3>
<p class="text3">Clear password, 2FA codes and other settings</p>
<button class="button1" id="but1" onclick="data()">Clear data</button>
<h4 id="version">Authme 1.3.0</h4>
<h4 id="version">Authme 1.4.0</h4>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion app/settings/src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ body {
.center {
top: -50px;
width: 1000px;
height: 1050px;
height: 1300px;
}

.button1 {
Expand Down
14 changes: 12 additions & 2 deletions app/settings/src/js/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { ipcMain } = require("electron")
const { ipcMain, shell } = require("electron")
const fs = require("fs")
const electron = require("electron")
const ipc = electron.ipcRenderer
Expand Down Expand Up @@ -109,7 +109,7 @@ let data_state = false

let data = () => {
if (data_state == false) {
but1.textContent = "Are you sure?"
but1.textContent = "Confirm"
data_state = true
} else {
fs.unlink(path.join(file_path, "nrpw.md"), (err) => {
Expand Down Expand Up @@ -159,6 +159,16 @@ let data = () => {
}
}

//? folder 0
let folder0 = () => {
ipc.send("app_path")
}

//? folder 1
let folder1 = () => {
shell.showItemInFolder(file_path)
}

let hide = () => {
ipc.send("hide0")
}
Expand Down
27 changes: 27 additions & 0 deletions app/splash/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Authme</title>
<!-- js -->
<script defer src="./src/js/index.js"></script>
<!-- css -->
<link rel="stylesheet" href="../.././src/dragonfly@1.1.0.css" />
<link rel="stylesheet" href="./src/css/index.css" />
<!-- favicon -->
<link rel="shortcut icon" href="../../img/icon.ico" type="image/x-icon" />
</head>
<body unselectable="on" onselectstart="return false;" onmousedown="return false;">
<div class="center">
<h1>Authme</h1>

<img src="../../img/iconw.png" alt="" srcset="" />
<br />
<br />
<br />
<img src="../../img/loading.gif" alt="" srcset="" />

<h4 id="version">Authme 1.4.0</h4>
</div>
</body>
</html>
66 changes: 66 additions & 0 deletions app/splash/src/css/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
body {
background: rgb(0, 0, 0);
background: linear-gradient(90deg, rgba(0, 0, 0, 1) 30%, rgba(42, 36, 36, 1) 100%);
overflow: hidden;
cursor: wait;
}

h1 {
margin-top: 5px;
}

.center {
top: -150px;
width: 500px;
height: 550px;
}

.button1 {
color: black;
background-color: white;
border-color: white;
}

.button1:hover {
color: white;
border-color: white;
}

.input1 {
color: black;
background-color: white;
border-color: white;
width: 250px;
}

.input1:hover {
color: white;
border-color: white;
}

#password_input2 {
position: relative;
top: 20px;
}

#password_label2 {
position: relative;
top: 20px;
}

#button1 {
position: relative;
top: 45px;
}

#version {
position: relative;
top: -5px;
}

.link1 {
font-size: 1rem !important;
position: relative;
top: 50px;
color: white !important;
}
197 changes: 197 additions & 0 deletions app/splash/src/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
const { ipcMain, shell } = require("electron")
const fs = require("fs")
const electron = require("electron")
const ipc = electron.ipcRenderer
const path = require("path")

const file_path = path.join(process.env.APPDATA, "/Levminer/Authme")

let but0 = document.querySelector("#but0")
let but1 = document.querySelector("#but1")
let but2 = document.querySelector("#but2")

//? startup
let startup_state = true

fs.readFile(path.join(file_path, "saos.md"), "utf-8", (err, data) => {
if (err) {
but0.textContent = "Off"
startup_state = true

after_startup0()
} else {
but0.textContent = "On"
startup_state = false

after_startup1()
}
})

let startup = () => {
if (startup_state == true) {
fs.writeFile(path.join(file_path, "saos.md"), "saos", (err) => {
if (err) {
console.log("Start after os started don't created!")
} else {
console.log("Start after os started file created!")

but0.textContent = "On"
startup_state = false

after_startup1()
}
})
} else {
fs.unlink(path.join(file_path, "saos.md"), (err) => {
if (err && err.code === "ENOENT") {
return console.log("saos.md not deleted")
} else {
console.log("saos.md deleted")

but0.textContent = "Off"
startup_state = true

after_tray0()
}
})
}
}

//? tray
let tray_state = true

fs.readFile(path.join(file_path, "catt.md"), "utf-8", (err, data) => {
if (err) {
but2.textContent = "Off"
tray_state = true

after_tray0()
} else {
but2.textContent = "On"
tray_state = false

after_tray1()
}
})

let tray = () => {
if (tray_state == true) {
fs.writeFile(path.join(file_path, "catt.md"), "catt", (err) => {
if (err) {
console.log("Close app to tray don't created!")
} else {
console.log("Close app to tray file created!")

but2.textContent = "On"
tray_state = false

after_tray1()
}
})
} else {
fs.unlink(path.join(file_path, "catt.md"), (err) => {
if (err && err.code === "ENOENT") {
return console.log("catt.md not deleted")
} else {
console.log("catt.md deleted")

but2.textContent = "Off"
tray_state = true

after_tray0()
}
})
}
}

//? data
let data_state = false

let data = () => {
if (data_state == false) {
but1.textContent = "Confirm"
data_state = true
} else {
fs.unlink(path.join(file_path, "nrpw.md"), (err) => {
if (err && err.code === "ENOENT") {
return console.log("nrpw.md not deleted")
} else {
console.log("nrpw.md deleted")
}
})

fs.unlink(path.join(file_path, "pass.md"), (err) => {
if (err && err.code === "ENOENT") {
return console.log("pass.md not deleted")
} else {
console.log("pass.md deleted")
}
})

fs.unlink(path.join(file_path, "hash.md"), (err) => {
if (err && err.code === "ENOENT") {
return console.log("hash.md not deleted")
} else {
console.log("hash.md deleted")
}
})

fs.unlink(path.join(file_path, "saos.md"), (err) => {
if (err && err.code === "ENOENT") {
return console.log("saos.md not deleted")
} else {
console.log("saos.md deleted")
}
})

let file_path2 = path.join(process.env.APPDATA, "/Microsoft/Windows/Start Menu/Programs/Startup/Authme Launcher.lnk")

fs.unlink(file_path2, (err) => {
if (err && err.code === "ENOENT") {
return console.log("startup shortcut not deleted")
} else {
console.log("startup shortcut deleted")
}
})

but1.textContent = "Exiting app"
after_data()
}
}

//? folder 0
let folder0 = () => {
ipc.send("app_path")
}

//? folder 1
let folder1 = () => {
shell.showItemInFolder(file_path)
}

let hide = () => {
ipc.send("hide0")
}

//? after_data
let after_data = () => {
ipc.send("after_data")
}

//? after_startup
let after_startup0 = () => {
ipc.send("after_startup0")
}

let after_startup1 = () => {
ipc.send("after_startup1")
}

//? after_tray
let after_tray0 = () => {
ipc.send("after_tray0")
}

let after_tray1 = () => {
ipc.send("after_tray1")
}
File renamed without changes
Binary file added img/iconw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 176648e

Please sign in to comment.