-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Thunderbird #642
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
13c3438
Add support for Thunderbird for Android
kewisch a7312d2
Change download source for Mozilla apps to Mozilla Archive
kewisch 98e2a82
Add generic beta warning to Thunderbird and Firefox
kewisch c977e06
Merge branch 'master' into thunderbird
Tobi823 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ object FirefoxRelease : AppBase() { | |
override val title = R.string.firefox_release__title | ||
override val description = R.string.firefox_release__description | ||
override val installationWarning = R.string.firefox_release__warning | ||
override val downloadSource = "GitHub" | ||
override val downloadSource = "Mozilla Archive" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. I totally forgot to change this value |
||
override val icon = R.drawable.ic_logo_firefox_release | ||
override val minApiLevel = Build.VERSION_CODES.LOLLIPOP | ||
override val supportedAbis = ARM32_ARM64_X86_X64 | ||
|
61 changes: 61 additions & 0 deletions
61
ffupdater/src/main/java/de/marmaro/krt/ffupdater/app/impl/ThunderbirdBeta.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package de.marmaro.krt.ffupdater.app.impl | ||
|
||
import android.content.Context | ||
import android.os.Build | ||
import androidx.annotation.Keep | ||
import androidx.annotation.MainThread | ||
import de.marmaro.krt.ffupdater.R | ||
import de.marmaro.krt.ffupdater.app.App | ||
import de.marmaro.krt.ffupdater.app.entity.DisplayCategory.FROM_MOZILLA | ||
import de.marmaro.krt.ffupdater.app.entity.LatestVersion | ||
import de.marmaro.krt.ffupdater.app.entity.Version | ||
import de.marmaro.krt.ffupdater.device.DeviceAbiExtractor | ||
import de.marmaro.krt.ffupdater.network.exceptions.NetworkException | ||
import de.marmaro.krt.ffupdater.network.github.GithubConsumer | ||
import de.marmaro.krt.ffupdater.network.website.MozillaArchiveConsumer | ||
import de.marmaro.krt.ffupdater.settings.DeviceSettingsHelper | ||
|
||
/** | ||
* https://github.com/k9mail/k9mail.app | ||
* https://github.com/thunderbird/thunderbird-android/releases | ||
* https://api.github.com/repos/thunderbird/thunderbird-android/releases | ||
*/ | ||
@Keep | ||
object ThunderbirdBeta : AppBase() { | ||
override val app = App.THUNDERBIRD_BETA | ||
override val packageName = "net.thunderbird.android.beta" | ||
override val title = R.string.thunderbird_beta__title | ||
override val description = R.string.thunderbird__description | ||
override val installationWarning = R.string.generic_beta__warning | ||
override val downloadSource = "Mozilla Archive" | ||
override val icon = R.drawable.ic_logo_thunderbird_beta | ||
override val minApiLevel = Build.VERSION_CODES.LOLLIPOP | ||
override val supportedAbis = ARM32_ARM64_X86_X64 | ||
override val signatureHash = "056bfafb450249502fd9226228704c2529e1b822da06760d47a85c9557741fbd" | ||
override val projectPage = "https://github.com/thunderbird/thunderbird-android" | ||
override val displayCategory = listOf(FROM_MOZILLA) | ||
override val hostnameForInternetCheck = "https://api.github.com" | ||
|
||
@MainThread | ||
@Throws(NetworkException::class) | ||
override suspend fun fetchLatestUpdate(context: Context): LatestVersion { | ||
val version = findLatestVersion() | ||
val page = "https://archive.mozilla.org/pub/thunderbird-mobile/android/releases/$version/" | ||
val downloadUrl = "${page}thunderbird-$version.apk" | ||
val dateTime = MozillaArchiveConsumer.findDateTimeFromPage(page) | ||
return LatestVersion( | ||
downloadUrl = downloadUrl, | ||
version = Version(version), | ||
publishDate = dateTime.toString(), | ||
exactFileSizeBytesOfDownload = null, | ||
fileHash = null, | ||
) | ||
} | ||
|
||
private suspend fun findLatestVersion(): String { | ||
val url = "https://archive.mozilla.org/pub/thunderbird-mobile/android/releases/" | ||
val versionRegex = Regex("""(\d+)\.(\d+b\d+)""") | ||
val version = MozillaArchiveConsumer.findLatestVersion(url, versionRegex) | ||
return version | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
ffupdater/src/main/java/de/marmaro/krt/ffupdater/app/impl/ThunderbirdRelease.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package de.marmaro.krt.ffupdater.app.impl | ||
|
||
import android.content.Context | ||
import android.os.Build | ||
import androidx.annotation.Keep | ||
import androidx.annotation.MainThread | ||
import de.marmaro.krt.ffupdater.R | ||
import de.marmaro.krt.ffupdater.app.App | ||
import de.marmaro.krt.ffupdater.app.entity.DisplayCategory.FROM_MOZILLA | ||
import de.marmaro.krt.ffupdater.app.entity.LatestVersion | ||
import de.marmaro.krt.ffupdater.app.entity.Version | ||
import de.marmaro.krt.ffupdater.device.DeviceAbiExtractor | ||
import de.marmaro.krt.ffupdater.network.exceptions.NetworkException | ||
import de.marmaro.krt.ffupdater.network.github.GithubConsumer | ||
import de.marmaro.krt.ffupdater.network.website.MozillaArchiveConsumer | ||
import de.marmaro.krt.ffupdater.settings.DeviceSettingsHelper | ||
|
||
/** | ||
* https://github.com/k9mail/k9mail.app | ||
* https://github.com/thunderbird/thunderbird-android/releases | ||
* https://api.github.com/repos/thunderbird/thunderbird-android/releases | ||
*/ | ||
@Keep | ||
object ThunderbirdRelease : AppBase() { | ||
override val app = App.THUNDERBIRD | ||
override val packageName = "net.thunderbird.android" | ||
override val title = R.string.thunderbird__title | ||
override val description = R.string.thunderbird__description | ||
override val installationWarning: Int? = null | ||
override val downloadSource = "Mozilla Archive" | ||
override val icon = R.drawable.ic_logo_thunderbird | ||
override val minApiLevel = Build.VERSION_CODES.LOLLIPOP | ||
override val supportedAbis = ARM32_ARM64_X86_X64 | ||
override val signatureHash = "b6524779b3dbbc5ac17a5ac271ddb29dcfbf723578c238e03c3c217811356dd1" | ||
override val projectPage = "https://github.com/thunderbird/thunderbird-android" | ||
override val displayCategory = listOf(FROM_MOZILLA) | ||
override val hostnameForInternetCheck = "https://api.github.com" | ||
|
||
@MainThread | ||
@Throws(NetworkException::class) | ||
override suspend fun fetchLatestUpdate(context: Context): LatestVersion { | ||
val version = findLatestVersion() | ||
val page = "https://archive.mozilla.org/pub/thunderbird-mobile/android/releases/$version/" | ||
val downloadUrl = "${page}thunderbird-$version.apk" | ||
val dateTime = MozillaArchiveConsumer.findDateTimeFromPage(page) | ||
return LatestVersion( | ||
downloadUrl = downloadUrl, | ||
version = Version(version), | ||
publishDate = dateTime.toString(), | ||
exactFileSizeBytesOfDownload = null, | ||
fileHash = null, | ||
) | ||
} | ||
|
||
private suspend fun findLatestVersion(): String { | ||
val url = "https://archive.mozilla.org/pub/thunderbird-mobile/android/releases/" | ||
val versionRegex = Regex("""(\d+)\.(\d+)\.?(\d+)?""") | ||
val version = MozillaArchiveConsumer.findLatestVersion(url, versionRegex) | ||
return version | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻