Skip to content

omegastripes/mdopener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android Kotlin Obsidian

Release Build Status License

MD Open: Obsidian

Problem Solved

The official Obsidian Android app does not register itself as a handler for .md files. Consequently, it is completely missing from the "Open with" dialog in file managers (primarily Samsung "My Files").

This bridge utility registers the necessary intent filter and acts as an intermediary, allowing .md files to be opened in Obsidian from third-party file explorers.

Attention

This app DOES NOT open arbitrary Markdown files from just any folder. It only works with files that are already inside existing Obsidian Vaults.

The folder containing the file (or its parent) must be previously added to Obsidian as a vault, meaning a hidden .obsidian folder is automatically created in its root.

If you try to open a file from a folder that is not a vault, the app will show an error and will not launch Obsidian.

Implementation Details

The app solves several technical issues that arise when interacting between the Android file system and Obsidian:

  • Forced context switching. If Obsidian is already running, a standard call is often ignored. The app uses CLEAR_TASK flags to guarantee switching Obsidian to the required vault.
  • Case sensitivity correction. Android may return a file path in lowercase (e.g., documents), even if the folder is named Documents. Obsidian is case-sensitive and will not open such a vault. The app scans the file system, finds the exact folder name on the disk, and passes it to Obsidian.
  • Correct link generation. Obsidian does not accept absolute file paths. The app converts the path into a special URI format: obsidian://open?vault=Name&file=RelativePath.

Compatibility

  • Android 11 and higher.
  • Tested on Samsung "My Files" explorer. Operation with other file managers is possible but requires testing.
  • Works with the standard version of Obsidian without installing additional plugins.

Installation and Usage

  1. Make sure folders containing your files are added to Obsidian. For example, if you open files from Download or Documents folders, these folders must be added to the Obsidian vault list individually (due to file system access limitations on Samsung).
  2. Download and install the APK from the Releases section.
  3. Tap on any .md file in the file manager.
  4. Select MD Open: Obsidian in the "Open with" menu.
  5. Grant "All files access" permission upon first launch. This is a separate system requirement necessary for the app to search for the .obsidian folder and determine the vault root.

MD Open: Obsidian

Решаемая приложением задача

Официальное приложение Obsidian на Android не регистрирует себя в системе как обработчик файлов типа .md. Из-за этого оно полностью отсутствует в диалоге «Открыть с помощью» в файловых менеджерах (в первую очередь Samsung «Мои файлы»).

Данная утилита-мост регистрирует нужный intent-фильтр и выступает посредником, позволяя открывать .md файлы в Obsidian из сторонних проводников.

Внимание

Это приложение НЕ открывает произвольные Markdown-файлы из любой папки. Оно работает только с файлами, которые уже находятся внутри существующих хранилищ (Vaults) Obsidian.

Папка, в которой лежит файл (или её родитель), должна быть заранее добавлена в Obsidian как хранилище, при этом в корне этой папки автоматически создается скрытая папка .obsidian.

Если вы попытаетесь открыть файл из папки, не являющейся хранилищем, приложение выдаст ошибку и не запустит Obsidian.

Особенности реализации

Приложение решает ряд технических проблем, возникающих при взаимодействии файловой системы Android и Obsidian:

  • Принудительное переключение контекста. Если Obsidian уже запущен, стандартный вызов часто игнорируется. Приложение использует флаги CLEAR_TASK, чтобы гарантированно переключить Obsidian на нужное хранилище.
  • Исправление регистра имен. Android может возвращать путь к файлу в нижнем регистре (например, documents), даже если папка называется Documents. Obsidian чувствителен к регистру и не откроет такое хранилище. Приложение сканирует файловую систему, находит точное имя папки на диске и передает его в Obsidian.
  • Генерация корректных ссылок. Obsidian не принимает абсолютные пути к файлам. Приложение преобразует путь в специальный URI формат: obsidian://open?vault=Имя&file=ОтносительныйПуть.

Совместимость

  • Android 11 и выше.
  • Протестировано на проводнике Samsung «Мои файлы». Работа с другими проводниками возможна, но требует тестирования.
  • Работает со стандартной версией Obsidian без установки дополнительных плагинов.

Установка и использование

  1. Убедитесь, что папки с вашими файлами добавлены в Obsidian. Например, если вы открываете файлы из папок Download или Documents, эти папки должны быть добавлены в список хранилищ Obsidian по отдельности (из-за ограничений доступа к файловой системе на Samsung).
  2. Скачайте и установите APK из раздела Releases.
  3. В проводнике нажмите на любой .md файл.
  4. В меню «Открыть с помощью» выберите MD Open: Obsidian.
  5. При первом запуске предоставьте разрешение на доступ ко всем файлам. Это отдельное системное требование, необходимое приложению для поиска папки .obsidian и определения корня хранилища.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages