{"id":194,"date":"2013-12-15T20:45:38","date_gmt":"2013-12-15T20:45:38","guid":{"rendered":"http:\/\/josephpcohen.com\/w\/?p=194"},"modified":"2022-04-10T18:14:37","modified_gmt":"2022-04-10T22:14:37","slug":"glass-analysis","status":"publish","type":"post","link":"https:\/\/josephpcohen.com\/w\/glass-analysis\/","title":{"rendered":"Google Glass Analysis &#8211; Sending Directly to Glass"},"content":{"rendered":"<p>So how does android talk directly to glass?<br \/>\n<!--more--><\/p>\n<pre>$ blucat devices\r\n#Searching for devices\r\n+,F88FCA255988, \"Joseph Glass's Glass\", Trusted:false, Encrypted:false\r\n<\/pre>\n<pre>$ blucat services\r\n#Listing all services\r\n+,F88FCA255988, \"Joseph Glass's Glass\", Trusted:false, Encrypted:false\r\n-,\"Glass Identity\", \"\", btspp:\/\/F88FCA255988:14\r\n-,\"Handsfree\", \"\", btspp:\/\/F88FCA255988:13\r\n<\/pre>\n<p>Looking at the apk file GlassBluetooth.apk shows this line:<\/p>\n<pre>public void onCreate()\r\n  {\r\n    logger.i(\"Starting Glass bluetooth service.\", new Object[0]);\r\n    this.tasks.put(new ConnectivityLogger(this), Boolean.valueOf(false));\r\n    this.tasks.put(new Tethering(this), Boolean.valueOf(false));\r\n    this.tasks.put(new GlassIdentityProfile(this), Boolean.valueOf(false));\r\n    this.tasks.put(new PairingPolicy(this), Boolean.valueOf(false));\r\n    this.tasks.put(new HandsFreeProfile(this), Boolean.valueOf(false));\r\n    this.companion = new CompanionSocketServer(this);\r\n    this.tasks.put(this.companion, Boolean.valueOf(false));\r\n  }\r\n<\/pre>\n<p>This points in interesting directions. The IdentityProfile starts a service that we are interested in:<\/p>\n<pre>public void onBluetoothAdapterEnabled()\r\n  {\r\n    try\r\n    {\r\n      this.listenSocket = HiddenBluetoothAdapter.listenUsingInsecureRfcommOn(14);\r\n<\/pre>\n<p>So this was leading me in circles so I started looking at how SMS messages work and found this line in CompanionSmsManager:<\/p>\n<pre> TimelineNano.TimelineItem localTimelineItem = \r\nCompanionUtils.getCompanionSmsTimelineItem(localContext, str1, str2, str3, l1, bool3, bool2);\r\n              if (!this.forwarder.forward(localTimelineItem))\r\n                break label430;\r\n...\r\n              localFormattingLogger2.d(\"Successfully forwarded notification id=%s with timestamp =%s to Glass.\", arrayOfObject2);\r\n<\/pre>\n<p>Where it&#8217;s defined as CompanionSmsManager.SmsTimelineForwarder forwarder;<\/p>\n<p>Then I found CompanionMessagingUtil<\/p>\n<p>And then googling that found that someone already did this:<\/p>\n<p><a title=\"https:\/\/github.com\/thorikawa\/GlassBluetoothProtocol\" href=\"https:\/\/github.com\/thorikawa\/GlassBluetoothProtocol\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/thorikawa\/GlassBluetoothProtocol<\/a><\/p>\n<p>I put my test app here but it doesn&#8217;t work yet:<\/p>\n<p><a title=\"https:\/\/github.com\/ieee8023\/GlassDirect\" href=\"https:\/\/github.com\/ieee8023\/GlassDirect\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/ieee8023\/GlassDirect<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>So how does android talk directly to glass?<\/p>\n<\/div>","protected":false},"author":1,"featured_media":209,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Google Glass Analysis - Sending Directly to Glass - Joseph Paul Cohen PhD<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/josephpcohen.com\/w\/glass-analysis\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google Glass Analysis - Sending Directly to Glass - Joseph Paul Cohen PhD\" \/>\n<meta property=\"og:description\" content=\"So how does android talk directly to glass?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/josephpcohen.com\/w\/glass-analysis\/\" \/>\n<meta property=\"og:site_name\" content=\"Joseph Paul Cohen PhD\" \/>\n<meta property=\"article:published_time\" content=\"2013-12-15T20:45:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-10T22:14:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/josephpcohen.com\/w\/wp-content\/uploads\/2013\/12\/ic_launcher.png\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Joseph Paul Cohen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joseph Paul Cohen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/josephpcohen.com\/w\/glass-analysis\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/glass-analysis\/\"},\"author\":{\"name\":\"Joseph Paul Cohen\",\"@id\":\"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684\"},\"headline\":\"Google Glass Analysis &#8211; Sending Directly to Glass\",\"datePublished\":\"2013-12-15T20:45:38+00:00\",\"dateModified\":\"2022-04-10T22:14:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/glass-analysis\/\"},\"wordCount\":105,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/josephpcohen.com\/w\/glass-analysis\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/josephpcohen.com\/w\/glass-analysis\/\",\"url\":\"https:\/\/josephpcohen.com\/w\/glass-analysis\/\",\"name\":\"Google Glass Analysis - Sending Directly to Glass - Joseph Paul Cohen PhD\",\"isPartOf\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/#website\"},\"datePublished\":\"2013-12-15T20:45:38+00:00\",\"dateModified\":\"2022-04-10T22:14:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/glass-analysis\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/josephpcohen.com\/w\/glass-analysis\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/josephpcohen.com\/w\/glass-analysis\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/josephpcohen.com\/w\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Google Glass Analysis &#8211; Sending Directly to Glass\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/josephpcohen.com\/w\/#website\",\"url\":\"https:\/\/josephpcohen.com\/w\/\",\"name\":\"Joseph Paul Cohen PhD\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/josephpcohen.com\/w\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684\",\"name\":\"Joseph Paul Cohen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a810b57939e75247f570c9094e7bd16e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a810b57939e75247f570c9094e7bd16e?s=96&d=mm&r=g\",\"caption\":\"Joseph Paul Cohen\"},\"logo\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Google Glass Analysis - Sending Directly to Glass - Joseph Paul Cohen PhD","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/josephpcohen.com\/w\/glass-analysis\/","og_locale":"en_US","og_type":"article","og_title":"Google Glass Analysis - Sending Directly to Glass - Joseph Paul Cohen PhD","og_description":"So how does android talk directly to glass?","og_url":"https:\/\/josephpcohen.com\/w\/glass-analysis\/","og_site_name":"Joseph Paul Cohen PhD","article_published_time":"2013-12-15T20:45:38+00:00","article_modified_time":"2022-04-10T22:14:37+00:00","og_image":[{"width":512,"height":512,"url":"https:\/\/josephpcohen.com\/w\/wp-content\/uploads\/2013\/12\/ic_launcher.png","type":"image\/png"}],"author":"Joseph Paul Cohen","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Joseph Paul Cohen","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/josephpcohen.com\/w\/glass-analysis\/#article","isPartOf":{"@id":"https:\/\/josephpcohen.com\/w\/glass-analysis\/"},"author":{"name":"Joseph Paul Cohen","@id":"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684"},"headline":"Google Glass Analysis &#8211; Sending Directly to Glass","datePublished":"2013-12-15T20:45:38+00:00","dateModified":"2022-04-10T22:14:37+00:00","mainEntityOfPage":{"@id":"https:\/\/josephpcohen.com\/w\/glass-analysis\/"},"wordCount":105,"commentCount":0,"publisher":{"@id":"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/josephpcohen.com\/w\/glass-analysis\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/josephpcohen.com\/w\/glass-analysis\/","url":"https:\/\/josephpcohen.com\/w\/glass-analysis\/","name":"Google Glass Analysis - Sending Directly to Glass - Joseph Paul Cohen PhD","isPartOf":{"@id":"https:\/\/josephpcohen.com\/w\/#website"},"datePublished":"2013-12-15T20:45:38+00:00","dateModified":"2022-04-10T22:14:37+00:00","breadcrumb":{"@id":"https:\/\/josephpcohen.com\/w\/glass-analysis\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/josephpcohen.com\/w\/glass-analysis\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/josephpcohen.com\/w\/glass-analysis\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/josephpcohen.com\/w\/"},{"@type":"ListItem","position":2,"name":"Google Glass Analysis &#8211; Sending Directly to Glass"}]},{"@type":"WebSite","@id":"https:\/\/josephpcohen.com\/w\/#website","url":"https:\/\/josephpcohen.com\/w\/","name":"Joseph Paul Cohen PhD","description":"","publisher":{"@id":"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/josephpcohen.com\/w\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684","name":"Joseph Paul Cohen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a810b57939e75247f570c9094e7bd16e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a810b57939e75247f570c9094e7bd16e?s=96&d=mm&r=g","caption":"Joseph Paul Cohen"},"logo":{"@id":"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/posts\/194"}],"collection":[{"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/comments?post=194"}],"version-history":[{"count":14,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/posts\/194\/revisions"}],"predecessor-version":[{"id":1659,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/posts\/194\/revisions\/1659"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/media\/209"}],"wp:attachment":[{"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/media?parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/categories?post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/tags?post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}