ilabs-flir 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -7,7 +7,10 @@ import com.facebook.react.uimanager.ViewManager
|
|
|
7
7
|
|
|
8
8
|
class FlirPackage : ReactPackage {
|
|
9
9
|
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
|
10
|
-
return listOf(
|
|
10
|
+
return listOf(
|
|
11
|
+
FlirModule(reactContext),
|
|
12
|
+
FlirDownloadManager(reactContext)
|
|
13
|
+
)
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
@@ -27,8 +27,11 @@ object FlirSDKLoader {
|
|
|
27
27
|
splitInstallManager?.installedModules?.let {
|
|
28
28
|
if (FEATURE_MODULE in it) return true
|
|
29
29
|
}
|
|
30
|
-
// Check direct download
|
|
31
|
-
|
|
30
|
+
// Check direct download - look for either file from the manifest
|
|
31
|
+
val sdkDir = getSDKDirectory(context)
|
|
32
|
+
return File(sdkDir, "thermalsdk-release.aar").exists() ||
|
|
33
|
+
File(sdkDir, "androidsdk-release.aar").exists() ||
|
|
34
|
+
File(sdkDir, "thermalsdk.aar").exists()
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
fun getDownloadSize(context: Context): Long {
|
|
@@ -70,7 +73,8 @@ object FlirSDKLoader {
|
|
|
70
73
|
): Result<Unit> = withContext(Dispatchers.IO) {
|
|
71
74
|
try {
|
|
72
75
|
val manifest = loadManifest(context) ?: return@withContext Result.failure(
|
|
73
|
-
Exception("Failed to load manifest")
|
|
76
|
+
Exception("Failed to load manifest")
|
|
77
|
+
)
|
|
74
78
|
|
|
75
79
|
val downloadUrl = manifest.android.directDownload.downloadUrl
|
|
76
80
|
val expectedHash = manifest.android.directDownload.sha256
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ilabs-flir",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "FLIR Thermal SDK for React Native - On-Demand Download",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
"@types/react": "*",
|
|
59
59
|
"@types/react-native": "*"
|
|
60
60
|
}
|
|
61
|
-
}
|
|
61
|
+
}
|