Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.set_title()
# ADB moved to the bottom once the logger handler is configured
# self.adb = adb_conn.ADBConn(logger=logger, log_level=self.log_level)
self.registry = decoders.Registry()
self.menubar = tk.Menu(self.root, tearoff=0)
self.root['menu'] = self.menubar
self.build_file_menus()
self.build_decoders_menus()
self.build_utils_menus()
self.build_locks_menus()
self.build_tools_menus()
self.build_adb_menus()
self.build_help_menus()
self.DeviceStatus = tk.StringVar()
self.StatusMsg = tk.StringVar()
self.StatusMsg.set('Ready')
# MIDFRAME -----------------------------------------------------------
midframe = ttk.Frame(self.mainframe, padding=(5, 5, 5, 5))
def salt_locksettings_wal(self):
dialog = self.get_file(
'locksettings.db-wal',
ftype=[('SQLite Write Ahead Logs', '*.db-wal')])
if dialog and os.path.getsize(dialog):
salt_values = decoders.parse_lockscreen_wal(dialog)
if len(salt_values) == 1:
logger.info(f'Lockscreen salt: {salt_values[0]}')
self.SALT.set(salt_values[0])
elif len(salt_values) > 1:
for n, s in enumerate(salt_values, start=1):
logger.info(f'Lockscreen salt_{n}: {s}')
messagebox.showwarning(
'Multiple results found',
'More than one value for salt was found! Check the log window to pick a value manually.')
else:
messagebox.showwarning(
'Value not found',
'Salt was not found in the file!')
def salt_settings(self, key='lockscreen.password_salt'):
dialog = self.get_file(
'settings.db',
ftype=[('SQLite Databases', '*.db')])
if dialog:
dec = decoders.SettingsDecoder(None, dialog)
salt_value = dec.DICT.get(key)
if salt_value:
logger.info(f'Lockscreen salt: {salt_value}')
self.SALT.set(salt_value)
else:
messagebox.showwarning(
'Value not found',
f'`{key}` not found in the file!')
def salt_locksettings(self, key='lockscreen.password_salt'):
dialog = self.get_file(
'locksettings.db',
ftype=[('SQLite Databases', '*.db')])
if dialog:
try:
dec = decoders.LocksettingsDecoder(None, dialog)
salt_value = dec.DICT.get(key)
if salt_value:
logger.info(f'Lockscreen salt: {salt_value}')
self.SALT.set(salt_value)
except Exception:
messagebox.showwarning(
'Value not found',
f'`{key}` not found in the database!\nTry parsing the `locksettings.db-wal` instead.')