Remove dependency on commons-io library

This commit is contained in:
Torsten Grote 2020-09-10 15:51:54 -03:00 committed by Chirayu Desai
parent 8bdbe6d681
commit 8f91138e9f
5 changed files with 4 additions and 11 deletions

View file

@ -37,7 +37,6 @@ android_app {
"seedvault-lib-androidx-lifecycle-viewmodel-ktx", "seedvault-lib-androidx-lifecycle-viewmodel-ktx",
"seedvault-lib-koin-android", "seedvault-lib-koin-android",
"seedvault-lib-koin-androidx-viewmodel", "seedvault-lib-koin-androidx-viewmodel",
"seedvault-lib-commons-io",
"seedvault-lib-koin-core", "seedvault-lib-koin-core",
"seedvault-lib-novacrypto-bip39", "seedvault-lib-novacrypto-bip39",
"seedvault-lib-novacrypto-sha256", "seedvault-lib-novacrypto-sha256",

View file

@ -121,7 +121,6 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'commons-io:commons-io:2.6'
implementation 'io.github.novacrypto:BIP39:2019.01.27' implementation 'io.github.novacrypto:BIP39:2019.01.27'
implementation 'org.koin:koin-androidx-viewmodel:2.0.1' implementation 'org.koin:koin-androidx-viewmodel:2.0.1'

View file

@ -12,7 +12,7 @@ import com.stevesoltys.seedvault.crypto.Crypto
import com.stevesoltys.seedvault.header.HeaderWriter import com.stevesoltys.seedvault.header.HeaderWriter
import com.stevesoltys.seedvault.header.VersionHeader import com.stevesoltys.seedvault.header.VersionHeader
import libcore.io.IoUtils.closeQuietly import libcore.io.IoUtils.closeQuietly
import org.apache.commons.io.IOUtils import java.io.EOFException
import java.io.IOException import java.io.IOException
import java.io.InputStream import java.io.InputStream
import java.io.OutputStream import java.io.OutputStream
@ -156,7 +156,9 @@ internal class FullBackup(
state.outputStreamInit = null // the stream init lambda is not needed beyond that point state.outputStreamInit = null // the stream init lambda is not needed beyond that point
// read backup data, encrypt it and write it to output stream // read backup data, encrypt it and write it to output stream
val payload = IOUtils.readFully(state.inputStream, numBytes) val payload = ByteArray(numBytes)
val read = state.inputStream.read(payload, 0, numBytes)
if (read != numBytes) throw EOFException("Read $read bytes instead of $numBytes.")
crypto.encryptSegment(outputStream, payload) crypto.encryptSegment(outputStream, payload)
TRANSPORT_OK TRANSPORT_OK
} catch (e: IOException) { } catch (e: IOException) {

View file

@ -34,13 +34,6 @@ android_library_import {
sdk_version: "current", sdk_version: "current",
} }
java_import {
name: "seedvault-lib-commons-io",
host_supported: true,
jars: ["commons-io-2.6.jar"],
sdk_version: "current",
}
java_import { java_import {
name: "seedvault-lib-koin-core", name: "seedvault-lib-koin-core",
host_supported: true, host_supported: true,

Binary file not shown.