🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

react-native-wechat-share

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-wechat-share - npm Package Compare versions

Comparing version
0.1.36
to
0.1.37
+7
-17
android/src/main/java/com/wechatshare/WechatShareModule.kt

@@ -77,11 +77,11 @@ package com.wechatshare

// 2. 读取图片字节数据(关键修改)
var imageBytes: ByteArray
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
try {
val imageBytes: ByteArray = try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Files.readAllBytes(imageFile.toPath())
} catch (e: Exception) {
} else {
FileInputStream(imageFile).use { it.readBytes() }
}
} else {
FileInputStream(imageFile).use { it.readBytes() }
} catch (e: Exception) {
promise.reject("READ_FAILED", "读取图片失败: ${e.message}")
return
}

@@ -96,3 +96,3 @@

FileOutputStream(externalFile).use { it.write(imageBytes) }
imagePath = externalFile.absolutePath
imageObj.imagePath = externalFile.absolutePath
} catch (e: Exception) {

@@ -103,12 +103,2 @@ promise.reject("COPY_FAILED", "保存临时图片失败: ${e.message}")

} else {
imageBytes = try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Files.readAllBytes(imageFile.toPath())
} else {
FileInputStream(imageFile).use { it.readBytes() }
}
} catch (e: Exception) {
promise.reject("READ_FAILED", "读取图片失败: ${e.message}")
return
}
imageObj.imageData = imageBytes

@@ -115,0 +105,0 @@ }

{
"name": "react-native-wechat-share",
"version": "0.1.36",
"version": "0.1.37",
"description": "react-native wechat share",

@@ -5,0 +5,0 @@ "main": "./lib/module/index.js",