@hot-updater/react-native 0.30.2 → 0.30.3
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.
- package/android/src/main/java/com/hotupdater/BundleFileStorageService.kt +2 -2
- package/android/src/main/java/com/hotupdater/FileManagerService.kt +3 -3
- package/android/src/main/java/com/hotupdater/HotUpdaterRecoveryManager.kt +1 -1
- package/android/src/test/java/com/hotupdater/BundleFileStorageServiceTest.kt +2 -2
- package/package.json +6 -6
|
@@ -150,7 +150,7 @@ class BundleFileStorageService(
|
|
|
150
150
|
// MARK: - Bundle Store Directory
|
|
151
151
|
|
|
152
152
|
private fun getBundleStoreDir(): File {
|
|
153
|
-
val baseDir = fileSystem.
|
|
153
|
+
val baseDir = fileSystem.getInternalFilesDir()
|
|
154
154
|
return File(baseDir, "bundle-store")
|
|
155
155
|
}
|
|
156
156
|
|
|
@@ -688,7 +688,7 @@ class BundleFileStorageService(
|
|
|
688
688
|
Log.d(TAG, "Created initial metadata during updateBundle")
|
|
689
689
|
}
|
|
690
690
|
|
|
691
|
-
val baseDir = fileSystem.
|
|
691
|
+
val baseDir = fileSystem.getInternalFilesDir()
|
|
692
692
|
val bundleStoreDir = getBundleStoreDir()
|
|
693
693
|
if (!bundleStoreDir.exists()) {
|
|
694
694
|
bundleStoreDir.mkdirs()
|
|
@@ -44,9 +44,9 @@ interface FileSystemService {
|
|
|
44
44
|
fun contentsOfDirectory(path: String): List<String>
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* Gets the
|
|
47
|
+
* Gets the internal files directory for the application
|
|
48
48
|
*/
|
|
49
|
-
fun
|
|
49
|
+
fun getInternalFilesDir(): File?
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|
|
@@ -100,5 +100,5 @@ class FileManagerService(
|
|
|
100
100
|
return directory.listFiles()?.map { it.name } ?: listOf()
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
override fun
|
|
103
|
+
override fun getInternalFilesDir(): File? = context.filesDir
|
|
104
104
|
}
|
|
@@ -484,7 +484,7 @@ internal class HotUpdaterRecoveryManager(
|
|
|
484
484
|
scheduleRecoveryWatchdogTick(appContext, WATCHDOG_TICK_INTERVAL_MS)
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
-
private fun getBundleStoreDir(context: Context): File = File(context.
|
|
487
|
+
private fun getBundleStoreDir(context: Context): File = File(context.filesDir, "bundle-store")
|
|
488
488
|
|
|
489
489
|
private fun getRecoveryWatchdogIntent(context: Context): Intent =
|
|
490
490
|
Intent(context, HotUpdaterRecoveryReceiver::class.java).setAction(WATCHDOG_ACTION)
|
|
@@ -318,7 +318,7 @@ class BundleFileStorageServiceTest {
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
private class TestFileSystemService(
|
|
321
|
-
private val
|
|
321
|
+
private val internalFilesDir: File,
|
|
322
322
|
) : FileSystemService {
|
|
323
323
|
override fun fileExists(path: String): Boolean = File(path).exists()
|
|
324
324
|
|
|
@@ -343,7 +343,7 @@ class BundleFileStorageServiceTest {
|
|
|
343
343
|
|
|
344
344
|
override fun contentsOfDirectory(path: String): List<String> = File(path).list()?.toList() ?: emptyList()
|
|
345
345
|
|
|
346
|
-
override fun
|
|
346
|
+
override fun getInternalFilesDir(): File = internalFilesDir
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
private class InMemoryPreferencesService : PreferencesService {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/react-native",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.3",
|
|
4
4
|
"description": "React Native OTA solution for self-hosted",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -120,14 +120,14 @@
|
|
|
120
120
|
"react-native": "0.79.1",
|
|
121
121
|
"react-native-builder-bob": "^0.40.10",
|
|
122
122
|
"typescript": "^6.0.2",
|
|
123
|
-
"hot-updater": "0.30.
|
|
123
|
+
"hot-updater": "0.30.3"
|
|
124
124
|
},
|
|
125
125
|
"dependencies": {
|
|
126
126
|
"use-sync-external-store": "1.5.0",
|
|
127
|
-
"@hot-updater/cli-tools": "0.30.
|
|
128
|
-
"@hot-updater/
|
|
129
|
-
"@hot-updater/js": "0.30.
|
|
130
|
-
"@hot-updater/core": "0.30.
|
|
127
|
+
"@hot-updater/cli-tools": "0.30.3",
|
|
128
|
+
"@hot-updater/core": "0.30.3",
|
|
129
|
+
"@hot-updater/js": "0.30.3",
|
|
130
|
+
"@hot-updater/plugin-core": "0.30.3"
|
|
131
131
|
},
|
|
132
132
|
"scripts": {
|
|
133
133
|
"build": "bob build && tsc -p plugin/tsconfig.build.json",
|