Skip to content

Commit 08bbbdf

Browse files
committed
Add Kotlin JVM target configuration to build scripts and refactor asset loading in SC.kt
1 parent 61b803b commit 08bbbdf

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

app/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ android {
5050
sourceCompatibility = JavaVersion.VERSION_17
5151
targetCompatibility = JavaVersion.VERSION_17
5252
}
53+
kotlinOptions {
54+
jvmTarget = "17"
55+
}
5356

5457
packaging {
5558
resources {

library/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ android {
4242
sourceCompatibility = JavaVersion.VERSION_17
4343
targetCompatibility = JavaVersion.VERSION_17
4444
}
45+
kotlinOptions {
46+
jvmTarget = "17"
47+
}
4548
testOptions {
4649
unitTests.all {
4750
it.useJUnitPlatform()

library/src/main/java/dev/vyp/stringcare/library/SC.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,7 @@ class SC {
294294
}
295295

296296
private fun assetByteArray(path: String, predicate: () -> Boolean = { true }): ByteArray {
297-
val inputStream = context.assets.openFd(path)
298-
var bytes = inputStream.createInputStream().readBytes()
297+
var bytes = context.assets.open(path).readBytes()
299298
if (predicate()) {
300299
bytes = CPlusLogic.revealByteArray(context, bytes)
301300
}

0 commit comments

Comments
 (0)