npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-csdeviceinfo

v1.2.0

Published

A Cordova plugin to retrieve app info such as version name, app name, etc.

Downloads

35

Readme

Cordova DeviceInfo Plugin

This plugin contains various methods for retrieving miscellaneous device/app info.

Installation

Using the Cordova CLI

cordova plugins add org.cloudsky.cordovaplugins.deviceinfo

Usage

Get App ID

cloudSky.deviceInfo.getAppId(
    function (appId) {
        // Success callback.
        // `appId` is the package name on Android, bundle identifier on iOS,
        // `ProductId` on Windows.
    },
    function (err) {
        // Failure callback.
        // `err` is an error message.
    }
)

Get App Version Name

cloudSky.deviceInfo.getVersionName(
    function (versionName) {
        // Success callback.
        // `versionName` is the version name on Android (from the
        // AndroidManifest's <manifest> element, `android:versionName` attribute).
        // On iOS, this is the `CFBundleShortVersionString` value from the main
        // NSBundle.
        // On Windows, this is the version number built from components
        // <major>.<minor>.<build>.<revision> of the WinJS PackageId class
        // (https://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.packageid.aspx#properties)
    },
    function (err) {
        // Failure callback.
        // `err` is an error message.
    }
)

Get Device Jailbreak/Root Status

Performs a simplistic check on whether the device is rooted or jailbroken.

cloudSky.deviceInfo.isHackedDevice(
    function (isHacked) {
        // Success callback.
        // `isHacked` is _truthy_ if the device is rooted/jailbroken, _falsy_
        // otherwise (meaning it can be true, false, 1, 0, ...).
        // NOTE: `isHacked` is always false on Windows - no checking is
        // performed on this platform...
    },
    function (err) {
        // Failure callback.
        // `err` is an error message.
    }
)

Get Devcie Jailbreak/Root detection details

Get details about jailbreak / root detection, i.e. which tests considered the device to be jailbroken / rooted, which tests did not detect anything.

cloudSky.deviceInfo.getHackDetectionDetails(
    function (details) {
        // NOTE: Android and iOS  have different sets of tests.
        for(var testName in details) {
            if(details[testName]) {
                console.log(testName + " was positive.")
            }
        }
    },
    function (err) {
        // Failure callback.
        // `err` is an error message.
    }
)

Troubleshooting

Android support library build error

If you get the following error when building on Android:

* What went wrong:
Execution failed for task ':processArmv7ReleaseManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.0-alpha1) from [com.android.support:support-v4:26.0.0-alpha1] AndroidManifest.xml:27:9-38
  	is also present at [com.android.support:appcompat-v7:25.3.0] AndroidManifest.xml:27:9-31 value=(25.3.0).
  	Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-27:41 to override.

Try adding this to your cordova/platforms/android/build.gradle file, replacing the useVersion with the ones you need:

dependencies {
    configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            def requested = details.requested
            if (requested.group == 'com.android.support') {
                if (requested.name == 'appcompat-v7') {
                    details.useVersion '23.+'
                } else if (requested.name == 'support-v4') {
                    details.useVersion '26.+'
                } else if (requested.name == 'support-compat') {
                    details.useVersion '25.0.1'
                }
            }
        }
    }
}