Skip to content

Commit 90e5890

Browse files
authored
fix: android build after changes to FileSystemScriptLoader (#1203)
1 parent 11d9091 commit 90e5890

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.changeset/salty-rockets-kiss.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@callstack/repack": patch
3+
---
4+
5+
Fix type mismatch in FileSystemScriptLoader on Android

packages/repack/android/src/main/java/com/callstack/repack/FileSystemScriptLoader.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import java.io.FileInputStream
77

88
class FileSystemScriptLoader(private val reactContext: ReactContext, private val nativeLoader: NativeScriptLoader) {
99
fun verifyBundle(code: ByteArray, config: ScriptConfig): ByteArray {
10-
val (bundle, token) = code?.let {
10+
val (bundle, token) = code.let {
1111
CodeSigningUtils.extractBundleAndToken(code)
12-
} ?: Pair(null, null)
12+
}
1313

1414
if (config.verifyScriptSignature == "strict" || (config.verifyScriptSignature == "lax" && token != null)) {
1515
CodeSigningUtils.verifyBundle(reactContext, token, bundle)
@@ -31,7 +31,7 @@ class FileSystemScriptLoader(private val reactContext: ReactContext, private val
3131
val inputStream = reactContext.assets.open(assetName)
3232
code = inputStream.use { it.readBytes() }
3333
}
34-
val bundle: ByteArray = verifyBundle(code, config)
34+
val bundle = verifyBundle(code, config)
3535
nativeLoader.evaluate(bundle, config.sourceUrl, promise)
3636
} catch (error: Exception) {
3737
promise.reject(

0 commit comments

Comments
 (0)