Due to Android's limited set of regex characters for intent actions, any local `.kmp*` file triggers the Keyman app. (e.g. `.kmp` is treated the same as `.kmpo`). Added Toast notifications for when the intent inadvertently triggers the Keyman app.
Also updated PackageActivity to display the package name when no `welcome.htm` file exists.
A Linux user reports issues building KMAPro because the script uses bash syntax instead of sh.
```
while [[ $# -gt 0 ]] ; do
```
KMEA is already using `#!/bin/bash`
Starting with Android 6.0 Marshmallow (API 23), apps need to request permissions for "dangerous" (Storage) access at runtime. Previous versions of Android granted permissions at installation. Normal permissions declared in the manifest are granted automatically.
This doesn't affect Keyman running on older versions of Android
[Reference](https://developer.android.com/training/permissions/requesting.html)
[Runtime Permissions Sample](https://github.com/googlesamples/android-RuntimePermissions) provided by Google
- Modify kmp.json to have package versions 1.4 and 1.5.
- also made exception string more descriptive when JSON object doesn't contain a valid "options" object
Intents from the DownloadManager use paths like `/document/number/` so additional code needed to determine the kmp filename.
protocols also separated in switch statement for maintainability.
- Changed PackageProcessor to skip processing keyboard ID's if JS not found
- Fix a PackageProcessorTest to use the correct package ID
- Added a dialog for when Packge install fails
-
Add intent-filter and storage permissions so Keyman app will process keyman://, http://, https:// protocols, along with local KMP file. Also add external storage permission
Update MainActivity to pass the downloaded kmp file to PackageActivity.
PackageActivity then unzips and parses the package version, and displays the Welcome page with the package version. If Welcome.htm is not in the package, just display the package ID.
Lastly, copied package processing code from KMKeyboardDownloaderActivity to PackageActivity.
TODO: cleanup KMKeyboardDownloaderActivity
Keyboard paths that get passed to KMW will depend on the `packageID`
1. Keyboards distributed ad-hoc via kmp (stored in `/packages/packageID/` won't have version strings in their filename.
2. Legacy keyboards in the `/cloud/` directory will still contain version strings
Per design discussions, use "cloud" as the package ID when it's undefined. Those keyboards get stored physically at `/cloud/`.
Later on, keyboards installed via kmp will be installed at `/packages/packageID/`
Also update version checker depending on package ID:
1. cloud: use the version string within the filename
2. all others: parse kmp.json for the keyboard version