Launcher dynamically loads sundpood

This commit is contained in:
Ninnjah 2021-01-02 16:06:56 +03:00 committed by GitHub
parent 942832999e
commit 732126bacb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

1
key.py Normal file
View file

@ -0,0 +1 @@
KEY = b'Nd6jgPcL_V2j-TpaKjAAch1rwFxLo9EAw4IlmmuRQTg='

30
launcher.py Normal file
View file

@ -0,0 +1,30 @@
import os
from cryptography.fernet import Fernet
import key
### Добавь здесь модули нужные твоей программе ###
import pygame
import sounddevice as sd
from pynput.keyboard import Listener
from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5.QtCore import QFile, QTextStream
from PyQt5.QtWidgets import QApplication
from data import ui_preferences
from data import ui_hotkeys
from data import ui_sundpood
from data import ui_overlay
from data import keys
import themes
### ^^^ ^^^ ###
def decrypt(filename, key):
# Расшифруем файл и записываем его
f = Fernet(key)
with open(filename, 'rb') as file:
encrypted_data = file.read()
decrypted_data = f.decrypt(encrypted_data)
return decrypted_data.decode('utf-8')
exec(decrypt(os.path.join('data', 'sundpood-runtime.sr') , key.KEY))