Greg-MM / C4-AndroidTV

Control4 Android TV Driver (MiBox S, etc)
GNU General Public License v3.0
12 stars 6 forks source link

Faster way to generate the certificate modulus #9

Open cpereirasp opened 1 year ago

cpereirasp commented 1 year ago

Here's my little contribution to how to make this easier. With a little piping and sed magic, you can extract the certificate using openssl and pipe it back to openssl to calculate the modulus:

openssl s_client -connect <IP address here>:6467 2>/dev/null </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -noout -modulus

The dirty way to do this would be with os.execute - but that's highly discouraged because it seriously messes up the director process. I wonder if there's a way to tap into openssl using C4's APIs.

simonk83 commented 1 month ago

Just a question on this, as your way shows the modulus without the : in between (so AAB577CD etc vs AA:B5:77:CD). Does Control4 want the modules entered with the : or without (I can't get this working on a TCL TV so I'm just making sure I'm not making a mistake)

cpereirasp commented 1 month ago

It has worked without the : for me, but it seems like google might have changed the protocol again because this stopped working a few weeks ago.

On Fri, Jul 19, 2024, 5:20 p.m. crunch @.***> wrote:

Just a question on this, as your way shows the modulus without the : in between (so AAB577CD etc vs AA:B5:77:CD). Does Control4 want the modules entered with the : or without (I can't get this working on a TCL TV so I'm just making sure I'm not making a mistake)

— Reply to this email directly, view it on GitHub https://github.com/Greg-MM/C4-AndroidTV/issues/9#issuecomment-2240141619, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZN3QOFRZMHKCZ4NNKE43LZNF7LLAVCNFSM6AAAAABLFIJSDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBQGE2DCNRRHE . You are receiving this because you authored the thread.Message ID: @.***>

simonk83 commented 1 month ago

It has worked without the : for me, but it seems like google might have changed the protocol again because this stopped working a few weeks ago.

Ahh ok, maybe there's still hope then if someone works out the new protocol :D

Leighm0 commented 1 month ago

It has worked without the : for me, but it seems like google might have changed the protocol again because this stopped working a few weeks ago.

Ahh ok, maybe there's still hope then if someone works out the new protocol :D

change the connections to TLS 1.3 and it works again.

simonk83 commented 1 month ago

It has worked without the : for me, but it seems like google might have changed the protocol again because this stopped working a few weeks ago.

Ahh ok, maybe there's still hope then if someone works out the new protocol :D

change the connections to TLS 1.3 and it works again.

Edit it in driver.xml (<method>tlsv1</method>)? Or is there a spot in composer to change it (sorry I’m out of the house at the mo to check)

Leighm0 commented 1 month ago

It has worked without the : for me, but it seems like google might have changed the protocol again because this stopped working a few weeks ago.

Ahh ok, maybe there's still hope then if someone works out the new protocol :D

change the connections to TLS 1.3 and it works again.

Edit it in driver.xml (<method>tlsv1</method>)? Or is there a spot in composer to change it (sorry I’m out of the house at the mo to check)

driver.xml

cpereirasp commented 1 month ago

It has worked without the : for me, but it seems like google might have changed the protocol again because this stopped working a few weeks ago.

Ahh ok, maybe there's still hope then if someone works out the new protocol :D

change the connections to TLS 1.3 and it works again.

Edit it in driver.xml (<method>tlsv1</method>)? Or is there a spot in composer to change it (sorry I’m out of the house at the mo to check)

driver.xml

@Leighm0 what value did you use for that got it working for you?

Leighm0 commented 1 month ago

It has worked without the : for me, but it seems like google might have changed the protocol again because this stopped working a few weeks ago.

Ahh ok, maybe there's still hope then if someone works out the new protocol :D

change the connections to TLS 1.3 and it works again.

Edit it in driver.xml (<method>tlsv1</method>)? Or is there a spot in composer to change it (sorry I’m out of the house at the mo to check)

driver.xml

@Leighm0 what value did you use for that got it working for you?

add _3 I think, I'm not at my computer to check

simonk83 commented 1 month ago

It has worked without the : for me, but it seems like google might have changed the protocol again because this stopped working a few weeks ago.

Ahh ok, maybe there's still hope then if someone works out the new protocol :D

change the connections to TLS 1.3 and it works again.

Edit it in driver.xml (<method>tlsv1</method>)? Or is there a spot in composer to change it (sorry I’m out of the house at the mo to check)

driver.xml

@Leighm0 what value did you use for that got it working for you?

Just tried a few things and it's just tlsv13. Finally got my TCL to show a pairing code, happy days. Thanks guys

EDIT: Though it looks like I don't have any control over it unfortunately. boooo

Leighm0 commented 1 month ago

It has worked without the : for me, but it seems like google might have changed the protocol again because this stopped working a few weeks ago.

Ahh ok, maybe there's still hope then if someone works out the new protocol :D

change the connections to TLS 1.3 and it works again.

Edit it in driver.xml (<method>tlsv1</method>)? Or is there a spot in composer to change it (sorry I’m out of the house at the mo to check)

driver.xml

@Leighm0 what value did you use for that got it working for you?

Just tried a few things and it's just tlsv13. Finally got my TCL to show a pairing code, happy days. Thanks guys

EDIT: Though it looks like I don't have any control over it unfortunately. boooo

you need to basically reset the driver, so start from scratch (remove from project and add again), then start with pairing it and then connect the command interface, should start accepting control commands

EDIT: also make sure you updated BOTH entries for tlsv13, not just the pairing port.

simonk83 commented 1 month ago

It has worked without the : for me, but it seems like google might have changed the protocol again because this stopped working a few weeks ago.

Ahh ok, maybe there's still hope then if someone works out the new protocol :D

change the connections to TLS 1.3 and it works again.

Edit it in driver.xml (<method>tlsv1</method>)? Or is there a spot in composer to change it (sorry I’m out of the house at the mo to check)

driver.xml

@Leighm0 what value did you use for that got it working for you?

Just tried a few things and it's just tlsv13. Finally got my TCL to show a pairing code, happy days. Thanks guys EDIT: Though it looks like I don't have any control over it unfortunately. boooo

you need to basically reset the driver, so start from scratch (remove from project and add again), then start with pairing it and then connect the command interface, should start accepting control commands

EDIT: also make sure you updated BOTH entries for tlsv13, not just the pairing port.

Hmm ok. I did change both entries. I deleted the driver and added it again and re-paired, but it seems now whenever I press one of the buttons in the little control box (the up and down arrows for example) it just changes the connection status...

Connection Status Changed: ONLINE Connection Status Changed: OFFLINE Connection Status Changed: ONLINE Connection Status Changed: OFFLINE Connection Status Changed: ONLINE Connection Status Changed: OFFLINE Connection Status Changed: ONLINE Connection Status Changed: OFFLINE

Leighm0 commented 1 month ago

It has worked without the : for me, but it seems like google might have changed the protocol again because this stopped working a few weeks ago.

Ahh ok, maybe there's still hope then if someone works out the new protocol :D

change the connections to TLS 1.3 and it works again.

Edit it in driver.xml (<method>tlsv1</method>)? Or is there a spot in composer to change it (sorry I’m out of the house at the mo to check)

driver.xml

@Leighm0 what value did you use for that got it working for you?

Just tried a few things and it's just tlsv13. Finally got my TCL to show a pairing code, happy days. Thanks guys EDIT: Though it looks like I don't have any control over it unfortunately. boooo

you need to basically reset the driver, so start from scratch (remove from project and add again), then start with pairing it and then connect the command interface, should start accepting control commands EDIT: also make sure you updated BOTH entries for tlsv13, not just the pairing port.

Hmm ok. I did change both entries. I deleted the driver and added it again and re-paired, but it seems now whenever I press one of the buttons in the little control box (the up and down arrows for example) it just changes the connection status...

Connection Status Changed: ONLINE Connection Status Changed: OFFLINE Connection Status Changed: ONLINE Connection Status Changed: OFFLINE Connection Status Changed: ONLINE Connection Status Changed: OFFLINE Connection Status Changed: ONLINE Connection Status Changed: OFFLINE

I'm using it with the NVIDIA Shield TV Pro, so can't comment on it working for a TCL TV sorry.

oilman89 commented 1 month ago

@Leighm0 could you send me your compiled driver with this edit?

WhatTheDiv commented 1 month ago

Is anyone able to assist here, i have tried to follow the advice in this thread and updated the two locations where "tlsv1" appears under the method tags, replaced with "tlsv13", successfully built the c4z, deleted from my project and re-added it ... but i'm still not getting a pair code request on my new TCL google tv. Any suggestions would be super appreciated!

simonk83 commented 1 month ago

I’m not 100% sure this was necessary, but try adding an IP address to the tv in Connections > Network

If you get it to pair I’d be interested to hear if you run into the same issue as me above though with the connecting message. Probably as someone else in a forum mentioned they were getting the same thing with an nvidia shield so we assumed something might have changed with the protocol at googles end

On Thu, 25 Jul 2024 at 5:31 AM, Pat Cannon @.***> wrote:

Is anyone able to assist here, i have tried to follow the advice in this thread and updated the two locations where "tlsv1" appears, replaced with "tlsv13", successfully built the c4z, deleted from my project and re-added it ... but i'm still not getting a pair code request on my new TCL google tv. Any suggestions would be super appreciated!

— Reply to this email directly, view it on GitHub https://github.com/Greg-MM/C4-AndroidTV/issues/9#issuecomment-2248754968, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD6SKG5FDCSLT6GG77RZ7TZN76K7AVCNFSM6AAAAABLFIJSDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBYG42TIOJWHA . You are receiving this because you commented.Message ID: @.***>

WhatTheDiv commented 1 month ago

I’m not 100% sure this was necessary, but try adding an IP address to the tv in Connections > Network If you get it to pair I’d be interested to hear if you run into the same issue as me above though with the connecting message. Probably as someone else in a forum mentioned they were getting the same thing with an nvidia shield so we assumed something might have changed with the protocol at googles end On Thu, 25 Jul 2024 at 5:31 AM, Pat Cannon @.> wrote: Is anyone able to assist here, i have tried to follow the advice in this thread and updated the two locations where "tlsv1" appears, replaced with "tlsv13", successfully built the c4z, deleted from my project and re-added it ... but i'm still not getting a pair code request on my new TCL google tv. Any suggestions would be super appreciated! — Reply to this email directly, view it on GitHub <#9 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD6SKG5FDCSLT6GG77RZ7TZN76K7AVCNFSM6AAAAABLFIJSDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBYG42TIOJWHA . You are receiving this because you commented.Message ID: @.>

Still no luck, I did add its static ip into the networks tab and no difference. Lua logging out:

{ "ACTION" : "BeginPair" } Begin Pairing...

| OnTimerExpired: 14263510 |

Communication Failed, attempting to connect... Disconnecting From Command Interface... Connecting To Command Interface...

simonk83 commented 1 month ago

@WhatTheDiv Double check your modulus is correct and you have it all on the one line (remove spaces and line breaks), like:

00:c0:53:d9:27:c2:55:3a:e3:80:54:e7:33:42:ed:23:5b:aa:f5:38:69:26:1e:0b:f2:3b:f8:e1:ec etc etc

NOT

00:c0:53:d9:27:c2:55:9a:e3:80:34:e7:33:44: ed:73:5b:aa:f5:48:69:26:1e:0b:f2:3b:f8:e1:ec:

Wolf-9988 commented 1 month ago

I’m not 100% sure this was necessary, but try adding an IP address to the tv in Connections > Network If you get it to pair I’d be interested to hear if you run into the same issue as me above though with the connecting message. Probably as someone else in a forum mentioned they were getting the same thing with an nvidia shield so we assumed something might have changed with the protocol at googles end On Thu, 25 Jul 2024 at 5:31 AM, Pat Cannon @.> wrote: Is anyone able to assist here, i have tried to follow the advice in this thread and updated the two locations where "tlsv1" appears, replaced with "tlsv13", successfully built the c4z, deleted from my project and re-added it ... but i'm still not getting a pair code request on my new TCL google tv. Any suggestions would be super appreciated! — Reply to this email directly, view it on GitHub <#9 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD6SKG5FDCSLT6GG77RZ7TZN76K7AVCNFSM6AAAAABLFIJSDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBYG42TIOJWHA . You are receiving this because you commented.Message ID: @.>

I have gotten my CCwGTV4K to pair but also cant send any commands after doing the TLS change. Anyone Have any suggestions? is there a change required in any of the other files? i did some research and the dev may need to update the p12 file or move to self signed certificate

simonk83 commented 1 month ago

I’m not 100% sure this was necessary, but try adding an IP address to the tv in Connections > Network If you get it to pair I’d be interested to hear if you run into the same issue as me above though with the connecting message. Probably as someone else in a forum mentioned they were getting the same thing with an nvidia shield so we assumed something might have changed with the protocol at googles end On Thu, 25 Jul 2024 at 5:31 AM, Pat Cannon @.**> wrote: Is anyone able to assist here, i have tried to follow the advice in this thread and updated the two locations where "tlsv1" appears, replaced with "tlsv13", successfully built the c4z, deleted from my project and re-added it ... but i'm still not getting a pair code request on my new TCL google tv. Any suggestions would be super appreciated! — Reply to this email directly, view it on GitHub <#9 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD6SKG5FDCSLT6GG77RZ7TZN76K7AVCNFSM6AAAAABLFIJSDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBYG42TIOJWHA . You are receiving this because you commented.Message ID: @.**>

I have gotten my CCwGTV4K to pair but also cant send any commands after doing the TLS change. Anyone Have any suggestions? is there a change required in any of the other files? i did some research and the dev may need to update the p12 file or move to self signed certificate

Yep I think it’s protocol changes getting in the way now, so probably just have to wait for someone to figure that out.

In the meantime I’m just using homeassistant to talk to the tv instead

Leighm0 commented 1 month ago

A change needs to occur in the protobuf.lua

Particularly in: function DecodeWire

Google has changed the protobuf response a bit in the latest Android Remote version and this script is not decoding it properly now.