Skip to content
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 4 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Installs and updates the following browsers:

Browsers from Mozilla or based on Firefox:
Software from Mozilla or based on Firefox:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻


- [Fennec F-Droid](https://f-droid.org/packages/org.mozilla.fennec_fdroid/)
- [Firefox Browser](https://play.google.com/store/apps/details?id=org.mozilla.firefox),
Expand All @@ -22,6 +22,9 @@ Browsers from Mozilla or based on Firefox:
- [Iceraven](https://github.com/fork-maintainers/iceraven-browser)
- [Tor Browser](https://www.torproject.org/download),
[Tor Browser Alpha](https://www.torproject.org/download/alpha/)
- [Thunderbird for Android](https://play.google.com/store/apps/details?id=net.thunderbird.android),
[Thunderbird for Android Beta](https://play.google.com/store/apps/details?id=net.thunderbird.android.beta)
([GitHub Repository](https://github.com/thunderbird/thunderbird-android/))

Good privacy browsers:

Expand All @@ -44,7 +47,7 @@ Browser which are better than Google Chrome:
Other applications:

- [FairEmail](https://github.com/M66B/FairEmail)
- [K-9 Mail / Thunderbird Android](https://github.com/k9mail/k9mail.app)
- [K-9 Mail](https://k9mail.app)
- [Orbot](https://github.com/guardianproject/orbot)

FFUpdater checks for updates in the background and downloads them as well. Apps can be updated without user
Expand Down
2 changes: 2 additions & 0 deletions ffupdater/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
<package android:name="org.mozilla.focus.beta" />
<package android:name="org.mozilla.klar" />
<package android:name="org.mozilla.rocket" />
<package android:name="net.thunderbird.android" />
<package android:name="net.thunderbird.android.beta" />
<package android:name="org.torproject.android" />
<package android:name="org.torproject.torbrowser" />
<package android:name="org.torproject.torbrowser_alpha" />
Expand Down
6 changes: 6 additions & 0 deletions ffupdater/src/main/java/de/marmaro/krt/ffupdater/app/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import de.marmaro.krt.ffupdater.app.impl.MullFromRepo
import de.marmaro.krt.ffupdater.app.impl.Orbot
import de.marmaro.krt.ffupdater.app.impl.PrivacyBrowser
import de.marmaro.krt.ffupdater.app.impl.Thorium
import de.marmaro.krt.ffupdater.app.impl.ThunderbirdRelease
import de.marmaro.krt.ffupdater.app.impl.ThunderbirdBeta
import de.marmaro.krt.ffupdater.app.impl.TorBrowser
import de.marmaro.krt.ffupdater.app.impl.TorBrowserAlpha
import de.marmaro.krt.ffupdater.app.impl.Vivaldi
Expand Down Expand Up @@ -56,6 +58,8 @@ enum class App {
ORBOT,
PRIVACY_BROWSER,
THORIUM,
THUNDERBIRD,
THUNDERBIRD_BETA,
TOR_BROWSER,
TOR_BROWSER_ALPHA,
VIVALDI,
Expand Down Expand Up @@ -88,6 +92,8 @@ enum class App {
ORBOT -> Orbot
PRIVACY_BROWSER -> PrivacyBrowser
THORIUM -> Thorium
THUNDERBIRD -> ThunderbirdRelease
THUNDERBIRD_BETA -> ThunderbirdBeta
TOR_BROWSER -> TorBrowser
TOR_BROWSER_ALPHA -> TorBrowserAlpha
VIVALDI -> Vivaldi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ object FirefoxBeta : AppBase() {
override val packageName = "org.mozilla.firefox_beta"
override val title = R.string.firefox_beta__title
override val description = R.string.firefox_beta__description
override val installationWarning = R.string.firefox_beta__warning
override val downloadSource = "Github"
override val installationWarning = R.string.generic_beta__warning
override val downloadSource = "Mozilla Archive"
override val icon = R.drawable.ic_logo_firefox_beta
override val minApiLevel = Build.VERSION_CODES.LOLLIPOP
override val supportedAbis = ARM32_ARM64_X86_X64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object FirefoxFocus : AppBase() {
override val packageName = "org.mozilla.focus"
override val title = R.string.firefox_focus__title
override val description = R.string.firefox_focus__description
override val downloadSource = "GitHub"
override val downloadSource = "Mozilla Archive"
override val icon = R.drawable.ic_logo_firefox_focus_klar
override val minApiLevel = Build.VERSION_CODES.LOLLIPOP
override val supportedAbis = ARM32_ARM64_X86_X64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object FirefoxFocusBeta : AppBase() {
override val title = R.string.firefox_focus_beta__title
override val description = R.string.firefox_focus_beta__description
override val installationWarning = R.string.generic_app_warning__beta_version
override val downloadSource = "GitHub"
override val downloadSource = "Mozilla Archive"
override val icon = R.drawable.ic_logo_firefox_focus_beta
override val minApiLevel = Build.VERSION_CODES.LOLLIPOP
override val supportedAbis = ARM32_ARM64_X86_X64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object FirefoxKlar : AppBase() {
override val packageName = "org.mozilla.klar"
override val title = R.string.firefox_klar__title
override val description = R.string.firefox_klar__description
override val downloadSource = "GitHub"
override val downloadSource = "Mozilla Archive"
override val icon = R.drawable.ic_logo_firefox_focus_klar
override val minApiLevel = Build.VERSION_CODES.LOLLIPOP
override val supportedAbis = ARM32_ARM64_X86_X64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Owner

Choose a reason for hiding this comment

The 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
Expand Down
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
}
}
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.
5 changes: 4 additions & 1 deletion ffupdater/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<string name="available_version">Available: %1$s</string>
<string name="notification__error__text">Please report this error. Click to view the error report.</string>
<string name="notification__error__title">Background update check failed</string>
<string name="generic_beta__warning">- This is a beta app, designed for developers and testers. It may contain various bugs that can affect your experience.</string>
<string name="brave__description">Privately browse the internet, for free! The Brave Private Browser App is your fast, free, and safe private web browser with ad blocker and pop-up blocker. Privately browse and search the internet without being tracked by advertisers, malware and pop-ups.</string>
<string name="brave__title">Brave Private Browser</string>
<string name="brave__warning">- Brave uses the technical foundation of Google Chrome and thus indirectly supports the monopoly position of the Chromium render engine.\n- Due to its Basic Attention Token BAT on the Ethereum blockchain the project has ties with cryptocurrency. Blockchains have many problems and should be avoided in my view.</string>
Expand Down Expand Up @@ -48,7 +49,6 @@
<string name="notification__error__channel_name">Background errors</string>
<string name="firefox_beta__description">Firefox Browser for Android is automatically private and incredibly fast. Thousands of online trackers are following you every day, collecting information about where you go online and slowing down your speed. Firefox blocks over 2000 of these trackers by default and there are ad blocker add-ons available if you want to customize your browser even more. With Firefox, you’ll get the security you deserve and the speed you need in a private, mobile browser.</string>
<string name="firefox_beta__title">Firefox for Android Beta</string>
<string name="firefox_beta__warning">- This app is designed for developers and testers. It may contain various bugs that can affect your usual work with the browser.</string>
<string name="firefox_focus__description">This is a modification of the Firefox browser aimed to increase privacy.</string>
<string name="firefox_focus__title">Firefox Focus</string>
<string name="firefox_klar__description">Firefox Klar is developed for Germany, Austria and Switzerland, but can be used by users in any country. It is very similar to Firefox Focus, but the name was changed in German-speaking countries to avoid confusion with the magazine Focus by Hubert Burda Media group. Unlike Firefox Focus, Firefox Klar has telemetry disabled by default due to strict German privacy laws.</string>
Expand Down Expand Up @@ -295,6 +295,9 @@
<string name="thorium__warning">- Thorium uses the technical foundation of Google Chrome and thus indirectly supports the monopoly position of the Chromium render engine.</string>
<string name="k9mail__title">K-9 Mail</string>
<string name="k9mail__description">Full-featured email client</string>
<string name="thunderbird__title">Thunderbird: Free Your Inbox</string>
<string name="thunderbird_beta__title">Thunderbird Beta for Testers</string>
<string name="thunderbird__description">Thunderbird is a powerful, privacy-focused email app. Effortlessly manage multiple email accounts from one app, with a Unified Inbox option for maximum productivity. Built on open-source technology and supported by a dedicated team of developers alongside a global community of volunteers, Thunderbird never treats your private data as a product. Supported solely by financial contributions from our users, so you never have to see ads mixed in with your emails again.</string>
<string name="fairemail__title">FairEmail</string>
<string name="fairemail__description">Fully featured, open source, privacy friendly email app for Android</string>
<string name="cardview_dialog__self_description_label">Self description:</string>
Expand Down