Since a single socket's output stream may be used to write multiple HTTP
26 | * requests to the same server, subclasses should not close the socket stream.
27 | */
28 | public abstract class AbstractOutputStream extends OutputStream {
29 | protected boolean closed;
30 |
31 | @Override public final void write(int data) throws IOException {
32 | write(new byte[] { (byte) data });
33 | }
34 |
35 | protected final void checkNotClosed() throws IOException {
36 | if (closed) {
37 | throw new IOException("stream closed");
38 | }
39 | }
40 |
41 | /** Returns true if this stream was closed locally. */
42 | public boolean isClosed() {
43 | return closed;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/platforms/android/CordovaLib/src/com/squareup/okhttp/internal/Dns.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 Square, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.squareup.okhttp.internal;
17 |
18 | import java.net.InetAddress;
19 | import java.net.UnknownHostException;
20 |
21 | /**
22 | * Domain name service. Prefer this over {@link InetAddress#getAllByName} to
23 | * make code more testable.
24 | */
25 | public interface Dns {
26 | Dns DEFAULT = new Dns() {
27 | @Override public InetAddress[] getAllByName(String host) throws UnknownHostException {
28 | return InetAddress.getAllByName(host);
29 | }
30 | };
31 |
32 | InetAddress[] getAllByName(String host) throws UnknownHostException;
33 | }
34 |
--------------------------------------------------------------------------------
/platforms/android/CordovaLib/src/com/squareup/okhttp/internal/NamedRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Square, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.squareup.okhttp.internal;
18 |
19 | /**
20 | * Runnable implementation which always sets its thread name.
21 | */
22 | public abstract class NamedRunnable implements Runnable {
23 | private final String name;
24 |
25 | public NamedRunnable(String format, Object... args) {
26 | this.name = String.format(format, args);
27 | }
28 |
29 | @Override public final void run() {
30 | String oldName = Thread.currentThread().getName();
31 | Thread.currentThread().setName(name);
32 | try {
33 | execute();
34 | } finally {
35 | Thread.currentThread().setName(oldName);
36 | }
37 | }
38 |
39 | protected abstract void execute();
40 | }
41 |
--------------------------------------------------------------------------------
/platforms/android/CordovaLib/src/com/squareup/okhttp/internal/spdy/HeadersMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Square, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.squareup.okhttp.internal.spdy;
17 |
18 | enum HeadersMode {
19 | SPDY_SYN_STREAM,
20 | SPDY_REPLY,
21 | SPDY_HEADERS,
22 | HTTP_20_HEADERS;
23 |
24 | /** Returns true if it is an error these headers to create a new stream. */
25 | public boolean failIfStreamAbsent() {
26 | return this == SPDY_REPLY || this == SPDY_HEADERS;
27 | }
28 |
29 | /** Returns true if it is an error these headers to update an existing stream. */
30 | public boolean failIfStreamPresent() {
31 | return this == SPDY_SYN_STREAM;
32 | }
33 |
34 | /**
35 | * Returns true if it is an error these headers to be the initial headers of a
36 | * response.
37 | */
38 | public boolean failIfHeadersAbsent() {
39 | return this == SPDY_HEADERS;
40 | }
41 |
42 | /**
43 | * Returns true if it is an error these headers to be update existing headers
44 | * of a response.
45 | */
46 | public boolean failIfHeadersPresent() {
47 | return this == SPDY_REPLY;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/platforms/android/CordovaLib/src/com/squareup/okhttp/internal/spdy/IncomingStreamHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.squareup.okhttp.internal.spdy;
18 |
19 | import java.io.IOException;
20 |
21 | /** Listener to be notified when a connected peer creates a new stream. */
22 | public interface IncomingStreamHandler {
23 | IncomingStreamHandler REFUSE_INCOMING_STREAMS = new IncomingStreamHandler() {
24 | @Override public void receive(SpdyStream stream) throws IOException {
25 | stream.close(ErrorCode.REFUSED_STREAM);
26 | }
27 | };
28 |
29 | /**
30 | * Handle a new stream from this connection's peer. Implementations should
31 | * respond by either {@link SpdyStream#reply replying to the stream} or
32 | * {@link SpdyStream#close closing it}. This response does not need to be
33 | * synchronous.
34 | */
35 | void receive(SpdyStream stream) throws IOException;
36 | }
37 |
--------------------------------------------------------------------------------
/platforms/android/CordovaLib/src/com/squareup/okhttp/internal/spdy/Variant.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Square, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.squareup.okhttp.internal.spdy;
17 |
18 | import java.io.InputStream;
19 | import java.io.OutputStream;
20 |
21 | /** A version and dialect of the framed socket protocol. */
22 | interface Variant {
23 | Variant SPDY3 = new Spdy3();
24 | Variant HTTP_20_DRAFT_06 = new Http20Draft06();
25 |
26 | /**
27 | * @param client true if this is the HTTP client's reader, reading frames from
28 | * a peer SPDY or HTTP/2 server.
29 | */
30 | FrameReader newReader(InputStream in, boolean client);
31 |
32 | /**
33 | * @param client true if this is the HTTP client's writer, writing frames to a
34 | * peer SPDY or HTTP/2 server.
35 | */
36 | FrameWriter newWriter(OutputStream out, boolean client);
37 | }
38 |
--------------------------------------------------------------------------------
/platforms/android/CordovaLib/src/org/apache/cordova/DroidGap.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | package org.apache.cordova;
21 |
22 | /**
23 | * This used to be the class that should be extended by application
24 | * developers, but everything has been moved to CordovaActivity. So
25 | * you should extend CordovaActivity instead of DroidGap. This class
26 | * will be removed at a future time.
27 | *
28 | * @see CordovaActivity
29 | * @deprecated
30 | */
31 | @Deprecated
32 | public class DroidGap extends CordovaActivity {
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/platforms/android/CordovaLib/src/org/apache/cordova/JSONUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | import java.util.ArrayList;
22 | import java.util.List;
23 |
24 | import org.json.JSONArray;
25 | import org.json.JSONException;
26 |
27 | @Deprecated // Deprecated in 3.1. To be removed in 4.0.
28 | public class JSONUtils {
29 | public static List toStringList(JSONArray array) throws JSONException {
30 | if(array == null) {
31 | return null;
32 | }
33 | else {
34 | List list = new ArrayList();
35 |
36 | for (int i = 0; i < array.length(); i++) {
37 | list.add(array.get(i).toString());
38 | }
39 |
40 | return list;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/platforms/android/assets/_where-is-www.txt:
--------------------------------------------------------------------------------
1 | To show `assets/www` or `res/xml/config.xml`, go to:
2 | Project -> Properties -> Resource -> Resource Filters
3 | And delete the exclusion filter.
4 |
--------------------------------------------------------------------------------
/platforms/android/assets/www/char_detail.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/arrow.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/back.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/background.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/bg.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/bga.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/bga.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/client.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/client.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/disconnect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/disconnect.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/dot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/dot.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/indexBg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/indexBg.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/logo.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/pair.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/pair.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/prev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/prev.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/refresh.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/searching.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/searching.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/service.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/word.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/word.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/img/word1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/assets/www/img/word1.png
--------------------------------------------------------------------------------
/platforms/android/assets/www/plugins/org/www/org.bluetooth.service/blood_pressure.js:
--------------------------------------------------------------------------------
1 | cordova.define("org.bluetooth.service.blood_pressure", function(require, exports, module) { /*
2 | Copyright 2013-2014, JUMA Technology
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | var BC = require("org.bcsphere.bcjs");
18 |
19 | var BloodPressureService = BC.BloodPressureService = BC.Service.extend({
20 |
21 | /* org.bluetooth.characteristic.blood_pressure_measurement */
22 | BloodPressureMeasurementUUID:'2a35',
23 | /* org.bluetooth.characteristic.intermediate_cuff_pressure */
24 | IntermediateCuffPressureUUID:'2a36',
25 | /* org.bluetooth.characteristic.blood_pressure_feature */
26 | BloodPressureFeatureUUID:'2a49',
27 |
28 | //ToDo
29 | });
30 |
31 | document.addEventListener('bccoreready',function(){
32 | BC.bluetooth.UUIDMap["00001810-0000-1000-8000-00805f9b34fb"] = BC.BloodPressureService;
33 | });
34 | module.exports = BC;
35 | });
36 |
--------------------------------------------------------------------------------
/platforms/android/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/platforms/android/bin/BCExplorer.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/bin/BCExplorer.apk
--------------------------------------------------------------------------------
/platforms/android/cordova/android_sdk_version:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var android_sdk_version = require('./lib/android_sdk_version');
23 |
24 | android_sdk_version.run().done(null, function(err) {
25 | console.log(err);
26 | process.exit(2);
27 | });
28 |
29 |
30 |
--------------------------------------------------------------------------------
/platforms/android/cordova/build:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var build = require('./lib/build'),
23 | reqs = require('./lib/check_reqs'),
24 | args = process.argv;
25 |
26 | // Support basic help commands
27 | if(args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
28 | args[2] == 'help' || args[2] == '-help' || args[2] == '/help') {
29 | build.help();
30 | } else {
31 | reqs.run().then(function() {
32 | return build.run(args[2]);
33 | }).done(null, function(err) {
34 | console.error(err);
35 | process.exit(2);
36 | });
37 | }
38 |
--------------------------------------------------------------------------------
/platforms/android/cordova/build.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0build"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'build' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/platforms/android/cordova/check_reqs:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var check_reqs = require('./lib/check_reqs');
23 |
24 | check_reqs.run().done(
25 | function success() {
26 | console.log('Looks like your environment fully supports cordova-android development!');
27 | }, function fail(err) {
28 | console.log(err);
29 | process.exit(2);
30 | }
31 | );
32 |
--------------------------------------------------------------------------------
/platforms/android/cordova/clean:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var clean = require('./lib/clean'),
23 | reqs = require('./lib/check_reqs'),
24 | args = process.argv;
25 |
26 | // Usage support for when args are given
27 | if(args.length > 2) {
28 | clean.help();
29 | } else {
30 | reqs.run().done(function() {
31 | return clean.run();
32 | }, function(err) {
33 | console.error('ERROR: ' + err);
34 | process.exit(2);
35 | });
36 | }
37 |
--------------------------------------------------------------------------------
/platforms/android/cordova/clean.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0clean"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'clean' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/platforms/android/cordova/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/clean.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var build = require('./build'),
23 | spawn = require('./spawn'),
24 | path = require('path');
25 |
26 | /*
27 | * Cleans the project using ant
28 | * Returns a promise.
29 | */
30 | module.exports.run = function() {
31 | var args = build.getAntArgs('clean');
32 | return spawn('ant', args);
33 | }
34 |
35 | module.exports.help = function() {
36 | console.log('Usage: ' + path.relative(process.cwd(), process.argv[1]));
37 | console.log('Cleans the project directory.');
38 | process.exit(0);
39 | }
40 |
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/exec.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var child_process = require('child_process'),
23 | Q = require('q');
24 |
25 | // Takes a command and optional current working directory.
26 | // Returns a promise that either resolves with the stdout, or
27 | // rejects with an error message and the stderr.
28 | module.exports = function(cmd, opt_cwd) {
29 | var d = Q.defer();
30 | try {
31 | child_process.exec(cmd, {cwd: opt_cwd, maxBuffer: 1024000}, function(err, stdout, stderr) {
32 | if (err) d.reject('Error executing "' + cmd + '": ' + stderr);
33 | else d.resolve(stdout);
34 | });
35 | } catch(e) {
36 | console.error('error caught: ' + e);
37 | d.reject(e);
38 | }
39 | return d.promise;
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/install-device:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var device = require('./device'),
23 | args = process.argv;
24 |
25 | if(args.length > 2) {
26 | var install_target;
27 | if (args[2].substring(0, 9) == '--target=') {
28 | install_target = args[2].substring(9, args[2].length);
29 | device.install(install_target).done(null, function(err) {
30 | console.error('ERROR: ' + err);
31 | process.exit(2);
32 | });
33 | } else {
34 | console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
35 | process.exit(2);
36 | }
37 | } else {
38 | device.install().done(null, function(err) {
39 | console.error('ERROR: ' + err);
40 | process.exit(2);
41 | });
42 | }
43 |
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/install-device.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0install-device"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'install-device' script in 'cordova\lib' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/install-emulator:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var emulator = require('./emulator'),
23 | args = process.argv;
24 |
25 | var install_target;
26 | if(args.length > 2) {
27 | if (args[2].substring(0, 9) == '--target=') {
28 | install_target = args[2].substring(9, args[2].length);
29 | } else {
30 | console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
31 | process.exit(2);
32 | }
33 | }
34 |
35 | emulator.install(install_target).done(null, function(err) {
36 | console.error('ERROR: ' + err);
37 | process.exit(2);
38 | });
39 |
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/install-emulator.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0install-emulator"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'install-emulator' script in 'cordova\lib' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/list-devices:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var devices = require('./device');
23 |
24 | // Usage support for when args are given
25 | devices.list().done(function(device_list) {
26 | device_list && device_list.forEach(function(dev) {
27 | console.log(dev);
28 | });
29 | }, function(err) {
30 | console.error('ERROR: ' + err);
31 | process.exit(2);
32 | });
33 |
34 |
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/list-devices.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0list-devices"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'list-devices' script in 'cordova\lib' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/list-emulator-images:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var emulators = require('./emulator');
23 |
24 | // Usage support for when args are given
25 | emulators.list_images().done(function(emulator_list) {
26 | emulator_list && emulator_list.forEach(function(emu) {
27 | console.log(emu.name);
28 | });
29 | }, function(err) {
30 | console.error('ERROR: ' + err);
31 | process.exit(2);
32 | });
33 |
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/list-emulator-images.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0list-emulator-images"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'list-emulator-images' script in 'cordova\lib' folder, aborting...>&2
25 | EXIT /B 1
26 | )
27 |
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/list-started-emulators:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var emulators = require('./emulator');
23 |
24 | // Usage support for when args are given
25 | emulators.list_started().done(function(emulator_list) {
26 | emulator_list && emulator_list.forEach(function(emu) {
27 | console.log(emu);
28 | });
29 | }, function(err) {
30 | console.error('ERROR: ' + err);
31 | process.exit(2);
32 | });
33 |
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/list-started-emulators.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0list-started-emulators"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'list-started-emulators' script in 'cordova\lib' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/start-emulator:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var emulator = require('./emulator'),
23 | args = process.argv;
24 |
25 | var install_target;
26 | if(args.length > 2) {
27 | if (args[2].substring(0, 9) == '--target=') {
28 | install_target = args[2].substring(9, args[2].length);
29 | } else {
30 | console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
31 | process.exit(2);
32 | }
33 | }
34 |
35 | emulator.start(install_target).done(null, function(err) {
36 | console.error('ERROR: ' + err);
37 | process.exit(2);
38 | });
39 |
40 |
--------------------------------------------------------------------------------
/platforms/android/cordova/lib/start-emulator.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0start-emulator"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'start-emulator' script in 'cordova\lib' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/platforms/android/cordova/log:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var log = require('./lib/log'),
23 | reqs = require('./lib/check_reqs'),
24 | args = process.argv;
25 |
26 | // Usage support for when args are given
27 | if(args.length > 2) {
28 | log.help();
29 | } else {
30 | reqs.run().done(function() {
31 | return log.run();
32 | }, function(err) {
33 | console.error('ERROR: ' + err);
34 | process.exit(2);
35 | });
36 | }
37 |
--------------------------------------------------------------------------------
/platforms/android/cordova/log.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0log"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'log' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/q/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Copyright 2009–2012 Kristopher Michael Kowal. All rights reserved.
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to
5 | deal in the Software without restriction, including without limitation the
6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 | sell copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19 | IN THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/q/benchmark/scenarios.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var Q = require("../q");
4 |
5 | suite("Chaining", function () {
6 | var numberToChain = 1000;
7 |
8 | bench("Chaining many already-fulfilled promises together", function (done) {
9 | var currentPromise = Q();
10 | for (var i = 0; i < numberToChain; ++i) {
11 | currentPromise = currentPromise.then(function () {
12 | return Q();
13 | });
14 | }
15 |
16 | currentPromise.then(done);
17 | });
18 |
19 | bench("Chaining and then fulfilling the end of the chain", function (done) {
20 | var deferred = Q.defer();
21 |
22 | var currentPromise = deferred.promise;
23 | for (var i = 0; i < numberToChain; ++i) {
24 | (function () {
25 | var promiseToReturn = currentPromise;
26 | currentPromise = Q().then(function () {
27 | return promiseToReturn;
28 | });
29 | }());
30 | }
31 |
32 | currentPromise.then(done);
33 |
34 | deferred.resolve();
35 | });
36 | });
37 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/q/queue.js:
--------------------------------------------------------------------------------
1 |
2 | var Q = require("./q");
3 |
4 | module.exports = Queue;
5 | function Queue() {
6 | var ends = Q.defer();
7 | var closed = Q.defer();
8 | return {
9 | put: function (value) {
10 | var next = Q.defer();
11 | ends.resolve({
12 | head: value,
13 | tail: next.promise
14 | });
15 | ends.resolve = next.resolve;
16 | },
17 | get: function () {
18 | var result = ends.promise.get("head");
19 | ends.promise = ends.promise.get("tail");
20 | return result.fail(function (error) {
21 | closed.resolve(error);
22 | throw error;
23 | });
24 | },
25 | closed: closed.promise,
26 | close: function (error) {
27 | error = error || new Error("Can't get value from closed queue");
28 | var end = {head: Q.reject(error)};
29 | end.tail = end;
30 | ends.resolve(end);
31 | return closed.promise;
32 | }
33 | };
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/.documentup.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ShellJS",
3 | "twitter": [
4 | "r2r"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "loopfunc": true,
3 | "sub": true,
4 | "undef": true,
5 | "unused": true,
6 | "node": true
7 | }
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/.npmignore:
--------------------------------------------------------------------------------
1 | test/
2 | tmp/
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "0.8"
4 | - "0.10"
5 | - "0.11"
6 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012, Artur Adib
2 | All rights reserved.
3 |
4 | You may use this project under the terms of the New BSD license as follows:
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 | * Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in the
12 | documentation and/or other materials provided with the distribution.
13 | * Neither the name of Artur Adib nor the
14 | names of the contributors may be used to endorse or promote products
15 | derived from this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY
21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/bin/shjs:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | require('../global');
3 |
4 | if (process.argv.length < 3) {
5 | console.log('ShellJS: missing argument (script name)');
6 | console.log();
7 | process.exit(1);
8 | }
9 |
10 | var args,
11 | scriptName = process.argv[2];
12 | env['NODE_PATH'] = __dirname + '/../..';
13 |
14 | if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) {
15 | if (test('-f', scriptName + '.js'))
16 | scriptName += '.js';
17 | if (test('-f', scriptName + '.coffee'))
18 | scriptName += '.coffee';
19 | }
20 |
21 | if (!test('-f', scriptName)) {
22 | console.log('ShellJS: script not found ('+scriptName+')');
23 | console.log();
24 | process.exit(1);
25 | }
26 |
27 | args = process.argv.slice(3);
28 |
29 | for (var i = 0, l = args.length; i < l; i++) {
30 | if (args[i][0] !== "-"){
31 | args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words
32 | }
33 | }
34 |
35 | if (scriptName.match(/\.coffee$/)) {
36 | //
37 | // CoffeeScript
38 | //
39 | if (which('coffee')) {
40 | exec('coffee ' + scriptName + ' ' + args.join(' '), { async: true });
41 | } else {
42 | console.log('ShellJS: CoffeeScript interpreter not found');
43 | console.log();
44 | process.exit(1);
45 | }
46 | } else {
47 | //
48 | // JavaScript
49 | //
50 | exec('node ' + scriptName + ' ' + args.join(' '), { async: true });
51 | }
52 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/global.js:
--------------------------------------------------------------------------------
1 | var shell = require('./shell.js');
2 | for (var cmd in shell)
3 | global[cmd] = shell[cmd];
4 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/make.js:
--------------------------------------------------------------------------------
1 | require('./global');
2 |
3 | global.config.fatal = true;
4 | global.target = {};
5 |
6 | // This ensures we only execute the script targets after the entire script has
7 | // been evaluated
8 | var args = process.argv.slice(2);
9 | setTimeout(function() {
10 | var t;
11 |
12 | if (args.length === 1 && args[0] === '--help') {
13 | console.log('Available targets:');
14 | for (t in global.target)
15 | console.log(' ' + t);
16 | return;
17 | }
18 |
19 | // Wrap targets to prevent duplicate execution
20 | for (t in global.target) {
21 | (function(t, oldTarget){
22 |
23 | // Wrap it
24 | global.target[t] = function(force) {
25 | if (oldTarget.done && !force)
26 | return;
27 | oldTarget.done = true;
28 | return oldTarget.apply(oldTarget, arguments);
29 | };
30 |
31 | })(t, global.target[t]);
32 | }
33 |
34 | // Execute desired targets
35 | if (args.length > 0) {
36 | args.forEach(function(arg) {
37 | if (arg in global.target)
38 | global.target[arg]();
39 | else {
40 | console.log('no such target: ' + arg);
41 | }
42 | });
43 | } else if ('all' in global.target) {
44 | global.target.all();
45 | }
46 |
47 | }, 0);
48 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/scripts/generate-docs.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | require('../global');
3 |
4 | echo('Appending docs to README.md');
5 |
6 | cd(__dirname + '/..');
7 |
8 | // Extract docs from shell.js
9 | var docs = grep('//@', 'shell.js');
10 |
11 | docs = docs.replace(/\/\/\@include (.+)/g, function(match, path) {
12 | var file = path.match('.js$') ? path : path+'.js';
13 | return grep('//@', file);
14 | });
15 |
16 | // Remove '//@'
17 | docs = docs.replace(/\/\/\@ ?/g, '');
18 | // Append docs to README
19 | sed('-i', /## Command reference(.|\n)*/, '## Command reference\n\n' + docs, 'README.md');
20 |
21 | echo('All done.');
22 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/scripts/run-tests.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | require('../global');
3 |
4 | var path = require('path');
5 |
6 | var failed = false;
7 |
8 | //
9 | // Lint
10 | //
11 | JSHINT_BIN = './node_modules/jshint/bin/jshint';
12 | cd(__dirname + '/..');
13 |
14 | if (!test('-f', JSHINT_BIN)) {
15 | echo('JSHint not found. Run `npm install` in the root dir first.');
16 | exit(1);
17 | }
18 |
19 | if (exec(JSHINT_BIN + ' *.js test/*.js').code !== 0) {
20 | failed = true;
21 | echo('*** JSHINT FAILED! (return code != 0)');
22 | echo();
23 | } else {
24 | echo('All JSHint tests passed');
25 | echo();
26 | }
27 |
28 | //
29 | // Unit tests
30 | //
31 | cd(__dirname + '/../test');
32 | ls('*.js').forEach(function(file) {
33 | echo('Running test:', file);
34 | if (exec('node ' + file).code !== 123) { // 123 avoids false positives (e.g. premature exit)
35 | failed = true;
36 | echo('*** TEST FAILED! (missing exit code "123")');
37 | echo();
38 | }
39 | });
40 |
41 | if (failed) {
42 | echo();
43 | echo('*******************************************************');
44 | echo('WARNING: Some tests did not pass!');
45 | echo('*******************************************************');
46 | exit(1);
47 | } else {
48 | echo();
49 | echo('All tests passed.');
50 | }
51 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/cat.js:
--------------------------------------------------------------------------------
1 | var common = require('./common');
2 | var fs = require('fs');
3 |
4 | //@
5 | //@ ### cat(file [, file ...])
6 | //@ ### cat(file_array)
7 | //@
8 | //@ Examples:
9 | //@
10 | //@ ```javascript
11 | //@ var str = cat('file*.txt');
12 | //@ var str = cat('file1', 'file2');
13 | //@ var str = cat(['file1', 'file2']); // same as above
14 | //@ ```
15 | //@
16 | //@ Returns a string containing the given file, or a concatenated string
17 | //@ containing the files if more than one file is given (a new line character is
18 | //@ introduced between each file). Wildcard `*` accepted.
19 | function _cat(options, files) {
20 | var cat = '';
21 |
22 | if (!files)
23 | common.error('no paths given');
24 |
25 | if (typeof files === 'string')
26 | files = [].slice.call(arguments, 1);
27 | // if it's array leave it as it is
28 |
29 | files = common.expand(files);
30 |
31 | files.forEach(function(file) {
32 | if (!fs.existsSync(file))
33 | common.error('no such file or directory: ' + file);
34 |
35 | cat += fs.readFileSync(file, 'utf8') + '\n';
36 | });
37 |
38 | if (cat[cat.length-1] === '\n')
39 | cat = cat.substring(0, cat.length-1);
40 |
41 | return common.ShellString(cat);
42 | }
43 | module.exports = _cat;
44 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/cd.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var common = require('./common');
3 |
4 | //@
5 | //@ ### cd('dir')
6 | //@ Changes to directory `dir` for the duration of the script
7 | function _cd(options, dir) {
8 | if (!dir)
9 | common.error('directory not specified');
10 |
11 | if (!fs.existsSync(dir))
12 | common.error('no such file or directory: ' + dir);
13 |
14 | if (!fs.statSync(dir).isDirectory())
15 | common.error('not a directory: ' + dir);
16 |
17 | process.chdir(dir);
18 | }
19 | module.exports = _cd;
20 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/echo.js:
--------------------------------------------------------------------------------
1 | var common = require('./common');
2 |
3 | //@
4 | //@ ### echo(string [,string ...])
5 | //@
6 | //@ Examples:
7 | //@
8 | //@ ```javascript
9 | //@ echo('hello world');
10 | //@ var str = echo('hello world');
11 | //@ ```
12 | //@
13 | //@ Prints string to stdout, and returns string with additional utility methods
14 | //@ like `.to()`.
15 | function _echo() {
16 | var messages = [].slice.call(arguments, 0);
17 | console.log.apply(this, messages);
18 | return common.ShellString(messages.join(' '));
19 | }
20 | module.exports = _echo;
21 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/error.js:
--------------------------------------------------------------------------------
1 | var common = require('./common');
2 |
3 | //@
4 | //@ ### error()
5 | //@ Tests if error occurred in the last command. Returns `null` if no error occurred,
6 | //@ otherwise returns string explaining the error
7 | function error() {
8 | return common.state.error;
9 | };
10 | module.exports = error;
11 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/find.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var common = require('./common');
3 | var _ls = require('./ls');
4 |
5 | //@
6 | //@ ### find(path [,path ...])
7 | //@ ### find(path_array)
8 | //@ Examples:
9 | //@
10 | //@ ```javascript
11 | //@ find('src', 'lib');
12 | //@ find(['src', 'lib']); // same as above
13 | //@ find('.').filter(function(file) { return file.match(/\.js$/); });
14 | //@ ```
15 | //@
16 | //@ Returns array of all files (however deep) in the given paths.
17 | //@
18 | //@ The main difference from `ls('-R', path)` is that the resulting file names
19 | //@ include the base directories, e.g. `lib/resources/file1` instead of just `file1`.
20 | function _find(options, paths) {
21 | if (!paths)
22 | common.error('no path specified');
23 | else if (typeof paths === 'object')
24 | paths = paths; // assume array
25 | else if (typeof paths === 'string')
26 | paths = [].slice.call(arguments, 1);
27 |
28 | var list = [];
29 |
30 | function pushFile(file) {
31 | if (common.platform === 'win')
32 | file = file.replace(/\\/g, '/');
33 | list.push(file);
34 | }
35 |
36 | // why not simply do ls('-R', paths)? because the output wouldn't give the base dirs
37 | // to get the base dir in the output, we need instead ls('-R', 'dir/*') for every directory
38 |
39 | paths.forEach(function(file) {
40 | pushFile(file);
41 |
42 | if (fs.statSync(file).isDirectory()) {
43 | _ls('-RA', file+'/*').forEach(function(subfile) {
44 | pushFile(subfile);
45 | });
46 | }
47 | });
48 |
49 | return list;
50 | }
51 | module.exports = _find;
52 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/grep.js:
--------------------------------------------------------------------------------
1 | var common = require('./common');
2 | var fs = require('fs');
3 |
4 | //@
5 | //@ ### grep([options ,] regex_filter, file [, file ...])
6 | //@ ### grep([options ,] regex_filter, file_array)
7 | //@ Available options:
8 | //@
9 | //@ + `-v`: Inverse the sense of the regex and print the lines not matching the criteria.
10 | //@
11 | //@ Examples:
12 | //@
13 | //@ ```javascript
14 | //@ grep('-v', 'GLOBAL_VARIABLE', '*.js');
15 | //@ grep('GLOBAL_VARIABLE', '*.js');
16 | //@ ```
17 | //@
18 | //@ Reads input string from given files and returns a string containing all lines of the
19 | //@ file that match the given `regex_filter`. Wildcard `*` accepted.
20 | function _grep(options, regex, files) {
21 | options = common.parseOptions(options, {
22 | 'v': 'inverse'
23 | });
24 |
25 | if (!files)
26 | common.error('no paths given');
27 |
28 | if (typeof files === 'string')
29 | files = [].slice.call(arguments, 2);
30 | // if it's array leave it as it is
31 |
32 | files = common.expand(files);
33 |
34 | var grep = '';
35 | files.forEach(function(file) {
36 | if (!fs.existsSync(file)) {
37 | common.error('no such file or directory: ' + file, true);
38 | return;
39 | }
40 |
41 | var contents = fs.readFileSync(file, 'utf8'),
42 | lines = contents.split(/\r*\n/);
43 | lines.forEach(function(line) {
44 | var matched = line.match(regex);
45 | if ((options.inverse && !matched) || (!options.inverse && matched))
46 | grep += line + '\n';
47 | });
48 | });
49 |
50 | return common.ShellString(grep);
51 | }
52 | module.exports = _grep;
53 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/popd.js:
--------------------------------------------------------------------------------
1 | // see dirs.js
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/pushd.js:
--------------------------------------------------------------------------------
1 | // see dirs.js
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/pwd.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | var common = require('./common');
3 |
4 | //@
5 | //@ ### pwd()
6 | //@ Returns the current directory.
7 | function _pwd(options) {
8 | var pwd = path.resolve(process.cwd());
9 | return common.ShellString(pwd);
10 | }
11 | module.exports = _pwd;
12 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/sed.js:
--------------------------------------------------------------------------------
1 | var common = require('./common');
2 | var fs = require('fs');
3 |
4 | //@
5 | //@ ### sed([options ,] search_regex, replace_str, file)
6 | //@ Available options:
7 | //@
8 | //@ + `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_
9 | //@
10 | //@ Examples:
11 | //@
12 | //@ ```javascript
13 | //@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js');
14 | //@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js');
15 | //@ ```
16 | //@
17 | //@ Reads an input string from `file` and performs a JavaScript `replace()` on the input
18 | //@ using the given search regex and replacement string. Returns the new string after replacement.
19 | function _sed(options, regex, replacement, file) {
20 | options = common.parseOptions(options, {
21 | 'i': 'inplace'
22 | });
23 |
24 | if (typeof replacement === 'string')
25 | replacement = replacement; // no-op
26 | else if (typeof replacement === 'number')
27 | replacement = replacement.toString(); // fallback
28 | else
29 | common.error('invalid replacement string');
30 |
31 | if (!file)
32 | common.error('no file given');
33 |
34 | if (!fs.existsSync(file))
35 | common.error('no such file or directory: ' + file);
36 |
37 | var result = fs.readFileSync(file, 'utf8').replace(regex, replacement);
38 | if (options.inplace)
39 | fs.writeFileSync(file, result, 'utf8');
40 |
41 | return common.ShellString(result);
42 | }
43 | module.exports = _sed;
44 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/to.js:
--------------------------------------------------------------------------------
1 | var common = require('./common');
2 | var fs = require('fs');
3 | var path = require('path');
4 |
5 | //@
6 | //@ ### 'string'.to(file)
7 | //@
8 | //@ Examples:
9 | //@
10 | //@ ```javascript
11 | //@ cat('input.txt').to('output.txt');
12 | //@ ```
13 | //@
14 | //@ Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as
15 | //@ those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_
16 | function _to(options, file) {
17 | if (!file)
18 | common.error('wrong arguments');
19 |
20 | if (!fs.existsSync( path.dirname(file) ))
21 | common.error('no such file or directory: ' + path.dirname(file));
22 |
23 | try {
24 | fs.writeFileSync(file, this.toString(), 'utf8');
25 | } catch(e) {
26 | common.error('could not write to file (code '+e.code+'): '+file, true);
27 | }
28 | }
29 | module.exports = _to;
30 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/toEnd.js:
--------------------------------------------------------------------------------
1 | var common = require('./common');
2 | var fs = require('fs');
3 | var path = require('path');
4 |
5 | //@
6 | //@ ### 'string'.toEnd(file)
7 | //@
8 | //@ Examples:
9 | //@
10 | //@ ```javascript
11 | //@ cat('input.txt').toEnd('output.txt');
12 | //@ ```
13 | //@
14 | //@ Analogous to the redirect-and-append operator `>>` in Unix, but works with JavaScript strings (such as
15 | //@ those returned by `cat`, `grep`, etc).
16 | function _toEnd(options, file) {
17 | if (!file)
18 | common.error('wrong arguments');
19 |
20 | if (!fs.existsSync( path.dirname(file) ))
21 | common.error('no such file or directory: ' + path.dirname(file));
22 |
23 | try {
24 | fs.appendFileSync(file, this.toString(), 'utf8');
25 | } catch(e) {
26 | common.error('could not append to file (code '+e.code+'): '+file, true);
27 | }
28 | }
29 | module.exports = _toEnd;
30 |
--------------------------------------------------------------------------------
/platforms/android/cordova/run:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var run = require('./lib/run'),
23 | reqs = require('./lib/check_reqs'),
24 | args = process.argv;
25 |
26 | // Support basic help commands
27 | if (args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
28 | args[2] == 'help' || args[2] == '-help' || args[2] == '/help') {
29 | run.help();
30 | } else {
31 | reqs.run().done(function() {
32 | return run.run(args);
33 | }, function(err) {
34 | console.error('ERROR: ' + err);
35 | process.exit(2);
36 | });
37 | }
38 |
--------------------------------------------------------------------------------
/platforms/android/cordova/run.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0run"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'run' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/platforms/android/cordova/version:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | // Coho updates this line:
23 | var VERSION = "3.5.0";
24 |
25 | console.log(VERSION);
26 |
--------------------------------------------------------------------------------
/platforms/android/cordova/version.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0version"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
27 |
--------------------------------------------------------------------------------
/platforms/android/custom_rules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/platforms/android/gen/com/bcsphere/bcexplorer/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.bcsphere.bcexplorer;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/platforms/android/gen/com/bcsphere/bcexplorer/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package com.bcsphere.bcexplorer;
9 |
10 | public final class R {
11 | public static final class attr {
12 | }
13 | public static final class drawable {
14 | public static final int icon=0x7f020000;
15 | public static final int screen=0x7f020001;
16 | }
17 | public static final class string {
18 | public static final int app_name=0x7f040000;
19 | }
20 | public static final class xml {
21 | public static final int config=0x7f030000;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/platforms/android/libs/samsung_ble_sdk_200.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/libs/samsung_ble_sdk_200.jar
--------------------------------------------------------------------------------
/platforms/android/local.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 |
7 | # location of the SDK. This is only used by Ant
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | sdk.dir=D:\\adt-bundle-windows-x86_64-20131030\\sdk
11 |
--------------------------------------------------------------------------------
/platforms/android/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/platforms/android/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | android.library.reference.1=CordovaLib
14 | # Project target.
15 | target=android-19
16 |
--------------------------------------------------------------------------------
/platforms/android/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/platforms/android/res/drawable-land-hdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable-land-hdpi/screen.png
--------------------------------------------------------------------------------
/platforms/android/res/drawable-land-ldpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable-land-ldpi/screen.png
--------------------------------------------------------------------------------
/platforms/android/res/drawable-land-mdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable-land-mdpi/screen.png
--------------------------------------------------------------------------------
/platforms/android/res/drawable-land-xhdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable-land-xhdpi/screen.png
--------------------------------------------------------------------------------
/platforms/android/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/platforms/android/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/platforms/android/res/drawable-port-hdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable-port-hdpi/screen.png
--------------------------------------------------------------------------------
/platforms/android/res/drawable-port-ldpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable-port-ldpi/screen.png
--------------------------------------------------------------------------------
/platforms/android/res/drawable-port-mdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable-port-mdpi/screen.png
--------------------------------------------------------------------------------
/platforms/android/res/drawable-port-xhdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable-port-xhdpi/screen.png
--------------------------------------------------------------------------------
/platforms/android/res/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/platforms/android/res/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/platforms/android/res/drawable/icon.png
--------------------------------------------------------------------------------
/platforms/android/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | BCExplorer
4 |
5 |
--------------------------------------------------------------------------------
/platforms/android/res/xml/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | BCExplorer
9 |
10 | A sample Apache Cordova application that responds to the deviceready event.
11 |
12 |
13 | Apache Cordova Team
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/platforms/android/src/com/bcsphere/bcexplorer/BCExplorer.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | package com.bcsphere.bcexplorer;
21 |
22 | import android.os.Bundle;
23 | import org.apache.cordova.*;
24 |
25 | public class BCExplorer extends CordovaActivity
26 | {
27 | @Override
28 | public void onCreate(Bundle savedInstanceState)
29 | {
30 | super.onCreate(savedInstanceState);
31 | super.init();
32 | // Set by in config.xml
33 | super.loadUrl(Config.getStartUrl());
34 | //super.loadUrl("file:///android_asset/www/index.html");
35 | }
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/platforms/appendix:
--------------------------------------------------------------------------------
1 | You can delete this file after git clone, leave the /platforms for 'cordova platform add '
2 |
--------------------------------------------------------------------------------
/plugins/android.json:
--------------------------------------------------------------------------------
1 | {
2 | "prepare_queue": {
3 | "installed": [],
4 | "uninstalled": []
5 | },
6 | "config_munge": {
7 | "files": {
8 | "res/xml/config.xml": {
9 | "parents": {
10 | "/*": [
11 | {
12 | "xml": "",
13 | "count": 1
14 | }
15 | ]
16 | }
17 | },
18 | "AndroidManifest.xml": {
19 | "parents": {
20 | "/manifest": [
21 | {
22 | "xml": "",
23 | "count": 1
24 | },
25 | {
26 | "xml": "",
27 | "count": 1
28 | }
29 | ],
30 | "/manifest/application": [
31 | {
32 | "xml": "",
33 | "count": 1
34 | }
35 | ]
36 | }
37 | }
38 | }
39 | },
40 | "installed_plugins": {
41 | "org": {
42 | "PACKAGE_NAME": "com.bcsphere.bcexplorer"
43 | }
44 | },
45 | "dependent_plugins": {}
46 | }
--------------------------------------------------------------------------------
/plugins/org.bcsphere.bluetooth/.fetch.json:
--------------------------------------------------------------------------------
1 | {"source":{"type":"git","url":"https://github.com/bcsphere/bluetooth","subdir":"."}}
--------------------------------------------------------------------------------
/plugins/org.bcsphere.bluetooth/docs/scripts/linenumber.js:
--------------------------------------------------------------------------------
1 | /*global document */
2 | (function() {
3 | var source = document.getElementsByClassName('prettyprint source linenums');
4 | var i = 0;
5 | var lineNumber = 0;
6 | var lineId;
7 | var lines;
8 | var totalLines;
9 | var anchorHash;
10 |
11 | if (source && source[0]) {
12 | anchorHash = document.location.hash.substring(1);
13 | lines = source[0].getElementsByTagName('li');
14 | totalLines = lines.length;
15 |
16 | for (; i < totalLines; i++) {
17 | lineNumber++;
18 | lineId = 'line' + lineNumber;
19 | lines[i].id = lineId;
20 | if (lineId === anchorHash) {
21 | lines[i].className += ' selected';
22 | }
23 | }
24 | }
25 | })();
26 |
--------------------------------------------------------------------------------
/plugins/org.bcsphere.bluetooth/docs/scripts/prettify/lang-css.js:
--------------------------------------------------------------------------------
1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
3 |
--------------------------------------------------------------------------------
/plugins/org.bcsphere.bluetooth/libs/com.htc.android.bluetooth.le.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/plugins/org.bcsphere.bluetooth/libs/com.htc.android.bluetooth.le.jar
--------------------------------------------------------------------------------
/plugins/org.bcsphere.bluetooth/libs/samsung_ble_sdk_200.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/plugins/org.bcsphere.bluetooth/libs/samsung_ble_sdk_200.jar
--------------------------------------------------------------------------------
/plugins/org.bcsphere.bluetooth/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.3.0",
3 | "name": "org.bcsphere.bluetooth",
4 | "cordova_name": "bcsphere.bluetooth",
5 | "description": "Use the Bluetooth Low Energy plugin to connect your Phonegap app to new Bluetooth devices like heart rate monitors, thermometers, etc...",
6 | "license": "Apache 2.0 License",
7 | "keywords": [
8 | "bluetooth",
9 | "low energy",
10 | "smart"
11 | ],
12 | "engines": [
13 | {
14 | "name": "cordova",
15 | "version": ">=3.0.0"
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/plugins/org/.fetch.json:
--------------------------------------------------------------------------------
1 | {"source":{"type":"git","url":"https://github.com/bcsphere/bluetooth","subdir":"."}}
--------------------------------------------------------------------------------
/plugins/org/docs/scripts/linenumber.js:
--------------------------------------------------------------------------------
1 | /*global document */
2 | (function() {
3 | var source = document.getElementsByClassName('prettyprint source linenums');
4 | var i = 0;
5 | var lineNumber = 0;
6 | var lineId;
7 | var lines;
8 | var totalLines;
9 | var anchorHash;
10 |
11 | if (source && source[0]) {
12 | anchorHash = document.location.hash.substring(1);
13 | lines = source[0].getElementsByTagName('li');
14 | totalLines = lines.length;
15 |
16 | for (; i < totalLines; i++) {
17 | lineNumber++;
18 | lineId = 'line' + lineNumber;
19 | lines[i].id = lineId;
20 | if (lineId === anchorHash) {
21 | lines[i].className += ' selected';
22 | }
23 | }
24 | }
25 | })();
26 |
--------------------------------------------------------------------------------
/plugins/org/docs/scripts/prettify/lang-css.js:
--------------------------------------------------------------------------------
1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
3 |
--------------------------------------------------------------------------------
/plugins/org/libs/samsung_ble_sdk_200.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/plugins/org/libs/samsung_ble_sdk_200.jar
--------------------------------------------------------------------------------
/plugins/org/others/HTC/com.htc.android.bluetooth.le.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcsphere/bcexplorer/f78a042d9fffe8766b40e765a99e063f2da8758c/plugins/org/others/HTC/com.htc.android.bluetooth.le.jar
--------------------------------------------------------------------------------
/plugins/org/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.5.0",
3 | "name": "org.bcsphere.bluetooth",
4 | "cordova_name": "bcsphere.bluetooth",
5 | "description": "Use the Bluetooth 4.0 plugin to connect your App to new Bluetooth Smart devices like heart rate monitors, thermometers, etc...",
6 | "license": "Apache 2.0 License",
7 | "keywords": [
8 | "Bluetooth",
9 | "Low Energy",
10 | "Bluetooth Smart"
11 | ],
12 | "engines": [
13 | {
14 | "name": "cordova",
15 | "version": ">=3.0.0"
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/plugins/org/src/ios/BCIBeacon.h:
--------------------------------------------------------------------------------
1 | //
2 | // BCIBeacon.h
3 | // BCSphereCoreDev
4 | //
5 | // Created by NPHD on 14-4-15.
6 | //
7 | //
8 |
9 | #import
10 | #import
11 | #import
12 | #import
13 | #import
14 | #import
15 | #import
16 | #import
17 | #import
18 | #import
19 | #import "BCBluetooth.h"
20 |
21 | @interface BCIBeacon : CDVPlugin
22 | {
23 | BOOL isVariableInit;
24 | }
25 | @property (retain, nonatomic) CBPeripheralManager *beaconPeripheralManager;
26 | @property (nonatomic, strong) CLLocationManager *locationManager;
27 | @property (nonatomic, strong) CLBeaconRegion *beaconRegion;
28 | @property NSMutableDictionary *rangedRegions;
29 |
30 | - (void)addEventListener:(CDVInvokedUrlCommand *)command;
31 | - (void)startIBeaconScan:(CDVInvokedUrlCommand *)command;
32 | - (void)stopIBeaconScan:(CDVInvokedUrlCommand *)command;
33 | - (void)startIBeaconAdvertising:(CDVInvokedUrlCommand *)command;
34 | @end
35 |
--------------------------------------------------------------------------------
/plugins/org/www/org.bluetooth.service/battery_service.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2013-2014, JUMA Technology
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | var BC = require("org.bcsphere.bcjs");
18 |
19 | var BatteryLevelService = BC.BatteryLevelService = BC.Service.extend({
20 |
21 | /* org.bluetooth.characteristic.battery_level*/
22 | characteristicUUID:'2a19',
23 |
24 | getValue : function(callback){
25 | this.discoverCharacteristics(function(){
26 | this.getCharacteristicByUUID(this.characteristicUUID)[0].read(function(data){
27 | callback(data.value);
28 | });
29 | });
30 | },
31 |
32 | notify : function(callback){
33 | this.discoverCharacteristics(function(){
34 | this.getCharacteristicByUUID(this.characteristicUUID)[0].subscribe(function(data){
35 | callback(data.value);
36 | });
37 | });
38 | },
39 |
40 | });
41 |
42 | document.addEventListener('bccoreready',function(){
43 | BC.bluetooth.UUIDMap["0000180f-0000-1000-8000-00805f9b34fb"] = BC.BatteryLevelService;
44 | });
45 |
46 | module.exports = BC;
47 |
--------------------------------------------------------------------------------
/plugins/org/www/org.bluetooth.service/blood_pressure.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2013-2014, JUMA Technology
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | var BC = require("org.bcsphere.bcjs");
18 |
19 | var BloodPressureService = BC.BloodPressureService = BC.Service.extend({
20 |
21 | /* org.bluetooth.characteristic.blood_pressure_measurement */
22 | BloodPressureMeasurementUUID:'2a35',
23 | /* org.bluetooth.characteristic.intermediate_cuff_pressure */
24 | IntermediateCuffPressureUUID:'2a36',
25 | /* org.bluetooth.characteristic.blood_pressure_feature */
26 | BloodPressureFeatureUUID:'2a49',
27 |
28 | //ToDo
29 | });
30 |
31 | document.addEventListener('bccoreready',function(){
32 | BC.bluetooth.UUIDMap["00001810-0000-1000-8000-00805f9b34fb"] = BC.BloodPressureService;
33 | });
34 | module.exports = BC;
--------------------------------------------------------------------------------
/www/char_detail.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |