public final class AtakPluginRegistry
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AtakPluginRegistry.Extension
Each plugin can have multiple extensions where each extension describes a type
(i.e., interface that the plugin implements), and the implementation of that type.
|
static class |
AtakPluginRegistry.PluginDescriptor
Plugin's description, high-level
|
static interface |
AtakPluginRegistry.PluginLoadingProgressCallback |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
pluginLoadedBasename |
static java.lang.String |
SHOULD_LOAD |
Modifier and Type | Method and Description |
---|---|
static AtakPluginRegistry |
get()
Get a handle on the singleton, NULL if initialize() was not called first
|
java.util.Set<java.lang.String> |
getIncompatiblePlugins()
Gets list of plugins scanned which are incompatible with current version of ATAK
|
int |
getNumberOfAppsInstalled()
scan() populates the list of apps, this will tell you how many the scan returned...
|
AtakPluginRegistry.PluginDescriptor |
getPlugin(java.lang.String pkg)
Check if the specified app is a plugin
|
static java.lang.String |
getPluginApiVersion(android.content.Context context,
java.lang.String packageName,
boolean stripPrefix) |
java.util.Set<AtakPluginRegistry.PluginDescriptor> |
getPluginDescriptors()
Gets all the PluginDescriptors, must be populated by loadDescriptors()
|
java.util.Collection<java.lang.Object> |
getPluginInstantiations()
Returns an unmodifiable version of the plugin instantiations.
|
java.util.Set<java.lang.String> |
getPluginsLoaded()
Returns a copy of a set that contains the names of all of the loaded plugins.
|
static AtakPluginRegistry |
initialize(MapView mapView)
Initialize this singleton with all parameter requirements
|
static boolean |
isAtak(android.content.pm.PackageInfo info)
Check if the specified package is ATAK
|
static boolean |
isAtak(java.lang.String packageName)
Check if the specified package is ATAK
|
boolean |
isPlugin(java.lang.String pkg)
Check if the specified app is a plugin
|
boolean |
isPluginLoaded(java.lang.String pkg) |
static boolean |
isTakCompatible(android.content.Context context,
java.lang.String packageName)
See if the specific plugin is compatible with this version of ATAK
|
static boolean |
isTakCompatible(java.lang.String packageName,
java.lang.String pluginApiVersion)
See if the specific plugin API version is compatible with this version of ATAK
Currently must match exactly the ATAK plugin API version (from AndroidManifest.xml)
|
boolean |
loadPlugin(java.lang.String pkg)
Loads the specified plugin
|
AtakPluginRegistry |
loadPlugins(AtakPluginRegistry.PluginLoadingProgressCallback progressCallback)
Loads all the plugins that have been marked PluginDescriptor.shouldLoad
|
AtakPluginRegistry |
scan()
Populates the list of installed applications on the system
|
boolean |
scanAndLoadPlugins(AtakPluginRegistry.PluginLoadingProgressCallback callback)
Scan apps, parse plugin descriptors, loads all extentions for all plugins which are flagged \
as "shouldLoad" and are not already loaded
|
static java.lang.String |
stripPluginApiVersion(java.lang.String api) |
boolean |
unloadPlugin(java.lang.String pkg)
Unloads the specified plugin
|
static boolean |
verifySignature(android.content.Context context,
java.lang.String pkgname)
Verify the signature of the package matches the signature used to sign the TAK application.
|
static boolean |
verifyTrust(android.content.Context context,
java.lang.String pkgname)
Verifies that a specific package can be trusted.
|
public static final java.lang.String SHOULD_LOAD
public static final java.lang.String pluginLoadedBasename
public java.util.Collection<java.lang.Object> getPluginInstantiations()
public static boolean verifySignature(android.content.Context context, java.lang.String pkgname)
Suppressed Lint warning because of the information in https://thehackernews.com/2014/07/android-fake-id-vulnerability-allows_29.html https://www.blackhat.com/docs/us-14/materials/us-14-Forristal-Android-FakeID-Vulnerability-Walkthrough.pdf and the fact that it is not used for anything more than printing the current signatures. If this is ever enabled as a true verification, then the above links should be examined.
context
- provided context for getting the package managerpkgname
- the name of the pacakge to checkpublic static boolean verifyTrust(android.content.Context context, java.lang.String pkgname)
context
- the context to usepkgname
- the package name to look uppublic static AtakPluginRegistry get()
public static AtakPluginRegistry initialize(MapView mapView)
mapView
- pass in a mapview for initialization purposes.public boolean scanAndLoadPlugins(AtakPluginRegistry.PluginLoadingProgressCallback callback)
public AtakPluginRegistry scan()
public int getNumberOfAppsInstalled()
public java.util.Set<AtakPluginRegistry.PluginDescriptor> getPluginDescriptors()
public java.util.Set<java.lang.String> getIncompatiblePlugins()
public boolean isPluginLoaded(java.lang.String pkg)
public java.util.Set<java.lang.String> getPluginsLoaded()
public boolean isPlugin(java.lang.String pkg)
pkg
- the package namepublic AtakPluginRegistry.PluginDescriptor getPlugin(java.lang.String pkg)
pkg
- the provided package namepublic static boolean isTakCompatible(android.content.Context context, java.lang.String packageName)
context
- the context to use.packageName
- the package name to checkpublic static boolean isTakCompatible(java.lang.String packageName, java.lang.String pluginApiVersion)
packageName
- the package namepluginApiVersion
- the api versionpublic static boolean isAtak(android.content.pm.PackageInfo info)
info
- the package to checkpublic static boolean isAtak(java.lang.String packageName)
packageName
- the package name to check.public static java.lang.String getPluginApiVersion(android.content.Context context, java.lang.String packageName, boolean stripPrefix)
public static java.lang.String stripPluginApiVersion(java.lang.String api)
public AtakPluginRegistry loadPlugins(AtakPluginRegistry.PluginLoadingProgressCallback progressCallback)
progressCallback
- indicates how many extensions have been loadedpublic boolean loadPlugin(java.lang.String pkg)
pkg
- the package to loadpublic boolean unloadPlugin(java.lang.String pkg)
pkg
- the package to unload