fix: fdroid check update, in app messages bug

This commit is contained in:
zaneschepke
2025-12-26 00:31:13 -05:00
parent af21a6a3cf
commit eeeec5613f
5 changed files with 6 additions and 18 deletions
@@ -135,6 +135,7 @@ class MainActivity : AppCompatActivity() {
private val appDatabase: AppDatabase by inject()
private val networkMonitor: NetworkMonitor by inject()
val viewModel by viewModel<SharedAppViewModel>()
private lateinit var roomBackup: RoomBackup
@OptIn(ExperimentalMaterial3Api::class)
@@ -150,8 +151,6 @@ class MainActivity : AppCompatActivity() {
roomBackup = RoomBackup(this)
val viewModel by viewModel<SharedAppViewModel>()
installSplashScreen().apply {
setKeepOnScreenCondition { !viewModel.container.stateFlow.value.isAppLoaded }
}
@@ -64,12 +64,13 @@ val appModule = module {
)
}
singleOf(::GlobalEffectRepository)
viewModelScope {
scoped { FileUtils(androidContext(), get(named(Dispatcher.IO))) }
scoped<ShortcutManager> {
DynamicShortcutManager(androidContext(), get(named(Dispatcher.IO)))
}
scopedOf(::GlobalEffectRepository)
scopedOf(::SelectedTunnelsRepository)
}
@@ -191,7 +191,8 @@ fun SupportScreen(viewModel: SupportViewModel = koinViewModel()) {
return@SurfaceRow context.showToast(R.string.update_check_unsupported)
when (BuildConfig.FLAVOR) {
Constants.GOOGLE_PLAY_FLAVOR -> context.launchPlayStoreListing()
Constants.FDROID_FLAVOR -> context.launchFDroidListing()
Constants.FDROID_FLAVOR ->
context.openWebUrl(context.getString(R.string.fdroid_url))
else -> viewModel.checkForStandaloneUpdate()
}
},
@@ -280,20 +280,6 @@ fun Context.launchPlayStoreReview() {
}
}
fun Context.launchFDroidListing() {
val intent =
Intent(Intent.ACTION_VIEW, Uri.parse("fdroid.app://details?id=$packageName")).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
setPackage("org.fdroid.fdroid")
}
if (intent.resolveActivity(packageManager) != null) {
startActivity(intent)
} else {
openWebUrl("https://f-droid.org/packages/$packageName/")
}
}
fun Activity.setScreenBrightness(brightness: Float) {
window.attributes = window.attributes.apply { screenBrightness = brightness }
}
+1
View File
@@ -460,6 +460,7 @@
<string name="mode">Mode</string>
<string name="app_selection">App selection</string>
<string name="example_import_url" translatable="false">https://123.com/tun.conf</string>
<string name="fdroid_url" translatable="false">https://apt.izzysoft.de/fdroid/index/apk/com.zaneschepke.wireguardautotunnel</string>
<string name="import_url_description">The URL must be secure and serve a .conf file.</string>
<string name="only_template">%1$s only</string>
</resources>