AndroidTV Binding [3.2.0;4.2.0)

I got no “Unknown Android App” messages in my log.

It even picked up my custom launcher. :smile:

2023-01-09 17:41:20.468 [DEBUG] [v.internal.protocol.shieldtv.ShieldTVMessageParser] - AppPrepend: 30010a5c0a AppDN: com.wolf.firelauncher
2023-01-09 17:41:20.468 [DEBUG] [v.internal.protocol.shieldtv.ShieldTVMessageParser] - AppName: Wolf Launcher AppURL: http://192.168.X.X:41723/com.wolf.firelauncher

Oh, and no exceptions either.

One more reminder for others in case you forget…

To pick up the new channels you need to delete and readd the Thing.

Awesome! Anything loaded from the app store seems to be fine. The stupid one it never sends is the default launcher. I’m semi curious about side loaded apps (I don’t have one) as they may not be tracked on the backend properly. Also it will only throw the error when the app starts. Basically the exception throws when get fails on the hashmap.

The Wolf Launcher was side loaded.

As was the Launcher Manager.

2023-01-09 17:41:20.468 [DEBUG] [v.internal.protocol.shieldtv.ShieldTVMessageParser] - AppPrepend: 30010a590a AppDN: com.wolf.google.lm
2023-01-09 17:41:20.468 [DEBUG] [v.internal.protocol.shieldtv.ShieldTVMessageParser] - AppName: Launcher Manager AppURL: http://192.168.X.X:41723/com.wolf.google.lm

Edit:

Wait. I’m not sure but I think maybe this is the one that was side loader.

2023-01-09 17:41:20.469 [DEBUG] [v.internal.protocol.shieldtv.ShieldTVMessageParser] - AppPrepend: 30010a5c0a AppDN: com.wolf.firelauncher
2023-01-09 17:41:20.469 [DEBUG] [v.internal.protocol.shieldtv.ShieldTVMessageParser] - AppName: Wolf Launcher AppURL: http://192.168.X.X:41723/com.wolf.firelauncher

Nice! Well that is very promising. I’ll probably work on the dynamic channel tomorrow and drop a good clean beta for everyone.

@mhilbush just out of curiosity, did any of the entries look out of alignment? I think I nabbed all the issues I was getting (some were randomly a byte off in either direction for no reason).

Alignment looks fine. But I do see quite a few duplicates (list sorted by me to make the dups more clear).

AppName: AccuWeather AppURL: http://x.x.x.x:41723/com.accuweather.android
AppName: AccuWeather AppURL: http://x.x.x.x:41723/com.accuweather.android
AppName: Amazon Music AppURL: http://x.x.x.x:41723/com.amazon.music.tv
AppName: Amazon Music AppURL: http://x.x.x.x:41723/com.amazon.music.tv
AppName: Downloader AppURL: http://x.x.x.x:41723/com.esaba.downloader
AppName: Downloader AppURL: http://x.x.x.x:41723/com.esaba.downloader
AppName: ESPN AppURL: http://x.x.x.x:41723/com.espn.score_center
AppName: FOX Sports AppURL: http://x.x.x.x:41723/com.foxsports.android
AppName: Freevee AppURL: http://x.x.x.x:41723/com.imdbtv.livingroom
AppName: Fully Kiosk Browser AppURL: http://x.x.x.x:41723/de.ozerov.fully
AppName: Fully Kiosk Browser AppURL: http://x.x.x.x:41723/de.ozerov.fully
AppName: Gallery AppURL: http://x.x.x.x:41723/com.android.gallery3d
AppName: Gallery AppURL: http://x.x.x.x:41723/com.android.gallery3d
AppName: HBO Max AppURL: http://x.x.x.x:41723/com.hbo.hbonow
AppName: Launcher Manager AppURL: http://x.x.x.x:41723/com.wolf.google.lm
AppName: Launcher Manager AppURL: http://x.x.x.x:41723/com.wolf.google.lm
AppName: Live Channels AppURL: http://x.x.x.x:41723/com.google.android.tv
AppName: Live Channels AppURL: http://x.x.x.x:41723/com.google.android.tv
AppName: Netflix AppURL: http://x.x.x.x:41723/com.netflix.ninja
AppName: Netflix AppURL: http://x.x.x.x:41723/com.netflix.ninja
AppName: NVIDIA Games AppURL: http://x.x.x.x:41723/com.nvidia.tegrazone3
AppName: NVIDIA Games AppURL: http://x.x.x.x:41723/com.nvidia.tegrazone3
AppName: Pandora AppURL: http://x.x.x.x:41723/com.pandora.android.atv
AppName: Pandora AppURL: http://x.x.x.x:41723/com.pandora.android.atv
AppName: Peacock TV AppURL: http://x.x.x.x:41723/com.peacocktv.peacockandroid
AppName: Peacock TV AppURL: http://x.x.x.x:41723/com.peacocktv.peacockandroid
AppName: Play Games AppURL: http://x.x.x.x:41723/com.google.android.play.games
AppName: Play Movies & TV AppURL: http://x.x.x.x:41723/com.google.android.videos
AppName: Play Store AppURL: http://x.x.x.x:41723/com.android.vending
AppName: Play Store AppURL: http://x.x.x.x:41723/com.android.vending
AppName: Plex AppURL: http://x.x.x.x:41723/com.plexapp.android
AppName: Plex AppURL: http://x.x.x.x:41723/com.plexapp.android
AppName: Plex Media Server AppURL: http://x.x.x.x:41723/com.plexapp.mediaserver.smb
AppName: Prime Video AppURL: http://x.x.x.x:41723/com.amazon.amazonvideo.livingroom
AppName: Settings AppURL: http://x.x.x.x:41723/com.android.tv.settings
AppName: Showtime Anytime AppURL: http://x.x.x.x:41723/com.showtime.showtimeanytime
AppName: Showtime Anytime AppURL: http://x.x.x.x:41723/com.showtime.showtimeanytime
AppName: SmugMug AppURL: http://x.x.x.x:41723/com.snapwood.smugfolio
AppName: SmugMug AppURL: http://x.x.x.x:41723/com.snapwood.smugfolio
AppName: Spotify AppURL: http://x.x.x.x:41723/com.spotify.tv.android
AppName: Spotify AppURL: http://x.x.x.x:41723/com.spotify.tv.android
AppName: VUDU AppURL: http://x.x.x.x:41723/air.com.vudu.air.DownloaderTablet
AppName: Wolf Launcher AppURL: http://x.x.x.x:41723/com.wolf.firelauncher
AppName: Wolf Launcher AppURL: http://x.x.x.x:41723/com.wolf.firelauncher
AppName: YouTube AppURL: http://x.x.x.x:41723/com.google.android.youtube.tv
AppName: YouTube AppURL: http://x.x.x.x:41723/com.google.android.youtube.tv
AppName: YouTube Music AppURL: http://x.x.x.x:41723/com.google.android.youtube.tvmusic
AppName: YouTube Music AppURL: http://x.x.x.x:41723/com.google.android.youtube.tvmusic```

Well thats interesting. Do you have two shields?

Yes. But they’re in different houses on different networks with different IP addresses. :wink:

Dang, I was hoping you were just getting two lists. I think we’re still ok. The map should deduplicate it right? When youre looking at trace it should be dumping the hashmap still. Are they duplicated there?

In a few minutes I’ll post the TRACE log to you in a PM.

1 Like

Looked at the log. Looks perfect! Not a single thing looks out of whack. The HashMap deduplicated the entire thing as well from what I can tell. Thanks!

For those watching on the sidelines, assuming the dynamic channel bits don’t confuse me too much, and assuming I have the time, ill probably drop a new beta tomorrow for both 4.0.0 and 3.4.0 with all the app additions.

1 Like

Point of amusement for the day. After absolutely crashing my shield about 40 times, I found the power on button! I’ll be adding it to the next beta drop. No, I have not found any of the power off/sleep buttons yet. But, this definitively works to power the shield on from an off state. I also randomly stumbled onto the google assistant activator (I’m assuming a bluetooth mic may be needed for this). Unfortunately I haven’t stumbled on what I was looking for (basically a null button push) which would force the app name to be sent back. As long as you are using OH as your remote, this isn’t really an issue as it sends on almost every button press. However, if OH is just more in monitoring mode, this could be an issue so I am working on trying to find a patch to it.

I’m giving up on bug fixing for now and moving to the dynamic channel so I can try to get this out soon.

Version 0.6 is posted for both 4.0.0 and 3.4.0

This does NOT include the dynamic channels. I didn’t have time to really get into it yet but I wanted to get this update out.

Remember, you will have to rebuild your things to add the new channels.

Please post any issues.

Thanks!

I’ve updated to version 0.7.

This adds the reported Device ID (which I can’t find in the shield on screen GUI but seems to be some sort of unique ID of the server that the binding talks to) as well as the supported system architectures as reported. This also fixes some bits on the certificate parsing/storage process after successful PIN authentication.

I’d appreciate knowing if the PIN process is working or failing for anyone who uses this. The calculation of the length of the keys has been completely reworked and seems to be OK on the dozen or so attempts I’ve made, but it’s a little weird so I’d appreciate knowing it works for others too.

There was no problem with the pin process after I installed the binding.
When I switched to your 0.6 version I even hadn’t to repeat the Pin-Game
with my shield.
But still I or openhab are not able to see wether the shield is running or
not (the “power on problem”). If it’s solved I could get rid of my android debug binding that still causes these messages of not being able to read media and refresh play status… Or would it be possible with your new versions to solve my problem?

Best wishes!

Im glad to hear it’s working. The issue of not having awareness of power state still exists. Simply put, I havent found any specific flag on any message that comes from the shield to indicate power state. It’s definitely something on the todo list. I have one other option I’m going to investigate, but it will require several hours worth of work to identify and then potentially several more hours to code if it does work. If that fails, plan B is to actually integrate the ADB connection into the binding to have it pull that data directly so that happens behind the scenes for the user. I’ll get there eventually, just going to take some time.

No hurry! :grinning:

So good news and bad news.

Good news, I was able to successfully do a MITM on the new Google TV app and I was able to capture some of the parts of the pin process. Getting that going has been a pain but I had a breakthrough today that gives me some hope that this is possible. My plan here is to integrate both protocol stacks and basically hope that one is going to get the data we need. The protocol seems similar to the shield stack so I’m hoping that some of it seems familiar as I go.

Bad news, there are some added complexities I have to figure out with the PKI process. The googletv (version 2) protocol uses mutual TLS certificate authentication which I haven’t had to do yet so I need to figure out how to adapt the binding to do this as the shield protocol doesn’t do it. Why they did this level of complexity is beyond me, it’s a bit overkill. Once I get the authentication parts done then I’m going to have to try to decode the parts of the protocol that I haven’t been exposed to yet. So, this is going to take some time.

To note, for this to work you will have to make sure your apps are updated on your shield. They discontinued support for the version 1 of the protocol in the last few months.

So stay tuned, I’ll try to post some more updates as I hit some milestones.

I’ve started a thread (link below) about converting this binding to be a googletv binding with an option to add the shieldtv protocol as opposed to just being a shieldtv binding. The googletv protocol is available to any androidtv system so it would have a broader reach than just the shield. If anyone would like to comment please feel free: