View Full Version : (Hidden) Password XBMC keyboard dialog???
stanley87
2007-01-09, 12:20
Hi,
I am looking for a way to hide passwords when being entered into my XBMC script using the XBMC built in keyboard function.(XBMCMail (SSS)).
Basically, I want it to be like when you enter in a master password in XBMC. It hides the password when being entered so no one else can see what it is as you are entering it.
Any way of doing this??
Cheers,
Stanley87
Looking at the api it does not look possible currently. Someone would need to add it to the api. Really since the virtual keyboard is on the screen its not all that secure anyway but it should be in there.
yeah, that should be added. the keyboard, itself, supports it but its not extended out to the python api yet. just quickly looking at the code, it should be simple to add a "setHiddenInput()" command to the python keyboard object.
committed to svn... please let me know if it works correctly.
i'm a bit worried you might get the md5 hash back. i'm not sure how general i did it when i tweaked the profile stuff.
really? i thought it just hid the text on screen with *'s...
nope, it hashes as well. i know, i was lazy. but come to think of it, it's probably in one of them static functions, not triggered by only setting the bool
thanks... i was concerned so i just checked it out... the md5 hashing is only done when using the static password specific functions to get input. python does not use them. it has its own low level text entry similar to the basic static function. that bool, by itself, only hides the text on screen in the edit bar of the keyboard dialog.
stanley87
2007-01-11, 07:55
thanks... i was concerned so i just checked it out... the md5 hashing is only done when using the static password specific functions to get input. python does not use them. it has its own low level text entry similar to the basic static function. that bool, by itself, only hides the text on screen in the edit bar of the keyboard dialog.
Im not so familiar with SVN, do you add it to the XBMC SVN?::-s
you'll have to wait for the next t3ch release then.
stanley87
2007-01-11, 23:02
:grin: you'll have to wait for the next t3ch release then.
Hi, I have grabbed the SVN. Just obtaining the apropriate programs needed to compile at the moment.
Cheers for the help.
stanley87
2007-01-13, 14:11
Hi,
Can't get the hiddeninput function in my script going, i used the following code:
def getpassinput(self):
mastpassw = ""
keyboard = xbmc.Keyboard(mastpassw, "Please Enter Password")
keyboard.setHiddenInput(True)
keyboard.doModal()
mastpassw = keyboard.getText()
I also tried the "setHiddenInput" with "()" instead of true and no go, also tried moving the line above and below the do.Modal and still no luck.
Is this the right way of doing it?
Cheers
try using "1"... there isnt really a bool datatype... its faked with an unsigned char... but False should be interprettted as zero, and True as one so I dont think thats the problem.
** edit **
also, the way its coded, if you just do "kb.setHiddenInput()" with no argument in the parens, it should default to hidden.
let me know, if its still not working. and please email me a short test script.
Nuka1195
2007-01-13, 16:49
import xbmc
def getKeyboard( default = "", heading = "" ):
keyboard = xbmc.Keyboard( default, heading )
try:
keyboard.setHiddenInput( True )
keyboard.doModal()
if ( keyboard.isConfirmed() ):
return keyboard.getText(), True
except:
pass
return default, False
mastpassw, succeeded = getKeyboard( "", "Please Enter Password" )
print mastpassw, succeeded
That works on the xbox, for some reason it errors on the PC after you cancel or accept the keyboard.
Edit: It actually works and prints the result, but XBMC_PC.exe errors with the following. Also it doesn't matter if the setHiddenInput() is used. Must be something with this specific code, because other scripts work fine with the keyboard.
09:52:53 M:126373888 INFO: test
09:52:53 M:126373888 INFO:
09:52:53 M:126373888 INFO: True
09:52:53 M:126373888 INFO:
09:52:53 M:126373888 INFO: Scriptresult: Succes
09:52:53 M:126373888 INFO: Python script stopped
09:52:53 M:126382080 FATAL: EXCEPTION_ACCESS_VIOLATION (0xc0000005)
at 0x006af0e3
So to confirm, it works on the Xbox, but not on the PC?
Nuka1195
2007-01-13, 19:26
it actually works on both, but xbmc_pc.exe crashes after it prints the results with the above code.
Another script I use with the same code, except it uses the keyboard inside a window class does not crash xbmc_pc.exe.
This code inside a window class does NOT crash xbmc_pc.exe.
def getKeyboard(self, default = "", heading = ""):
keyboard = xbmc.Keyboard(default, heading)
try:
keyboard.setHiddenInput( True )
keyboard.doModal()
if (keyboard.isConfirmed()):
return keyboard.getText(), True
except:
pass
return default, False
stanley87
2007-01-14, 03:15
I could only get it working on the xbox, no problem tho, i just added a try eg:
try:
keyboard.setHiddenInput(True)
except:pass
This way, if im using pc, it will skip it, and also for people with an older XBMC build, it won't freeze their xbox's.
Also, wondering if there is a way to do this same thought of thing (replace the input with *'s) but with labels.
So once, the password is set, the label for it can also contain the *'s.
At the moment i just set the label to "*******" but then it is always the same and not the correct amount of *'s for the password length. This is no big deal, but just wondering.
Oh, and big up's for implementing this so quick!!! :-D
Cheers
Stanley87
Nuka1195
2007-01-14, 04:45
@stanley87, it sounds like you don't have an updated xbmc_pc.exe.
edit: the label thing should be done with code, just:
self.passwdLabel.setLabel('*' * len(mastpassw))
edit2: @kraqh3d, xbmc_pc.exe does NOT crash using the skin clearity with the code outside of a class, odd. Might be something on my end. So I'm saying the keyboard code works fine.
stanley87
2007-01-14, 06:10
@stanley87, it sounds like you don't have an updated xbmc_pc.exe.
edit: the label thing should be done with code, just:
self.passwdLabel.setLabel('*' * len(mastpassw))
edit2: @kraqh3d, xbmc_pc.exe does NOT crash using the skin clearity with the code outside of a class, odd. Might be something on my end. So I'm saying the keyboard code works fine.
Hi thanks, that worked a treat.
You are correct, i'm using the latest compile of XBMC but using an old XBMC_PC.exe. Is there a .bat to compile this or just BUILD through VS NET 2003?