Skip to content

Conversation

@itsyourap
Copy link

@itsyourap itsyourap commented Nov 23, 2025

This pull request updates the plugin storage directory to the app's private files directory, ensuring a clean state before loading plugins, and improving error handling when the plugins folder does not exist.

Plugin directory management improvements:

  • Changed the plugin storage directory from the external files directory to the app's private files directory (context.filesDir) to avoid SecurityException when loading dex files.
  • Cleaned up all non-existing plugins in the plugins directory by comparing them with the local plugins directory before loading new plugins to prevent stale plugins from persisting.
  • If local plugin folder (in Internal Storage) does not exist, then do not create it and remove all local plugins currently installed.

Error handling and plugin loading logic:

  • Improved handling when the local plugins folder does not exist by logging a message and marking plugins as loaded, instead of attempting to create the directory and logging a warning.
  • Ensured that all local plugins are fully refreshed by removing the local plugins key before loading.

Related Issues

@Luna712
Copy link
Contributor

Luna712 commented Nov 23, 2025

This won't fix the issue mentioned. It still writes on internal storage in two directories which is what the issue mentioned. Also if I remember correctly there was some issue with storing here. As far as I know there is no good way for dex, the read only issue happens if you don't follow the instructions to enable all files access. In the original folder that is an issue regardless but even here under some circumstances and under some conditions (not all the time though) it will still give dex issues.

@Luna712
Copy link
Contributor

Luna712 commented Nov 23, 2025

I will test this more tomorrow, looking at it more and maybe it will work better because I think I tried something a little bit different then this initially which didn't properly work but I'll test this one more.

@Luna712
Copy link
Contributor

Luna712 commented Nov 23, 2025

Always deleting might be bad for performance though, checking certain conditionals before deleting, only deleting if they are truly stale or outdated may be more efficient though I'm not certain.

@itsyourap
Copy link
Author

only deleting if they are truly stale or outdated may be more efficient

Yes that can be done. I am working on it.

@Luna712
Copy link
Contributor

Luna712 commented Nov 23, 2025

Thanks a lot. I'll test this tomorrow. But I think it could probably work a lot better. Thanks for working on this. Local plugjns have proven to be a bit of a challenge due to Android security and dex handling now.

Copy link
Contributor

@Luna712 Luna712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does seem to work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PluginManager writing on internal storage

2 participants