feat: Migrate option file selector to SAF#2953
Conversation
This file is intended for the ReVanced/.github repository; however, ads.fund is responsible for configuring the verification for this repository. I have contacted them to set up the .github repository, but they are currently offline. Therefore, this file is committed here temporarily due to a time constraint, as the verification must be completed before the end of this month. Once the verification process is finished and the changes on the ads.fund side are implemented, this file can be removed.
|
If we exit the app does it remove these files? |
|
Yes, it's stored in the same place as the temporary files generated for patcher |
Axelen123
left a comment
There was a problem hiding this comment.
The temporary files will be gone after an app restart and won't be present if manager attempts to use saved patch options. This is partly why I chose not to use SAF when implementing patch options.
|
@X1nto app restarts still need to be handled, since the temporary directory will be cleared on restarts. To fix this, you could:
|
Co-authored-by: Ax333l <main@axelen.xyz>
TBF this would be much easier if patches themselves could use a different Option type for URIs. The only reason why copying files is even needed is because patches expect a string path instead of URIs. I'll take a look at your suggestion, but sounds like a lot of work. |
The reason for this is the direction of dependency. The Manager depends on the Patcher, but not the other way around. Therefore, the Patcher cannot consider the requirements of the Manager and instead, it is the Manager that must take the Patcher into account. Options are specified with typed intentions for basic types such as string, int, long, boolean, and arrays of these types. These options are compatible with any platform and can be used as base types for arbitrary purposes. You can express any kind of option using them. There are no specific types to avoid unnecessary or unwanted specialization, as the API is designed to be generalized. This is why Options dont have "URI" type. Instead there is the string type, that can be used and serialize as URIs |
476e976 to
3329647
Compare
This gets rid of external file access requirements by moving the patcher options path selector to Storage Access Framework. Because of this change, it has become necessary to 1) separate folder and file selector actions and 2) copy selected folder/file to the app's internal storage. Internal storage refers to Filesystem.tempDir.
androidx.documentfile was added to handle SAF and everything related to external storage permissions have been removed.
screen-20260219-230118.mp4