[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] enable AppUpdater notificatoins through Github



commit dafcdd72bceb68aec0d2dab87eb5a8d78c157f58
Author: n8fr8 <nathan@xxxxxxxxxxx>
Date:   Wed Jan 3 23:58:17 2018 -0500

    enable AppUpdater notificatoins through Github
---
 app/build.gradle                                       |  1 +
 app/src/main/java/org/torproject/android/OrbotApp.java | 17 ++++++++---------
 update.json                                            | 10 ++++++++++
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/app/build.gradle b/app/build.gradle
index 83782fd8..da05525a 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -50,5 +50,6 @@ dependencies {
     compile 'com.android.support:design:26.1.0'
     compile 'pl.bclogic:pulsator4droid:1.0.3'
     compile 'com.github.apl-devs:appintro:v4.2.2'
+    compile 'com.github.javiersantos:AppUpdater:2.6.4'
 
 }
diff --git a/app/src/main/java/org/torproject/android/OrbotApp.java b/app/src/main/java/org/torproject/android/OrbotApp.java
index 9ebcfa2b..2c5d5e10 100644
--- a/app/src/main/java/org/torproject/android/OrbotApp.java
+++ b/app/src/main/java/org/torproject/android/OrbotApp.java
@@ -18,6 +18,10 @@ import android.support.v4.app.NotificationCompat;
 import android.util.Log;
 import android.widget.RemoteViews;
 
+import com.github.javiersantos.appupdater.AppUpdater;
+import com.github.javiersantos.appupdater.enums.Display;
+import com.github.javiersantos.appupdater.enums.UpdateFrom;
+
 import org.torproject.android.service.OrbotConstants;
 import org.torproject.android.service.TorEventHandler;
 import org.torproject.android.service.TorService;
@@ -41,7 +45,10 @@ public class OrbotApp extends Application implements OrbotConstants
         Languages.setup(OrbotMainActivity.class, R.string.menu_settings);
         Languages.setLanguage(this, Prefs.getDefaultLocale(), true);
 
-        checkTransparentProxyingLegacy();
+        new AppUpdater(this)
+                .setUpdateFrom(UpdateFrom.JSON)
+                .setUpdateJSON("https://raw.githubusercontent.com/n8fr8/orbot/master/update.json";)
+                .setDisplay(Display.NOTIFICATION);
     }
 
     @Override
@@ -66,14 +73,6 @@ public class OrbotApp extends Application implements OrbotConstants
         return Languages.get(activity);
     }
 
-    private void checkTransparentProxyingLegacy ()
-    {
-        if (Prefs.useTransparentProxying())
-        {
-            showToolbarNotification(getString(R.string.no_transproxy_warning_short),getString(R.string.no_transproxy_warning), 9999, org.torproject.android.service.R.drawable.ic_stat_notifyerr);
-
-        }
-    }
 
     @SuppressLint("NewApi")
     protected void showToolbarNotification (String shortMsg, String notifyMsg, int notifyId, int icon)
diff --git a/update.json b/update.json
new file mode 100644
index 00000000..3a16ad80
--- /dev/null
+++ b/update.json
@@ -0,0 +1,10 @@
+{
+  "latestVersion": "16.0.0 BETA 1",
+  "latestVersionCode": 16000003,
+  "url": "https://github.com/n8fr8/orbot/releases";,
+  "releaseNotes": [
+    "- New look and feel",
+    "- Easier setup and onboarding",
+    "- Bridge wizard and network testing"
+  ]
+}



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits