feat: власна папка для збереження записів через SAF - #32
Open
elphamale wants to merge 1 commit into
Open
Conversation
The "Recording Folder" row in Settings was purely informational — recordings were always locked to the app-private Android/data/... directory, which most third-party apps (file managers, backup/sync tools) can't read. The row is now clickable and opens the standard ACTION_OPEN_DOCUMENT_TREE folder picker. RecordingStorage creates new recordings under the picked SAF tree (falling back to the legacy directory if it becomes inaccessible), and a new FolderMigrationJob offers to move existing recordings into it. AacEncoder/WavEncoder now write through a ParcelFileDescriptor (WavEncoder via FileChannel instead of RandomAccessFile, which has no FD constructor) so the same encoder code serves both legacy and SAF output. A new RecordingPaths helper centralises the legacy-path-vs-SAF-URI branch for every read/delete site: playback, waveform, sharing, transcription, cleanup, bulk-delete, and startup reconciliation. Confirmed the privileged Shizuku UserService never touches the filesystem (it only pumps PCM over a pipe), so this needed no AIDL or :userservice changes. Addresses LyoSU#12.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Вирішує #12.
Проблема
Рядок «Папка записів» у Settings був суто інформаційним — записи завжди зберігалися у приватній папці
Android/data/…, яку більшість сторонніх застосунків (файлові менеджери, бекап/синхронізація) не можуть прочитати.Рішення
ACTION_OPEN_DOCUMENT_TREE), щоб користувач міг обрати будь-яку папку.RecordingStorageстворює нові записи в обраній SAF-папці, а якщо вона стає недоступною (відкликано дозвіл, вилучено SD-картку) — безпечно повертається до приватної папки, щоб запис не загубився.FolderMigrationJobпропонує перенести вже наявні записи в нову папку, по одному файлу за раз, з ізоляцією помилок — один пошкоджений/недоступний файл не зупиняє весь процес.AacEncoder/WavEncoderтепер пишуть черезParcelFileDescriptor(WavEncoder— черезFileChannelзамістьRandomAccessFile, бо в останнього немає конструктора з довільного дескриптора) — той самий код encoder-шару обслуговує і легасі-, і SAF-шлях.RecordingPathsцентралізує розрізнення легасі-шлях vs SAFcontent://URI для ~9 місць читання/видалення: відтворення, waveform, шеринг, транскрипція, автоочищення, bulk-видалення, стартова звірка з диском при запуску.Область змін
Усе — лише в
:app. Привілейований Shizuku UserService ніколи не торкається файлової системи напряму (лише передає сирі PCM-семпли через pipe назад у процес застосунку), тож змін в AIDL чи:userserviceне знадобилося —userServiceVersionне змінювався.