Clean up BIP39 dependencies
This commit is contained in:
parent
6cde6be997
commit
cfcf7b35ba
10 changed files with 2144 additions and 30 deletions
|
@ -35,8 +35,6 @@ android_app {
|
||||||
"seedvault-lib-koin-android",
|
"seedvault-lib-koin-android",
|
||||||
"seedvault-lib-koin-androidx-viewmodel",
|
"seedvault-lib-koin-androidx-viewmodel",
|
||||||
"seedvault-lib-novacrypto-bip39",
|
"seedvault-lib-novacrypto-bip39",
|
||||||
"seedvault-lib-novacrypto-sha256",
|
|
||||||
"seedvault-lib-novacrypto-toruntime"
|
|
||||||
],
|
],
|
||||||
manifest: "app/src/main/AndroidManifest.xml",
|
manifest: "app/src/main/AndroidManifest.xml",
|
||||||
|
|
||||||
|
|
|
@ -124,9 +124,6 @@ dependencies {
|
||||||
//noinspection GradleDependency
|
//noinspection GradleDependency
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||||
|
|
||||||
implementation 'io.github.novacrypto:BIP39:2019.01.27'
|
|
||||||
implementation 'org.koin:koin-androidx-viewmodel:2.0.1'
|
|
||||||
|
|
||||||
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-11.0.0_r3/current/androidx/Android.bp#610
|
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-11.0.0_r3/current/androidx/Android.bp#610
|
||||||
//noinspection GradleDependency
|
//noinspection GradleDependency
|
||||||
implementation 'androidx.core:core-ktx:1.5.0-alpha01'
|
implementation 'androidx.core:core-ktx:1.5.0-alpha01'
|
||||||
|
@ -156,6 +153,9 @@ dependencies {
|
||||||
//noinspection GradleDependency
|
//noinspection GradleDependency
|
||||||
implementation 'com.google.android.material:material:1.1.0-alpha05'
|
implementation 'com.google.android.material:material:1.1.0-alpha05'
|
||||||
|
|
||||||
|
implementation 'io.github.novacrypto:BIP39:2019.01.27'
|
||||||
|
implementation 'org.koin:koin-androidx-viewmodel:2.0.1'
|
||||||
|
|
||||||
//
|
//
|
||||||
// Dependencies below do not concern the AOSP build
|
// Dependencies below do not concern the AOSP build
|
||||||
//
|
//
|
||||||
|
|
|
@ -16,7 +16,7 @@ import io.github.novacrypto.bip39.Validation.WordNotFoundException
|
||||||
import io.github.novacrypto.bip39.Words
|
import io.github.novacrypto.bip39.Words
|
||||||
import io.github.novacrypto.bip39.wordlists.English
|
import io.github.novacrypto.bip39.wordlists.English
|
||||||
import java.security.SecureRandom
|
import java.security.SecureRandom
|
||||||
import java.util.*
|
import java.util.ArrayList
|
||||||
|
|
||||||
internal const val WORD_NUM = 12
|
internal const val WORD_NUM = 12
|
||||||
internal const val WORD_LIST_SIZE = 2048
|
internal const val WORD_LIST_SIZE = 2048
|
||||||
|
|
|
@ -39,10 +39,10 @@ fun getRandomBase64(size: Int = Random.nextInt(1, MAX_KEY_LENGTH_NEXTCLOUD)): St
|
||||||
.joinToString("")
|
.joinToString("")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun ByteArray.toHexString(): String {
|
fun ByteArray.toHexString(spacer: String = " "): String {
|
||||||
var str = ""
|
var str = ""
|
||||||
for (b in this) {
|
for (b in this) {
|
||||||
str += String.format("%02X ", b)
|
str += String.format("%02X$spacer", b)
|
||||||
}
|
}
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -16,24 +16,3 @@ android_library_import {
|
||||||
aars: ["koin-androidx-viewmodel-2.0.1.aar"],
|
aars: ["koin-androidx-viewmodel-2.0.1.aar"],
|
||||||
sdk_version: "current",
|
sdk_version: "current",
|
||||||
}
|
}
|
||||||
|
|
||||||
java_import {
|
|
||||||
name: "seedvault-lib-novacrypto-bip39",
|
|
||||||
host_supported: true,
|
|
||||||
jars: ["BIP39-2019.01.27.jar"],
|
|
||||||
sdk_version: "current",
|
|
||||||
}
|
|
||||||
|
|
||||||
java_import {
|
|
||||||
name: "seedvault-lib-novacrypto-sha256",
|
|
||||||
host_supported: true,
|
|
||||||
jars: ["SHA256-2019.01.27.jar"],
|
|
||||||
sdk_version: "current",
|
|
||||||
}
|
|
||||||
|
|
||||||
java_import {
|
|
||||||
name: "seedvault-lib-novacrypto-toruntime",
|
|
||||||
host_supported: true,
|
|
||||||
jars: ["ToRuntime-0.9.0.jar"],
|
|
||||||
sdk_version: "current",
|
|
||||||
}
|
|
||||||
|
|
31
libs/novacrypto-bip39/Android.bp
Normal file
31
libs/novacrypto-bip39/Android.bp
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
java_import {
|
||||||
|
name: "seedvault-lib-novacrypto-bip39-nodeps",
|
||||||
|
host_supported: true,
|
||||||
|
jars: ["BIP39-2019.01.27.jar"],
|
||||||
|
sdk_version: "current",
|
||||||
|
}
|
||||||
|
|
||||||
|
java_library_static {
|
||||||
|
name: "seedvault-lib-novacrypto-bip39",
|
||||||
|
host_supported: true,
|
||||||
|
static_libs: [
|
||||||
|
"seedvault-lib-novacrypto-bip39-nodeps",
|
||||||
|
"seedvault-lib-novacrypto-sha256",
|
||||||
|
"seedvault-lib-novacrypto-toruntime",
|
||||||
|
],
|
||||||
|
sdk_version: "current",
|
||||||
|
}
|
||||||
|
|
||||||
|
java_import {
|
||||||
|
name: "seedvault-lib-novacrypto-sha256",
|
||||||
|
host_supported: true,
|
||||||
|
jars: ["SHA256-2019.01.27.jar"],
|
||||||
|
sdk_version: "current",
|
||||||
|
}
|
||||||
|
|
||||||
|
java_import {
|
||||||
|
name: "seedvault-lib-novacrypto-toruntime",
|
||||||
|
host_supported: true,
|
||||||
|
jars: ["ToRuntime-0.9.0.jar"],
|
||||||
|
sdk_version: "current",
|
||||||
|
}
|
Loading…
Reference in a new issue