Skip to content

Commit

Permalink
#491 - build process and config updated
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Mar 4, 2017
1 parent d38b571 commit e9af25f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 29 deletions.
34 changes: 19 additions & 15 deletions build_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ if [ ! -f "$NINJAKEYSTORE" ]; then
exit
fi

# clean up past builds
rm -fr platforms/android/build/outputs/*
mkdir release_files
rm -f release_files/*

Expand All @@ -27,18 +25,18 @@ if [ "$1" = "2" ]; then
echo "only building native view (5+)"
fi

echo "Cleaning past builds..."
cordova clean

############ Crosswalk build ####################################
if [ "$BUILD_MODE" = "xwalk" ] || [ "$BUILD_MODE" = "all" ]; then

echo "Building Release mode for Xwalk android..."
echo "--------------------------------------------"
echo "Adding crosswalk..."
#ionic plugin add [email protected] --variable "XWALK_VERSION"="18+"
ionic plugin remove cordova-plugin-crosswalk-webview
ionic plugin add "https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview#1.8.0" --variable XWALK_MODE="lite" --variable "XWALK_VERSION"="17.46.459.1"
echo "Removing android and re-adding..."
cordova platform remove android
cordova platform add android
cordova plugin remove cordova-plugin-crosswalk-webview
echo "Adding crosswalk..."
cordova plugin add [email protected] --variable XWALK_MODE="lite" --variable "XWALK_VERSION"="17.46.459.1"
#ionic plugin add cordova-plugin-crosswalk-webview

# crosswalk handles SSL certificate handling in a different way
Expand All @@ -49,7 +47,7 @@ if [ "$BUILD_MODE" = "xwalk" ] || [ "$BUILD_MODE" = "all" ]; then
#ionic platform remove android
#ionic platform add android
cp "$NINJAKEYSTORE" platforms/android/
ionic build android --release
cordova build android --release

# copy builds to my release directory
cp platforms/android/build/outputs/apk/android-x86-release-unsigned.apk release_files/
Expand All @@ -66,16 +64,20 @@ if [ "$BUILD_MODE" = "xwalk" ] || [ "$BUILD_MODE" = "all" ]; then
cd ..
fi


############ Native web view build ###############################
if [ "$BUILD_MODE" = "native" ] || [ "$BUILD_MODE" = "all" ]; then

echo "Building Release mode for android 5+..."
echo "--------------------------------------------"

#clean up past build stuff
rm -fr platforms/android/build/outputs/*
echo "Removing android and re-adding..."
cordova platform remove android
cordova platform add android

#clean up past build stuff
echo "Adding default browser..."
ionic plugin remove cordova-plugin-crosswalk-webview
cordova plugin remove cordova-plugin-crosswalk-webview

# use the right plugin for SSL certificate mgmt
cordova plugin remove cordova-plugin-crosswalk-certificate
Expand All @@ -85,7 +87,7 @@ if [ "$BUILD_MODE" = "native" ] || [ "$BUILD_MODE" = "all" ]; then
cp "$NINJAKEYSTORE" platforms/android/

# Make sure native builds are only deployed in devices < Android 5
ionic build android --release -- --minSdkVersion=21
cordova build android --release -- --minSdkVersion=21
#ionic build android --release -- --minSdkVersion=19

# copy build to release folder and sign
Expand All @@ -97,9 +99,11 @@ if [ "$BUILD_MODE" = "native" ] || [ "$BUILD_MODE" = "all" ]; then
~/Library/Android/sdk/build-tools/22.0.1/zipalign -v 4 android-release-unsigned.apk zmNinja.apk
rm -f android-release-unsigned.apk
cd ..
fi

# Do a phone perm check

./checkperms.sh release_files/zmNinja.apk
echo "*** Phone State Check:"
./checkperms.sh release_files/zmNinja.apk | grep PHONE_STATE
fi


6 changes: 3 additions & 3 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</author>
<content src="index.html" />
<access launch-external="yes" origin="mailto:*" />
<access origin='*' allows-arbitrary-loads-in-media='true' allows-arbitrary-loads-in-web-content='true' allows-local-networking='true' minimum-tls-version='TLSv1.0' requires-forward-secrecy='false' requires-certificate-transparency='false'/>
<access allows-arbitrary-loads-in-media="true" allows-arbitrary-loads-in-web-content="true" allows-local-networking="true" minimum-tls-version="TLSv1.0" origin="*" requires-certificate-transparency="false" requires-forward-secrecy="false" />
<allow-navigation href="*" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<preference name="iosPersistentFileLocation" value="Library" />
Expand Down Expand Up @@ -96,6 +96,6 @@
<variable name="ANDROID_HOST" value=" " />
<variable name="ANDROID_PATHPREFIX" value="/" />
</plugin>
<engine name="android" spec="~5.1.1" />
<engine name="ios" spec="~4.3.1" />
<engine name="android" />
<engine name="ios" />
</widget>
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@
"id": "cordova-sqlite-storage"
},
"cordova-plugin-settings-hook",
{
"id": "phonegap-plugin-push",
"locator": "phonegap-plugin-push",
"variables": {
"SENDER_ID": "710936220256"
}
},
"cordova-plugin-file",
"cordova-plugin-compat",
"cordova-plugin-inappbrowser",
Expand Down Expand Up @@ -98,16 +91,23 @@
"id": "cordova-library-helper"
},
"cordova-plugin-photo-library",
{
"locator": "https://github.com/hypery2k/cordova-certificate-plugin",
"id": "cordova-plugin-certificates"
},
{
"id": "cordova-plugin-customurlscheme",
"locator": "cordova-plugin-customurlscheme",
"variables": {
"URL_SCHEME": "zmninja"
}
},
{
"id": "phonegap-plugin-push",
"locator": "phonegap-plugin-push",
"variables": {
"SENDER_ID": "710936220256"
}
},
{
"locator": "https://github.com/hypery2k/cordova-certificate-plugin",
"id": "cordova-plugin-certificates"
}
],
"cordovaPlatforms": [
Expand Down

0 comments on commit e9af25f

Please sign in to comment.