Skip to content

Commit

Permalink
authme 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Nov 16, 2020
1 parent 176648e commit 917e5fb
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 227 deletions.
2 changes: 1 addition & 1 deletion .GITIGNORE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules
__pycache__
build
build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# How to use

- For technical people: Check out `extract/README.md`
- For simple people: Instructions in the app
- For non technical people: Instructions in the app

# Development

Expand Down
2 changes: 1 addition & 1 deletion app/settings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h3>Open folders</h3>
<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.4.0</h4>
<h4 id="ver"></h4>
</div>
</body>
</html>
4 changes: 4 additions & 0 deletions app/settings/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ const electron = require("electron")
const ipc = electron.ipcRenderer
const path = require("path")

let version = ipc.sendSync("ver")

document.querySelector("#ver").textContent = `Authme ${version}`

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

let but0 = document.querySelector("#but0")
Expand Down
2 changes: 1 addition & 1 deletion app/splash/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1>Authme</h1>
<br />
<img src="../../img/loading.gif" alt="" srcset="" />

<h4 id="version">Authme 1.4.0</h4>
<h4 id="ver"></h4>
</div>
</body>
</html>
198 changes: 3 additions & 195 deletions app/splash/src/js/index.js
Original file line number Diff line number Diff line change
@@ -1,197 +1,5 @@
const { ipcMain, shell } = require("electron")
const fs = require("fs")
const electron = require("electron")
const ipc = electron.ipcRenderer
const path = require("path")
const { ipcRenderer } = require("electron")

const file_path = path.join(process.env.APPDATA, "/Levminer/Authme")
let version = ipcRenderer.sendSync("ver")

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")
}
document.querySelector("#ver").textContent = `Authme ${version}`
Loading

0 comments on commit 917e5fb

Please sign in to comment.