diff options
| -rwxr-xr-x | build_android.sh | 22 | ||||
| -rw-r--r-- | package.json | 4 | ||||
| -rwxr-xr-x | www/js/app.js | 21 |
3 files changed, 22 insertions, 25 deletions
diff --git a/build_android.sh b/build_android.sh index 0eb723c5..65d14676 100755 --- a/build_android.sh +++ b/build_android.sh @@ -1,10 +1,14 @@ #!/bin/bash + ./electron_js/sync_versions.sh + APPVER=`cat config.xml | grep "widget " | sed 's/.* version=\"\([^\"]*\)\" xmlns.*/\1/'` # multipleApk adds 2 and 4 in Xwalk builds for arm and x86 respectively ver_pre5=${APPVER//.} ver=${APPVER//.}9 + echo "About to build version: $APPVER" + read -p "Press any key..." # App signining credentials in this file NINJAKEYSTORE=~/Desktop/zmNinja.keystore @@ -13,23 +17,9 @@ if [ ! -f "$NINJAKEYSTORE" ]; then exit fi -rm -f release_files 2>/dev/null +rm -rf release_files 2>/dev/null mkdir release_files -# no arguments - build both -# 1 == build crosswalk only -# 2 == build native only -BUILD_MODE="all" -if [ "$1" = "1" ]; then - BUILD_MODE="xwalk" - echo "only building crosswalk" -fi - -if [ "$1" = "2" ]; then - BUILD_MODE="native" - echo "only building native view (5+)" -fi - echo "----------> Only building native. Not building crosswalk anymore due to compatibility issues <----------------------" BUILD_MODE="native" @@ -39,7 +29,7 @@ if [ "$BUILD_MODE" = "native" ] || [ "$BUILD_MODE" = "all" ]; then echo "${ver}: Building Release mode for android 5+..." echo "--------------------------------------------" -# No longger needed as we are not supporting Xwalk +# No longer needed as we are not supporting Xwalk # echo "Removing android and re-adding..." # cordova platform remove android # cordova platform add android@6.4.0 diff --git a/package.json b/package.json index 0196ddc8..bb9e847a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "zmninjapro", "description": "Home security mobile app for ZoneMinder", - "version":"1.3.028", + "version": "1.3.028", "displayName": "zmNinja", "author": "Pliable Pixels", "license": "custom see LICENSE.md", @@ -175,4 +175,4 @@ ] } } -} +}
\ No newline at end of file diff --git a/www/js/app.js b/www/js/app.js index f5ec5c47..f43afe28 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -42,7 +42,7 @@ angular.module('zmApp', [ .constant('zm', { minAppVersion: '1.28.107', // if ZM is less than this, the app won't work recommendedAppVersion: '1.32.0', - minEventServerVersion: '2.0', + minEventServerVersion: '2.1', castAppId: 'BA30FB4C', alarmFlashTimer: 20000, // time to flash alarm gcmSenderId: '710936220256', @@ -2341,14 +2341,25 @@ angular.module('zmApp', [ method: method, data: arguments[0].data, headers: arguments[0].headers, - timeout: arguments[0].timeout || 20, + // timeout: arguments[0].timeout, responseType: arguments[0].responseType }; + + if (arguments[0].timeout) options.timeout = arguments[0].timeout; // console.log ("**** -->"+method+"<-- using native HTTP with:"+encodeURI(url)+" payload:"+JSON.stringify(options)); cordova.plugin.http.sendRequest(encodeURI(url), options, function (succ) { // automatic JSON parse if no responseType: text // fall back to text if JSON parse fails too + + // work around for cake-error leak + + // console.log ("HTTP RESPONSE:" + JSON.stringify(succ.data)); + if (succ.data && succ.data.startsWith("<pre class=\"cake-error\">") ) { + logger.debug ("**** Native: cake-error in message, trying fix..."); + succ.data = JSON.parse(succ.data.replace(/<pre class=\"cake-error\">[\s\S]*<\/pre>/,'')); + } + if (options.responseType == 'text') { // don't parse into JSON d.resolve({ @@ -2357,11 +2368,7 @@ angular.module('zmApp', [ return d.promise; } else { - // work around for cake-error leak - if (succ.data.startsWith("<pre class=\"cake-error\">") ) { - logger.debug ("**** Native: cake-error in message, trying fix..."); - succ.data = JSON.parse(succ.data.replace(/<pre class=\"cake-error\">[\s\S]*<\/pre>/,'')); - } + try { d.resolve({ |
