Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MerrickZ committed Oct 24, 2014
1 parent 8943a0e commit 6cfd87a
Show file tree
Hide file tree
Showing 1,012 changed files with 145,816 additions and 308 deletions.
44 changes: 20 additions & 24 deletions 2.0/project/one2/config.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="one" version="2.2.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>ONE</name>
<description>
ONE Unofficial App.
</description>
<name xml:lang="zh-CN">一个</name>
<author email="[email protected]" href="http://about.me/anpho">
anpho
</author>
<content src="index.html" />
<icon src="img/logo.png" />
<access origin="*" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="false" />
<preference name="WebSecurity" value="disable"/>
<preference name="AutoHideSplashScreen" value="false" />

<rim:splash src="img/splash-1280x768.png"/>
<rim:splash src="img/splash-1280x720.png"/>
<rim:splash src="img/splash-768x1280.png"/>
<rim:splash src="img/splash-720x1280.png"/>
<rim:splash src="img/splash-720x720.png"/>
</widget>
<widget id="one"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0" version="2.2.10">
<name>ONE</name>
<name xml:lang="zh-CN">一个</name>
<description>ONE Unofficial App.</description>
<rim:splash src="img/splash-1280x768.png"/>
<rim:splash src="img/splash-1280x720.png"/>
<rim:splash src="img/splash-768x1280.png"/>
<rim:splash src="img/splash-720x1280.png"/>
<rim:splash src="img/splash-720x720.png"/>
<content src="index.html"/>
<icon src="img/logo.png"/>
<access origin="*"/>
<preference name="fullscreen" value="true"/>
<preference name="webviewbounce" value="false"/>
<preference name="WebSecurity" value="disable"/>
<preference name="AutoHideSplashScreen" value="false"/>
<author email="[email protected]" href="http://about.me/anpho">anpho</author>
</widget>
Binary file added 2.0/project/one2/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion 2.0/project/one2/platforms/blackberry10/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.1.0.13
v2.2.0.15
Binary file not shown.
Binary file not shown.
79 changes: 0 additions & 79 deletions 2.0/project/one2/platforms/blackberry10/build/options

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
<<COMMENT
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-->
<!--
Widget Configuration Reference:
http://docs.blackberry.com/en/developers/deliverables/15274/
https://developer.blackberry.com/html5/documentation/v2_1/config_doc_elements.html
-->
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
Expand Down
4 changes: 3 additions & 1 deletion 2.0/project/one2/platforms/blackberry10/cordova/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ try {
keystorepass = session.getKeyStorePass(command),
err;

copyArgIfExists("buildId");
copyArgIfExists("signing");

if (command.release) {
copyArgIfExists("buildId");
if (command.signing) {
//Note: Packager refers to signing password as "password" not "keystorepass"
bbwpArgv.push("--password");
Expand Down
19 changes: 10 additions & 9 deletions 2.0/project/one2/platforms/blackberry10/cordova/lib/cmdline.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var command = require("commander"),

command
.version('1.0.0.0')
.usage('[drive:][path]archive [-s [dir]] [[ -g genpassword] [-buildId num]] [-o dir] [-d] [-p paramsjsonfile]')
.usage('[drive:][path]archive [-s [dir]] [[ -g genpassword] [-buildId num]] [-o dir] [-d] [-p paramsjsonfile] [--signing]')
.option('-s, --source [dir]', 'Save source. The default behavior is to not save the source files. If dir is specified then creates dir\\src\\ directory structure. If no dir specified then the path of archive is assumed')
.option('-g, --password <password>', 'Signing key password')
.option('-buildId <num>', '[deprecated] Use --buildId.')
Expand All @@ -30,7 +30,8 @@ command
.option('-p, --params <params JSON file>', 'Specifies additional parameters to pass to downstream tools.')
.option('--appdesc <filepath>', 'Optionally specifies the path to the bar descriptor file (bar-descriptor.xml). For internal use only.')
.option('-v, --verbose', 'Turn on verbose messages')
.option('-l, --loglevel <loglevel>', 'set the logging level (error, warn, verbose)');
.option('-l, --loglevel <loglevel>', 'set the logging level (error, warn, verbose)')
.option('--signing', 'indicates the build process is trying to sign the app'); // --signing won't be passed to blackberry-nativepackager, package-validator.js uses this flag to check indicate if it is signing

function parseArgs(args) {
var option,
Expand All @@ -50,14 +51,14 @@ function parseArgs(args) {
command.parse(args);

//Check for any invalid command line args
for (i = 0; i < args.length; i++) {
//Remove leading dashes if any
option = args[i].substring(2);
if (args[i].indexOf("--") === 0 && !command[option]) {
throw localize.translate("EXCEPTION_CMDLINE_ARG_INVALID", args[i]);
args.forEach(function (arg) {
if (typeof arg === "string" && arg.indexOf("--") === 0) {
var option = arg.substring(2);
if (!command[option]) {
throw localize.translate("EXCEPTION_CMDLINE_ARG_INVALID", arg);
}
}
}

});
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function processWidgetData(data, widgetConfig, session) {
widgetConfig.autoDeferNetworkingAndJavaScript = true;
widgetConfig.theme = "default";
widgetConfig.autoHideSplashScreen = "true";
widgetConfig.useSpatialNavigation = false;

//set locally available features to access list
if (data.feature) {
Expand Down Expand Up @@ -539,6 +540,7 @@ function processNameAndDescription(data, widgetConfig) {
function processCordovaPreferences(data, widgetConfig) {
if (data.preference) {
var preference = JSON.parse(JSON.stringify(processParamObj(data.preference)).toLowerCase()),
spatialNavigation = preference.spatialnavigation,
hideFormControl = preference.hidekeyboardformaccessorybar;

widgetConfig.packageCordovaJs = preference.packagecordovajs === "enable";
Expand All @@ -555,7 +557,7 @@ function processCordovaPreferences(data, widgetConfig) {
}

// <preference name="HideKeyboardFormAccessoryBar" value="enable/true or disable/false" />
if (preference.hidekeyboardformaccessorybar) {
if (hideFormControl) {
widgetConfig.enableFormControl = (hideFormControl !== 'enable') && (hideFormControl !== 'true');
}

Expand Down Expand Up @@ -591,6 +593,11 @@ function processCordovaPreferences(data, widgetConfig) {
if (preference.diskcache) {
widgetConfig.enableDiskCache = (preference.diskcache === 'enable');
}

// <preference name="spatialNavigation" value="enable/true or disable/false" />
if (spatialNavigation) {
widgetConfig.useSpatialNavigation = (spatialNavigation === 'enable') || (spatialNavigation === 'true');
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ var Localize = require("localize"),
"en": "Build ID set in config.xml [version], but signing key file was not found: $[1]"
},
"EXCEPTION_MISSING_SIGNING_PASSWORD": {
"en": "Cannot sign application - No signing password provided [-g]"
"en": "Cannot sign application - No signing password provided [--keystorepass]"
},
"WARNING_SIGNING_PASSWORD_EXPECTED": {
"en": "Build ID set in config.xml [version], but no signing password was provided [-g]. Bar will be unsigned"
"en": "Build ID set in config.xml [version], but no signing password was provided [--keystorepass]. Bar will be unsigned"
},
"EXCEPTION_DEBUG_TOKEN_NOT_FOUND": {
"en": "Failed to find debug token. If you have an existing debug token, please copy it to $[1]/.cordova/blackberry10debugtoken.bar. To generate a new debug token, execute the 'run' command."
"en": "Failed to find debug token. If you have an existing debug token, please copy it to $[1]. To generate a new debug token, execute the 'run' command."
},
"EXCEPTION_DEBUG_TOKEN_WRONG_FILE_EXTENSION": {
"en": "Specified debug token not a .bar extension"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function generateOptionsFile(session, target, config) {
optionsStr += "-debugToken" + NL;
optionsStr += conf.DEBUG_TOKEN + NL;
} else {
logger.warn(localize.translate("EXCEPTION_DEBUG_TOKEN_NOT_FOUND", pkgrUtils.homedir()));
logger.warn(localize.translate("EXCEPTION_DEBUG_TOKEN_NOT_FOUND", path.join(pkgrUtils.homedir(), '.cordova', 'blackberry10debugtoken.bar')));
}
optionsStr += "-devMode" + NL;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ _self = {
keysPassword = session.storepass && typeof session.storepass === "string",
commandLinebuildId = session.buildId && typeof session.buildId === "string",//--buildId
buildId = widgetConfig.buildId && typeof widgetConfig.buildId === "string",//Finalized Build ID
signing = session.signing,

//Constants
AUTHOR_P12 = "author.p12",
Expand All @@ -55,35 +56,37 @@ _self = {
throw localize.translate("EXCEPTION_MISSING_SIGNING_KEY_FILE", file);
};

//If -g <password> or --buildId is set, but signing key files are missing, throw an error
if (keysPassword || commandLinebuildId) {
if (!keysFound) {
signingFileError(AUTHOR_P12);
} else if (keysDefault && !cskFound && !bbidFound) {
//Only warn about BBID since the old tokens are deprecated
signingFileError(BARSIGNER_BBID);
} else if (keysDefault && cskFound && !dbFound) {
signingFileError(BARSIGNER_DB);
}
if (signing) {
//If -g <password> or --buildId is set, but signing key files are missing, throw an error
if ((keysPassword || commandLinebuildId)) {
if (!keysFound) {
signingFileError(AUTHOR_P12);
} else if (keysDefault && !cskFound && !bbidFound) {
//Only warn about BBID since the old tokens are deprecated
signingFileError(BARSIGNER_BBID);
} else if (keysDefault && cskFound && !dbFound) {
signingFileError(BARSIGNER_DB);
}

//If a buildId exists in config, but no keys were found, throw a warning
} else if (buildId) {
if (!keysFound) {
signingFileWarn(AUTHOR_P12);
} else if (keysDefault && !cskFound && !bbidFound) {
//Only warn about BBID since the old tokens are deprecated
signingFileWarn(BARSIGNER_BBID);
} else if (keysDefault && cskFound && !dbFound) {
signingFileWarn(BARSIGNER_DB);
//If a buildId exists in config, but no keys were found, throw a warning
} else if (buildId) {
if (!keysFound) {
signingFileWarn(AUTHOR_P12);
} else if (keysDefault && !cskFound && !bbidFound) {
//Only warn about BBID since the old tokens are deprecated
signingFileWarn(BARSIGNER_BBID);
} else if (keysDefault && cskFound && !dbFound) {
signingFileWarn(BARSIGNER_DB);
}
}
}

if (commandLinebuildId && !keysPassword) {
//if --buildId was provided with NO password, throw error
throw localize.translate("EXCEPTION_MISSING_SIGNING_PASSWORD");
if (commandLinebuildId && !keysPassword) {
//if --buildId was provided with NO password, throw error
throw localize.translate("EXCEPTION_MISSING_SIGNING_PASSWORD");
}
}

//if --appdesc was provided, but the file is not existing, throw an error
//if --appdesc was provided, but the file does not exist, throw an error
if (session.appdesc && !fs.existsSync(session.appdesc)) {
throw localize.translate("EXCEPTION_APPDESC_NOT_FOUND", session.appdesc);
}
Expand Down
Loading

0 comments on commit 6cfd87a

Please sign in to comment.