eclair4151 / samsung_encrypted_POC

A proof of concept to pair and send commands to H and J series Samsung TVs
10 stars 5 forks source link

Able to pair but keycode not working #2

Closed uchagani closed 6 years ago

uchagani commented 6 years ago

Hi, I was able to pair with my tv using your script but debug.py script isn't sending keys. Any ideas?

eclair4151 commented 6 years ago

Hard to say. some things to make sure

Are you using python3? Did you replace the session and enc_key in the file with the ones printed from pairing?

try putting print(aesLib.generate_command('KEY_VOLDOWN')) in line 46 of debug.py and see what it prints out. make sure it looks like an array of numbers not a bunch of unicode symbols

also what model tv do you have? some specific models arent supported.

mmichalko commented 6 years ago

Hi, I have the same problem. Pairing works, but sending the key does not decrease volume and doesn't produce any error. I have replaced both values in debug.py. I use python version 2.7.12. My TV is J6270. When I put print(aesLib.generate_command('KEY_VOLDOWN')) after the line aesLib = aes_lib.AESCipher(enc_key, session) I get the following output on the command line:

$ python debug.py ws://10.0.0.5:8000/socket.io/1/websocket/pK9gHgrPpvpiyNT7V5rH 5::/com.samsung.companion:{"name":"callCommon","args":[{"Session_Id":6,"body":"[F,%,�,�,�,x,�,,�, ,2,�,�,�,,=,�,q,,�,�,n,�,k,N,�,�,5,�,K,�,p,�,],,z,V,�,,�,�,b,�,�,x,�,q,.,",�,�,�,�,�,Y,u,�,:,7,i,�,),w,P,c,m,�,�,X,�,�,�,�,,',R,b,L,R,�,,�,/,�,$,�,,H,�,�,�,�,�,,B,�,Q,�,),�,�,,A,,},�,�,�,�, ,j,�,n,a,o,,.,L,,�,E,�,1,�,,,�,�,�,�,,W,�,�,�,?,T,�,|,�,�,{,U,�,-,�,v,�,(,�,,Q,�,�,�,h,,Q,�,�,,,},8,�,,�,�,",�,�,�,,U, ,=]"}]}

Any suggestions?

eclair4151 commented 6 years ago

You need python 3

mmichalko commented 6 years ago

Works now, thanks!