Showing preview only (1,305K chars total). Download the full file or copy to clipboard to get everything.
Repository: crosswalk-project/crosswalk-cordova-android
Branch: master
Commit: a5fc3b852806
Files: 280
Total size: 1.2 MB
Directory structure:
gitextract_tlizatdc/
├── .gitignore
├── .reviewboardrc
├── CONTRIBUTING.md
├── LICENSE
├── NOTICE
├── README.md
├── RELEASENOTES.md
├── VERSION
├── bin/
│ ├── android_sdk_version
│ ├── android_sdk_version.bat
│ ├── check_reqs
│ ├── check_reqs.bat
│ ├── create
│ ├── create.bat
│ ├── lib/
│ │ ├── android_sdk_version.js
│ │ ├── check_reqs.js
│ │ ├── create.js
│ │ └── simpleargs.js
│ ├── templates/
│ │ ├── cordova/
│ │ │ ├── build
│ │ │ ├── build.bat
│ │ │ ├── clean
│ │ │ ├── clean.bat
│ │ │ ├── defaults.xml
│ │ │ ├── lib/
│ │ │ │ ├── appinfo.js
│ │ │ │ ├── build.js
│ │ │ │ ├── device.js
│ │ │ │ ├── emulator.js
│ │ │ │ ├── exec.js
│ │ │ │ ├── install-device
│ │ │ │ ├── install-device.bat
│ │ │ │ ├── install-emulator
│ │ │ │ ├── install-emulator.bat
│ │ │ │ ├── list-devices
│ │ │ │ ├── list-devices.bat
│ │ │ │ ├── list-emulator-images
│ │ │ │ ├── list-emulator-images.bat
│ │ │ │ ├── list-started-emulators
│ │ │ │ ├── list-started-emulators.bat
│ │ │ │ ├── log.js
│ │ │ │ ├── run.js
│ │ │ │ ├── spawn.js
│ │ │ │ ├── start-emulator
│ │ │ │ └── start-emulator.bat
│ │ │ ├── log
│ │ │ ├── log.bat
│ │ │ ├── run
│ │ │ ├── run.bat
│ │ │ ├── version
│ │ │ └── version.bat
│ │ └── project/
│ │ ├── Activity.java
│ │ ├── AndroidManifest.xml
│ │ ├── assets/
│ │ │ └── www/
│ │ │ ├── css/
│ │ │ │ └── index.css
│ │ │ ├── index.html
│ │ │ ├── js/
│ │ │ │ └── index.js
│ │ │ ├── main.js
│ │ │ └── master.css
│ │ ├── build.gradle
│ │ ├── custom_rules.xml
│ │ ├── eclipse-project
│ │ ├── eclipse-project-CLI
│ │ ├── gitignore
│ │ ├── project.properties
│ │ ├── res/
│ │ │ └── values/
│ │ │ └── strings.xml
│ │ └── settings.gradle
│ ├── update
│ └── update.bat
├── framework/
│ ├── AndroidManifest.xml
│ ├── ant.properties
│ ├── assets/
│ │ └── www/
│ │ ├── cordova.js
│ │ └── index.html
│ ├── build.gradle
│ ├── build.xml
│ ├── project.properties
│ ├── res/
│ │ ├── layout/
│ │ │ └── main.xml
│ │ ├── values/
│ │ │ └── strings.xml
│ │ └── xml/
│ │ └── config.xml
│ ├── src/
│ │ ├── com/
│ │ │ └── squareup/
│ │ │ └── okhttp/
│ │ │ ├── Address.java
│ │ │ ├── Connection.java
│ │ │ ├── ConnectionPool.java
│ │ │ ├── Dispatcher.java
│ │ │ ├── Failure.java
│ │ │ ├── HttpResponseCache.java
│ │ │ ├── Job.java
│ │ │ ├── MediaType.java
│ │ │ ├── OkAuthenticator.java
│ │ │ ├── OkHttpClient.java
│ │ │ ├── OkResponseCache.java
│ │ │ ├── Request.java
│ │ │ ├── Response.java
│ │ │ ├── ResponseSource.java
│ │ │ ├── Route.java
│ │ │ ├── RouteDatabase.java
│ │ │ ├── TunnelRequest.java
│ │ │ └── internal/
│ │ │ ├── AbstractOutputStream.java
│ │ │ ├── Base64.java
│ │ │ ├── DiskLruCache.java
│ │ │ ├── Dns.java
│ │ │ ├── FaultRecoveringOutputStream.java
│ │ │ ├── NamedRunnable.java
│ │ │ ├── Platform.java
│ │ │ ├── StrictLineReader.java
│ │ │ ├── Util.java
│ │ │ ├── http/
│ │ │ │ ├── AbstractHttpInputStream.java
│ │ │ │ ├── HeaderParser.java
│ │ │ │ ├── HttpAuthenticator.java
│ │ │ │ ├── HttpDate.java
│ │ │ │ ├── HttpEngine.java
│ │ │ │ ├── HttpTransport.java
│ │ │ │ ├── HttpURLConnectionImpl.java
│ │ │ │ ├── HttpsEngine.java
│ │ │ │ ├── HttpsURLConnectionImpl.java
│ │ │ │ ├── OkResponseCacheAdapter.java
│ │ │ │ ├── Policy.java
│ │ │ │ ├── RawHeaders.java
│ │ │ │ ├── RequestHeaders.java
│ │ │ │ ├── ResponseHeaders.java
│ │ │ │ ├── RetryableOutputStream.java
│ │ │ │ ├── RouteSelector.java
│ │ │ │ ├── SpdyTransport.java
│ │ │ │ ├── Transport.java
│ │ │ │ └── UnknownLengthHttpInputStream.java
│ │ │ ├── spdy/
│ │ │ │ ├── ErrorCode.java
│ │ │ │ ├── FrameReader.java
│ │ │ │ ├── FrameWriter.java
│ │ │ │ ├── HeadersMode.java
│ │ │ │ ├── Hpack.java
│ │ │ │ ├── Http20Draft06.java
│ │ │ │ ├── IncomingStreamHandler.java
│ │ │ │ ├── NameValueBlockReader.java
│ │ │ │ ├── Ping.java
│ │ │ │ ├── Settings.java
│ │ │ │ ├── Spdy3.java
│ │ │ │ ├── SpdyConnection.java
│ │ │ │ ├── SpdyStream.java
│ │ │ │ └── Variant.java
│ │ │ └── tls/
│ │ │ ├── DistinguishedNameParser.java
│ │ │ └── OkHostnameVerifier.java
│ │ └── org/
│ │ └── apache/
│ │ └── cordova/
│ │ ├── App.java
│ │ ├── AuthenticationToken.java
│ │ ├── CallbackContext.java
│ │ ├── Config.java
│ │ ├── ConfigXmlParser.java
│ │ ├── CordovaActivity.java
│ │ ├── CordovaApplication.java
│ │ ├── CordovaArgs.java
│ │ ├── CordovaBridge.java
│ │ ├── CordovaChromeClient.java
│ │ ├── CordovaInterface.java
│ │ ├── CordovaPlugin.java
│ │ ├── CordovaPreferences.java
│ │ ├── CordovaResourceApi.java
│ │ ├── CordovaUriHelper.java
│ │ ├── CordovaWebView.java
│ │ ├── CordovaWebViewClient.java
│ │ ├── DirectoryManager.java
│ │ ├── DroidGap.java
│ │ ├── ExifHelper.java
│ │ ├── ExposedJsApi.java
│ │ ├── FileHelper.java
│ │ ├── IceCreamCordovaWebViewClient.java
│ │ ├── JSONUtils.java
│ │ ├── LOG.java
│ │ ├── LinearLayoutSoftKeyboardDetect.java
│ │ ├── NativeToJsMessageQueue.java
│ │ ├── PluginEntry.java
│ │ ├── PluginManager.java
│ │ ├── PluginResult.java
│ │ ├── ScrollEvent.java
│ │ └── Whitelist.java
│ └── test/
│ └── org/
│ └── apache/
│ └── cordova/
│ ├── PreferenceNodeTest.java
│ └── PreferenceSetTest.java
├── package.json
├── spec/
│ └── create.spec.js
└── test/
├── AndroidManifest.xml
├── README.md
├── ant.properties
├── assets/
│ └── www/
│ ├── backbuttonmultipage/
│ │ ├── index.html
│ │ ├── sample2.html
│ │ └── sample3.html
│ ├── background/
│ │ ├── index.html
│ │ └── index2.html
│ ├── backgroundcolor/
│ │ └── index.html
│ ├── basicauth/
│ │ └── index.html
│ ├── cordova_plugins.js
│ ├── fullscreen/
│ │ └── index.html
│ ├── htmlnotfound/
│ │ └── error.html
│ ├── iframe/
│ │ ├── index.html
│ │ └── index2.html
│ ├── index.html
│ ├── jqmtabbackbutton/
│ │ ├── index.html
│ │ ├── tab1.html
│ │ ├── tab2.html
│ │ └── tab3.html
│ ├── lifecycle/
│ │ ├── index.html
│ │ └── index2.html
│ ├── main.js
│ ├── master.css
│ ├── menus/
│ │ └── index.html
│ ├── splashscreen/
│ │ └── index.html
│ ├── userwebview/
│ │ └── index.html
│ ├── whitelist/
│ │ ├── index.html
│ │ └── index2.html
│ └── xhr/
│ └── index.html
├── build.xml
├── cordova/
│ ├── android_sdk_version
│ ├── build
│ ├── build.bat
│ ├── check_reqs
│ ├── clean
│ ├── clean.bat
│ ├── lib/
│ │ ├── android_sdk_version.js
│ │ ├── appinfo.js
│ │ ├── build.js
│ │ ├── check_reqs.js
│ │ ├── clean.js
│ │ ├── device.js
│ │ ├── emulator.js
│ │ ├── exec.js
│ │ ├── install-device
│ │ ├── install-device.bat
│ │ ├── install-emulator
│ │ ├── install-emulator.bat
│ │ ├── list-devices
│ │ ├── list-devices.bat
│ │ ├── list-emulator-images
│ │ ├── list-emulator-images.bat
│ │ ├── list-started-emulators
│ │ ├── list-started-emulators.bat
│ │ ├── log.js
│ │ ├── run.js
│ │ ├── start-emulator
│ │ └── start-emulator.bat
│ ├── log
│ ├── log.bat
│ ├── run
│ ├── run.bat
│ ├── version
│ └── version.bat
├── project.properties
├── res/
│ ├── layout/
│ │ └── main.xml
│ ├── values/
│ │ └── strings.xml
│ └── xml/
│ └── config.xml
└── src/
└── org/
└── apache/
└── cordova/
├── pluginApi/
│ └── pluginStub.java
└── test/
├── ActivityPlugin.java
├── CordovaDriverAction.java
├── CordovaWebViewTestActivity.java
├── MainTestActivity.java
├── SabotagedActivity.java
├── backbuttonmultipage.java
├── background.java
├── backgroundcolor.java
├── basicauth.java
├── errorurl.java
├── fullscreen.java
├── htmlnotfound.java
├── iframe.java
├── junit/
│ ├── BackButtonMultiPageTest.java
│ ├── CordovaActivityTest.java
│ ├── CordovaResourceApiTest.java
│ ├── CordovaTest.java
│ ├── ErrorUrlTest.java
│ ├── FixWebView.java
│ ├── HtmlNotFoundTest.java
│ ├── IFrameTest.java
│ ├── IntentUriOverrideTest.java
│ ├── LifecycleTest.java
│ ├── MenuTest.java
│ ├── PluginManagerTest.java
│ ├── SplashscreenTest.java
│ └── XhrTest.java
├── lifecycle.java
├── loading.java
├── menus.java
├── splashscreen.java
├── tests.java
├── timeout.java
├── userwebview.java
├── util/
│ └── Purity.java
├── whitelist.java
└── xhr.java
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.DS_Store
default.properties
gen
assets/www/cordova.js
framework/assets/www/.tmp*
local.properties
framework/lib
proguard.cfg
proguard.cfg
proguard-project.txt
framework/bin
framework/test/org/apache/cordova/*.class
framework/assets/www/.DS_Store
framework/assets/www/cordova-*.js
framework/assets/www/phonegap-*.js
framework/libs
framework/javadoc-public
framework/javadoc-private
framework/xwalk_core_library
framework/xwalk_shared_library
test/libs
example
./test
test/bin
test/assets/www/.tmp*
test/assets/www/cordova.js
test/cordova/plugins/org.apache.cordova.device/www/device.js
test/cordova/plugins/org.apache.cordova.device/src/android/Device.java
tmp/**
.metadata
tmp/**/*
Thumbs.db
Desktop.ini
*.tmp
*.bak
*.swp
*.class
*.jar
# IntelliJ IDEA files
*.iml
.idea
# Eclipse files
.classpath
.project
.settings
================================================
FILE: .reviewboardrc
================================================
#
# Settings for post-review (used for uploading diffs to reviews.apache.org).
#
GUESS_FIELDS = True
OPEN_BROWSER = True
TARGET_GROUPS = 'cordova'
REVIEWBOARD_URL = 'http://reviews.apache.org'
================================================
FILE: CONTRIBUTING.md
================================================
<!--
#
# 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.
#
-->
# Contributing to Apache Cordova
Anyone can contribute to Cordova. And we need your contributions.
There are multiple ways to contribute: report bugs, improve the docs, and
contribute code.
For instructions on this, start with the
[contribution overview](http://cordova.apache.org/#contribute).
The details are explained there, but the important items are:
- Sign and submit an Apache ICLA (Contributor License Agreement).
- Have a Jira issue open that corresponds to your contribution.
- Run the tests so your patch doesn't break existing functionality.
We look forward to your contributions!
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed 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.
ADDITIONAL LICENSES:
================================================================================
bin/node_modules/q
================================================================================
Copyright 2009–2012 Kristopher Michael Kowal. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
================================================================================
bin/node_modules/shelljs
================================================================================
Copyright (c) 2012, Artur Adib <aadib@mozilla.com>
All rights reserved.
You may use this project under the terms of the New BSD license as follows:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Artur Adib nor the
names of the contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================================================
bin/node_modules/shelljs
================================================================================
Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
All rights reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: NOTICE
================================================
Apache Cordova
Copyright 2014 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org)
=========================================================================
== NOTICE file corresponding to the section 4 d of ==
== the Apache License, Version 2.0, ==
== in this case for the Android-specific code. ==
=========================================================================
This product includes software developed as part of
The Android Open Source Project (http://source.android.com).
This software includes software developed at Square, Inc.
Copyright (C) 2013 Square, Inc.
================================================
FILE: README.md
================================================
<!--
#
# 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.
#
-->
THIS REPOSITORY IS DEPRECATED
===
This repository is based on Cordova-Android 3.6.3, which is not being maintained upstream anymore. It thus does not receive new features or security fixes.
Starting with Cordova-Android 4.0.0, Crosswalk is [officially supported](http://cordova.apache.org/announcements/2015/04/15/cordova-android-4.0.0.html) with the standard releases and this repository is not necessary anymore.
You are encouraged to follow our [Cordova 4+ guide](https://crosswalk-project.org/documentation/cordova/cordova_4.html) and use a supported Cordova-Android release.
Crosswalk-based Cordova Android
===
Crosswalk-based Cordova Android is derived from [Cordova Android](https://github.com/apache/cordova-android)
and uses [Crosswalk](https://github.com/crosswalk-project/crosswalk) as the
HTML5 runtime. It is an Android application library that allows for Cordova-based
projects to be built for the Android Platform. Cordova based applications are,
at the core, applications written with web technology: HTML, CSS and JavaScript.
[Apache Cordova](http://cordova.io) is a project of The Apache Software Foundation (ASF).
Requires
---
- Java JDK 1.5 or greater
- Apache Ant 1.8.0 or greater
- Android SDK [http://developer.android.com](http://developer.android.com)
- Python 2.6 or greater
Setup Crosswalk Dependency
---
1. Please download the crosswalk-webview for Android package from [Crosswalk download site](https://download.01.org/crosswalk/releases/crosswalk/android/).
2. Unzip the crosswalk-webview package to a folder and create a link named `xwalk_core_library` under `framework` linking to that folder.
For example, on Linux:
$cd /path/to/crosswalk-cordova-android/framework
$ln -s /path/to/crosswalk-webview-unzipped-folder/ xwalk_core_library
Cordova Android Developer Tools
---
The Cordova developer tooling is split between general tooling and project level tooling.
General Commands
./bin/create [path package activity] ... creates the ./example app or a cordova android project
./bin/check_reqs ....................... checks that your environment is set up for cordova-android development
./bin/update [path] .................... updates an existing cordova-android project to the version of the framework
Project Commands
These commands live in a generated Cordova Android project. Any interactions with the emulator require you to have an AVD defined.
./cordova/clean ........................ cleans the project
./cordova/build ........................ calls `clean` then compiles the project
./cordova/log ........................ streams device or emulator logs to STDOUT
./cordova/run ........................ calls `build` then deploys to a connected Android device. If no Android device is detected, will launch an emulator and deploy to it.
./cordova/version ...................... returns the cordova-android version of the current project
Importing a Crosswalk-based Cordova Android Project into Eclipse
----
1. Import Crosswalk-based Cordova Android and XWalkCoreLibrary library projects by File > Import... > Existing Android Code Into Workspace. Point to `[path_to_cordova_xwalk_android]/framework` and click `Finish`.
2. Build `xwalk_core_library` and `Cordova` projects.
3. Import generated project by File > Import... > Existing Android Code. Point to the generated app path.
4. Right click on the project root: Run as > Run Configurations
5. Click on the Target tab and select Manual (this way you can choose the emulator or device to build to)
Running Tests
----
Please see details under test/README.md.
Further Reading
----
- [http://developer.android.com](http://developer.android.com)
- [http://cordova.apache.org/](http://cordova.apache.org)
- [http://wiki.apache.org/cordova/](http://wiki.apache.org/cordova/)
================================================
FILE: RELEASENOTES.md
================================================
<!--
#
# 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.
#
-->
## Release Notes for Cordova (Android) ##
### 3.6.0 (Sept 2014) ###
* Set VERSION to 3.6.0 (via coho)
* CB-7410 fix the menu test
* CB-7410 Fix the errorUrl test
* CB-7410 Fix Basic Authentication test
* CB-3445: Allow build and run scripts to select APK by architecture
* CB-3445: Add environment variable 'BUILD_MULTIPLE_APKS' for splitting APKs based on architecture
* CB-3445: Ensure that JAR files in libs directory are included
* CB-7267 update RELEASENOTES for 3.5.1
* CB-7410 clarify the title
* CB-7385 update cordova.js for testing prior to branch/tag
* CB-7410 add whitelist entries to get iframe/GoogleMaps working
* CB-7291 propogate change in method signature to the native tests
* CB-7291: Restrict meaning of "\*" in internal whitelist to just http and https
* CB-7291: Only add file, content and data URLs to internal whitelist
* CB-7291: Add defaults to external whitelist
* CB-7291: Add external-launch-whitelist and use it for filtering intent launches
* CB-3445: Read project.properties to configure gradle libraries
* CB-7325 Fix error message in android_sdk_version.js when missing SDK on windows
* CB-7335 Add a .gitignore to android project template
* CB-7330 Fix dangling function call in last commit (broke gradle builds)
* CB-7330 Don't run "android update" during creation
* CB-3445 Add gradle support clean command (plus some code cleanup)
* CB-7044 Fix typo in prev commit causing check_reqs to always fail.
* CB-3445 Copy gradle wrapper in build instead of create
* CB-3445 Add .gradle template files for "update" as well as "create"
* CB-7044 Add JAVA_HOME when not set. Be stricter about ANDROID_HOME
* CB-3445 Speed up gradle building (incremental builds go from 10s -> 1.5s for me)
* CB-3445: android: Copy Gradle wrapper from Android SDK rather than bundling a JAR
* CB-3445: Add which to checked-in node_modules
* CB-3445: Add option to build and install with gradle
* CB-3445: Add an initial set of Gradle build scripts
* CB-7321 Don't require ant for create script
* CB-7044, CB-7299 Fix up PATH problems when possible.
* Change in test's AndroidManifest.xml needed for the test to run properly. Forgot the manifest.
* Change in test's AndroidManifest.xml needed for the test to run properly
* Adding tests related to 3.5.1
* CB-7261 Fix setNativeToJsBridgeMode sometimes crashing when switching to ONLINE_EVENT
* CB-7265 Fix crash when navigating to custom protocol (introduced in 3.5.1)
* Filter out non-launchable intents
* Handle unsupported protocol errors in webview better
* CB-7238: I should have collapsed this, but Config.init() must go before the creation of CordovaWebView
* CB-7238: Minor band-aid to get tests running again, this has to go away before 3.6.0 is released, since this is an API change.
* Extend whitelist to handle URLs without // chars
* CB-7172 Force window to have focus after resume
* CB-7159 Set background color of webView as well as its parent
* CB-7018 Fix setButtonPlumbedToJs never un-listening
* Undeprecate some just-deprecated symbols in PluginManager.
* @Deprecate methods of PluginManager that were never meant to be public
* Move plugin instantiation and instance storing logic PluginEntry->PluginManager
* Fix broken unit test due to missing Config.init() call
* Update to check for Google Glass APIs
* Fix for `android` not being in PATH check on Windows
* Displaying error when regex does not match.
* Fix broken compile due to previous commit :(
* Tweak CordovaPlugin.initialize method to be less deprecated.
* Un-deprecate CordovaActivity.init() - it's needed to tweak prefs in onCreate
* Tweak log messages in CordovaBridge with bridgeSecret is wrong
* Backport CordovaBridge from 4.0.x -> master
* Update unit tests to not use most deprecated things (e.g. DroidGap)
* Add non-String overloades for CordovaPreferences.set()
* Make CordovaWebview resilient to init() not being called (for backwards-compatibility)
* Add node_module licenses to LICENSE
* Update cordova.js snapshot to work with bridge changes
* Provide CordovaPlugin with CordovaPreferences. Add new Plugin.initialize()
* Convert usages of Config.\* to use the non-static versions
* Change getProperty -> prefs.get\* within CordovaActivity
* Make CordovaUriHelper class package-private
* Fix PluginManager.setPluginEntries not removing old entries
* Move registration of App plugin from config.xml -> code
* Make setWebViewClient an override instead of an overload. Delete Location-change JS->Native bridge mode (missed some of it).
* CB-4404 Revert setting android:windowSoftInputMode to "adjustPan"
* Refactor: Use ConfigXmlParser in activity. Adds CordovaWebView.init()
* Deprecate some convenience methods on CordovaActivity
* Fix CordovaPreferences not correctly parsing hex values (valueOf->decode)
* Refactor: Move url-filter information into PluginEntry.
* Don't re-parse config.xml in onResume.
* Move handling of Fullscreen preference to CordovaActivity
* Delete dead code from CordovaActivity
* Update .classpath to make Eclipse happy (just re-orders one line)
* Delete "CB-3064: The errorUrl is..." Log message left over from debugging presumably
* Refactor Config into ConfigXmlParser, CordovaPreferences
* Delete Location-change JS->Native bridge mode
* CB-5988 Allow exec() only from file: or start-up URL's domain
* CB-6761 Fix native->JS bridge ceasing to fire when page changes and online is set to false and the JS loads quickly
* Update the errorurl to no longer use intents
* This breaks running the JUnit tests, we'll bring it back soon
* Refactoring the URI handling on Cordova, removing dead code
* CB-7018 Clean up and deprecation of some button-related functions
* CB-7017 Fix onload=true being set on all subsequent plugins
* CB-5971: Fix package / project validation
* CB-5971: Add unit tests to cordova-android
* CB-5971: Factor out package/project name validation logic
* Delete explicit activity.finish() in back button handling. No change in behaviour.
* CB-5971: This would have been a good first bug, too bad
* CB-4404: Changing where android:windowSoftInputMode is in the manifest so it works
* Add documentation referencing other implementation.
* CB-6851 Deprecate WebView.sendJavascript()
* CB-6876 Show the correct executable name
* CB-6876 Fix the "print usage"
* Trivial spelling fix in comments when reading CordovaResourceApi
* CB-6818: I want to remove this code, because Square didn't do their headers properly
* CB-6860 Add activity_name and launcher_name to AndroidManifest.xml & strings.xml
* Add a comment to custom_rules.xml saying why we move AndroidManifest.xml
* Remove +x from README.md
* CB-6784 Add missing licenses
* CB-6784 Add license to CONTRIBUTING.md
* Revert "defaults.xml: Add AndroidLaunchMode preference"
* updated RELEASENOTES
* CB-6315: Wrapping this so it runs on the UI thread
* CB-6723 Update package name for Robotium
* CB-6707 Update minSdkVersion to 10 consistently
* CB-5652 make visible cordova version
* Update JS snapshot to version 3.6.0-dev (via coho)
* Update JS snapshot to version 3.6.0-dev (via coho)
* Set VERSION to 3.6.0-dev (via coho)
### 3.5.1 (August 2014) ###
This was a security update to address CVE-2014-3500, CVE-2014-3501,
and CVE-2014-3502. For more information, see
http://cordova.apache.org/announcements/2014/08/04/android-351.html
* Filter out non-launchable intents
* Handle unsupported protocol errors in webview better
* Update the errorurl to no longer use intents
* Refactoring the URI handling on Cordova, removing dead code
### 3.5.0 (May 2014) ###
* OkHttp has broken headers. Updating for ASF compliance.
* Revert accidentally removed lines from NOTICE
* CB-6552: added top level package.json
* CB-6491 add CONTRIBUTING.md
* CB-6543 Fix cordova/run failure when no custom_rules.xml available
* defaults.xml: Add AndroidLaunchMode preference
* Add JavaDoc for CordovaResourceApi
* CB-6388: Handle binary data correctly in LOAD_URL bridge
* Fix CB-6048: Set launchMode=singleTop so tapping app icon does not always restart app
* Remove incorrect usage of AlertDialog.Builder.create
* Catch uncaught exceptions in from plugins and turn them into error responses.
* Add NOTICE file
* CB-6047 Fix online sometimes getting in a bad state on page transitions.
* Add another convenience overload for CordovaResourceApi.copyResource
* Update framework's .classpath to what Eclipse wants it to be.
* README.md: `android update` to `android-19`.
* Fix NPE when POLLING bridge mode is used.
* Updating NOTICE to include Square for OkHttp
* CB-5398 Apply KitKat content URI fix to all content URIs
* CB-5398 Work-around for KitKat content: URLs not rendering in <img> tags
* CB-5908: add splascreen images to template
* CB-5395: Make scheme and host (but not path) case-insensitive in whitelist
* Ignore multiple onPageFinished() callbacks & onReceivedError due to stopLoading()
* Removing addJavascriptInterface support from all Android versions lower than 4.2 due to security vu
* CB-4984 Don't create on CordovaActivity name
* CB-5917 Add a loadUrlIntoView overload that doesn't recreate plugins.
* Use thread pool for load timeout.
* CB-5715 For CLI, hide assets/www and res/xml/config.xml by default
* CB-5793 ant builds: Rename AndroidManifest during -post-build to avoid Eclipse detecting ant-build/
* CB-5889 Make update script find project name instead of using "null" for CordovaLib
* CB-5889 Add a message in the update script about needing to import CordovaLib when using an IDE.
### 3.4.0 (Feb 2014) ###
43 commits from 10 authors. Highlights include:
* Removing addJavascriptInterface support from all Android versions lower than 4.2 due to security vulnerability
* CB-5917 Add a loadUrlIntoView overload that doesn't recreate plugins.
* CB-5889 Make update script find project name instead of using "null" for CordovaLib
* CB-5889 Add a message in the update script about needing to import CordovaLib when using an IDE.
* CB-5793 Don't clean before build and change output directory to ant-build to avoid conflicts with Eclipse.
* CB-5803 Fix cordova/emulate on windows.
* CB-5801 exec->spawn in build to make sure compile errors are shown.
* CB-5799 Update version of OkHTTP to 1.3
* CB-4910 Update CLI project template to point to config.xml at the root now that it's not in www/ by default.
* CB-5504 Adding onDestroy to app plugin to deregister telephonyReceiver
* CB-5715 Add Eclipse .project file to create template. For CLI projects, it adds refs for root www/ & config.xml and hides platform versions
* CB-5447 Removed android:debuggable=“true” from project template.
* CB-5714 Fix of android build when too big output stops build with error due to buffer overflow.
* CB-5592 Set MIME type for openExternal when scheme is file:
### 3.3.0 (Dec 2013) ###
41 commits from 11 authors. Highlights include:
* CB-5481 Fix for Cordova trying to get config.xml from the wrong namespace
* CB-5487 Enable Remote Debugging when your Android app is debuggable.
* CB-5445 Adding onScrollChanged and the ScrollEvent object
* CB-5422 Don't require JAVA_HOME to be defined
* CB-5490 Add javadoc target to ant script
* CB-5471 Deprecated DroidGap class
* CB-5255 Prefer Google API targets over android-## targets when building.
* CB-5232 Change create script to use Cordova as a Library Project instead of a .jar
* CB-5302 Massive movement to get tests working again
* CB-4996 Fix paths with spaces while launching on emulator and device
* CB-5209 Cannot build Android app if project path contains spaces
### 3.2.0 (Nov 2013) ###
27 commits from 7 authors. Highlights include:
* CB-5193 Fix Android WebSQL sometime throwing SECURITY_ERR.
* CB-5191 Deprecate <url-filter>
* Updating shelljs to 0.2.6. Copy now preserves mode bits.
* CB-4872 Added android version scripts (android_sdk_version, etc)
* CB-5117 Output confirmation message if check_reqs passes.
* CB-5080 Find resources in a way that works with aapt's --rename-manifest-package
* CB-4527 Don't delete .bat files even when on non-windows platform
* CB-4892 Fix create script only escaping the first space instead of all spaces.
### 3.1.0 (Sept 2013) ###
55 commits from 9 authors. Highlights include:
* [CB-4817] Remove unused assets in project template.
* Fail fast in create script if package name is not com.foo.bar.
* [CB-4782] Convert ApplicationInfo.java -> appinfo.js
* [CB-4766] Deprecated JSONUtils.java (moved into plugins)
* [CB-4765] Deprecated ExifHelper.java (moved into plugins)
* [CB-4764] Deprecated DirectoryManager.java (moved into plugins)
* [CB-4763] Deprecated FileHelper.java (moved into plugins), Move getMimeType() into CordovaResourceApi.
* [CB-4725] Add CordovaWebView.CORDOVA_VERSION constant
* Incrementing version check for Android 4.3 API Level 18
* [CB-3542] rewrote cli tooling scripts in node
* Allow CordovaChromeClient subclasses access to CordovaInterface and CordovaWebView members
* Refactor CordovaActivity.init so that subclasses can easily override factory methods for webview objects
* [CB-4652] Allow default project template to be overridden on create
* Tweak the online bridge to not send excess online events.
* [CB-4495] Modify start-emulator script to exit immediately on a fatal emulator error.
* Log WebView IOExceptions only when they are not 404s
* Use a higher threshold for slow exec() warnings when debugger is attached.
* Fix data URI decoding in CordovaResourceApi
* [CB-3819] Made it easier to set SplashScreen delay.
* [CB-4013] Fixed loadUrlTimeoutValue preference.
* Upgrading project to Android 4.3
* [CB-4198] bin/create script should be better at handling non-word characters in activity name. Patched windows script as well.
* [CB-4198] bin/create should handle spaces in activity better.
* [CB-4096] Implemented new unified whitelist for android
* [CB-3384] Fix thread assertion when plugins remap URIs
================================================
FILE: VERSION
================================================
3.6.3
================================================
FILE: bin/android_sdk_version
================================================
#!/usr/bin/env node
/*
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.
*/
var android_sdk_version = require('./lib/android_sdk_version');
android_sdk_version.run().done(null, function(err) {
console.log(err);
process.exit(2);
});
================================================
FILE: bin/android_sdk_version.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0android_sdk_version"
IF EXIST %script_path% (
node "%script_path%" %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'android_sdk_version' script in 'bin' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/check_reqs
================================================
#!/usr/bin/env node
/*
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.
*/
var check_reqs = require('./lib/check_reqs');
check_reqs.run().done(
function success() {
console.log('Looks like your environment fully supports cordova-android development!');
}, function fail(err) {
console.log(err);
process.exit(2);
}
);
================================================
FILE: bin/check_reqs.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0check_reqs"
IF EXIST %script_path% (
node "%script_path%" %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'check_reqs' script in 'bin' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/create
================================================
#!/usr/bin/env node
/*
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.
*/
var path = require('path');
var create = require('./lib/create');
var args = require('./lib/simpleargs').getArgs(process.argv);
var apk_url = args['--xwalk-apk-url'];
var shared_library = args['--xwalk-shared-library'];
if (args['--help'] || args._.length === 0) {
console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'create')) + ' <path_to_new_project> <package_name> <project_name> [<template_path>] [--shared]');
console.log(' <path_to_new_project>: Path to your new Cordova Android project');
console.log(' <package_name>: Package name, following reverse-domain style convention');
console.log(' <project_name>: Project name');
console.log(' <template_path>: Path to a custom application template to use');
console.log(' --shared will use the CordovaLib project directly instead of making a copy.');
console.log(' --xwalk-shared-library will use Crosswalk shared mode to package the project that without xwalk so library.');
console.log(' --xwalk-apk-url configure the download URL of the Crosswalk runtime library, it requires --xwalk-shared-library.');
process.exit(1);
}
if (typeof apk_url != 'undefined' &&
(typeof apk_url != 'string' || apk_url.length == 0)) {
console.log(' --xwalk-apk-url expects a URL.');
process.exit(1);
}
if (apk_url && !shared_library) {
console.log(' --xwalk-apk-url must be used together with --xwalk-shared-library.');
process.exit(1);
}
if (args['--shared'] && (apk_url || shared_library)) {
console.log(' --shared cannot be used with --xwalk-apk-url and --xwalk-shared-library.');
process.exit(1);
}
create.createProject(args._[0], args._[1], args._[2], args._[3], args['--shared'], args['--cli'], args['--xwalk-shared-library'], args['--xwalk-apk-url']).done();
================================================
FILE: bin/create.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0create"
IF EXIST %script_path% (
node %script_path% %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'create' script in 'bin' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/lib/android_sdk_version.js
================================================
#!/usr/bin/env node
/*
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.
*/
var shell = require('shelljs'),
child_process = require('child_process'),
Q = require('q');
get_highest_sdk = function(results){
var reg = /\d+/;
var apiLevels = [];
for(var i=0;i<results.length;i++){
apiLevels[i] = parseInt(results[i].match(reg)[0]);
}
apiLevels.sort(function(a,b){return b-a});
console.log(apiLevels[0]);
}
get_sdks = function() {
var d = Q.defer();
child_process.exec('android list targets', function(err, stdout, stderr) {
if (err) d.reject(stderr);
else d.resolve(stdout);
});
return d.promise.then(function(output) {
var reg = /android-\d+/gi;
var results = output.match(reg);
if(results.length===0){
return Q.reject(new Error('No android sdks installed.'));
}else{
get_highest_sdk(results);
}
return Q();
}, function(stderr) {
if (stderr.match(/command\snot\sfound/) || stderr.match(/'android' is not recognized/)) {
return Q.reject(new Error('The command \"android\" failed. Make sure you have the latest Android SDK installed, and the \"android\" command (inside the tools/ folder) is added to your path.'));
} else {
return Q.reject(new Error('An error occurred while listing Android targets'));
}
});
}
module.exports.run = function() {
return Q.all([get_sdks()]);
}
================================================
FILE: bin/lib/check_reqs.js
================================================
#!/usr/bin/env node
/*
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.
*/
var shelljs = require('shelljs'),
child_process = require('child_process'),
Q = require('q'),
path = require('path'),
fs = require('fs'),
which = require('which'),
ROOT = path.join(__dirname, '..', '..');
var isWindows = process.platform == 'win32';
function forgivingWhichSync(cmd) {
try {
return which.sync(cmd);
} catch (e) {
return '';
}
}
function tryCommand(cmd, errMsg) {
var d = Q.defer();
child_process.exec(cmd, function(err, stdout, stderr) {
if (err) d.reject(new Error(errMsg));
else d.resolve(stdout);
});
return d.promise;
}
// Get valid target from framework/project.properties
module.exports.get_target = function() {
if(fs.existsSync(path.join(ROOT, 'framework', 'project.properties'))) {
var target = shelljs.grep(/target=android-[\d+]/, path.join(ROOT, 'framework', 'project.properties'));
return target.split('=')[1].replace('\n', '').replace('\r', '').replace(' ', '');
} else if (fs.existsSync(path.join(ROOT, 'project.properties'))) {
// if no target found, we're probably in a project and project.properties is in ROOT.
// this is called on the project itself, and can support Google APIs AND Vanilla Android
var target = shelljs.grep(/target=android-[\d+]/, path.join(ROOT, 'project.properties')) ||
shelljs.grep(/target=Google Inc.:Google APIs:[\d+]/, path.join(ROOT, 'project.properties'));
if(target == "" || !target) {
// Try Google Glass APIs
target = shelljs.grep(/target=Google Inc.:Glass Development Kit Preview:[\d+]/, path.join(ROOT, 'project.properties'));
}
return target.split('=')[1].replace('\n', '').replace('\r', '');
}
}
// Returns a promise. Called only by build and clean commands.
module.exports.check_ant = function() {
return tryCommand('ant -version', 'Failed to run "ant -version", make sure you have ant installed and added to your PATH.');
};
// Returns a promise. Called only by build and clean commands.
module.exports.check_gradle = function() {
var sdkDir = process.env['ANDROID_HOME'];
var wrapperDir = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper');
if (!fs.existsSync(wrapperDir)) {
return Q.reject(new Error('Could not find gradle wrapper within android sdk. Might need to update your Android SDK.\n' +
'Looked here: ' + wrapperDir));
}
return Q.when();
};
// Returns a promise.
module.exports.check_java = function() {
var javacPath = forgivingWhichSync('javac');
var hasJavaHome = !!process.env['JAVA_HOME'];
return Q().then(function() {
if (hasJavaHome) {
// Windows java installer doesn't add javac to PATH, nor set JAVA_HOME (ugh).
if (!javacPath) {
process.env['PATH'] += path.delimiter + path.join(process.env['JAVA_HOME'], 'bin');
}
} else {
if (javacPath) {
// OS X has a command for finding JAVA_HOME.
if (fs.existsSync('/usr/libexec/java_home')) {
return tryCommand('/usr/libexec/java_home', 'Failed to run: /usr/libexec/java_home')
.then(function(stdout) {
process.env['JAVA_HOME'] = stdout.trim();
});
} else {
// See if we can derive it from javac's location.
var maybeJavaHome = path.dirname(path.dirname(javacPath));
if (fs.existsSync(path.join(maybeJavaHome, 'lib', 'tools.jar'))) {
process.env['JAVA_HOME'] = maybeJavaHome;
} else {
throw new Error('Could not find JAVA_HOME. Try setting the environment variable manually');
}
}
} else if (isWindows) {
// Try to auto-detect java in the default install paths.
var firstJdkDir =
shelljs.ls(process.env['ProgramFiles'] + '\\java\\jdk*')[0] ||
shelljs.ls('C:\\Program Files\\java\\jdk*')[0] ||
shelljs.ls('C:\\Program Files (x86)\\java\\jdk*')[0];
if (firstJdkDir) {
// shelljs always uses / in paths.
firstJdkDir = firstJdkDir.replace(/\//g, path.sep);
if (!javacPath) {
process.env['PATH'] += path.delimiter + path.join(firstJdkDir, 'bin');
}
process.env['JAVA_HOME'] = firstJdkDir;
}
}
}
}).then(function() {
var msg =
'Failed to run "java -version", make sure your java environment is set up\n' +
'including JDK and JRE.\n' +
'Your JAVA_HOME variable is: ' + process.env['JAVA_HOME'];
return tryCommand('java -version', msg)
}).then(function() {
msg = 'Failed to run "javac -version", make sure you have a Java JDK (not just a JRE) installed.';
return tryCommand('javac -version', msg)
});
}
// Returns a promise.
module.exports.check_android = function() {
return Q().then(function() {
var androidCmdPath = forgivingWhichSync('android');
var adbInPath = !!forgivingWhichSync('adb');
var hasAndroidHome = !!process.env['ANDROID_HOME'] && fs.existsSync(process.env['ANDROID_HOME']);
if (hasAndroidHome && !androidCmdPath) {
process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'tools');
}
if (androidCmdPath && !hasAndroidHome) {
var parentDir = path.dirname(androidCmdPath);
if (path.basename(parentDir) == 'tools') {
process.env['ANDROID_HOME'] = path.dirname(parentDir);
hasAndroidHome = true;
}
}
if (hasAndroidHome && !adbInPath) {
process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'platform-tools');
}
if (!process.env['ANDROID_HOME']) {
throw new Error('ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.');
}
if (!fs.existsSync(process.env['ANDROID_HOME'])) {
throw new Error('ANDROID_HOME is set to a non-existant path: ' + process.env['ANDROID_HOME']);
}
// Check that the target sdk level is installed.
return module.exports.check_android_target(module.exports.get_target());
});
};
module.exports.check_android_target = function(valid_target) {
var msg = 'Failed to run "android". Make sure you have the latest Android SDK installed, and that the "android" command (inside the tools/ folder) is added to your PATH.';
return tryCommand('android list targets', msg)
.then(function(output) {
if (!output.match(valid_target)) {
throw new Error('Please install Android target "' + valid_target + '".\n' +
'Hint: Run "android" from your command-line to open the SDK manager.');
}
});
};
// Returns a promise.
module.exports.run = function() {
return Q.all([this.check_java(), this.check_android()]);
}
================================================
FILE: bin/lib/create.js
================================================
#!/usr/bin/env node
/*
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.
*/
var shell = require('shelljs'),
child_process = require('child_process'),
Q = require('q'),
path = require('path'),
fs = require('fs'),
check_reqs = require('./check_reqs'),
ROOT = path.join(__dirname, '..', '..'),
XWALK_LIBRARY_PATH= path.join(ROOT, 'framework', 'xwalk_core_library');
XWALK_SHARED_LIBRARY_PATH= path.join(ROOT, 'framework', 'xwalk_shared_library');
// Returns a promise.
function exec(command, opt_cwd) {
var d = Q.defer();
console.log('Running: ' + command);
child_process.exec(command, { cwd: opt_cwd }, function(err, stdout, stderr) {
stdout && console.log(stdout);
stderr && console.error(stderr);
if (err) d.reject(err);
else d.resolve(stdout);
});
return d.promise;
}
function setShellFatal(value, func) {
var oldVal = shell.config.fatal;
shell.config.fatal = value;
func();
shell.config.fatal = oldVal;
}
function getFrameworkDir(projectPath, shared) {
return shared ? path.join(ROOT, 'framework') : path.join(projectPath, 'CordovaLib');
}
function copyJsAndLibrary(projectPath, shared, projectName, xwalkSharedLibrary) {
var nestedCordovaLibPath = getFrameworkDir(projectPath, false);
shell.cp('-f', path.join(ROOT, 'framework', 'assets', 'www', 'cordova.js'), path.join(projectPath, 'assets', 'www', 'cordova.js'));
// Don't fail if there are no old jars.
setShellFatal(false, function() {
shell.ls(path.join(projectPath, 'libs', 'cordova-*.jar')).forEach(function(oldJar) {
console.log("Deleting " + oldJar);
shell.rm('-f', oldJar);
});
// Delete old library project if it existed.
if (shared) {
shell.rm('-rf', nestedCordovaLibPath);
} else {
// Delete only the src, since eclipse can't handle its .project file being deleted.
shell.rm('-rf', path.join(nestedCordovaLibPath, 'src'));
}
});
if (!shared) {
shell.mkdir('-p', nestedCordovaLibPath);
shell.cp('-f', path.join(ROOT, 'framework', 'AndroidManifest.xml'), nestedCordovaLibPath);
shell.cp('-f', path.join(ROOT, 'framework', 'project.properties'), nestedCordovaLibPath);
shell.cp('-f', path.join(ROOT, 'framework', 'build.gradle'), nestedCordovaLibPath);
shell.cp('-r', path.join(ROOT, 'framework', 'src'), nestedCordovaLibPath);
if (xwalkSharedLibrary) {
shell.mkdir(path.join(nestedCordovaLibPath, 'xwalk_core_library'));
shell.cp('-r', path.join(ROOT, 'framework', 'xwalk_shared_library/*'), path.join(nestedCordovaLibPath, 'xwalk_core_library'));
} else {
shell.cp('-r', path.join(ROOT, 'framework', 'xwalk_core_library'), nestedCordovaLibPath);
}
// Create an eclipse project file and set the name of it to something unique.
// Without this, you can't import multiple CordovaLib projects into the same workspace.
var eclipseProjectFilePath = path.join(nestedCordovaLibPath, '.project');
if (!fs.existsSync(eclipseProjectFilePath)) {
var data = '<?xml version="1.0" encoding="UTF-8"?><projectDescription><name>' + projectName + '-' + 'CordovaLib</name></projectDescription>';
fs.writeFileSync(eclipseProjectFilePath, data, 'utf8');
}
}
}
function extractSubProjectPaths(data) {
var ret = {};
var r = /^\s*android\.library\.reference\.\d+=(.*)(?:\s|$)/mg
var m;
while (m = r.exec(data)) {
ret[m[1]] = 1;
}
return Object.keys(ret);
}
function writeProjectProperties(projectPath, target_api, shared) {
var dstPath = path.join(projectPath, 'project.properties');
var templatePath = path.join(ROOT, 'bin', 'templates', 'project', 'project.properties');
var srcPath = fs.existsSync(dstPath) ? dstPath : templatePath;
var data = fs.readFileSync(srcPath, 'utf8');
data = data.replace(/^target=.*/m, 'target=' + target_api);
var subProjects = extractSubProjectPaths(data);
subProjects = subProjects.filter(function(p) {
return !(/^CordovaLib$/m.exec(p) ||
/[\\\/]cordova-android[\\\/]framework$/m.exec(p) ||
/^(\.\.[\\\/])+framework$/m.exec(p)
);
});
subProjects.unshift(shared ? path.relative(projectPath, path.join(ROOT, 'framework')) : 'CordovaLib');
data = data.replace(/^\s*android\.library\.reference\.\d+=.*\n/mg, '');
if (!/\n$/.exec(data)) {
data += '\n';
}
for (var i = 0; i < subProjects.length; ++i) {
data += 'android.library.reference.' + (i+1) + '=' + subProjects[i] + '\n';
}
fs.writeFileSync(dstPath, data);
var targetFrameworkDir = getFrameworkDir(projectPath, shared);
exec('android update lib-project -p "' + targetFrameworkDir + '" --target ' + target_api);
}
function copyBuildRules(projectPath) {
var srcDir = path.join(ROOT, 'bin', 'templates', 'project');
//shell.cp('-f', path.join(srcDir, 'custom_rules.xml'), projectPath);
shell.cp('-f', path.join(srcDir, 'build.gradle'), projectPath);
shell.cp('-f', path.join(srcDir, 'settings.gradle'), projectPath);
}
function copyScripts(projectPath) {
var srcScriptsDir = path.join(ROOT, 'bin', 'templates', 'cordova');
var destScriptsDir = path.join(projectPath, 'cordova');
// Delete old scripts directory if this is an update.
shell.rm('-rf', destScriptsDir);
// Copy in the new ones.
shell.cp('-r', srcScriptsDir, projectPath);
shell.cp('-r', path.join(ROOT, 'bin', 'node_modules'), destScriptsDir);
shell.cp(path.join(ROOT, 'bin', 'check_reqs'), path.join(destScriptsDir, 'check_reqs'));
shell.cp(path.join(ROOT, 'bin', 'lib', 'check_reqs.js'), path.join(projectPath, 'cordova', 'lib', 'check_reqs.js'));
shell.cp(path.join(ROOT, 'bin', 'android_sdk_version'), path.join(destScriptsDir, 'android_sdk_version'));
shell.cp(path.join(ROOT, 'bin', 'lib', 'android_sdk_version.js'), path.join(projectPath, 'cordova', 'lib', 'android_sdk_version.js'));
}
/**
* Test whether a package name is acceptable for use as an android project.
* Returns a promise, fulfilled if the package name is acceptable; rejected
* otherwise.
*/
function validatePackageName(package_name) {
//Make the package conform to Java package types
//Enforce underscore limitation
if (!/^[a-zA-Z]+(\.[a-zA-Z0-9][a-zA-Z0-9_]*)+$/.test(package_name)) {
return Q.reject('Package name must look like: com.company.Name');
}
//Class is a reserved word
if(/\b[Cc]lass\b/.test(package_name)) {
return Q.reject('class is a reserved word');
}
return Q.resolve();
}
/**
* Test whether a project name is acceptable for use as an android class.
* Returns a promise, fulfilled if the project name is acceptable; rejected
* otherwise.
*/
function validateProjectName(project_name) {
//Make sure there's something there
if (project_name === '') {
return Q.reject('Project name cannot be empty');
}
//Enforce stupid name error
if (project_name === 'CordovaActivity') {
return Q.reject('Project name cannot be CordovaActivity');
}
//Classes in Java don't begin with numbers
if (/^[0-9]/.test(project_name)) {
return Q.reject('Project name must not begin with a number');
}
return Q.resolve();
}
/**
* $ create [options]
*
* Creates an android application with the given options.
*
* Options:
*
* - `project_path` {String} Path to the new Cordova android project.
* - `package_name`{String} Package name, following reverse-domain style convention.
* - `project_name` {String} Project name.
* - 'project_template_dir' {String} Path to project template (override).
*
* Returns a promise.
*/
exports.createProject = function(project_path, package_name, project_name, project_template_dir,
use_shared_project, use_cli_template, xwalk_shared_library, xwalk_apk_url) {
var VERSION = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8').trim();
// Set default values for path, package and name
project_path = typeof project_path !== 'undefined' ? project_path : "CordovaExample";
project_path = path.relative(process.cwd(), project_path);
package_name = typeof package_name !== 'undefined' ? package_name : 'my.cordova.project';
project_name = typeof project_name !== 'undefined' ? project_name : 'CordovaExample';
project_template_dir = typeof project_template_dir !== 'undefined' ?
project_template_dir :
path.join(ROOT, 'bin', 'templates', 'project');
xwalk_apk_url = typeof xwalk_apk_url !== 'undefined' ? xwalk_apk_url : "";
var safe_activity_name = project_name.replace(/\W/g, '');
var package_as_path = package_name.replace(/\./g, path.sep);
var activity_dir = path.join(project_path, 'src', package_as_path);
var activity_path = path.join(activity_dir, safe_activity_name + '.java');
var target_api = check_reqs.get_target();
var manifest_path = path.join(project_path, 'AndroidManifest.xml');
// Check if project already exists
if(fs.existsSync(project_path)) {
return Q.reject('Project already exists! Delete and recreate');
}
// prepare xwalk_core_library
if(fs.existsSync(XWALK_LIBRARY_PATH)) {
exec('android update lib-project --path "' + XWALK_LIBRARY_PATH + '" --target "' + target_api + '"' )
} else {
// TODO(wang16): download xwalk core library here
return Q.reject('No XWalk Library Project found. Please download it and extract it to $XWALK_LIBRARY_PATH')
}
if (xwalk_shared_library) {
if (fs.existsSync(XWALK_SHARED_LIBRARY_PATH)) {
exec('android update lib-project --path "' + XWALK_SHARED_LIBRARY_PATH + '" --target "' + target_api + '"' )
} else {
return Q.reject('No XWalk Shared Library Project found. Please download it and extract it to $XWALK_SHARED_LIBRARY_PATH')
}
}
//Make the package conform to Java package types
return validatePackageName(package_name)
.then(function() {
validateProjectName(project_name);
})
// Check that requirements are met and proper targets are installed
.then(function() {
return check_reqs.run();
}).then(function() {
// Log the given values for the project
console.log('Creating Cordova project for the Android platform:');
console.log('\tPath: ' + project_path);
console.log('\tPackage: ' + package_name);
console.log('\tName: ' + project_name);
console.log('\tAndroid target: ' + target_api);
console.log('Copying template files...');
setShellFatal(true, function() {
// copy project template
shell.cp('-r', path.join(project_template_dir, 'assets'), project_path);
shell.cp('-r', path.join(project_template_dir, 'res'), project_path);
shell.cp('-r', path.join(ROOT, 'framework', 'res', 'xml'), path.join(project_path, 'res'));
shell.cp(path.join(project_template_dir, 'gitignore'), path.join(project_path, '.gitignore'));
// Manually create directories that would be empty within the template (since git doesn't track directories).
shell.mkdir(path.join(project_path, 'libs'));
// Add in the proper eclipse project file.
if (use_cli_template) {
var note = 'To show `assets/www` or `res/xml/config.xml`, go to:\n' +
' Project -> Properties -> Resource -> Resource Filters\n' +
'And delete the exclusion filter.\n';
shell.cp(path.join(project_template_dir, 'eclipse-project-CLI'), path.join(project_path, '.project'));
fs.writeFileSync(path.join(project_path, 'assets', '_where-is-www.txt'), note);
} else {
shell.cp(path.join(project_template_dir, 'eclipse-project'), path.join(project_path, '.project'));
}
// copy cordova.js, cordova.jar
copyJsAndLibrary(project_path, use_shared_project, safe_activity_name, xwalk_shared_library);
// interpolate the activity name and package
shell.mkdir('-p', activity_dir);
shell.cp('-f', path.join(project_template_dir, 'Activity.java'), activity_path);
shell.sed('-i', /__ACTIVITY__/, safe_activity_name, activity_path);
shell.sed('-i', /__NAME__/, project_name, path.join(project_path, 'res', 'values', 'strings.xml'));
shell.sed('-i', /__NAME__/, project_name, path.join(project_path, '.project'));
shell.sed('-i', /__ID__/, package_name, activity_path);
shell.cp('-f', path.join(project_template_dir, 'AndroidManifest.xml'), manifest_path);
shell.sed('-i', /__ACTIVITY__/, safe_activity_name, manifest_path);
shell.sed('-i', /__PACKAGE__/, package_name, manifest_path);
shell.sed('-i', /__APILEVEL__/, target_api.split('-')[1], manifest_path);
shell.sed('-i', /__XWALKAPKURL__/, xwalk_apk_url, manifest_path);
copyScripts(project_path);
copyBuildRules(project_path);
});
// Link it to local android install.
writeProjectProperties(project_path, target_api, use_shared_project);
}).then(function() {
console.log('Project successfully created.');
});
}
// Attribute removed in Cordova 4.4 (CB-5447).
function removeDebuggableFromManifest(projectPath) {
var manifestPath = path.join(projectPath, 'AndroidManifest.xml');
shell.sed('-i', /\s*android:debuggable="true"/, '', manifestPath);
}
function extractProjectNameFromManifest(projectPath) {
var manifestPath = path.join(projectPath, 'AndroidManifest.xml');
var manifestData = fs.readFileSync(manifestPath, 'utf8');
var m = /<activity[\s\S]*?android:name\s*=\s*"(.*?)"/i.exec(manifestData);
if (!m) {
throw new Error('Could not find activity name in ' + manifestPath);
}
return m[1];
}
// Returns a promise.
exports.updateProject = function(projectPath, shared, xwalkSharedLibrary) {
var newVersion = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8').trim();
// Check that requirements are met and proper targets are installed
return check_reqs.run()
.then(function() {
var projectName = extractProjectNameFromManifest(projectPath);
var target_api = check_reqs.get_target();
copyJsAndLibrary(projectPath, shared, projectName, xwalkSharedLibrary);
copyScripts(projectPath);
copyBuildRules(projectPath);
removeDebuggableFromManifest(projectPath);
writeProjectProperties(projectPath, target_api, shared);
console.log('Android project is now at version ' + newVersion);
console.log('If you updated from a pre-3.2.0 version and use an IDE, we now require that you import the "CordovaLib" library project.');
});
};
// For testing
exports.validatePackageName = validatePackageName;
exports.validateProjectName = validateProjectName;
================================================
FILE: bin/lib/simpleargs.js
================================================
/*
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.
*/
exports.getArgs = function(argv) {
var ret = {};
var posArgs = [];
for (var i = 2, arg; arg = argv[i] || i < argv.length; ++i) {
if (/^--/.exec(arg)) {
if (arg.indexOf("=") != -1) {
var arr = arg.split("=");
ret[arr[0]] = arr[1];
} else {
ret[arg] = true;
}
} else {
posArgs.push(arg);
}
}
ret._ = posArgs;
return ret;
};
================================================
FILE: bin/templates/cordova/build
================================================
#!/usr/bin/env node
/*
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.
*/
var build = require('./lib/build'),
reqs = require('./lib/check_reqs'),
args = process.argv;
// Support basic help commands
if(args[2] == '--help' ||
args[2] == '/?' ||
args[2] == '-h' ||
args[2] == 'help' ||
args[2] == '-help' ||
args[2] == '/help') {
build.help();
} else {
reqs.run().done(function() {
return build.run(args.slice(2));
}, function(err) {
console.error(err);
process.exit(2);
});
}
================================================
FILE: bin/templates/cordova/build.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0build"
IF EXIST %script_path% (
node %script_path% %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'build' script in 'cordova' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/templates/cordova/clean
================================================
#!/usr/bin/env node
/*
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.
*/
var build = require('./lib/build'),
reqs = require('./lib/check_reqs'),
args = process.argv;
var path = require('path');
// Support basic help commands
if(args[2] == '--help' ||
args[2] == '/?' ||
args[2] == '-h' ||
args[2] == 'help' ||
args[2] == '-help' ||
args[2] == '/help') {
console.log('Usage: ' + path.relative(process.cwd(), process.argv[1]));
console.log('Cleans the project directory.');
process.exit(0);
} else {
reqs.run().done(function() {
return build.runClean(args.slice(2));
}, function(err) {
console.error(err);
process.exit(2);
});
}
================================================
FILE: bin/templates/cordova/clean.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0clean"
IF EXIST %script_path% (
node %script_path% %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'clean' script in 'cordova' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/templates/cordova/defaults.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<widget xmlns = "http://www.w3.org/ns/widgets"
id = "io.cordova.helloCordova"
version = "2.0.0">
<!-- Preferences for Android -->
<preference name="loglevel" value="DEBUG" />
</widget>
================================================
FILE: bin/templates/cordova/lib/appinfo.js
================================================
#!/usr/bin/env node
/*
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.
*/
var path = require('path');
var fs = require('fs');
var cachedAppInfo = null;
function readAppInfoFromManifest() {
var manifestPath = path.join(__dirname, '..', '..', 'AndroidManifest.xml');
var manifestData = fs.readFileSync(manifestPath, {encoding:'utf8'});
var packageName = /\bpackage\s*=\s*"(.+?)"/.exec(manifestData);
if (!packageName) throw new Error('Could not find package name within ' + manifestPath);
var activityTag = /<activity\b[\s\S]*<\/activity>/.exec(manifestData);
if (!activityTag) throw new Error('Could not find <activity> within ' + manifestPath);
var activityName = /\bandroid:name\s*=\s*"(.+?)"/.exec(activityTag);
if (!activityName) throw new Error('Could not find android:name within ' + manifestPath);
return packageName[1] + '/.' + activityName[1];
}
exports.getActivityName = function() {
return cachedAppInfo = cachedAppInfo || readAppInfoFromManifest();
};
================================================
FILE: bin/templates/cordova/lib/build.js
================================================
#!/usr/bin/env node
/*
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.
*/
var shell = require('shelljs'),
spawn = require('./spawn'),
Q = require('q'),
path = require('path'),
fs = require('fs'),
ROOT = path.join(__dirname, '..', '..');
var check_reqs = require('./check_reqs');
var LOCAL_PROPERTIES_TEMPLATE =
'# This file is automatically generated.\n' +
'# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n';
function find_files(directory, predicate) {
if (fs.existsSync(directory)) {
var candidates = fs.readdirSync(directory).filter(predicate).map(function(p) {
p = path.join(directory, p);
return { p: p, t: fs.statSync(p).mtime };
}).sort(function(a,b) {
return a.t > b.t ? -1 :
a.t < b.t ? 1 : 0;
}).map(function(p) { return p.p; });
return candidates;
} else {
console.error('ERROR : unable to find project ' + directory + ' directory, could not locate .apk');
process.exit(2);
}
}
function hasCustomRules() {
return fs.existsSync(path.join(ROOT, 'custom_rules.xml'));
}
function extractProjectNameFromManifest(projectPath) {
var manifestPath = path.join(projectPath, 'AndroidManifest.xml');
var manifestData = fs.readFileSync(manifestPath, 'utf8');
var m = /<activity[\s\S]*?android:name\s*=\s*"(.*?)"/i.exec(manifestData);
if (!m) {
throw new Error('Could not find activity name in ' + manifestPath);
}
return m[1];
}
function extractSubProjectPaths() {
var data = fs.readFileSync(path.join(ROOT, 'project.properties'), 'utf8');
var ret = {};
var r = /^\s*android\.library\.reference\.\d+=(.*)(?:\s|$)/mg
var m;
while (m = r.exec(data)) {
ret[m[1]] = 1;
}
return Object.keys(ret);
}
var builders = {
ant: {
getArgs: function(cmd) {
var args = [cmd, '-f', path.join(ROOT, 'build.xml')];
// custom_rules.xml is required for incremental builds.
if (hasCustomRules()) {
args.push('-Dout.dir=ant-build', '-Dgen.absolute.dir=ant-gen');
}
return args;
},
prepEnv: function() {
return check_reqs.check_ant()
.then(function() {
// Copy in build.xml on each build so that:
// A) we don't require the Android SDK at project creation time, and
// B) we always use the SDK's latest version of it.
var sdkDir = process.env['ANDROID_HOME'];
var buildTemplate = fs.readFileSync(path.join(sdkDir, 'tools', 'lib', 'build.template'), 'utf8');
function writeBuildXml(projectPath) {
var newData = buildTemplate.replace('PROJECT_NAME', extractProjectNameFromManifest(ROOT));
fs.writeFileSync(path.join(projectPath, 'build.xml'), newData);
if (!fs.existsSync(path.join(projectPath, 'local.properties'))) {
fs.writeFileSync(path.join(projectPath, 'local.properties'), LOCAL_PROPERTIES_TEMPLATE);
}
}
var subProjects = extractSubProjectPaths();
writeBuildXml(ROOT);
for (var i = 0; i < subProjects.length; ++i) {
writeBuildXml(path.join(ROOT, subProjects[i]));
}
});
},
/*
* Builds the project with ant.
* Returns a promise.
*/
build: function(build_type) {
// Without our custom_rules.xml, we need to clean before building.
var ret = Q();
if (!hasCustomRules()) {
// clean will call check_ant() for us.
ret = this.clean();
}
var builder = this;
var args = this.getArgs(build_type == 'debug' ? 'debug' : 'release');
return check_reqs.check_ant()
.then(function() {
return spawn('ant', args);
}).then(function() {
return builder.getOutputFiles();
});
},
clean: function() {
var args = this.getArgs('clean');
return check_reqs.check_ant()
.then(function() {
return spawn('ant', args);
});
},
// Find the recently-generated output APK files
// Ant only generates one output file; return it.
getOutputFiles: function() {
var binDir;
if(hasCustomRules()) {
binDir = path.join(ROOT, 'ant-build');
} else {
binDir = path.join(ROOT, 'bin');
}
var candidates = find_files(binDir, function(candidate) { return path.extname(candidate) == '.apk'; });
if (candidates.length === 0) {
console.error('ERROR : No .apk found in ' + binDir + ' directory');
process.exit(2);
}
console.log('Using apk: ' + candidates[0]);
return [candidates[0]];
}
},
gradle: {
getArgs: function(cmd) {
var lintSteps;
if (process.env['BUILD_MULTIPLE_APKS']) {
lintSteps = [
'lint',
'lintVitalX86Release',
'lintVitalArmv7Release',
'compileLint',
'copyReleaseLint',
'copyDebugLint'
];
} else {
lintSteps = [
'lint',
'lintVitalRelease',
'compileLint',
'copyReleaseLint',
'copyDebugLint'
];
}
var args = [cmd, '-b', path.join(ROOT, 'build.gradle')];
// 10 seconds -> 6 seconds
args.push('-Dorg.gradle.daemon=true');
// Excluding lint: 6s-> 1.6s
for (var i = 0; i < lintSteps.length; ++i) {
args.push('-x', lintSteps[i]);
}
// Shaves another 100ms, but produces a "try at own risk" warning. Not worth it (yet):
// args.push('-Dorg.gradle.parallel=true');
return args;
},
prepEnv: function() {
return check_reqs.check_gradle()
.then(function() {
// Copy the gradle wrapper on each build so that:
// A) we don't require the Android SDK at project creation time, and
// B) we always use the SDK's latest version of it.
var projectPath = ROOT;
// check_reqs ensures that this is set.
var sdkDir = process.env['ANDROID_HOME'];
var wrapperDir = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper');
if (process.platform == 'win32') {
shell.cp('-f', path.join(wrapperDir, 'gradlew.bat'), projectPath);
} else {
shell.cp('-f', path.join(wrapperDir, 'gradlew'), projectPath);
}
shell.rm('-rf', path.join(projectPath, 'gradle', 'wrapper'));
shell.mkdir('-p', path.join(projectPath, 'gradle'));
shell.cp('-r', path.join(wrapperDir, 'gradle', 'wrapper'), path.join(projectPath, 'gradle'));
});
},
/*
* Builds the project with gradle.
* Returns a promise.
*/
build: function(build_type) {
var builder = this;
var wrapper = path.join(ROOT, 'gradlew');
var args = builder.getArgs('build');
return Q().then(function() {
return spawn(wrapper, args);
}).then(function() {
return builder.getOutputFiles(build_type);
});
},
clean: function() {
var builder = this;
var wrapper = path.join(ROOT, 'gradlew');
var args = builder.getArgs('clean');
return Q().then(function() {
return spawn(wrapper, args);
});
},
// Find the recently-generated output APK files
// Gradle can generate multiple output files; return all of them.
getOutputFiles: function(build_type) {
var binDir = path.join(ROOT, 'build', 'apk');
var candidates = find_files(binDir, function(candidate) {
// Need to choose between release and debug .apk.
if (build_type === 'debug') {
return (path.extname(candidate) == '.apk' && candidate.indexOf('-debug-') >= 0);
}
if (build_type === 'release') {
return (path.extname(candidate) == '.apk' && candidate.indexOf('-release-') >= 0);
}
return path.extname(candidate) == '.apk';
});
return candidates;
}
},
none: {
prepEnv: function() {
return Q();
},
build: function() {
console.log('Skipping build...');
return Q();
},
clean: function() {
return Q();
},
}
};
function parseOpts(options) {
// Backwards-compatibility: Allow a single string argument
if (typeof options == "string") options = [options];
var ret = {
buildType: 'debug',
buildMethod: process.env['ANDROID_BUILD'] || 'ant'
};
// Iterate through command line options
for (var i=0; options && (i < options.length); ++i) {
if (options[i].substring && options[i].substring(0,2) == "--") {
var option = options[i].substring(2);
switch(option) {
case 'debug':
case 'release':
ret.buildType = option;
break;
case 'ant':
case 'gradle':
ret.buildMethod = option;
break;
case 'nobuild' :
ret.buildMethod = 'none';
break;
default :
return Q.reject('Build option \'' + options[i] + '\' not recognized.');
}
} else {
return Q.reject('Build option \'' + options[i] + '\' not recognized.');
}
}
return ret;
}
/*
* Builds the project with the specifed options
* Returns a promise.
*/
module.exports.runClean = function(options) {
var opts = parseOpts(options);
var builder = builders[opts.buildMethod];
return builder.prepEnv()
.then(function() {
return builder.clean();
}).then(function() {
shell.rm('-rf', path.join(ROOT, 'out'));
});
};
/*
* Builds the project with the specifed options
* Returns a promise.
*/
module.exports.run = function(options) {
var opts = parseOpts(options);
var builder = builders[opts.buildMethod];
return builder.prepEnv()
.then(function() {
return builder.build(opts.buildType);
}).then(function(apkFiles) {
// TODO: Rather than copy apks to out, it might be better to
// just write out what the last .apk build was. These files
// are used by get_apk().
var outputDir = path.join(ROOT, 'out');
shell.mkdir('-p', outputDir);
for (var i=0; i < apkFiles.length; ++i) {
shell.cp('-f', apkFiles[i], path.join(outputDir, path.basename(apkFiles[i])));
}
});
};
/*
* Gets the path to the apk file, if not such file exists then
* the script will error out. (should we error or just return undefined?)
* This is called by the run script to install the apk to the device
*/
module.exports.get_apk = function(build_type, architecture) {
var outputDir = path.join(ROOT, 'out');
var candidates = find_files(outputDir, function(filename) { return (!architecture) || filename.indexOf(architecture) >= 0; });
if (candidates.length === 0) {
console.error('ERROR : No .apk found in ' + outputDir + ' directory');
process.exit(2);
}
// TODO: Use build_type here.
console.log('Using apk: ' + candidates[0]);
return candidates[0];
};
module.exports.help = function() {
console.log('Usage: ' + path.relative(process.cwd(), path.join(ROOT, 'cordova', 'build')) + ' [build_type]');
console.log('Build Types : ');
console.log(' \'--debug\': Default build, will build project in debug mode');
console.log(' \'--release\': will build project for release');
console.log(' \'--ant\': Default build, will build project with ant');
console.log(' \'--gradle\': will build project with gradle');
console.log(' \'--nobuild\': will skip build process (can be used with run command)');
process.exit(0);
};
================================================
FILE: bin/templates/cordova/lib/device.js
================================================
#!/usr/bin/env node
/*
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.
*/
var exec = require('./exec'),
Q = require('q'),
path = require('path'),
build = require('./build'),
appinfo = require('./appinfo'),
ROOT = path.join(__dirname, '..', '..');
/**
* Returns a promise for the list of the device ID's found
*/
module.exports.list = function() {
return exec('adb devices')
.then(function(output) {
var response = output.split('\n');
var device_list = [];
for (var i = 1; i < response.length; i++) {
if (response[i].match(/\w+\tdevice/) && !response[i].match(/emulator/)) {
device_list.push(response[i].replace(/\tdevice/, '').replace('\r', ''));
}
}
return device_list;
});
}
/*
* Installs a previously built application on the device
* and launches it.
* Returns a promise.
*/
module.exports.install = function(target) {
var launchName;
return this.list()
.then(function(device_list) {
if (!device_list || !device_list.length)
return Q.reject('ERROR: Failed to deploy to device, no devices found.');
// default device
target = typeof target !== 'undefined' ? target : device_list[0];
if (device_list.indexOf(target) < 0)
return Q.reject('ERROR: Unable to find target \'' + target + '\'.');
var apk_path;
if (typeof process.env.DEPLOY_APK_ARCH == 'undefined') {
apk_path = build.get_apk();
} else {
apk_path = build.get_apk(null, process.env.DEPLOY_APK_ARCH);
}
launchName = appinfo.getActivityName();
console.log('Installing app on device...');
var cmd = 'adb -s ' + target + ' install -r "' + apk_path + '"';
return exec(cmd);
}).then(function(output) {
if (output.match(/Failure/)) return Q.reject('ERROR: Failed to install apk to device: ' + output);
//unlock screen
var cmd = 'adb -s ' + target + ' shell input keyevent 82';
return exec(cmd);
}, function(err) { return Q.reject('ERROR: Failed to install apk to device: ' + err); })
.then(function() {
// launch the application
console.log('Launching application...');
var cmd = 'adb -s ' + target + ' shell am start -W -a android.intent.action.MAIN -n ' + launchName;
return exec(cmd);
}).then(function() {
console.log('LAUNCH SUCCESS');
}, function(err) {
return Q.reject('ERROR: Failed to launch application on device: ' + err);
});
}
================================================
FILE: bin/templates/cordova/lib/emulator.js
================================================
#!/usr/bin/env node
/*
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.
*/
var shell = require('shelljs'),
exec = require('./exec'),
Q = require('q'),
path = require('path'),
appinfo = require('./appinfo'),
build = require('./build'),
ROOT = path.join(__dirname, '..', '..'),
child_process = require('child_process'),
new_emulator = 'cordova_emulator';
/**
* Returns a Promise for a list of emulator images in the form of objects
* {
name : <emulator_name>,
path : <path_to_emulator_image>,
target : <api_target>,
abi : <cpu>,
skin : <skin>
}
*/
module.exports.list_images = function() {
return exec('android list avds')
.then(function(output) {
var response = output.split('\n');
var emulator_list = [];
for (var i = 1; i < response.length; i++) {
// To return more detailed information use img_obj
var img_obj = {};
if (response[i].match(/Name:\s/)) {
img_obj['name'] = response[i].split('Name: ')[1].replace('\r', '');
if (response[i + 1].match(/Path:\s/)) {
i++;
img_obj['path'] = response[i].split('Path: ')[1].replace('\r', '');
}
if (response[i + 1].match(/\(API\slevel\s/)) {
i++;
img_obj['target'] = response[i].replace('\r', '');
}
if (response[i + 1].match(/ABI:\s/)) {
i++;
img_obj['abi'] = response[i].split('ABI: ')[1].replace('\r', '');
}
if (response[i + 1].match(/Skin:\s/)) {
i++;
img_obj['skin'] = response[i].split('Skin: ')[1].replace('\r', '');
}
emulator_list.push(img_obj);
}
/* To just return a list of names use this
if (response[i].match(/Name:\s/)) {
emulator_list.push(response[i].split('Name: ')[1].replace('\r', '');
}*/
}
return emulator_list;
});
}
/**
* Will return the closest avd to the projects target
* or undefined if no avds exist.
* Returns a promise.
*/
module.exports.best_image = function() {
var project_target = this.get_target().replace('android-', '');
return this.list_images()
.then(function(images) {
var closest = 9999;
var best = images[0];
for (i in images) {
var target = images[i].target;
if(target) {
var num = target.split('(API level ')[1].replace(')', '');
if (num == project_target) {
return images[i];
} else if (project_target - num < closest && project_target > num) {
var closest = project_target - num;
best = images[i];
}
}
}
return best;
});
}
// Returns a promise.
module.exports.list_started = function() {
return exec('adb devices')
.then(function(output) {
var response = output.split('\n');
var started_emulator_list = [];
for (var i = 1; i < response.length; i++) {
if (response[i].match(/device/) && response[i].match(/emulator/)) {
started_emulator_list.push(response[i].replace(/\tdevice/, '').replace('\r', ''));
}
}
return started_emulator_list;
});
}
module.exports.get_target = function() {
var target = shell.grep(/target=android-[\d+]/, path.join(ROOT, 'project.properties'));
return target.split('=')[1].replace('\n', '').replace('\r', '').replace(' ', '');
}
// Returns a promise.
module.exports.list_targets = function() {
return exec('android list targets')
.then(function(output) {
var target_out = output.split('\n');
var targets = [];
for (var i = target_out.length; i >= 0; i--) {
if(target_out[i].match(/id:/)) {
targets.push(targets[i].split(' ')[1]);
}
}
return targets;
});
}
/*
* Starts an emulator with the given ID,
* and returns the started ID of that emulator.
* If no ID is given it will used the first image available,
* if no image is available it will error out (maybe create one?).
*
* Returns a promise.
*/
module.exports.start = function(emulator_ID) {
var self = this;
var emulator_id, num_started, started_emulators;
return self.list_started()
.then(function(list) {
started_emulators = list;
num_started = started_emulators.length;
if (typeof emulator_ID === 'undefined') {
return self.list_images()
.then(function(emulator_list) {
if (emulator_list.length > 0) {
return self.best_image()
.then(function(best) {
emulator_ID = best.name;
console.log('WARNING : no emulator specified, defaulting to ' + emulator_ID);
return emulator_ID;
});
} else {
return Q.reject('ERROR : No emulator images (avds) found, if you would like to create an\n' +
' avd follow the instructions provided here:\n' +
' http://developer.android.com/tools/devices/index.html\n' +
' Or run \'android create avd --name <name> --target <targetID>\'\n' +
' in on the command line.');
}
});
} else {
return Q(emulator_ID);
}
}).then(function() {
var cmd = 'emulator';
var args = ['-avd', emulator_ID];
var proc = child_process.spawn(cmd, args, { stdio: 'inherit', detached: true });
proc.unref(); // Don't wait for it to finish, since the emulator will probably keep running for a long time.
}).then(function() {
// wait for emulator to start
console.log('Waiting for emulator...');
return self.wait_for_emulator(num_started);
}).then(function(new_started) {
if (new_started.length > 1) {
for (i in new_started) {
if (started_emulators.indexOf(new_started[i]) < 0) {
emulator_id = new_started[i];
}
}
} else {
emulator_id = new_started[0];
}
if (!emulator_id) return Q.reject('ERROR : Failed to start emulator, could not find new emulator');
//wait for emulator to boot up
process.stdout.write('Booting up emulator (this may take a while)...');
return self.wait_for_boot(emulator_id);
}).then(function() {
console.log('BOOT COMPLETE');
//unlock screen
return exec('adb -s ' + emulator_id + ' shell input keyevent 82');
}).then(function() {
//return the new emulator id for the started emulators
return emulator_id;
});
}
/*
* Waits for the new emulator to apear on the started-emulator list.
* Returns a promise with a list of newly started emulators' IDs.
*/
module.exports.wait_for_emulator = function(num_running) {
var self = this;
return self.list_started()
.then(function(new_started) {
if (new_started.length > num_running) {
return new_started;
} else {
return Q.delay(1000).then(function() {
return self.wait_for_emulator(num_running);
});
}
});
}
/*
* Waits for the boot animation property of the emulator to switch to 'stopped'
*/
module.exports.wait_for_boot = function(emulator_id) {
var self = this;
return exec('adb -s ' + emulator_id + ' shell getprop init.svc.bootanim')
.then(function(output) {
if (output.match(/stopped/)) {
return;
} else {
process.stdout.write('.');
return Q.delay(3000).then(function() {
return self.wait_for_boot(emulator_id);
});
}
});
}
/*
* Create avd
* TODO : Enter the stdin input required to complete the creation of an avd.
* Returns a promise.
*/
module.exports.create_image = function(name, target) {
console.log('Creating avd named ' + name);
if (target) {
return exec('android create avd --name ' + name + ' --target ' + target)
.then(null, function(error) {
console.error('ERROR : Failed to create emulator image : ');
console.error(' Do you have the latest android targets including ' + target + '?');
console.error(create.output);
});
} else {
console.log('WARNING : Project target not found, creating avd with a different target but the project may fail to install.');
return exec('android create avd --name ' + name + ' --target ' + this.list_targets()[0])
.then(function() {
// TODO: This seems like another error case, even though it always happens.
console.error('ERROR : Unable to create an avd emulator, no targets found.');
console.error('Please insure you have targets available by running the "android" command');
return Q.reject();
}, function(error) {
console.error('ERROR : Failed to create emulator image : ');
console.error(error);
});
}
}
/*
* Installs a previously built application on the emulator and launches it.
* If no target is specified, then it picks one.
* If no started emulators are found, error out.
* Returns a promise.
*/
module.exports.install = function(target) {
var self = this;
return this.list_started()
.then(function(emulator_list) {
if (emulator_list.length < 1) {
return Q.reject('No started emulators found, please start an emultor before deploying your project.');
}
// default emulator
target = typeof target !== 'undefined' ? target : emulator_list[0];
if (emulator_list.indexOf(target) < 0) {
return Q.reject('Unable to find target \'' + target + '\'. Failed to deploy to emulator.');
}
console.log('Installing app on emulator...');
var apk_path = build.get_apk();
return exec('adb -s ' + target + ' install -r "' + apk_path + '"');
}).then(function(output) {
if (output.match(/Failure/)) {
return Q.reject('Failed to install apk to emulator: ' + output);
}
return Q();
}, function(err) {
return Q.reject('Failed to install apk to emulator: ' + err);
}).then(function() {
//unlock screen
return exec('adb -s ' + target + ' shell input keyevent 82');
}).then(function() {
// launch the application
console.log('Launching application...');
var launchName = appinfo.getActivityName();
cmd = 'adb -s ' + target + ' shell am start -W -a android.intent.action.MAIN -n ' + launchName;
return exec(cmd);
}).then(function(output) {
console.log('LAUNCH SUCCESS');
}, function(err) {
return Q.reject('Failed to launch app on emulator: ' + err);
});
}
================================================
FILE: bin/templates/cordova/lib/exec.js
================================================
#!/usr/bin/env node
/*
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.
*/
var child_process = require('child_process'),
Q = require('q');
// Takes a command and optional current working directory.
// Returns a promise that either resolves with the stdout, or
// rejects with an error message and the stderr.
module.exports = function(cmd, opt_cwd) {
var d = Q.defer();
try {
child_process.exec(cmd, {cwd: opt_cwd, maxBuffer: 1024000}, function(err, stdout, stderr) {
if (err) d.reject('Error executing "' + cmd + '": ' + stderr);
else d.resolve(stdout);
});
} catch(e) {
console.error('error caught: ' + e);
d.reject(e);
}
return d.promise;
}
================================================
FILE: bin/templates/cordova/lib/install-device
================================================
#!/usr/bin/env node
/*
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.
*/
var device = require('./device'),
args = process.argv;
if(args.length > 2) {
var install_target;
if (args[2].substring(0, 9) == '--target=') {
install_target = args[2].substring(9, args[2].length);
device.install(install_target).done(null, function(err) {
console.error('ERROR: ' + err);
process.exit(2);
});
} else {
console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
process.exit(2);
}
} else {
device.install().done(null, function(err) {
console.error('ERROR: ' + err);
process.exit(2);
});
}
================================================
FILE: bin/templates/cordova/lib/install-device.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0install-device"
IF EXIST %script_path% (
node "%script_path%" %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'install-device' script in 'cordova\lib' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/templates/cordova/lib/install-emulator
================================================
#!/usr/bin/env node
/*
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.
*/
var emulator = require('./emulator'),
args = process.argv;
var install_target;
if(args.length > 2) {
if (args[2].substring(0, 9) == '--target=') {
install_target = args[2].substring(9, args[2].length);
} else {
console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
process.exit(2);
}
}
emulator.install(install_target).done(null, function(err) {
console.error('ERROR: ' + err);
process.exit(2);
});
================================================
FILE: bin/templates/cordova/lib/install-emulator.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0install-emulator"
IF EXIST %script_path% (
node "%script_path%" %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'install-emulator' script in 'cordova\lib' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/templates/cordova/lib/list-devices
================================================
#!/usr/bin/env node
/*
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.
*/
var devices = require('./device');
// Usage support for when args are given
devices.list().done(function(device_list) {
device_list && device_list.forEach(function(dev) {
console.log(dev);
});
}, function(err) {
console.error('ERROR: ' + err);
process.exit(2);
});
================================================
FILE: bin/templates/cordova/lib/list-devices.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0list-devices"
IF EXIST %script_path% (
node "%script_path%" %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'list-devices' script in 'cordova\lib' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/templates/cordova/lib/list-emulator-images
================================================
#!/usr/bin/env node
/*
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.
*/
var emulators = require('./emulator');
// Usage support for when args are given
emulators.list_images().done(function(emulator_list) {
emulator_list && emulator_list.forEach(function(emu) {
console.log(emu.name);
});
}, function(err) {
console.error('ERROR: ' + err);
process.exit(2);
});
================================================
FILE: bin/templates/cordova/lib/list-emulator-images.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0list-emulator-images"
IF EXIST %script_path% (
node "%script_path%" %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'list-emulator-images' script in 'cordova\lib' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/templates/cordova/lib/list-started-emulators
================================================
#!/usr/bin/env node
/*
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.
*/
var emulators = require('./emulator');
// Usage support for when args are given
emulators.list_started().done(function(emulator_list) {
emulator_list && emulator_list.forEach(function(emu) {
console.log(emu);
});
}, function(err) {
console.error('ERROR: ' + err);
process.exit(2);
});
================================================
FILE: bin/templates/cordova/lib/list-started-emulators.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0list-started-emulators"
IF EXIST %script_path% (
node "%script_path%" %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'list-started-emulators' script in 'cordova\lib' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/templates/cordova/lib/log.js
================================================
#!/usr/bin/env node
/*
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.
*/
var shell = require('shelljs'),
path = require('path'),
Q = require('q'),
child_process = require('child_process'),
ROOT = path.join(__dirname, '..', '..');
/*
* Starts running logcat in the shell.
* Returns a promise.
*/
module.exports.run = function() {
var cmd = 'adb logcat | grep -v nativeGetEnabledTags';
var d = Q.defer();
var adb = child_process.spawn('adb', ['logcat']);
adb.stdout.on('data', function(data) {
var lines = data ? data.toString().split('\n') : [];
var out = lines.filter(function(x) { return x.indexOf('nativeGetEnabledTags') < 0; });
console.log(out.join('\n'));
});
adb.stderr.on('data', console.error);
adb.on('close', function(code) {
if (code > 0) {
d.reject('Failed to run logcat command.');
} else d.resolve();
});
return d.promise;
}
module.exports.help = function() {
console.log('Usage: ' + path.relative(process.cwd(), path.join(ROOT, 'cordova', 'log')));
console.log('Gives the logcat output on the command line.');
process.exit(0);
}
================================================
FILE: bin/templates/cordova/lib/run.js
================================================
#!/usr/bin/env node
/*
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.
*/
var path = require('path'),
build = require('./build'),
emulator = require('./emulator'),
device = require('./device'),
Q = require('q');
/*
* Runs the application on a device if available.
* If not device is found, it will use a started emulator.
* If no started emulators are found it will attempt to start an avd.
* If no avds are found it will error out.
* Returns a promise.
*/
module.exports.run = function(args) {
var build_type;
var install_target;
for (var i=2; i<args.length; i++) {
if (args[i] == '--debug') {
build_type = '--debug';
} else if (args[i] == '--release') {
build_type = '--release';
} else if (args[i] == '--nobuild') {
build_type = '--nobuild';
} else if (args[i] == '--device') {
install_target = '--device';
} else if (args[i] == '--emulator') {
install_target = '--emulator';
} else if (args[i].substring(0, 9) == '--target=') {
install_target = args[i].substring(9, args[i].length);
} else {
console.error('ERROR : Run option \'' + args[i] + '\' not recognized.');
process.exit(2);
}
}
return build.run(build_type).then(function() {
if (install_target == '--device') {
return device.install();
} else if (install_target == '--emulator') {
return emulator.list_started().then(function(started) {
var p = started && started.length > 0 ? Q() : emulator.start();
return p.then(function() { emulator.install(); });
});
} else if (install_target) {
var devices, started_emulators, avds;
return device.list()
.then(function(res) {
devices = res;
return emulator.list_started();
}).then(function(res) {
started_emulators = res;
return emulator.list_images();
}).then(function(res) {
avds = res;
if (devices.indexOf(install_target) > -1) {
return device.install(install_target);
} else if (started_emulators.indexOf(install_target) > -1) {
return emulator.install(install_target);
} else {
// if target emulator isn't started, then start it.
var emulator_ID;
for(avd in avds) {
if(avds[avd].name == install_target) {
return emulator.start(install_target)
.then(function() { emulator.install(emulator_ID); });
}
}
return Q.reject('Target \'' + install_target + '\' not found, unable to run project');
}
});
} else {
// no target given, deploy to device if available, otherwise use the emulator.
return device.list()
.then(function(device_list) {
if (device_list.length > 0) {
console.log('WARNING : No target specified, deploying to device \'' + device_list[0] + '\'.');
return device.install(device_list[0]);
} else {
return emulator.list_started()
.then(function(emulator_list) {
if (emulator_list.length > 0) {
console.log('WARNING : No target specified, deploying to emulator \'' + emulator_list[0] + '\'.');
return emulator.install(emulator_list[0]);
} else {
console.log('WARNING : No started emulators found, starting an emulator.');
return emulator.best_image()
.then(function(best_avd) {
if(best_avd) {
return emulator.start(best_avd.name)
.then(function(emulator_ID) {
console.log('WARNING : No target specified, deploying to emulator \'' + emulator_ID + '\'.');
return emulator.install(emulator_ID);
});
} else {
return emulator.start();
}
});
}
});
}
});
}
});
}
module.exports.help = function(args) {
console.log('Usage: ' + path.relative(process.cwd(), args[1]) + ' [options]');
console.log('Build options :');
console.log(' --debug : Builds project in debug mode');
console.log(' --release : Builds project in release mode');
console.log(' --nobuild : Runs the currently built project without recompiling');
console.log('Deploy options :');
console.log(' --device : Will deploy the built project to a device');
console.log(' --emulator : Will deploy the built project to an emulator if one exists');
console.log(' --target=<target_id> : Installs to the target with the specified id.');
process.exit(0);
}
================================================
FILE: bin/templates/cordova/lib/spawn.js
================================================
#!/usr/bin/env node
/*
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.
*/
var child_process = require('child_process'),
Q = require('q');
var isWindows = process.platform.slice(0, 3) == 'win';
// Takes a command and optional current working directory.
module.exports = function(cmd, args, opt_cwd) {
var d = Q.defer();
try {
// Work around spawn not being able to find .bat files.
if (isWindows) {
args.unshift('/s', '/c', cmd);
cmd = 'cmd';
}
var child = child_process.spawn(cmd, args, {cwd: opt_cwd, stdio: 'inherit'});
child.on('exit', function(code) {
if (code) {
d.reject('Error code ' + code + ' for command: ' + cmd + ' with args: ' + args);
} else {
d.resolve();
}
});
} catch(e) {
console.error('error caught: ' + e);
d.reject(e);
}
return d.promise;
}
================================================
FILE: bin/templates/cordova/lib/start-emulator
================================================
#!/usr/bin/env node
/*
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.
*/
var emulator = require('./emulator'),
args = process.argv;
var install_target;
if(args.length > 2) {
if (args[2].substring(0, 9) == '--target=') {
install_target = args[2].substring(9, args[2].length);
} else {
console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
process.exit(2);
}
}
emulator.start(install_target).done(null, function(err) {
console.error('ERROR: ' + err);
process.exit(2);
});
================================================
FILE: bin/templates/cordova/lib/start-emulator.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0start-emulator"
IF EXIST %script_path% (
node "%script_path%" %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'start-emulator' script in 'cordova\lib' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/templates/cordova/log
================================================
#!/usr/bin/env node
/*
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.
*/
var log = require('./lib/log'),
reqs = require('./lib/check_reqs'),
args = process.argv;
// Usage support for when args are given
if(args.length > 2) {
log.help();
} else {
reqs.run().done(function() {
return log.run();
}, function(err) {
console.error('ERROR: ' + err);
process.exit(2);
});
}
================================================
FILE: bin/templates/cordova/log.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0log"
IF EXIST %script_path% (
node %script_path% %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'log' script in 'cordova' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/templates/cordova/run
================================================
#!/usr/bin/env node
/*
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.
*/
var run = require('./lib/run'),
reqs = require('./lib/check_reqs'),
args = process.argv;
// Support basic help commands
if (args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
args[2] == 'help' || args[2] == '-help' || args[2] == '/help') {
run.help(args);
} else {
reqs.run().done(function() {
return run.run(args);
}, function(err) {
console.error('ERROR: ' + err);
process.exit(2);
});
}
================================================
FILE: bin/templates/cordova/run.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0run"
IF EXIST %script_path% (
node %script_path% %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'run' script in 'cordova' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/templates/cordova/version
================================================
#!/usr/bin/env node
/*
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.
*/
// Coho updates this line:
var VERSION = "3.6.3";
console.log(VERSION);
================================================
FILE: bin/templates/cordova/version.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0version"
IF EXIST %script_path% (
node %script_path% %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: bin/templates/project/Activity.java
================================================
/*
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 __ID__;
import android.os.Bundle;
import org.apache.cordova.*;
public class __ACTIVITY__ extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
}
@Override
protected void onXWalkReady() {
super.init();
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}
}
================================================
FILE: bin/templates/project/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="__PACKAGE__" android:versionName="1.0" android:versionCode="1" android:hardwareAccelerated="true">
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true"
android:resizeable="true"
android:anyDensity="true"
/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:name="org.apache.cordova.CordovaApplication"
android:icon="@drawable/icon" android:label="@string/app_name"
android:hardwareAccelerated="true">
<meta-data android:name="xwalk_apk_url" android:value="__XWALKAPKURL__" />
<activity android:name="__ACTIVITY__"
android:label="@string/activity_name"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustResize"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="__APILEVEL__"/>
</manifest>
================================================
FILE: bin/templates/project/assets/www/css/index.css
================================================
/*
* 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.
*/
* {
-webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
}
body {
-webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
background-color:#E4E4E4;
background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
background-image:-webkit-gradient(
linear,
left top,
left bottom,
color-stop(0, #A7A7A7),
color-stop(0.51, #E4E4E4)
);
background-attachment:fixed;
font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
font-size:12px;
height:100%;
margin:0px;
padding:0px;
text-transform:uppercase;
width:100%;
}
/* Portrait layout (default) */
.app {
background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
position:absolute; /* position in the center of the screen */
left:50%;
top:50%;
height:50px; /* text area height */
width:225px; /* text area width */
text-align:center;
padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
/* offset horizontal: half of text area width */
}
/* Landscape layout (with min-width) */
@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
.app {
background-position:left center;
padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
/* offset horizontal: half of image width and text area width */
}
}
h1 {
font-size:24px;
font-weight:normal;
margin:0px;
overflow:visible;
padding:0px;
text-align:center;
}
.event {
border-radius:4px;
-webkit-border-radius:4px;
color:#FFFFFF;
font-size:12px;
margin:0px 30px;
padding:2px 0px;
}
.event.listening {
background-color:#333333;
display:block;
}
.event.received {
background-color:#4B946A;
display:none;
}
@keyframes fade {
from { opacity: 1.0; }
50% { opacity: 0.4; }
to { opacity: 1.0; }
}
@-webkit-keyframes fade {
from { opacity: 1.0; }
50% { opacity: 0.4; }
to { opacity: 1.0; }
}
.blink {
animation:fade 3000ms infinite;
-webkit-animation:fade 3000ms infinite;
}
================================================
FILE: bin/templates/project/assets/www/index.html
================================================
<!DOCTYPE html>
<!--
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.
-->
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Hello World</title>
</head>
<body>
<div class="app">
<h1>Apache Cordova</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();
</script>
</body>
</html>
================================================
FILE: bin/templates/project/assets/www/js/index.js
================================================
/*
* 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.
*/
var app = {
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicitly call 'app.receivedEvent(...);'
onDeviceReady: function() {
app.receivedEvent('deviceready');
},
// Update DOM on a Received Event
receivedEvent: function(id) {
var parentElement = document.getElementById(id);
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');
listeningElement.setAttribute('style', 'display:none;');
receivedElement.setAttribute('style', 'display:block;');
console.log('Received Event: ' + id);
}
};
================================================
FILE: bin/templates/project/assets/www/main.js
================================================
/*
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.
*/
var deviceInfo = function() {
document.getElementById("platform").innerHTML = device.platform;
document.getElementById("version").innerHTML = device.version;
document.getElementById("uuid").innerHTML = device.uuid;
document.getElementById("name").innerHTML = device.name;
document.getElementById("width").innerHTML = screen.width;
document.getElementById("height").innerHTML = screen.height;
document.getElementById("colorDepth").innerHTML = screen.colorDepth;
};
var getLocation = function() {
var suc = function(p) {
alert(p.coords.latitude + " " + p.coords.longitude);
};
var locFail = function() {
};
navigator.geolocation.getCurrentPosition(suc, locFail);
};
var beep = function() {
navigator.notification.beep(2);
};
var vibrate = function() {
navigator.notification.vibrate(0);
};
function roundNumber(num) {
var dec = 3;
var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec);
return result;
}
var accelerationWatch = null;
function updateAcceleration(a) {
document.getElementById('x').innerHTML = roundNumber(a.x);
document.getElementById('y').innerHTML = roundNumber(a.y);
document.getElementById('z').innerHTML = roundNumber(a.z);
}
var toggleAccel = function() {
if (accelerationWatch !== null) {
navigator.accelerometer.clearWatch(accelerationWatch);
updateAcceleration({
x : "",
y : "",
z : ""
});
accelerationWatch = null;
} else {
var options = {};
options.frequency = 1000;
accelerationWatch = navigator.accelerometer.watchAcceleration(
updateAcceleration, function(ex) {
alert("accel fail (" + ex.name + ": " + ex.message + ")");
}, options);
}
};
var preventBehavior = function(e) {
e.preventDefault();
};
function dump_pic(data) {
var viewport = document.getElementById('viewport');
console.log(data);
viewport.style.display = "";
viewport.style.position = "absolute";
viewport.style.top = "10px";
viewport.style.left = "10px";
document.getElementById("test_img").src = data;
}
function fail(msg) {
alert(msg);
}
function show_pic() {
navigator.camera.getPicture(dump_pic, fail, {
quality : 50
});
}
function close() {
var viewport = document.getElementById('viewport');
viewport.style.position = "relative";
viewport.style.display = "none";
}
function contacts_success(contacts) {
alert(contacts.length
+ ' contacts returned.'
+ (contacts[2] && contacts[2].name ? (' Third contact is ' + contacts[2].name.formatted)
: ''));
}
function get_contacts() {
var obj = new ContactFindOptions();
obj.filter = "";
obj.multiple = true;
navigator.contacts.find(
[ "displayName", "name" ], contacts_success,
fail, obj);
}
function check_network() {
var networkState = navigator.network.connection.type;
var states = {};
states[Connection.UNKNOWN] = 'Unknown connection';
states[Connection.ETHERNET] = 'Ethernet connection';
states[Connection.WIFI] = 'WiFi connection';
states[Connection.CELL_2G] = 'Cell 2G connection';
states[Connection.CELL_3G] = 'Cell 3G connection';
states[Connection.CELL_4G] = 'Cell 4G connection';
states[Connection.NONE] = 'No network connection';
confirm('Connection type:\n ' + states[networkState]);
}
var watchID = null;
function updateHeading(h) {
document.getElementById('h').innerHTML = h.magneticHeading;
}
function toggleCompass() {
if (watchID !== null) {
navigator.compass.clearWatch(watchID);
watchID = null;
updateHeading({ magneticHeading : "Off"});
} else {
var options = { frequency: 1000 };
watchID = navigator.compass.watchHeading(updateHeading, function(e) {
alert('Compass Error: ' + e.code);
}, options);
}
}
function init() {
// the next line makes it impossible to see Contacts on the HTC Evo since it
// doesn't have a scroll button
// document.addEventListener("touchmove", preventBehavior, false);
document.addEventListener("deviceready", deviceInfo, true);
}
================================================
FILE: bin/templates/project/assets/www/master.css
================================================
/*
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.
*/
body {
background:#222 none repeat scroll 0 0;
color:#666;
font-family:Helvetica;
font-size:72%;
line-height:1.5em;
margin:0;
border-top:1px solid #393939;
}
#info{
background:#ffa;
border: 1px solid #ffd324;
-webkit-border-radius: 5px;
border-radius: 5px;
clear:both;
margin:15px 6px 0;
width:295px;
padding:4px 0px 2px 10px;
}
#info > h4{
font-size:.95em;
margin:5px 0;
}
#stage.theme{
padding-top:3px;
}
/* Definition List */
#stage.theme > dl{
padding-top:10px;
clear:both;
margin:0;
list-style-type:none;
padding-left:10px;
overflow:auto;
}
#stage.theme > dl > dt{
font-weight:bold;
float:left;
margin-left:5px;
}
#stage.theme > dl > dd{
width:45px;
float:left;
color:#a87;
font-weight:bold;
}
/* Content Styling */
#stage.theme > h1, #stage.theme > h2, #stage.theme > p{
margin:1em 0 .5em 13px;
}
#stage.theme > h1{
color:#eee;
font-size:1.6em;
text-align:center;
margin:0;
margin-top:15px;
padding:0;
}
#stage.theme > h2{
clear:both;
margin:0;
padding:3px;
font-size:1em;
text-align:center;
}
/* Stage Buttons */
#stage.theme a.btn{
border: 1px solid #555;
-webkit-border-radius: 5px;
border-radius: 5px;
text-align:center;
display:block;
float:left;
background:#444;
width:150px;
color:#9ab;
font-size:1.1em;
text-decoration:none;
padding:1.2em 0;
margin:3px 0px 3px 5px;
}
#stage.theme a.btn.large{
width:308px;
padding:1.2em 0;
}
================================================
FILE: bin/templates/project/build.gradle
================================================
import java.util.regex.Pattern
apply plugin: 'android'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.10.+'
}
}
ext.multiarch=false
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
for (subproject in getProjectList()) {
compile project(subproject)
}
}
android {
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
defaultConfig {
versionCode Integer.parseInt("" + getVersionCodeFromManifest() + "0")
}
compileSdkVersion 19
buildToolsVersion "19.0.0"
if (multiarch || System.env.BUILD_MULTIPLE_APKS) {
productFlavors {
armv7 {
versionCode defaultConfig.versionCode + 2
ndk {
abiFilters "armeabi-v7a", ""
}
}
x86 {
versionCode defaultConfig.versionCode + 4
ndk {
abiFilters "x86", ""
}
}
all {
ndk {
abiFilters "all", ""
}
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.12'
}
def getVersionCodeFromManifest() {
def manifestFile = file(android.sourceSets.main.manifest.srcFile)
def pattern = Pattern.compile("versionCode=\"(\\d+)\"")
def matcher = pattern.matcher(manifestFile.getText())
matcher.find()
return Integer.parseInt(matcher.group(1))
}
def getProjectList() {
def manifestFile = file("project.properties")
def pattern = Pattern.compile("android.library.reference.(\\d+)\\s*=\\s*(.*)")
def matcher = pattern.matcher(manifestFile.getText())
def projects = []
while (matcher.find()) {
projects.add(":" + matcher.group(2).replace("/",":"))
}
return projects
}
================================================
FILE: bin/templates/project/custom_rules.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project>
<target name="-pre-compile">
<!-- Fix library references due to bug in build.xml: See: https://groups.google.com/forum/#!topic/android-developers/0ivH-YqCjzg -->
<pathconvert property="fixedJarsPath" refid="project.all.jars.path">
<filtermapper>
<replacestring from="/bin/" to="/ant-build/"/>
<replacestring from="\bin\" to="\ant-build\"/>
</filtermapper>
</pathconvert>
<path id="project.all.jars.path">
<pathelement path="${fixedJarsPath}"/>
</path>
<echo message="Set jars path to: ${toString:project.all.jars.path}"/>
</target>
<!-- Rename AndroidManifest.xml so that Eclipse's import wizard doesn't detect ant-build as a project -->
<target name="-post-build">
<move file="ant-build/AndroidManifest.xml" tofile="ant-build/AndroidManifest.cordova.xml" failonerror="false" overwrite="true" />
<move file="CordovaLib/ant-build/AndroidManifest.xml" tofile="CordovaLib/ant-build/AndroidManifest.cordova.xml" failonerror="false" overwrite="true" />
</target>
</project>
================================================
FILE: bin/templates/project/eclipse-project
================================================
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>__NAME__</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1388696068187</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-true-CordovaLib|platform_www|cordova</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
================================================
FILE: bin/templates/project/eclipse-project-CLI
================================================
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>__NAME__</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>
<name>config.xml</name>
<type>1</type>
<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/config.xml</locationURI>
</link>
<link>
<name>www</name>
<type>2</type>
<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/www</locationURI>
</link>
<link>
<name>merges</name>
<type>2</type>
<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/merges</locationURI>
</link>
</linkedResources>
<filteredResources>
<filter>
<id>1390880034107</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-projectRelativePath-matches-false-true-^(build.xml|ant-gen|ant-build|custom_rules.xml|CordovaLib|platform_www|cordova)</arguments>
</matcher>
</filter>
<filter>
<id>1390880034108</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-projectRelativePath-matches-false-true-^(assets/www|res/xml/config.xml)</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
================================================
FILE: bin/templates/project/gitignore
================================================
# Non-project-specific build files:
build.xml
local.properties
/gradlew
/gradlew.bat
/gradle
# Ant builds
ant-built
ant-gen
# Eclipse builds
gen
out
# Gradle builds
/build
================================================
FILE: bin/templates/project/project.properties
================================================
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
android.library.reference.1=CordovaLib
# Project target.
target=This_gets_replaced
================================================
FILE: bin/templates/project/res/values/strings.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- App label shown within list of installed apps, battery & network usage screens. -->
<string name="app_name">__NAME__</string>
<!-- App label shown on the launcher. -->
<string name="launcher_name">@string/app_name</string>
<!-- App label shown on the task switcher. -->
<string name="activity_name">@string/launcher_name</string>
</resources>
================================================
FILE: bin/templates/project/settings.gradle
================================================
import java.util.regex.Pattern
def getProjectList() {
def manifestFile = file("project.properties")
def pattern = Pattern.compile("android.library.reference.(\\d+)\\s*=\\s*(.*)")
def matcher = pattern.matcher(manifestFile.getText())
def projects = []
while (matcher.find()) {
projects.add(":" + matcher.group(2).replace("/",":"))
}
return projects
}
for (subproject in getProjectList()) {
include subproject
}
include ':'
================================================
FILE: bin/update
================================================
#!/usr/bin/env node
/*
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.
*/
var path = require('path');
var create = require('./lib/create');
var args = require('./lib/simpleargs').getArgs(process.argv);
if (args['--help'] || args._.length === 0) {
console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'update')) + ' <path_to_project> [--shared]');
console.log(' --shared will use the CordovaLib project directly instead of making a copy.');
console.log(' --xwalk-shared-library will use Crosswalk shared mode to package the project that without xwalk so library.');
process.exit(1);
}
if (args['--shared'] && args['--xwalk-shared-library']) {
console.log(' --xwalk-shared-library do not support --shared.');
process.exit(1);
}
create.updateProject(args._[0], args['--shared'], args['--xwalk-shared-library']).done();
================================================
FILE: bin/update.bat
================================================
:: 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.
@ECHO OFF
SET script_path="%~dp0update"
IF EXIST %script_path% (
node %script_path% %*
) ELSE (
ECHO.
ECHO ERROR: Could not find 'update' script in 'bin' folder, aborting...>&2
EXIT /B 1
)
================================================
FILE: framework/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.apache.cordova" android:versionName="1.0" android:versionCode="1">
<uses-sdk android:minSdkVersion="10" />
</manifest>
================================================
FILE: framework/ant.properties
================================================
# 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.
#
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
================================================
FILE: framework/assets/www/cordova.js
================================================
// Platform: android
// 3.6.3
/*
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.
*/
;(function() {
var CORDOVA_JS_BUILD_LABEL = '3.6.3';
// file: src/scripts/require.js
/*jshint -W079 */
/*jshint -W020 */
var require,
define;
(function () {
var modules = {},
// Stack of moduleIds currently being built.
requireStack = [],
// Map of module ID -> index into requireStack of modules currently being built.
inProgressModules = {},
SEPARATOR = ".";
function build(module) {
var factory = module.factory,
localRequire = function (id) {
var resultantId = id;
//Its a relative path, so lop off the last portion and add the id (minus "./")
if (id.charAt(0) === ".") {
resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2);
}
return require(resultantId);
};
module.exports = {};
delete module.factory;
factory(localRequire, module.exports, module);
return module.exports;
}
require = function (id) {
if (!modules[id]) {
throw "module " + id + " not found";
} else if (id in inProgressModules) {
var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
throw "Cycle in require graph: " + cycle;
}
if (modules[id].factory) {
try {
inProgressModules[id] = requireStack.length;
requireStack.push(id);
return build(modules[id]);
} finally {
delete inProgressModules[id];
requireStack.pop();
}
}
return modules[id].exports;
};
define = function (id, factory) {
if (modules[id]) {
throw "module " + id + " already defined";
}
modules[id] = {
id: id,
factory: factory
};
};
define.remove = function (id) {
delete modules[id];
};
define.moduleMap = modules;
})();
//Export for use in node
if (typeof module === "object" && typeof require === "function") {
module.exports.require = require;
module.exports.define = define;
}
// file: src/cordova.js
define("cordova", function(require, exports, module) {
var channel = require('cordova/channel');
var platform = require('cordova/platform');
/**
* Intercept calls to addEventListener + removeEventListener and handle deviceready,
* resume, and pause events.
*/
var m_document_addEventListener = document.addEventListener;
var m_document_removeEventListener = document.removeEventListener;
var m_window_addEventListener = window.addEventListener;
var m_window_removeEventListener = window.removeEventListener;
/**
* Houses custom event handlers to intercept on document + window event listeners.
*/
var documentEventHandlers = {},
windowEventHandlers = {};
document.addEventListener = function(evt, handler, capture) {
var e = evt.toLowerCase();
if (typeof documentEventHandlers[e] != 'undefined') {
documentEventHandlers[e].subscribe(handler);
} else {
m_document_addEventListener.call(document, evt, handler, capture);
}
};
window.addEventListener = function(evt, handler, capture) {
var e = evt.toLowerCase();
if (typeof windowEventHandlers[e] != 'undefined') {
windowEventHandlers[e].subscribe(handler);
} else {
m_window_addEventListener.call(window, evt, handler, capture);
}
};
document.removeEventListener = function(evt, handler, capture) {
var e = evt.toLowerCase();
// If unsubscribing from an event that is handled by a plugin
if (typeof documentEventHandlers[e] != "undefined") {
documentEventHandlers[e].unsubscribe(handler);
} else {
m_document_removeEventListener.call(document, evt, handler, capture);
}
};
window.removeEventListener = function(evt, handler, capture) {
var e = evt.toLowerCase();
// If unsubscribing from an event that is handled by a plugin
if (typeof windowEventHandlers[e] != "undefined") {
windowEventHandlers[e].unsubscribe(handler);
} else {
m_window_removeEventListener.call(window, evt, handler, capture);
}
};
function createEvent(type, data) {
var event = document.createEvent('Events');
event.initEvent(type, false, false);
if (data) {
for (var i in data) {
if (data.hasOwnProperty(i)) {
event[i] = data[i];
}
}
}
return event;
}
var cordova = {
define:define,
require:require,
version:CORDOVA_JS_BUILD_LABEL,
platformId:platform.id,
/**
* Methods to add/remove your own addEventListener hijacking on document + window.
*/
addWindowEventHandler:function(event) {
return (windowEventHandlers[event] = channel.create(event));
},
addStickyDocumentEventHandler:function(event) {
return (documentEventHandlers[event] = channel.createSticky(event));
},
addDocumentEventHandler:function(event) {
return (documentEventHandlers[event] = channel.create(event));
},
removeWindowEventHandler:function(event) {
delete windowEventHandlers[event];
},
removeDocumentEventHandler:function(event) {
delete documentEventHandlers[event];
},
/**
* Retrieve original event handlers that were replaced by Cordova
*
* @return object
*/
getOriginalHandlers: function() {
return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener},
'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}};
},
/**
* Method to fire event from native code
* bNoDetach is required for events which cause an exception which needs to be caught in native code
*/
fireDocumentEvent: function(type, data, bNoDetach) {
var evt = createEvent(type, data);
if (typeof documentEventHandlers[type] != 'undefined') {
if( bNoDetach ) {
documentEventHandlers[type].fire(evt);
}
else {
setTimeout(function() {
// Fire deviceready on listeners that were registered before cordova.js was loaded.
if (type == 'deviceready') {
document.dispatchEvent(evt);
}
documentEventHandlers[type].fire(evt);
}, 0);
}
} else {
document.dispatchEvent(evt);
}
},
fireWindowEvent: function(type, data) {
var evt = createEvent(type,data);
if (typeof windowEventHandlers[type] != 'undefined') {
setTimeout(function() {
windowEventHandlers[type].fire(evt);
}, 0);
} else {
window.dispatchEvent(evt);
}
},
/**
* Plugin callback mechanism.
*/
// Randomize the starting callbackId to avoid collisions after refreshing or navigating.
// This way, it's very unlikely that any new callback would get the same callbackId as an old callback.
callbackId: Math.floor(Math.random() * 2000000000),
callbacks: {},
callbackStatus: {
NO_RESULT: 0,
OK: 1,
CLASS_NOT_FOUND_EXCEPTION: 2,
ILLEGAL_ACCESS_EXCEPTION: 3,
INSTANTIATION_EXCEPTION: 4,
MALFORMED_URL_EXCEPTION: 5,
IO_EXCEPTION: 6,
INVALID_ACTION: 7,
JSON_EXCEPTION: 8,
ERROR: 9
},
/**
* Called by native code when returning successful result from an action.
*/
callbackSuccess: function(callbackId, args) {
try {
cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback);
} catch (e) {
console.log("Error in success callback: " + callbackId + " = "+e);
}
},
/**
* Called by native code when returning error result from an action.
*/
callbackError: function(callbackId, args) {
// TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative.
// Derive success from status.
try {
cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback);
} catch (e) {
console.log("Error in error callback: " + callbackId + " = "+e);
}
},
/**
* Called by native code when returning the result from an action.
*/
callbackFromNative: function(callbackId, success, status, args, keepCallback) {
var callback = cordova.callbacks[callbackId];
if (callback) {
if (success && status == cordova.callbackStatus.OK) {
callback.success && callback.success.apply(null, args);
} else if (!success) {
callback.fail && callback.fail.apply(null, args);
}
// Clear callback if not expecting any more results
if (!keepCallback) {
delete cordova.callbacks[callbackId];
}
}
},
addConstructor: function(func) {
channel.onCordovaReady.subscribe(function() {
try {
func();
} catch(e) {
console.log("Failed to run constructor: " + e);
}
});
}
};
module.exports = cordova;
});
// file: src/android/android/nativeapiprovider.js
define("cordova/android/nativeapiprovider", function(require, exports, module) {
/**
* Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
*/
var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
var currentApi = nativeApi;
module.exports = {
get: function() { return currentApi; },
setPreferPrompt: function(value) {
currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
},
// Used only by tests.
set: function(value) {
currentApi = value;
}
};
});
// file: src/android/android/promptbasednativeapi.js
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
/**
* Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
* This is used pre-JellyBean, where addJavascriptInterface() is disabled.
*/
module.exports = {
exec: function(bridgeSecret, service, action, callbackId, argsJson) {
return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId]));
},
setNativeToJsBridgeMode: function(bridgeSecret, value) {
prompt(value, 'gap_bridge_mode:' + bridgeSecret);
},
retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) {
return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
}
};
});
// file: src/common/argscheck.js
define("cordova/argscheck", function(require, exports, module) {
var exec = require('cordova/exec');
var utils = require('cordova/utils');
var moduleExports = module.exports;
var typeMap = {
'A': 'Array',
'D': 'Date',
'N': 'Number',
'S': 'String',
'F': 'Function',
'O': 'Object'
};
function extractParamName(callee, argIndex) {
return (/.*?\((.*?)\)/).exec(callee)[1].split(', ')[argIndex];
}
function checkArgs(spec, functionName, args, opt_callee) {
if (!moduleExports.enableChecks) {
return;
}
var errMsg = null;
var typeName;
for (var i = 0; i < spec.length; ++i) {
var c = spec.charAt(i),
cUpper = c.toUpperCase(),
arg = args[i];
// Asterix means allow anything.
if (c == '*') {
continue;
}
typeName = utils.typeName(arg);
if ((arg === null || arg === undefined) && c == cUpper) {
continue;
}
if (typeName != typeMap[cUpper]) {
errMsg = 'Expected ' + typeMap[cUpper];
break;
}
}
if (errMsg) {
errMsg += ', but got ' + typeName + '.';
errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg;
// Don't log when running unit tests.
if (typeof jasmine == 'undefined') {
console.error(errMsg);
}
throw TypeError(errMsg);
}
}
function getValue(value, defaultValue) {
return value === undefined ? defaultValue : value;
}
moduleExports.checkArgs = checkArgs;
moduleExports.getValue = getValue;
moduleExports.enableChecks = true;
});
// file: src/common/base64.js
define("cordova/base64", function(require, exports, module) {
var base64 = exports;
base64.fromArrayBuffer = function(arrayBuffer) {
var array = new Uint8Array(arrayBuffer);
return uint8ToBase64(array);
};
base64.toArrayBuffer = function(str) {
var decodedStr = typeof atob != 'undefined' ? atob(str) : new Buffer(str,'base64').toString('binary');
var arrayBuffer = new ArrayBuffer(decodedStr.length);
var array = new Uint8Array(arrayBuffer);
for (var i=0, len=decodedStr.length; i < len; i++) {
array[i] = decodedStr.charCodeAt(i);
}
return arrayBuffer;
};
//------------------------------------------------------------------------------
/* This code is based on the performance tests at http://jsperf.com/b64tests
* This 12-bit-at-a-time algorithm was the best performing version on all
* platforms tested.
*/
var b64_6bit = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var b64_12bit;
var b64_12bitTable = function() {
b64_12bit = [];
for (var i=0; i<64; i++) {
for (var j=0; j<64; j++) {
b64_12bit[i*64+j] = b64_6bit[i] + b64_6bit[j];
}
}
b64_12bitTable = function() { return b64_12bit; };
return b64_12bit;
};
function uint8ToBase64(rawData) {
var numBytes = rawDat
gitextract_tlizatdc/
├── .gitignore
├── .reviewboardrc
├── CONTRIBUTING.md
├── LICENSE
├── NOTICE
├── README.md
├── RELEASENOTES.md
├── VERSION
├── bin/
│ ├── android_sdk_version
│ ├── android_sdk_version.bat
│ ├── check_reqs
│ ├── check_reqs.bat
│ ├── create
│ ├── create.bat
│ ├── lib/
│ │ ├── android_sdk_version.js
│ │ ├── check_reqs.js
│ │ ├── create.js
│ │ └── simpleargs.js
│ ├── templates/
│ │ ├── cordova/
│ │ │ ├── build
│ │ │ ├── build.bat
│ │ │ ├── clean
│ │ │ ├── clean.bat
│ │ │ ├── defaults.xml
│ │ │ ├── lib/
│ │ │ │ ├── appinfo.js
│ │ │ │ ├── build.js
│ │ │ │ ├── device.js
│ │ │ │ ├── emulator.js
│ │ │ │ ├── exec.js
│ │ │ │ ├── install-device
│ │ │ │ ├── install-device.bat
│ │ │ │ ├── install-emulator
│ │ │ │ ├── install-emulator.bat
│ │ │ │ ├── list-devices
│ │ │ │ ├── list-devices.bat
│ │ │ │ ├── list-emulator-images
│ │ │ │ ├── list-emulator-images.bat
│ │ │ │ ├── list-started-emulators
│ │ │ │ ├── list-started-emulators.bat
│ │ │ │ ├── log.js
│ │ │ │ ├── run.js
│ │ │ │ ├── spawn.js
│ │ │ │ ├── start-emulator
│ │ │ │ └── start-emulator.bat
│ │ │ ├── log
│ │ │ ├── log.bat
│ │ │ ├── run
│ │ │ ├── run.bat
│ │ │ ├── version
│ │ │ └── version.bat
│ │ └── project/
│ │ ├── Activity.java
│ │ ├── AndroidManifest.xml
│ │ ├── assets/
│ │ │ └── www/
│ │ │ ├── css/
│ │ │ │ └── index.css
│ │ │ ├── index.html
│ │ │ ├── js/
│ │ │ │ └── index.js
│ │ │ ├── main.js
│ │ │ └── master.css
│ │ ├── build.gradle
│ │ ├── custom_rules.xml
│ │ ├── eclipse-project
│ │ ├── eclipse-project-CLI
│ │ ├── gitignore
│ │ ├── project.properties
│ │ ├── res/
│ │ │ └── values/
│ │ │ └── strings.xml
│ │ └── settings.gradle
│ ├── update
│ └── update.bat
├── framework/
│ ├── AndroidManifest.xml
│ ├── ant.properties
│ ├── assets/
│ │ └── www/
│ │ ├── cordova.js
│ │ └── index.html
│ ├── build.gradle
│ ├── build.xml
│ ├── project.properties
│ ├── res/
│ │ ├── layout/
│ │ │ └── main.xml
│ │ ├── values/
│ │ │ └── strings.xml
│ │ └── xml/
│ │ └── config.xml
│ ├── src/
│ │ ├── com/
│ │ │ └── squareup/
│ │ │ └── okhttp/
│ │ │ ├── Address.java
│ │ │ ├── Connection.java
│ │ │ ├── ConnectionPool.java
│ │ │ ├── Dispatcher.java
│ │ │ ├── Failure.java
│ │ │ ├── HttpResponseCache.java
│ │ │ ├── Job.java
│ │ │ ├── MediaType.java
│ │ │ ├── OkAuthenticator.java
│ │ │ ├── OkHttpClient.java
│ │ │ ├── OkResponseCache.java
│ │ │ ├── Request.java
│ │ │ ├── Response.java
│ │ │ ├── ResponseSource.java
│ │ │ ├── Route.java
│ │ │ ├── RouteDatabase.java
│ │ │ ├── TunnelRequest.java
│ │ │ └── internal/
│ │ │ ├── AbstractOutputStream.java
│ │ │ ├── Base64.java
│ │ │ ├── DiskLruCache.java
│ │ │ ├── Dns.java
│ │ │ ├── FaultRecoveringOutputStream.java
│ │ │ ├── NamedRunnable.java
│ │ │ ├── Platform.java
│ │ │ ├── StrictLineReader.java
│ │ │ ├── Util.java
│ │ │ ├── http/
│ │ │ │ ├── AbstractHttpInputStream.java
│ │ │ │ ├── HeaderParser.java
│ │ │ │ ├── HttpAuthenticator.java
│ │ │ │ ├── HttpDate.java
│ │ │ │ ├── HttpEngine.java
│ │ │ │ ├── HttpTransport.java
│ │ │ │ ├── HttpURLConnectionImpl.java
│ │ │ │ ├── HttpsEngine.java
│ │ │ │ ├── HttpsURLConnectionImpl.java
│ │ │ │ ├── OkResponseCacheAdapter.java
│ │ │ │ ├── Policy.java
│ │ │ │ ├── RawHeaders.java
│ │ │ │ ├── RequestHeaders.java
│ │ │ │ ├── ResponseHeaders.java
│ │ │ │ ├── RetryableOutputStream.java
│ │ │ │ ├── RouteSelector.java
│ │ │ │ ├── SpdyTransport.java
│ │ │ │ ├── Transport.java
│ │ │ │ └── UnknownLengthHttpInputStream.java
│ │ │ ├── spdy/
│ │ │ │ ├── ErrorCode.java
│ │ │ │ ├── FrameReader.java
│ │ │ │ ├── FrameWriter.java
│ │ │ │ ├── HeadersMode.java
│ │ │ │ ├── Hpack.java
│ │ │ │ ├── Http20Draft06.java
│ │ │ │ ├── IncomingStreamHandler.java
│ │ │ │ ├── NameValueBlockReader.java
│ │ │ │ ├── Ping.java
│ │ │ │ ├── Settings.java
│ │ │ │ ├── Spdy3.java
│ │ │ │ ├── SpdyConnection.java
│ │ │ │ ├── SpdyStream.java
│ │ │ │ └── Variant.java
│ │ │ └── tls/
│ │ │ ├── DistinguishedNameParser.java
│ │ │ └── OkHostnameVerifier.java
│ │ └── org/
│ │ └── apache/
│ │ └── cordova/
│ │ ├── App.java
│ │ ├── AuthenticationToken.java
│ │ ├── CallbackContext.java
│ │ ├── Config.java
│ │ ├── ConfigXmlParser.java
│ │ ├── CordovaActivity.java
│ │ ├── CordovaApplication.java
│ │ ├── CordovaArgs.java
│ │ ├── CordovaBridge.java
│ │ ├── CordovaChromeClient.java
│ │ ├── CordovaInterface.java
│ │ ├── CordovaPlugin.java
│ │ ├── CordovaPreferences.java
│ │ ├── CordovaResourceApi.java
│ │ ├── CordovaUriHelper.java
│ │ ├── CordovaWebView.java
│ │ ├── CordovaWebViewClient.java
│ │ ├── DirectoryManager.java
│ │ ├── DroidGap.java
│ │ ├── ExifHelper.java
│ │ ├── ExposedJsApi.java
│ │ ├── FileHelper.java
│ │ ├── IceCreamCordovaWebViewClient.java
│ │ ├── JSONUtils.java
│ │ ├── LOG.java
│ │ ├── LinearLayoutSoftKeyboardDetect.java
│ │ ├── NativeToJsMessageQueue.java
│ │ ├── PluginEntry.java
│ │ ├── PluginManager.java
│ │ ├── PluginResult.java
│ │ ├── ScrollEvent.java
│ │ └── Whitelist.java
│ └── test/
│ └── org/
│ └── apache/
│ └── cordova/
│ ├── PreferenceNodeTest.java
│ └── PreferenceSetTest.java
├── package.json
├── spec/
│ └── create.spec.js
└── test/
├── AndroidManifest.xml
├── README.md
├── ant.properties
├── assets/
│ └── www/
│ ├── backbuttonmultipage/
│ │ ├── index.html
│ │ ├── sample2.html
│ │ └── sample3.html
│ ├── background/
│ │ ├── index.html
│ │ └── index2.html
│ ├── backgroundcolor/
│ │ └── index.html
│ ├── basicauth/
│ │ └── index.html
│ ├── cordova_plugins.js
│ ├── fullscreen/
│ │ └── index.html
│ ├── htmlnotfound/
│ │ └── error.html
│ ├── iframe/
│ │ ├── index.html
│ │ └── index2.html
│ ├── index.html
│ ├── jqmtabbackbutton/
│ │ ├── index.html
│ │ ├── tab1.html
│ │ ├── tab2.html
│ │ └── tab3.html
│ ├── lifecycle/
│ │ ├── index.html
│ │ └── index2.html
│ ├── main.js
│ ├── master.css
│ ├── menus/
│ │ └── index.html
│ ├── splashscreen/
│ │ └── index.html
│ ├── userwebview/
│ │ └── index.html
│ ├── whitelist/
│ │ ├── index.html
│ │ └── index2.html
│ └── xhr/
│ └── index.html
├── build.xml
├── cordova/
│ ├── android_sdk_version
│ ├── build
│ ├── build.bat
│ ├── check_reqs
│ ├── clean
│ ├── clean.bat
│ ├── lib/
│ │ ├── android_sdk_version.js
│ │ ├── appinfo.js
│ │ ├── build.js
│ │ ├── check_reqs.js
│ │ ├── clean.js
│ │ ├── device.js
│ │ ├── emulator.js
│ │ ├── exec.js
│ │ ├── install-device
│ │ ├── install-device.bat
│ │ ├── install-emulator
│ │ ├── install-emulator.bat
│ │ ├── list-devices
│ │ ├── list-devices.bat
│ │ ├── list-emulator-images
│ │ ├── list-emulator-images.bat
│ │ ├── list-started-emulators
│ │ ├── list-started-emulators.bat
│ │ ├── log.js
│ │ ├── run.js
│ │ ├── start-emulator
│ │ └── start-emulator.bat
│ ├── log
│ ├── log.bat
│ ├── run
│ ├── run.bat
│ ├── version
│ └── version.bat
├── project.properties
├── res/
│ ├── layout/
│ │ └── main.xml
│ ├── values/
│ │ └── strings.xml
│ └── xml/
│ └── config.xml
└── src/
└── org/
└── apache/
└── cordova/
├── pluginApi/
│ └── pluginStub.java
└── test/
├── ActivityPlugin.java
├── CordovaDriverAction.java
├── CordovaWebViewTestActivity.java
├── MainTestActivity.java
├── SabotagedActivity.java
├── backbuttonmultipage.java
├── background.java
├── backgroundcolor.java
├── basicauth.java
├── errorurl.java
├── fullscreen.java
├── htmlnotfound.java
├── iframe.java
├── junit/
│ ├── BackButtonMultiPageTest.java
│ ├── CordovaActivityTest.java
│ ├── CordovaResourceApiTest.java
│ ├── CordovaTest.java
│ ├── ErrorUrlTest.java
│ ├── FixWebView.java
│ ├── HtmlNotFoundTest.java
│ ├── IFrameTest.java
│ ├── IntentUriOverrideTest.java
│ ├── LifecycleTest.java
│ ├── MenuTest.java
│ ├── PluginManagerTest.java
│ ├── SplashscreenTest.java
│ └── XhrTest.java
├── lifecycle.java
├── loading.java
├── menus.java
├── splashscreen.java
├── tests.java
├── timeout.java
├── userwebview.java
├── util/
│ └── Purity.java
├── whitelist.java
└── xhr.java
SYMBOL INDEX (1815 symbols across 142 files)
FILE: bin/lib/check_reqs.js
function forgivingWhichSync (line 32) | function forgivingWhichSync(cmd) {
function tryCommand (line 40) | function tryCommand(cmd, errMsg) {
FILE: bin/lib/create.js
function exec (line 32) | function exec(command, opt_cwd) {
function setShellFatal (line 44) | function setShellFatal(value, func) {
function getFrameworkDir (line 51) | function getFrameworkDir(projectPath, shared) {
function copyJsAndLibrary (line 55) | function copyJsAndLibrary(projectPath, shared, projectName, xwalkSharedL...
function extractSubProjectPaths (line 94) | function extractSubProjectPaths(data) {
function writeProjectProperties (line 104) | function writeProjectProperties(projectPath, target_api, shared) {
function copyBuildRules (line 131) | function copyBuildRules(projectPath) {
function copyScripts (line 139) | function copyScripts(projectPath) {
function validatePackageName (line 158) | function validatePackageName(package_name) {
function validateProjectName (line 178) | function validateProjectName(project_name) {
function removeDebuggableFromManifest (line 319) | function removeDebuggableFromManifest(projectPath) {
function extractProjectNameFromManifest (line 324) | function extractProjectNameFromManifest(projectPath) {
FILE: bin/templates/cordova/lib/appinfo.js
function readAppInfoFromManifest (line 26) | function readAppInfoFromManifest() {
FILE: bin/templates/cordova/lib/build.js
function find_files (line 34) | function find_files(directory, predicate) {
function hasCustomRules (line 50) | function hasCustomRules() {
function extractProjectNameFromManifest (line 54) | function extractProjectNameFromManifest(projectPath) {
function extractSubProjectPaths (line 64) | function extractSubProjectPaths() {
function writeBuildXml (line 94) | function writeBuildXml(projectPath) {
function parseOpts (line 267) | function parseOpts(options) {
FILE: bin/templates/project/Activity.java
class __ACTIVITY__ (line 25) | public class __ACTIVITY__ extends CordovaActivity
method onCreate (line 27) | @Override
method onXWalkReady (line 33) | @Override
FILE: bin/templates/project/assets/www/main.js
function roundNumber (line 47) | function roundNumber(num) {
function updateAcceleration (line 55) | function updateAcceleration(a) {
function dump_pic (line 84) | function dump_pic(data) {
function fail (line 94) | function fail(msg) {
function show_pic (line 98) | function show_pic() {
function close (line 104) | function close() {
function contacts_success (line 110) | function contacts_success(contacts) {
function get_contacts (line 117) | function get_contacts() {
function check_network (line 126) | function check_network() {
function updateHeading (line 143) | function updateHeading(h) {
function toggleCompass (line 147) | function toggleCompass() {
function init (line 160) | function init() {
FILE: framework/assets/www/cordova.js
function build (line 41) | function build(module) {
function createEvent (line 161) | function createEvent(type, data) {
function extractParamName (line 381) | function extractParamName(callee, argIndex) {
function checkArgs (line 385) | function checkArgs(spec, functionName, args, opt_callee) {
function getValue (line 419) | function getValue(value, defaultValue) {
function uint8ToBase64 (line 471) | function uint8ToBase64(rawData) {
function each (line 501) | function each(objects, func, context) {
function clobber (line 509) | function clobber(obj, key, value) {
function assignOrWrapInDeprecateGetter (line 520) | function assignOrWrapInDeprecateGetter(obj, key, value, message) {
function include (line 533) | function include(parent, objects, clobber, merge) {
function recursiveMerge (line 577) | function recursiveMerge(target, src) {
function forceFunction (line 728) | function forceFunction(f) {
function androidExec (line 898) | function androidExec(success, fail, service, action, args) {
function pollOnceFromOnlineEvent (line 944) | function pollOnceFromOnlineEvent() {
function pollOnce (line 948) | function pollOnce(opt_fromOnlineEvent) {
function pollingTimerFunc (line 958) | function pollingTimerFunc() {
function hookOnlineApis (line 965) | function hookOnlineApis() {
function processMessage (line 1016) | function processMessage(message) {
function popMessageFromQueue (line 1097) | function popMessageFromQueue() {
function logUnfiredChannels (line 1158) | function logUnfiredChannels(arr) {
function replaceNavigator (line 1176) | function replaceNavigator(origNavigator) {
function logUnfiredChannels (line 1277) | function logUnfiredChannels(arr) {
function replaceNavigator (line 1295) | function replaceNavigator(origNavigator) {
function addEntry (line 1383) | function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessa...
function prepareNamespace (line 1410) | function prepareNamespace(symbolPath, context) {
function bindButtonChannel (line 1500) | function bindButtonChannel(buttonName) {
function injectIfNecessary (line 1631) | function injectIfNecessary(id, url, onload, onerror) {
function onScriptLoadingComplete (line 1646) | function onScriptLoadingComplete(moduleList, finishPluginLoading) {
function handlePluginsObject (line 1674) | function handlePluginsObject(path, moduleList, finishPluginLoading) {
function findCordovaPath (line 1693) | function findCordovaPath() {
function UUIDcreatePart (line 1897) | function UUIDcreatePart(length) {
FILE: framework/src/com/squareup/okhttp/Address.java
class Address (line 37) | public final class Address {
method Address (line 46) | public Address(String uriHost, int uriPort, SSLSocketFactory sslSocket...
method getUriHost (line 63) | public String getUriHost() {
method getUriPort (line 71) | public int getUriPort() {
method getSslSocketFactory (line 79) | public SSLSocketFactory getSslSocketFactory() {
method getHostnameVerifier (line 87) | public HostnameVerifier getHostnameVerifier() {
method getAuthenticator (line 95) | public OkAuthenticator getAuthenticator() {
method getTransports (line 103) | public List<String> getTransports() {
method getProxy (line 111) | public Proxy getProxy() {
method equals (line 115) | @Override public boolean equals(Object other) {
method hashCode (line 129) | @Override public int hashCode() {
FILE: framework/src/com/squareup/okhttp/Connection.java
class Connection (line 68) | public final class Connection implements Closeable {
method Connection (line 90) | public Connection(Route route) {
method connect (line 94) | public void connect(int connectTimeout, int readTimeout, TunnelRequest...
method upgradeToTls (line 116) | private void upgradeToTls(TunnelRequest tunnelRequest) throws IOExcept...
method isConnected (line 166) | public boolean isConnected() {
method close (line 170) | @Override public void close() throws IOException {
method getRoute (line 175) | public Route getRoute() {
method getSocket (line 183) | public Socket getSocket() {
method isAlive (line 188) | public boolean isAlive() {
method isReadable (line 197) | public boolean isReadable() {
method resetIdleStartTime (line 225) | public void resetIdleStartTime() {
method isIdle (line 233) | public boolean isIdle() {
method isExpired (line 241) | public boolean isExpired(long keepAliveDurationNs) {
method getIdleStartTimeNs (line 249) | public long getIdleStartTimeNs() {
method newTransport (line 254) | public Object newTransport(HttpEngine httpEngine) throws IOException {
method isSpdy (line 264) | public boolean isSpdy() {
method getSpdyConnection (line 268) | public SpdyConnection getSpdyConnection() {
method getHttpMinorVersion (line 277) | public int getHttpMinorVersion() {
method setHttpMinorVersion (line 281) | public void setHttpMinorVersion(int httpMinorVersion) {
method requiresTunnel (line 290) | public boolean requiresTunnel() {
method updateReadTimeout (line 294) | public void updateReadTimeout(int newTimeout) throws IOException {
method makeTunnel (line 304) | private void makeTunnel(TunnelRequest tunnelRequest) throws IOException {
method streamWrapper (line 331) | private void streamWrapper() throws IOException {
FILE: framework/src/com/squareup/okhttp/ConnectionPool.java
class ConnectionPool (line 55) | public class ConnectionPool {
method call (line 87) | @Override public Void call() throws Exception {
method ConnectionPool (line 120) | public ConnectionPool(int maxIdleConnections, long keepAliveDurationMs) {
method getConnections (line 129) | List<Connection> getConnections() {
method waitForCleanupCallableToRun (line 140) | private void waitForCleanupCallableToRun() {
method getDefault (line 151) | public static ConnectionPool getDefault() {
method getConnectionCount (line 156) | public synchronized int getConnectionCount() {
method getSpdyConnectionCount (line 161) | public synchronized int getSpdyConnectionCount() {
method getHttpConnectionCount (line 170) | public synchronized int getHttpConnectionCount() {
method get (line 179) | public synchronized Connection get(Address address) {
method recycle (line 218) | public void recycle(Connection connection) {
method maybeShare (line 249) | public void maybeShare(Connection connection) {
method evictAll (line 263) | public void evictAll() {
FILE: framework/src/com/squareup/okhttp/Dispatcher.java
class Dispatcher (line 29) | final class Dispatcher {
method enqueue (line 35) | public synchronized void enqueue(
method cancel (line 47) | public synchronized void cancel(Object tag) {
method finished (line 55) | synchronized void finished(Job job) {
class RealResponseBody (line 60) | static class RealResponseBody extends Response.Body {
method RealResponseBody (line 64) | RealResponseBody(ResponseHeaders responseHeaders, InputStream in) {
method ready (line 69) | @Override public boolean ready() throws IOException {
method contentType (line 73) | @Override public MediaType contentType() {
method contentLength (line 78) | @Override public long contentLength() {
method byteStream (line 82) | @Override public InputStream byteStream() throws IOException {
FILE: framework/src/com/squareup/okhttp/Failure.java
class Failure (line 24) | class Failure {
method Failure (line 28) | private Failure(Builder builder) {
method request (line 33) | public Request request() {
method exception (line 37) | public Throwable exception() {
class Builder (line 41) | public static class Builder {
method request (line 45) | public Builder request(Request request) {
method exception (line 50) | public Builder exception(Throwable exception) {
method build (line 55) | public Failure build() {
FILE: framework/src/com/squareup/okhttp/HttpResponseCache.java
class HttpResponseCache (line 118) | public final class HttpResponseCache extends ResponseCache {
method get (line 141) | @Override public CacheResponse get(URI uri, String requestMethod,
method put (line 146) | @Override public CacheRequest put(URI uri, URLConnection connection) t...
method maybeRemove (line 150) | @Override public void maybeRemove(String requestMethod, URI uri) throw...
method update (line 154) | @Override public void update(
method trackConditionalCacheHit (line 159) | @Override public void trackConditionalCacheHit() {
method trackResponse (line 163) | @Override public void trackResponse(ResponseSource source) {
method HttpResponseCache (line 168) | public HttpResponseCache(File directory, long maxSize) throws IOExcept...
method uriToKey (line 172) | private String uriToKey(URI uri) {
method get (line 176) | @Override public CacheResponse get(URI uri, String requestMethod,
method put (line 201) | @Override public CacheRequest put(URI uri, URLConnection urlConnection...
method maybeRemove (line 251) | private boolean maybeRemove(String requestMethod, URI uri) {
method update (line 264) | private void update(CacheResponse conditionalCacheHit, HttpURLConnecti...
method abortQuietly (line 287) | private void abortQuietly(DiskLruCache.Editor editor) {
method getHttpEngine (line 297) | private HttpEngine getHttpEngine(URLConnection httpConnection) {
method delete (line 312) | public void delete() throws IOException {
method getWriteAbortCount (line 316) | public synchronized int getWriteAbortCount() {
method getWriteSuccessCount (line 320) | public synchronized int getWriteSuccessCount() {
method getSize (line 324) | public long getSize() {
method getMaxSize (line 328) | public long getMaxSize() {
method flush (line 332) | public void flush() throws IOException {
method close (line 336) | public void close() throws IOException {
method getDirectory (line 340) | public File getDirectory() {
method isClosed (line 344) | public boolean isClosed() {
method trackResponse (line 348) | private synchronized void trackResponse(ResponseSource source) {
method trackConditionalCacheHit (line 362) | private synchronized void trackConditionalCacheHit() {
method getNetworkCount (line 366) | public synchronized int getNetworkCount() {
method getHitCount (line 370) | public synchronized int getHitCount() {
method getRequestCount (line 374) | public synchronized int getRequestCount() {
class CacheRequestImpl (line 378) | private final class CacheRequestImpl extends CacheRequest {
method CacheRequestImpl (line 384) | public CacheRequestImpl(final DiskLruCache.Editor editor) throws IOE...
method abort (line 408) | @Override public void abort() {
method getBody (line 423) | @Override public OutputStream getBody() throws IOException {
class Entry (line 428) | private static final class Entry {
method Entry (line 486) | public Entry(InputStream in) throws IOException {
method Entry (line 522) | public Entry(URI uri, RawHeaders varyHeaders, HttpURLConnection http...
method getSslSocket (line 553) | private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
method writeTo (line 562) | public void writeTo(DiskLruCache.Editor editor) throws IOException {
method isHttps (line 588) | private boolean isHttps() {
method readCertArray (line 592) | private Certificate[] readCertArray(StrictLineReader reader) throws ...
method writeCertArray (line 611) | private void writeCertArray(Writer writer, Certificate[] certificate...
method matches (line 628) | public boolean matches(URI uri, String requestMethod,
method newBodyInputStream (line 641) | private static InputStream newBodyInputStream(final DiskLruCache.Snaps...
class EntryCacheResponse (line 650) | static class EntryCacheResponse extends CacheResponse {
method EntryCacheResponse (line 655) | public EntryCacheResponse(Entry entry, DiskLruCache.Snapshot snapsho...
method getHeaders (line 661) | @Override public Map<String, List<String>> getHeaders() {
method getBody (line 665) | @Override public InputStream getBody() {
class EntrySecureCacheResponse (line 670) | static class EntrySecureCacheResponse extends SecureCacheResponse {
method EntrySecureCacheResponse (line 675) | public EntrySecureCacheResponse(Entry entry, DiskLruCache.Snapshot s...
method getHeaders (line 681) | @Override public Map<String, List<String>> getHeaders() {
method getBody (line 685) | @Override public InputStream getBody() {
method getCipherSuite (line 689) | @Override public String getCipherSuite() {
method getServerCertificateChain (line 693) | @Override public List<Certificate> getServerCertificateChain()
method getPeerPrincipal (line 701) | @Override public Principal getPeerPrincipal() throws SSLPeerUnverifi...
method getLocalCertificateChain (line 708) | @Override public List<Certificate> getLocalCertificateChain() {
method getLocalPrincipal (line 715) | @Override public Principal getLocalPrincipal() {
FILE: framework/src/com/squareup/okhttp/Job.java
class Job (line 39) | final class Job implements Runnable, Policy {
method Job (line 47) | public Job(Dispatcher dispatcher, OkHttpClient client, Request request,
method getChunkLength (line 55) | @Override public int getChunkLength() {
method getFixedContentLength (line 59) | @Override public long getFixedContentLength() {
method getUseCaches (line 63) | @Override public boolean getUseCaches() {
method getHttpConnectionToCache (line 67) | @Override public HttpURLConnection getHttpConnectionToCache() {
method getURL (line 71) | @Override public URL getURL() {
method getIfModifiedSince (line 75) | @Override public long getIfModifiedSince() {
method usingProxy (line 79) | @Override public boolean usingProxy() {
method setSelectedProxy (line 83) | @Override public void setSelectedProxy(Proxy proxy) {
method tag (line 87) | Object tag() {
method run (line 91) | @Override public void run() {
method execute (line 107) | private Response execute() throws IOException {
method newEngine (line 158) | HttpEngine newEngine(Connection connection) throws IOException {
method processResponse (line 176) | private Request processResponse(HttpEngine engine, Response response) ...
method sameConnection (line 227) | private boolean sameConnection(Request a, Request b) {
FILE: framework/src/com/squareup/okhttp/MediaType.java
class MediaType (line 27) | public final class MediaType {
method MediaType (line 39) | private MediaType(String mediaType, String type, String subtype, Strin...
method parse (line 50) | public static MediaType parse(String string) {
method type (line 77) | public String type() {
method subtype (line 85) | public String subtype() {
method charset (line 93) | public Charset charset() {
method charset (line 101) | public Charset charset(Charset defaultValue) {
method toString (line 109) | @Override public String toString() {
method equals (line 113) | @Override public boolean equals(Object o) {
method hashCode (line 117) | @Override public int hashCode() {
FILE: framework/src/com/squareup/okhttp/OkAuthenticator.java
type OkAuthenticator (line 29) | public interface OkAuthenticator {
method authenticate (line 39) | Credential authenticate(Proxy proxy, URL url, List<Challenge> challeng...
method authenticateProxy (line 50) | Credential authenticateProxy(Proxy proxy, URL url, List<Challenge> cha...
class Challenge (line 53) | public final class Challenge {
method Challenge (line 57) | public Challenge(String scheme, String realm) {
method getScheme (line 63) | public String getScheme() {
method getRealm (line 68) | public String getRealm() {
method equals (line 72) | @Override public boolean equals(Object o) {
method hashCode (line 78) | @Override public int hashCode() {
method toString (line 82) | @Override public String toString() {
class Credential (line 88) | public final class Credential {
method Credential (line 91) | private Credential(String headerValue) {
method basic (line 96) | public static Credential basic(String userName, String password) {
method getHeaderValue (line 107) | public String getHeaderValue() {
method equals (line 111) | @Override public boolean equals(Object o) {
method hashCode (line 115) | @Override public int hashCode() {
method toString (line 119) | @Override public String toString() {
FILE: framework/src/com/squareup/okhttp/OkHttpClient.java
class OkHttpClient (line 41) | public final class OkHttpClient implements URLStreamHandlerFactory {
method OkHttpClient (line 60) | public OkHttpClient() {
method OkHttpClient (line 65) | private OkHttpClient(OkHttpClient copyFrom) {
method setConnectTimeout (line 75) | public void setConnectTimeout(long timeout, TimeUnit unit) {
method getConnectTimeout (line 90) | public int getConnectTimeout() {
method setReadTimeout (line 99) | public void setReadTimeout(long timeout, TimeUnit unit) {
method getReadTimeout (line 114) | public int getReadTimeout() {
method setProxy (line 124) | public OkHttpClient setProxy(Proxy proxy) {
method getProxy (line 129) | public Proxy getProxy() {
method setProxySelector (line 142) | public OkHttpClient setProxySelector(ProxySelector proxySelector) {
method getProxySelector (line 147) | public ProxySelector getProxySelector() {
method setCookieHandler (line 158) | public OkHttpClient setCookieHandler(CookieHandler cookieHandler) {
method getCookieHandler (line 163) | public CookieHandler getCookieHandler() {
method setResponseCache (line 173) | public OkHttpClient setResponseCache(ResponseCache responseCache) {
method getResponseCache (line 178) | public ResponseCache getResponseCache() {
method getOkResponseCache (line 182) | public OkResponseCache getOkResponseCache() {
method setSslSocketFactory (line 198) | public OkHttpClient setSslSocketFactory(SSLSocketFactory sslSocketFact...
method getSslSocketFactory (line 203) | public SSLSocketFactory getSslSocketFactory() {
method setHostnameVerifier (line 214) | public OkHttpClient setHostnameVerifier(HostnameVerifier hostnameVerif...
method getHostnameVerifier (line 219) | public HostnameVerifier getHostnameVerifier() {
method setAuthenticator (line 230) | public OkHttpClient setAuthenticator(OkAuthenticator authenticator) {
method getAuthenticator (line 235) | public OkAuthenticator getAuthenticator() {
method setConnectionPool (line 245) | public OkHttpClient setConnectionPool(ConnectionPool connectionPool) {
method getConnectionPool (line 250) | public ConnectionPool getConnectionPool() {
method setFollowProtocolRedirects (line 261) | public OkHttpClient setFollowProtocolRedirects(boolean followProtocolR...
method getFollowProtocolRedirects (line 266) | public boolean getFollowProtocolRedirects() {
method getRoutesDatabase (line 270) | public RouteDatabase getRoutesDatabase() {
method setTransports (line 301) | public OkHttpClient setTransports(List<String> transports) {
method getTransports (line 316) | public List<String> getTransports() {
method enqueue (line 323) | void enqueue(Request request, Response.Receiver responseReceiver) {
method cancel (line 334) | void cancel(Object tag) {
method open (line 338) | public HttpURLConnection open(URL url) {
method open (line 342) | HttpURLConnection open(URL url, Proxy proxy) {
method copyWithDefaults (line 356) | private OkHttpClient copyWithDefaults() {
method createURLStreamHandler (line 389) | public URLStreamHandler createURLStreamHandler(final String protocol) {
FILE: framework/src/com/squareup/okhttp/OkResponseCache.java
type OkResponseCache (line 34) | public interface OkResponseCache {
method get (line 35) | CacheResponse get(URI uri, String requestMethod, Map<String, List<Stri...
method put (line 38) | CacheRequest put(URI uri, URLConnection urlConnection) throws IOExcept...
method maybeRemove (line 41) | void maybeRemove(String requestMethod, URI uri) throws IOException;
method update (line 49) | void update(CacheResponse conditionalCacheHit, HttpURLConnection conne...
method trackConditionalCacheHit (line 52) | void trackConditionalCacheHit();
method trackResponse (line 55) | void trackResponse(ResponseSource source);
FILE: framework/src/com/squareup/okhttp/Request.java
class Request (line 38) | final class Request {
method Request (line 45) | private Request(Builder builder) {
method url (line 53) | public URL url() {
method urlString (line 57) | public String urlString() {
method method (line 61) | public String method() {
method header (line 65) | public String header(String name) {
method headers (line 69) | public List<String> headers(String name) {
method headerNames (line 73) | public Set<String> headerNames() {
method rawHeaders (line 77) | RawHeaders rawHeaders() {
method headerCount (line 81) | public int headerCount() {
method headerName (line 85) | public String headerName(int index) {
method headerValue (line 89) | public String headerValue(int index) {
method body (line 93) | public Body body() {
method tag (line 97) | public Object tag() {
method newBuilder (line 101) | Builder newBuilder() {
class Body (line 108) | public abstract static class Body {
method contentType (line 110) | public abstract MediaType contentType();
method contentLength (line 116) | public long contentLength() {
method writeTo (line 121) | public abstract void writeTo(OutputStream out) throws IOException;
method create (line 127) | public static Body create(MediaType contentType, String content) {
method create (line 140) | public static Body create(final MediaType contentType, final byte[] ...
method create (line 160) | public static Body create(final MediaType contentType, final File fi...
class Builder (line 192) | public static class Builder {
method Builder (line 199) | public Builder(String url) {
method Builder (line 203) | public Builder(URL url) {
method url (line 207) | public Builder url(String url) {
method url (line 216) | public Builder url(URL url) {
method header (line 226) | public Builder header(String name, String value) {
method addHeader (line 235) | public Builder addHeader(String name, String value) {
method rawHeaders (line 240) | Builder rawHeaders(RawHeaders rawHeaders) {
method get (line 245) | public Builder get() {
method head (line 249) | public Builder head() {
method post (line 253) | public Builder post(Body body) {
method put (line 257) | public Builder put(Body body) {
method method (line 261) | public Builder method(String method, Body body) {
method tag (line 275) | public Builder tag(Object tag) {
method build (line 280) | public Request build() {
FILE: framework/src/com/squareup/okhttp/Response.java
class Response (line 39) | final class Response {
method Response (line 46) | private Response(Builder builder) {
method request (line 66) | public Request request() {
method code (line 70) | public int code() {
method header (line 74) | public String header(String name) {
method header (line 78) | public String header(String name, String defaultValue) {
method headers (line 83) | public List<String> headers(String name) {
method headerNames (line 87) | public Set<String> headerNames() {
method headerCount (line 91) | public int headerCount() {
method headerName (line 95) | public String headerName(int index) {
method rawHeaders (line 99) | RawHeaders rawHeaders() {
method headerValue (line 103) | public String headerValue(int index) {
method body (line 107) | public Body body() {
method redirectedBy (line 117) | public Response redirectedBy() {
class Body (line 121) | public abstract static class Body {
method ready (line 137) | public abstract boolean ready() throws IOException;
method contentType (line 139) | public abstract MediaType contentType();
method contentLength (line 145) | public abstract long contentLength();
method byteStream (line 147) | public abstract InputStream byteStream() throws IOException;
method bytes (line 149) | public final byte[] bytes() throws IOException {
method charStream (line 174) | public final Reader charStream() throws IOException {
method string (line 186) | public final String string() throws IOException {
method charset (line 190) | private Charset charset() {
type Receiver (line 196) | public interface Receiver {
method onFailure (line 202) | void onFailure(Failure failure);
method onResponse (line 234) | boolean onResponse(Response response) throws IOException;
class Builder (line 237) | public static class Builder {
method Builder (line 244) | public Builder(Request request, int code) {
method header (line 255) | public Builder header(String name, String value) {
method addHeader (line 264) | public Builder addHeader(String name, String value) {
method rawHeaders (line 269) | Builder rawHeaders(RawHeaders rawHeaders) {
method body (line 274) | public Builder body(Body body) {
method redirectedBy (line 279) | public Builder redirectedBy(Response redirectedBy) {
method build (line 284) | public Response build() {
FILE: framework/src/com/squareup/okhttp/ResponseSource.java
type ResponseSource (line 19) | public enum ResponseSource {
method requiresConnection (line 34) | public boolean requiresConnection() {
FILE: framework/src/com/squareup/okhttp/Route.java
class Route (line 22) | public class Route {
method Route (line 28) | public Route(Address address, Proxy proxy, InetSocketAddress inetSocke...
method getAddress (line 40) | public Address getAddress() {
method getProxy (line 53) | public Proxy getProxy() {
method getSocketAddress (line 58) | public InetSocketAddress getSocketAddress() {
method isModernTls (line 63) | public boolean isModernTls() {
method flipTlsMode (line 68) | Route flipTlsMode() {
method equals (line 72) | @Override public boolean equals(Object obj) {
method hashCode (line 83) | @Override public int hashCode() {
FILE: framework/src/com/squareup/okhttp/RouteDatabase.java
class RouteDatabase (line 30) | public final class RouteDatabase {
method failed (line 34) | public synchronized void failed(Route failedRoute, IOException failure) {
method connected (line 45) | public synchronized void connected(Route route) {
method shouldPostpone (line 50) | public synchronized boolean shouldPostpone(Route route) {
method failedRoutesCount (line 54) | public synchronized int failedRoutesCount() {
FILE: framework/src/com/squareup/okhttp/TunnelRequest.java
class TunnelRequest (line 30) | public final class TunnelRequest {
method TunnelRequest (line 43) | public TunnelRequest(String host, int port, String userAgent, String p...
method getRequestHeaders (line 57) | RawHeaders getRequestHeaders() {
FILE: framework/src/com/squareup/okhttp/internal/AbstractOutputStream.java
class AbstractOutputStream (line 28) | public abstract class AbstractOutputStream extends OutputStream {
method write (line 31) | @Override public final void write(int data) throws IOException {
method checkNotClosed (line 35) | protected final void checkNotClosed() throws IOException {
method isClosed (line 42) | public boolean isClosed() {
FILE: framework/src/com/squareup/okhttp/internal/Base64.java
class Base64 (line 32) | public final class Base64 {
method Base64 (line 33) | private Base64() {
method decode (line 36) | public static byte[] decode(byte[] in) {
method decode (line 40) | public static byte[] decode(byte[] in, int len) {
method encode (line 134) | public static String encode(byte[] in) {
FILE: framework/src/com/squareup/okhttp/internal/DiskLruCache.java
class DiskLruCache (line 88) | public final class DiskLruCache implements Closeable {
method call (line 165) | public Void call() throws Exception {
method DiskLruCache (line 180) | private DiskLruCache(File directory, int appVersion, int valueCount, l...
method open (line 199) | public static DiskLruCache open(File directory, int appVersion, int va...
method readJournal (line 243) | private void readJournal() throws IOException {
method readJournalLine (line 275) | private void readJournalLine(String line) throws IOException {
method processJournal (line 318) | private void processJournal() throws IOException {
method rebuildJournal (line 341) | private synchronized void rebuildJournal() throws IOException {
method deleteIfExists (line 380) | private static void deleteIfExists(File file) throws IOException {
method renameTo (line 386) | private static void renameTo(File from, File to, boolean deleteDestina...
method get (line 400) | public synchronized Snapshot get(String key) throws IOException {
method edit (line 445) | public Editor edit(String key) throws IOException {
method edit (line 449) | private synchronized Editor edit(String key, long expectedSequenceNumb...
method getDirectory (line 474) | public File getDirectory() {
method getMaxSize (line 482) | public long getMaxSize() {
method setMaxSize (line 490) | public synchronized void setMaxSize(long maxSize) {
method size (line 500) | public synchronized long size() {
method completeEdit (line 504) | private synchronized void completeEdit(Editor editor, boolean success)...
method journalRebuildRequired (line 563) | private boolean journalRebuildRequired() {
method remove (line 575) | public synchronized boolean remove(String key) throws IOException {
method isClosed (line 604) | public boolean isClosed() {
method checkNotClosed (line 608) | private void checkNotClosed() {
method flush (line 615) | public synchronized void flush() throws IOException {
method close (line 622) | public synchronized void close() throws IOException {
method trimToSize (line 636) | private void trimToSize() throws IOException {
method delete (line 648) | public void delete() throws IOException {
method validateKey (line 653) | private void validateKey(String key) {
method inputStreamToString (line 660) | private static String inputStreamToString(InputStream in) throws IOExc...
class Snapshot (line 665) | public final class Snapshot implements Closeable {
method Snapshot (line 671) | private Snapshot(String key, long sequenceNumber, InputStream[] ins,...
method edit (line 683) | public Editor edit() throws IOException {
method getInputStream (line 688) | public InputStream getInputStream(int index) {
method getString (line 693) | public String getString(int index) throws IOException {
method getLength (line 698) | public long getLength(int index) {
method close (line 702) | public void close() {
method write (line 710) | @Override
class Editor (line 717) | public final class Editor {
method Editor (line 723) | private Editor(Entry entry) {
method newInputStream (line 732) | public InputStream newInputStream(int index) throws IOException {
method getString (line 752) | public String getString(int index) throws IOException {
method newOutputStream (line 764) | public OutputStream newOutputStream(int index) throws IOException {
method set (line 791) | public void set(int index, String value) throws IOException {
method commit (line 805) | public void commit() throws IOException {
method abort (line 819) | public void abort() throws IOException {
method abortUnlessCommitted (line 823) | public void abortUnlessCommitted() {
class FaultHidingOutputStream (line 832) | private class FaultHidingOutputStream extends FilterOutputStream {
method FaultHidingOutputStream (line 833) | private FaultHidingOutputStream(OutputStream out) {
method write (line 837) | @Override public void write(int oneByte) {
method write (line 845) | @Override public void write(byte[] buffer, int offset, int length) {
method close (line 853) | @Override public void close() {
method flush (line 861) | @Override public void flush() {
class Entry (line 871) | private final class Entry {
method Entry (line 886) | private Entry(String key) {
method getLengths (line 891) | public String getLengths() throws IOException {
method setLengths (line 900) | private void setLengths(String[] strings) throws IOException {
method invalidLengths (line 914) | private IOException invalidLengths(String[] strings) throws IOExcept...
method getCleanFile (line 918) | public File getCleanFile(int i) {
method getDirtyFile (line 922) | public File getDirtyFile(int i) {
FILE: framework/src/com/squareup/okhttp/internal/Dns.java
type Dns (line 25) | public interface Dns {
method getAllByName (line 27) | @Override public InetAddress[] getAllByName(String host) throws Unknow...
method getAllByName (line 32) | InetAddress[] getAllByName(String host) throws UnknownHostException;
FILE: framework/src/com/squareup/okhttp/internal/FaultRecoveringOutputStream.java
class FaultRecoveringOutputStream (line 35) | public abstract class FaultRecoveringOutputStream extends AbstractOutput...
method FaultRecoveringOutputStream (line 47) | public FaultRecoveringOutputStream(int maxReplayBufferLength, OutputSt...
method write (line 54) | @Override public final void write(byte[] buffer, int offset, int count...
method flush (line 78) | @Override public final void flush() throws IOException {
method close (line 92) | @Override public final void close() throws IOException {
method recover (line 111) | private boolean recover(IOException e) {
method isRecoverable (line 136) | public boolean isRecoverable() {
method replaceStream (line 144) | public final void replaceStream(OutputStream replacementStream) throws...
method replacementStream (line 162) | protected abstract OutputStream replacementStream(IOException e) throw...
FILE: framework/src/com/squareup/okhttp/internal/NamedRunnable.java
class NamedRunnable (line 22) | public abstract class NamedRunnable implements Runnable {
method NamedRunnable (line 25) | public NamedRunnable(String format, Object... args) {
method run (line 29) | @Override public final void run() {
method execute (line 39) | protected abstract void execute();
FILE: framework/src/com/squareup/okhttp/internal/Platform.java
class Platform (line 50) | public class Platform {
method get (line 55) | public static Platform get() {
method getPrefix (line 60) | public String getPrefix() {
method logW (line 64) | public void logW(String warning) {
method tagSocket (line 68) | public void tagSocket(Socket socket) throws SocketException {
method untagSocket (line 71) | public void untagSocket(Socket socket) throws SocketException {
method toUriLenient (line 74) | public URI toUriLenient(URL url) throws URISyntaxException {
method enableTlsExtensions (line 83) | public void enableTlsExtensions(SSLSocket socket, String uriHost) {
method supportTlsIntolerantServer (line 90) | public void supportTlsIntolerantServer(SSLSocket socket) {
method getNpnSelectedProtocol (line 95) | public byte[] getNpnSelectedProtocol(SSLSocket socket) {
method setNpnProtocols (line 103) | public void setNpnProtocols(SSLSocket socket, byte[] npnProtocols) {
method connectSocket (line 106) | public void connectSocket(Socket socket, InetSocketAddress address,
method newDeflaterOutputStream (line 116) | public OutputStream newDeflaterOutputStream(OutputStream out, Deflater...
method findPlatform (line 138) | private static Platform findPlatform() {
class Android23 (line 191) | private static class Android23 extends Platform {
method Android23 (line 196) | private Android23(
method connectSocket (line 203) | @Override public void connectSocket(Socket socket, InetSocketAddress...
method enableTlsExtensions (line 216) | @Override public void enableTlsExtensions(SSLSocket socket, String u...
class Android41 (line 233) | private static class Android41 extends Android23 {
method Android41 (line 237) | private Android41(Class<?> openSslSocketClass, Method setUseSessionT...
method setNpnProtocols (line 244) | @Override public void setNpnProtocols(SSLSocket socket, byte[] npnPr...
method getNpnSelectedProtocol (line 257) | @Override public byte[] getNpnSelectedProtocol(SSLSocket socket) {
class JdkWithJettyNpnPlatform (line 272) | private static class JdkWithJettyNpnPlatform extends Platform {
method JdkWithJettyNpnPlatform (line 278) | public JdkWithJettyNpnPlatform(Method putMethod, Method getMethod, C...
method setNpnProtocols (line 286) | @Override public void setNpnProtocols(SSLSocket socket, byte[] npnPr...
method getNpnSelectedProtocol (line 307) | @Override public byte[] getNpnSelectedProtocol(SSLSocket socket) {
class JettyNpnProvider (line 332) | private static class JettyNpnProvider implements InvocationHandler {
method JettyNpnProvider (line 337) | public JettyNpnProvider(List<String> protocols) {
method invoke (line 341) | @Override public Object invoke(Object proxy, Method method, Object[]...
FILE: framework/src/com/squareup/okhttp/internal/StrictLineReader.java
class StrictLineReader (line 45) | public class StrictLineReader implements Closeable {
method StrictLineReader (line 71) | public StrictLineReader(InputStream in, Charset charset) {
method StrictLineReader (line 86) | public StrictLineReader(InputStream in, int capacity, Charset charset) {
method close (line 108) | public void close() throws IOException {
method readLine (line 125) | public String readLine() throws IOException {
method readInt (line 185) | public int readInt() throws IOException {
method fillBuf (line 198) | private void fillBuf() throws IOException {
FILE: framework/src/com/squareup/okhttp/internal/Util.java
class Util (line 43) | public final class Util {
method Util (line 60) | private Util() {
method getEffectivePort (line 63) | public static int getEffectivePort(URI uri) {
method getEffectivePort (line 67) | public static int getEffectivePort(URL url) {
method getEffectivePort (line 71) | private static int getEffectivePort(String scheme, int specifiedPort) {
method getDefaultPort (line 75) | public static int getDefaultPort(String scheme) {
method checkOffsetAndCount (line 85) | public static void checkOffsetAndCount(int arrayLength, int offset, in...
method pokeInt (line 91) | public static void pokeInt(byte[] dst, int offset, int value, ByteOrde...
method equal (line 106) | public static boolean equal(Object a, Object b) {
method closeQuietly (line 114) | public static void closeQuietly(Closeable closeable) {
method closeQuietly (line 129) | public static void closeQuietly(Socket socket) {
method closeQuietly (line 144) | public static void closeQuietly(ServerSocket serverSocket) {
method closeAll (line 159) | public static void closeAll(Closeable a, Closeable b) throws IOExcepti...
method deleteContents (line 182) | public static void deleteContents(File dir) throws IOException {
method readSingleByte (line 202) | public static int readSingleByte(InputStream in) throws IOException {
method writeSingleByte (line 213) | public static void writeSingleByte(OutputStream out, int b) throws IOE...
method readFully (line 222) | public static void readFully(InputStream in, byte[] dst) throws IOExce...
method readFully (line 232) | public static void readFully(InputStream in, byte[] dst, int offset, i...
method readFully (line 255) | public static String readFully(Reader reader) throws IOException {
method skipAll (line 269) | public static void skipAll(InputStream in) throws IOException {
method skipByReading (line 286) | public static long skipByReading(InputStream in, long byteCount) throw...
method copy (line 318) | public static int copy(InputStream in, OutputStream out) throws IOExce...
method readAsciiLine (line 336) | public static String readAsciiLine(InputStream in) throws IOException {
method hash (line 357) | public static String hash(String s) {
method bytesToHexString (line 369) | private static String bytesToHexString(byte[] bytes) {
method immutableList (line 381) | public static <T> List<T> immutableList(List<T> list) {
method daemonThreadFactory (line 385) | public static ThreadFactory daemonThreadFactory(final String name) {
FILE: framework/src/com/squareup/okhttp/internal/http/AbstractHttpInputStream.java
class AbstractHttpInputStream (line 35) | abstract class AbstractHttpInputStream extends InputStream {
method AbstractHttpInputStream (line 42) | AbstractHttpInputStream(InputStream in, HttpEngine httpEngine, CacheRe...
method read (line 62) | @Override public final int read() throws IOException {
method checkNotClosed (line 66) | protected final void checkNotClosed() throws IOException {
method cacheWrite (line 72) | protected final void cacheWrite(byte[] buffer, int offset, int count) ...
method endOfInput (line 82) | protected final void endOfInput() throws IOException {
method unexpectedEndOfInput (line 101) | protected final void unexpectedEndOfInput() {
FILE: framework/src/com/squareup/okhttp/internal/http/HeaderParser.java
class HeaderParser (line 19) | final class HeaderParser {
type CacheControlHandler (line 21) | public interface CacheControlHandler {
method handle (line 22) | void handle(String directive, String parameter);
method parseCacheControl (line 26) | public static void parseCacheControl(String value, CacheControlHandler...
method skipUntil (line 68) | public static int skipUntil(String input, int pos, String characters) {
method skipWhitespace (line 81) | public static int skipWhitespace(String input, int pos) {
method parseSeconds (line 95) | public static int parseSeconds(String value) {
method HeaderParser (line 110) | private HeaderParser() {
FILE: framework/src/com/squareup/okhttp/internal/http/HttpAuthenticator.java
class HttpAuthenticator (line 36) | public final class HttpAuthenticator {
method authenticate (line 39) | @Override public Credential authenticate(
method authenticateProxy (line 56) | @Override public Credential authenticateProxy(
method getConnectToInetAddress (line 75) | private InetAddress getConnectToInetAddress(Proxy proxy, URL url) thro...
method HttpAuthenticator (line 82) | private HttpAuthenticator() {
method processAuthHeader (line 91) | public static boolean processAuthHeader(OkAuthenticator authenticator,...
method parseChallenges (line 124) | private static List<Challenge> parseChallenges(RawHeaders responseHead...
FILE: framework/src/com/squareup/okhttp/internal/http/HttpDate.java
class HttpDate (line 29) | final class HttpDate {
method initialValue (line 37) | @Override protected DateFormat initialValue() {
method parse (line 60) | public static Date parse(String value) {
method format (line 82) | public static String format(Date value) {
method HttpDate (line 86) | private HttpDate() {
FILE: framework/src/com/squareup/okhttp/internal/http/HttpEngine.java
class HttpEngine (line 78) | public class HttpEngine {
method getHeaders (line 80) | @Override public Map<String, List<String>> getHeaders() throws IOExcep...
method getBody (line 85) | @Override public InputStream getBody() throws IOException {
method HttpEngine (line 153) | public HttpEngine(OkHttpClient client, Policy policy, String method, R...
method getUri (line 170) | public URI getUri() {
method sendRequest (line 179) | public final void sendRequest() throws IOException {
method initResponseSource (line 217) | private void initResponseSource() throws IOException {
method sendSocketRequest (line 253) | private void sendSocketRequest() throws IOException {
method connect (line 272) | protected final void connect() throws IOException {
method connected (line 311) | protected void connected(Connection connection) {
method writingRequestHeaders (line 320) | public void writingRequestHeaders() {
method setResponse (line 331) | private void setResponse(ResponseHeaders headers, InputStream body) th...
method hasRequestBody (line 341) | boolean hasRequestBody() {
method getRequestBody (line 346) | public final OutputStream getRequestBody() {
method hasResponse (line 353) | public final boolean hasResponse() {
method getRequestHeaders (line 357) | public final RequestHeaders getRequestHeaders() {
method getResponseHeaders (line 361) | public final ResponseHeaders getResponseHeaders() {
method getResponseCode (line 368) | public final int getResponseCode() {
method getResponseBody (line 375) | public final InputStream getResponseBody() {
method getCacheResponse (line 382) | public final CacheResponse getCacheResponse() {
method getConnection (line 386) | public final Connection getConnection() {
method acceptCacheResponseType (line 395) | protected boolean acceptCacheResponseType(CacheResponse cacheResponse) {
method maybeCache (line 399) | private void maybeCache() throws IOException {
method automaticallyReleaseConnectionToPool (line 423) | public final void automaticallyReleaseConnectionToPool() {
method release (line 436) | public final void release(boolean streamCanceled) {
method initContentStream (line 456) | private void initContentStream(InputStream transferStream) throws IOEx...
method hasResponseBody (line 478) | public final boolean hasResponseBody() {
method prepareRawRequestHeaders (line 508) | private void prepareRawRequestHeaders() throws IOException {
method getRequestLine (line 550) | String getRequestLine() {
method requestString (line 556) | private String requestString() {
method requestPath (line 570) | public static String requestPath(URL url) {
method includeAuthorityInRequestLine (line 589) | protected boolean includeAuthorityInRequestLine() {
method getDefaultUserAgent (line 595) | public static String getDefaultUserAgent() {
method getOriginAddress (line 600) | public static String getOriginAddress(URL url) {
method readResponse (line 613) | public final void readResponse() throws IOException {
method getTunnelConfig (line 676) | protected TunnelRequest getTunnelConfig() {
method receiveHeaders (line 680) | public void receiveHeaders(RawHeaders headers) throws IOException {
FILE: framework/src/com/squareup/okhttp/internal/http/HttpTransport.java
class HttpTransport (line 32) | public final class HttpTransport implements Transport {
method HttpTransport (line 54) | public HttpTransport(HttpEngine httpEngine, OutputStream outputStream,...
method createRequestBody (line 61) | @Override public OutputStream createRequestBody() throws IOException {
method flushRequest (line 106) | @Override public void flushRequest() throws IOException {
method writeRequestBody (line 111) | @Override public void writeRequestBody(RetryableOutputStream requestBo...
method writeRequestHeaders (line 127) | public void writeRequestHeaders() throws IOException {
method readResponseHeaders (line 134) | @Override public ResponseHeaders readResponseHeaders() throws IOExcept...
method makeReusable (line 144) | public boolean makeReusable(boolean streamCanceled, OutputStream reque...
method discardStream (line 185) | private static boolean discardStream(HttpEngine httpEngine, InputStrea...
method getTransferStream (line 204) | @Override public InputStream getTransferStream(CacheRequest cacheReque...
class FixedLengthOutputStream (line 225) | private static final class FixedLengthOutputStream extends AbstractOut...
method FixedLengthOutputStream (line 229) | private FixedLengthOutputStream(OutputStream socketOut, long bytesRe...
method write (line 234) | @Override public void write(byte[] buffer, int offset, int count) th...
method flush (line 244) | @Override public void flush() throws IOException {
method close (line 251) | @Override public void close() throws IOException {
class ChunkedOutputStream (line 267) | private static final class ChunkedOutputStream extends AbstractOutputS...
method ChunkedOutputStream (line 281) | private ChunkedOutputStream(OutputStream socketOut, int maxChunkLeng...
method dataLength (line 292) | private int dataLength(int dataPlusHeaderLength) {
method write (line 300) | @Override public synchronized void write(byte[] buffer, int offset, ...
method writeHex (line 333) | private void writeHex(int i) throws IOException {
method flush (line 341) | @Override public synchronized void flush() throws IOException {
method close (line 349) | @Override public synchronized void close() throws IOException {
method writeBufferedChunkToSocket (line 358) | private void writeBufferedChunkToSocket() throws IOException {
class FixedLengthInputStream (line 372) | private static class FixedLengthInputStream extends AbstractHttpInputS...
method FixedLengthInputStream (line 375) | public FixedLengthInputStream(InputStream is, CacheRequest cacheRequ...
method read (line 384) | @Override public int read(byte[] buffer, int offset, int count) thro...
method available (line 403) | @Override public int available() throws IOException {
method close (line 408) | @Override public void close() throws IOException {
class ChunkedInputStream (line 420) | private static class ChunkedInputStream extends AbstractHttpInputStream {
method ChunkedInputStream (line 426) | ChunkedInputStream(InputStream is, CacheRequest cacheRequest, HttpTr...
method read (line 432) | @Override public int read(byte[] buffer, int offset, int count) thro...
method readChunkSize (line 455) | private void readChunkSize() throws IOException {
method available (line 479) | @Override public int available() throws IOException {
method close (line 487) | @Override public void close() throws IOException {
FILE: framework/src/com/squareup/okhttp/internal/http/HttpURLConnectionImpl.java
class HttpURLConnectionImpl (line 60) | public class HttpURLConnectionImpl extends HttpURLConnection implements ...
method HttpURLConnectionImpl (line 81) | public HttpURLConnectionImpl(URL url, OkHttpClient client) {
method connect (line 86) | @Override public final void connect() throws IOException {
method disconnect (line 94) | @Override public final void disconnect() {
method getErrorStream (line 113) | @Override public final InputStream getErrorStream() {
method getHeaderField (line 129) | @Override public final String getHeaderField(int position) {
method getHeaderField (line 142) | @Override public final String getHeaderField(String fieldName) {
method getHeaderFieldKey (line 151) | @Override public final String getHeaderFieldKey(int position) {
method getHeaderFields (line 159) | @Override public final Map<String, List<String>> getHeaderFields() {
method getRequestProperties (line 167) | @Override public final Map<String, List<String>> getRequestProperties() {
method getInputStream (line 175) | @Override public final InputStream getInputStream() throws IOException {
method getOutputStream (line 197) | @Override public final OutputStream getOutputStream() throws IOExcepti...
method getPermission (line 210) | @Override public final Permission getPermission() throws IOException {
method getRequestProperty (line 221) | @Override public final String getRequestProperty(String field) {
method setConnectTimeout (line 228) | @Override public void setConnectTimeout(int timeoutMillis) {
method getConnectTimeout (line 232) | @Override public int getConnectTimeout() {
method setReadTimeout (line 236) | @Override public void setReadTimeout(int timeoutMillis) {
method getReadTimeout (line 240) | @Override public int getReadTimeout() {
method initHttpEngine (line 244) | private void initHttpEngine() throws IOException {
method getHttpConnectionToCache (line 269) | @Override public HttpURLConnection getHttpConnectionToCache() {
method newHttpEngine (line 273) | private HttpEngine newHttpEngine(String method, RawHeaders requestHead...
method getResponse (line 289) | private HttpEngine getResponse() throws IOException {
method execute (line 348) | private boolean execute(boolean readResponse) throws IOException {
method handleFailure (line 370) | private boolean handleFailure(IOException e) throws IOException {
method isRecoverable (line 394) | private boolean isRecoverable(IOException e) {
method getHttpEngine (line 403) | public HttpEngine getHttpEngine() {
type Retry (line 407) | enum Retry {
method processResponseHeaders (line 418) | private Retry processResponseHeaders() throws IOException {
method getFixedContentLength (line 478) | @Override public final long getFixedContentLength() {
method getChunkLength (line 482) | @Override public final int getChunkLength() {
method usingProxy (line 486) | @Override public final boolean usingProxy() {
method isValidNonDirectProxy (line 499) | private static boolean isValidNonDirectProxy(Proxy proxy) {
method getResponseMessage (line 503) | @Override public String getResponseMessage() throws IOException {
method getResponseCode (line 507) | @Override public final int getResponseCode() throws IOException {
method setRequestProperty (line 511) | @Override public final void setRequestProperty(String field, String ne...
method addRequestProperty (line 535) | @Override public final void addRequestProperty(String field, String va...
method setTransports (line 563) | private void setTransports(String transportsString, boolean append) {
method setFixedLengthStreamingMode (line 574) | @Override public void setFixedLengthStreamingMode(int contentLength) {
method setFixedLengthStreamingMode (line 579) | public void setFixedLengthStreamingMode(long contentLength) {
method setSelectedProxy (line 587) | @Override public final void setSelectedProxy(Proxy proxy) {
FILE: framework/src/com/squareup/okhttp/internal/http/HttpsEngine.java
class HttpsEngine (line 30) | public final class HttpsEngine extends HttpEngine {
method HttpsEngine (line 38) | public HttpsEngine(OkHttpClient client, Policy policy, String method, ...
method connected (line 44) | @Override protected void connected(Connection connection) {
method acceptCacheResponseType (line 49) | @Override protected boolean acceptCacheResponseType(CacheResponse cach...
method includeAuthorityInRequestLine (line 53) | @Override protected boolean includeAuthorityInRequestLine() {
method getSslSocket (line 58) | public SSLSocket getSslSocket() {
method getTunnelConfig (line 62) | @Override protected TunnelRequest getTunnelConfig() {
FILE: framework/src/com/squareup/okhttp/internal/http/HttpsURLConnectionImpl.java
class HttpsURLConnectionImpl (line 39) | public final class HttpsURLConnectionImpl extends HttpsURLConnection {
method HttpsURLConnectionImpl (line 44) | public HttpsURLConnectionImpl(URL url, OkHttpClient client) {
method getCipherSuite (line 49) | @Override public String getCipherSuite() {
method getLocalCertificates (line 61) | @Override public Certificate[] getLocalCertificates() {
method getServerCertificates (line 74) | @Override public Certificate[] getServerCertificates() throws SSLPeerU...
method getPeerPrincipal (line 87) | @Override public Principal getPeerPrincipal() throws SSLPeerUnverified...
method getLocalPrincipal (line 99) | @Override public Principal getLocalPrincipal() {
method getHttpEngine (line 111) | public HttpEngine getHttpEngine() {
method getSslSocket (line 115) | private SSLSocket getSslSocket() {
method disconnect (line 124) | @Override public void disconnect() {
method getErrorStream (line 128) | @Override public InputStream getErrorStream() {
method getRequestMethod (line 132) | @Override public String getRequestMethod() {
method getResponseCode (line 136) | @Override public int getResponseCode() throws IOException {
method getResponseMessage (line 140) | @Override public String getResponseMessage() throws IOException {
method setRequestMethod (line 144) | @Override public void setRequestMethod(String method) throws ProtocolE...
method usingProxy (line 148) | @Override public boolean usingProxy() {
method getInstanceFollowRedirects (line 152) | @Override public boolean getInstanceFollowRedirects() {
method setInstanceFollowRedirects (line 156) | @Override public void setInstanceFollowRedirects(boolean followRedirec...
method connect (line 160) | @Override public void connect() throws IOException {
method getAllowUserInteraction (line 165) | @Override public boolean getAllowUserInteraction() {
method getContent (line 169) | @Override public Object getContent() throws IOException {
method getContent (line 173) | @SuppressWarnings("unchecked") // Spec does not generify
method getContentEncoding (line 178) | @Override public String getContentEncoding() {
method getContentLength (line 182) | @Override public int getContentLength() {
method getContentType (line 186) | @Override public String getContentType() {
method getDate (line 190) | @Override public long getDate() {
method getDefaultUseCaches (line 194) | @Override public boolean getDefaultUseCaches() {
method getDoInput (line 198) | @Override public boolean getDoInput() {
method getDoOutput (line 202) | @Override public boolean getDoOutput() {
method getExpiration (line 206) | @Override public long getExpiration() {
method getHeaderField (line 210) | @Override public String getHeaderField(int pos) {
method getHeaderFields (line 214) | @Override public Map<String, List<String>> getHeaderFields() {
method getRequestProperties (line 218) | @Override public Map<String, List<String>> getRequestProperties() {
method addRequestProperty (line 222) | @Override public void addRequestProperty(String field, String newValue) {
method getHeaderField (line 226) | @Override public String getHeaderField(String key) {
method getHeaderFieldDate (line 230) | @Override public long getHeaderFieldDate(String field, long defaultVal...
method getHeaderFieldInt (line 234) | @Override public int getHeaderFieldInt(String field, int defaultValue) {
method getHeaderFieldKey (line 238) | @Override public String getHeaderFieldKey(int position) {
method getIfModifiedSince (line 242) | @Override public long getIfModifiedSince() {
method getInputStream (line 246) | @Override public InputStream getInputStream() throws IOException {
method getLastModified (line 250) | @Override public long getLastModified() {
method getOutputStream (line 254) | @Override public OutputStream getOutputStream() throws IOException {
method getPermission (line 258) | @Override public Permission getPermission() throws IOException {
method getRequestProperty (line 262) | @Override public String getRequestProperty(String field) {
method getURL (line 266) | @Override public URL getURL() {
method getUseCaches (line 270) | @Override public boolean getUseCaches() {
method setAllowUserInteraction (line 274) | @Override public void setAllowUserInteraction(boolean newValue) {
method setDefaultUseCaches (line 278) | @Override public void setDefaultUseCaches(boolean newValue) {
method setDoInput (line 282) | @Override public void setDoInput(boolean newValue) {
method setDoOutput (line 286) | @Override public void setDoOutput(boolean newValue) {
method setIfModifiedSince (line 290) | @Override public void setIfModifiedSince(long newValue) {
method setRequestProperty (line 294) | @Override public void setRequestProperty(String field, String newValue) {
method setUseCaches (line 298) | @Override public void setUseCaches(boolean newValue) {
method setConnectTimeout (line 302) | @Override public void setConnectTimeout(int timeoutMillis) {
method getConnectTimeout (line 306) | @Override public int getConnectTimeout() {
method setReadTimeout (line 310) | @Override public void setReadTimeout(int timeoutMillis) {
method getReadTimeout (line 314) | @Override public int getReadTimeout() {
method toString (line 318) | @Override public String toString() {
method setFixedLengthStreamingMode (line 322) | @Override public void setFixedLengthStreamingMode(int contentLength) {
method setChunkedStreamingMode (line 326) | @Override public void setChunkedStreamingMode(int chunkLength) {
method setHostnameVerifier (line 330) | @Override public void setHostnameVerifier(HostnameVerifier hostnameVer...
method getHostnameVerifier (line 334) | @Override public HostnameVerifier getHostnameVerifier() {
method setSSLSocketFactory (line 338) | @Override public void setSSLSocketFactory(SSLSocketFactory sslSocketFa...
method getSSLSocketFactory (line 342) | @Override public SSLSocketFactory getSSLSocketFactory() {
method setFixedLengthStreamingMode (line 346) | @SuppressLint("NewApi")
class HttpUrlConnectionDelegate (line 351) | private final class HttpUrlConnectionDelegate extends HttpURLConnectio...
method HttpUrlConnectionDelegate (line 352) | private HttpUrlConnectionDelegate(URL url, OkHttpClient client) {
method getHttpConnectionToCache (line 356) | @Override public HttpURLConnection getHttpConnectionToCache() {
method getSecureCacheResponse (line 360) | public SecureCacheResponse getSecureCacheResponse() {
FILE: framework/src/com/squareup/okhttp/internal/http/OkResponseCacheAdapter.java
class OkResponseCacheAdapter (line 30) | public final class OkResponseCacheAdapter implements OkResponseCache {
method OkResponseCacheAdapter (line 32) | public OkResponseCacheAdapter(ResponseCache responseCache) {
method get (line 36) | @Override public CacheResponse get(URI uri, String requestMethod,
method put (line 41) | @Override public CacheRequest put(URI uri, URLConnection urlConnection...
method maybeRemove (line 45) | @Override public void maybeRemove(String requestMethod, URI uri) throw...
method update (line 48) | @Override public void update(CacheResponse conditionalCacheHit, HttpUR...
method trackConditionalCacheHit (line 52) | @Override public void trackConditionalCacheHit() {
method trackResponse (line 55) | @Override public void trackResponse(ResponseSource source) {
FILE: framework/src/com/squareup/okhttp/internal/http/Policy.java
type Policy (line 22) | public interface Policy {
method getUseCaches (line 24) | boolean getUseCaches();
method getHttpConnectionToCache (line 27) | HttpURLConnection getHttpConnectionToCache();
method getURL (line 30) | URL getURL();
method getIfModifiedSince (line 33) | long getIfModifiedSince();
method usingProxy (line 36) | boolean usingProxy();
method getChunkLength (line 39) | int getChunkLength();
method getFixedContentLength (line 42) | long getFixedContentLength();
method setSelectedProxy (line 48) | void setSelectedProxy(Proxy proxy);
FILE: framework/src/com/squareup/okhttp/internal/http/RawHeaders.java
class RawHeaders (line 53) | public final class RawHeaders {
method compare (line 56) | @Override public int compare(String a, String b) {
method RawHeaders (line 76) | public RawHeaders() {
method RawHeaders (line 79) | public RawHeaders(RawHeaders copyFrom) {
method setRequestLine (line 89) | public void setRequestLine(String requestLine) {
method setStatusLine (line 95) | public void setStatusLine(String statusLine) throws IOException {
method addSpdyRequestHeaders (line 133) | public void addSpdyRequestHeaders(String method, String path, String v...
method getStatusLine (line 143) | public String getStatusLine() {
method getHttpMinorVersion (line 151) | public int getHttpMinorVersion() {
method getResponseCode (line 156) | public int getResponseCode() {
method getResponseMessage (line 161) | public String getResponseMessage() {
method addLine (line 170) | public void addLine(String line) {
method add (line 182) | public void add(String fieldName, String value) {
method addLenient (line 195) | private void addLenient(String fieldName, String value) {
method removeAll (line 200) | public void removeAll(String fieldName) {
method addAll (line 209) | public void addAll(String fieldName, List<String> headerFields) {
method set (line 219) | public void set(String fieldName, String value) {
method length (line 225) | public int length() {
method getFieldName (line 230) | public String getFieldName(int index) {
method names (line 239) | public Set<String> names() {
method getValue (line 248) | public String getValue(int index) {
method get (line 257) | public String get(String fieldName) {
method values (line 267) | public List<String> values(String name) {
method getAll (line 281) | public RawHeaders getAll(Set<String> fieldNames) {
method toBytes (line 293) | public byte[] toBytes() throws UnsupportedEncodingException {
method fromBytes (line 307) | public static RawHeaders fromBytes(InputStream in) throws IOException {
method readHeaders (line 318) | public static void readHeaders(InputStream in, RawHeaders out) throws ...
method toMultimap (line 330) | public Map<String, List<String>> toMultimap(boolean response) {
method fromMultimap (line 357) | public static RawHeaders fromMultimap(Map<String, List<String>> map, b...
method toNameValueBlock (line 380) | public List<String> toNameValueBlock() {
method fromNameValueBlock (line 415) | public static RawHeaders fromNameValueBlock(List<String> nameValueBloc...
FILE: framework/src/com/squareup/okhttp/internal/http/RequestHeaders.java
class RequestHeaders (line 25) | public final class RequestHeaders {
method RequestHeaders (line 62) | public RequestHeaders(URI uri, RawHeaders headers) {
method isChunked (line 120) | public boolean isChunked() {
method hasConnectionClose (line 124) | public boolean hasConnectionClose() {
method getUri (line 128) | public URI getUri() {
method getHeaders (line 132) | public RawHeaders getHeaders() {
method isNoCache (line 136) | public boolean isNoCache() {
method getMaxAgeSeconds (line 140) | public int getMaxAgeSeconds() {
method getMaxStaleSeconds (line 144) | public int getMaxStaleSeconds() {
method getMinFreshSeconds (line 148) | public int getMinFreshSeconds() {
method isOnlyIfCached (line 152) | public boolean isOnlyIfCached() {
method hasAuthorization (line 156) | public boolean hasAuthorization() {
method getContentLength (line 160) | public long getContentLength() {
method getTransferEncoding (line 164) | public String getTransferEncoding() {
method getUserAgent (line 168) | public String getUserAgent() {
method getHost (line 172) | public String getHost() {
method getConnection (line 176) | public String getConnection() {
method getAcceptEncoding (line 180) | public String getAcceptEncoding() {
method getContentType (line 184) | public String getContentType() {
method getIfModifiedSince (line 188) | public String getIfModifiedSince() {
method getIfNoneMatch (line 192) | public String getIfNoneMatch() {
method getProxyAuthorization (line 196) | public String getProxyAuthorization() {
method setChunked (line 200) | public void setChunked() {
method setContentLength (line 208) | public void setContentLength(long contentLength) {
method removeContentLength (line 221) | public void removeContentLength() {
method setUserAgent (line 228) | public void setUserAgent(String userAgent) {
method setHost (line 236) | public void setHost(String host) {
method setConnection (line 244) | public void setConnection(String connection) {
method setAcceptEncoding (line 252) | public void setAcceptEncoding(String acceptEncoding) {
method setContentType (line 260) | public void setContentType(String contentType) {
method setIfModifiedSince (line 268) | public void setIfModifiedSince(Date date) {
method setIfNoneMatch (line 277) | public void setIfNoneMatch(String ifNoneMatch) {
method hasConditions (line 290) | public boolean hasConditions() {
method addCookies (line 294) | public void addCookies(Map<String, List<String>> allCookieHeaders) {
method buildCookieHeader (line 308) | private String buildCookieHeader(List<String> cookies) {
FILE: framework/src/com/squareup/okhttp/internal/http/ResponseHeaders.java
class ResponseHeaders (line 35) | public final class ResponseHeaders {
method ResponseHeaders (line 121) | public ResponseHeaders(URI uri, RawHeaders headers) {
method isContentEncodingGzip (line 191) | public boolean isContentEncodingGzip() {
method stripContentEncoding (line 195) | public void stripContentEncoding() {
method stripContentLength (line 200) | public void stripContentLength() {
method isChunked (line 205) | public boolean isChunked() {
method hasConnectionClose (line 209) | public boolean hasConnectionClose() {
method getUri (line 213) | public URI getUri() {
method getHeaders (line 217) | public RawHeaders getHeaders() {
method getServedDate (line 221) | public Date getServedDate() {
method getLastModified (line 225) | public Date getLastModified() {
method getExpires (line 229) | public Date getExpires() {
method isNoCache (line 233) | public boolean isNoCache() {
method isNoStore (line 237) | public boolean isNoStore() {
method getMaxAgeSeconds (line 241) | public int getMaxAgeSeconds() {
method getSMaxAgeSeconds (line 245) | public int getSMaxAgeSeconds() {
method isPublic (line 249) | public boolean isPublic() {
method isMustRevalidate (line 253) | public boolean isMustRevalidate() {
method getEtag (line 257) | public String getEtag() {
method getVaryFields (line 261) | public Set<String> getVaryFields() {
method getContentEncoding (line 265) | public String getContentEncoding() {
method getContentLength (line 269) | public long getContentLength() {
method getContentType (line 273) | public String getContentType() {
method getConnection (line 277) | public String getConnection() {
method setLocalTimestamps (line 281) | public void setLocalTimestamps(long sentRequestMillis, long receivedRe...
method setResponseSource (line 288) | public void setResponseSource(ResponseSource responseSource) {
method setTransport (line 292) | public void setTransport(String transport) {
method computeAge (line 300) | private long computeAge(long nowMillis) {
method computeFreshnessLifetime (line 315) | private long computeFreshnessLifetime() {
method isFreshnessLifetimeHeuristic (line 339) | private boolean isFreshnessLifetimeHeuristic() {
method isCacheable (line 347) | public boolean isCacheable(RequestHeaders request) {
method hasVaryAll (line 376) | public boolean hasVaryAll() {
method varyMatches (line 384) | public boolean varyMatches(Map<String, List<String>> cachedRequest,
method chooseResponseSource (line 395) | public ResponseSource chooseResponseSource(long nowMillis, RequestHead...
method validate (line 452) | public boolean validate(ResponseHeaders networkResponse) {
method combine (line 473) | public ResponseHeaders combine(ResponseHeaders network) throws IOExcep...
method isEndToEnd (line 502) | private static boolean isEndToEnd(String fieldName) {
FILE: framework/src/com/squareup/okhttp/internal/http/RetryableOutputStream.java
class RetryableOutputStream (line 32) | final class RetryableOutputStream extends AbstractOutputStream {
method RetryableOutputStream (line 36) | public RetryableOutputStream(int limit) {
method RetryableOutputStream (line 41) | public RetryableOutputStream() {
method close (line 46) | @Override public synchronized void close() throws IOException {
method write (line 57) | @Override public synchronized void write(byte[] buffer, int offset, in...
method contentLength (line 67) | public synchronized int contentLength() throws IOException {
method writeToSocket (line 72) | public void writeToSocket(OutputStream socketOut) throws IOException {
FILE: framework/src/com/squareup/okhttp/internal/http/RouteSelector.java
class RouteSelector (line 44) | public final class RouteSelector {
method RouteSelector (line 79) | public RouteSelector(Address address, URI uri, ProxySelector proxySele...
method hasNext (line 96) | public boolean hasNext() {
method next (line 105) | public Connection next(String method) throws IOException {
method connectFailed (line 144) | public void connectFailed(Connection connection, IOException failure) {
method resetNextProxy (line 155) | private void resetNextProxy(URI uri, Proxy proxy) {
method hasNextProxy (line 168) | private boolean hasNextProxy() {
method nextProxy (line 173) | private Proxy nextProxy() {
method resetNextInetSocketAddress (line 197) | private void resetNextInetSocketAddress(Proxy proxy) throws UnknownHos...
method hasNextInetSocketAddress (line 221) | private boolean hasNextInetSocketAddress() {
method nextInetSocketAddress (line 226) | private InetSocketAddress nextInetSocketAddress() throws UnknownHostEx...
method resetNextTlsMode (line 238) | private void resetNextTlsMode() {
method hasNextTlsMode (line 243) | private boolean hasNextTlsMode() {
method nextTlsMode (line 248) | private int nextTlsMode() {
method hasNextPostponed (line 261) | private boolean hasNextPostponed() {
method nextPostponed (line 266) | private Route nextPostponed() {
FILE: framework/src/com/squareup/okhttp/internal/http/SpdyTransport.java
class SpdyTransport (line 29) | public final class SpdyTransport implements Transport {
method SpdyTransport (line 34) | public SpdyTransport(HttpEngine httpEngine, SpdyConnection spdyConnect...
method createRequestBody (line 39) | @Override public OutputStream createRequestBody() throws IOException {
method writeRequestHeaders (line 49) | @Override public void writeRequestHeaders() throws IOException {
method writeRequestBody (line 66) | @Override public void writeRequestBody(RetryableOutputStream requestBo...
method flushRequest (line 70) | @Override public void flushRequest() throws IOException {
method readResponseHeaders (line 74) | @Override public ResponseHeaders readResponseHeaders() throws IOExcept...
method getTransferStream (line 84) | @Override public InputStream getTransferStream(CacheRequest cacheReque...
method makeReusable (line 88) | @Override public boolean makeReusable(boolean streamCanceled, OutputSt...
FILE: framework/src/com/squareup/okhttp/internal/http/Transport.java
type Transport (line 24) | interface Transport {
method createRequestBody (line 41) | OutputStream createRequestBody() throws IOException;
method writeRequestHeaders (line 44) | void writeRequestHeaders() throws IOException;
method writeRequestBody (line 50) | void writeRequestBody(RetryableOutputStream requestBody) throws IOExce...
method flushRequest (line 53) | void flushRequest() throws IOException;
method readResponseHeaders (line 56) | ResponseHeaders readResponseHeaders() throws IOException;
method getTransferStream (line 59) | InputStream getTransferStream(CacheRequest cacheRequest) throws IOExce...
method makeReusable (line 62) | boolean makeReusable(boolean streamCanceled, OutputStream requestBodyOut,
FILE: framework/src/com/squareup/okhttp/internal/http/UnknownLengthHttpInputStream.java
class UnknownLengthHttpInputStream (line 25) | final class UnknownLengthHttpInputStream extends AbstractHttpInputStream {
method UnknownLengthHttpInputStream (line 28) | UnknownLengthHttpInputStream(InputStream in, CacheRequest cacheRequest...
method read (line 33) | @Override public int read(byte[] buffer, int offset, int count) throws...
method available (line 49) | @Override public int available() throws IOException {
method close (line 54) | @Override public void close() throws IOException {
FILE: framework/src/com/squareup/okhttp/internal/spdy/ErrorCode.java
type ErrorCode (line 19) | public enum ErrorCode {
method ErrorCode (line 57) | private ErrorCode(int httpCode, int spdyRstCode, int spdyGoAwayCode) {
method fromSpdy3Rst (line 63) | public static ErrorCode fromSpdy3Rst(int code) {
method fromHttp2 (line 70) | public static ErrorCode fromHttp2(int code) {
method fromSpdyGoAway (line 77) | public static ErrorCode fromSpdyGoAway(int code) {
FILE: framework/src/com/squareup/okhttp/internal/spdy/FrameReader.java
type FrameReader (line 25) | public interface FrameReader extends Closeable {
method readConnectionHeader (line 26) | void readConnectionHeader() throws IOException;
method nextFrame (line 27) | boolean nextFrame(Handler handler) throws IOException;
type Handler (line 29) | public interface Handler {
method data (line 30) | void data(boolean inFinished, int streamId, InputStream in, int leng...
method headers (line 45) | void headers(boolean outFinished, boolean inFinished, int streamId, ...
method rstStream (line 47) | void rstStream(int streamId, ErrorCode errorCode);
method settings (line 48) | void settings(boolean clearPrevious, Settings settings);
method noop (line 49) | void noop();
method ping (line 50) | void ping(boolean reply, int payload1, int payload2);
method goAway (line 51) | void goAway(int lastGoodStreamId, ErrorCode errorCode);
method windowUpdate (line 52) | void windowUpdate(int streamId, int deltaWindowSize, boolean endFlow...
method priority (line 53) | void priority(int streamId, int priority);
FILE: framework/src/com/squareup/okhttp/internal/spdy/FrameWriter.java
type FrameWriter (line 24) | public interface FrameWriter extends Closeable {
method connectionHeader (line 26) | void connectionHeader() throws IOException;
method flush (line 29) | void flush() throws IOException;
method synStream (line 30) | void synStream(boolean outFinished, boolean inFinished, int streamId, ...
method synReply (line 32) | void synReply(boolean outFinished, int streamId, List<String> nameValu...
method headers (line 33) | void headers(int streamId, List<String> nameValueBlock) throws IOExcep...
method rstStream (line 34) | void rstStream(int streamId, ErrorCode errorCode) throws IOException;
method data (line 35) | void data(boolean outFinished, int streamId, byte[] data) throws IOExc...
method data (line 36) | void data(boolean outFinished, int streamId, byte[] data, int offset, ...
method settings (line 38) | void settings(Settings settings) throws IOException;
method noop (line 39) | void noop() throws IOException;
method ping (line 40) | void ping(boolean reply, int payload1, int payload2) throws IOException;
method goAway (line 41) | void goAway(int lastGoodStreamId, ErrorCode errorCode) throws IOExcept...
method windowUpdate (line 42) | void windowUpdate(int streamId, int deltaWindowSize) throws IOException;
FILE: framework/src/com/squareup/okhttp/internal/spdy/HeadersMode.java
type HeadersMode (line 18) | enum HeadersMode {
method failIfStreamAbsent (line 25) | public boolean failIfStreamAbsent() {
method failIfStreamPresent (line 30) | public boolean failIfStreamPresent() {
method failIfHeadersAbsent (line 38) | public boolean failIfHeadersAbsent() {
method failIfHeadersPresent (line 46) | public boolean failIfHeadersPresent() {
FILE: framework/src/com/squareup/okhttp/internal/spdy/Hpack.java
class Hpack (line 31) | final class Hpack {
class HeaderEntry (line 33) | static class HeaderEntry {
method HeaderEntry (line 37) | HeaderEntry(String name, String value) {
method length (line 43) | int length() {
method Hpack (line 123) | private Hpack() {
class Reader (line 126) | static class Reader {
method Reader (line 136) | Reader(DataInputStream in, boolean client) {
method readHeaders (line 151) | public void readHeaders(int byteCount) throws IOException {
method emitReferenceSet (line 182) | public void emitReferenceSet() {
method getAndReset (line 193) | public List<String> getAndReset() {
method readIndexedHeader (line 199) | private void readIndexedHeader(int index) {
method readLiteralHeaderWithoutIndexingIndexedName (line 207) | private void readLiteralHeaderWithoutIndexingIndexedName(int index)
method readLiteralHeaderWithoutIndexingNewName (line 215) | private void readLiteralHeaderWithoutIndexingNewName()
method readLiteralHeaderWithIncrementalIndexingIndexedName (line 223) | private void readLiteralHeaderWithIncrementalIndexingIndexedName(int...
method readLiteralHeaderWithIncrementalIndexingNewName (line 231) | private void readLiteralHeaderWithIncrementalIndexingNewName() throw...
method readLiteralHeaderWithSubstitutionIndexingIndexedName (line 238) | private void readLiteralHeaderWithSubstitutionIndexingIndexedName(in...
method readLiteralHeaderWithSubstitutionIndexingNewName (line 246) | private void readLiteralHeaderWithSubstitutionIndexingNewName() thro...
method getName (line 253) | private String getName(int index) {
method getValue (line 257) | private String getValue(int index) {
method insertIntoHeaderTable (line 261) | private void insertIntoHeaderTable(int index, HeaderEntry entry) {
method remove (line 296) | private void remove(int index) {
method readByte (line 300) | private int readByte() throws IOException {
method readInt (line 305) | int readInt(int firstByte, int prefixMask) throws IOException {
method readString (line 331) | public String readString() throws IOException {
class Writer (line 341) | static class Writer {
method Writer (line 344) | Writer(OutputStream out) {
method writeHeaders (line 348) | public void writeHeaders(List<String> nameValueBlock) throws IOExcep...
method writeInt (line 357) | public void writeInt(int value, int prefixMask, int bits) throws IOE...
method writeString (line 381) | public void writeString(String headerName) throws IOException {
FILE: framework/src/com/squareup/okhttp/internal/spdy/Http20Draft06.java
class Http20Draft06 (line 33) | final class Http20Draft06 implements Variant {
method newReader (line 61) | @Override public FrameReader newReader(InputStream in, boolean client) {
method newWriter (line 65) | @Override public FrameWriter newWriter(OutputStream out, boolean clien...
class Reader (line 69) | static final class Reader implements FrameReader {
method Reader (line 74) | Reader(InputStream in, boolean client) {
method readConnectionHeader (line 80) | @Override public void readConnectionHeader() throws IOException {
method nextFrame (line 90) | @Override public boolean nextFrame(Handler handler) throws IOExcepti...
method readHeaders (line 146) | private void readHeaders(Handler handler, int flags, int length, int...
method readData (line 185) | private void readData(Handler handler, int flags, int length, int st...
method readPriority (line 190) | private void readPriority(Handler handler, int flags, int length, in...
method readRstStream (line 200) | private void readRstStream(Handler handler, int flags, int length, i...
method readSettings (line 212) | private void readSettings(Handler handler, int flags, int length, in...
method readPushPromise (line 227) | private void readPushPromise(Handler handler, int flags, int length,...
method readPing (line 231) | private void readPing(Handler handler, int flags, int length, int st...
method readGoAway (line 240) | private void readGoAway(Handler handler, int flags, int length, int ...
method readWindowUpdate (line 256) | private void readWindowUpdate(Handler handler, int flags, int length...
method ioException (line 265) | private static IOException ioException(String message, Object... arg...
method close (line 269) | @Override public void close() throws IOException {
class Writer (line 274) | static final class Writer implements FrameWriter {
method Writer (line 280) | Writer(OutputStream out, boolean client) {
method flush (line 287) | @Override public synchronized void flush() throws IOException {
method connectionHeader (line 291) | @Override public synchronized void connectionHeader() throws IOExcep...
method synStream (line 296) | @Override public synchronized void synStream(boolean outFinished, bo...
method synReply (line 303) | @Override public synchronized void synReply(boolean outFinished, int...
method headers (line 308) | @Override public synchronized void headers(int streamId, List<String...
method headers (line 313) | private void headers(boolean outFinished, int streamId, int priority,
method rstStream (line 329) | @Override public synchronized void rstStream(int streamId, ErrorCode...
method data (line 334) | @Override public void data(boolean outFinished, int streamId, byte[]...
method data (line 338) | @Override public synchronized void data(boolean outFinished, int str...
method settings (line 348) | @Override public synchronized void settings(Settings settings) throw...
method noop (line 362) | @Override public synchronized void noop() throws IOException {
method ping (line 366) | @Override public synchronized void ping(boolean reply, int payload1,...
method goAway (line 371) | @Override public synchronized void goAway(int lastGoodStreamId, Erro...
method windowUpdate (line 376) | @Override public synchronized void windowUpdate(int streamId, int de...
method close (line 381) | @Override public void close() throws IOException {
FILE: framework/src/com/squareup/okhttp/internal/spdy/IncomingStreamHandler.java
type IncomingStreamHandler (line 22) | public interface IncomingStreamHandler {
method receive (line 24) | @Override public void receive(SpdyStream stream) throws IOException {
method receive (line 35) | void receive(SpdyStream stream) throws IOException;
FILE: framework/src/com/squareup/okhttp/internal/spdy/NameValueBlockReader.java
class NameValueBlockReader (line 36) | class NameValueBlockReader implements Closeable {
method NameValueBlockReader (line 41) | NameValueBlockReader(final InputStream in) {
class FillableInflaterInputStream (line 80) | static class FillableInflaterInputStream extends InflaterInputStream {
method FillableInflaterInputStream (line 81) | public FillableInflaterInputStream(InputStream in, Inflater inf) {
method fill (line 85) | @Override public void fill() throws IOException {
method readNameValueBlock (line 90) | public List<String> readNameValueBlock(int length) throws IOException {
method doneReading (line 117) | private void doneReading() throws IOException {
method readString (line 129) | private String readString() throws DataFormatException, IOException {
method close (line 136) | @Override public void close() throws IOException {
FILE: framework/src/com/squareup/okhttp/internal/spdy/Ping.java
class Ping (line 24) | public final class Ping {
method Ping (line 29) | Ping() {
method send (line 32) | void send() {
method receive (line 37) | void receive() {
method cancel (line 43) | void cancel() {
method roundTripTime (line 54) | public long roundTripTime() throws InterruptedException {
method roundTripTime (line 64) | public long roundTripTime(long timeout, TimeUnit unit) throws Interrup...
FILE: framework/src/com/squareup/okhttp/internal/spdy/Settings.java
class Settings (line 18) | final class Settings {
method set (line 70) | void set(int id, int idFlags, int value) {
method isSet (line 92) | boolean isSet(int id) {
method get (line 98) | int get(int id) {
method flags (line 103) | int flags(int id) {
method size (line 111) | int size() {
method getUploadBandwidth (line 115) | int getUploadBandwidth(int defaultValue) {
method getDownloadBandwidth (line 120) | int getDownloadBandwidth(int defaultValue) {
method getRoundTripTime (line 125) | int getRoundTripTime(int defaultValue) {
method getMaxConcurrentStreams (line 130) | int getMaxConcurrentStreams(int defaultValue) {
method getCurrentCwnd (line 135) | int getCurrentCwnd(int defaultValue) {
method getDownloadRetransRate (line 140) | int getDownloadRetransRate(int defaultValue) {
method getInitialWindowSize (line 145) | int getInitialWindowSize(int defaultValue) {
method getClientCertificateVectorSize (line 150) | int getClientCertificateVectorSize(int defaultValue) {
method isFlowControlDisabled (line 156) | boolean isFlowControlDisabled() {
method persistValue (line 166) | boolean persistValue(int id) {
method isPersisted (line 172) | boolean isPersisted(int id) {
method merge (line 181) | void merge(Settings other) {
FILE: framework/src/com/squareup/okhttp/internal/spdy/Spdy3.java
class Spdy3 (line 31) | final class Spdy3 implements Variant {
method newReader (line 90) | @Override public FrameReader newReader(InputStream in, boolean client) {
method newWriter (line 94) | @Override public FrameWriter newWriter(OutputStream out, boolean clien...
class Reader (line 99) | static final class Reader implements FrameReader {
method Reader (line 104) | Reader(InputStream in, boolean client) {
method readConnectionHeader (line 110) | @Override public void readConnectionHeader() {
method nextFrame (line 117) | @Override public boolean nextFrame(Handler handler) throws IOExcepti...
method readSynStream (line 191) | private void readSynStream(Handler handler, int flags, int length) t...
method readSynReply (line 207) | private void readSynReply(Handler handler, int flags, int length) th...
method readRstStream (line 215) | private void readRstStream(Handler handler, int flags, int length) t...
method readHeaders (line 226) | private void readHeaders(Handler handler, int flags, int length) thr...
method readWindowUpdate (line 233) | private void readWindowUpdate(Handler handler, int flags, int length...
method readPing (line 242) | private void readPing(Handler handler, int flags, int length) throws...
method readGoAway (line 249) | private void readGoAway(Handler handler, int flags, int length) thro...
method readSettings (line 260) | private void readSettings(Handler handler, int flags, int length) th...
method ioException (line 277) | private static IOException ioException(String message, Object... arg...
method close (line 281) | @Override public void close() throws IOException {
class Writer (line 287) | static final class Writer implements FrameWriter {
method Writer (line 293) | Writer(OutputStream out, boolean client) {
method connectionHeader (line 304) | @Override public synchronized void connectionHeader() {
method flush (line 308) | @Override public synchronized void flush() throws IOException {
method synStream (line 312) | @Override public synchronized void synStream(boolean outFinished, bo...
method synReply (line 330) | @Override public synchronized void synReply(
method headers (line 344) | @Override public synchronized void headers(int streamId, List<String...
method rstStream (line 358) | @Override public synchronized void rstStream(int streamId, ErrorCode...
method data (line 371) | @Override public synchronized void data(boolean outFinished, int str...
method data (line 376) | @Override public synchronized void data(boolean outFinished, int str...
method writeNameValueBlockToBuffer (line 384) | private void writeNameValueBlockToBuffer(List<String> nameValueBlock...
method settings (line 395) | @Override public synchronized void settings(Settings settings) throw...
method noop (line 412) | @Override public synchronized void noop() throws IOException {
method ping (line 421) | @Override public synchronized void ping(boolean reply, int payload1,...
method goAway (line 434) | @Override public synchronized void goAway(int lastGoodStreamId, Erro...
method windowUpdate (line 447) | @Override public synchronized void windowUpdate(int streamId, int de...
method close (line 459) | @Override public void close() throws IOException {
FILE: framework/src/com/squareup/okhttp/internal/spdy/SpdyConnection.java
class SpdyConnection (line 44) | public final class SpdyConnection implements Closeable {
method SpdyConnection (line 90) | private SpdyConnection(Builder builder) {
method openStreamCount (line 108) | public synchronized int openStreamCount() {
method getStream (line 112) | private synchronized SpdyStream getStream(int id) {
method removeStream (line 116) | synchronized SpdyStream removeStream(int streamId) {
method setIdle (line 124) | private synchronized void setIdle(boolean value) {
method isIdle (line 129) | public synchronized boolean isIdle() {
method getIdleStartTimeNs (line 137) | public synchronized long getIdleStartTimeNs() {
method newStream (line 149) | public SpdyStream newStream(List<String> requestHeaders, boolean out, ...
method writeSynReply (line 181) | void writeSynReply(int streamId, boolean outFinished, List<String> alt...
method writeData (line 186) | public void writeData(int streamId, boolean outFinished, byte[] buffer...
method writeSynResetLater (line 191) | void writeSynResetLater(final int streamId, final ErrorCode errorCode) {
method writeSynReset (line 202) | void writeSynReset(int streamId, ErrorCode statusCode) throws IOExcept...
method writeWindowUpdateLater (line 206) | void writeWindowUpdateLater(final int streamId, final int deltaWindowS...
method writeWindowUpdate (line 217) | void writeWindowUpdate(int streamId, int deltaWindowSize) throws IOExc...
method ping (line 225) | public Ping ping() throws IOException {
method writePingLater (line 241) | private void writePingLater(
method writePing (line 254) | private void writePing(boolean reply, int payload1, int payload2, Ping...
method removePing (line 262) | private synchronized Ping removePing(int id) {
method noop (line 267) | public void noop() throws IOException {
method flush (line 271) | public void flush() throws IOException {
method shutdown (line 281) | public void shutdown(ErrorCode statusCode) throws IOException {
method close (line 300) | @Override public void close() throws IOException {
method close (line 304) | private void close(ErrorCode connectionCode, ErrorCode streamCode) thr...
method sendConnectionHeader (line 361) | public void sendConnectionHeader() throws IOException {
method readConnectionHeader (line 370) | public void readConnectionHeader() throws IOException {
class Builder (line 374) | public static class Builder {
method Builder (line 382) | public Builder(boolean client, Socket socket) throws IOException {
method Builder (line 386) | public Builder(boolean client, InputStream in, OutputStream out) {
method Builder (line 394) | public Builder(String hostName, boolean client, Socket socket) throw...
method Builder (line 402) | public Builder(String hostName, boolean client, InputStream in, Outp...
method handler (line 409) | public Builder handler(IncomingStreamHandler handler) {
method spdy3 (line 414) | public Builder spdy3() {
method http20Draft06 (line 419) | public Builder http20Draft06() {
method build (line 424) | public SpdyConnection build() {
class Reader (line 429) | private class Reader implements Runnable, FrameReader.Handler {
method run (line 430) | @Override public void run() {
method data (line 449) | @Override public void data(boolean inFinished, int streamId, InputSt...
method headers (line 463) | @Override public void headers(boolean outFinished, boolean inFinishe...
method rstStream (line 516) | @Override public void rstStream(int streamId, ErrorCode errorCode) {
method settings (line 523) | @Override public void settings(boolean clearPrevious, Settings newSe...
method noop (line 550) | @Override public void noop() {
method ping (line 553) | @Override public void ping(boolean reply, int payload1, int payload2) {
method goAway (line 565) | @Override public void goAway(int lastGoodStreamId, ErrorCode errorCo...
method windowUpdate (line 582) | @Override public void windowUpdate(int streamId, int deltaWindowSize...
method priority (line 595) | @Override public void priority(int streamId, int priority) {
FILE: framework/src/com/squareup/okhttp/internal/spdy/SpdyStream.java
class SpdyStream (line 31) | public final class SpdyStream {
method SpdyStream (line 66) | SpdyStream(int id, SpdyConnection connection, boolean outFinished, boo...
method isOpen (line 90) | public synchronized boolean isOpen() {
method isLocallyInitiated (line 101) | public boolean isLocallyInitiated() {
method getConnection (line 106) | public SpdyConnection getConnection() {
method getRequestHeaders (line 110) | public List<String> getRequestHeaders() {
method getResponseHeaders (line 118) | public synchronized List<String> getResponseHeaders() throws IOExcepti...
method getErrorCode (line 152) | public synchronized ErrorCode getErrorCode() {
method reply (line 162) | public void reply(List<String> responseHeaders, boolean out) throws IO...
method setReadTimeout (line 188) | public void setReadTimeout(long readTimeoutMillis) {
method getReadTimeoutMillis (line 192) | public long getReadTimeoutMillis() {
method getInputStream (line 197) | public InputStream getInputStream() {
method getOutputStream (line 207) | public OutputStream getOutputStream() {
method close (line 220) | public void close(ErrorCode rstStatusCode) throws IOException {
method closeLater (line 231) | public void closeLater(ErrorCode errorCode) {
method closeInternal (line 239) | private boolean closeInternal(ErrorCode errorCode) {
method receiveHeaders (line 255) | void receiveHeaders(List<String> headers, HeadersMode headersMode) {
method receiveData (line 286) | void receiveData(InputStream in, int length) throws IOException {
method receiveFin (line 291) | void receiveFin() {
method receiveRstStream (line 304) | synchronized void receiveRstStream(ErrorCode errorCode) {
method setSettings (line 311) | private void setSettings(Settings settings) {
method receiveSettings (line 320) | void receiveSettings(Settings settings) {
method receiveWindowUpdate (line 326) | synchronized void receiveWindowUpdate(int deltaWindowSize) {
method getPriority (line 331) | int getPriority() {
class SpdyDataInputStream (line 340) | private final class SpdyDataInputStream extends InputStream {
method available (line 377) | @Override public int available() throws IOException {
method read (line 390) | @Override public int read() throws IOException {
method read (line 394) | @Override public int read(byte[] b, int offset, int count) throws IO...
method waitUntilReadable (line 446) | private void waitUntilReadable() throws IOException {
method receive (line 469) | void receive(InputStream in, int byteCount) throws IOException {
method close (line 529) | @Override public void close() throws IOException {
method checkNotClosed (line 537) | private void checkNotClosed() throws IOException {
method cancelStreamIfNecessary (line 547) | private void cancelStreamIfNecessary() throws IOException {
class SpdyDataOutputStream (line 570) | private final class SpdyDataOutputStream extends OutputStream {
method write (line 590) | @Override public void write(int b) throws IOException {
method write (line 594) | @Override public void write(byte[] bytes, int offset, int count) thr...
method flush (line 611) | @Override public void flush() throws IOException {
method close (line 620) | @Override public void close() throws IOException {
method writeFrame (line 635) | private void writeFrame(boolean outFinished) throws IOException {
method waitUntilWritable (line 653) | private void waitUntilWritable(int count, boolean last) throws IOExc...
method checkNotClosed (line 672) | private void checkNotClosed() throws IOException {
FILE: framework/src/com/squareup/okhttp/internal/spdy/Variant.java
type Variant (line 22) | interface Variant {
method newReader (line 30) | FrameReader newReader(InputStream in, boolean client);
method newWriter (line 36) | FrameWriter newWriter(OutputStream out, boolean client);
FILE: framework/src/com/squareup/okhttp/internal/tls/DistinguishedNameParser.java
class DistinguishedNameParser (line 26) | final class DistinguishedNameParser {
method DistinguishedNameParser (line 39) | public DistinguishedNameParser(X500Principal principal) {
method nextAT (line 48) | private String nextAT() {
method quotedAV (line 104) | private String quotedAV() {
method hexAV (line 137) | private String hexAV() {
method escapedAV (line 187) | private String escapedAV() {
method getEscaped (line 232) | private char getEscaped() {
method getUTF8 (line 263) | private char getUTF8() {
method getByte (line 311) | private int getByte(int position) {
method findMostSpecific (line 349) | public String findMostSpecific(String attributeType) {
FILE: framework/src/com/squareup/okhttp/internal/tls/OkHostnameVerifier.java
class OkHostnameVerifier (line 38) | public final class OkHostnameVerifier implements HostnameVerifier {
method OkHostnameVerifier (line 58) | private OkHostnameVerifier() {
method verify (line 61) | public boolean verify(String host, SSLSession session) {
method verify (line 70) | public boolean verify(String host, X509Certificate certificate) {
method verifyAsIpAddress (line 76) | static boolean verifyAsIpAddress(String host) {
method verifyIpAddress (line 83) | private boolean verifyIpAddress(String ipAddress, X509Certificate cert...
method verifyHostName (line 95) | private boolean verifyHostName(String hostName, X509Certificate certif...
method getSubjectAltNames (line 117) | private List<String> getSubjectAltNames(X509Certificate certificate, i...
method verifyHostName (line 153) | public boolean verifyHostName(String hostName, String cn) {
FILE: framework/src/org/apache/cordova/App.java
class App (line 42) | public class App extends CordovaPlugin {
method pluginInitialize (line 51) | @Override
method execute (line 64) | public boolean execute(String action, JSONArray args, CallbackContext ...
method clearCache (line 118) | public void clearCache() {
method loadUrl (line 133) | public void loadUrl(String url, JSONObject props) throws JSONException {
method clearHistory (line 189) | public void clearHistory() {
method backHistory (line 201) | public void backHistory() {
method overrideBackbutton (line 215) | public void overrideBackbutton(boolean override) {
method overrideButton (line 227) | public void overrideButton(String button, boolean override) {
method isBackbuttonOverridden (line 242) | public boolean isBackbuttonOverridden() {
method exitApp (line 249) | public void exitApp() {
method initTelephonyReceiver (line 259) | private void initTelephonyReceiver() {
method onDestroy (line 297) | public void onDestroy()
FILE: framework/src/org/apache/cordova/AuthenticationToken.java
class AuthenticationToken (line 24) | public class AuthenticationToken {
method getUserName (line 33) | public String getUserName() {
method setUserName (line 43) | public void setUserName(String userName) {
method getPassword (line 52) | public String getPassword() {
method setPassword (line 62) | public void setPassword(String password) {
FILE: framework/src/org/apache/cordova/CallbackContext.java
class CallbackContext (line 29) | public class CallbackContext {
method CallbackContext (line 37) | public CallbackContext(String callbackId, CordovaWebView webView) {
method isFinished (line 42) | public boolean isFinished() {
method isChangingThreads (line 46) | public boolean isChangingThreads() {
method getCallbackId (line 50) | public String getCallbackId() {
method sendPluginResult (line 54) | public void sendPluginResult(PluginResult pluginResult) {
method success (line 71) | public void success(JSONObject message) {
method success (line 80) | public void success(String message) {
method success (line 89) | public void success(JSONArray message) {
method success (line 98) | public void success(byte[] message) {
method success (line 107) | public void success(int message) {
method success (line 114) | public void success() {
method error (line 123) | public void error(JSONObject message) {
method error (line 132) | public void error(String message) {
method error (line 141) | public void error(int message) {
FILE: framework/src/org/apache/cordova/Config.java
class Config (line 27) | @Deprecated // Use Whitelist, CordovaPrefences, etc. directly.
method Config (line 33) | private Config() {
method init (line 36) | public static void init(Activity action) {
method init (line 44) | public static void init() {
method addWhiteListEntry (line 56) | public static void addWhiteListEntry(String origin, boolean subdomains) {
method isUrlWhiteListed (line 70) | public static boolean isUrlWhiteListed(String url) {
method isUrlExternallyWhiteListed (line 84) | public static boolean isUrlExternallyWhiteListed(String url) {
method getStartUrl (line 92) | public static String getStartUrl() {
method getErrorUrl (line 99) | public static String getErrorUrl() {
method getWhitelist (line 103) | public static Whitelist getWhitelist() {
method getExternalWhitelist (line 107) | public static Whitelist getExternalWhitelist() {
method getPluginEntries (line 111) | public static List<PluginEntry> getPluginEntries() {
method getPreferences (line 115) | public static CordovaPreferences getPreferences() {
method isInitialized (line 119) | public static boolean isInitialized() {
FILE: framework/src/org/apache/cordova/ConfigXmlParser.java
class ConfigXmlParser (line 35) | public class ConfigXmlParser {
method getInternalWhitelist (line 44) | public Whitelist getInternalWhitelist() {
method getExternalWhitelist (line 48) | public Whitelist getExternalWhitelist() {
method getPreferences (line 52) | public CordovaPreferences getPreferences() {
method getPluginEntries (line 56) | public ArrayList<PluginEntry> getPluginEntries() {
method getLaunchUrl (line 60) | public String getLaunchUrl() {
method parse (line 64) | public void parse(Activity action) {
method parse (line 78) | public void parse(XmlResourceParser xml) {
method setStartUrl (line 169) | private void setStartUrl(String src) {
FILE: framework/src/org/apache/cordova/CordovaActivity.java
class CordovaActivity (line 100) | public abstract class CordovaActivity extends XWalkActivity implements C...
method setAuthenticationToken (line 157) | public void setAuthenticationToken(AuthenticationToken authenticationT...
method removeAuthenticationToken (line 171) | public AuthenticationToken removeAuthenticationToken(String host, Stri...
method getAuthenticationToken (line 192) | public AuthenticationToken getAuthenticationToken(String host, String ...
method clearAuthenticationTokens (line 202) | public void clearAuthenticationTokens() {
method onCreate (line 211) | @Override
method loadConfig (line 254) | @SuppressWarnings("deprecation")
method createViews (line 268) | @SuppressWarnings("deprecation")
method getActivity (line 309) | @Override public Activity getActivity() {
method toggleFullscreen (line 316) | @SuppressLint("NewApi")
method isImmersiveMode (line 326) | private boolean isImmersiveMode() {
method setSystemUiVisibilityMode (line 331) | private void setSystemUiVisibilityMode(Window window) {
method makeWebView (line 349) | protected CordovaWebView makeWebView() {
method makeWebViewClient (line 361) | protected CordovaWebViewClient makeWebViewClient(CordovaWebView webVie...
method makeChromeClient (line 373) | protected CordovaChromeClient makeChromeClient(CordovaWebView webView) {
method init (line 377) | public void init() {
method init (line 381) | @SuppressLint("NewApi")
method loadUrl (line 407) | public void loadUrl(String url) {
method loadUrl (line 450) | public void loadUrl(final String url, int time) {
method loadSpinner (line 459) | void loadSpinner() {
method cancelLoadUrl (line 491) | @Deprecated
method clearCache (line 498) | @Deprecated // Call method on appView directly.
method clearHistory (line 509) | @Deprecated // Call method on appView directly.
method backHistory (line 521) | @Deprecated // Call method on appView directly.
method getBooleanProperty (line 532) | @Deprecated // Call method on preferences directly.
method getIntegerProperty (line 540) | @Deprecated // Call method on preferences directly.
method getStringProperty (line 548) | @Deprecated // Call method on preferences directly.
method getDoubleProperty (line 556) | @Deprecated // Call method on preferences directly.
method setBooleanProperty (line 570) | @Deprecated
method setIntegerProperty (line 585) | @Deprecated
method setStringProperty (line 600) | @Deprecated
method setDoubleProperty (line 615) | @Deprecated
method onPause (line 624) | @Override
method onNewIntent (line 650) | @Override
method onResume (line 661) | @Override
method onDestroy (line 700) | @Override
method postMessage (line 720) | public void postMessage(String id, Object data) {
method addService (line 732) | @Deprecated
method sendJavascript (line 745) | @Deprecated // Call method on appView directly.
method spinnerStart (line 758) | public void spinnerStart(final String title, final String message) {
method spinnerStop (line 775) | public void spinnerStop() {
method endActivity (line 785) | public void endActivity() {
method startActivityForResult (line 799) | public void startActivityForResult(CordovaPlugin command, Intent inten...
method onActivityResult (line 821) | @Override
method setActivityResultCallback (line 851) | public void setActivityResultCallback(CordovaPlugin plugin) {
method onReceivedError (line 863) | public void onReceivedError(final int errorCode, final String descript...
method displayError (line 896) | public void displayError(final String title, final String message, fin...
method isUrlWhiteListed (line 926) | @Deprecated // Use whitelist object directly.
method onCreateOptionsMenu (line 934) | @Override
method onPrepareOptionsMenu (line 940) | @Override
method onOptionsItemSelected (line 946) | @Override
method getContext (line 955) | @Deprecated
method showWebPage (line 971) | @Deprecated // Call method on appView directly.
method removeSplashScreen (line 986) | public void removeSplashScreen() {
method getScreenOrientation (line 995) | @SuppressLint("NewApi")
method getSplashLayout (line 1016) | protected LinearLayout getSplashLayout() {
method showSplashScreen (line 1035) | @SuppressWarnings("deprecation")
method onKeyUp (line 1096) | @Override
method onKeyDown (line 1114) | @Override
method onMessage (line 1138) | public Object onMessage(String id, Object data) {
method getThreadPool (line 1178) | public ExecutorService getThreadPool() {
method onSaveInstanceState (line 1182) | protected void onSaveInstanceState(Bundle outState)
FILE: framework/src/org/apache/cordova/CordovaApplication.java
class CordovaApplication (line 23) | public class CordovaApplication extends XWalkApplication {
FILE: framework/src/org/apache/cordova/CordovaArgs.java
class CordovaArgs (line 27) | public class CordovaArgs {
method CordovaArgs (line 30) | public CordovaArgs(JSONArray args) {
method get (line 36) | public Object get(int index) throws JSONException {
method getBoolean (line 40) | public boolean getBoolean(int index) throws JSONException {
method getDouble (line 44) | public double getDouble(int index) throws JSONException {
method getInt (line 48) | public int getInt(int index) throws JSONException {
method getJSONArray (line 52) | public JSONArray getJSONArray(int index) throws JSONException {
method getJSONObject (line 56) | public JSONObject getJSONObject(int index) throws JSONException {
method getLong (line 60) | public long getLong(int index) throws JSONException {
method getString (line 64) | public String getString(int index) throws JSONException {
method opt (line 69) | public Object opt(int index) {
method optBoolean (line 73) | public boolean optBoolean(int index) {
method optDouble (line 77) | public double optDouble(int index) {
method optInt (line 81) | public int optInt(int index) {
method optJSONArray (line 85) | public JSONArray optJSONArray(int index) {
method optJSONObject (line 89) | public JSONObject optJSONObject(int index) {
method optLong (line 93) | public long optLong(int index) {
method optString (line 97) | public String optString(int index) {
method isNull (line 101) | public boolean isNull(int index) {
method getArrayBuffer (line 107) | public byte[] getArrayBuffer(int index) throws JSONException {
FILE: framework/src/org/apache/cordova/CordovaBridge.java
class CordovaBridge (line 33) | public class CordovaBridge {
method CordovaBridge (line 40) | public CordovaBridge(PluginManager pluginManager, NativeToJsMessageQue...
method jsExec (line 45) | public String jsExec(int bridgeSecret, String service, String action, ...
method jsSetNativeToJsBridgeMode (line 78) | public void jsSetNativeToJsBridgeMode(int bridgeSecret, int value) thr...
method jsRetrieveJsMessages (line 85) | public String jsRetrieveJsMessages(int bridgeSecret, boolean fromOnlin...
method verifySecret (line 92) | private boolean verifySecret(String action, int bridgeSecret) throws I...
method clearBridgeSecret (line 109) | void clearBridgeSecret() {
method generateBridgeSecret (line 114) | int generateBridgeSecret() {
method reset (line 119) | public void reset(String loadedUrl) {
method promptOnJsPrompt (line 125) | public String promptOnJsPrompt(String origin, String message, String d...
method getMessageQueue (line 185) | public NativeToJsMessageQueue getMessageQueue() {
FILE: framework/src/org/apache/cordova/CordovaChromeClient.java
class CordovaChromeClient (line 55) | public class CordovaChromeClient extends XWalkUIClient {
method CordovaChromeClient (line 67) | @Deprecated
method CordovaChromeClient (line 73) | public CordovaChromeClient(CordovaInterface ctx, CordovaWebView app) {
method setWebView (line 79) | @Deprecated
method onJavascriptModalDialog (line 84) | @Override
method onJsAlert (line 113) | private boolean onJsAlert(XWalkView view, String url, String message,
method onJsConfirm (line 157) | private boolean onJsConfirm(XWalkView view, String url, String message,
method onJsPrompt (line 207) | private boolean onJsPrompt(XWalkView view, String origin, String messa...
method onPageLoadStarted (line 250) | @Override
method onPageLoadStopped (line 275) | @Override
method openFileChooser (line 324) | @Override
method getValueCallback (line 330) | public ValueCallback<Uri> getValueCallback() {
FILE: framework/src/org/apache/cordova/CordovaInterface.java
type CordovaInterface (line 32) | public interface CordovaInterface {
method startActivityForResult (line 42) | abstract public void startActivityForResult(CordovaPlugin command, Int...
method setActivityResultCallback (line 49) | abstract public void setActivityResultCallback(CordovaPlugin plugin);
method getActivity (line 56) | public abstract Activity getActivity();
method onMessage (line 66) | public Object onMessage(String id, Object data);
method getThreadPool (line 71) | public ExecutorService getThreadPool();
FILE: framework/src/org/apache/cordova/CordovaPlugin.java
class CordovaPlugin (line 35) | public class CordovaPlugin {
method privateInitialize (line 46) | public final void privateInitialize(CordovaInterface cordova, CordovaW...
method initialize (line 68) | public void initialize(CordovaInterface cordova, CordovaWebView webVie...
method pluginInitialize (line 74) | protected void pluginInitialize() {
method execute (line 91) | public boolean execute(String action, String rawArgs, CallbackContext ...
method execute (line 110) | public boolean execute(String action, JSONArray args, CallbackContext ...
method execute (line 129) | public boolean execute(String action, CordovaArgs args, CallbackContex...
method onPause (line 138) | public void onPause(boolean multitasking) {
method onResume (line 146) | public void onResume(boolean multitasking) {
method onNewIntent (line 152) | public void onNewIntent(Intent intent) {
method onDestroy (line 158) | public void onDestroy() {
method onMessage (line 168) | public Object onMessage(String id, Object data) {
method onActivityResult (line 181) | public void onActivityResult(int requestCode, int resultCode, Intent i...
method onOverrideUrlLoading (line 190) | public boolean onOverrideUrlLoading(String url) {
method remapUri (line 197) | public Uri remapUri(Uri uri) {
method onReset (line 208) | public void onReset() {
FILE: framework/src/org/apache/cordova/CordovaPreferences.java
class CordovaPreferences (line 31) | public class CordovaPreferences {
method setPreferencesBundle (line 35) | public void setPreferencesBundle(Bundle extras) {
method set (line 39) | public void set(String name, String value) {
method set (line 43) | public void set(String name, boolean value) {
method set (line 47) | public void set(String name, int value) {
method set (line 51) | public void set(String name, double value) {
method getAll (line 55) | public Map<String, String> getAll() {
method getBoolean (line 59) | public boolean getBoolean(String name, boolean defaultValue) {
method getInteger (line 75) | public int getInteger(String name, int defaultValue) {
method getDouble (line 92) | public double getDouble(String name, double defaultValue) {
method getString (line 108) | public String getString(String name, String defaultValue) {
method copyIntoIntentExtras (line 125) | public void copyIntoIntentExtras(Activity action) {
FILE: framework/src/org/apache/cordova/CordovaResourceApi.java
class CordovaResourceApi (line 69) | public class CordovaResourceApi {
method CordovaResourceApi (line 95) | public CordovaResourceApi(Context context, PluginManager pluginManager) {
method setThreadCheckingEnabled (line 101) | public void setThreadCheckingEnabled(boolean value) {
method isThreadCheckingEnabled (line 105) | public boolean isThreadCheckingEnabled() {
method getUriType (line 110) | public static int getUriType(Uri uri) {
method remapUri (line 137) | public Uri remapUri(Uri uri) {
method remapPath (line 143) | public String remapPath(String path) {
method mapUriToFile (line 151) | public File mapUriToFile(Uri uri) {
method getMimeType (line 177) | public String getMimeType(Uri uri) {
method getMimeTypeFromPath (line 205) | private String getMimeTypeFromPath(String path) {
method openForRead (line 230) | public OpenForReadResult openForRead(Uri uri) throws IOException {
method openForRead (line 242) | public OpenForReadResult openForRead(Uri uri, boolean skipThreadCheck)...
method openOutputStream (line 297) | public OutputStream openOutputStream(Uri uri) throws IOException {
method openOutputStream (line 308) | public OutputStream openOutputStream(Uri uri, boolean append) throws I...
method createHttpConnection (line 328) | public HttpURLConnection createHttpConnection(Uri uri) throws IOExcept...
method copyResource (line 335) | public void copyResource(OpenForReadResult input, OutputStream outputS...
method copyResource (line 369) | public void copyResource(Uri sourceUri, OutputStream outputStream) thr...
method copyResource (line 374) | public void copyResource(Uri sourceUri, Uri dstUri) throws IOException {
method assertBackgroundThread (line 378) | private void assertBackgroundThread() {
method getDataUriMimeType (line 390) | private String getDataUriMimeType(Uri uri) {
method readDataUri (line 403) | private OpenForReadResult readDataUri(Uri uri) {
method assertNonRelative (line 426) | private static void assertNonRelative(Uri uri) {
class OpenForReadResult (line 432) | public static final class OpenForReadResult {
method OpenForReadResult (line 439) | OpenForReadResult(Uri uri, InputStream inputStream, String mimeType,...
FILE: framework/src/org/apache/cordova/CordovaUriHelper.java
class CordovaUriHelper (line 29) | class CordovaUriHelper {
method CordovaUriHelper (line 36) | CordovaUriHelper(CordovaInterface cdv, CordovaWebView webView)
method shouldOverrideUrlLoading (line 50) | @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
FILE: framework/src/org/apache/cordova/CordovaWebView.java
class CordovaWebView (line 67) | public class CordovaWebView extends XWalkView {
class ActivityResult (line 100) | class ActivityResult {
method ActivityResult (line 106) | public ActivityResult(int req, int res, Intent intent) {
method CordovaWebView (line 121) | public CordovaWebView(Context context) {
method CordovaWebView (line 125) | public CordovaWebView(Context context, AttributeSet attrs) {
method CordovaWebView (line 129) | @Deprecated
method CordovaWebView (line 134) | @TargetApi(11)
method init (line 141) | public void init(CordovaInterface cordova, CordovaWebViewClient webVie...
method initIfNecessary (line 168) | @SuppressWarnings("deprecation")
method initWebViewSettings (line 181) | @SuppressLint("SetJavaScriptEnabled")
method makeWebChromeClient (line 243) | public CordovaChromeClient makeWebChromeClient(CordovaInterface cordov...
method makeWebViewClient (line 247) | public CordovaWebViewClient makeWebViewClient(CordovaInterface cordova) {
method enableRemoteDebugging (line 254) | public void enableRemoteDebugging() {
method shouldRequestFocusOnInit (line 264) | protected boolean shouldRequestFocusOnInit() {
method exposeJsInterface (line 268) | private void exposeJsInterface() {
method setWebViewClient (line 286) | public void setWebViewClient(CordovaWebViewClient client) {
method setWebChromeClient (line 296) | public void setWebChromeClient(CordovaChromeClient client) {
method getWebChromeClient (line 301) | public CordovaChromeClient getWebChromeClient() {
method getWhitelist (line 306) | public Whitelist getWhitelist() {
method getExternalWhitelist (line 310) | public Whitelist getExternalWhitelist() {
method load (line 319) | @Override
method loadUrl (line 329) | public void loadUrl(String url) {
method loadUrl (line 340) | @Deprecated
method loadUrlIntoView (line 352) | public void loadUrlIntoView(final String url) {
method loadUrlIntoView (line 361) | public void loadUrlIntoView(final String url, boolean recreatePlugins) {
method loadUrlNow (line 421) | void loadUrlNow(String url) {
method loadUrlIntoView (line 437) | public void loadUrlIntoView(final String url, final int time) {
method stopLoading (line 457) | @Override
method onScrollChanged (line 463) | public void onScrollChanged(int l, int t, int oldl, int oldt)
method sendJavascript (line 491) | @Deprecated
method sendPluginResult (line 503) | public void sendPluginResult(PluginResult result, String callbackId) {
method postMessage (line 513) | public void postMessage(String id, Object data) {
method canGoBack (line 524) | public boolean canGoBack() {
method backHistory (line 533) | public boolean backHistory() {
method showWebPage (line 554) | public void showWebPage(String url, boolean openExternal, boolean clea...
method getProperty (line 598) | public String getProperty(String name, String defaultValue) {
method onKeyDown (line 611) | @Override
method dispatchKeyEvent (line 652) | @Override
method setButtonPlumbedToJs (line 705) | public void setButtonPlumbedToJs(int keyCode, boolean override) {
method bindButton (line 722) | @Deprecated // Use setButtonPlumbedToJs() instead.
method bindButton (line 728) | @Deprecated // Use setButtonPlumbedToJs() instead.
method bindButton (line 738) | @Deprecated // Use setButtonPlumbedToJs() instead.
method isBackButtonBound (line 743) | @Deprecated // Use isButtonPlumbedToJs
method isButtonPlumbedToJs (line 749) | public boolean isButtonPlumbedToJs(int keyCode)
method pauseTimers (line 755) | @Override
method pauseTimersForReal (line 761) | public void pauseTimersForReal() {
method handlePause (line 765) | public void handlePause(boolean keepRunning)
method handleResume (line 785) | public void handleResume(boolean keepRunning, boolean activityResultKe...
method handleDestroy (line 800) | public void handleDestroy()
method onNewIntent (line 824) | @Override
method isPaused (line 835) | public boolean isPaused()
method hadKeyEvent (line 840) | @Deprecated // This never did anything.
method printBackForwardList (line 845) | public void printBackForwardList() {
method startOfHistory (line 858) | public boolean startOfHistory()
method restoreState (line 872) | @Override
method storeResult (line 884) | @Deprecated // This never did anything
method getResourceApi (line 888) | public CordovaResourceApi getResourceApi() {
method getPreferences (line 892) | public CordovaPreferences getPreferences() {
FILE: framework/src/org/apache/cordova/CordovaWebViewClient.java
class CordovaWebViewClient (line 57) | public class CordovaWebViewClient extends XWalkResourceClient {
method CordovaWebViewClient (line 100) | @Deprecated
method CordovaWebViewClient (line 112) | public CordovaWebViewClient(CordovaInterface cordova, CordovaWebView v...
method setWebView (line 124) | @Deprecated
method onReceivedLoadError (line 139) | @Override
method shouldOverrideUrlLoading (line 159) | @Override
method onReceivedSslError (line 171) | public void onReceivedSslError(XWalkView view, ValueCallback<Boolean> ...
method setAuthenticationToken (line 199) | public void setAuthenticationToken(AuthenticationToken authenticationT...
method removeAuthenticationToken (line 217) | public AuthenticationToken removeAuthenticationToken(String host, Stri...
method getAuthenticationToken (line 235) | public AuthenticationToken getAuthenticationToken(String host, String ...
method clearAuthenticationTokens (line 260) | public void clearAuthenticationTokens() {
FILE: framework/src/org/apache/cordova/DirectoryManager.java
class DirectoryManager (line 33) | @Deprecated // Deprecated in 3.1. To be removed in 4.0.
method testFileExists (line 44) | public static boolean testFileExists(String name) {
method getFreeDiskSpace (line 65) | public static long getFreeDiskSpace(boolean checkInternal) {
method freeSpaceCalculation (line 90) | private static long freeSpaceCalculation(String path) {
method testSaveLocationExists (line 102) | public static boolean testSaveLocationExists() {
method constructFilePaths (line 125) | private static File constructFilePaths (String file1, String file2) {
method getTempDirectoryPath (line 142) | public static String getTempDirectoryPath(Context ctx) {
FILE: framework/src/org/apache/cordova/DroidGap.java
class DroidGap (line 31) | @Deprecated
method onXWalkReady (line 33) | @Override
FILE: framework/src/org/apache/cordova/ExifHelper.java
class ExifHelper (line 25) | @Deprecated // Deprecated in 3.1. To be removed in 4.0.
method createInFile (line 56) | public void createInFile(String filePath) throws IOException {
method createOutFile (line 66) | public void createOutFile(String filePath) throws IOException {
method readExifData (line 73) | public void readExifData() {
method writeExifData (line 100) | public void writeExifData() throws IOException {
method getOrientation (line 167) | public int getOrientation() {
method resetOrientation (line 183) | public void resetOrientation() {
FILE: framework/src/org/apache/cordova/ExposedJsApi.java
class ExposedJsApi (line 29) | class ExposedJsApi {
method ExposedJsApi (line 33) | public ExposedJsApi(CordovaBridge bridge) {
method exec (line 37) | @JavascriptInterface
method setNativeToJsBridgeMode (line 42) | @JavascriptInterface
method retrieveJsMessages (line 47) | @JavascriptInterface
FILE: framework/src/org/apache/cordova/FileHelper.java
class FileHelper (line 37) | @Deprecated // Deprecated in 3.1. To be removed in 4.0.
method getRealPath (line 50) | @SuppressWarnings("deprecation")
method getRealPath (line 84) | public static String getRealPath(Uri uri, CordovaInterface cordova) {
method getInputStreamFromUriString (line 96) | public static InputStream getInputStreamFromUriString(String uriString...
method stripFileProtocol (line 124) | public static String stripFileProtocol(String uriString) {
method getMimeTypeForExtension (line 131) | public static String getMimeTypeForExtension(String path) {
method getMimeType (line 151) | public static String getMimeType(String uriString, CordovaInterface co...
FILE: framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
class IceCreamCordovaWebViewClient (line 35) | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
method IceCreamCordovaWebViewClient (line 41) | public IceCreamCordovaWebViewClient(CordovaInterface cordova) {
method IceCreamCordovaWebViewClient (line 45) | public IceCreamCordovaWebViewClient(CordovaInterface cordova, CordovaW...
method shouldInterceptLoadRequest (line 49) | @Override
method isUrlHarmful (line 80) | private boolean isUrlHarmful(String url) {
method needsKitKatContentUrlFix (line 85) | private static boolean needsKitKatContentUrlFix(Uri uri) {
method needsSpecialsInAssetUrlFix (line 89) | private static boolean needsSpecialsInAssetUrlFix(Uri uri) {
FILE: framework/src/org/apache/cordova/JSONUtils.java
class JSONUtils (line 27) | @Deprecated // Deprecated in 3.1. To be removed in 4.0.
method toStringList (line 29) | public static List<String> toStringList(JSONArray array) throws JSONEx...
FILE: framework/src/org/apache/cordova/LOG.java
class LOG (line 29) | public class LOG {
method setLogLevel (line 45) | public static void setLogLevel(int logLevel) {
method setLogLevel (line 55) | public static void setLogLevel(String logLevel) {
method isLoggable (line 70) | public static boolean isLoggable(int logLevel) {
method v (line 80) | public static void v(String tag, String s) {
method d (line 90) | public static void d(String tag, String s) {
method i (line 100) | public static void i(String tag, String s) {
method w (line 110) | public static void w(String tag, String s) {
method e (line 120) | public static void e(String tag, String s) {
method v (line 131) | public static void v(String tag, String s, Throwable e) {
method d (line 142) | public static void d(String tag, String s, Throwable e) {
method i (line 153) | public static void i(String tag, String s, Throwable e) {
method w (line 164) | public static void w(String tag, String s, Throwable e) {
method e (line 175) | public static void e(String tag, String s, Throwable e) {
method v (line 186) | public static void v(String tag, String s, Object... args) {
method d (line 197) | public static void d(String tag, String s, Object... args) {
method i (line 208) | public static void i(String tag, String s, Object... args) {
method w (line 219) | public static void w(String tag, String s, Object... args) {
method e (line 230) | public static void e(String tag, String s, Object... args) {
FILE: framework/src/org/apache/cordova/LinearLayoutSoftKeyboardDetect.java
class LinearLayoutSoftKeyboardDetect (line 30) | public class LinearLayoutSoftKeyboardDetect extends LinearLayout {
method LinearLayoutSoftKeyboardDetect (line 40) | public LinearLayoutSoftKeyboardDetect(Context context, int width, int ...
method onMeasure (line 47) | @Override
FILE: framework/src/org/apache/cordova/NativeToJsMessageQueue.java
class NativeToJsMessageQueue (line 35) | public class NativeToJsMessageQueue {
method NativeToJsMessageQueue (line 77) | public NativeToJsMessageQueue(CordovaWebView webView, CordovaInterface...
method isBridgeEnabled (line 88) | public boolean isBridgeEnabled() {
method setBridgeMode (line 95) | public void setBridgeMode(int value) {
method reset (line 118) | public void reset() {
method calculatePackedMessageLength (line 125) | private int calculatePackedMessageLength(JsMessage message) {
method packMessage (line 131) | private void packMessage(JsMessage message, StringBuilder sb) {
method popAndEncode (line 143) | public String popAndEncode(boolean fromOnlineEvent) {
method popAndEncodeAsJs (line 181) | private String popAndEncodeAsJs() {
method addJavaScript (line 225) | public void addJavaScript(String statement) {
method addPluginResult (line 232) | public void addPluginResult(PluginResult result, String callbackId) {
method enqueueMessage (line 254) | private void enqueueMessage(JsMessage message) {
method setPaused (line 267) | public void setPaused(boolean value) {
class BridgeMode (line 283) | private abstract class BridgeMode {
method onNativeToJsMessageAvailable (line 284) | abstract void onNativeToJsMessageAvailable();
method notifyOfFlush (line 285) | void notifyOfFlush(boolean fromOnlineEvent) {}
method reset (line 286) | void reset() {}
class PollingBridgeMode (line 290) | private class PollingBridgeMode extends BridgeMode {
method onNativeToJsMessageAvailable (line 291) | @Override void onNativeToJsMessageAvailable() {
class LoadUrlBridgeMode (line 296) | private class LoadUrlBridgeMode extends BridgeMode {
method run (line 298) | public void run() {
method onNativeToJsMessageAvailable (line 306) | @Override void onNativeToJsMessageAvailable() {
class OnlineEventsBridgeMode (line 312) | private class OnlineEventsBridgeMode extends BridgeMode {
method run (line 317) | public void run() {
method run (line 325) | public void run() {
method reset (line 332) | @Override void reset() {
method onNativeToJsMessageAvailable (line 335) | @Override void onNativeToJsMessageAvailable() {
method notifyOfFlush (line 339) | @Override void notifyOfFlush(boolean fromOnlineEvent) {
class PrivateApiBridgeMode (line 350) | private class PrivateApiBridgeMode extends BridgeMode {
method initReflection (line 360) | @SuppressWarnings("rawtypes")
method onNativeToJsMessageAvailable (line 388) | @Override void onNativeToJsMessageAvailable() {
class JsMessage (line 404) | private static class JsMessage {
method JsMessage (line 407) | JsMessage(String js) {
method JsMessage (line 414) | JsMessage(PluginResult pluginResult, String callbackId) {
method calculateEncodedLength (line 422) | int calculateEncodedLength() {
method encodeAsMessage (line 452) | void encodeAsMessage(StringBuilder sb) {
method encodeAsJsMessage (line 498) | void encodeAsJsMessage(StringBuilder sb) {
FILE: framework/src/org/apache/cordova/PluginEntry.java
class PluginEntry (line 28) | public class PluginEntry {
method PluginEntry (line 56) | public PluginEntry(String service, CordovaPlugin plugin) {
method PluginEntry (line 65) | public PluginEntry(String service, String pluginClass, boolean onload) {
method PluginEntry (line 69) | @Deprecated // urlFilters are going away
method PluginEntry (line 78) | private PluginEntry(String service, String pluginClass, boolean onload...
method getUrlFilters (line 86) | public List<String> getUrlFilters() {
FILE: framework/src/org/apache/cordova/PluginManager.java
class PluginManager (line 43) | public class PluginManager {
method PluginManager (line 58) | @Deprecated
method PluginManager (line 63) | PluginManager(CordovaWebView cordovaWebView, CordovaInterface cordova,...
method setPluginEntries (line 74) | public void setPluginEntries(List<PluginEntry> pluginEntries) {
method init (line 87) | public void init() {
method loadPlugins (line 95) | @Deprecated
method clearPluginObjects (line 102) | @Deprecated // Should not be exposed as public.
method startupPlugins (line 110) | @Deprecated // Should not be exposed as public.
method exec (line 136) | public void exec(final String service, final String action, final Stri...
method exec (line 166) | @Deprecated
method getPlugin (line 179) | public CordovaPlugin getPlugin(String service) {
method addService (line 204) | public void addService(String service, String className) {
method addService (line 215) | public void addService(PluginEntry entry) {
method onPause (line 233) | public void onPause(boolean multitasking) {
method onResume (line 244) | public void onResume(boolean multitasking) {
method onDestroy (line 253) | public void onDestroy() {
method postMessage (line 266) | public Object postMessage(String id, Object data) {
method onNewIntent (line 283) | public void onNewIntent(Intent intent) {
method onOverrideUrlLoading (line 295) | public boolean onOverrideUrlLoading(String url) {
method onReset (line 321) | public void onReset() {
method remapUri (line 327) | Uri remapUri(Uri uri) {
method instantiatePlugin (line 340) | private CordovaPlugin instantiatePlugin(String className) {
FILE: framework/src/org/apache/cordova/PluginResult.java
class PluginResult (line 26) | public class PluginResult {
method PluginResult (line 33) | public PluginResult(Status status) {
method PluginResult (line 37) | public PluginResult(Status status, String message) {
method PluginResult (line 43) | public PluginResult(Status status, JSONArray message) {
method PluginResult (line 49) | public PluginResult(Status status, JSONObject message) {
method PluginResult (line 55) | public PluginResult(Status status, int i) {
method PluginResult (line 61) | public PluginResult(Status status, float f) {
method PluginResult (line 67) | public PluginResult(Status status, boolean b) {
method PluginResult (line 73) | public PluginResult(Status status, byte[] data) {
method PluginResult (line 77) | public PluginResult(Status status, byte[] data, boolean binaryString) {
method setKeepCallback (line 83) | public void setKeepCallback(boolean b) {
method getStatus (line 87) | public int getStatus() {
method getMessageType (line 91) | public int getMessageType() {
method getMessage (line 95) | public String getMessage() {
method getStrMessage (line 106) | public String getStrMessage() {
method getKeepCallback (line 110) | public boolean getKeepCallback() {
method getJSONString (line 114) | @Deprecated // Use sendPluginResult instead of sendJavascript.
method toCallbackString (line 119) | @Deprecated // Use sendPluginResult instead of sendJavascript.
method toSuccessCallbackString (line 134) | @Deprecated // Use sendPluginResult instead of sendJavascript.
method toErrorCallbackString (line 139) | @Deprecated // Use sendPluginResult instead of sendJavascript.
type Status (line 167) | public enum Status {
FILE: framework/src/org/apache/cordova/ScrollEvent.java
class ScrollEvent (line 30) | public class ScrollEvent {
method ScrollEvent (line 46) | ScrollEvent(int nx, int ny, int x, int y, View view)
method dl (line 52) | public int dl()
method dt (line 57) | public int dt()
method getTargetView (line 62) | public View getTargetView()
FILE: framework/src/org/apache/cordova/Whitelist.java
class Whitelist (line 31) | public class Whitelist {
class URLPattern (line 32) | private static class URLPattern {
method regexFromPattern (line 38) | private String regexFromPattern(String pattern, boolean allowWildcar...
method URLPattern (line 53) | public URLPattern(String scheme, String host, String port, String pa...
method matches (line 82) | public boolean matches(Uri uri) {
method Whitelist (line 99) | public Whitelist() {
method addWhiteListEntry (line 114) | public void addWhiteListEntry(String origin, boolean subdomains) {
method isUrlWhiteListed (line 154) | public boolean isUrlWhiteListed(String uri) {
FILE: framework/test/org/apache/cordova/PreferenceNodeTest.java
class PreferenceNodeTest (line 24) | public class PreferenceNodeTest {
method testConstructor (line 25) | @Test
method testNameAssignment (line 33) | @Test
method testValueAssignment (line 40) | @Test
method testReadonlyAssignment (line 47) | @Test
FILE: framework/test/org/apache/cordova/PreferenceSetTest.java
class PreferenceSetTest (line 25) | public class PreferenceSetTest {
method setUp (line 29) | @Before
method testAddition (line 35) | @Test
method testClear (line 41) | @Test
method testPreferenceRetrieval (line 48) | @Test
method testNoPreferenceRetrieval (line 54) | @Test
method testUnsetPreferenceChecking (line 60) | @Test
method testSetPreferenceChecking (line 67) | @Test
FILE: test/assets/www/main.js
function roundNumber (line 42) | function roundNumber(num) {
function updateAcceleration (line 50) | function updateAcceleration(a) {
function dump_pic (line 79) | function dump_pic(data) {
function fail (line 89) | function fail(msg) {
function show_pic (line 93) | function show_pic() {
function close (line 99) | function close() {
function contacts_success (line 105) | function contacts_success(contacts) {
function get_contacts (line 112) | function get_contacts() {
function check_network (line 121) | function check_network() {
function updateHeading (line 138) | function updateHeading(h) {
function toggleCompass (line 142) | function toggleCompass() {
function init (line 155) | function init() {
FILE: test/cordova/lib/appinfo.js
function readAppInfoFromManifest (line 26) | function readAppInfoFromManifest() {
FILE: test/src/org/apache/cordova/pluginApi/pluginStub.java
class pluginStub (line 29) | public class pluginStub extends CordovaPlugin {
method onMessage (line 34) | public Object onMessage(String id, Object input)
FILE: test/src/org/apache/cordova/test/ActivityPlugin.java
class ActivityPlugin (line 35) | public class ActivityPlugin extends CordovaPlugin {
method ActivityPlugin (line 42) | public ActivityPlugin() {
method execute (line 53) | public boolean execute(String action, CordovaArgs args, final Callback...
method startActivity (line 74) | public void startActivity(String className) {
FILE: test/src/org/apache/cordova/test/CordovaDriverAction.java
class CordovaDriverAction (line 33) | public class CordovaDriverAction extends Activity implements CordovaInte...
method onCreate (line 35) | @Override
method startActivityForResult (line 40) | public void startActivityForResult(CordovaPlugin command, Intent intent,
method setActivityResultCallback (line 46) | public void setActivityResultCallback(CordovaPlugin plugin) {
method getActivity (line 51) | public Activity getActivity() {
method getContext (line 56) | @Deprecated
method cancelLoadUrl (line 62) | @Deprecated
method onMessage (line 68) | public Object onMessage(String id, Object data) {
method getThreadPool (line 73) | public ExecutorService getThreadPool() {
FILE: test/src/org/apache/cordova/test/CordovaWebViewTestActivity.java
class CordovaWebViewTestActivity (line 38) | public class CordovaWebViewTestActivity extends Activity implements Cord...
method onCreate (line 44) | @Override
method getContext (line 61) | public Context getContext() {
method startActivityForResult (line 65) | public void startActivityForResult(CordovaPlugin command, Intent intent,
method setActivityResultCallback (line 71) | public void setActivityResultCallback(CordovaPlugin plugin) {
method getActivity (line 77) | public Activity getActivity() {
method cancelLoadUrl (line 81) | @Deprecated
method onMessage (line 87) | public Object onMessage(String id, Object data) {
method getThreadPool (line 92) | public ExecutorService getThreadPool() {
method onDestroy (line 97) | @Override
FILE: test/src/org/apache/cordova/test/MainTestActivity.java
class MainTestActivity (line 25) | public class MainTestActivity extends CordovaActivity {
method onCreate (line 27) | @Override
FILE: test/src/org/apache/cordova/test/SabotagedActivity.java
class SabotagedActivity (line 35) | public class SabotagedActivity extends CordovaActivity {
method onCreate (line 41) | @Override
method copyErrorAsset (line 56) | private void copyErrorAsset () {
method copy (line 85) | private void copy(InputStream in, OutputStream out) throws IOException {
FILE: test/src/org/apache/cordova/test/backbuttonmultipage.java
class backbuttonmultipage (line 24) | public class backbuttonmultipage extends CordovaActivity {
method onCreate (line 25) | @Override
FILE: test/src/org/apache/cordova/test/background.java
class background (line 25) | public class background extends CordovaActivity {
method onCreate (line 26) | @Override
FILE: test/src/org/apache/cordova/test/backgroundcolor.java
class backgroundcolor (line 25) | public class backgroundcolor extends CordovaActivity {
method onCreate (line 26) | @Override
FILE: test/src/org/apache/cordova/test/basicauth.java
class basicauth (line 24) | public class basicauth extends CordovaActivity {
method onCreate (line 25) | @Override
FILE: test/src/org/apache/cordova/test/errorurl.java
class errorurl (line 24) | public class errorurl extends CordovaActivity {
method onCreate (line 25) | @Override
FILE: test/src/org/apache/cordova/test/fullscreen.java
class fullscreen (line 24) | public class fullscreen extends CordovaActivity {
method onCreate (line 25) | @Override
FILE: test/src/org/apache/cordova/test/htmlnotfound.java
class htmlnotfound (line 24) | public class htmlnotfound extends CordovaActivity {
method onCreate (line 25) | @Override
FILE: test/src/org/apache/cordova/test/iframe.java
class iframe (line 24) | public class iframe extends CordovaActivity {
method onCreate (line 25) | @Override
FILE: test/src/org/apache/cordova/test/junit/BackButtonMultiPageTest.java
class BackButtonMultiPageTest (line 34) | public class BackButtonMultiPageTest extends ActivityInstrumentationTest...
method BackButtonMultiPageTest (line 43) | public BackButtonMultiPageTest() {
method setUp (line 47) | @UiThreadTest
method testPreconditions (line 58) | @UiThreadTest
method testViaLoadUrl (line 112) | public void testViaLoadUrl() throws Throwable {
method testViaBackButtonOnView (line 157) | public void testViaBackButtonOnView() throws Throwable {
method testViaBackButtonOnLayout (line 210) | public void testViaBackButtonOnLayout() throws Throwable {
method sleep (line 263) | @UiThreadTest
FILE: test/src/org/apache/cordova/test/junit/CordovaActivityTest.java
class CordovaActivityTest (line 31) | public class CordovaActivityTest extends ActivityInstrumentationTestCase...
method CordovaActivityTest (line 40) | @SuppressWarnings("deprecation")
method setUp (line 46) | protected void setUp() throws Exception {
method testPreconditions (line 56) | public void testPreconditions(){
method testForCordovaView (line 62) | public void testForCordovaView() {
method testForLinearLayout (line 67) | public void testForLinearLayout() {
method sleep (line 72) | private void sleep() {
FILE: test/src/org/apache/cordova/test/junit/CordovaResourceApiTest.java
class CordovaResourceApiTest (line 49) | public class CordovaResourceApiTest extends ActivityInstrumentationTestC...
method CordovaResourceApiTest (line 51) | public CordovaResourceApiTest()
method setUp (line 63) | protected void setUp() throws Exception {
method createTestImageContentUri (line 89) | private Uri createTestImageContentUri() {
method performApiTest (line 96) | private void performApiTest(Uri uri, String expectedMimeType, File exp...
method testValidContentUri (line 129) | @Suppress
method testInvalidContentUri (line 138) | public void testInvalidContentUri() throws IOException
method testValidAssetUri (line 144) | public void testValidAssetUri() throws IOException
method testInvalidAssetUri (line 150) | public void testInvalidAssetUri() throws IOException
method testFileUriToExistingFile (line 156) | public void testFileUriToExistingFile() throws IOException
method testFileUriToMissingFile (line 167) | public void testFileUriToMissingFile() throws IOException
method testFileUriToMissingFileWithMissingParent (line 178) | public void testFileUriToMissingFileWithMissingParent() throws IOExcep...
method testUnrecognizedUri (line 185) | public void testUnrecognizedUri() throws IOException
method testRelativeUri (line 191) | public void testRelativeUri()
method testPluginOverride (line 210) | public void testPluginOverride() throws IOException
method testMainThreadUsage (line 216) | public void testMainThreadUsage() throws IOException
method testDataUriPlain (line 228) | public void testDataUriPlain() throws IOException
method testDataUriBase64 (line 237) | public void testDataUriBase64() throws IOException
FILE: test/src/org/apache/cordova/test/junit/CordovaTest.java
class CordovaTest (line 30) | public class CordovaTest extends
method CordovaTest (line 38) | public CordovaTest() {
method setUp (line 42) | protected void setUp() throws Exception {
method testPreconditions (line 48) | public void testPreconditions() {
method testForCordovaView (line 52) | public void testForCordovaView() {
method sleep (line 109) | private void sleep() {
FILE: test/src/org/apache/cordova/test/junit/ErrorUrlTest.java
class ErrorUrlTest (line 32) | public class ErrorUrlTest extends ActivityInstrumentationTestCase2<error...
method ErrorUrlTest (line 40) | public ErrorUrlTest() {
method setUp (line 45) | protected void setUp() throws Exception {
method testPreconditions (line 53) | @Suppress
method testUrl (line 59) | @Suppress
method sleep (line 76) | private void sleep() {
FILE: test/src/org/apache/cordova/test/junit/FixWebView.java
class FixWebView (line 24) | public class FixWebView extends WebView {
method FixWebView (line 26) | public FixWebView(Context context) {
method pauseTimers (line 30) | @Override
method pauseTimers (line 39) | public void pauseTimers(@SuppressWarnings("unused") boolean realPause) {
FILE: test/src/org/apache/cordova/test/junit/HtmlNotFoundTest.java
class HtmlNotFoundTest (line 31) | public class HtmlNotFoundTest extends ActivityInstrumentationTestCase2<h...
method HtmlNotFoundTest (line 39) | public HtmlNotFoundTest() {
method setUp (line 43) | protected void setUp() throws Exception {
method testPreconditions (line 51) | public void testPreconditions(){
method testUrl (line 56) | public void testUrl() throws Throwable
method sleep (line 71) | private void sleep() {
FILE: test/src/org/apache/cordova/test/junit/IFrameTest.java
class IFrameTest (line 35) | public class IFrameTest extends ActivityInstrumentationTestCase2 {
method IFrameTest (line 46) | public IFrameTest() {
method setUp (line 51) | protected void setUp() throws Exception {
method testIframeDest (line 63) | public void testIframeDest() throws Throwable
method testIframeHistory (line 88) | public void testIframeHistory() throws Throwable
method sleep (line 121) | private void sleep(int timeout) {
FILE: test/src/org/apache/cordova/test/junit/IntentUriOverrideTest.java
class IntentUriOverrideTest (line 35) | public class IntentUriOverrideTest extends ActivityInstrumentationTestCa...
method IntentUriOverrideTest (line 47) | @SuppressWarnings("deprecation")
method setUp (line 54) | protected void setUp() throws Exception {
method testPreconditions (line 68) | public void testPreconditions(){
method testChangeStartUrl (line 73) | public void testChangeStartUrl() throws Throwable
method sleep (line 84) | private void sleep() {
FILE: test/src/org/apache/cordova/test/junit/LifecycleTest.java
class LifecycleTest (line 28) | public class LifecycleTest extends ActivityInstrumentationTestCase2<life...
method LifecycleTest (line 30) | public LifecycleTest()
FILE: test/src/org/apache/cordova/test/junit/MenuTest.java
class MenuTest (line 26) | public class MenuTest extends ActivityInstrumentationTestCase2<menus> {
method MenuTest (line 28) | public MenuTest() {
FILE: test/src/org/apache/cordova/test/junit/PluginManagerTest.java
class PluginManagerTest (line 31) | public class PluginManagerTest extends ActivityInstrumentationTestCase2<...
method PluginManagerTest (line 40) | public PluginManagerTest() {
method setUp (line 44) | protected void setUp() throws Exception{
method testPreconditions (line 53) | public void testPreconditions(){
method testForPluginManager (line 59) | public void testForPluginManager() {
FILE: test/src/org/apache/cordova/test/junit/SplashscreenTest.java
class SplashscreenTest (line 32) | public class SplashscreenTest extends ActivityInstrumentationTestCase2<s...
method SplashscreenTest (line 37) | public SplashscreenTest()
method setUp (line 42) | protected void setUp() throws Exception {
FILE: test/src/org/apache/cordova/test/junit/XhrTest.java
class XhrTest (line 28) | public class XhrTest extends ActivityInstrumentationTestCase2<xhr> {
method XhrTest (line 30) | public XhrTest()
FILE: test/src/org/apache/cordova/test/lifecycle.java
class lifecycle (line 24) | public class lifecycle extends CordovaActivity {
method onCreate (line 25) | @Override
FILE: test/src/org/apache/cordova/test/loading.java
class loading (line 24) | public class loading extends CordovaActivity {
method onCreate (line 25) | @Override
FILE: test/src/org/apache/cordova/test/menus.java
class menus (line 31) | public class menus extends CordovaActivity {
method onCreate (line 32) | @Override
method onCreateOptionsMenu (line 43) | @Override
method onOptionsItemSelected (line 54) | @Override
method onPrepareOptionsMenu (line 61) | @Override
method onCreateContextMenu (line 68) | @Override
method onContextItemSelected (line 75) | @Override
FILE: test/src/org/apache/cordova/test/splashscreen.java
class splashscreen (line 24) | public class splashscreen extends CordovaActivity {
method onCreate (line 25) | @Override
FILE: test/src/org/apache/cordova/test/tests.java
class tests (line 24) | public class tests extends CordovaActivity {
method onCreate (line 25) | @Override
FILE: test/src/org/apache/cordova/test/timeout.java
class timeout (line 24) | public class timeout extends CordovaActivity {
method onCreate (line 25) | @Override
FILE: test/src/org/apache/cordova/test/userwebview.java
class userwebview (line 27) | public class userwebview extends MainTestActivity {
method onCreate (line 32) | @Override
class TestChromeClient (line 43) | public class TestChromeClient extends CordovaChromeClient {
method TestChromeClient (line 44) | public TestChromeClient(CordovaInterface ctx, CordovaWebView app) {
class TestViewClient (line 56) | public class TestViewClient extends CordovaWebViewClient {
method TestViewClient (line 57) | public TestViewClient(CordovaInterface ctx, CordovaWebView app) {
FILE: test/src/org/apache/cordova/test/util/Purity.java
class Purity (line 37) | public class Purity {
method Purity (line 45) | public Purity(Context ctx, Instrumentation i)
method getRealCoord (line 59) | private int getRealCoord(int coord)
method getViewportWidth (line 64) | public int getViewportWidth()
method getViewportHeight (line 69) | public int getViewportHeight()
method touch (line 74) | public void touch(int x, int y)
method touchStart (line 90) | public void touchStart(int x, int y)
method touchMove (line 103) | public void touchMove(int x, int y)
method touchEnd (line 119) | public void touchEnd(int x, int y)
method setBitmap (line 138) | public void setBitmap(WebView view)
method checkRenderView (line 144) | public boolean checkRenderView(WebView view)
method clearBitmap (line 161) | public void clearBitmap()
method finalize (line 167) | protected void finalize()
FILE: test/src/org/apache/cordova/test/whitelist.java
class whitelist (line 28) | public class whitelist extends MainTestActivity {
method onCreate (line 29) | @Override
class TestViewClient (line 40) | public class TestViewClient extends CordovaWebViewClient {
method TestViewClient (line 42) | public TestViewClient(CordovaInterface ctx, CordovaWebView app) {
FILE: test/src/org/apache/cordova/test/xhr.java
class xhr (line 24) | public class xhr extends CordovaActivity {
method onCreate (line 25) | @Override
Condensed preview — 280 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,311K chars).
[
{
"path": ".gitignore",
"chars": 817,
"preview": ".DS_Store\ndefault.properties\ngen\nassets/www/cordova.js\nframework/assets/www/.tmp*\nlocal.properties\nframework/lib\nproguar"
},
{
"path": ".reviewboardrc",
"chars": 194,
"preview": "#\n# Settings for post-review (used for uploading diffs to reviews.apache.org).\n#\nGUESS_FIELDS = True\nOPEN_BROWSER = True"
},
{
"path": "CONTRIBUTING.md",
"chars": 1401,
"preview": "<!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the N"
},
{
"path": "LICENSE",
"chars": 15703,
"preview": "\n Apache License\n Version 2.0, January 2004\n "
},
{
"path": "NOTICE",
"chars": 737,
"preview": "Apache Cordova\nCopyright 2014 The Apache Software Foundation\n\nThis product includes software developed at\nThe Apache Sof"
},
{
"path": "README.md",
"chars": 4634,
"preview": "<!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the N"
},
{
"path": "RELEASENOTES.md",
"chars": 14606,
"preview": "<!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the N"
},
{
"path": "VERSION",
"chars": 6,
"preview": "3.6.3\n"
},
{
"path": "bin/android_sdk_version",
"chars": 1048,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/android_sdk_version.bat",
"chars": 1039,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/check_reqs",
"chars": 1160,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/check_reqs.bat",
"chars": 1021,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/create",
"chars": 2705,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/create.bat",
"chars": 1006,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/lib/android_sdk_version.js",
"chars": 2290,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/lib/check_reqs.js",
"chars": 8161,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/lib/create.js",
"chars": 16057,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/lib/simpleargs.js",
"chars": 1326,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "bin/templates/cordova/build",
"chars": 1347,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/build.bat",
"chars": 1010,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/templates/cordova/clean",
"chars": 1510,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/clean.bat",
"chars": 1010,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/templates/cordova/defaults.xml",
"chars": 1038,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contrib"
},
{
"path": "bin/templates/cordova/lib/appinfo.js",
"chars": 1813,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/build.js",
"chars": 13677,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/device.js",
"chars": 3390,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/emulator.js",
"chars": 12036,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/exec.js",
"chars": 1538,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/install-device",
"chars": 1510,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/install-device.bat",
"chars": 1036,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/templates/cordova/lib/install-emulator",
"chars": 1353,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/install-emulator.bat",
"chars": 1040,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/templates/cordova/lib/list-devices",
"chars": 1172,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/list-devices.bat",
"chars": 1032,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/templates/cordova/lib/list-emulator-images",
"chars": 1195,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/list-emulator-images.bat",
"chars": 1050,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/templates/cordova/lib/list-started-emulators",
"chars": 1191,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/list-started-emulators.bat",
"chars": 1052,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/templates/cordova/lib/log.js",
"chars": 1982,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/run.js",
"chars": 6217,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/spawn.js",
"chars": 1753,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/start-emulator",
"chars": 1352,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/lib/start-emulator.bat",
"chars": 1036,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/templates/cordova/log",
"chars": 1225,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/log.bat",
"chars": 1006,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/templates/cordova/run",
"chars": 1351,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/run.bat",
"chars": 1006,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/templates/cordova/version",
"chars": 954,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/templates/cordova/version.bat",
"chars": 1015,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "bin/templates/project/Activity.java",
"chars": 1278,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "bin/templates/project/AndroidManifest.xml",
"chars": 2648,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or "
},
{
"path": "bin/templates/project/assets/www/css/index.css",
"chars": 3719,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOT"
},
{
"path": "bin/templates/project/assets/www/index.html",
"chars": 1778,
"preview": "<!DOCTYPE html>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agre"
},
{
"path": "bin/templates/project/assets/www/js/index.js",
"chars": 1915,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOT"
},
{
"path": "bin/templates/project/assets/www/main.js",
"chars": 5163,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "bin/templates/project/assets/www/master.css",
"chars": 2472,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "bin/templates/project/build.gradle",
"chars": 2282,
"preview": "import java.util.regex.Pattern\n\napply plugin: 'android'\n\nbuildscript {\n repositories {\n mavenCentral()\n }\n\n"
},
{
"path": "bin/templates/project/custom_rules.xml",
"chars": 1157,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project>\n <target name=\"-pre-compile\">\n <!-- Fix library references du"
},
{
"path": "bin/templates/project/eclipse-project",
"chars": 1098,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>__NAME__</name>\n\t<comment></comment>\n\t<projects>\n\t</p"
},
{
"path": "bin/templates/project/eclipse-project-CLI",
"chars": 2389,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>__NAME__</name>\n\t<comment></comment>\n\t<projects>\n\t</p"
},
{
"path": "bin/templates/project/gitignore",
"chars": 172,
"preview": "# Non-project-specific build files:\nbuild.xml\nlocal.properties\n/gradlew\n/gradlew.bat\n/gradle\n# Ant builds\nant-built\nant-"
},
{
"path": "bin/templates/project/project.properties",
"chars": 610,
"preview": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# T"
},
{
"path": "bin/templates/project/res/values/strings.xml",
"chars": 423,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <!-- App label shown within list of installed apps, battery & net"
},
{
"path": "bin/templates/project/settings.gradle",
"chars": 463,
"preview": "import java.util.regex.Pattern\n\ndef getProjectList() {\n def manifestFile = file(\"project.properties\")\n def pattern"
},
{
"path": "bin/update",
"chars": 1682,
"preview": "#!/usr/bin/env node\n\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor lic"
},
{
"path": "bin/update.bat",
"chars": 1007,
"preview": ":: Licensed to the Apache Software Foundation (ASF) under one\n:: or more contributor license agreements. See the NOTICE"
},
{
"path": "framework/AndroidManifest.xml",
"chars": 1112,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or "
},
{
"path": "framework/ant.properties",
"chars": 1567,
"preview": "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See "
},
{
"path": "framework/assets/www/cordova.js",
"chars": 61739,
"preview": "// Platform: android\n// 3.6.3\n/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor licens"
},
{
"path": "framework/assets/www/index.html",
"chars": 975,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. S"
},
{
"path": "framework/build.gradle",
"chars": 1571,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/build.xml",
"chars": 7613,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or "
},
{
"path": "framework/project.properties",
"chars": 560,
"preview": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# T"
},
{
"path": "framework/res/layout/main.xml",
"chars": 1267,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or "
},
{
"path": "framework/res/values/strings.xml",
"chars": 1003,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or "
},
{
"path": "framework/res/xml/config.xml",
"chars": 2466,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contrib"
},
{
"path": "framework/src/com/squareup/okhttp/Address.java",
"chars": 4799,
"preview": "/*\n * Copyright (C) 2012 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/Connection.java",
"chars": 11924,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the N"
},
{
"path": "framework/src/com/squareup/okhttp/ConnectionPool.java",
"chars": 9731,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the N"
},
{
"path": "framework/src/com/squareup/okhttp/Dispatcher.java",
"chars": 2861,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/Failure.java",
"chars": 1525,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/HttpResponseCache.java",
"chars": 24889,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/Job.java",
"chars": 8116,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/MediaType.java",
"chars": 3941,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/OkAuthenticator.java",
"chars": 3825,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/OkHttpClient.java",
"chars": 13918,
"preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/OkResponseCache.java",
"chars": 2117,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/Request.java",
"chars": 7653,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/Response.java",
"chars": 9701,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/ResponseSource.java",
"chars": 1181,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/Route.java",
"chars": 2976,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/RouteDatabase.java",
"chars": 2053,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/TunnelRequest.java",
"chars": 2720,
"preview": "/*\n * Copyright (C) 2012 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/AbstractOutputStream.java",
"chars": 1387,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/Base64.java",
"chars": 5366,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the N"
},
{
"path": "framework/src/com/squareup/okhttp/internal/DiskLruCache.java",
"chars": 30357,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/Dns.java",
"chars": 1093,
"preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/FaultRecoveringOutputStream.java",
"chars": 5433,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/NamedRunnable.java",
"chars": 1180,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/Platform.java",
"chars": 14108,
"preview": "/*\n * Copyright (C) 2012 Square, Inc.\n * Copyright (C) 2012 The Android Open Source Project\n *\n * Licensed under the Apa"
},
{
"path": "framework/src/com/squareup/okhttp/internal/StrictLineReader.java",
"chars": 7644,
"preview": "/*\n * Copyright (C) 2012 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/Util.java",
"chars": 12307,
"preview": "/*\n * Copyright (C) 2012 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/AbstractHttpInputStream.java",
"chars": 3585,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/HeaderParser.java",
"chars": 3332,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/HttpAuthenticator.java",
"chars": 6679,
"preview": "/*\n * Copyright (C) 2012 Square, Inc.\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apa"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/HttpDate.java",
"chars": 3308,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/HttpEngine.java",
"chars": 23992,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the N"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/HttpTransport.java",
"chars": 17386,
"preview": "/*\n * Copyright (C) 2012 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/HttpURLConnectionImpl.java",
"chars": 21028,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the N"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/HttpsEngine.java",
"chars": 2697,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the N"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/HttpsURLConnectionImpl.java",
"chars": 10996,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the N"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/OkResponseCacheAdapter.java",
"chars": 1915,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/Policy.java",
"chars": 1589,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/RawHeaders.java",
"chars": 15958,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the N"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/RequestHeaders.java",
"chars": 9248,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/ResponseHeaders.java",
"chars": 17069,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/RetryableOutputStream.java",
"chars": 2376,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/RouteSelector.java",
"chars": 9207,
"preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/SpdyTransport.java",
"chars": 3954,
"preview": "/*\n * Copyright (C) 2012 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/Transport.java",
"chars": 2519,
"preview": "/*\n * Copyright (C) 2012 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/http/UnknownLengthHttpInputStream.java",
"chars": 1911,
"preview": "/*\n * Copyright (C) 2012 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/ErrorCode.java",
"chars": 2222,
"preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/FrameReader.java",
"chars": 2416,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/FrameWriter.java",
"chars": 1911,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/HeadersMode.java",
"chars": 1455,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/Hpack.java",
"chars": 12898,
"preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/Http20Draft06.java",
"chars": 13797,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/IncomingStreamHandler.java",
"chars": 1335,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/NameValueBlockReader.java",
"chars": 4927,
"preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/Ping.java",
"chars": 2000,
"preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/Settings.java",
"chars": 5915,
"preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/Spdy3.java",
"chars": 18917,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/SpdyConnection.java",
"chars": 19330,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/SpdyStream.java",
"chars": 21319,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "framework/src/com/squareup/okhttp/internal/spdy/Variant.java",
"chars": 1246,
"preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
},
{
"path": "framework/src/com/squareup/okhttp/internal/tls/DistinguishedNameParser.java",
"chars": 11401,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the N"
},
{
"path": "framework/src/com/squareup/okhttp/internal/tls/OkHostnameVerifier.java",
"chars": 6541,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the N"
},
{
"path": "framework/src/org/apache/cordova/App.java",
"chars": 11028,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/AuthenticationToken.java",
"chars": 1787,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CallbackContext.java",
"chars": 4736,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/Config.java",
"chars": 3850,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/ConfigXmlParser.java",
"chars": 7697,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CordovaActivity.java",
"chars": 41834,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CordovaApplication.java",
"chars": 990,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CordovaArgs.java",
"chars": 3104,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CordovaBridge.java",
"chars": 7660,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CordovaChromeClient.java",
"chars": 12755,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CordovaInterface.java",
"chars": 2486,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CordovaPlugin.java",
"chars": 7911,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CordovaPreferences.java",
"chars": 6665,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CordovaResourceApi.java",
"chars": 17652,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CordovaUriHelper.java",
"chars": 3392,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CordovaWebView.java",
"chars": 31431,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/CordovaWebViewClient.java",
"chars": 9061,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/DirectoryManager.java",
"chars": 4924,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/DroidGap.java",
"chars": 1300,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/ExifHelper.java",
"chars": 7467,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/ExposedJsApi.java",
"chars": 2042,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/FileHelper.java",
"chars": 6379,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java",
"chars": 4328,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/JSONUtils.java",
"chars": 1461,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/LOG.java",
"chars": 5883,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/LinearLayoutSoftKeyboardDetect.java",
"chars": 4053,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/NativeToJsMessageQueue.java",
"chars": 20249,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/PluginEntry.java",
"chars": 2813,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/PluginManager.java",
"chars": 12655,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/PluginResult.java",
"chars": 5951,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/ScrollEvent.java",
"chars": 1613,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/src/org/apache/cordova/Whitelist.java",
"chars": 6777,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/test/org/apache/cordova/PreferenceNodeTest.java",
"chars": 2046,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "framework/test/org/apache/cordova/PreferenceSetTest.java",
"chars": 2428,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "package.json",
"chars": 660,
"preview": "{\n \"name\": \"cordova-android\",\n \"version\": \"3.6.3\",\n \"description\": \"cordova-android release\",\n \"main\": \"bin/"
},
{
"path": "spec/create.spec.js",
"chars": 2509,
"preview": "/**\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See the "
},
{
"path": "test/AndroidManifest.xml",
"chars": 12996,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- \n Licensed to the Apache Software Foundation (ASF) under one\n or"
},
{
"path": "test/README.md",
"chars": 1932,
"preview": "<!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the N"
},
{
"path": "test/ant.properties",
"chars": 696,
"preview": "# This file is used to override default values used by the Ant build system.\n#\n# This file must be checked in Version Co"
},
{
"path": "test/assets/www/backbuttonmultipage/index.html",
"chars": 1740,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/backbuttonmultipage/sample2.html",
"chars": 1739,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/backbuttonmultipage/sample3.html",
"chars": 1953,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/background/index.html",
"chars": 3337,
"preview": "<!DOCTYPE HTML>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor li"
},
{
"path": "test/assets/www/background/index2.html",
"chars": 3447,
"preview": "<!DOCTYPE HTML>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor li"
},
{
"path": "test/assets/www/backgroundcolor/index.html",
"chars": 1749,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/basicauth/index.html",
"chars": 1845,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/cordova_plugins.js",
"chars": 882,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See the NOTICE "
},
{
"path": "test/assets/www/fullscreen/index.html",
"chars": 1765,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/htmlnotfound/error.html",
"chars": 1721,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/iframe/index.html",
"chars": 2238,
"preview": "<!DOCTYPE HTML>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor li"
},
{
"path": "test/assets/www/iframe/index2.html",
"chars": 1824,
"preview": "<!DOCTYPE HTML>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor li"
},
{
"path": "test/assets/www/index.html",
"chars": 4007,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/jqmtabbackbutton/index.html",
"chars": 2481,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/jqmtabbackbutton/tab1.html",
"chars": 1671,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/jqmtabbackbutton/tab2.html",
"chars": 1672,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/jqmtabbackbutton/tab3.html",
"chars": 1672,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/lifecycle/index.html",
"chars": 3654,
"preview": "<!DOCTYPE HTML>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor li"
},
{
"path": "test/assets/www/lifecycle/index2.html",
"chars": 3853,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/main.js",
"chars": 4864,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "test/assets/www/master.css",
"chars": 2922,
"preview": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See"
},
{
"path": "test/assets/www/menus/index.html",
"chars": 1858,
"preview": "<!DOCTYPE HTML>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor li"
},
{
"path": "test/assets/www/splashscreen/index.html",
"chars": 1707,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
},
{
"path": "test/assets/www/userwebview/index.html",
"chars": 2529,
"preview": "<!--\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements"
}
]
// ... and 80 more files (download for full content)
About this extraction
This page contains the full source code of the crosswalk-project/crosswalk-cordova-android GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 280 files (1.2 MB), approximately 287.5k tokens, and a symbol index with 1815 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.