mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-18 22:16:08 -04:00
A new library for storing app keys is added
This commit is contained in:
29
src/keys/__init__.py
Normal file
29
src/keys/__init__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import platform
|
||||
import exceptions
|
||||
from ctypes import c_char_p
|
||||
from libloader import load_library
|
||||
import paths
|
||||
if platform.architecture()[0][:2] == "32":
|
||||
lib = load_library("api_keys32", x86_path=paths.app_path("keys/lib"))
|
||||
else:
|
||||
lib = load_library("api_keys64", x64_path=paths.app_path("keys/lib"))
|
||||
|
||||
keyring = None
|
||||
|
||||
def setup():
|
||||
global keyring
|
||||
if keyring == None:
|
||||
keyring = Keyring()
|
||||
|
||||
class Keyring(object):
|
||||
def __init__(self):
|
||||
super(Keyring, self).__init__()
|
||||
|
||||
def _call_method(self, function):
|
||||
result = getattr(lib, function)
|
||||
result = c_char_p(result.__call__())
|
||||
return result.value
|
||||
|
||||
def get(self, func):
|
||||
return getattr(self, "_call_method")("get_"+func)
|
BIN
src/keys/lib/api_keys32.dll
Normal file
BIN
src/keys/lib/api_keys32.dll
Normal file
Binary file not shown.
Reference in New Issue
Block a user