mirror of
https://github.com/wgtunnel/android.git
synced 2026-06-02 00:29:08 +02:00
fix: fdroid check update, in app messages bug
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -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()
|
||||
}
|
||||
},
|
||||
|
||||
-14
@@ -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 }
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user