Sandboxing and reading folderitems from prefs

After my recent adventures with saving and restoring folders in Catalina in https://forum.xojo.com/54254-wwdc-gotchas-for-xojo-developers something occurred to me: in the Sandboxed version of my application I still use my standard code for saving and restoring folderitems. Here is the restoring code:

[code]Dim theCFObject As CFObjectMBS = theCFPrefs.CopyAppValue(NewCFStringMBS(fieldName), theCFPrefs.kCFPreferencesCurrentApplication)
if theCFObject = Nil then Return nil

dim theFolderitem as FolderItem
if theCFObject.TypeDescription = “CFString” then
dim FieldValue as String = CFStringMBS(theCFObject).str

theFolderitem = Volume(0)
dim theSaveInfo as String = DecodeBase64MBS(FieldValue)
return theFolderitem.getRelative(theSaveInfo)
end if[/code]

I double-checked that this works fine when the app is Sandboxed. Is this something that should work? Will this continue to work in the AppStore? Should I change this to using security scoped bookmarks?

AFAIK: It shouldn’t work at all!

While Security-Scoped Bodgemarks are the most appropriate replacement; please consider the alternative suggestions first, and make sure that you’re fully aware of the pitfalls of when they fail.

That’s totally odd because accessing the files worked fine without the security bookmarks. When they fail my app doesn’t work because the main file can’t be opened. But the main file can’t move in the Sandbox version.