Skip to content

Commit cb3551d

Browse files
committed
fix: Use GetContent instead of OpenDocument for APK/bundle pickers
1 parent 3923283 commit cb3551d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

app/src/main/java/app/morphe/manager/ui/screen/HomeScreen.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,16 @@ fun HomeScreen(
9494
}
9595

9696
// Initialize launchers
97+
// GetContent is used instead of OpenDocument so that third-party file managers
98+
// appear as available options in Android's picker
9799
val openApkPicker = rememberLauncherForActivityResult(
98-
contract = ActivityResultContracts.OpenDocument()
100+
contract = ActivityResultContracts.GetContent()
99101
) { uri ->
100102
uri?.let { homeViewModel.handleApkSelection(it) }
101103
}
102104

103105
val openBundlePicker = rememberLauncherForActivityResult(
104-
contract = ActivityResultContracts.OpenDocument()
106+
contract = ActivityResultContracts.GetContent()
105107
) { uri ->
106108
uri?.let {
107109
homeViewModel.selectedBundleUri = it
@@ -159,8 +161,8 @@ fun HomeScreen(
159161
// All dialogs
160162
HomeDialogs(
161163
homeViewModel = homeViewModel,
162-
storagePickerLauncher = { openApkPicker.launch(APK_FILE_MIME_TYPES) },
163-
openBundlePicker = { openBundlePicker.launch(MPP_FILE_MIME_TYPES) }
164+
storagePickerLauncher = { openApkPicker.launch("*/*") },
165+
openBundlePicker = { openBundlePicker.launch("*/*") }
164166
)
165167

166168
// Pre-patching installer selection dialog for root-capable devices.

0 commit comments

Comments
 (0)