1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-01-04 06:23:04 +00:00

Changed download link

This commit is contained in:
M66B 2017-09-01 13:43:44 +02:00
parent ef77c98a72
commit 72c73e35eb

View file

@ -663,14 +663,14 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
try { try {
JSONObject jroot = new JSONObject(json.toString()); JSONObject jroot = new JSONObject(json.toString());
if (jroot.has("tag_name") && jroot.has("assets")) { if (jroot.has("tag_name") && jroot.has("html_url") && jroot.has("assets")) {
String url = jroot.getString("html_url");
JSONArray jassets = jroot.getJSONArray("assets"); JSONArray jassets = jroot.getJSONArray("assets");
if (jassets.length() > 0) { if (jassets.length() > 0) {
JSONObject jasset = jassets.getJSONObject(0); JSONObject jasset = jassets.getJSONObject(0);
if (jasset.has("name") && jasset.has("browser_download_url")) { if (jasset.has("name")) {
String version = jroot.getString("tag_name"); String version = jroot.getString("tag_name");
String name = jasset.getString("name"); String name = jasset.getString("name");
String url = jasset.getString("browser_download_url");
Log.i(TAG, "Tag " + version + " name " + name + " url " + url); Log.i(TAG, "Tag " + version + " name " + name + " url " + url);
Version current = new Version(Util.getSelfVersionName(ServiceSinkhole.this)); Version current = new Version(Util.getSelfVersionName(ServiceSinkhole.this));
@ -2758,7 +2758,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
getTheme().resolveAttribute(R.attr.colorPrimary, tv, true); getTheme().resolveAttribute(R.attr.colorPrimary, tv, true);
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "notify"); NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "notify");
builder.setSmallIcon(R.drawable.ic_security_white_24dp) builder.setSmallIcon(R.drawable.ic_security_white_24dp)
.setContentTitle(getString(R.string.app_name)) .setContentTitle(name)
.setContentText(getString(R.string.msg_update)) .setContentText(getString(R.string.msg_update))
.setContentIntent(pi) .setContentIntent(pi)
.setColor(tv.data) .setColor(tv.data)
@ -2769,11 +2769,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
builder.setCategory(NotificationCompat.CATEGORY_STATUS) builder.setCategory(NotificationCompat.CATEGORY_STATUS)
.setVisibility(NotificationCompat.VISIBILITY_SECRET); .setVisibility(NotificationCompat.VISIBILITY_SECRET);
NotificationCompat.BigTextStyle notification = new NotificationCompat.BigTextStyle(builder); NotificationManagerCompat.from(this).notify(NOTIFY_UPDATE, builder.build());
notification.bigText(getString(R.string.msg_update));
notification.setSummaryText(name);
NotificationManagerCompat.from(this).notify(NOTIFY_UPDATE, notification.build());
} }
private void removeWarningNotifications() { private void removeWarningNotifications() {