
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
cordova-nfcv-plugin
Advanced tools
Cordova plugin for reading and writing to NFC tags using NfcV protocol (with support for Ionic2+)
Requirements: Make sure you have a working environment for Ionic2+ project or for Cordova project before installing the plugin.
Ionic2+:
ionic plugin add https://github.com/valentiniljaz/cordova-nfcv-plugin
Cordova (without Ionic2+)
cordova plugin add https://github.com/valentiniljaz/cordova-nfcv-plugin
Plugin configuration is done by changing values in NfcVHandler class (src/android/NfcVHandler.java
).
Some NFC tags might not support NDEF:
The following values should be the same for any tag. If not, you should change to the appropriate values:
NfcV.init: function (success, error));
Initializes plugin. In most cases not even required, since every request also initializes the adapter.
NfcV.checkNfcVAvailability: function (success, error));
Check if Nfc hardware is available.
NfcV.addNdefListener: function (success, error));
Get notified when ever new device is discovered. Ndef message is sent in event data.
You need to add document.addEventListener
to be notified when a new device is discovered.
document.addEventListener('NdefTag', (event) => {
console.log('Ndef', JSON.parse(event.ndef));
}, true);
NfcV.addNdefListener();
NfcV.startListening: function (success, error));
Starts listening for new "ACTION_TECH_DISCOVERED" intent.
NfcV.stopListening: function (success, error));
It disables foreground dispatch. Intents are no longer received.
NfcV.transceive: function (request, success, error));
It is used to dispatch any kind of request against a NFC tag. Request object has to include a full request: flags, block_addr and any data.
NfcV.readBlock: function (blockAddr, success, error));
Reads one block from blockAddr
.
blockAddr
along with response flagsNfcV.writeBlock: function (blockAddr, blockData, success, error));
Writes blockData
into one block at blockAddr
.
E_NO_NFC
- NFC is not supportedE_NFC_DISABLED
- NFC is not enabledE_NULL_TAG
- Tag returned NULLE_ADDR_TOO_LONG
- Block addr is too long (more than 2 bytes)Add the following intent filters inside activity
:
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
</intent-filter>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED" android:resource="@xml/nfc_tech_filter" />
Create new file within platforms/android/res/xml/nfc_tech_filter.xml
:
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<tech-list>
<tech>android.nfc.tech.NfcV</tech>
</tech-list>
</resources>
FAQs
Ionic2 service for communicating with NfcV tags
The npm package cordova-nfcv-plugin receives a total of 3 weekly downloads. As such, cordova-nfcv-plugin popularity was classified as not popular.
We found that cordova-nfcv-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.