philips_android_tv icon indicating copy to clipboard operation
philips_android_tv copied to clipboard

Start apps

Open Hjord opened this issue 8 years ago • 8 comments

Is it possible to start installed apps with this?

Hjord avatar Jul 16 '17 10:07 Hjord

It is possible judging from the Android TV remote app. GET activities/current returns {'component': {'className': 'com.google.android.apps.youtube.tv.cobalt.activity.ShellActivity', 'packageName': 'com.google.android.youtube.tv'}}

POST activities/launch That payload needs to be send to the TV. The TV should then execute the following code: intent.setComponent(new ComponentName(pkgName, classPathToActivity) So exactly the same thing the get is returning.

But I get a Bad Request 400, when posting it like this.

nstrelow avatar Sep 05 '17 12:09 nstrelow

Anyone got any luck running apps remotely?

SagosHiron avatar Feb 13 '18 22:02 SagosHiron

Any luck @fliphess ? Tried also MITM the hell out of the Android app, but I just can't get it to work

nstrelow avatar Feb 14 '18 21:02 nstrelow

I was thinking about deploying some kind of web service onto TV that would run those intents. Over HTTP.

SagosHiron avatar Feb 14 '18 21:02 SagosHiron

Hey, I managed to figure this out, you need to send the whole intent to the endpoint.

To fetch all the available applications, do a GET applications request. There the interesting part is intent. Once that is sent to POST applications/launch, the application actually launches.

For example, the application for Finnish channel MTV is presented like this in the applications endpoint (prettified for your pleasure):

{
	"id": "fi.mtvkatsomo.androidtv.MainActivity-fi.mtvkatsomo",
	"type": "app",
	"intent": {
		"action": "empty",
		"component": {
			"className": "fi.mtvkatsomo.androidtv.MainActivity",
			"packageName": "fi.mtvkatsomo"
		}
	},
	"order": 0,
	"label": "MTV Katsomo"
}

To change to Katsomo app, POST request must be done to the applications/launch -endpoint with content

{
	"intent": {
		"action": "empty",
		"component": {
			"className": "fi.mtvkatsomo.androidtv.MainActivity",
			"packageName": "fi.mtvkatsomo"
		}
	}
}

kipe avatar Mar 05 '18 18:03 kipe

Amazing! Thanks so much :grin:

nstrelow avatar Mar 05 '18 18:03 nstrelow

Started playing around with this again Actually it is "activities/launch" endpoint to start the app (at least on 43pus6401) with the payload you shared 💯

nstrelow avatar Oct 23 '18 22:10 nstrelow

Oh, sorry. That was a typo in my previous message.

kipe avatar Oct 24 '18 02:10 kipe