Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
cordova-plugin-huawei-push
Advanced tools
华为手机推送
安装cordova-plugin-huawei-push
cordova plugin add cordova-plugin-huawei-push
在项目根目录建个文件夹 config-push
,将 agconnect-services.json
拷贝到 config-push
目录。
agconnect-services.json
文件,请从华为开发者官网配置推送后下载到本地。 华为开发者官网
调试推送需要使用签名后的apk,因此建议在 cordova
根目录建 build.json
文件,把签名信息配置一下
{
"android": {
"debug": {
"keystore": "./keys/testpush.keystore",
"alias": "testpush.keystore",
"storePassword": "123456",
"password": "123456"
},
"release": {
"keystore": "./keys/testpush.keystore",
"alias": "testpush.keystore",
"storePassword": "123456",
"password": "123456"
}
}
}
build.json
的上述配置需要改成你自已的配置信息
如需调试,需要在真实的设备,使用以下命令调试
cordova run android --device --buildConfig
使用前需注册,以获取 token
,你可以将 token
与你的app用户信息关联后上传到服务器
// 注册推送
huaweiPush.register(function(token) {
console.log(token);
}, function(err) {
console.log(err);
}, []);
// 接收token
huaweiPush.onNewToken(function(token) {
console.log(token); // 会多次接收到token
});
注册完成后,需要监听 messageReceived
事件
document.addEventListener("messageReceived", function(result) {
console.log(result);
}, false);
FAQs
Cordova Push Plugin
We found that cordova-plugin-huawei-push 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.