2021-10-11, 08:20
Hello everyone,
I am trying to create an addon that launches a numeric keypad in order to enter a password.
The correct password is contained in the settings.xml file.
I can display the keyboard, but I don't know how to make it check if the password is correct.
I have a few leads but I can't.
I would like that if the password is incorrect, an error message is displayed, if it is correct, the numeric keypad disappears like when locking the Kodi settings. It asks for the password with a maximum of 3 attempts.
Here is my code start:
I would like the password contained in the settings.xml file to be encoded in MD5.
If you have to make it clear first, no worries.
Thanking you all for your help, I'm getting started in coding ...
I am trying to create an addon that launches a numeric keypad in order to enter a password.
The correct password is contained in the settings.xml file.
I can display the keyboard, but I don't know how to make it check if the password is correct.
I have a few leads but I can't.
I would like that if the password is incorrect, an error message is displayed, if it is correct, the numeric keypad disappears like when locking the Kodi settings. It asks for the password with a maximum of 3 attempts.
Here is my code start:
Code:
import xbmcaddon
import xbmcgui
addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
password = addon.getSettings('password')
xbmcgui.Dialog().input('Enter Password', hashlib.md5(password.encode('utf-8')).hexdigest(), type=xbmcgui.INPUT_PASSWORD, option=xbmcgui.PASSWORD_VERIFY)
I would like the password contained in the settings.xml file to be encoded in MD5.
If you have to make it clear first, no worries.
Thanking you all for your help, I'm getting started in coding ...