1 Star 0 Fork 1

Android-TV / Cordova-Android-TV-Plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
isgame.js 1008 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env node
module.exports = function(context) {
var fs = context.requireCordovaModule('fs'),
path = context.requireCordovaModule('path');
var platformRoot = path.join(context.opts.projectRoot, 'platforms/android');
var manifestFile = path.join(platformRoot, 'AndroidManifest.xml');
if (fs.existsSync(manifestFile)) {
fs.readFile(manifestFile, 'utf8', function (err,data) {
if (err) {
throw new Error('Unable to find AndroidManifest.xml: ' + err);
}
var result;
if (!(/<application[^>]*\bandroid:isGame="true"/).test(data)) {
result = data.replace(/<application/g, '<application android:isGame="true"');
}
else {
result = data;
}
fs.writeFile(manifestFile, result, 'utf8', function (err) {
if (err) throw new Error('Unable to write into AndroidManifest.xml: ' + err);
})
});
}
};
Android
1
https://gitee.com/Android-TV/Cordova-Android-TV-Plugin.git
git@gitee.com:Android-TV/Cordova-Android-TV-Plugin.git
Android-TV
Cordova-Android-TV-Plugin
Cordova-Android-TV-Plugin
master

搜索帮助