Compare commits
No commits in common. "db9afe38f2b7aa6c1681b71e71e54b33d8b5c116" and "1cc6d1d60fb80e9ffcf913235038dc4ac7f04a18" have entirely different histories.
db9afe38f2
...
1cc6d1d60f
2 changed files with 2 additions and 57 deletions
|
@ -14,42 +14,6 @@ import threading
|
|||
import signal
|
||||
import sys
|
||||
|
||||
app_name = "Dislocker"
|
||||
dislocker_dir = os.getcwd()
|
||||
|
||||
os.chdir(dislocker_dir)
|
||||
|
||||
config_dir_path = "./config/"
|
||||
client_config_path = config_dir_path + "client.json"
|
||||
if not os.path.isfile(client_config_path):
|
||||
if not os.path.isdir(config_dir_path):
|
||||
os.mkdir(config_dir_path)
|
||||
|
||||
client_config = {
|
||||
"initial": 1,
|
||||
"auth_host_url": "http://localhost",
|
||||
"pc_number": 1,
|
||||
"master_password_hash": "",
|
||||
"testing": 0
|
||||
}
|
||||
|
||||
elif os.path.isfile(client_config_path):
|
||||
with open(client_config_path, "r") as r:
|
||||
client_config = json.load(r)
|
||||
|
||||
def init(**kwargs):
|
||||
master_password = master_password_gen()
|
||||
msgbox = tkinter.messagebox.showinfo(title=f"{app_name} | 初回起動を検出", message=f"初回起動のようです。\nマスターパスワードを記録しておいてください。\nこれ以降二度と表示されることはないでしょう。\n\n{master_password["password"]}\n\nまた、認証先サーバーの接続先を指定してください。ロックを解除できなくなります。")
|
||||
client_config["master_password_hash"] = master_password["password_hash"]
|
||||
client_config["initial"] = 0
|
||||
if "pc_number" in kwargs:
|
||||
client_config["pc_number"] = int(kwargs["pc_number"])
|
||||
else:
|
||||
client_config["pc_number"] = 1
|
||||
with open(client_config_path, "w") as w:
|
||||
json.dump(client_config, w, indent=4)
|
||||
|
||||
|
||||
class App(customtkinter.CTk):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
@ -78,7 +42,7 @@ class App(customtkinter.CTk):
|
|||
keyboard.block_key(i)
|
||||
|
||||
def block_taskmgr(self):
|
||||
block = subprocess.run(['reg', 'add', 'HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System', '/v', 'DisableTaskMgr', '/t', 'REG_DWORD', '/d', '1', '/f'])
|
||||
block = subprocess.run(['reg', 'add', 'HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System', '/v', 'DisableTaskMgr', '/t', 'REG_DWORD', '/d', 'f', '1'])
|
||||
print(block)
|
||||
|
||||
def unlock_taskmgr(self):
|
||||
|
@ -325,8 +289,8 @@ def master_password_gen():
|
|||
result = {"password": password, "password_hash": password_hash}
|
||||
return result
|
||||
|
||||
app_name = "Dislocker"
|
||||
|
||||
<<<<<<< HEAD
|
||||
config_dir_path = "./config/"
|
||||
client_config_path = config_dir_path + "client.json"
|
||||
if not os.path.isfile(client_config_path):
|
||||
|
@ -371,21 +335,6 @@ else:
|
|||
monitor.signal_handler()
|
||||
else:
|
||||
print("引数エラー。")
|
||||
=======
|
||||
if __name__ == '__main__':
|
||||
args = sys.argv
|
||||
if len(args) >= 2:
|
||||
if args[1] == "stop":
|
||||
monitor = Monitor()
|
||||
monitor.signal_handler()
|
||||
elif args[1] == "setup":
|
||||
init(pc_number=args[2])
|
||||
else:
|
||||
print("引数エラー。")
|
||||
else:
|
||||
if client_config["initial"] == 1:
|
||||
init()
|
||||
>>>>>>> testing_2
|
||||
else:
|
||||
app = App()
|
||||
app.protocol("WM_DELETE_WINDOW", app.handler_close)
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
customtkinter
|
||||
winotify
|
||||
keyboard
|
||||
requests
|
Loading…
Reference in a new issue