Skip to content

Commit

Permalink
added other files, also fixed xwalk
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Sep 21, 2017
1 parent b28028a commit 02380f3
Show file tree
Hide file tree
Showing 38 changed files with 1,800 additions and 533 deletions.
Binary file modified .DS_Store
Binary file not shown.
510 changes: 0 additions & 510 deletions CDVStatusBar.m

This file was deleted.

1,008 changes: 1,008 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
68 changes: 68 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
##Contributing to zmNinja

The source code will always be available under CC BY-NC-SA 4.0. If you'd like to contribute please know that if your changes are accepted and merged they will make it to the App/Play Store when I publish the app. This does not entitle you to any remuneration - If you still would like to contribute and make this solution better, please go right ahead. If you feel this prohibits you from contributing, please create a bug report or enhancement request via the github issue tracker and I'll incorporate it when I have time/agree its a good idea.

Thanks.


## Steps for code contribution

It's best if you follow a proper process to contribute code - makes it easy for me to track/review. You will need `git`

If you are familiar with doing Pull Requests, you can ignore detailed instructions below - just do the following:
* create a [github issue](https://github.com/pliablepixels/zmNinja/issues) in zmNinja describing your feature
* create a fork and create a local branch using the issue# created (Example 459-new-feature)
* Make your changes on that branch and push/PR

If you are not familiar with the Pull Request process, these steps explain further:

### Detailed instructions (for folks who are not familiar with Pull Requests)
#### One time
* [Fork](https://guides.github.com/activities/forking/) zmNinja using the "Fork" button on the top right of the [zmNinja project](https://github.com/pliablepixels/zmNinja). This creates your own copy (or fork) of zmNinja on github:

* Now launch a command line and make a local copy of your fork
```
git clone https://github.com/<your github username>/zmNinja.git
```

* Now connect your copy to my repository (needed for future pushes)
```
git remote add upstream https://github.com/pliablepixels/zmNinja.git
```


#### Every time you want to contribute
* cd `<wherever you cloned my repo>/zmNinja`

* Make sure you have the latest version of my repo

```
git checkout master
git pull upstream master
```

* Let's suppose you want to add some "new-feature"

* Create an ISSUE on [zmNinja github issues](https://github.com/pliablepixels/zmNinja/issues)

* Note down the issue number (lets say its 1234)

* create a branch in your local git copy
```
git checkout -b 1234-new-feature (replace 1234 and new-feature)
```

You will now be in a new branch for you to develop the feature

* You can keep testing your changes. Make sure you commit often via `git add <files>` and `git commit -m "comments describing change" .`(you are committing to your local copy only here).

* So far, you are committing changes to your local copy. To push it to your fork of zmNinja on github, do `git push origin 1234-new-feature` (replace 1234 and new-feature)

* Keep repeating above steps as many times as you want till the code is ready.

* Once done, go to your github webpage and you will see a "create pull request" button in green. Review what you are doing a pull request for and click that button - I'll get an email you want me to review your changes





21 changes: 21 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Before you create an issue, please make sure you have read the FAQ at https://github.com/pliablepixels/zmNinja/wiki/FAQ. Common questions on API, no image etc are covered there.



**Platform & OS Version**
(example only, please edit this line) Android 6.0 Marshmallow

**The version of the app you are reporting:**
(example only, please edit this line) 1.1

**Device details:**
(example only, please edit this line) Moto G

**What is the nature of your issue**
(one of Bug, Enhancement, Question)

**Details**
Describe in detail. If its a bug, please describe what is happening, what should happen and how to reproduce if its not obvious


Thanks!
56 changes: 56 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
License for apps on Play store/App store
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The apps in Apple App store and Google Play store can be used for any purpose (personal, commercial etc). After all, you've paid for it.


For Desktop Clients Binaries:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Desktop clients binaries free to download and use ONLY for users
who are using the desktop client with the free and open source ZoneMinder
software. If you are selling a service based on ZoneMinder and are either distributing the Desktop Client to your users or asking your users to use the desktop client by download it themselves, you are violating the non-commercial use. You will need to procure a license before you do so.


Source Code License
~~~~~~~~~~~~~~~~~~~
The source code of zmNinja is dual licensed.

a) The code is free for personal, non commercial use
http://creativecommons.org/licenses/by-nc-sa/4.0/
In summary: Share Alike, Adapt,Attribute, NonCommercial

b) zmNinja source code is also open for commercial licensing and white-labeling.
Please contact [email protected]



Third Party credits
===================
Ninja icon;
https://openclipart.org/detail/172393/ninja-logo
License: https://openclipart.org/share

Wizard Icon:
https://openclipart.org/detail/4795/wizard-in-blue-hat
License: https://openclipart.org/share

Blop sound for notifications:
http://soundbible.com/2067-Blop.html

Version 1.1.0 and above of zmNinja uses Packery.
http://packery.metafizzy.co

A commercial single developer license has been purchased for the same.
Note that this license allows me (pliablepixels) to use Packery for commercial
apps that I develop (such as zmNinja). Given that I publish my source under
CC BY-NC-SA 4.0, you can compile the code for your personal use (non commercial purposes)
and continue to use Packery. This is compliant to Packery's license too, where they
prohibit other developers to build for profit using the license I purchased.

If however you purchase the source code from me, you will
still have to purchase an additional license for Packery from David via http://packery.metafizzy.co/#commercial-license
It's very cheap ($25 for unlimited products by one developer).





84 changes: 68 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,78 @@
Ionic App Base
==============
![](https://github.com/pliablepixels/zmNinja/blob/master/sample_images/zmn.png?raw=true "icon")

A starting project for Ionic that optionally supports using custom SCSS.
[zmNinja website](http://pliablepixels.github.io)

## Using this project
zmNinja is a multi platform (iOS, Android, Windows Desktop, Mac Desktop, Linux Desktop) client for ZoneMinder users.
[ZoneMinder](http://www.zoneminder.com) is an incredible open source camera monitoring system and is used
by many for home and commercial security monitoring.

We recommend using the [Ionic CLI](https://github.com/ionic-team/ionic-cli) to create new Ionic projects that are based on this project but use a ready-made starter template.

For example, to start a new Ionic project with the default tabs interface, make sure the `ionic` utility is installed:
<a href="https://itunes.apple.com/us/app/zmninja-pro/id1067914954?mt=8"><img src="http://www.pbase.com/arjunrc/image/162132546/original.jpg" width="200px" alt="Get in on App Store"></a>
<a href="https://play.google.com/store/apps/details?id=com.pliablepixels.zmninja_pro&hl=en&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1"><img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" width="200px"/></a>

```bash
$ npm install -g ionic cordova
```
**Problems running zmNinja? Check out the [FAQ](https://github.com/pliablepixels/zmNinja/wiki/FAQ)**

Then run:

```bash
$ ionic start myProject tabs --type=ionic1
```
Video Demo
-------------
Check out a video demo of zmNinja [here](https://youtu.be/prtA_mv68Ok)

More info on this can be found on the Ionic [Getting Started](https://ionicframework.com/getting-started) page and the [Ionic CLI](https://github.com/ionic-team/ionic-cli) repo.
Mobile Platforms
---------------------------
zmNinja is stable as of today and runs on a variety of Android and iOS platforms.
See links above to get them on play store (Android) and app store (iOS)

It also runs on the desktop (see below)

Desktop Platforms
-----------------
Please download binaries for Win 7, Linux or Mac from [here](https://github.com/pliablepixels/zmNinja/releases).
Please make sure you download the correct ZIP file (32/64 bit)


Key Features (just watch the video already)
--------------------------------------------
* Push Notifications for alarms (Needs the [eventserver](https://github.com/pliablepixels/zmeventserver) to be set up)
* Multiple languages (English, French, German, Spanish, Portugese, Dutch, and more)
* H264 video branch support
* live views of monitors
* Montage view (with multiple montage profile settings/sizes)
* Events history and list
* Timeline view
* Camera pan/tilt/zoom (needs to have ZM support it first)

Thanks
------
To the zonemider community in general, and the awesome Stack Overflow community.
But specifically, [Andrew Bauer](https://github.com/knnniggett) (knnniggett) who egged me on to take up this project.

Important Notes
---------------
* zmNinja needs APIs enabled in ZoneMinder. If you are running ZM 1.29 or above, APIs should automatically be available. See [this](https://github.com/pliablepixels/zmNinja/wiki/Validating-if-APIs-work-on-ZM) for instructions on how to make sure your APIs are working. If they are not working, zmNinja **will not** work.

Before you ask for help
-----------------------
* Make sure you have read the [FAQ](https://github.com/pliablepixels/zmNinja/wiki/FAQ)
* Make sure you have [validated](https://github.com/pliablepixels/zmNinja/wiki/Validating-if-APIs-work-on-ZM) that your APIs are working (if not, its a ZM issue, please post in ZM forums)
* Please don't ask me for help with source compilation if you are not familiar with coding mobile apps - you should try and solve your own problems


Objective
----------
I wanted to learn how to write a mobile app. It was (and is) fun.

Running from source
----------------------
Please follow [these](https://github.com/pliablepixels/zmNinja/wiki/Running-zmNinja-from-Source) instructions.


Screenshots:
------------
![](https://github.com/pliablepixels/zmNinja/blob/master/sample_images/IMG_0757.PNG?raw=true)
![](https://github.com/pliablepixels/zmNinja/blob/master/sample_images/IMG_0758.PNG?raw=true)
![](https://github.com/pliablepixels/zmNinja/blob/master/sample_images/IMG_0759.PNG?raw=true)
![](https://github.com/pliablepixels/zmNinja/blob/master/sample_images/IMG_0760.PNG?raw=true)
![](https://github.com/pliablepixels/zmNinja/blob/master/sample_images/IMG_0761.PNG?raw=true)
![](https://github.com/pliablepixels/zmNinja/blob/master/sample_images/IMG_0762.PNG?raw=true)

## Issues

Issues have been disabled on this repo. If you do find an issue or have a question, consider posting it on the [Ionic Forum](https://forum.ionicframework.com/). If there is truly an error, follow our guidelines for [submitting an issue](https://ionicframework.com/submit-issue/) to the main Ionic repository.
108 changes: 108 additions & 0 deletions build_android.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#!/bin/bash

# App signining credentials in this file
NINJAKEYSTORE=~/Desktop/zmNinja.keystore

if [ ! -f "$NINJAKEYSTORE" ]; then
echo "zmNinja keystore not found"
exit
fi

mkdir release_files
rm -f 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

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

echo "Building Release mode for Xwalk android..."
echo "--------------------------------------------"
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 cordova-plugin-crosswalk-webview
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
# need to switch plugins
echo "Adding crosswalk cert plugin..."
cordova plugin remove cordova-plugin-certificates
cordova plugin add https://github.com/danjarvis/cordova-plugin-crosswalk-certificate
cp "$NINJAKEYSTORE" platforms/android/
cordova build android --release -- --targetSdkVersion=23

# copy builds to my release directory
cp platforms/android/build/outputs/apk/android-x86-release-unsigned.apk release_files/
cp platforms/android/build/outputs/apk/android-armv7-release-unsigned.apk release_files/
echo "Copied files to release_files"

# sign them
cd release_files/
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../platforms/android/zmNinja.keystore android-armv7-release-unsigned.apk zmNinja
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../platforms/android/zmNinja.keystore android-x86-release-unsigned.apk zmNinja
~/Library/Android/sdk/build-tools/25.0.2/zipalign -v 4 android-x86-release-unsigned.apk zmNinja-x86-pre5.apk
~/Library/Android/sdk/build-tools/25.0.2/zipalign -v 4 android-armv7-release-unsigned.apk zmNinja-arm-pre5.apk
rm -f android-x86-release-unsigned.apk android-armv7-release-unsigned.apk
cd ..
fi


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

echo "Building Release mode for android 5+..."
echo "--------------------------------------------"
APPVER=`cat config.xml | grep "widget " | sed 's/.* version=\"\([^\"]*\)\" xmlns.*/\1/'`
a=( ${APPVER//./ } )
vcode="$(((a[0]*10000+a[1]*100+a[2])))9"

echo "Removing android and re-adding..."
cordova platform remove android
cordova platform add android

#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
cordova plugin add https://github.com/hypery2k/cordova-certificate-plugin
#ionic platform remove android
#ionic platform add android
cp "$NINJAKEYSTORE" platforms/android/

# Make sure native builds are only deployed in devices < Android 5
cordova build android --release -- --minSdkVersion=21 --versionCode=${vcode}

# copy build to release folder and sign
cp platforms/android/build/outputs/apk/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

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

Loading

2 comments on commit 02380f3

@pliablepixels
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pliablepixels
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.