Skip to content

More friendly access to data/obb folder on Android 14+ - Version 2#90

Merged
naveensingh merged 2 commits intoFossifyOrg:masterfrom
papjul:data_obb_android_14_workaround
Apr 6, 2025
Merged

More friendly access to data/obb folder on Android 14+ - Version 2#90
naveensingh merged 2 commits intoFossifyOrg:masterfrom
papjul:data_obb_android_14_workaround

Conversation

@papjul
Copy link
Copy Markdown
Contributor

@papjul papjul commented Apr 5, 2025

What is it?

  • Bugfix
  • Feature
  • Codebase improvement

Description of the changes in your PR

  • On Android 14+, there is no longer any workaround to access data and obb folder. This PR ensures users of Android 14+ are no longer prompted into using the workaround that no longer works.
  • It also includes the ability to add a "Open in system app" option when relevant. By default, this option is off to avoid any side effect given how intensively it is used across all Fossify apps.

Before/After Screenshots/Screen Record

  • Before:
before
  • After:
    On Android < 14:
after on Android below 14

On Android 14+:
after on Android 14 and above

Fixes the following issue(s)

Relies on the following changes

Acknowledgement

@papjul papjul marked this pull request as ready for review April 5, 2025 09:30
@naveensingh naveensingh self-assigned this Apr 5, 2025
Copy link
Copy Markdown
Member

@naveensingh naveensingh left a comment

Choose a reason for hiding this comment

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

Hey, I did some quick testing, left some comments below. I'll review once again later.

Thanks for contributing!

Comment thread commons/src/main/kotlin/org/fossify/commons/extensions/Activity.kt Outdated
Comment thread commons/src/main/kotlin/org/fossify/commons/extensions/Activity.kt Outdated
Comment thread commons/src/main/kotlin/org/fossify/commons/extensions/Activity.kt Outdated
Comment thread commons/src/main/kotlin/org/fossify/commons/extensions/Activity.kt Outdated
Comment thread commons/src/main/kotlin/org/fossify/commons/extensions/Activity.kt Outdated
@naveensingh
Copy link
Copy Markdown
Member

Unrelated to your PR but it doesn't seem right to fire "Storage permission is required" toast when pressing back on the system SAF page.

@papjul papjul force-pushed the data_obb_android_14_workaround branch from 5191625 to 445d12a Compare April 5, 2025 11:18
@papjul
Copy link
Copy Markdown
Contributor Author

papjul commented Apr 5, 2025

Unrelated to your PR but it doesn't seem right to fire "Storage permission is required" toast when pressing back on the system SAF page.

If you're talking about the no_storage_permissions string, I don’t see it used in the Commons project, and I’m not sure to understand how you trigger this

@naveensingh
Copy link
Copy Markdown
Member

Let's apply this new behavior to Android 11 and above. More context: FossifyOrg/File-Manager#16 (comment)

@papjul
Copy link
Copy Markdown
Contributor Author

papjul commented Apr 5, 2025

Done. The isRestrictedSAFOnlyRoot(path) already checks if running Android 11+.
I made a separate commit, so you can easily revert once you find out which DocumentUI versions are compatible on Android 11-13.

Comment thread commons/src/main/kotlin/org/fossify/commons/extensions/Activity.kt Outdated
@naveensingh
Copy link
Copy Markdown
Member

This change looks safe for the most part, even though the SAF callback is never executed now. These functions really are used extensively.

I hope you have tested this and it is regression-free ;)

Comment thread commons/src/main/res/values/strings.xml Outdated
@papjul papjul force-pushed the data_obb_android_14_workaround branch from 9084e38 to f8d09ee Compare April 6, 2025 07:36
@papjul
Copy link
Copy Markdown
Contributor Author

papjul commented Apr 6, 2025

This change looks safe for the most part, even though the SAF callback is never executed now. These functions really are used extensively.

I hope you have tested this and it is regression-free ;)

Well, I did my share of tests, and I hardly see how it could be worse than the current broken situation given the limited scope of the changes (that's also why I wanted to avoid any major UI changes).

Note that on my side, the file browsing feature is completely broken in apps other than the file manager (I know there is an ongoing issue about this), but the data/ and obb/ are still available (and the only available folders actually), so I could test the dialog on the Voice recorder app.

Then, you're the code reviewer, and you know your apps better than me, so your own tests are essential ;) And I noticed you already spotted a few existing bugs from before this PR ;)

@naveensingh
Copy link
Copy Markdown
Member

Looks good now, thanks!

A Jitpack build should be up soon for FossifyOrg/File-Manager#152.

@naveensingh naveensingh merged commit 8439b1b into FossifyOrg:master Apr 6, 2025
2 of 4 checks passed
@papjul papjul deleted the data_obb_android_14_workaround branch April 6, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants