Skip to content

Commit

Permalink
Merge pull request #930 from shankari/upgrade_2023
Browse files Browse the repository at this point in the history
Last few changes + our plugin bump ups
  • Loading branch information
shankari authored Mar 17, 2023
2 parents 3a0bd44 + 2cf8cef commit a5f8bfd
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 77 deletions.
10 changes: 6 additions & 4 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="49" id="edu.berkeley.eecs.emission" ios-CFBundleVersion="47" version="3.2.6" 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="50" id="edu.berkeley.eecs.emission" ios-CFBundleVersion="48" version="3.2.7" 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 @@ -45,12 +45,14 @@
</platform>
<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="30" />
<preference name="android-minSdkVersion" value="23" />
<preference name="android-targetSdkVersion" value="32" />
<preference name="AndroidLaunchMode" value="singleInstance"/>
<preference name="AndroidXEnabled" value="true" />
<preference name="GradlePluginKotlinEnabled" value="true" />
<preference name="GradlePluginKotlinVersion" value="1.7.10" />
<resource-file src="google-services.json" target="app/google-services.json" />
<hook src="hooks/before_build/android/android_set_provider.js" type="before_build" />
<hook src="hooks/before_build/android/android_change_compile_implementation.js" type="before_build" />
<config-file parent="/manifest/application" target="AndroidManifest.xml">
<uses-library android:name="org.apache.http.legacy" android:required="false" />
</config-file>
Expand Down

This file was deleted.

30 changes: 17 additions & 13 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.2.6",
"version": "3.2.7",
"displayName": "emission",
"license": "BSD-3-Clause",
"repository": {
Expand All @@ -20,8 +20,8 @@
"plugins": {
"@havesource/cordova-plugin-push": {
"ANDROIDX_CORE_VERSION": "1.6.+",
"FCM_VERSION": "18.+",
"IOS_FIREBASE_MESSAGING_VERSION": "~> 6.32.2"
"FCM_VERSION": "23.+",
"IOS_FIREBASE_MESSAGING_VERSION": "~> 8.1.1"
},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-app-version": {},
Expand All @@ -39,24 +39,28 @@
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to share photos on social media."
},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-local-notification": {},
"cordova-plugin-local-notification-12": {
"ANDROID_SUPPORT_V4_VERSION": "26.+",
"ANDROIDX_VERSION": "1.2.0",
"ANDROIDX_APPCOMPAT_VERSION": "1.3.1"
},
"cordova-plugin-advanced-http": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-em-opcodeauth": {},
"cordova-plugin-em-server-communication": {},
"cordova-plugin-em-datacollection": {
"LOCATION_VERSION": "18.0.0",
"ANDROIDX_CORE_VERSION": "1.7.0",
"LOCATION_VERSION": "21.0.1",
"ANDROIDX_CORE_VERSION": "1.8.0",
"ANDROIDX_WORK_VERSION": "2.7.1"
},
"cordova-plugin-em-serversync": {},
"cordova-plugin-em-settings": {},
"cordova-plugin-em-unifiedlogger": {},
"cordova-plugin-em-usercache": {},
"cordova-plugin-androidx-adapter": {},
"phonegap-plugin-barcodescanner": {}
"cordova-plugin-barcode-qrscanner": {}
}
},
"dependencies": {
Expand All @@ -67,23 +71,23 @@
"cordova-plugin-app-version": "0.1.14",
"cordova-plugin-customurlscheme": "5.0.2",
"cordova-plugin-device": "2.1.0",
"cordova-plugin-em-datacollection": "git+https://github.com/e-mission/e-mission-data-collection.git#v1.7.5",
"cordova-plugin-em-datacollection": "git+https://github.com/e-mission/e-mission-data-collection.git#v1.7.6",
"cordova-plugin-em-opcodeauth": "git+https://github.com/e-mission/cordova-jwt-auth.git#v1.7.0",
"cordova-plugin-em-server-communication": "git+https://github.com/e-mission/cordova-server-communication.git#v1.2.5",
"cordova-plugin-em-serversync": "git+https://github.com/e-mission/cordova-server-sync.git#v1.3.0",
"cordova-plugin-em-serversync": "git+https://github.com/e-mission/cordova-server-sync.git#v1.3.1",
"cordova-plugin-em-settings": "git+https://github.com/e-mission/cordova-connection-settings.git#v1.2.3",
"cordova-plugin-em-unifiedlogger": "git+https://github.com/e-mission/cordova-unified-logger.git#v1.3.5",
"cordova-plugin-em-unifiedlogger": "git+https://github.com/e-mission/cordova-unified-logger.git#v1.3.6",
"cordova-plugin-em-usercache": "git+https://github.com/e-mission/cordova-usercache.git#v1.1.5",
"cordova-plugin-email-composer": "git+https://github.com/katzer/cordova-plugin-email-composer.git#0.10.1",
"cordova-plugin-file": "7.0.0",
"cordova-plugin-inappbrowser": "5.0.0",
"cordova-plugin-ionic-keyboard": "2.2.0",
"cordova-plugin-ionic-webview": "5.0.0",
"cordova-plugin-local-notification": "https://github.com/levanax/cordova-plugin-local-notifications.git#0362bc731a3f2241acadcc6a0cc63776806e851c",
"cordova-plugin-local-notification-12": "0.1.4",
"cordova-plugin-x-socialsharing": "6.0.4",
"fs-extra": "^9.0.1",
"klaw-sync": "^6.0.0",
"phonegap-plugin-barcodescanner": "git+https://github.com/phonegap/phonegap-plugin-barcodescanner#v8.1.0",
"@havesource/cordova-plugin-push": "3.0.1"
"cordova-plugin-barcode-qrscanner": "^3.0.12",
"@havesource/cordova-plugin-push": "git+https://github.com/havesource/cordova-plugin-push.git#4.0.0-dev.0"
}
}
2 changes: 2 additions & 0 deletions setup/android_sdk_packages
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ system-images;android-28;google_apis_playstore;x86_64
system-images;android-29;google_apis_playstore;x86_64
system-images;android-30;google_apis_playstore;x86_64
system-images;android-31;google_apis_playstore;x86_64
system-images;android-32;google_apis;x86_64
system-images;android-32;google_apis_playstore;x86_64
system-images;android-33;google_apis;x86_64
system-images;android-33;google_apis_playstore;x86_64
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=23
EXPECTED_COUNT=24
INSTALLED_COUNT=`npx cordova plugin list | wc -l`
echo "Found $INSTALLED_COUNT plugins, expected $EXPECTED_COUNT"
if [ $INSTALLED_COUNT -lt $EXPECTED_COUNT ];
Expand Down
13 changes: 11 additions & 2 deletions www/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@
"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'",
"android-11": "On the app settings page, choose the 'Location' permission and set it to 'Allow all the time'",
"android-gte-12": "On the app settings page, choose the 'Location' permission and set it to 'Allow all the time' and 'Precise'",
"ios-lt-13": "Please select 'Always allow'",
"ios-gte-13": "On the app settings page, please select 'Always' and 'Precise' and return here to continue"
}
Expand Down Expand Up @@ -378,7 +379,15 @@
"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.",
"android-disable-lt-12": "On the app settings page, go to 'Permissions' and ensure that the app permissions will not be automatically reset.",
"android-disable-gte-12": "On the app settings page, turn off 'Remove permissions and free up space.'",
"ios": "Please allow."
}
},
"ignorebatteryopt": {
"name": "Ignore battery optimizations",
"description": {
"android-disable": "On the optimization page, go to all apps, search for this app and turn off optimizations.",
"ios": "Please allow."
}
}
Expand Down
28 changes: 25 additions & 3 deletions www/js/appstatus/permissioncheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ controller("PermissionCheckControl", function($scope, $element, $attrs,
if (version < 9) {
androidSettingsDescTag = "intro.appstatus.locsettings.description.android-lt-9";
}
var androidPermDescTag = "intro.appstatus.locperms.description.android-gte-11";
var androidPermDescTag = "intro.appstatus.locperms.description.android-gte-12";
if($scope.osver < 6) {
androidPermDescTag = 'intro.appstatus.locperms.description.android-lt-6';
} else if ($scope.osver < 10) {
androidPermDescTag = "intro.appstatus.locperms.description.android-6-9";
} else if ($scope.osver < 11) {
androidPermDescTag= "intro.appstatus.locperms.description.android-10";
} else if ($scope.osver < 12) {
androidPermDescTag= "intro.appstatus.locperms.description.android-11";
}
console.log("description tags are "+androidSettingsDescTag+" "+androidPermDescTag);
// location settings
Expand Down Expand Up @@ -327,13 +329,33 @@ controller("PermissionCheckControl", function($scope, $element, $attrs,
return checkOrFix(unusedAppsUnrestrictedCheck, $window.cordova.plugins.BEMDataCollection.isUnusedAppUnrestricted,
$scope.recomputeBackgroundRestrictionStatus, showError=false);
};
let fixBatteryOpt = function() {
console.log("fix and refresh battery optimization permissions");
return checkOrFix(ignoreBatteryOptCheck, $window.cordova.plugins.BEMDataCollection.fixIgnoreBatteryOptimizations,
$scope.recomputeBackgroundRestrictionStatus, showError=true);
};
let checkBatteryOpt = function() {
console.log("fix and refresh battery optimization permissions");
return checkOrFix(ignoreBatteryOptCheck, $window.cordova.plugins.BEMDataCollection.isIgnoreBatteryOptimizations,
$scope.recomputeBackgroundRestrictionStatus, showError=false);
};
var androidUnusedDescTag = "intro.appstatus.unusedapprestrict.description.android-disable-gte-12";
if ($scope.osver < 12) {
androidUnusedDescTag= "intro.appstatus.unusedapprestrict.description.android-disable-lt-12";
}
let unusedAppsUnrestrictedCheck = {
name: $translate.instant("intro.appstatus.unusedapprestrict.name"),
desc: $translate.instant("intro.appstatus.unusedapprestrict.description.android-disable"),
desc: $translate.instant(androidUnusedDescTag),
fix: fixPerms,
refresh: checkPerms
}
$scope.backgroundRestrictionChecks = [unusedAppsUnrestrictedCheck];
let ignoreBatteryOptCheck = {
name: $translate.instant("intro.appstatus.ignorebatteryopt.name"),
desc: $translate.instant("intro.appstatus.ignorebatteryopt.description.android-disable"),
fix: fixBatteryOpt,
refresh: checkBatteryOpt
}
$scope.backgroundRestrictionChecks = [unusedAppsUnrestrictedCheck, ignoreBatteryOptCheck];
refreshChecks($scope.backgroundRestrictionChecks, $scope.recomputeBackgroundRestrictionStatus);
}

Expand Down

0 comments on commit a5f8bfd

Please sign in to comment.