swiftp icon indicating copy to clipboard operation
swiftp copied to clipboard

[BUG] Unable to enable ScopeStorage

Open Thalhammer opened this issue 1 year ago • 1 comments

Version: 90f9c2d8ddc75f382c0e5c893df5dba5fd983266 (current master) Android: 12 (Samsung Galaxy S10+, OneUI 4.1)

Expected Behaviour: Enabling Scoped Storage in Settings enables Scoped Storage support.

Observed Behaviour: It doesn't.

Reason and Fix: https://github.com/ppareit/swiftp/blob/90f9c2d8ddc75f382c0e5c893df5dba5fd983266/app/src/main/java/be/ppareit/swiftp/gui/PreferenceFragment.java#L248 sets a property named UseScopedStorage, but https://github.com/ppareit/swiftp/blob/90f9c2d8ddc75f382c0e5c893df5dba5fd983266/app/src/main/java/be/ppareit/swiftp/Util.java#L122 queries for a property called AllowNewScopedStorage (which is never used anywhere else) and thus always returns false. Fix: Replace AllowNewScopedStorage in Util.java with UseScopedStorage.

@Xavron pinging you since you seem to have (inofficially) taken over the project lead.

Thalhammer avatar Jan 17 '25 10:01 Thalhammer

I believe it should be "UseScopedStorage" in Util to be corrected... its really just a naming problem anyway. Quite sure UseScopedStorage is what ppareit named it. AllowNewScopedStorage is very likely what I originally used. Have switched my project to avoid the issue from now on.

Again, I probably got the wrong name in a pull for that one. Although, Util had a very different thing in there before that one, so I don't know lol. Sorry @ppareit. Will just have to pick something.

Pull request created with fix: https://github.com/ppareit/swiftp/pull/263

"UseScopedStorage" is indeed in PreferenceFragment so they now match after the pull request.

Edited: Cleaned up to just the most relevant.

Xavron avatar Jan 19 '25 00:01 Xavron