Closed Ton-O closed 2 years ago
Hi!
You can pass them in options of AndroidRemote constructor:
...
let cert = androidRemote.getCertificate(); fs.writeFileSync('key.pem', cert.key); fs.writeFileSync('cert.pem', cert.cert);
...
let key = fs.readFileSync('key.pem'); let cert = fs.readFileSync('cert.pem');
let options = { pairing_port : 6467, remote_port : 6466, name : 'androidtv-remote', cert: {key, cert}, }
let androidRemote = new AndroidRemote(host, options)
If you like my work, don't hesitate to click on 'Donate' ^^
Okay, thanks for your explanation/piece of code. Indeed it more or less that way, just wondered if I missed something that was already in.
As always for me: if I start using the code on a daily basis, I will not hesitate and donate :-)
@Ton-O what is the end goal u r trying to achieve.
I'm quite active in programming extensions (drivers) for my NEEO remotes (https://github.com/Ton-O/NEEO-Meta-Plus) Have tried other Android systems through ADB but that was awfully slow (unusable). Bought GoogleTV recently but did not want to use ADB for that use. Started to look at the API, did some experimenting based on the explanation of Aymkdn) then saw you built everything already;-)
Also, would like to add the possibility to styartup applications on google TV, pretty easy through ADB, but seems to be more complex with this API. Something with Intents, so it seems.
@Ton-O So You are trying to create a Mobile Application to control Google TV
Well, NEEO is an existing and complete remote control platform allowing custom drivers for unknown devices. It uses a physical remote, but also an APP and can be accessed through browser as well.
But in essence: yes I'm creating a driver to remotely control GoogleTV.
First step is "just the remote buttons", then start/stop APPs.
@Ton-O Ohh nice Can u share ur playstore and appstore link.
Sure, but then I need to elaborate a bit on NEEO first. NEEO started as a kickstarter-fundraiser, became moderately successful, then was purchased by big companies who killed the product in favour of their own products. As such, it has become obsolete for them, though still having a reasonable large installed base. Development from vendor's side was halted completely, and community took over. The APP's in use are on android: https://play.google.com/store/apps/details?id=com.neeo.app&gl=NL and on Apple, but that one was removed from the applestore a coupe of months ago.... probably as it was 32-bit only. I'm using both of them.
Let me first start with a warm "Thank you" for this project!
Working great, but I need some guidance on reusing the certificate that is generated during the first pairing request. You're stating: After first succeeded pairing, you can reuse generated certs with getCertificate() by sending it in constructor options. Is the certificate stored somewhere already and if so, on what constructor-part should I add it?
Could you please elaborate on that one?