From 90be3b3401b990203b6cb51833c887bdb88c1828 Mon Sep 17 00:00:00 2001 From: C10udburst <18114966+C10udburst@users.noreply.github.com> Date: Tue, 9 Aug 2022 18:14:36 +0200 Subject: [PATCH] resources loading --- app/src/main/java/com/lagradost/cloudstream3/plugins/Plugin.kt | 2 +- .../java/com/lagradost/cloudstream3/plugins/PluginManager.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/plugins/Plugin.kt b/app/src/main/java/com/lagradost/cloudstream3/plugins/Plugin.kt index 08b20dd9..89ebdaa0 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/plugins/Plugin.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/plugins/Plugin.kt @@ -53,9 +53,9 @@ abstract class Plugin { @JsonProperty("name") var name: String? = null @JsonProperty("pluginClassName") var pluginClassName: String? = null @JsonProperty("version") var version: Int? = null + @JsonProperty("requiresResources") var requiresResources: Boolean = false } var resources: Resources? = null - var needsResources = false var __filename: String? = null } \ No newline at end of file diff --git a/app/src/main/java/com/lagradost/cloudstream3/plugins/PluginManager.kt b/app/src/main/java/com/lagradost/cloudstream3/plugins/PluginManager.kt index f293b153..8a942522 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/plugins/PluginManager.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/plugins/PluginManager.kt @@ -251,7 +251,8 @@ object PluginManager { } pluginInstance.__filename = fileName - if (pluginInstance.needsResources) { + if (manifest.requiresResources) { + Log.d(TAG, "Loading resources for ${data.internalName}") // based on https://stackoverflow.com/questions/7483568/dynamic-resource-loading-from-other-apk val assets = AssetManager::class.java.newInstance() val addAssetPath =