Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/salty-rockets-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@callstack/repack": patch
---

Fix type mismatch in FileSystemScriptLoader on Android
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import java.io.FileInputStream

class FileSystemScriptLoader(private val reactContext: ReactContext, private val nativeLoader: NativeScriptLoader) {
fun verifyBundle(code: ByteArray, config: ScriptConfig): ByteArray {
val (bundle, token) = code?.let {
val (bundle, token) = code.let {
CodeSigningUtils.extractBundleAndToken(code)
} ?: Pair(null, null)
}

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