Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start apps #5

Open
Hjord opened this issue Jul 16, 2017 · 8 comments
Open

Start apps #5

Hjord opened this issue Jul 16, 2017 · 8 comments

Comments

@Hjord
Copy link

Hjord commented Jul 16, 2017

Is it possible to start installed apps with this?

@nstrelow
Copy link

nstrelow commented Sep 5, 2017

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.

@SagosHiron
Copy link

Anyone got any luck running apps remotely?

@nstrelow
Copy link

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

@SagosHiron
Copy link

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

@kipe
Copy link

kipe commented Mar 5, 2018

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"
		}
	}
}

@nstrelow
Copy link

nstrelow commented Mar 5, 2018

Amazing! Thanks so much 😁

@nstrelow
Copy link

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 💯

@kipe
Copy link

kipe commented Oct 24, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants