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 "String", "PRO_FEATURES_URI", "\"https://email.faircode.eu/donate/\""
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 {
dimension "all"
@ -134,7 +135,8 @@ android {
buildConfigField "boolean", "PLAY_STORE_RELEASE", "false"
buildConfigField "String", "PRO_FEATURES_URI", "\"https://email.faircode.eu/donate/\""
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 {
dimension "all"
@ -144,6 +146,7 @@ android {
buildConfigField "String", "PRO_FEATURES_URI", "\"https://email.faircode.eu/#pro\""
buildConfigField "String", "CHANGELOG", "\"\""
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"))
throw new IOException("tag_name field missing");
if (!jroot.has("html_url") || jroot.isNull("html_url"))
throw new IOException("html_url field missing");
//if (!jroot.has("html_url") || jroot.isNull("html_url"))
// throw new IOException("html_url field missing");
if (!jroot.has("assets") || jroot.isNull("assets"))
throw new IOException("assets section missing");
// Get update info
UpdateInfo info = new UpdateInfo();
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
JSONArray jassets = jroot.getJSONArray("assets");
@ -934,6 +935,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
new NotificationCompat.Builder(ActivityView.this, "update")
.setSmallIcon(R.drawable.twotone_get_app_24)
.setContentTitle(getString(R.string.title_updated, info.tag_name))
.setContentText(info.html_url)
.setAutoCancel(true)
.setShowWhen(false)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)

Loading…
Cancel
Save