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-android-safetynet

v1.0.2

Published

A wrapper plugin for safetynet API on Play Enabled devices. This plugin extends attestation and app verification methods.

Downloads

241

Readme

Cordova SafetyNet

A wrapper plugin for safetynet API on Play Enabled devices. This plugin extends attestation and app verification methods. Google Play Service are required on device. At the time of writing , I am targeting Play Service 15.0.1 in gradle.

Installation

Cordova:

cordova plugin add cordova-plugin-android-safetynet

Ionic:

ionic cordova plugin add cordova-plugin-android-safetynet

Safety Net URL & some links

TBA

Steps for Attestation

  • Obtain API key from Google Developer Console. The name of the API is Android Device Verification. Get the API_KEY from Credentials Section.
  • Generate a nonce server side: This a unique token which should be generated server side. Google recommends atleast 16 byte long token.
  • Invoke the cordova method
  • Get the result from success callback. Send it to the server
  • Send trhe sesult to android check to verify the payload server side.
  • After extract the result. Compare the values and base your logic from the result.

Syntax for Attestation

You will need API key from Google APIs Console for initiating attestation.

A nonce security token from server side, is also required.

window.safetynet.attest(nonce ,API_Key ,successCallback ,errorCallback);

Success Callbacks

A JWS string is sent back as success. This is the same data obtained from getJwsResult(). This data should be again cross verified with google.

Syntax for Verify Apps API

Three methods are available for the SafetyNet Verify Apps API.

Check Verify App is Enabled

This method allows a check for Verify App(Play Protect). The result is a boolean in successcallback.

window.safetynet.checkAppVerification(successCallback, errorCallback)

Enable App Verification

This method allows you to enable App Verfication. A dialog is invoked to If the verification is already enabled , the successCallback returns true. successCallback is a boolean. It represnts the state of App verification.

window.safetynet.enableAppVerification(successCallback, errorCallback);

List Harmful Apps

This method lists harmful apps installed in a device. App verification/Play Protect is required to be enabled to process the request. The result is an array of objects in successCallback.

window.safetynet.listHarmfulApps(successCallback, errorCallback);

Issues

Post the issues related to this library here . Do provide the device details as below.

  • Device name & manufacturer
  • Android version
  • Custom OS version (Lineage , MIUI , Exodus, DU)