resources loading

This commit is contained in:
C10udburst 2022-08-09 18:14:36 +02:00
parent 15f0ba12d1
commit 90be3b3401
2 changed files with 3 additions and 2 deletions

View file

@ -53,9 +53,9 @@ abstract class Plugin {
@JsonProperty("name") var name: String? = null @JsonProperty("name") var name: String? = null
@JsonProperty("pluginClassName") var pluginClassName: String? = null @JsonProperty("pluginClassName") var pluginClassName: String? = null
@JsonProperty("version") var version: Int? = null @JsonProperty("version") var version: Int? = null
@JsonProperty("requiresResources") var requiresResources: Boolean = false
} }
var resources: Resources? = null var resources: Resources? = null
var needsResources = false
var __filename: String? = null var __filename: String? = null
} }

View file

@ -251,7 +251,8 @@ object PluginManager {
} }
pluginInstance.__filename = fileName 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 // based on https://stackoverflow.com/questions/7483568/dynamic-resource-loading-from-other-apk
val assets = AssetManager::class.java.newInstance() val assets = AssetManager::class.java.newInstance()
val addAssetPath = val addAssetPath =