Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ updates:
- dependency-name: "com.google.devtools.ksp*"
- dependency-name: "com.github.skydoves.compose.stability.analyzer*"
- dependency-name: "androidx.compose:compose-bom"
# Navigation 2.10 breaks predictive back transitions (wrong pair, then a snap); stay on 2.9.x.
- dependency-name: "androidx.navigation:*"
versions: [">= 2.10.0"]
groups:
gradle:
patterns:
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/to/bitkit/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class MainActivity : FragmentActivity() {
importance = NotificationManager.IMPORTANCE_LOW
)

intent.removeNavDestinationExtras()
val consumedLaunchIntent = savedInstanceState?.getString(KEY_CONSUMED_LAUNCH_INTENT)
val currentLaunchIntent = intent.launchKey()
if (currentLaunchIntent == null || currentLaunchIntent != consumedLaunchIntent) {
Expand Down Expand Up @@ -282,11 +283,21 @@ class MainActivity : FragmentActivity() {
return
}

intent.removeNavDestinationExtras()
super.onNewIntent(intent)
setIntent(intent)
handleLaunchIntent(intent)
}

/**
* Navigation 2.9 opens the destination these extras name for any caller; 2.10 trusts them only from this app.
* Bitkit never sets them, so drop them: an exported launch can then reach only the declared deep links.
*/
private fun Intent.removeNavDestinationExtras() {
removeExtra("android-support-nav:controller:deepLinkIds")
removeExtra("android-support-nav:controller:deepLinkArgs")
}

private fun handleLaunchIntent(intent: Intent) {
if (intent.getBooleanExtra(EXTRA_PAYKIT_SUBSCRIPTION_PAYMENT_DUE, false)) {
intent.removeExtra(EXTRA_PAYKIT_SUBSCRIPTION_PAYMENT_DUE)
Expand Down
1 change: 1 addition & 0 deletions changelog.d/next/1853.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Swiping back from a screen slides it out like the Back button does, and other apps can no longer open Bitkit's internal screens.
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ hiltAndroidx = "1.4.0"
kotlin = "2.3.21"
ktor = "3.6.1"
lifecycle = "2.10.0"
navCompose = "2.10.2"
# 2.10 breaks predictive back: a swipe soon after a navigation seeks with the forward transitions,
# then snaps. Stay on 2.9.x until a release fixes it (see .github/dependabot.yml).
navCompose = "2.9.8"
room = "2.8.5"
slf4j = "2.0.20"
haze = "1.7.3"
Expand Down
Loading