Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First beta testing version #804

Merged
merged 25 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6ebeb28
First beta testing version
shankari Oct 18, 2021
ce6bccf
Set the FCM version to 18+
shankari Oct 19, 2021
7eca457
Change the build script to work with aab
shankari Oct 22, 2021
352c2ae
Remove the hardcoded badge plugin
shankari Oct 22, 2021
d124859
Downgrade the ruby version since we don't have a more recent version …
shankari Oct 22, 2021
2025e5e
Upgrade to the updated version of the auth plugin
shankari Oct 24, 2021
29d2d85
Initial version of the status screen (location settings only)
shankari Oct 27, 2021
ec76468
Add status support for the fitness sensors
shankari Oct 28, 2021
7be6cba
Adding in the fitness permission as well
shankari Oct 28, 2021
e9cd270
Enable notification enabled checks
shankari Oct 29, 2021
2b0cf26
Adding support for checking paused notifications
shankari Oct 29, 2021
bfa4bf3
Revert "Adding support for checking paused notifications"
shankari Oct 29, 2021
feca14c
Bump up the java version to 11
shankari Oct 31, 2021
03740df
Fix the code that sets the JAVA_HOME correctly
shankari Oct 31, 2021
fc8d0e2
Add the new unused app restrictions to the status screen
shankari Nov 2, 2021
37e327a
UI changes to handle the "deny" use case correctly
shankari Nov 13, 2021
f3ab75a
Follow on to also update the instructions for the motion activity
shankari Nov 13, 2021
570c87d
Enhance the local notification handling and redirection code
shankari Nov 17, 2021
07dfa93
Allow the user to proceed only when they have made all the settings c…
shankari Nov 17, 2021
539a0fd
Add a new entry to the profile screen which opens the app status modal
shankari Nov 17, 2021
6314932
Pass in parameters to indicate whether we need to launch the app sett…
shankari Nov 17, 2021
ccc5157
Cancel the existing "problematic" notification once the issue is fixed
shankari Nov 17, 2021
5d5692d
Fix some minor formatting and spacing issues
shankari Nov 17, 2021
9e8103d
Add the css classes for the app status code
shankari Nov 17, 2021
4378a70
Add in client side support for additional popup types
shankari Dec 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ jobs:

# Runs a single command using the runners shell
- name: Print the java version
run: java -version
run: |
java -version
export JAVA_HOME=$JAVA_HOME_11_X64
java -version

- name: Tries to figure out where android is installed
run: |
Expand All @@ -42,6 +45,7 @@ jobs:
- name: Check tool versions
shell: bash -l {0}
run: |
export JAVA_HOME=$JAVA_HOME_11_X64
source setup/activate_native.sh
echo "cordova version"
npx cordova -version
Expand All @@ -59,6 +63,7 @@ jobs:
gradle -version
echo "Let's rerun the activation"
source setup/activate_native.sh
export JAVA_HOME=$JAVA_HOME_11_X64
echo $PATH
which gradle
gradle --version
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ Pre-requisites
- **NOTE**: the basic xcode install on Catalina was messed up for me due to a prior installation of command line tools. [These workarounds helped](https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md).
- git
- the most recent version of android studio
- **NOTE**: although Catalina has a `/usr/bin/java`, trying to run it gives the error `No Java runtime present, requesting install.`. Installed [OpenJDK 1.8 using AdoptOpenJDK](https://adoptopenjdk.net/releases.html) to be consistent with the CI.
- NOTE: The setup script below will modify this install to workaround
https://github.com/actions/virtual-environments/issues/3757
- **NOTE**: although Catalina has a `/usr/bin/java`, trying to run it gives the error `No Java runtime present, requesting install.`. The build now requires Java 11. Installed [OpenJDK 11 (Temurin) using AdoptOpenJDK](https://adoptopenjdk.net/releases.html) to be consistent with the CI.

Important
---
Expand Down
7 changes: 4 additions & 3 deletions bin/sign_and_align_keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fi
# Sign and release the L+ version
# Make sure the highest supported version has the biggest version code
npx cordova build android --release -- --minSdkVersion=22
cp platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk platforms/android/app/build/outputs/apk/app-release-signed-unaligned.apk
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../config_files/production.keystore ./platforms/android/app/build/outputs/apk/app-release-signed-unaligned.apk androidproductionkey
~/Library/Android/sdk/build-tools/30.0.1/zipalign -v 4 platforms/android/app/build/outputs/apk/app-release-signed-unaligned.apk $1-build-$2.apk
# cp platforms/android/app/build/outputs/apk/release/app-release-unsigned.aab platforms/android/app/build/outputs/apk/app-release-signed-unaligned.apk
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore ../config_files/production.keystore ./platforms/android/app/build/outputs/bundle/release/app-release.aab androidproductionkey
cp platforms/android/app/build/outputs/bundle/release/app-release.aab $1-build-$2.aab
# ~/Library/Android/sdk/build-tools/30.0.1/zipalign -v 4 platforms/android/app/build/outputs/apk/app-release-signed-unaligned.apk $1-build-$2.apk
4 changes: 2 additions & 2 deletions config.cordovabuild.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="41" id="edu.berkeley.eecs.emission" ios-CFBundleVersion="41" version="3.0.0" 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-versionCode="42" id="edu.berkeley.eecs.emission" ios-CFBundleVersion="42" version="3.1.0" 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>emission</name>
<description>
A commute pattern tracker and carbon footprint estimator.
Expand Down Expand Up @@ -46,7 +46,7 @@
<platform name="android">
<hook src="hooks/before_build/android/android_copy_locales.js" type="before_build" />
<preference name="android-minSdkVersion" value="22" />
<preference name="android-targetSdkVersion" value="29" />
<preference name="android-targetSdkVersion" value="30" />
<preference name="AndroidXEnabled" value="true" />
<resource-file src="google-services.json" target="app/google-services.json" />
<hook src="hooks/before_build/android/android_set_provider.js" type="before_build" />
Expand Down
47 changes: 26 additions & 21 deletions package.cordovabuild.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "edu.berkeley.eecs.emission",
"version": "3.0.0",
"version": "3.1.0",
"displayName": "emission",
"license": "BSD-3-Clause",
"repository": {
Expand All @@ -18,22 +18,27 @@
"ios"
],
"plugins": {
"phonegap-plugin-push": {
"FCM_VERSION": "17.0.0"
"@havesource/cordova-plugin-push": {
"ANDROID_SUPPORT_V13_VERSION": "28.0.0",
"FCM_VERSION": "18.+",
"IOS_FIREBASE_MESSAGING_VERSION": "~> 6.32.2"
},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-app-version": {},
"cordova-plugin-file": {},
"cordova-plugin-device": {},
"cordova-plugin-customurlscheme": {
"URL_SCHEME": "emission"
"URL_SCHEME": "emission",
"ANDROID_SCHEME": " ",
"ANDROID_HOST": " ",
"ANDROID_PATHPREFIX": "/"
},
"cordova-plugin-email-composer": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-x-socialsharing": {
"PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."
"PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to share photos on social media.",
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to share photos on social media."
},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-local-notification": {},
Expand All @@ -48,9 +53,8 @@
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-whitelist": {},
"cordova-plugin-em-jwt-auth": {
"AUTH_VERSION": "17.0.0"
"AUTH_VERSION": "19.2.0"
},
"cordova-plugin-em-server-communication": {},
"cordova-plugin-em-datacollection": {
Expand All @@ -61,19 +65,20 @@
"cordova-plugin-em-transition-notify": {},
"cordova-plugin-em-unifiedlogger": {},
"cordova-plugin-em-usercache": {},
"cordova-plugin-androidx-adapter": {}
"cordova-plugin-androidx-adapter": {},
"phonegap-plugin-barcodescanner": {}
}
},
"dependencies": {
"cordova-android": "9.0.0",
"cordova-ios": "6.1.0",
"cordova-plugin-advanced-http": "3.0.0",
"cordova-android": "10.1.0",
"cordova-ios": "6.2.0",
"cordova-plugin-advanced-http": "3.2.2",
"cordova-plugin-androidx-adapter": "git+https://github.com/dpa99c/cordova-plugin-androidx-adapter.git",
"cordova-plugin-app-version": "0.1.9",
"cordova-plugin-customurlscheme": "5.0.1",
"cordova-plugin-device": "2.0.1",
"cordova-plugin-app-version": "0.1.12",
"cordova-plugin-customurlscheme": "5.0.2",
"cordova-plugin-device": "2.0.3",
"cordova-plugin-em-datacollection": "git+https://github.com/e-mission/e-mission-data-collection.git#v1.6.0",
"cordova-plugin-em-jwt-auth": "git+https://github.com/e-mission/cordova-jwt-auth.git#v1.6.4",
"cordova-plugin-em-jwt-auth": "git+https://github.com/e-mission/cordova-jwt-auth.git#v1.6.5",
"cordova-plugin-em-server-communication": "git+https://github.com/e-mission/cordova-server-communication.git#v1.2.3",
"cordova-plugin-em-serversync": "git+https://github.com/e-mission/cordova-server-sync.git#v1.2.5",
"cordova-plugin-em-settings": "git+https://github.com/e-mission/cordova-connection-settings.git#v1.2.2",
Expand All @@ -82,15 +87,15 @@
"cordova-plugin-em-usercache": "git+https://github.com/e-mission/cordova-usercache.git#v1.1.3",
"cordova-plugin-email-composer": "0.9.2",
"cordova-plugin-file": "6.0.2",
"cordova-plugin-inappbrowser": "4.0.0",
"cordova-plugin-ionic": "5.4.7",
"cordova-plugin-inappbrowser": "5.0.0",
"cordova-plugin-ionic": "5.5.1",
"cordova-plugin-ionic-keyboard": "2.2.0",
"cordova-plugin-ionic-webview": "5.0.0",
"cordova-plugin-local-notification": "0.9.0-beta.3",
"cordova-plugin-whitelist": "~1.3.3",
"cordova-plugin-x-socialsharing": "6.0.0",
"cordova-plugin-x-socialsharing": "6.0.3",
"fs-extra": "^9.0.1",
"klaw-sync": "^6.0.0",
"phonegap-plugin-push": "=2.3.0"
"phonegap-plugin-barcodescanner": "git+https://github.com/phonegap/phonegap-plugin-barcodescanner#v8.1.0",
"@havesource/cordova-plugin-push": "2.0.0"
}
}
10 changes: 5 additions & 5 deletions setup/export_shared_dep_versions.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export NVM_VERSION=0.36.0
export NODE_VERSION=14.7.0
export NPM_VERSION=6.14.8
export NVM_VERSION=0.39.0
export NODE_VERSION=14.18.1
export NPM_VERSION=6.14.15
export RUBY_VERSION=2.6.0
export COCOAPODS_VERSION=1.10.0
export GRADLE_VERSION=6.7
export COCOAPODS_VERSION=1.11.2
export GRADLE_VERSION=7.1.1

export NVM_DIR="$HOME/.nvm"
export RUBY_PATH=$HOME/.gem/ruby/$RUBY_VERSION/bin
5 changes: 0 additions & 5 deletions setup/setup_android_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ ANDROID_BUILD_TOOLS_VERSION=27.0.3
MIN_SDK_VERSION=21
TARGET_SDK_VERSION=28

echo "Uninstalling build tools > 30"
echo "As a temporary workaround until we upgrade to cordova 10"
SDKMANAGER=$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager
echo y | $SDKMANAGER --uninstall "build-tools;31.0.0"

# Setup the development environment
source setup/setup_shared.sh

Expand Down
2 changes: 1 addition & 1 deletion setup/setup_shared_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sed -i -e "s|/usr/bin/env node|/usr/bin/env node --unhandled-rejections=strict|"

npx cordova prepare

EXPECTED_COUNT=27
EXPECTED_COUNT=25
INSTALLED_COUNT=`npx cordova plugin list | wc -l`
echo "Found $INSTALLED_COUNT plugins, expected $EXPECTED_COUNT"
if [ $INSTALLED_COUNT -lt $EXPECTED_COUNT ];
Expand Down
12 changes: 12 additions & 0 deletions www/css/appstatus.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.status-red {
background-color: #ED2D3A;
color: white;
}
.status-yellow {
background-color: #FFC108;
color: white;
}
.status-green {
background-color: #30A64A;
color: white;
}
47 changes: 46 additions & 1 deletion www/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"control":{
"profile": "Profile",
"tracking": "Tracking",
"app-status": "App Status",
"medium-accuracy": "Medium accuracy",
"dark-theme": "Dark theme",
"force-sync": "Force sync",
Expand All @@ -77,7 +78,8 @@
"check-map": "Check map",
"collection": "Collection",
"sync": "Sync",
"transition-notify": "Transition Notify"
"transition-notify": "Transition Notify",
"button-accept": "I accept"
},

"general-settings":{
Expand Down Expand Up @@ -306,6 +308,49 @@
},

"intro": {
"appstatus": {
"locsettings": {
"name": "Location Settings",
"description": {
"android-lt-9": "Location services should be enabled and set to High Accuracy. This allows us to accurately record the trajectory of the travel",
"android-gte-9": "Location services should be enabled. This allows us to access location data and generate the trip log",
"ios": "Placeholder"
}
},
"locperms": {
"name": "Location Permissions",
"description": {
"android-lt-6": "Enabled during app installation.",
"android-6-9": "Please select 'allow'",
"android-10": "Please select 'Allow all the time'",
"android-gte-11": "On the app settings page, choose the 'Location' permission and set it to 'Allow all the time'",
"ios": "Placeholder"
}
},
"fitnessperms": {
"name": "Fitness Permission",
"description": {
"android": "Please allow.",
"ios": "Please allow."
}
},
"notificationperms": {
"app-enabled-name": "App Notifications",
"not-paused-name": "Not Paused",
"description": {
"android-enable": "On the app settings page, ensure that all notifications and channels are enabled.",
"android-unpause": "On the app settings page, ensure that all notifications are enabled. If this doesn't fix the problem, ask for help from your admin",
"ios": "Please allow."
}
},
"unusedapprestrict": {
"name": "Unused apps disabled",
"description": {
"android-disable": "On the app settings page, go to 'Permissions' and ensure that the app permissions will not be automatically reset.",
"ios": "Please allow."
}
}
},
"permissions": {
"locationPermExplanation-android-lt-6": "you accepted the permission during installation. You don't need to do anything now.",
"locationPermExplanation-android-6-9": "please select 'allow'",
Expand Down
3 changes: 3 additions & 0 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/intro.css" rel="stylesheet">
<link href="css/appstatus.css" rel="stylesheet">
<link href="css/main.recent.css" rel="stylesheet">
<link href="css/main.diary.css" rel="stylesheet">
<link href="lib/animate.css/animate.min.css" rel="stylesheet">
Expand Down Expand Up @@ -73,6 +74,7 @@
<script src="js/splash/pushnotify.js"></script>
<script src="js/splash/storedevicesettings.js"></script>
<script src="js/splash/localnotify.js"></script>
<script src="js/splash/remotenotify.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>
<script src="js/i18n-utils.js"></script>
Expand Down Expand Up @@ -116,6 +118,7 @@
<script src="js/plugin/logger.js"></script>
<script src="js/plugin/storage.js"></script>

<script src="js/appstatus/permissioncheck.js"></script>

<script src="lib/d3/d3.js"></script>
<script src="lib/nvd3/build/nv.d3.min.js"></script>
Expand Down
13 changes: 13 additions & 0 deletions www/js/appstatus/appstatus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Directive to display a set of configurable labels for each trip
* Assumptions:
* - The directive is embedded within an ion-view
* - The controller for the ion-view has a function called
* 'recomputeDisplayTrips` which modifies the trip *list* as necessary. An
* example with the label view is removing the labeled trips from the
* "toLabel" filter. Function can be a no-op (for example, in
* the diary view)
* - The view is associated with a state which we can record in the client stats.
* - The directive implements a `verifyTrip` function that can be invoked by
* other components.
*/
Loading