-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
移除「外部儲存空間的權限和存取權」 #1394
base: develop
Are you sure you want to change the base?
移除「外部儲存空間的權限和存取權」 #1394
Conversation
… storage permission
When manual deploy, the app will 1. copy files from external directory to app specific directory using `DocumentFile`. 2. delete any files that exists in app specific directory but not in external directory. If files exists in both directories, the app will skip copying when both file's sizes are the same.
…nged The following files will be exported: - `default.custom.yaml` - `user.yaml`
On some devices, external storage may not be immediately mounted when `TrimeInputMethodService` is started after device booted. When external storage is not mounted, `RimeSession` is created but `Rime` will not be started. A `BroadcastReceiver` is added to listen for the storage mounted broadcast. When the broadcast is recevied, `RimeSession` will be re-created to start the `Rime` properly.
…reference` `showDefaultButton` is to control the display of "Default" button. `defaultButtonLabel` is the text of the "Default" button.
And display directory name only when folder is selected.
目前我在我的机器上测试,发现:
其他:
拷贝整个
感觉这部分可以考虑限定文件名后缀为 |
|
形码词库不会大,但是音码词库一般都很大,主要取决于方案,我个人安装的方案比较多所以有500MB。
感觉可以先排除一部分librime不会用到的文件夹,让trime直接使用
这个或许可以放在以后完善…… EDIT: 补充,我的fonts文件夹有120MB,这是我认为需要排除一些文件夹的原因 |
Tested in Android 13, it's working. Thanks for your hard working! |
List and show themes with user/share directory. Sort themes with default theme at the top and "share" themes at the bottom. Copy themes to the correct directory after selected.
目前我对纯粹复制这个方案是不乐观的,虽然它最容易实作,但从性能方面考虑,最理想 的情况是所需时间多了 1 倍(因为相当于同样的东西写进了磁盘两次),而且还要考虑用户目录可能会有很多东西。如果要延续这个方案,我想到的解决办法之一就是差异复制/增量复制,但是说实话要实现起来也挺麻烦的,我个人不是很想弄。 最好的方式我认为还是找到一种稳妥的方法,可以让 librime 无痛地直接读取 SAF 限制下的外部存储空间。或者还有一计:那就是给用户自主选择是用外部还是内部存储,但这无法彻底解决权限问题。 |
老實說,若 rime 大過100 mb 的話,我也覺得此方法不合適。 讓用戶選擇內置還是外置也是一可行選項,至少可以上 google play store 。 |
重要的只有方案文件和主题文件,这两个需要依靠 librime 进行部署。其他字体、背景图片等不需要同步进去,可以改为直接通过 SAF 拿。 |
a940ff3
to
185c328
Compare
Pull request
Issue tracker
Fixes will automatically close the related issues
Fixes #1186
Fixes #1096
Refs #997
Feature
如我在 #1186 描述的方法。「手動部署」(主頁面中按「部署」)時,Trime 會將
/sdcard/rime
的資料複製到內置目錄/sdcard/Android/data/com.osfans.trime
中使用。之後所有的運作會在/sdcard/Android/data/com.osfans.trime
中進行。而為了方便測試主題,每次切換「主題」時也會將相關的主題文件覆寫一次到內置目錄。關於效能方面,「手動部置」和「同步」所需的時間一定有所增加。我的
rime
文件夾 約 50MB,需時多了約 20 秒 (取決於你的配置文件大小和手機效能)。平常的文字輸入或切換輸入法等效能不變。而為了改善效能,以下檔案不會覆製
build
資料夾userdb
資料夾另外, Trime 也會覆寫以下檔案回到
/sdcard/rime
:default.custom.yaml
(選擇方案後)user.yaml
(啟用不同方案後)/sync
(同步後)最後,在「工具箱」中新增「內部資料夾」選項,可透過 Android 內置的
DocumentsUI
瀏覽內置目錄。Code of conduct
Code style
make sytle-lint
Build pass
make debug
Manually test
Code Review
Daily build
Login and download artifact at https://github.com/osfans/trime/actions
Additional Info