├── package.json ├── LICENSE ├── isgame.js ├── README.md └── plugin.xml /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.3", 3 | "name": "com.hughisaacs2.cordova.plugins.androidtvplugin", 4 | "cordova_name": "AndroidTVPlugin", 5 | "description": "Cordova Android TV Plugin", 6 | "platforms": [ 7 | "android" 8 | ], 9 | "engines": [ 10 | { 11 | "name": "cordova", 12 | "version": ">=3.0.0" 13 | } 14 | ], 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/HughIsaacs2/Cordova-Android-TV-Plugin.git" 18 | }, 19 | "keywords": [ 20 | "ecosystem:cordova", 21 | "cordova-android" 22 | ], 23 | "author": "Hugh Isaacs II", 24 | "license": "MIT", 25 | "bugs": { 26 | "url": "https://github.com/HughIsaacs2/Cordova-Android-TV-Plugin/issues" 27 | }, 28 | "homepage": "https://github.com/HughIsaacs2/Cordova-Android-TV-Plugin" 29 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /isgame.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | module.exports = function(context) { 4 | 5 | var fs = context.requireCordovaModule('fs'), 6 | path = context.requireCordovaModule('path'); 7 | 8 | var platformRoot = path.join(context.opts.projectRoot, 'platforms/android'); 9 | 10 | 11 | var manifestFile = path.join(platformRoot, 'AndroidManifest.xml'); 12 | 13 | if (fs.existsSync(manifestFile)) { 14 | 15 | fs.readFile(manifestFile, 'utf8', function (err,data) { 16 | if (err) { 17 | throw new Error('Unable to find AndroidManifest.xml: ' + err); 18 | } 19 | 20 | var result; 21 | 22 | if (!(/]*\bandroid:isGame="true"/).test(data)) { 23 | 24 | result = data.replace(/ 2 | 6 | 7 | AndroidTVPlugin 8 | Cordova Android TV Plugin 9 | Hugh Isaacs II 10 | MIT 11 | ecosystem:cordova,cordova-android 12 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | --------------------------------------------------------------------------------