Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
cordova-plugin-sms-retriever-manager
Advanced tools
Easily retrieve SMS messages using the Google SMS Retriever API with our cross-platform plugin designed for Ionic/Cordova. This powerful tool streamlines the process and is specifically available for Android devices.
Cross-platform plugin for Cordova / PhoneGap to to easily retrive SMS for your APP without need permission of SMS_READ. Available for Android.
Using the Cordova CLI run:
ionic cordova plugin add cordova-plugin-sms-retriever-manager
npm install @ionic-native/sms-retriever
It is also possible to install via repo url directly (unstable), run :
ionic cordova plugin add https://github.com/hanatharesh2712/ionic-native-sms-retriever-plugin-master.git
You can find working Demo for Cordova here: https://github.com/hanatharesh2712/automatic-sms-cordova/tree/main/hello
HTML
<input type="button" class="hashCode" value="Get App Hash" />
<input type="button" class="startWatching" value="Start watching SMS" />
Javascript
document.querySelector('.hashCode').addEventListener('click', this.getAppHash);
document.querySelector('.startWatching').addEventListener('click', this.retriveSMS);
var app = {
getAppHash: function() {
window['cordova']['plugins']['smsRetriever']['getAppHash'](
(result) => {
// Once you get this hash code of your app. Please remove this code.
alert(result);
console.log('Hash', result);
},
(err) => {
console.log(err);
});
},
retriveSMS: function() {
window['cordova']['plugins']['smsRetriever']['startWatching'](
// the first callback is the success callback. We got back the native code’s result here.
(result) => {
alert(result.Message);
console.log('Message', result);
},
// the second is the error callback where we get back the errors
(err) => {
console.log(err);
});
}
};
You can find working Demo for Ionic 4 here: https://github.com/hanatharesh2712/sms-plugin-test
Typescript (Ionic 4)
import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';
constructor(private smsRetriever: SmsRetriever) { }
...
// This function is to get hash string of APP.
// * @return {Promise<string>} Returns a promise that resolves when successfully generate hash of APP.
this.smsRetriever.getAppHash()
.then((res: any) => console.log(res))
.catch((error: any) => console.error(error));
// * This function start wathching message arrive event and retrive message text.
// * @return {Promise<string>} Returns a promise that resolves when retrives SMS text or TIMEOUT after 5 min.
this.smsRetriever.startWatching()
.then((res: any) => console.log(res))
.catch((error: any) => console.error(error));
You can find working Demo for Ionic 3 here: https://github.com/hanatharesh2712/sms-plugin-test-ionic-3
Typescript (Ionic 3)
import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';
var smsRetriever = window['cordova']['plugins']['smsRetriever'];
public smsTextmessage: string = '';
public appHashString: string = '';
constructor(private smsRetriever: SmsRetriever) { }
...
getHashCode() {
smsRetriever['getAppHash'](
(res) => {
this.appHashString = res;
console.log(res);
}, (err) => {
console.warn(err);
}
);
}
getSMS() {
smsRetriever['startWatching'](
(res) => {
this.smsTextmessage = res.Message;
console.log(res);
}, (err) => {
console.warn(err);
}
);
}
You need to send your application hash in SMS when you are sending from your backend. to generate the hash of your application read this: https://developers.google.com/identity/sms-retriever/verify
To get your application hash code:
BUILD FAILED
The problem is that you need to make sure that you set the target to android-19 or later in your ./platforms/android/project.properties file like this:
# Project target.
target=android-19
If your app is successful or if you are working for a company, please consider donating some beer money :beer::
Keep in mind that I am maintaining this repository on my free time so thank you for considering a donation. :+1:
I believe that everything is working, feel free to put in an issue or to fork and make pull requests if you want to add a new feature.
Things you can fix:
Thanks for considering contributing to this project.
Ask, or pick an issue and comment on it announcing your desire to work on it. Ideally wait until we assign it to you to minimize work duplication.
Search existing issues before raising a new one.
Include as much detail as possible.
Make it clear in the issue tracker what you are working on, so that someone else doesn't duplicate the work.
Use a feature branch, not master.
Rebase your feature branch onto origin/master before raising the PR.
Keep up to date with changes in master so your PR is easy to merge.
Be descriptive in your PR message: what is it for, why is it needed, etc.
Make sure the tests pass
Squash related commits as much as possible.
Try to match the existing indent style.
Don't mix platform-specific stuff into the main code.
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Easily retrieve SMS messages using the Google SMS Retriever API with our cross-platform plugin designed for Ionic/Cordova. This powerful tool streamlines the process and is specifically available for Android devices.
The npm package cordova-plugin-sms-retriever-manager receives a total of 1,423 weekly downloads. As such, cordova-plugin-sms-retriever-manager popularity was classified as popular.
We found that cordova-plugin-sms-retriever-manager demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.