Updated GitHub URIs

pull/187/head
M66B 5 years ago
parent 0dc4e74f04
commit c43fae68ad

@ -126,7 +126,8 @@ android {
buildConfigField "boolean", "PLAY_STORE_RELEASE", "false" buildConfigField "boolean", "PLAY_STORE_RELEASE", "false"
buildConfigField "String", "PRO_FEATURES_URI", "\"https://email.faircode.eu/donate/\"" buildConfigField "String", "PRO_FEATURES_URI", "\"https://email.faircode.eu/donate/\""
buildConfigField "String", "CHANGELOG", "\"https://github.com/M66B/FairEmail/releases/\"" buildConfigField "String", "CHANGELOG", "\"https://github.com/M66B/FairEmail/releases/\""
buildConfigField "String", "GITHUB_LATEST_API", "\"https://api.github.com/repos/M66B/open-source-email/releases/latest\"" buildConfigField "String", "GITHUB_LATEST_API", "\"https://api.github.com/repos/M66B/FairEmail/releases/latest\""
buildConfigField "String", "GITHUB_LATEST_URI", "\"https://github.com/M66B/FairEmail/releases\""
} }
fdroid { fdroid {
dimension "all" dimension "all"
@ -134,7 +135,8 @@ android {
buildConfigField "boolean", "PLAY_STORE_RELEASE", "false" buildConfigField "boolean", "PLAY_STORE_RELEASE", "false"
buildConfigField "String", "PRO_FEATURES_URI", "\"https://email.faircode.eu/donate/\"" buildConfigField "String", "PRO_FEATURES_URI", "\"https://email.faircode.eu/donate/\""
buildConfigField "String", "CHANGELOG", "\"https://github.com/M66B/FairEmail/releases/\"" buildConfigField "String", "CHANGELOG", "\"https://github.com/M66B/FairEmail/releases/\""
buildConfigField "String", "GITHUB_LATEST_API", "\"https://api.github.com/repos/M66B/open-source-email/releases/latest\"" buildConfigField "String", "GITHUB_LATEST_API", "\"https://api.github.com/repos/M66B/FairEmail/releases/latest\""
buildConfigField "String", "GITHUB_LATEST_URI", "\"https://github.com/M66B/FairEmail/releases\""
} }
play { play {
dimension "all" dimension "all"
@ -144,6 +146,7 @@ android {
buildConfigField "String", "PRO_FEATURES_URI", "\"https://email.faircode.eu/#pro\"" buildConfigField "String", "PRO_FEATURES_URI", "\"https://email.faircode.eu/#pro\""
buildConfigField "String", "CHANGELOG", "\"\"" buildConfigField "String", "CHANGELOG", "\"\""
buildConfigField "String", "GITHUB_LATEST_API", "\"\"" buildConfigField "String", "GITHUB_LATEST_API", "\"\""
buildConfigField "String", "GITHUB_LATEST_URI", "\"\""
} }
} }

@ -888,15 +888,16 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
if (!jroot.has("tag_name") || jroot.isNull("tag_name")) if (!jroot.has("tag_name") || jroot.isNull("tag_name"))
throw new IOException("tag_name field missing"); throw new IOException("tag_name field missing");
if (!jroot.has("html_url") || jroot.isNull("html_url")) //if (!jroot.has("html_url") || jroot.isNull("html_url"))
throw new IOException("html_url field missing"); // throw new IOException("html_url field missing");
if (!jroot.has("assets") || jroot.isNull("assets")) if (!jroot.has("assets") || jroot.isNull("assets"))
throw new IOException("assets section missing"); throw new IOException("assets section missing");
// Get update info // Get update info
UpdateInfo info = new UpdateInfo(); UpdateInfo info = new UpdateInfo();
info.tag_name = jroot.getString("tag_name"); info.tag_name = jroot.getString("tag_name");
info.html_url = jroot.getString("html_url"); //info.html_url = jroot.getString("html_url");
info.html_url = BuildConfig.GITHUB_LATEST_URI;
// Check if new release // Check if new release
JSONArray jassets = jroot.getJSONArray("assets"); JSONArray jassets = jroot.getJSONArray("assets");
@ -934,6 +935,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
new NotificationCompat.Builder(ActivityView.this, "update") new NotificationCompat.Builder(ActivityView.this, "update")
.setSmallIcon(R.drawable.twotone_get_app_24) .setSmallIcon(R.drawable.twotone_get_app_24)
.setContentTitle(getString(R.string.title_updated, info.tag_name)) .setContentTitle(getString(R.string.title_updated, info.tag_name))
.setContentText(info.html_url)
.setAutoCancel(true) .setAutoCancel(true)
.setShowWhen(false) .setShowWhen(false)
.setPriority(NotificationCompat.PRIORITY_DEFAULT) .setPriority(NotificationCompat.PRIORITY_DEFAULT)

Loading…
Cancel
Save