http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/TokenizedPath.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/TokenizedPath.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/TokenizedPath.as new file mode 100644 index 0000000..e5f8c3d --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/TokenizedPath.as @@ -0,0 +1,221 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +*/ + +package org.apache.flex.ant.tags.filesetClasses +{ + import flash.filesystem.File; + + import org.apache.flex.ant.Ant; + import org.apache.flex.ant.tags.filesetClasses.FileUtils; + import org.apache.flex.ant.tags.filesetClasses.exceptions.BuildException; + import org.apache.flex.ant.tags.filesetClasses.exceptions.IOException; + + /** + * Ported from org.apache.tools.ant.types.selectors.TokenizedPath.java on 12/3/13; + * Container for a path that has been split into its components. + * @since 1.8.0 + */ + public class TokenizedPath { + + /** + * Instance that holds no tokens at all. + */ + public static const EMPTY_PATH:TokenizedPath = + new TokenizedPath("").init("", new Vector.<String>()); + + /** Helper. */ + private static const FILE_UTILS:FileUtils = FileUtils.getFileUtils(); + /** Helper. */ + /** iterations for case-sensitive scanning. */ + private static const CS_SCAN_ONLY:Vector.<Boolean> = new Vector.<Boolean>([true]); + /** iterations for non-case-sensitive scanning. */ + private static const CS_THEN_NON_CS:Vector.<Boolean> = new Vector.<Boolean>([true, false]); + + private var path:String; + private var tokenizedPath:Vector.<String>; + + /** + * Initialize the TokenizedPath by parsing it. + * @param path The path to tokenize. Must not be + * <code>null</code>. + */ + public function TokenizedPath(path:String) { + init(path, SelectorUtils.tokenizePathAsArray(path)); + } + + /** + * Creates a new path as a child of another path. + * + * @param parent the parent path + * @param child the child, must not contain the file separator + */ + public function initAsChild(parent:TokenizedPath, child:String):TokenizedPath { + if (parent.path.length > 0 + && parent.path.charAt(parent.path.length - 1) + != File.separator) { + path = parent.path + File.separator + child; + } else { + path = parent.path + child; + } + tokenizedPath = parent.tokenizedPath.slice(); + tokenizedPath.push(child); + return this; + } + + /* package */ public function init(path:String, tokens:Vector.<String>):TokenizedPath { + this.path = path; + this.tokenizedPath = tokens; + return this; + } + + /** + * @return The original path String + */ + public function toString():String { + return path; + } + + /** + * The depth (or length) of a path. + */ + public function depth():int { + return tokenizedPath.length; + } + + /* package */ public function getTokens():Vector.<String> { + return tokenizedPath; + } + + /** + * From <code>base</code> traverse the filesystem in order to find + * a file that matches the given name. + * + * @param base base File (dir). + * @param cs whether to scan case-sensitively. + * @return File object that points to the file in question or null. + */ + public function findFile(base:File, cs:Boolean):File { + var tokens:Vector.<String> = tokenizedPath; + if (FileUtils.isAbsolutePath(path)) { + if (base == null) { + var s:Vector.<String> = FILE_UTILS.dissect(path); + base = new File(s[0]); + tokens = SelectorUtils.tokenizePathAsArray(s[1]); + } else { + var f:File = FILE_UTILS.normalize(path); + var n:String = FILE_UTILS.removeLeadingPath(base, f); + if (n == f.nativePath) { + //removing base from path yields no change; path + //not child of base + return null; + } + tokens = SelectorUtils.tokenizePathAsArray(n); + } + } + return TokenizedPath.findFile(base, tokens, cs); + } + + + /** + * Do we have to traverse a symlink when trying to reach path from + * basedir? + * @param base base File (dir). + */ + public function isSymlink(base:File):Boolean { + for (var i:int = 0; i < tokenizedPath.length; i++) { + try { + if ((base != null + && new File(base.nativePath + File.separator + tokenizedPath[i]).isSymbolicLink) + || + (base == null + && new File(tokenizedPath[i]).isSymbolicLink) + ) { + return true; + } + base = new File(base + File.separator + tokenizedPath[i]); + } catch (ioe:IOException) { + var msg:String = "IOException caught while checking " + + "for links, couldn't get canonical path!"; + // will be caught and redirected to Ant's logging system + Ant.currentAnt.output(msg); + } + } + return false; + } + + /** + * true if the original paths are equal. + */ + public function equals(o:Object):Boolean { + return o is TokenizedPath + && path == TokenizedPath(o).path; + } + + /** + * From <code>base</code> traverse the filesystem in order to find + * a file that matches the given stack of names. + * + * @param base base File (dir) - must not be null. + * @param pathElements array of path elements (dirs...file). + * @param cs whether to scan case-sensitively. + * @return File object that points to the file in question or null. + */ + private static function findFile(base:File, pathElements:Vector.<String>, + cs:Boolean):File { + for (var current:int = 0; current < pathElements.length; current++) { + if (!base.isDirectory) { + return null; + } + var arr:Array = base.getDirectoryListing(); + var arr2:Array = []; + for each (var f:File in arr) + arr2.push(f.nativePath); + var files:Vector.<String> = Vector.<String>(arr2); + if (files == null) { + throw new BuildException("IO error scanning directory " + + base.nativePath); + } + var found:Boolean = false; + var matchCase:Vector.<Boolean> = cs ? CS_SCAN_ONLY : CS_THEN_NON_CS; + for (var i:int = 0; !found && i < matchCase.length; i++) { + for (var j:int = 0; !found && j < files.length; j++) { + if (matchCase[i] + ? files[j] == pathElements[current] + : files[j].toUpperCase() == pathElements[current].toUpperCase()) { + base = new File(base.nativePath + File.separator + files[j]); + found = true; + } + } + } + if (!found) { + return null; + } + } + return pathElements.length == 0 && !base.isDirectory ? null : base; + } + + /** + * Creates a TokenizedPattern from the same tokens that make up + * this path. + */ + public function toPattern():TokenizedPattern { + return new TokenizedPattern(path).init(path, tokenizedPath); + } + + } +} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/TokenizedPattern.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/TokenizedPattern.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/TokenizedPattern.as new file mode 100644 index 0000000..3055dbb --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/TokenizedPattern.as @@ -0,0 +1,173 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +*/ + +package org.apache.flex.ant.tags.filesetClasses +{ + import flash.filesystem.File; + import org.apache.flex.ant.tags.filesetClasses.exceptions.IllegalStateException; + + /** + * Ported from org.apache.tools.ant.types.selector.TokenizedPattern.java on 12/3/13. + * Provides reusable path pattern matching. PathPattern is preferable + * to equivalent SelectorUtils methods if you need to execute multiple + * matching with the same pattern because here the pattern itself will + * be parsed only once. + * @see SelectorUtils#matchPath(String, String) + * @see SelectorUtils#matchPath(String, String, boolean) + * @since 1.8.0 + */ + public class TokenizedPattern { + + /** + * Instance that holds no tokens at all. + */ + public static const EMPTY_PATTERN:TokenizedPattern = + new TokenizedPattern("").init("", new Vector.<String>()); + + private var pattern:String; + private var tokenizedPattern:Vector.<String>; + + /** + * Initialize the PathPattern by parsing it. + * @param pattern The pattern to match against. Must not be + * <code>null</code>. + */ + public function TokenizedPattern(pattern:String) { + init(pattern, SelectorUtils.tokenizePathAsArray(pattern)); + } + + public function init(pattern:String, tokens:Vector.<String>):TokenizedPattern { + this.pattern = pattern; + this.tokenizedPattern = tokens; + return this; + } + + /** + * Tests whether or not a given path matches a given pattern. + * + * @param path The path to match, as a String. Must not be + * <code>null</code>. + * @param isCaseSensitive Whether or not matching should be performed + * case sensitively. + * + * @return <code>true</code> if the pattern matches against the string, + * or <code>false</code> otherwise. + */ + public function matchPath(path:TokenizedPath, isCaseSensitive:Boolean):Boolean { + return SelectorUtils.matchPathVectors(tokenizedPattern, path.getTokens(), + isCaseSensitive); + } + + /** + * Tests whether or not this pattern matches the start of + * a path. + */ + public function matchStartOf(path:TokenizedPath, + caseSensitive:Boolean):Boolean { + return SelectorUtils.matchPatternStartVectors(tokenizedPattern, + path.getTokens(), caseSensitive); + } + + /** + * @return The pattern String + */ + public function toString():String { + return pattern; + } + + public function getPattern():String { + return pattern; + } + + /** + * true if the original patterns are equal. + */ + public function equals(o:Object):Boolean { + return o is TokenizedPattern + && pattern == TokenizedPattern(o).pattern; + } + + /** + * The depth (or length) of a pattern. + */ + public function depth():int { + return tokenizedPattern.length; + } + + /** + * Does the tokenized pattern contain the given string? + */ + public function containsPattern(pat:String):Boolean { + for (var i:int = 0; i < tokenizedPattern.length; i++) { + if (tokenizedPattern[i] == pat) { + return true; + } + } + return false; + } + + /** + * Returns a new TokenizedPath where all tokens of this pattern to + * the right containing wildcards have been removed + * @return the leftmost part of the pattern without wildcards + */ + public function rtrimWildcardTokens():TokenizedPath { + var sb:String = ""; + var newLen:int = 0; + for (; newLen < tokenizedPattern.length; newLen++) { + if (SelectorUtils.hasWildcards(tokenizedPattern[newLen])) { + break; + } + if (newLen > 0 + && sb.charAt(sb.length - 1) != File.separator) { + sb += File.separator; + } + sb += tokenizedPattern[newLen]; + } + if (newLen == 0) { + return TokenizedPath.EMPTY_PATH; + } + var newPats:Vector.<String> = tokenizedPattern.slice(0, newLen); + return new TokenizedPath("").init(sb, newPats); + } + + /** + * true if the last token equals the given string. + */ + public function endsWith(s:String):Boolean { + return tokenizedPattern.length > 0 + && tokenizedPattern[tokenizedPattern.length - 1] == s; + } + + /** + * Returns a new pattern without the last token of this pattern. + */ + public function withoutLastToken():TokenizedPattern { + if (tokenizedPattern.length == 0) { + throw new IllegalStateException("cant strip a token from nothing"); + } else if (tokenizedPattern.length == 1) { + return EMPTY_PATTERN; + } else { + var toStrip:String = tokenizedPattern[tokenizedPattern.length - 1]; + var index:int = pattern.lastIndexOf(toStrip); + var tokens:Vector.<String> = tokenizedPattern.slice(0, tokenizedPattern.length - 1); + return new TokenizedPattern("").init(pattern.substring(0, index), tokens); + } + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/BuildException.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/BuildException.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/BuildException.as new file mode 100644 index 0000000..6be2bc5 --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/BuildException.as @@ -0,0 +1,28 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.ant.tags.filesetClasses.exceptions +{ + public class BuildException extends Error + { + public function BuildException(message:String) + { + super(message); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/IOException.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/IOException.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/IOException.as new file mode 100644 index 0000000..0eb329d --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/IOException.as @@ -0,0 +1,28 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.ant.tags.filesetClasses.exceptions +{ + public class IOException extends Error + { + public function IOException(message:String) + { + super(message); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/IllegalStateException.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/IllegalStateException.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/IllegalStateException.as new file mode 100644 index 0000000..5d00f7f --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/IllegalStateException.as @@ -0,0 +1,28 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.ant.tags.filesetClasses.exceptions +{ + public class IllegalStateException extends Error + { + public function IllegalStateException(message:String) + { + super(message); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/UnsupportedOperationException.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/UnsupportedOperationException.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/UnsupportedOperationException.as new file mode 100644 index 0000000..b885fac --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/exceptions/UnsupportedOperationException.as @@ -0,0 +1,28 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.ant.tags.filesetClasses.exceptions +{ + public class UnsupportedOperationException extends Error + { + public function UnsupportedOperationException() + { + super("UnsupportedOperationException"); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/FileSetTaskHandler.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/FileSetTaskHandler.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/FileSetTaskHandler.as new file mode 100644 index 0000000..f3a361c --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/FileSetTaskHandler.as @@ -0,0 +1,166 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.ant.tags.supportClasses +{ + import flash.events.Event; + import flash.events.ProgressEvent; + import flash.filesystem.File; + + import org.apache.flex.ant.tags.FileSet; + + /** + * The base class for ITagHandlers that do work with filesets + */ + public class FileSetTaskHandler extends TaskHandler + { + public function FileSetTaskHandler() + { + } + + private var current:int = 0; + private var currentFile:int; + private var currentList:Vector.<String>; + private var currentDir:File; + private var totalFiles:int; + private var thisFile:int; + + /** + * Do the work. + * TaskHandlers lazily create their children + * and attributes so + * super.execute() should be called before + * doing any real work. + */ + override public function execute(callbackMode:Boolean, context:Object):Boolean + { + super.execute(callbackMode, context); + totalFiles = 0; + thisFile = 0; + for (var i:int = 0; i < numChildren; i++) + { + var fs:FileSet = getChildAt(i) as FileSet; + if (fs) + { + try + { + var list:Vector.<String> = fs.getValue(context) as Vector.<String>; + if (list) + { + totalFiles += list.length; + } + } + catch (e:Error) + { + if (failonerror) + { + ant.project.failureMessage = e.message; + ant.project.status = false; + return true; + } + } + } + } + if (numChildren) + outputTotal(totalFiles); + actOnFileSets(); + return !callbackMode; + } + + protected function outputTotal(total:int):void + { + + } + + private function actOnFileSets():void + { + if (current == numChildren) + { + dispatchEvent(new Event(Event.COMPLETE)); + return; + } + + while (current < numChildren) + { + var fs:FileSet = getChildAt(current++) as FileSet; + if (fs) + { + var list:Vector.<String> = fs.getValue(context) as Vector.<String>; + if (list) + { + try { + currentDir = new File(fs.dir); + } + catch (e:Error) + { + ant.output(fs.dir); + ant.output(e.message); + if (failonerror) + { + ant.project.failureMessage = e.message; + ant.project.status = false; + } + dispatchEvent(new Event(Event.COMPLETE)); + return; + } + currentFile = 0; + currentList = list; + actOnList(); + if (callbackMode) + return; + } + } + } + + if (current == numChildren) + { + dispatchEvent(new Event(Event.COMPLETE)); + return; + } + } + + private function actOnList():void + { + if (currentFile == currentList.length) + { + ant.functionToCall = actOnFileSets; + ant.dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS, false, false, thisFile, totalFiles)); + return; + } + + while (currentFile < currentList.length) + { + ant.progressClass = this; + var fileName:String = currentList[currentFile++]; + ant.dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS, false, false, thisFile, totalFiles)); + actOnFile(currentDir.nativePath, fileName); + thisFile++; + if (callbackMode) + { + ant.functionToCall = actOnList; + return; + } + } + } + + protected function actOnFile(dir:String, fileName:String):void + { + + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/IValueTagHandler.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/IValueTagHandler.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/IValueTagHandler.as new file mode 100644 index 0000000..49b0fec --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/IValueTagHandler.as @@ -0,0 +1,36 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.ant.tags.supportClasses +{ + import org.apache.flex.xml.ITagHandler; + + /** + * The interface for ITagHandlers that return a value + */ + public interface IValueTagHandler extends ITagHandler + { + /** + * Return a value based on the attributes and children. + * @param context Object A object of properties and values + * @return Object The computed value. Often a Boolean but + * always. + */ + function getValue(context:Object):Object; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/NamedTagHandler.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/NamedTagHandler.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/NamedTagHandler.as new file mode 100644 index 0000000..f4d803a --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/NamedTagHandler.as @@ -0,0 +1,39 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.ant.tags.supportClasses +{ + /** + * Base class for ITagHandlers that have a name attribute. + */ + public class NamedTagHandler extends ParentTagHandler + { + public function NamedTagHandler() + { + } + + /** + * The name property. + */ + public function get name():String + { + return getNullOrAttributeValue("@name"); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/ParentTagHandler.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/ParentTagHandler.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/ParentTagHandler.as new file mode 100644 index 0000000..ec462cc --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/ParentTagHandler.as @@ -0,0 +1,57 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.ant.tags.supportClasses +{ + import org.apache.flex.xml.IParentTagHandler; + import org.apache.flex.xml.ITagHandler; + + /** + * The base class for ITagHandlers that have children + */ + public class ParentTagHandler extends TagHandler implements IParentTagHandler + { + private var children:Array; + + public function addChild(child:ITagHandler):ITagHandler + { + if (children == null) + children = [ child ]; + else + children.push(child); + return child; + } + + public function getChildAt(index:int):ITagHandler + { + return children[index]; + } + + public function removeChildren():void + { + children = null; + } + + public function get numChildren():int + { + if (!children) return 0; + + return children.length; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TagHandler.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TagHandler.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TagHandler.as new file mode 100644 index 0000000..854d134 --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TagHandler.as @@ -0,0 +1,86 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.ant.tags.supportClasses +{ + import flash.events.EventDispatcher; + + import org.apache.flex.ant.Ant; + import org.apache.flex.xml.ITagHandler; + import org.apache.flex.xml.XMLTagProcessor; + + /** + * The lowest-level base class for ITagHandlers for Ant. + */ + public class TagHandler extends EventDispatcher implements ITagHandler + { + /** + * Constructor + */ + public function TagHandler() + { + } + + /** + * The Ant instance. Often used for getValue() and output() methods. + */ + protected var ant:Ant; + + /** + * The context object. Contains the properties that currently apply. + */ + protected var context:Object; + + /** + * Set the context + */ + public function setContext(context:Object):void + { + this.context = context; + } + + /** + * The xml node for this tag + */ + protected var xml:XML; + + /** + * @see org.apache.flex.xml.ITagHandler + */ + public function init(xml:XML, xmlProcessor:XMLTagProcessor):void + { + ant = xmlProcessor as Ant; + this.xml = xml; + } + + protected function getAttributeValue(name:String):String + { + return ant.getValue(xml[name].toString(), context); + } + + protected function getNullOrAttributeValue(name:String):String + { + var xmlList:XMLList = xml[name]; + if (xmlList.length() == 0) + return null; + + return ant.getValue(xml[name].toString(), context); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TaskHandler.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TaskHandler.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TaskHandler.as new file mode 100644 index 0000000..0d05909 --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TaskHandler.as @@ -0,0 +1,60 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.ant.tags.supportClasses +{ + + /** + * The base class for ITagHandlers that do work + */ + public class TaskHandler extends NamedTagHandler + { + public function TaskHandler() + { + } + + public function get failonerror():Boolean + { + var val:String = getNullOrAttributeValue("@failonerror"); + return val == null ? true : val == "true"; + } + + protected var callbackMode:Boolean; + + protected var processedChildren:Boolean; + + /** + * Do the work. + * TaskHandlers lazily create their children so + * super.execute() should be called before + * doing any real work. + */ + public function execute(callbackMode:Boolean, context:Object):Boolean + { + this.callbackMode = callbackMode; + this.context = context; + if (!processedChildren) + { + ant.processChildren(xml, this); + processedChildren = true; + } + return true; + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/crypto/MD5Stream.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/crypto/MD5Stream.as b/flex-installer/ant_on_air/src/org/apache/flex/crypto/MD5Stream.as new file mode 100644 index 0000000..14f3af5 --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/crypto/MD5Stream.as @@ -0,0 +1,468 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// + +package org.apache.flex.crypto +{ + import flash.utils.ByteArray; + import flash.utils.Endian; + import flash.utils.IDataInput; + + /** + * Perform MD5 hash of an input stream in chunks. This class was + * originally com.adobe.crypto.MD5Stream.as but was almost totally + * re-written to improve performance. + * This class processes data in + * chunks. Usage: create an instance, call + * update(data) repeatedly for multiples of 64-byte + * chunks and finally complete() + * which will return the md5 hash. + */ + public class MD5Stream + { + + // initialize the md buffers + private var a:int = 1732584193; + private var b:int = -271733879; + private var c:int = -1732584194; + private var d:int = 271733878; + + // variables to store previous values + private var aa:int; + private var bb:int; + private var cc:int; + private var dd:int; + + public function MD5Stream() + { + + } + + + /** + * Pass in chunks of the input data with update(), call + * complete() with an optional chunk which will return the + * final hash. Equivalent to the way + * java.security.MessageDigest works. + * + * @param input The IDataInput + * @param totalLength The total number of bytes in the IDataInput + * @return A string containing the hash value + * @langversion ActionScript 3.0 + * @playerversion Flash 8.5 + * @tiptext + */ + public function complete(input:IDataInput, totalLength:int):String + { + var bytesLeft:int = input.bytesAvailable; + if (bytesLeft > 0) + hashChunks(input, Math.floor(bytesLeft / 64) * 64); + + var finalChunk:ByteArray; + finalChunk = new ByteArray(); + finalChunk.endian = Endian.LITTLE_ENDIAN; + + var used:int = bytesLeft & 0x3f; + if (used > 0) + { + input.readBytes(finalChunk, 0, used); + finalChunk.position = finalChunk.length; + } + finalChunk.writeByte(0x80); + used++; + + var free:int = 64 - used; + if (free < 8) + { + for (var i:int = used; i < 64; i++) + { + finalChunk.writeByte(0); + } + used = 0; + free = 64; + } + free -= 8; + for (i = 0; i < free; i++) + { + finalChunk.writeByte(0); + } + finalChunk.writeInt(totalLength << 3); + finalChunk.writeInt(0); + + finalChunk.position = 0; + hashChunks(finalChunk, finalChunk.length); + + const zeros:String = "00000000"; + var res:String = ""; + var piece:uint = flip(a) + var part:String = piece.toString(16); + if (part.length < 8) + res += zeros.substr(part.length); + res += part; + piece = flip(b); + part = piece.toString(16); + if (part.length < 8) + res += zeros.substr(part.length); + res += part; + piece = flip(c); + part = piece.toString(16); + if (part.length < 8) + res += zeros.substr(part.length); + res += part; + piece = flip(d); + part = piece.toString(16); + if (part.length < 8) + res += zeros.substr(part.length); + res += part; + + resetFields(); + + return res; + } + + private function flip(a:int):uint + { + var v24:uint = uint(a & 0xff) << 24; + var v16:uint = uint(a >> 8 & 0xff) << 16; + var v8:uint = uint(a >> 16 & 0xff) << 8; + var v:uint = uint(a >> 24 & 0xff); + v += v24 + v16 + v8; + return v; + } + + /** + * Pass in chunks of the input data with update(), call + * complete() with an optional chunk which will return the + * final hash. Equivalent to the way + * java.security.MessageDigest works. + * + * @param input The bytearray chunk to perform the hash on + * @langversion ActionScript 3.0 + * @playerversion Flash 8.5 + * @tiptext + */ + public function update(input:IDataInput, length:int):void + { + hashChunks(input, length); + } + + /** + * Re-initialize this instance for use to perform hashing on + * another input stream. This is called automatically by + * complete(). + * + * @langversion ActionScript 3.0 + * @playerversion Flash 8.5 + * @tiptext + */ + public function resetFields():void + { + // initialize the md buffers + a = 1732584193; + b = -271733879; + c = -1732584194; + d = 271733878; + + // variables to store previous values + aa = 0; + bb = 0; + cc = 0; + dd = 0; + } + + + private function hashChunks(input:IDataInput, len:int):void + { + var arr00:int; + var arr01:int; + var arr02:int; + var arr03:int; + var arr04:int; + var arr05:int; + var arr06:int; + var arr07:int; + var arr08:int; + var arr09:int; + var arr10:int; + var arr11:int; + var arr12:int; + var arr13:int; + var arr14:int; + var arr15:int; + + var a:int = this.a; + var b:int = this.b; + var c:int = this.c; + var d:int = this.d; + var aa:int = this.aa; + var bb:int = this.bb; + var cc:int = this.cc; + var dd:int = this.dd; + + + input.endian = Endian.LITTLE_ENDIAN; + for ( var i:int = 0; i < len ; i += 64) + { + arr00 = input.readInt(); + arr01 = input.readInt(); + arr02 = input.readInt(); + arr03 = input.readInt(); + arr04 = input.readInt(); + arr05 = input.readInt(); + arr06 = input.readInt(); + arr07 = input.readInt(); + arr08 = input.readInt(); + arr09 = input.readInt(); + arr10 = input.readInt(); + arr11 = input.readInt(); + arr12 = input.readInt(); + arr13 = input.readInt(); + arr14 = input.readInt(); + arr15 = input.readInt(); + + // save previous values + aa = a; + bb = b; + cc = c; + dd = d; + + var tmp:int; + + // Round 1 + // f = ( x & y ) | ( (~x) & z ) + // a + int( func( b, c, d ) ) + x + t + //a = ff( a, b, c, d, arr00, 7, -680876936 ); // 1 + tmp = a + ( ( b & c) | ( (~b) & d ) ) + arr00 + -680876936; + a = ( ( tmp << 7 ) | ( tmp >>> 25 ) ) + b; + //d = ff( d, a, b, c, arr01, 12, -389564586 ); // 2 + tmp = d + ( ( a & b) | ( (~a) & c ) ) + arr01 + -389564586; + d = ( ( tmp << 12) | ( tmp >>> 20 ) ) + a; + //c = ff( c, d, a, b, arr02, 17, 606105819 ); // 3 + tmp = c + ( ( d & a) | ( (~d) & b ) ) + arr02 + 606105819; + c = ( ( tmp << 17) | ( tmp >>> 15 ) ) + d; + //b = ff( b, c, d, a, arr03, 22, -1044525330 ); // 4 + tmp = b + ( ( c & d) | ( (~c) & a ) ) + arr03 + -1044525330; + b = ( ( tmp << 22) | ( tmp >>> 10 ) ) + c; + //a = ff( a, b, c, d, arr04, 7, -176418897 ); // 5 + tmp = a + ( ( b & c) | ( (~b) & d ) ) + arr04 + -176418897; + a = ( ( tmp << 7 ) | ( tmp >>> 25 ) ) + b; + //d = ff( d, a, b, c, arr05, 12, 1200080426 ); // 6 + tmp = d + ( ( a & b) | ( (~a) & c ) ) + arr05 + 1200080426; + d = ( ( tmp << 12) | ( tmp >>> 20 ) ) + a; + //c = ff( c, d, a, b, arr06, 17, -1473231341 ); // 7 + tmp = c + ( ( d & a) | ( (~d) & b ) ) + arr06 + -1473231341; + c = ( ( tmp << 17) | ( tmp >>> 15 ) ) + d; + //b = ff( b, c, d, a, arr07, 22, -45705983 ); // 8 + tmp = b + ( ( c & d) | ( (~c) & a ) ) + arr07 + -45705983; + b = ( ( tmp << 22) | ( tmp >>> 10 ) ) + c; + //a = ff( a, b, c, d, arr08, 7, 1770035416 ); // 9 + tmp = a + ( ( b & c) | ( (~b) & d ) ) + arr08 + 1770035416; + a = ( ( tmp << 7 ) | ( tmp >>> 25 ) ) + b; + //d = ff( d, a, b, c, arr09, 12, -1958414417 ); // 10 + tmp = d + ( ( a & b) | ( (~a) & c ) ) + arr09 + -1958414417; + d = ( ( tmp << 12) | ( tmp >>> 20 ) ) + a; + //c = ff( c, d, a, b, arr10, 17, -42063 ); // 11 + tmp = c + ( ( d & a) | ( (~d) & b ) ) + arr10 + -42063; + c = ( ( tmp << 17) | ( tmp >>> 15 ) ) + d; + //b = ff( b, c, d, a, arr11, 22, -1990404162 ); // 12 + tmp = b + ( ( c & d) | ( (~c) & a ) ) + arr11 + -1990404162; + b = ( ( tmp << 22) | ( tmp >>> 10 ) ) + c; + //a = ff( a, b, c, d, arr12, 7, 1804603682 ); // 13 + tmp = a + ( ( b & c) | ( (~b) & d ) ) + arr12 + 1804603682; + a = ( ( tmp << 7 ) | ( tmp >>> 25 ) ) + b; + //d = ff( d, a, b, c, arr13, 12, -40341101 ); // 14 + tmp = d + ( ( a & b) | ( (~a) & c ) ) + arr13 + -40341101; + d = ( ( tmp << 12) | ( tmp >>> 20 ) ) + a; + //c = ff( c, d, a, b, arr14, 17, -1502002290 ); // 15 + tmp = c + ( ( d & a) | ( (~d) & b ) ) + arr14 + -1502002290; + c = ( ( tmp << 17) | ( tmp >>> 15 ) ) + d; + //b = ff( b, c, d, a, arr15, 22, 1236535329 ); // 16 + tmp = b + ( ( c & d) | ( (~c) & a ) ) + arr15 + 1236535329; + b = ( ( tmp << 22) | ( tmp >>> 10 ) ) + c; + + // Round 2 + // g = ( x & z ) | ( y & (~z) ) + //a = gg( a, b, c, d, arr01, 5, -165796510 ); // 17 + tmp = a + ( ( b & d) | ( c & (~d) ) ) + arr01 + -165796510; + a = ( ( tmp << 5 ) | ( tmp >>> 27 ) ) + b; + //d = gg( d, a, b, c, arr06, 9, -1069501632 ); // 18 + tmp = d + ( ( a & c) | ( b & (~c) ) ) + arr06 + -1069501632; + d = ( ( tmp << 9 ) | ( tmp >>> 23 ) ) + a; + //c = gg( c, d, a, b, arr11, 14, 643717713 ); // 19 + tmp = c + ( ( d & b) | ( a & (~b) ) ) + arr11 + 643717713; + c = ( ( tmp << 14) | ( tmp >>> 18) ) + d; + //b = gg( b, c, d, a, arr00, 20, -373897302 ); // 20 + tmp = b + ( ( c & a) | ( d & (~a) ) ) + arr00 + -373897302; + b = ( ( tmp << 20) | ( tmp >>> 12) ) + c; + //a = gg( a, b, c, d, arr05, 5, -701558691 ); // 21 + tmp = a + ( ( b & d) | ( c & (~d) ) ) + arr05 + -701558691; + a = ( ( tmp << 5 ) | ( tmp >>> 27 ) ) + b; + //d = gg( d, a, b, c, arr10, 9, 38016083 ); // 22 + tmp = d + ( ( a & c) | ( b & (~c) ) ) + arr10 + 38016083; + d = ( ( tmp << 9 ) | ( tmp >>> 23 ) ) + a; + //c = gg( c, d, a, b, arr15, 14, -660478335 ); // 23 + tmp = c + ( ( d & b) | ( a & (~b) ) ) + arr15 + -660478335; + c = ( ( tmp << 14) | ( tmp >>> 18) ) + d; + //b = gg( b, c, d, a, arr04, 20, -405537848 ); // 24 + tmp = b + ( ( c & a) | ( d & (~a) ) ) + arr04 + -405537848; + b = ( ( tmp << 20) | ( tmp >>> 12) ) + c; + //a = gg( a, b, c, d, arr09, 5, 568446438 ); // 25 + tmp = a + ( ( b & d) | ( c & (~d) ) ) + arr09 + 568446438; + a = ( ( tmp << 5 ) | ( tmp >>> 27 ) ) + b; + //d = gg( d, a, b, c, arr14, 9, -1019803690 ); // 26 + tmp = d + ( ( a & c) | ( b & (~c) ) ) + arr14 + -1019803690 ; + d = ( ( tmp << 9 ) | ( tmp >>> 23 ) ) + a; + //c = gg( c, d, a, b, arr03, 14, -187363961 ); // 27 + tmp = c + ( ( d & b) | ( a & (~b) ) ) + arr03 + -187363961; + c = ( ( tmp << 14) | ( tmp >>> 18) ) + d; + //b = gg( b, c, d, a, arr08, 20, 1163531501 ); // 28 + tmp = b + ( ( c & a) | ( d & (~a) ) ) + arr08 + 1163531501; + b = ( ( tmp << 20) | ( tmp >>> 12) ) + c; + //a = gg( a, b, c, d, arr13, 5, -1444681467 ); // 29 + tmp = a + ( ( b & d) | ( c & (~d) ) ) + arr13 + -1444681467; + a = ( ( tmp << 5 ) | ( tmp >>> 27 ) ) + b; + //d = gg( d, a, b, c, arr02, 9, -51403784 ); // 30 + tmp = d + ( ( a & c) | ( b & (~c) ) ) + arr02 + -51403784 ; + d = ( ( tmp << 9 ) | ( tmp >>> 23 ) ) + a; + //c = gg( c, d, a, b, arr07, 14, 1735328473 ); // 31 + tmp = c + ( ( d & b) | ( a & (~b) ) ) + arr07 + 1735328473; + c = ( ( tmp << 14) | ( tmp >>> 18) ) + d; + //b = gg( b, c, d, a, arr12, 20, -1926607734 ); // 32 + tmp = b + ( ( c & a) | ( d & (~a) ) ) + arr12 + -1926607734; + b = ( ( tmp << 20) | ( tmp >>> 12) ) + c; + + // Round 3 + // h = x ^ y ^ z + //a = hh( a, b, c, d, arr05, 4, -378558 ); // 33 + tmp = a + ( b ^ c ^ d ) + arr05 + -378558; + a = ( ( tmp << 4 ) | ( tmp >>> 28 ) ) + b; + //d = hh( d, a, b, c, arr08, 11, -2022574463 ); // 34 + tmp = d + ( a ^ b ^ c ) + arr08 + -2022574463; + d = ( ( tmp << 11 ) | ( tmp >>> 21 ) ) + a; + //c = hh( c, d, a, b, arr11, 16, 1839030562 ); // 35 + tmp = c + ( d ^ a ^ b ) + arr11 + 1839030562; + c = ( ( tmp << 16 ) | ( tmp >>> 16 ) ) + d; + //b = hh( b, c, d, a, arr14, 23, -35309556 ); // 36 + tmp = b + ( c ^ d ^ a ) + arr14 + -35309556; + b = ( ( tmp << 23 ) | ( tmp >>> 9 ) ) + c; + //a = hh( a, b, c, d, arr01, 4, -1530992060 ); // 37 + tmp = a + ( b ^ c ^ d ) + arr01 + -1530992060; + a = ( ( tmp << 4 ) | ( tmp >>> 28 ) ) + b; + //d = hh( d, a, b, c, arr04, 11, 1272893353 ); // 38 + tmp = d + ( a ^ b ^ c ) + arr04 + 1272893353; + d = ( ( tmp << 11 ) | ( tmp >>> 21 ) ) + a; + //c = hh( c, d, a, b, arr07, 16, -155497632 ); // 39 + tmp = c + ( d ^ a ^ b ) + arr07 + -155497632; + c = ( ( tmp << 16 ) | ( tmp >>> 16 ) ) + d; + //b = hh( b, c, d, a, arr10, 23, -1094730640 ); // 40 + tmp = b + ( c ^ d ^ a ) + arr10 + -1094730640; + b = ( ( tmp << 23 ) | ( tmp >>> 9 ) ) + c; + //a = hh( a, b, c, d, arr13, 4, 681279174 ); // 41 + tmp = a + ( b ^ c ^ d ) + arr13 + 681279174; + a = ( ( tmp << 4 ) | ( tmp >>> 28 ) ) + b; + //d = hh( d, a, b, c, arr00, 11, -358537222 ); // 42 + tmp = d + ( a ^ b ^ c ) + arr00 + -358537222; + d = ( ( tmp << 11 ) | ( tmp >>> 21 ) ) + a; + //c = hh( c, d, a, b, arr03, 16, -722521979 ); // 43 + tmp = c + ( d ^ a ^ b ) + arr03 + -722521979; + c = ( ( tmp << 16 ) | ( tmp >>> 16 ) ) + d; + //b = hh( b, c, d, a, arr06, 23, 76029189 ); // 44 + tmp = b + ( c ^ d ^ a ) + arr06 + 76029189; + b = ( ( tmp << 23 ) | ( tmp >>> 9 ) ) + c; + //a = hh( a, b, c, d, arr09, 4, -640364487 ); // 45 + tmp = a + ( b ^ c ^ d ) + arr09 + -640364487; + a = ( ( tmp << 4 ) | ( tmp >>> 28 ) ) + b; + //d = hh( d, a, b, c, arr12, 11, -421815835 ); // 46 + tmp = d + ( a ^ b ^ c ) + arr12 + -421815835; + d = ( ( tmp << 11 ) | ( tmp >>> 21 ) ) + a; + //c = hh( c, d, a, b, arr15, 16, 530742520 ); // 47 + tmp = c + ( d ^ a ^ b ) + arr15 + 530742520; + c = ( ( tmp << 16 ) | ( tmp >>> 16 ) ) + d; + //b = hh( b, c, d, a, arr02, 23, -995338651 ); // 48 + tmp = b + ( c ^ d ^ a ) + arr02 + -995338651; + b = ( ( tmp << 23 ) | ( tmp >>> 9 ) ) + c; + + // Round 4 + // i = y ^ ( x | (~z) ) + //a = ii( a, b, c, d, arr00, 6, -198630844 ); // 49 + tmp = a + ( c ^ ( b | (~d ) ) ) + arr00 + -198630844; + a = ( ( tmp << 6 ) | ( tmp >>> 26 ) ) + b; + //d = ii( d, a, b, c, arr07, 10, 1126891415 ); // 50 + tmp = d + ( b ^ ( a | (~c ) ) ) + arr07 + 1126891415; + d = ( ( tmp << 10) | ( tmp >>> 22 ) ) + a; + //c = ii( c, d, a, b, arr14, 15, -1416354905 ); // 51 + tmp = c + ( a ^ ( d | (~b ) ) ) + arr14 + -1416354905; + c = ( ( tmp << 15) | ( tmp >>> 17 ) ) + d; + //b = ii( b, c, d, a, arr05, 21, -57434055 ); // 52 + tmp = b + ( d ^ ( c | (~a ) ) ) + arr05 + -57434055; + b = ( ( tmp << 21) | ( tmp >>> 11 ) ) + c; + //a = ii( a, b, c, d, arr12, 6, 1700485571 ); // 53 + tmp = a + ( c ^ ( b | (~d ) ) ) + arr12 + 1700485571; + a = ( ( tmp << 6 ) | ( tmp >>> 26 ) ) + b; + //d = ii( d, a, b, c, arr03, 10, -1894986606 ); // 54 + tmp = d + ( b ^ ( a | (~c ) ) ) + arr03 + -1894986606; + d = ( ( tmp << 10) | ( tmp >>> 22 ) ) + a; + //c = ii( c, d, a, b, arr10, 15, -1051523 ); // 55 + tmp = c + ( a ^ ( d | (~b ) ) ) + arr10 + -1051523; + c = ( ( tmp << 15) | ( tmp >>> 17 ) ) + d; + //b = ii( b, c, d, a, arr01, 21, -2054922799 ); // 56 + tmp = b + ( d ^ ( c | (~a ) ) ) + arr01 + -2054922799; + b = ( ( tmp << 21) | ( tmp >>> 11 ) ) + c; + //a = ii( a, b, c, d, arr08, 6, 1873313359 ); // 57 + tmp = a + ( c ^ ( b | (~d ) ) ) + arr08 + 1873313359; + a = ( ( tmp << 6 ) | ( tmp >>> 26 ) ) + b; + //d = ii( d, a, b, c, arr15, 10, -30611744 ); // 58 + tmp = d + ( b ^ ( a | (~c ) ) ) + arr15 + -30611744; + d = ( ( tmp << 10) | ( tmp >>> 22 ) ) + a; + //c = ii( c, d, a, b, arr06, 15, -1560198380 ); // 59 + tmp = c + ( a ^ ( d | (~b ) ) ) + arr06 + -1560198380; + c = ( ( tmp << 15) | ( tmp >>> 17 ) ) + d; + //b = ii( b, c, d, a, arr13, 21, 1309151649 ); // 60 + tmp = b + ( d ^ ( c | (~a ) ) ) + arr13 + 1309151649; + b = ( ( tmp << 21) | ( tmp >>> 11 ) ) + c; + //a = ii( a, b, c, d, arr04, 6, -145523070 ); // 61 + tmp = a + ( c ^ ( b | (~d ) ) ) + arr04 + -145523070; + a = ( ( tmp << 6 ) | ( tmp >>> 26 ) ) + b; + //d = ii( d, a, b, c, arr11, 10, -1120210379 ); // 62 + tmp = d + ( b ^ ( a | (~c ) ) ) + arr11 + -1120210379; + d = ( ( tmp << 10) | ( tmp >>> 22 ) ) + a; + //c = ii( c, d, a, b, arr02, 15, 718787259 ); // 63 + tmp = c + ( a ^ ( d | (~b ) ) ) + arr02 + 718787259; + c = ( ( tmp << 15) | ( tmp >>> 17 ) ) + d; + //b = ii( b, c, d, a, arr09, 21, -343485551 ); // 64 + tmp = b + ( d ^ ( c | (~a ) ) ) + arr09 + -343485551; + b = ( ( tmp << 21) | ( tmp >>> 11 ) ) + c; + + a += aa; + b += bb; + c += cc; + d += dd; + + } + this.aa = aa; + this.bb = bb; + this.cc = cc; + this.dd = dd; + this.a = a; + this.b = b; + this.c = c; + this.d = d; + + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/xml/IParentTagHandler.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/xml/IParentTagHandler.as b/flex-installer/ant_on_air/src/org/apache/flex/xml/IParentTagHandler.as new file mode 100644 index 0000000..6a0e09a --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/xml/IParentTagHandler.as @@ -0,0 +1,51 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.xml +{ + /** + * The interface for ITagHandlers that can have children + */ + public interface IParentTagHandler extends ITagHandler + { + /** + * Add a child ITagHandler + * @param child ITagHandler The child. + * @return ITagHandler The child. + */ + function addChild(child:ITagHandler):ITagHandler; + + /** + * Get a child ITagHandler + * @param index int The index of the child. + * @return ITagHandler The child. + */ + function getChildAt(index:int):ITagHandler; + + /** + * Remove all children + */ + function removeChildren():void; + + /** + * The number of children. + * @return int The number of children. + */ + function get numChildren():int; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/xml/ITagHandler.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/xml/ITagHandler.as b/flex-installer/ant_on_air/src/org/apache/flex/xml/ITagHandler.as new file mode 100644 index 0000000..385d9db --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/xml/ITagHandler.as @@ -0,0 +1,33 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.xml +{ + /** + * The interface for all classes that represeting XML tags + */ + public interface ITagHandler + { + /** + * This method is called after the instance is created + * @param xml XML The XML node. + * @param tagProcessor The XMLTagProcessor that generated this instance. + */ + function init(xml:XML, tagProcessor:XMLTagProcessor):void; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/xml/ITextTagHandler.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/xml/ITextTagHandler.as b/flex-installer/ant_on_air/src/org/apache/flex/xml/ITextTagHandler.as new file mode 100644 index 0000000..e14bdcb --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/xml/ITextTagHandler.as @@ -0,0 +1,29 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.xml +{ + /** + * Interface for ITagHanders that can handle text nodes such as + * <echo>This is a message</echo> + */ + public interface ITextTagHandler extends ITagHandler + { + function setText(text:String):void; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/src/org/apache/flex/xml/XMLTagProcessor.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/xml/XMLTagProcessor.as b/flex-installer/ant_on_air/src/org/apache/flex/xml/XMLTagProcessor.as new file mode 100644 index 0000000..89150d5 --- /dev/null +++ b/flex-installer/ant_on_air/src/org/apache/flex/xml/XMLTagProcessor.as @@ -0,0 +1,86 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.xml +{ + import flash.events.EventDispatcher; + + /** + * Base class for processing XML Tags + */ + public class XMLTagProcessor extends EventDispatcher + { + /** + * Constructor + */ + public function XMLTagProcessor() + { + } + + /** + * Find the associated class for the XML tag and generate + * and instance of it. + * + * @param xml XML The XML node. + * @param context Object An object containing useful information. + * @return ITagHandler An instance representing this XML node + */ + public function processXMLTag(xml:XML):ITagHandler + { + var tag:String = xml.name().toString(); + var c:Class = tagMap[tag]; + if (!c) + { + trace("no processor for ", tag); + throw new Error("no processor for " + tag); + } + var o:ITagHandler = new c() as ITagHandler; + o.init(xml, this); + return o; + } + + /** + * Loop through the children of a node and process them + * + * @param xml XML The XML node. + * @param context Object An object containing useful information. + * @param parentTag IParentTagHandler The parent for the instances that are created. + */ + public function processChildren(xml:XML, parentTag:IParentTagHandler):void + { + parentTag.removeChildren(); + + var xmlList:XMLList = xml.children(); + var n:int = xmlList.length(); + for (var i:int = 0; i < n; i++) + { + var kind:String = xmlList[i].nodeKind(); + if (kind == "text") + ITextTagHandler(parentTag).setText(xmlList[i].toString()); + else + { + var tagHandler:ITagHandler = processXMLTag(xmlList[i]); + parentTag.addChild(tagHandler); + } + } + } + + public var tagMap:Object = {}; + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/AntOnAir-app.xml ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/tests/AntOnAir-app.xml b/flex-installer/ant_on_air/tests/AntOnAir-app.xml new file mode 100644 index 0000000..de8a063 --- /dev/null +++ b/flex-installer/ant_on_air/tests/AntOnAir-app.xml @@ -0,0 +1,251 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<application xmlns="http://ns.adobe.com/air/application/4.0"> + +<!-- Adobe AIR Application Descriptor File Template. + + Specifies parameters for identifying, installing, and launching AIR applications. + + xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/3.1 + The last segment of the namespace specifies the version + of the AIR runtime required for this application to run. + + minimumPatchLevel - The minimum patch level of the AIR runtime required to run + the application. Optional. +--> + + <!-- A universally unique application identifier. Must be unique across all AIR applications. + Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. --> + <id>AntOnAir</id> + + <!-- Used as the filename for the application. Required. --> + <filename>AntOnAir</filename> + + <!-- The name that is displayed in the AIR application installer. + May have multiple values for each language. See samples or xsd schema file. Optional. --> + <name>AntOnAir</name> + + <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. + Values can also be 1-part or 2-part. It is not necessary to have a 3-part value. + An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . --> + <versionNumber>0.0.0</versionNumber> + + <!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. --> + <!-- <versionLabel></versionLabel> --> + + <!-- Description, displayed in the AIR application installer. + May have multiple values for each language. See samples or xsd schema file. Optional. --> + <!-- <description></description> --> + + <!-- Copyright information. Optional --> + <!-- <copyright></copyright> --> + + <!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 --> + <!-- <publisherID></publisherID> --> + + <!-- Settings for the application's initial window. Required. --> + <initialWindow> + <!-- The main SWF or HTML file of the application. Required. --> + <!-- Note: In Flash Builder, the SWF reference is set automatically. --> + <content>AntonAir.swf</content> + + <!-- The title of the main window. Optional. --> + <!-- <title></title> --> + + <!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. --> + <!-- <systemChrome></systemChrome> --> + + <!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. --> + <!-- <transparent></transparent> --> + + <!-- Whether the window is initially visible. Optional. Default false. --> + <!-- <visible></visible> --> + + <!-- Whether the user can minimize the window. Optional. Default true. --> + <!-- <minimizable></minimizable> --> + + <!-- Whether the user can maximize the window. Optional. Default true. --> + <!-- <maximizable></maximizable> --> + + <!-- Whether the user can resize the window. Optional. Default true. --> + <!-- <resizable></resizable> --> + + <!-- The window's initial width in pixels. Optional. --> + <!-- <width></width> --> + + <!-- The window's initial height in pixels. Optional. --> + <!-- <height></height> --> + + <!-- The window's initial x position. Optional. --> + <!-- <x></x> --> + + <!-- The window's initial y position. Optional. --> + <!-- <y></y> --> + + <!-- The window's minimum size, specified as a width/height pair in pixels, such as "400 200". Optional. --> + <!-- <minSize></minSize> --> + + <!-- The window's initial maximum size, specified as a width/height pair in pixels, such as "1600 1200". Optional. --> + <!-- <maxSize></maxSize> --> + + <!-- The initial aspect ratio of the app when launched (either "portrait" or "landscape"). Optional. Mobile only. Default is the natural orientation of the device --> + + <!-- <aspectRatio></aspectRatio> --> + + <!-- Whether the app will begin auto-orienting on launch. Optional. Mobile only. Default false --> + + <!-- <autoOrients></autoOrients> --> + + <!-- Whether the app launches in full screen. Optional. Mobile only. Default false --> + + <!-- <fullScreen></fullScreen> --> + + <!-- The render mode for the app (either auto, cpu, gpu, or direct). Optional. Default auto --> + + <!-- <renderMode></renderMode> --> + + <!-- Whether or not to pan when a soft keyboard is raised or lowered (either "pan" or "none"). Optional. Defaults "pan." --> + <!-- <softKeyboardBehavior></softKeyboardBehavior> --> + <autoOrients>false</autoOrients> + <fullScreen>false</fullScreen> + <visible>false</visible> + </initialWindow> + + <!-- We recommend omitting the supportedProfiles element, --> + <!-- which in turn permits your application to be deployed to all --> + <!-- devices supported by AIR. If you wish to restrict deployment --> + <!-- (i.e., to only mobile devices) then add this element and list --> + <!-- only the profiles which your application does support. --> + <!-- <supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice</supportedProfiles> --> + <supportedProfiles>extendedDesktop</supportedProfiles> --> + + <!-- The subpath of the standard default installation location to use. Optional. --> + <!-- <installFolder></installFolder> --> + + <!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. --> + <!-- <programMenuFolder></programMenuFolder> --> + + <!-- The icon the system uses for the application. For at least one resolution, + specify the path to a PNG file included in the AIR package. Optional. --> + <!-- <icon> + <image16x16></image16x16> + <image32x32></image32x32> + <image36x36></image36x36> + <image48x48></image48x48> + <image57x57></image57x57> + <image72x72></image72x72> + <image114x114></image114x114> + <image128x128></image128x128> + </icon> --> + + <!-- Whether the application handles the update when a user double-clicks an update version + of the AIR file (true), or the default AIR application installer handles the update (false). + Optional. Default false. --> + <!-- <customUpdateUI></customUpdateUI> --> + + <!-- Whether the application can be launched when the user clicks a link in a web browser. + Optional. Default false. --> + <!-- <allowBrowserInvocation></allowBrowserInvocation> --> + + <!-- Listing of file types for which the application can register. Optional. --> + <!-- <fileTypes> --> + + <!-- Defines one file type. Optional. --> + <!-- <fileType> --> + + <!-- The name that the system displays for the registered file type. Required. --> + <!-- <name></name> --> + + <!-- The extension to register. Required. --> + <!-- <extension></extension> --> + + <!-- The description of the file type. Optional. --> + <!-- <description></description> --> + + <!-- The MIME content type. --> + <!-- <contentType></contentType> --> + + <!-- The icon to display for the file type. Optional. --> + <!-- <icon> + <image16x16></image16x16> + <image32x32></image32x32> + <image48x48></image48x48> + <image128x128></image128x128> + </icon> --> + + <!-- </fileType> --> + <!-- </fileTypes> --> + + <!-- iOS specific capabilities --> + <!-- <iPhone> --> + <!-- A list of plist key/value pairs to be added to the application Info.plist --> + <!-- <InfoAdditions> + <![CDATA[ + <key>UIDeviceFamily</key> + <array> + <string>1</string> + <string>2</string> + </array> + <key>UIStatusBarStyle</key> + <string>UIStatusBarStyleBlackOpaque</string> + <key>UIRequiresPersistentWiFi</key> + <string>YES</string> + ]]> + </InfoAdditions> --> + <!-- A list of plist key/value pairs to be added to the application Entitlements.plist --> + <!-- <Entitlements> + <![CDATA[ + <key>keychain-access-groups</key> + <array> + <string></string> + <string></string> + </array> + ]]> + </Entitlements> --> + <!-- Display Resolution for the app (either "standard" or "high"). Optional. Default "standard" --> + <!-- <requestedDisplayResolution></requestedDisplayResolution> --> + <!-- </iPhone> --> + + <!-- Specify Android specific tags that get passed to AndroidManifest.xml file. --> + <!--<android> --> + <!-- <manifestAdditions> + <![CDATA[ + <manifest android:installLocation="auto"> + <uses-permission android:name="android.permission.INTERNET"/> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> + <uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/> + <application android:enabled="true"> + <activity android:excludeFromRecents="false"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER"/> + </intent-filter> + </activity> + </application> + </manifest> + ]]> + </manifestAdditions> --> + <!-- Color depth for the app (either "32bit" or "16bit"). Optional. Default 16bit before namespace 3.0, 32bit after --> + <!-- <colorDepth></colorDepth> --> + <!-- </android> --> + <!-- End of the schema for adding the android specific tags in AndroidManifest.xml file --> + +</application>
