expo-updates 0.18.17 → 0.18.18

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/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.18.18 — 2023-12-15
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - [Android] overwrite duplicates when copying assets. ([#25898](https://github.com/expo/expo/pull/25898) by [@douglowder](https://github.com/douglowder))
18
+
13
19
  ## 0.18.17 — 2023-10-25
14
20
 
15
21
  ### 🐛 Bug fixes
@@ -4,7 +4,7 @@ apply plugin: 'kotlin-kapt'
4
4
  apply plugin: 'maven-publish'
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '0.18.17'
7
+ version = '0.18.18'
8
8
 
9
9
  // Utility method to derive boolean values from the environment or from Java properties,
10
10
  // and return them as strings to be used in BuildConfig fields
@@ -95,7 +95,7 @@ android {
95
95
  minSdkVersion safeExtGet("minSdkVersion", 21)
96
96
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
97
97
  versionCode 31
98
- versionName '0.18.17'
98
+ versionName '0.18.18'
99
99
  consumerProguardFiles("proguard-rules.pro")
100
100
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
101
101
 
@@ -1,10 +1,8 @@
1
1
  package expo.modules.updates
2
2
 
3
3
  import android.content.Context
4
- import expo.modules.updates.UpdatesConfiguration.CheckAutomaticallyConfiguration
5
- import expo.modules.updates.db.entity.AssetEntity
6
- import android.os.AsyncTask
7
4
  import android.net.ConnectivityManager
5
+ import android.os.AsyncTask
8
6
  import android.util.Base64
9
7
  import android.util.Log
10
8
  import com.facebook.react.ReactNativeHost
@@ -12,14 +10,14 @@ import com.facebook.react.bridge.Arguments
12
10
  import com.facebook.react.bridge.ReactContext
13
11
  import com.facebook.react.bridge.WritableMap
14
12
  import com.facebook.react.modules.core.DeviceEventManagerModule
13
+ import expo.modules.updates.UpdatesConfiguration.CheckAutomaticallyConfiguration
14
+ import expo.modules.updates.db.entity.AssetEntity
15
15
  import expo.modules.updates.logging.UpdatesErrorCode
16
16
  import expo.modules.updates.logging.UpdatesLogger
17
17
  import org.apache.commons.io.FileUtils
18
18
  import org.json.JSONArray
19
19
  import org.json.JSONObject
20
20
  import java.io.*
21
- import java.lang.ClassCastException
22
- import java.lang.Exception
23
21
  import java.lang.ref.WeakReference
24
22
  import java.security.DigestInputStream
25
23
  import java.security.MessageDigest
@@ -130,16 +128,15 @@ object UpdatesUtils {
130
128
  if (expectedBase64URLEncodedHash != null && expectedBase64URLEncodedHash != hashBase64String) {
131
129
  throw IOException("File download was successful but base64url-encoded SHA-256 did not match expected; expected: $expectedBase64URLEncodedHash; actual: $hashBase64String")
132
130
  }
133
-
134
131
  // only rename after the hash has been verified
135
132
  // Since renameTo() does not expose detailed errors, and can fail if source and destination
136
133
  // are not on the same mount point, we do a copyTo followed by delete
134
+ // if there are two assets with identical content, they will be written to the same file path,
135
+ // so we allow overwrites
137
136
  try {
138
- tmpFile.copyTo(destination)
137
+ tmpFile.copyTo(destination, true)
139
138
  } catch (e: NoSuchFileException) {
140
139
  throw IOException("File download was successful, but temp file ${tmpFile.absolutePath} does not exist")
141
- } catch (e: FileAlreadyExistsException) {
142
- throw IOException("File download was successful, but file already exists at ${destination.absolutePath}")
143
140
  } catch (e: Exception) {
144
141
  throw IOException("File download was successful, but an exception occurred: $e")
145
142
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-updates",
3
- "version": "0.18.17",
3
+ "version": "0.18.18",
4
4
  "description": "Fetches and manages remotely-hosted assets and updates to your app's JS bundle.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -64,5 +64,5 @@
64
64
  "peerDependencies": {
65
65
  "expo": "*"
66
66
  },
67
- "gitHead": "63bbdf029ce2847c870649449ee593c97bbe3fb3"
67
+ "gitHead": "4c1bf9223e08092f72d8bee2df24f75d042e790b"
68
68
  }