Repository navigation
Doesn't recognize ODF files without file extension #34
Description
Activity
@Metaxa007 says this is not reproducible. Need to test again
I can still reproduce this by uploading an odt-file without file extension via the iCloud web interface: https://www.icloud.com/iclouddrive/
Not an odrcore problem.
open_strategy::list_file_typesworks from the magic bytes and then probes the zip for an ODF manifest — no extension is read anywhere in that path, andCoreWrappercalls exactly it. An extensionless ODT opens fine once the app can reach the file.What blocks it is one system rule. Copying
test.odtto a name with no extension and asking UniformTypeIdentifiers:file resolved type conforms to zip / content / composite noextpublic.data, not dynamicfalse / false / false withext.odtorg.oasis-open.opendocument.textfalse / true / false No extension means
public.dataexactly, conforming to nothing else, andUIDocumentBrowserViewControllergreys out whatever does not conform to a type inCFBundleDocumentTypes. iOS resolves the type from the extension and the file provider's metadata, never from the content, so no declaration short ofpublic.dataitself reaches that file.Three ways out:
- Claim
public.data. One line in both plists and it is ungreyed. The same key drives Open-With, so the app becomes an offered opener for every file on the device — Please let users choose which file types OpenDocument Reader handles #150 asks for the opposite. Wrong trade. - Claim
public.datawithLSHandlerRank: None.Nonemeans the app never opens the type, so in principle the browser's filter still sees the claim while Open-With does not offer it. Undocumented for the document browser and it may drop the type outright. Cheap to settle by running it: is the file ungreyed, and does the app show up for an mp3. Worth testing before anything else — if it holds it is a one-line fix at no cost. - An explicit way in. A button in
additionalLeadingNavigationBarButtonItems— the trailing side carries Privacy — presenting aUIDocumentPickerViewController(forOpeningContentTypes: [.item]), whose list is not filtered by what the app declares. The picked URL goes topresentDocument(at:)unchanged and odrcore identifies it. NeedsstartAccessingSecurityScopedResource(), which nothing does today because browser-handed URLs do not need it. It does not ungrey the file in the list, so the reader has to find the button, and the picker shows everything — an mp3 picked there gets the cannot-open message.
Suggested order: test 2, fall back to 3.
- Claim
If you upload an ODF file without file extension to iCloud Drive, it'll show up greyed-out in the app. After renaming it to add a file extension the file will work fine.