diff --git a/.gitignore b/.gitignore
index 3a61f22..0f2c052 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,8 @@
/captures
output.json
+.idea/caches
+.idea/codeStyles
.idea/workspace.xml
.idea/libraries
.idea/dictionaries
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644
index 0000000..0463a28
--- /dev/null
+++ b/.idea/jarRepositories.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index cae1980..1e594e0 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,8 +2,8 @@
-
-
+
+
\ No newline at end of file
diff --git a/app/app.iml b/app/app.iml
index 499ac22..1cbe0f4 100644
--- a/app/app.iml
+++ b/app/app.iml
@@ -4,6 +4,8 @@
+
+
@@ -17,30 +19,30 @@
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
@@ -70,13 +72,6 @@
-
-
-
-
-
-
-
@@ -84,51 +79,69 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 21c4a18..dcbdeda 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,40 +1,21 @@
apply plugin: 'com.android.application'
+apply plugin: 'com.google.gms.google-services'
android {
- dexOptions {
- preDexLibraries = false
- }
-
- compileSdkVersion 26
- useLibrary 'org.apache.http.legacy'
+ compileSdkVersion 28
defaultConfig {
applicationId "com.red.alert"
- minSdkVersion 14
- targetSdkVersion 26
+ minSdkVersion 16
+ targetSdkVersion 28
versionCode 10099
versionName "1.0.9.9"
}
buildTypes {
release {
minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
-
- // Fixes "Duplicate files copied in APK" build bug
- packagingOptions {
- exclude 'META-INF/DEPENDENCIES.txt'
- exclude 'META-INF/LICENSE.txt'
- exclude 'META-INF/NOTICE.txt'
- exclude 'META-INF/NOTICE'
- exclude 'META-INF/LICENSE'
- exclude 'META-INF/DEPENDENCIES'
- exclude 'META-INF/notice.txt'
- exclude 'META-INF/license.txt'
- exclude 'META-INF/dependencies.txt'
- exclude 'META-INF/LGPL2.1'
- }
}
dependencies {
@@ -42,7 +23,10 @@ dependencies {
compile 'me.pushy:sdk:1.0.51'
// AppCompat v7 Dependency
- compile 'com.android.support:appcompat-v7:26.1.0'
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+
+ // Firebase Cloud Messaging
+ implementation "com.google.firebase:firebase-messaging:20.2.4"
// Google Play Services Dependencies
//noinspection GradleCompatible
diff --git a/app/google-services.json b/app/google-services.json
new file mode 100644
index 0000000..15ec590
--- /dev/null
+++ b/app/google-services.json
@@ -0,0 +1,40 @@
+{
+ "project_info": {
+ "project_number": "23150228579",
+ "firebase_url": "https://redalert-api.firebaseio.com",
+ "project_id": "redalert-api",
+ "storage_bucket": "redalert-api.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:23150228579:android:44c53eddc1bb72f6",
+ "android_client_info": {
+ "package_name": "com.red.alert"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "23150228579-60doeebh24udmpb2t3aq7672c2a5edsd.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyCoL_3SJ4Vlp7lP777Kp9pc1LIchdGM3og"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": [
+ {
+ "client_id": "23150228579-60doeebh24udmpb2t3aq7672c2a5edsd.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 755adfc..c2850ea 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -18,14 +18,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
@@ -193,8 +149,7 @@
-
-
+
@@ -214,7 +169,7 @@
+ android:exported="false" />
diff --git a/app/src/main/java/com/betomaluje/miband/bluetooth/MiBandWrapper.java b/app/src/main/java/com/betomaluje/miband/bluetooth/MiBandWrapper.java
index f10eb2d..b601cbf 100644
--- a/app/src/main/java/com/betomaluje/miband/bluetooth/MiBandWrapper.java
+++ b/app/src/main/java/com/betomaluje/miband/bluetooth/MiBandWrapper.java
@@ -2,7 +2,7 @@
import android.content.Context;
import android.content.Intent;
-import android.support.v4.content.LocalBroadcastManager;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import java.util.HashMap;
import java.util.Map;
diff --git a/app/src/main/java/com/red/alert/activities/AlertPopup.java b/app/src/main/java/com/red/alert/activities/AlertPopup.java
index f295256..d6ff2a6 100644
--- a/app/src/main/java/com/red/alert/activities/AlertPopup.java
+++ b/app/src/main/java/com/red/alert/activities/AlertPopup.java
@@ -4,7 +4,7 @@
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
+import androidx.appcompat.app.AppCompatActivity;
import android.view.Gravity;
import android.view.MenuItem;
import android.view.View;
diff --git a/app/src/main/java/com/red/alert/activities/AlertView.java b/app/src/main/java/com/red/alert/activities/AlertView.java
index 0dba200..48abb94 100644
--- a/app/src/main/java/com/red/alert/activities/AlertView.java
+++ b/app/src/main/java/com/red/alert/activities/AlertView.java
@@ -5,9 +5,9 @@
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Handler;
-import android.support.v4.app.ActivityCompat;
-import android.support.v4.view.MenuItemCompat;
-import android.support.v7.app.AppCompatActivity;
+import androidx.core.app.ActivityCompat;
+import androidx.core.view.MenuItemCompat;
+import androidx.appcompat.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
@@ -164,7 +164,7 @@ private String getShareMessage() {
String cityName = LocationData.getLocalizedCityName(mAlertCity, this);
// Construct share message
- return getString(R.string.alertSoundedAt) + cityName + " (" + LocationData.getLocalizedZoneByCityName(mAlertCity, this) + ") " + getString(R.string.atTime) + " " + mAlertDateString + " " + getString(R.string.alertSentVia);
+ return getString(R.string.alertSoundedAt) + " " + cityName + " (" + LocationData.getLocalizedZoneByCityName(mAlertCity, this) + ") " + getString(R.string.atTime) + " " + mAlertDateString + " " + getString(R.string.alertSentVia);
}
void initializeShareButton(Menu OptionsMenu) {
diff --git a/app/src/main/java/com/red/alert/activities/Main.java b/app/src/main/java/com/red/alert/activities/Main.java
index 2f666c2..01c8dc6 100644
--- a/app/src/main/java/com/red/alert/activities/Main.java
+++ b/app/src/main/java/com/red/alert/activities/Main.java
@@ -5,8 +5,10 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
-import android.support.v4.view.MenuItemCompat;
-import android.support.v7.app.AppCompatActivity;
+import androidx.core.view.MenuItemCompat;
+import androidx.appcompat.app.AppCompatActivity;
+
+
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
@@ -26,13 +28,11 @@
import com.red.alert.config.Integrations;
import com.red.alert.config.Logging;
import com.red.alert.config.RecentAlerts;
-import com.red.alert.logic.alerts.AlertLogic;
import com.red.alert.logic.communication.broadcasts.SettingsEvents;
import com.red.alert.logic.communication.intents.AlertViewParameters;
import com.red.alert.logic.communication.intents.MainActivityParameters;
import com.red.alert.logic.integration.BluetoothIntegration;
-import com.red.alert.logic.notifications.RocketNotifications;
-import com.red.alert.logic.push.GCMRegistration;
+import com.red.alert.logic.push.FCMRegistration;
import com.red.alert.logic.push.PushyRegistration;
import com.red.alert.logic.services.ServiceManager;
import com.red.alert.logic.settings.AppPreferences;
@@ -270,8 +270,8 @@ protected void onPause() {
}
void showImportantDialogs() {
- // Do we need to register for GCM or Pushy?
- if (!GCMRegistration.isRegistered(this) || !PushyRegistration.isRegistered(this)) {
+ // Do we need to register for FCM or Pushy?
+ if (!FCMRegistration.isRegistered(this) || !PushyRegistration.isRegistered(this)) {
// Register async
new RegisterPushAsync().execute();
@@ -625,8 +625,8 @@ protected Exception doInBackground(Integer... Parameter) {
// Make sure we have Google Play Services installed
if (GooglePlayServices.isAvailable(Main.this)) {
try {
- // Register for GCM push notifications
- GCMRegistration.registerForPushNotifications(Main.this);
+ // Register for FCM push notifications
+ FCMRegistration.registerForPushNotifications(Main.this);
}
catch (Exception exc) {
error = exc;
@@ -694,4 +694,4 @@ protected void onPostExecute(String newVersion) {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/app/src/main/java/com/red/alert/activities/settings/General.java b/app/src/main/java/com/red/alert/activities/settings/General.java
index ad28fe4..9973bf7 100644
--- a/app/src/main/java/com/red/alert/activities/settings/General.java
+++ b/app/src/main/java/com/red/alert/activities/settings/General.java
@@ -13,7 +13,7 @@
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceCategory;
-import android.support.v4.view.MenuItemCompat;
+import androidx.core.view.MenuItemCompat;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
@@ -31,7 +31,7 @@
import com.red.alert.logic.communication.broadcasts.SelfTestEvents;
import com.red.alert.logic.communication.broadcasts.SettingsEvents;
import com.red.alert.logic.integration.BluetoothIntegration;
-import com.red.alert.logic.push.GCMRegistration;
+import com.red.alert.logic.push.FCMRegistration;
import com.red.alert.logic.push.PushyRegistration;
import com.red.alert.logic.settings.AppPreferences;
import com.red.alert.model.req.SelfTestRequest;
@@ -53,7 +53,7 @@
public class General extends AppCompatPreferenceActivity {
boolean mIsTesting;
boolean mIsDestroyed;
- boolean mGcmTestPassed;
+ boolean mFcmTestPassed;
boolean mPushyTestPassed;
MenuItem mLoadingItem;
@@ -78,9 +78,9 @@ public void onSharedPreferenceChanged(SharedPreferences Preferences, String Key)
refreshAreaValues();
}
- // GCM test passed?
- if (Key.equalsIgnoreCase(SelfTestEvents.GCM_TEST_PASSED)) {
- mGcmTestPassed = true;
+ // FCM test passed?
+ if (Key.equalsIgnoreCase(SelfTestEvents.FCM_TEST_PASSED)) {
+ mFcmTestPassed = true;
}
// Pushy test passed?
@@ -428,8 +428,8 @@ String getContactEmailBody() {
body += "location.enabled=" + AppPreferences.getLocationAlertsEnabled(this) + ", ";
body += "volume.primary=" + AppPreferences.getPrimaryAlertVolume(this, -1) + ", ";
body += "volume.secondary=" + AppPreferences.getSecondaryAlertVolume(this, -1) + ", ";
- body += "gcm=" + GCMRegistration.isRegistered(this) + ", ";
- body += "gcm.token=" + GCMRegistration.getRegistrationToken(this) + ", ";
+ body += "fcm=" + FCMRegistration.isRegistered(this) + ", ";
+ body += "fcm.token=" + FCMRegistration.getRegistrationToken(this) + ", ";
body += "pushy=" + PushyRegistration.isRegistered(this) + ", ";
body += "pushy.token=" + PushyRegistration.getRegistrationToken(this) + ", ";
body += "android.sdk=" + Build.VERSION.SDK_INT + ", ";
@@ -470,21 +470,21 @@ void sendTestPushViaPushy() throws Exception {
HTTP.post(API.API_ENDPOINT + "/test", Singleton.getJackson().writeValueAsString(test));
}
- void sendTestPushViaGcm() throws Exception {
+ void sendTestPushViaFcm() throws Exception {
// Log to logcat
- Log.d(Logging.TAG, "Testing GCM...");
+ Log.d(Logging.TAG, "Testing FCM...");
// Reset test flag
- mGcmTestPassed = false;
+ mFcmTestPassed = false;
// Not registered?
- if (!GCMRegistration.isRegistered(this)) {
+ if (!FCMRegistration.isRegistered(this)) {
// No need for localization - only shows up in logcat for now
- throw new Exception("The device is not registered for push notifications via GCM.");
+ throw new Exception("The device is not registered for push notifications via FCM.");
}
// Grab registration token
- String token = GCMRegistration.getRegistrationToken(this);
+ String token = FCMRegistration.getRegistrationToken(this);
// Get user's locale
String locale = getResources().getConfiguration().locale.getLanguage();
@@ -496,12 +496,12 @@ void sendTestPushViaGcm() throws Exception {
HTTP.post(API.API_ENDPOINT + "/test", Singleton.getJackson().writeValueAsString(test));
}
- boolean didPassGcmTest() {
+ boolean didPassFcmTest() {
// Calculate the max timestamp
long maxTimestamp = System.currentTimeMillis() + Testing.PUSH_GATEWAY_TIMEOUT_SECONDS * 1000;
// Wait until boolean value changes or enough time passes
- while (!mGcmTestPassed && System.currentTimeMillis() < maxTimestamp) {
+ while (!mFcmTestPassed && System.currentTimeMillis() < maxTimestamp) {
// Sleep to relieve the thread
try {
Thread.sleep(100);
@@ -511,7 +511,7 @@ boolean didPassGcmTest() {
}
// Return the outcome of the test
- return mGcmTestPassed;
+ return mFcmTestPassed;
}
boolean didPassPushyTest() {
@@ -639,31 +639,31 @@ protected void onProgressUpdate(String... value) {
@Override
protected Integer doInBackground(Integer... Parameter) {
// Test results
- boolean gcmFailed = false, pushyFailed = false;
+ boolean fcmFailed = false, pushyFailed = false;
- // IsTesting GCM
- publishProgress(getString(R.string.testingGCM));
+ // IsTesting FCM
+ publishProgress(getString(R.string.testingFCM));
try {
// Send a test push
- sendTestPushViaGcm();
+ sendTestPushViaFcm();
}
catch (Exception exc) {
- // GCM test is done
- gcmFailed = true;
+ // FCM test is done
+ fcmFailed = true;
// Log to console
- Log.e(Logging.TAG, "GCM test failed", exc);
+ Log.e(Logging.TAG, "FCM test failed", exc);
}
// Wait for test push to arrive
- if (!gcmFailed) {
- if (!didPassGcmTest()) {
- gcmFailed = true;
+ if (!fcmFailed) {
+ if (!didPassFcmTest()) {
+ fcmFailed = true;
}
}
- // Done with GCM, testing Pushy
+ // Done with FCM, testing Pushy
publishProgress(getString(R.string.testingPushy));
try {
@@ -686,24 +686,24 @@ protected Integer doInBackground(Integer... Parameter) {
}
// At least one passed?
- if (!gcmFailed || !pushyFailed) {
+ if (!fcmFailed || !pushyFailed) {
// Display "successful test" message
AlertLogic.processIncomingAlert(getString(R.string.testSuccessful), AlertTypes.TEST, General.this);
}
// Both succeeded?
- if (!gcmFailed && !pushyFailed) {
+ if (!fcmFailed && !pushyFailed) {
return R.string.testSuccessfulLong;
}
// Both failed?
- else if (gcmFailed && pushyFailed) {
+ else if (fcmFailed && pushyFailed) {
return R.string.testFailed;
}
- // Only GCM failed?
- else if (gcmFailed) {
- return R.string.gcmTestFailed;
+ // Only FCM failed?
+ else if (fcmFailed) {
+ return R.string.fcmTestFailed;
}
// Only Pushy failed?
diff --git a/app/src/main/java/com/red/alert/config/push/FCMGateway.java b/app/src/main/java/com/red/alert/config/push/FCMGateway.java
new file mode 100644
index 0000000..4f1f671
--- /dev/null
+++ b/app/src/main/java/com/red/alert/config/push/FCMGateway.java
@@ -0,0 +1,12 @@
+package com.red.alert.config.push;
+
+public class FCMGateway {
+ // FCM Sender ID
+ public static String SENDER_ID = "23150228579";
+
+ // FCM Scope
+ public static String SCOPE = "*";
+
+ // FCM Topic Name for PubSub push notifications
+ public static String ALERTS_TOPIC = "alerts";
+}
diff --git a/app/src/main/java/com/red/alert/config/push/GCMGateway.java b/app/src/main/java/com/red/alert/config/push/GCMGateway.java
deleted file mode 100644
index 9ff9671..0000000
--- a/app/src/main/java/com/red/alert/config/push/GCMGateway.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.red.alert.config.push;
-
-public class GCMGateway {
- // GCM Sender ID for registration
- public static String SENDER_ID = "23150228579";
-
- // GCM Topic ID for PubSub push notifications
- public static String ALERTS_TOPIC = "/topics/alerts";
-}
diff --git a/app/src/main/java/com/red/alert/logic/communication/broadcasts/SelfTestEvents.java b/app/src/main/java/com/red/alert/logic/communication/broadcasts/SelfTestEvents.java
index 7fd29d2..6868fc8 100644
--- a/app/src/main/java/com/red/alert/logic/communication/broadcasts/SelfTestEvents.java
+++ b/app/src/main/java/com/red/alert/logic/communication/broadcasts/SelfTestEvents.java
@@ -1,6 +1,6 @@
package com.red.alert.logic.communication.broadcasts;
public class SelfTestEvents {
- public static final String GCM_TEST_PASSED = "GCMTestPassed";
+ public static final String FCM_TEST_PASSED = "FCMTestPassed";
public static final String PUSHY_TEST_PASSED = "PushyTestPassed";
}
diff --git a/app/src/main/java/com/red/alert/logic/communication/push/GCMPushParameters.java b/app/src/main/java/com/red/alert/logic/communication/push/FCMPushParameters.java
similarity index 86%
rename from app/src/main/java/com/red/alert/logic/communication/push/GCMPushParameters.java
rename to app/src/main/java/com/red/alert/logic/communication/push/FCMPushParameters.java
index db01474..8904b44 100644
--- a/app/src/main/java/com/red/alert/logic/communication/push/GCMPushParameters.java
+++ b/app/src/main/java/com/red/alert/logic/communication/push/FCMPushParameters.java
@@ -1,6 +1,6 @@
package com.red.alert.logic.communication.push;
-public class GCMPushParameters {
+public class FCMPushParameters {
public static final String ALERT_TYPE = "type";
public static final String ALERT_AREAS = "areas";
public static final String ALERT_CITIES = "cities";
diff --git a/app/src/main/java/com/red/alert/logic/notifications/RocketNotifications.java b/app/src/main/java/com/red/alert/logic/notifications/RocketNotifications.java
index 7cda248..661bf27 100644
--- a/app/src/main/java/com/red/alert/logic/notifications/RocketNotifications.java
+++ b/app/src/main/java/com/red/alert/logic/notifications/RocketNotifications.java
@@ -6,7 +6,7 @@
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.graphics.Color;
-import android.support.v4.app.NotificationCompat;
+import androidx.core.app.NotificationCompat;
import android.util.Log;
import android.widget.Toast;
diff --git a/app/src/main/java/com/red/alert/logic/push/GCMRegistration.java b/app/src/main/java/com/red/alert/logic/push/FCMRegistration.java
similarity index 54%
rename from app/src/main/java/com/red/alert/logic/push/GCMRegistration.java
rename to app/src/main/java/com/red/alert/logic/push/FCMRegistration.java
index 00aedfc..23f7e43 100644
--- a/app/src/main/java/com/red/alert/logic/push/GCMRegistration.java
+++ b/app/src/main/java/com/red/alert/logic/push/FCMRegistration.java
@@ -4,44 +4,34 @@
import android.content.SharedPreferences;
import android.util.Log;
-import com.google.android.gms.gcm.GcmPubSub;
-import com.google.android.gms.gcm.GoogleCloudMessaging;
-import com.google.android.gms.iid.InstanceID;
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.Task;
+import com.google.firebase.iid.FirebaseInstanceId;
+import com.google.firebase.messaging.FirebaseMessaging;
import com.red.alert.R;
import com.red.alert.config.API;
import com.red.alert.config.Logging;
-import com.red.alert.config.push.GCMGateway;
+import com.red.alert.config.push.FCMGateway;
import com.red.alert.model.req.RegistrationRequest;
import com.red.alert.utils.caching.Singleton;
import com.red.alert.utils.integration.GooglePlayServices;
import com.red.alert.utils.networking.HTTP;
-public class GCMRegistration {
- public static void registerForPushNotifications(Context context) throws Exception {
+import androidx.annotation.NonNull;
+
+public class FCMRegistration {
+ public static void registerForPushNotifications(final Context context) throws Exception {
// Make sure we have Google Play Services
if (!GooglePlayServices.isAvailable(context)) {
// Throw exception
throw new Exception(context.getString(R.string.noGooglePlayServices));
}
- // Get instance ID API
- InstanceID instanceID = InstanceID.getInstance(context);
-
- // Get a GCM registration token
- String token = instanceID.getToken(GCMGateway.SENDER_ID, GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
+ // Get an FCM registration token
+ final String token = FirebaseInstanceId.getInstance().getToken(FCMGateway.SENDER_ID, FCMGateway.SCOPE);
// Log to logcat
- Log.d(Logging.TAG, "GCM registration success: " + token);
-
- // Get GCM PubSub handler
- GcmPubSub pubSub = GcmPubSub.getInstance(context);
-
- // Subscribe to alerts topic
- // (limited to 1M subscriptions app-wide - think about how to scale this when the time comes)
- pubSub.subscribe(token, GCMGateway.ALERTS_TOPIC, null);
-
- // Log it
- Log.d(Logging.TAG, "GCM subscription success: " + GCMGateway.ALERTS_TOPIC);
+ Log.d(Logging.TAG, "FCM registration success: " + token);
// Prepare an object to store and send the registration token to our API
RegistrationRequest register = new RegistrationRequest(token, API.PLATFORM_IDENTIFIER);
@@ -49,13 +39,28 @@ public static void registerForPushNotifications(Context context) throws Exceptio
// Send the request to our API
HTTP.post(API.API_ENDPOINT + "/register", Singleton.getJackson().writeValueAsString(register));
- // Persist it locally
- saveRegistrationToken(context, token);
+ // Subscribe to alerts topic
+ FirebaseMessaging.getInstance().subscribeToTopic(FCMGateway.ALERTS_TOPIC)
+ .addOnCompleteListener(new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+ if (!task.isSuccessful()) {
+ Log.e(Logging.TAG, "FCM subscribe failed: ", task.getException());
+ return;
+ }
+
+ // Log it
+ Log.d(Logging.TAG, "FCM subscribe success: " + FCMGateway.ALERTS_TOPIC);
+
+ // Persist token locally
+ saveRegistrationToken(context, token);
+ }
+ });
}
public static String getRegistrationToken(Context context) {
// Get it from SharedPreferences (may be null)
- return Singleton.getSharedPreferences(context).getString(context.getString(R.string.gcmTokenPref), null);
+ return Singleton.getSharedPreferences(context).getString(context.getString(R.string.fcmTokenPref), null);
}
public static boolean isRegistered(Context context) {
@@ -68,7 +73,7 @@ public static void saveRegistrationToken(Context context, String registrationTok
SharedPreferences.Editor editor = Singleton.getSharedPreferences(context).edit();
// Store boolean value
- editor.putString(context.getString(R.string.gcmTokenPref), registrationToken);
+ editor.putString(context.getString(R.string.fcmTokenPref), registrationToken);
// Save and flush
editor.commit();
diff --git a/app/src/main/java/com/red/alert/model/req/SelfTestRequest.java b/app/src/main/java/com/red/alert/model/req/SelfTestRequest.java
index 9ed7d89..f9159a2 100644
--- a/app/src/main/java/com/red/alert/model/req/SelfTestRequest.java
+++ b/app/src/main/java/com/red/alert/model/req/SelfTestRequest.java
@@ -13,7 +13,7 @@ public class SelfTestRequest {
public String locale;
public SelfTestRequest(String token, String locale, String platform) {
- // Set GCM registration token
+ // Set FCM/Pushy registration token
this.token = token;
// Set the push type
diff --git a/app/src/main/java/com/red/alert/receivers/BootReceiver.java b/app/src/main/java/com/red/alert/receivers/BootReceiver.java
index f15bca6..c06739a 100644
--- a/app/src/main/java/com/red/alert/receivers/BootReceiver.java
+++ b/app/src/main/java/com/red/alert/receivers/BootReceiver.java
@@ -2,7 +2,7 @@
import android.content.Context;
import android.content.Intent;
-import android.support.v4.content.WakefulBroadcastReceiver;
+import androidx.legacy.content.WakefulBroadcastReceiver;
import com.red.alert.logic.services.ServiceManager;
diff --git a/app/src/main/java/com/red/alert/receivers/NotificationDeletedReceiver.java b/app/src/main/java/com/red/alert/receivers/NotificationDeletedReceiver.java
index 07cbdac..9c6ffe7 100644
--- a/app/src/main/java/com/red/alert/receivers/NotificationDeletedReceiver.java
+++ b/app/src/main/java/com/red/alert/receivers/NotificationDeletedReceiver.java
@@ -2,7 +2,7 @@
import android.content.Context;
import android.content.Intent;
-import android.support.v4.content.WakefulBroadcastReceiver;
+import androidx.legacy.content.WakefulBroadcastReceiver;
import com.red.alert.logic.communication.intents.RocketNotificationParameters;
import com.red.alert.logic.feedback.sound.SoundLogic;
diff --git a/app/src/main/java/com/red/alert/receivers/UpdateReceiver.java b/app/src/main/java/com/red/alert/receivers/UpdateReceiver.java
deleted file mode 100644
index e56326a..0000000
--- a/app/src/main/java/com/red/alert/receivers/UpdateReceiver.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.red.alert.receivers;
-
-import android.content.Context;
-import android.content.Intent;
-import android.support.v4.content.WakefulBroadcastReceiver;
-import android.util.Log;
-
-import com.red.alert.config.Logging;
-import com.red.alert.services.gcm.GCMRegistrationService;
-
-public class UpdateReceiver extends WakefulBroadcastReceiver {
- @Override
- public void onReceive(Context context, Intent intent) {
- // Got package replaced event?
- if (intent.ACTION_PACKAGE_REPLACED.equals(intent.getAction())) {
- // Is it this package?
- if (intent.getData().getSchemeSpecificPart().equals(context.getPackageName())) {
- // Log it
- Log.d(Logging.TAG, "App updated");
-
- // Call the intent service to re-register the device
- Intent gcmIntent = new Intent(context, GCMRegistrationService.class);
-
- // Start service (since this may take a while)
- context.startService(gcmIntent);
- }
- }
- }
-}
diff --git a/app/src/main/java/com/red/alert/receivers/pushy/PushyPushReceiver.java b/app/src/main/java/com/red/alert/receivers/pushy/PushyPushReceiver.java
index 57f8b4a..e24523b 100644
--- a/app/src/main/java/com/red/alert/receivers/pushy/PushyPushReceiver.java
+++ b/app/src/main/java/com/red/alert/receivers/pushy/PushyPushReceiver.java
@@ -8,15 +8,15 @@
import com.red.alert.config.Logging;
import com.red.alert.logic.alerts.AlertLogic;
import com.red.alert.logic.communication.broadcasts.SelfTestEvents;
-import com.red.alert.logic.communication.push.GCMPushParameters;
+import com.red.alert.logic.communication.push.FCMPushParameters;
import com.red.alert.utils.communication.Broadcasts;
public class PushyPushReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// Grab push data from extras
- String alertType = intent.getStringExtra(GCMPushParameters.ALERT_TYPE);
- String alertCities = intent.getStringExtra(GCMPushParameters.ALERT_CITIES);
+ String alertType = intent.getStringExtra(FCMPushParameters.ALERT_TYPE);
+ String alertCities = intent.getStringExtra(FCMPushParameters.ALERT_CITIES);
// Bad push?
if (alertType == null || alertCities == null) {
diff --git a/app/src/main/java/com/red/alert/services/fcm/FirebaseService.java b/app/src/main/java/com/red/alert/services/fcm/FirebaseService.java
new file mode 100644
index 0000000..89d2509
--- /dev/null
+++ b/app/src/main/java/com/red/alert/services/fcm/FirebaseService.java
@@ -0,0 +1,64 @@
+package com.red.alert.services.fcm;
+
+import android.util.Log;
+
+import com.google.firebase.messaging.FirebaseMessagingService;
+import com.google.firebase.messaging.RemoteMessage;
+import com.red.alert.config.Logging;
+import com.red.alert.logic.alerts.AlertLogic;
+import com.red.alert.logic.communication.broadcasts.SelfTestEvents;
+import com.red.alert.logic.communication.push.FCMPushParameters;
+import com.red.alert.logic.push.FCMRegistration;
+import com.red.alert.utils.communication.Broadcasts;
+
+import java.util.Map;
+
+public class FirebaseService extends FirebaseMessagingService {
+ @Override
+ public void onNewToken(String token) {
+ // Check whether FCM is already registered and token was changed
+ if (FCMRegistration.isRegistered(this) && !FCMRegistration.getRegistrationToken(this).equals(token)) {
+ try {
+ // Refresh the registration ID
+ FCMRegistration.registerForPushNotifications(this);
+ } catch (Exception exc) {
+ // Log it
+ Log.e(Logging.TAG, "FCM token update failed", exc);
+ }
+ }
+ }
+
+ @Override
+ public void onMessageReceived(RemoteMessage remoteMessage) {
+ // Get payload map
+ Map data = remoteMessage.getData();
+
+ // Grab push data from extras
+ String alertType = data.get(FCMPushParameters.ALERT_TYPE);
+ String alertCities = data.get(FCMPushParameters.ALERT_CITIES);
+
+ // Bad push?
+ if (alertType == null || alertCities == null) {
+ // Log it
+ Log.e(Logging.TAG, "Malformed push received via FCM");
+
+ // Stop execution to prevent crash
+ return;
+ }
+
+ // Test alert?
+ if (alertType.equals("test")) {
+ // Log success
+ Log.d(Logging.TAG, "FCM test passed");
+
+ // Mark test as complete via broadcast
+ Broadcasts.publish(this, SelfTestEvents.FCM_TEST_PASSED);
+
+ // Stop execution (we don't want any visible notification)
+ return;
+ }
+
+ // Receive the alert
+ AlertLogic.processIncomingAlert(alertCities, alertType, this);
+ }
+}
diff --git a/app/src/main/java/com/red/alert/services/gcm/GCMInstanceIDService.java b/app/src/main/java/com/red/alert/services/gcm/GCMInstanceIDService.java
deleted file mode 100644
index eaa83cb..0000000
--- a/app/src/main/java/com/red/alert/services/gcm/GCMInstanceIDService.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.red.alert.services.gcm;
-
-import android.content.Intent;
-
-import com.google.android.gms.iid.InstanceIDListenerService;
-
-public class GCMInstanceIDService extends InstanceIDListenerService {
- /**
- * Called if InstanceID token is updated. This may occur if the security of
- * the previous token had been compromised. This call is initiated by the
- * InstanceID provider.
- */
-
- @Override
- public void onTokenRefresh() {
- // Call the intent service to re-register the device
- Intent intent = new Intent(this, GCMRegistrationService.class);
-
- // Start service (since this may take a while)
- startService(intent);
- }
-}
diff --git a/app/src/main/java/com/red/alert/services/gcm/GCMPushReceiverService.java b/app/src/main/java/com/red/alert/services/gcm/GCMPushReceiverService.java
deleted file mode 100644
index d7bd446..0000000
--- a/app/src/main/java/com/red/alert/services/gcm/GCMPushReceiverService.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.red.alert.services.gcm;
-
-import android.os.Bundle;
-import android.util.Log;
-
-import com.google.android.gms.gcm.GcmListenerService;
-import com.red.alert.config.Logging;
-import com.red.alert.logic.alerts.AlertLogic;
-import com.red.alert.logic.communication.broadcasts.SelfTestEvents;
-import com.red.alert.logic.communication.push.GCMPushParameters;
-import com.red.alert.utils.communication.Broadcasts;
-
-public class GCMPushReceiverService extends GcmListenerService {
- @Override
- public void onMessageReceived(String from, Bundle data) {
- // Grab push data from extras
- String alertType = data.getString(GCMPushParameters.ALERT_TYPE);
- String alertCities = data.getString(GCMPushParameters.ALERT_CITIES);
-
- // Bad push?
- if (alertType == null || alertCities == null) {
- // Log it
- Log.e(Logging.TAG, "Malformed push received via GCM");
-
- // Stop execution to prevent crash
- return;
- }
-
- // Test alert?
- if (alertType.equals("test")) {
- // Log success
- Log.d(Logging.TAG, "GCM test passed");
-
- // Mark test as complete via broadcast
- Broadcasts.publish(this, SelfTestEvents.GCM_TEST_PASSED);
-
- // Stop execution (we don't want any visible notification)
- return;
- }
-
- // Receive the alert
- AlertLogic.processIncomingAlert(alertCities, alertType, this);
- }
-}
diff --git a/app/src/main/java/com/red/alert/services/gcm/GCMRegistrationService.java b/app/src/main/java/com/red/alert/services/gcm/GCMRegistrationService.java
deleted file mode 100644
index f715dd3..0000000
--- a/app/src/main/java/com/red/alert/services/gcm/GCMRegistrationService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.red.alert.services.gcm;
-
-import android.app.IntentService;
-import android.content.Intent;
-import android.util.Log;
-
-import com.red.alert.config.Logging;
-import com.red.alert.logic.push.GCMRegistration;
-
-public class GCMRegistrationService extends IntentService {
- private static final String TAG = "GCMRegistrationIntentService";
-
- public GCMRegistrationService() {
- // Call super with service class name
- super(TAG);
- }
-
- @Override
- protected void onHandleIntent(Intent intent) {
- try {
- // Refresh the registration ID
- GCMRegistration.registerForPushNotifications(this);
- }
- catch (Exception exc) {
- // Log it
- Log.e(Logging.TAG, "Registration failed", exc);
- }
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/red/alert/ui/activities/AppCompatPreferenceActivity.java b/app/src/main/java/com/red/alert/ui/activities/AppCompatPreferenceActivity.java
index 7cbe775..f2fc0da 100644
--- a/app/src/main/java/com/red/alert/ui/activities/AppCompatPreferenceActivity.java
+++ b/app/src/main/java/com/red/alert/ui/activities/AppCompatPreferenceActivity.java
@@ -19,11 +19,11 @@
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceActivity;
-import android.support.annotation.LayoutRes;
-import android.support.annotation.Nullable;
-import android.support.v7.app.ActionBar;
-import android.support.v7.app.AppCompatDelegate;
-import android.support.v7.widget.Toolbar;
+import androidx.annotation.LayoutRes;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.ActionBar;
+import androidx.appcompat.app.AppCompatDelegate;
+import androidx.appcompat.widget.Toolbar;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 1c021a8..61509a4 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -150,7 +150,7 @@
Teile die Meldung
- Ein code-red-Alarm hörte sich aus A code red alert sounded off in
+ Ein code-red-Alarm hörte sich aus
beim
- Gesendet mit RedAlert für Android - https://redalert.me
@@ -161,9 +161,9 @@
Meldungen werden als Popup Anzeigen
Raketen Alamirungen werden in einem pop-up fenster Angezeigt.
Lade..
- Push Gateway wird Getestet... (1/2)
+ Push Gateway wird Getestet... (1/2)
Push Gateway wird Getestet... (2/2)
- Der Selbsttest scheiterte teilweise. Es wurde keine Warnung vom Google-Push-Gateway empfangen, aber eine Warnung wurde erfolgreich über das sekundäre Push-Gateway empfangen. Bitte versuchen Sie es später noch einmal.
+ Der Selbsttest scheiterte teilweise. Es wurde keine Warnung vom Google-Push-Gateway empfangen, aber eine Warnung wurde erfolgreich über das sekundäre Push-Gateway empfangen. Bitte versuchen Sie es später noch einmal.
Der Selbsttest scheiterte teilweise. Es wurde kein Alarm vom sekundären Push-Gateway empfangen, aber eine Warnung wurde erfolgreich über das Google-Push-Gateway empfangen. Bitte versuchen Sie es später noch einmal.
Zusätzliche Informationen:
Der Test wurde erfolgreich abgeschlossen!
diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml
index 8389a83..066008c 100644
--- a/app/src/main/res/values-en/strings.xml
+++ b/app/src/main/res/values-en/strings.xml
@@ -162,9 +162,9 @@
Show popup
Rocket alerts will be displayed in a pop-up window.
Loading..
- Testing push gateway... (1/2)
+ Testing push gateway... (1/2)
Testing push gateway... (2/2)
- The self-test failed partially. No alert was received from Google\'s push gateway, but an alert was successfully received via the secondary push gateway. Please try again later.
+ The self-test failed partially. No alert was received from Google\'s push gateway, but an alert was successfully received via the secondary push gateway. Please try again later.
The self-test failed partially. No alert was received from the secondary push gateway, but an alert was successfully received via Google\'s push gateway. Please try again later.
Additional Info:
The test has completed successfully!
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 36b6e17..2528f80 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -207,9 +207,9 @@
Mostrar popup
Alertas se mostrarán en una ventana emergente.
Cargando...
- Prueba de impulso de puerta de enlace... (1/2)
+ Prueba de impulso de puerta de enlace... (1/2)
Prueba de impulso de puerta de enlace... (2/2)
- La auto-prueba ha fallado parcialmente. Sin alerta se recibió el impulso de puerta de enlace de Google, pero una alerta fue recibida con éxito a través de la puerta de entrada de empuje secundaria. Por favor, inténtelo de nuevo más tarde.
+ La auto-prueba ha fallado parcialmente. Sin alerta se recibió el impulso de puerta de enlace de Google, pero una alerta fue recibida con éxito a través de la puerta de entrada de empuje secundaria. Por favor, inténtelo de nuevo más tarde.
La auto-prueba ha fallado parcialmente. Sin alerta se recibió de la puerta de entrada de empuje secundaria, pero una alerta fue recibida con éxito a través de la puerta de enlace de empuje de Google. Por favor, inténtelo de nuevo más tarde.
Información adicional:
El test ha completado con éxito!
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index d03c1d6..598365b 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -162,9 +162,9 @@
Afficher la popup
Les alertes de roquettes s\'affichera dans une popup.
Chargement ...
- Test de la notification... (1/2)
+ Test de la notification... (1/2)
Test de la notification... (2/2)
- Le test a échoué partiellement. Aucune alerte n\'a été reçue de la notification de Google, mais une alerte a été reçue avec succès via la notification secondaire. Réessayez plus tard.
+ Le test a échoué partiellement. Aucune alerte n\'a été reçue de la notification de Google, mais une alerte a été reçue avec succès via la notification secondaire. Réessayez plus tard.
Le test a échoué partiellement. Aucune alerte n\'a été reçue de la notification secondaire, mais une alerte a été reçue avec succès via la notification de Google. Réessayez plus tard.
Informations supplémentaires:
Le test s\'est terminé avec succès!
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index bf8dc9a..66a2660 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -164,9 +164,9 @@
Mostra popup
Le allerte verrano mostrate in un pop-up.
Caricamento..
- Testando il gateway delle notifiche... (1/2)
+ Testando il gateway delle notifiche... (1/2)
Testando il gateway delle notifiche... (2/2)
- Il test è fallito parzialmente. Nessuna allerta è stata ricevuta dal gateway delle notifiche di Google, ma un allerta è stata ricevuta con successo tramite il gateway secondario delle notifiche. Riprova più tardi.
+ Il test è fallito parzialmente. Nessuna allerta è stata ricevuta dal gateway delle notifiche di Google, ma un allerta è stata ricevuta con successo tramite il gateway secondario delle notifiche. Riprova più tardi.
Il test è fallito parzialmente. Nessuna allerta è stata ricevuta dal gateway secondario delle notifiche, ma un allerta è stata ricevuta con successo tramite il gateway secondario delle notifiche. Riprova più tardi.
Informazioni addizionali:
Il test è stato completato con successo!
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index e2ce147..0a72589 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -207,9 +207,9 @@
Показать всплывающее
Оповещения Rocket будет отображаться в всплывающем окне.
загрузка...
- Тестирование толчок шлюз... (1/2)
+ Тестирование толчок шлюз... (1/2)
Тестирование толчок шлюз... (2/2)
- Самодиагностика удалось частично. Оповещение не было получено от нажимной шлюза Google, но тревога была успешно получил через вторичный толчок шлюза. Пожалуйста, повторите попытку позже.
+ Самодиагностика удалось частично. Оповещение не было получено от нажимной шлюза Google, но тревога была успешно получил через вторичный толчок шлюза. Пожалуйста, повторите попытку позже.
Самодиагностика удалось частично. Оповещение не было получено из вторичного толчок шлюза, но тревога была успешно получены через Google, толчок шлюза. Пожалуйста, повторите попытку позже.
Дополнительная информация:
Самодиагностика успешно завершила!
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ca0549b..81e17eb 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -191,10 +191,10 @@
אני משתמש באפליקציית \"צבע אדום\" באנדרואיד כדי לקבל התרעות על אזעקות צבע אדום - https://redalert.me
- שולח התרעת בדיקה... (1/2)
+ שולח התרעת בדיקה... (1/2)
שולח התרעת בדיקה... (2/2)
הבדיקה העצמית נכשלה לחלוטין. לא התקבלה התרעת בדיקה מאף שירות התרעות. בדוק את החיבור לאינטרנט ונסה מאוחר יותר, וצור איתנו קשר אם התקלה אינה חולפת.
- הבדיקה העצמית נכשלה חלקית. לא התקבלה התרעה דרך שרת ההתרעות של גוגל, אך כן התקבלה התרעה דרך שרת ההתרעות המשני. נסה שוב מאוחר יותר.
+ הבדיקה העצמית נכשלה חלקית. לא התקבלה התרעה דרך שרת ההתרעות של גוגל, אך כן התקבלה התרעה דרך שרת ההתרעות המשני. נסה שוב מאוחר יותר.
הבדיקה העצמית נכשלה חלקית. לא התקבלה התרעה דרך שרת ההתרעות המשני, אך כן התקבלה התרעה דרך שרת ההתרעות של גוגל. נסה שוב מאוחר יותר.
@@ -234,7 +234,7 @@
שתף את האזעקה
- אזעקת צבע אדום נשמעה ב-
+ אזעקת צבע אדום נשמעה ב
בשעה
- נשלח באמצעות צבע אדום באנדרואיד -
https://redalert.me
@@ -265,7 +265,7 @@
lang
sound
website
- gcm_registration_token
+ gcm_registration_token
pushy_registration_token
tutorial_1_0_9_7
rating
diff --git a/build.gradle b/build.gradle
index dcba93d..5c54870 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,8 +5,12 @@ buildscript {
jcenter()
google()
}
+
dependencies {
- classpath 'com.android.tools.build:gradle:3.0.1'
+ classpath 'com.android.tools.build:gradle:3.2.0'
+
+ // Google Play Services
+ classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/gradle.properties b/gradle.properties
index 1d3591c..915f0e6 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
\ No newline at end of file
+# org.gradle.parallel=true
+android.enableJetifier=true
+android.useAndroidX=true
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index aa8a600..a74a5bb 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue Apr 17 12:22:36 AEST 2018
+#Wed Sep 16 00:25:40 EDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip