Obtainium icon indicating copy to clipboard operation
Obtainium copied to clipboard

Allow custom script to support more sources

Open momobobe opened this issue 1 year ago • 5 comments

Maintaining all sources solely by the dev could be very troublesome as the list grows. Please consider to allow something like extension / addon / plugin for user customization, where users can use their own scripts. Maybe in future a repo can be set up for collecting user-made sources.

momobobe avatar May 19 '23 15:05 momobobe

It's an interesting idea, but how would this work? Currently the sources are all Dart classes that extend a base class, all compiled in the app. Is there a way for a Flutter app to load new code at runtime?

ImranR98 avatar May 19 '23 15:05 ImranR98

Maybe not something hardcoded. I'm not sure about the details, but it's likely some new modules (maybe in other languages) could be introduced, or the app structure should be kinda refactored. https://github.com/DUpdateSystem/UpgradeAll is an example (not in Flutter or Dart though).

momobobe avatar May 19 '23 16:05 momobobe

For reference, maybe these projects (all in Kotlin though) can also be inspirational for their different ideas on source extension: Tachiyomi, Legado, CloudStream

I'm sorry for being unable to provide more suggestions on tech details.

momobobe avatar May 26 '23 13:05 momobobe

The easiest solution would be to bundle a JS interpreter and have the sources be in JS.

But since this app is made with flutter...it doesn't feel that viable.

ArjixWasTaken avatar Jun 21 '23 00:06 ArjixWasTaken

Just found a Flutter app with such extension system, https://github.com/miru-project/miru-app, which uses https://github.com/bellard/quickjs. Maybe there are some better alternatives, but anyway, its implementation should be interesting enough for reference.

momobobe avatar Aug 19 '23 11:08 momobobe