|
|
@ -49,6 +49,7 @@ import java.util.* |
|
|
|
object PluginUtils { |
|
|
|
object PluginUtils { |
|
|
|
|
|
|
|
|
|
|
|
val TAG = PluginUtils.javaClass.simpleName |
|
|
|
val TAG = PluginUtils.javaClass.simpleName |
|
|
|
|
|
|
|
var hasLoad = false |
|
|
|
|
|
|
|
|
|
|
|
fun init() { |
|
|
|
fun init() { |
|
|
|
val pluginConfigUrl = |
|
|
|
val pluginConfigUrl = |
|
|
@ -94,6 +95,7 @@ object PluginUtils { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun loadAppLoader(context: Context, config: PluginConfig?) { |
|
|
|
private fun loadAppLoader(context: Context, config: PluginConfig?) { |
|
|
|
|
|
|
|
if (hasLoad) return |
|
|
|
config?.let { |
|
|
|
config?.let { |
|
|
|
val pluginPath = APPCONST.PLUGIN_DIR_PATH + it.name |
|
|
|
val pluginPath = APPCONST.PLUGIN_DIR_PATH + it.name |
|
|
|
val desFile = File(pluginPath) |
|
|
|
val desFile = File(pluginPath) |
|
|
@ -114,6 +116,7 @@ object PluginUtils { |
|
|
|
appParam.appInfo = context.applicationInfo |
|
|
|
appParam.appInfo = context.applicationInfo |
|
|
|
onLoad(appParam) |
|
|
|
onLoad(appParam) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
hasLoad = true |
|
|
|
} catch (e: Exception) { |
|
|
|
} catch (e: Exception) { |
|
|
|
e.printStackTrace() |
|
|
|
e.printStackTrace() |
|
|
|
} |
|
|
|
} |
|
|
|