
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
react-native-wechat-android
Advanced tools
react-native 的微信SDK辅助包,支持微信登录、微信分享、微信支付。
appId : 在微信开放平台申请的AppID
callback : 回调(err,res)
使用示例:
WeChatAndroid.registerApp(appId,(err,registerOK) => {
...
});
callback : 回调(err,res)
使用示例:
WeChatAndroid.openWXApp((err,res) => {
...
});
callback : 回调(err,res)
使用示例:
WeChatAndroid.isWXAppInstalled(
(err,isInstalled) => {
...
}
);
callback : 回调(err,res)
使用示例:
WeChatAndroid.isWXAppSupportAPI(
(err,isSupport) => {
...
}
);
callback : 回调(err,res)
使用示例:
WeChatAndroid.getWXAppSupportAPI(
(err,supportAPI) => {
...
}
);
scope : 微信登录需要的参数(可空)
state : 微信登录需要的参数(可空)
callback : 回调(err,res)
使用示例:
WeChatAndroid.sendAuthReq('snsapi_userinfo','SECRET',(err,authReqOK) => {
...
});
or
WeChatAndroid.sendAuthReq(null,null,(err,authReqOK) => {
...
});
// 处理登录回调结果
DeviceEventEmitter.addListener('finishedAuth',function(event){
var success = event.success;
if(success){
ToastAndroid.show(
' code = ' + JSON.stringify(event.code) +
' state = ' + JSON.stringify(event.state),
ToastAndroid.LONG
);
}else{
ToastAndroid.show('授权失败',ToastAndroid.SHORT);
}
});
options : 分享到微信需要的参数
callback : 回调(err,res)
使用示例:
//分享文本
var textOptions = {
title: '分享一段内容给你',
transaction: 'text',
scene: 0,
type: 1,
text: '这里是分享的文本内容',
}
//分享网络图片
var networkImageOptions = {
title: '分享一张图片给你',
thumbSize: 150,
scene: 0,
type: 2,
imageUrl: 'https://avatars3.githubusercontent.com/u/3015681?v=3&s=460',
}
//分享本地图片
var localImageOptions = {
title: '分享一张图片给你',
thumbSize: 150,
scene: 0,
type: 2,
imagePath: '/mnt/sdcard/temp.png',
}
//分享网页
var webpageOptions = {
title: '分享这个网页给你',
desc: '我发现这个网页很有趣,特意分享给你',
thumbSize: 150,
scene: 0,
type: 3,
webpageUrl: 'https://github.com/beefe/react-native-wechat-android',
thumbImage: 'http://img1.imgtn.bdimg.com/it/u=3924416677,403957246&fm=21&gp=0.jpg',
}
//分享音乐
var musicOptions = {
title: '这里是分享的标题',
desc: '发现一首好听的音乐,分享给你',
transaction: 'music',
scene: 1,
type: 4,
musicUrl: 'http://staff2.ustc.edu.cn/~wdw/softdown/index.asp/0042515_05.ANDY.mp3',
thumbImage: 'http://img1.imgtn.bdimg.com/it/u=3924416677,403957246&fm=21&gp=0.jpg',
}
//分享视频
var videoOptions = {
title: '这里是分享的标题',
desc: '这个视频好有趣,一起来看看',
transaction: 'video',
scene: 1,
type: 5,
videoUrl: 'http://www.iqiyi.com/v_19rrnlidhk.html?src=sharemodclk131212',
thumbImage: 'http://img1.imgtn.bdimg.com/it/u=3924416677,403957246&fm=21&gp=0.jpg',
}
WeChatAndroid.sendReq(videoOptions,(err,sendOK) => {
...
});
// 分享回调
DeviceEventEmitter.addListener('finishedShare',function(event){
var success = event.success;
if(success){
ToastAndroid.show('分享成功',ToastAndroid.SHORT);
}else{
ToastAndroid.show('分享失败',ToastAndroid.SHORT);
}
});
options : 微信支付需要的参数
callback : 回调(err,res)
使用示例:
var payOptions = {
appId: 'wx8888888888888888',
nonceStr: '5K8264ILTKCH16CQ2502SI8ZNMTM67VS',
packageValue: 'Sign=WXPay',
partnerId: '1900000109',
prepayId: 'WX1217752501201407033233368018',
timeStamp: '1412000000',
sign: 'C380BEC2BFD727A4B6845133519F3AD6',
};
WeChatAndroid.weChatPay(payOptions,(err,sendReqOK) => {
...
});
// 处理支付回调结果
DeviceEventEmitter.addListener('finishedPay',function(event){
var success = event.success;
if(success){
// 在此发起网络请求由服务器验证是否真正支付成功,然后做出相应的处理
}else{
ToastAndroid.show('支付失败',ToastAndroid.SHORT);
}
});
-keep class com.tencent.mm.sdk.** {
*;
}
FAQs
the wechat util for android
We found that react-native-wechat-android 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.