Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

community-cordova-plugin-apps

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

community-cordova-plugin-apps

A plugin for full detail for apps

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Cordova Apps Plugin

This Cordova plugin provides functionality to retrieve information about installed applications on the device, launch applications, and potentially extract APK files. It can be utilized in Cordova-based applications to enhance app management capabilities.

Installation

To install the plugin, use the Cordova CLI:

cordova plugin add community-cordova-plugin-apps

Replace community-cordova-plugin-apps with the URL of the repository hosting the plugin.

Usage

getAppList

Retrieve a list of installed applications on the device.

cordova.plugins.AppsPlugin.getAppList(successCallback, errorCallback);
  • successCallback: Function to handle the retrieved list of applications.
  • errorCallback: Function to handle errors.

The success callback will receive an array of objects, where each object represents information about an installed application.

getAppByPackageId

Retrieve information about a specific application using its package ID.

cordova.plugins.AppsPlugin.getAppByPackageId(packageId, successCallback, errorCallback);
  • packageId: Package ID (e.g., com.example.myapp).
  • successCallback: Function to handle the retrieved application information.
  • errorCallback: Function to handle errors.

The success callback will receive an object representing information about the specified application.

launchApp

Launch an application using its package ID.

cordova.plugins.AppsPlugin.launchApp(packageId, successCallback, errorCallback);
  • packageId: Package ID (e.g., com.example.myapp).
  • successCallback: Function to handle successful app launch.
  • errorCallback: Function to handle errors.

extractApp

Extract the APK file of an application (requires root access).

cordova.plugins.AppsPlugin.extractApp(packageId, successCallback, errorCallback);
  • packageId: Package ID (e.g., com.example.myapp).
  • successCallback: Function to handle successful APK extraction.
  • errorCallback: Function to handle errors.

Note: Extracting APKs may require root access and is more complex than what is provided in this example. Additional libraries or tools may be necessary.

AppInfo Object Structure

The AppInfo object structure returned by the plugin includes the following fields:

  • name: Application name.
  • packageName: Package ID.
  • version: Application version.
  • icon: Base64-encoded PNG representation of the application icon.
  • minSdkVersion: Minimum SDK version required.
  • targetSdkVersion: Target SDK version.
  • installedDate: Date of initial installation.
  • lastUpdatedDate: Date of the last update.
  • installerPackageName: Package ID of the installer.
  • isSystemApp: Boolean indicating whether the application is a system app.

Example

cordova.plugins.AppsPlugin.getAppList(
    function (appList) {
        console.log('Installed Applications:', appList);
    },
    function (error) {
        console.error('Error retrieving app list:', error);
    }
);

License

This Cordova Apps Plugin is licensed under the MIT License.

FAQs

Package last updated on 16 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc