Skip to content

Commit

Permalink
Merge pull request #8211 from cb1kenobi/timob-23756_5_5_X
Browse files Browse the repository at this point in the history
[TIMOB-23756] (5_5_X) Improved app name and resource name blacklist so you ca…
  • Loading branch information
cheekiatng committed Aug 15, 2016
2 parents 1737a0c + 62c2b60 commit 9d82af1
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ function iOSBuilder() {
'_codesignature',
'embedded.mobileprovision',
'info.plist',
'pkginfo'
'pkginfo',
'assets.car',
'modules',
'LaunchScreen.storyboardc',
'hyperloop'
];

this.graylistDirectories = [
Expand Down Expand Up @@ -1256,7 +1260,13 @@ iOSBuilder.prototype.validate = function (logger, config, cli) {

// make sure the app doesn't have any blacklisted directories or files in the Resources directory and warn about graylisted names
var platformsRegExp = /^(android|ios|iphone|ipad|mobileweb|blackberry|windows|tizen)$/;
this.blacklistDirectories.push(this.tiapp.name);

if (this.blacklistDirectories.indexOf(this.tiapp.name.toLowerCase()) !== -1 || this.tiapp.name.toLowerCase() === 'frameworks') {
logger.error(__('The app name conflicts with a reserved file.'));
logger.error(__('You must change the name of the app in the tiapp.xml.') + '\n');
process.exit(1);
}

[ path.join(this.projectDir, 'Resources'),
path.join(this.projectDir, 'Resources', 'iphone'),
path.join(this.projectDir, 'Resources', 'ios')
Expand All @@ -1272,23 +1282,23 @@ iOSBuilder.prototype.validate = function (logger, config, cli) {

if (this.blacklistDirectories.indexOf(lcaseFilename) !== -1) {
if (isDir) {
logger.error(__('Found blacklisted directory in the Resources directory'));
logger.error(__('Found blacklisted directory in the Resources directory.'));
logger.error(__('The directory "%s" is a reserved directory.', filename));
logger.error(__('You must rename this directory to something else.') + '\n');
} else {
logger.error(__('Found blacklisted file in the Resources directory'));
logger.error(__('Found blacklisted file in the Resources directory.'));
logger.error(__('The file "%s" is a reserved file.', filename));
logger.error(__('You must rename this file to something else.') + '\n');
}
process.exit(1);
} else if (this.graylistDirectories.indexOf(lcaseFilename) !== -1) {
if (isDir) {
logger.warn(__('Found graylisted directory in the Resources directory'));
logger.warn(__('Found graylisted directory in the Resources directory.'));
logger.warn(__('The directory "%s" is potentially a reserved directory.', filename));
logger.warn(__('There is a good chance your app will be rejected by Apple.'));
logger.warn(__('It is highly recommended you rename this directory to something else.'));
} else {
logger.warn(__('Found graylisted file in the Resources directory'));
logger.warn(__('Found graylisted file in the Resources directory.'));
logger.warn(__('The file "%s" is potentially a reserved file.', filename));
logger.warn(__('There is a good chance your app will be rejected by Apple.'));
logger.warn(__('It is highly recommended you rename this file to something else.'));
Expand Down

0 comments on commit 9d82af1

Please sign in to comment.