diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-11-14 09:54:46 -0500 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-11-14 09:54:46 -0500 |
| commit | ed485b7a29ceb8b59e36ed09f8373dcb88f79461 (patch) | |
| tree | 06da921491ca5fe05510f3140f830ada7958b9f2 | |
| parent | 754b54f8687c5e0e4b23f5365bedcfa4c55b019c (diff) | |
updates to remove wkwebview from android - causes issues displaying images with self signed
| -rwxr-xr-x | build_android.sh | 180 | ||||
| -rwxr-xr-x | build_ios.sh | 2 | ||||
| -rw-r--r-- | config.xml | 8 | ||||
| -rw-r--r-- | debug_files/android-debug.apk | bin | 0 -> 17911099 bytes | |||
| -rw-r--r-- | www/js/DataModel.js | 21 | ||||
| -rw-r--r-- | www/js/FirstUseCtrl.js | 6 | ||||
| -rw-r--r-- | www/js/LoginCtrl.js | 5 | ||||
| -rw-r--r-- | www/js/MenuController.js | 5 |
8 files changed, 156 insertions, 71 deletions
diff --git a/build_android.sh b/build_android.sh index 65d14676..33686916 100755 --- a/build_android.sh +++ b/build_android.sh @@ -1,71 +1,123 @@ #!/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 - -if [ ! -f "$NINJAKEYSTORE" ]; then - echo "zmNinja keystore not found" - exit +build_debug() { + echo "*********** Building Debug Build **************" + rm -rf debug_files 2>/dev/null + mkdir debug_files + ionic cordova build android + # adding back wkwebview clears platform debug directory later + cp platforms/android/build/outputs/apk/debug/android-debug.apk debug_files +} + + +build_release() { + echo "*********** Building Release Build **************" + echo "----> Only building native. Not building crosswalk anymore due to compatibility issues <----------" + # App signining credentials in this file + NINJAKEYSTORE=~/Desktop/zmNinja.keystore + + if [ ! -f "$NINJAKEYSTORE" ]; then + echo "zmNinja keystore not found" + exit + fi + + BUILD_MODE="native" + rm -rf release_files 2>/dev/null + mkdir release_files + + + ############ Native web view build ############################### + + echo "${ver}: Building Release mode for android 5+..." + echo "--------------------------------------------" + + # 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 + + #clean up past build stuff + # echo "Adding default browser..." + # cordova plugin remove cordova-plugin-crosswalk-webview + + # use the right plugin for SSL certificate mgmt + # cordova plugin remove cordova-plugin-crosswalk-certificate-pp-fork + # cordova plugin add cordova-plugin-certificates + cp "$NINJAKEYSTORE" platforms/android/ + + # Make sure native builds are only deployed in devices >= Android 5 + cordova build android --release -- --minSdkVersion=21 --versionCode=${ver} + + # copy build to release folder and sign + cp platforms/android/build/outputs/apk/release/android-release-unsigned.apk release_files/ + echo "Copied files to release_files" + + cd release_files/ + jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../platforms/android/zmNinja.keystore android-release-unsigned.apk zmNinja + ~/Library/Android/sdk/build-tools/25.0.2/zipalign -v 4 android-release-unsigned.apk zmNinja.apk + rm -f android-release-unsigned.apk + cd .. + + # Do a phone perm check + + ./checkperms.sh release_files/zmNinja.apk + echo "*** Phone State Check:" + ./checkperms.sh release_files/zmNinja.apk | grep PHONE_STATE + + echo "***VERSION CODE CHECKS:" + for f in release_files/*; do + echo "$f:" + `echo $ANDROID_HOME`/build-tools/23.0.1/aapt dump badging $f | grep versionCode + `echo $ANDROID_HOME`/build-tools/23.0.1/aapt dump badging $f | grep native-code + done + + } + + +# parse arguments +# credit: https://stackoverflow.com/a/14203146/1361529 +while [[ $# -gt 0 ]] +do +key="$1" +case $key in + -d|--debug) + MODE="debug" + shift # past argument + ;; + -r|--release) + MODE="release" + shift # past argument + ;; + *) # unknown option + shift # past argument + ;; +esac +done + +./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 ($MODE)" +read -p "Press any key..." + +echo "Removing wkwebview, adding certificate fork..." +cordova plugin remove cordova-plugin-ionic-webview > /dev/null 2>&1 +cordova plugin add cordova-plugin-certificates-pp-fork > /dev/null 2>&1 + +if [ "${MODE}" = "debug" ]; then + build_debug +else + build_release fi -rm -rf release_files 2>/dev/null -mkdir release_files - -echo "----------> Only building native. Not building crosswalk anymore due to compatibility issues <----------------------" -BUILD_MODE="native" - -############ Native web view build ############################### -if [ "$BUILD_MODE" = "native" ] || [ "$BUILD_MODE" = "all" ]; then - - echo "${ver}: Building Release mode for android 5+..." - echo "--------------------------------------------" - -# 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 - - #clean up past build stuff -# echo "Adding default browser..." -# cordova plugin remove cordova-plugin-crosswalk-webview - - # use the right plugin for SSL certificate mgmt -# cordova plugin remove cordova-plugin-crosswalk-certificate-pp-fork -# cordova plugin add cordova-plugin-certificates - cp "$NINJAKEYSTORE" platforms/android/ - - # Make sure native builds are only deployed in devices >= Android 5 - cordova build android --release -- --minSdkVersion=21 --versionCode=${ver} - - # copy build to release folder and sign - cp platforms/android/build/outputs/apk/release/android-release-unsigned.apk release_files/ - echo "Copied files to release_files" - - cd release_files/ - jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../platforms/android/zmNinja.keystore android-release-unsigned.apk zmNinja - ~/Library/Android/sdk/build-tools/25.0.2/zipalign -v 4 android-release-unsigned.apk zmNinja.apk - rm -f android-release-unsigned.apk - cd .. -fi -# Do a phone perm check +echo "Adding back wkwebview and removing certificate fork..." +cordova plugin remove cordova-plugin-certificates-pp-fork > /dev/null 2>&1 +cordova plugin add https://github.com/pliablepixels/cordova-plugin-ionic-webview.git > /dev/null 2>&1 - ./checkperms.sh release_files/zmNinja.apk - echo "*** Phone State Check:" - ./checkperms.sh release_files/zmNinja.apk | grep PHONE_STATE - echo "***VERSION CODE CHECKS:" - for f in release_files/*; do - echo "$f:" - `echo $ANDROID_HOME`/build-tools/23.0.1/aapt dump badging $f | grep versionCode - `echo $ANDROID_HOME`/build-tools/23.0.1/aapt dump badging $f | grep native-code - done + diff --git a/build_ios.sh b/build_ios.sh index f9042358..45c4e33c 100755 --- a/build_ios.sh +++ b/build_ios.sh @@ -1,7 +1,7 @@ echo "*** Using old build system due to XCode 10 issues ** " echo "see https://forum.ionicframework.com/t/how-to-build-ionic-cordova-with-xcode-10/142044" -#ionic cordova plugin add cordova-plugin-ionic-webview@latest +ionic cordova plugin add https://github.com/pliablepixels/cordova-plugin-ionic-webview.git #echo "--- readding certificate plugin to make sure... ---" #ionic cordova plugin remove cordova-plugin-certificates @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninja_pro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.3.029" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninja_pro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.3.031" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>zmNinja</name> <description> High performance ZoneMinder client @@ -160,13 +160,13 @@ <plugin name="phonegap-plugin-push" spec="~2.1.3"> <variable name="FCM_VERSION" value="11.6.2" /> </plugin> - <plugin name="cordova-plugin-ionic-webview" spec="https://github.com/pliablepixels/cordova-plugin-ionic-webview.git"> - <variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" /> - </plugin> <plugin name="cordova-plugin-advanced-websocket" spec="^1.1.3" /> <plugin name="cordova-plugin-network-information" spec="^2.0.1" /> <plugin name="cordova-plugin-x-socialsharing" spec="^5.4.1" /> <plugin name="cordova-plugin-media-pp-fork" spec="^1.0.2-dev" /> <engine name="android" spec="^6.4.0" /> <engine name="ios" spec="~4.5.5" /> + <plugin name="cordova-plugin-ionic-webview" spec="https://github.com/pliablepixels/cordova-plugin-ionic-webview.git"> + <variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" /> + </plugin> </widget> diff --git a/debug_files/android-debug.apk b/debug_files/android-debug.apk Binary files differnew file mode 100644 index 00000000..29100db5 --- /dev/null +++ b/debug_files/android-debug.apk diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 3e5f41c1..25a42c86 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -20,7 +20,7 @@ angular.module('zmApp.controllers') DO NOT TOUCH zmAppVersion It is changed by sync_version.sh */ - var zmAppVersion = "1.3.029"; + var zmAppVersion = "1.3.030"; var isBackground = false; var justResumed = false; var timeSinceResumed = -1; @@ -221,6 +221,11 @@ angular.module('zmApp.controllers') console.log('-->Error setting SSL permissive'); }); + if ($rootScope.platformOS == 'android') { + log (">>> Android: enabling inline image view for self signed certs"); + cordova.plugins.certificates.trustUnsecureCerts(true); + } + } else { log(">>>> Enabling strict SSL checking (turn off in Dev Options if you can't connect)"); @@ -2182,7 +2187,19 @@ angular.module('zmApp.controllers') // make them all show for now - + var recordingType = ''; + if (monitors[i].Monitor.SaveJPEGs>0) { + recordingType = $translate.instant('kImages'); + } + if (monitors[i].Monitor.VideoWriter > 0) { + if (recordingType.length) recordingType +=" + "; + recordingType = recordingType + $translate.instant('kVideo') + " ("; + recordingType = recordingType + ( monitors[i].Monitor.VideoWriter == 1 ? $translate.instant('kMonitorVideoEncode'): $translate.instant('kMonitorVideoPassThru')) + ")"; + } + + // in 1.30.4 these fields did not exist + + monitors[i].Monitor.recordingType = recordingType ? recordingType : $translate.instant ('kImages'); monitors[i].Monitor.listDisplay = 'show'; monitors[i].Monitor.isAlarmed = false; monitors[i].Monitor.connKey = (Math.floor((Math.random() * 999999) + 1)).toString(); diff --git a/www/js/FirstUseCtrl.js b/www/js/FirstUseCtrl.js index ca8ff14b..551a2bb3 100644 --- a/www/js/FirstUseCtrl.js +++ b/www/js/FirstUseCtrl.js @@ -23,6 +23,12 @@ angular.module('zmApp.controllers').controller('zmApp.FirstUseCtrl', ['$scope', }, function () { console.log('-->First Use -> Error setting SSL permissive'); }); + + if ($rootScope.platformOS == 'android') { + log (">>> Android: enabling inline image view for self signed certs"); + cordova.plugins.certificates.trustUnsecureCerts(true); + } + } diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index 09a48ac2..b24514f6 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -607,6 +607,11 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r console.log('-->Error setting SSL permissive'); }); + if ($rootScope.platformOS == 'android') { + NVRDataModel.log (">>> Android: enabling inline image view for self signed certs"); + cordova.plugins.certificates.trustUnsecureCerts(true); + } + } else { NVRDataModel.log(">>>> Enabling strict SSL checking (turn off in Dev Options if you can't connect)"); diff --git a/www/js/MenuController.js b/www/js/MenuController.js index 39b6ce7f..69e26686 100644 --- a/www/js/MenuController.js +++ b/www/js/MenuController.js @@ -101,6 +101,11 @@ angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$io console.log('-->Error setting SSL permissive'); }); + if ($rootScope.platformOS == 'android') { + log (">>> Android: enabling inline image view for self signed certs"); + cordova.plugins.certificates.trustUnsecureCerts(true); + } + } else { NVRDataModel.log(">>>> Enabling strict SSL checking (turn off in Dev Options if you can't connect)"); |
