Merge pull request #23 from ionspin/sample-improvement
Sample/Windows build
3
.gitignore
vendored
@ -32,3 +32,6 @@ build/
|
||||
/sodiumWrapper/static-tvos/
|
||||
/sodiumWrapper/static-watchos/
|
||||
/kotlin-multiplatform-libsodium-generator/out/
|
||||
/sodiumWrapper/static-ios-simulators/
|
||||
/sodiumWrapper/static-tvos-simulators/
|
||||
/sodiumWrapper/static-watchos-simulators/
|
||||
|
@ -17,6 +17,7 @@ simpleCheck:
|
||||
script: echo PREPARE
|
||||
tags:
|
||||
- linuxX64
|
||||
# ---- Linux builds ----
|
||||
|
||||
buildLinux:
|
||||
stage: build
|
||||
@ -26,6 +27,19 @@ buildLinux:
|
||||
- ./linuxBuild.sh
|
||||
tags:
|
||||
- linuxX64
|
||||
linuxPublishToSnapshot:
|
||||
stage: deploy
|
||||
script:
|
||||
- ./linuxBuild.sh
|
||||
- ./linuxBuildAndPublish.sh
|
||||
only:
|
||||
- master
|
||||
tags:
|
||||
- linuxX64
|
||||
|
||||
|
||||
# ---- Mac builds ----
|
||||
|
||||
buildMac:
|
||||
stage: build
|
||||
when: manual
|
||||
@ -34,11 +48,38 @@ buildMac:
|
||||
- ./macBuild.sh
|
||||
tags:
|
||||
- macos
|
||||
|
||||
macPublishToSnapshot:
|
||||
stage: deploy
|
||||
script:
|
||||
- ./macBuild.sh
|
||||
- ./macBuildAndPublishSnapshot-bindings.sh
|
||||
- ./macBuildAndPublishSnapshot-delegated.sh
|
||||
only:
|
||||
- master
|
||||
tags:
|
||||
- macos
|
||||
|
||||
# ---- Windows builds ----
|
||||
|
||||
buildWindows:
|
||||
stage: build
|
||||
when: manual
|
||||
allow_failure: false
|
||||
script: echo TEST_PULL_REQUEST_WIN
|
||||
script:
|
||||
- $env:CHERE_INVOKING = 'yes'
|
||||
- C:\msys64\usr\bin\bash -lc "./windowsBuild-delegated.sh"
|
||||
- C:\msys64\usr\bin\bash -lc "./windowsBuild-pure.sh"
|
||||
tags:
|
||||
- windowsX64
|
||||
|
||||
windowsPublishToSnapshot:
|
||||
stage: deploy
|
||||
script:
|
||||
- $env:CHERE_INVOKING = 'yes'
|
||||
- C:\msys64\usr\bin\bash -lc "./windowsBuildAndPublish-delegated.sh"
|
||||
- C:\msys64\usr\bin\bash -lc "./windowsBuildAndPublish-pure.sh"
|
||||
only:
|
||||
- master
|
||||
tags:
|
||||
- windowsX64
|
||||
|
23
README.md
@ -135,16 +135,23 @@ Currently supported native platforms:
|
||||
|
||||
### TODO:
|
||||
- Copy/adapt code documentation, currently only some functions have documentation that is a copy-paste from libsodium website
|
||||
- Complete the bindings list
|
||||
- Samples
|
||||
- Replace LazySodium with direct JNA calls, and add build scripts for required libraries if missing
|
||||
- Android testing
|
||||
- Fix browser testing, both locally and in CI/CD
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- LobsodiumUtil `unpad` and `fromBase64` native implementations use a nasty hack to support shared native sourceset. The hack either needs to be removed and replaced with another solution or additional safeguards need to be added.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### Notes for Gitlab runners:
|
||||
- At the moment all runners need to have android sdk
|
||||
#### Mac:
|
||||
|
||||
#### Windows:
|
||||
- Needs android sdk
|
||||
- Git needs long file path enabled
|
||||
- msys2 needs to be installed and `pacman update` executed
|
||||
|
||||
|
||||
|
||||
|
@ -15,9 +15,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
buildscript {
|
||||
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
|
@ -17,7 +17,9 @@
|
||||
|
||||
|
||||
plugins {
|
||||
`java-gradle-plugin`
|
||||
`kotlin-dsl`
|
||||
`kotlin-dsl-precompiled-script-plugins`
|
||||
}
|
||||
|
||||
repositories {
|
||||
@ -29,8 +31,8 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0-rc")
|
||||
implementation("com.android.tools.build:gradle:4.0.1")
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10")
|
||||
implementation("com.android.tools.build:gradle:4.0.2")
|
||||
}
|
||||
|
||||
System.setProperty("PROJECT_PATH", project.projectDir.parentFile.toString())
|
||||
|
@ -17,18 +17,21 @@
|
||||
object Versions {
|
||||
val kotlinCoroutines = "1.3.9"
|
||||
val kotlin = "1.4.10"
|
||||
val kotlinSerialization = "1.0.0-RC"
|
||||
val kotlinSerialization = "1.0.0"
|
||||
val kotlinSerializationPlugin = "1.4.10"
|
||||
val atomicfu = "0.14.3-M2-2-SNAPSHOT" //NOTE: my linux arm32 and arm64 build
|
||||
val nodePlugin = "1.3.0"
|
||||
val dokkaPlugin = "1.4.0-rc"
|
||||
val taskTreePlugin = "1.5"
|
||||
|
||||
val kotlinBigNumVersion = "0.1.6-1.4.0-rc-SNAPSHOT"
|
||||
|
||||
val kotlinBigNumVersion = "0.2.2"
|
||||
val lazySodium = "4.3.1-SNAPSHOT"
|
||||
val jna = "5.5.0"
|
||||
|
||||
val kotlinPoet = "1.6.0"
|
||||
val libsodiumBindings = "0.1.1-SNAPSHOT"
|
||||
val ktor = "1.3.2"
|
||||
val timber = "4.7.1"
|
||||
val kodeinVersion = "7.1.0"
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -36,6 +39,7 @@ object Versions {
|
||||
object ReleaseInfo {
|
||||
val group = "com.ionspin.kotlin"
|
||||
val version = "0.1.0-SNAPSHOT"
|
||||
val bindingsVersion = "0.1.1-SNAPSHOT"
|
||||
}
|
||||
|
||||
object Deps {
|
||||
@ -45,25 +49,53 @@ object Deps {
|
||||
val test = "test-common"
|
||||
val testAnnotation = "test-annotations-common"
|
||||
val coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:${Versions.kotlinCoroutines}"
|
||||
val serialization = "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:${Versions.kotlinSerialization}"
|
||||
val serialization = "org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.kotlinSerialization}"
|
||||
val atomicfu = "com.ionspin.kotlin.atomicfu:atomicfu:${Versions.atomicfu}"
|
||||
|
||||
|
||||
val kotlinBigNum = "com.ionspin.kotlin:bignum:${Versions.kotlinBigNumVersion}"
|
||||
|
||||
val apiProject = ":multiplatform-crypto-api"
|
||||
|
||||
val libsodiumBindings = "com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:${Versions.libsodiumBindings}"
|
||||
|
||||
val kodein = "org.kodein.di:kodein-di:${Versions.kodeinVersion}"
|
||||
}
|
||||
|
||||
object Js {
|
||||
|
||||
object JsVersions {
|
||||
val react = "16.13.1-pre.124-kotlin-1.4.10"
|
||||
val reactNpm = "16.13.1"
|
||||
val styled = "5.2.0-pre.124-kotlin-1.4.10"
|
||||
val styledNpm = "1.0.0"
|
||||
|
||||
}
|
||||
|
||||
val stdLib = "stdlib-js"
|
||||
val test = "test-js"
|
||||
val coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:${Versions.kotlinCoroutines}"
|
||||
val serialization = "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:${Versions.kotlinSerialization}"
|
||||
|
||||
val ktorClient = "io.ktor:ktor-client-js:${Versions.ktor}"
|
||||
val ktorClientSerialization = "io.ktor:ktor-client-serialization-js:${Versions.ktor}"
|
||||
val ktorClientWebSockets = "io.ktor:ktor-client-websockets-js:${Versions.ktor}"
|
||||
|
||||
object React {
|
||||
val react = "org.jetbrains:kotlin-react:${JsVersions.react}"
|
||||
val reactDom = "org.jetbrains:kotlin-react-dom:${JsVersions.react}"
|
||||
val styled = "org.jetbrains:kotlin-styled:${JsVersions.styled}"
|
||||
|
||||
}
|
||||
|
||||
object Npm {
|
||||
val libsodium = Pair("libsodium-wrappers-sumo", "0.7.8")
|
||||
//val libsodiumWrappers = Pair("libsodium-wrappers-sumo", "file:${getProjectPath()}/multiplatform-crypto-delegated/libsodium-wrappers-sumo-0.7.6.tgz")
|
||||
val libsodiumWrappers = Pair("libsodium-wrappers-sumo", "0.7.8")
|
||||
val reactPair = Pair("react", JsVersions.reactNpm)
|
||||
val reactDomPair = Pair("react-dom", JsVersions.reactNpm)
|
||||
val styledComponentsPair = Pair("styled-components", "5.2.0")
|
||||
val inlineStylePrefixesPair = Pair("inline-style-prefixer", "6.0.0")
|
||||
}
|
||||
|
||||
}
|
||||
@ -100,11 +132,24 @@ object Deps {
|
||||
|
||||
}
|
||||
|
||||
object Android {
|
||||
val coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.kotlinCoroutines}"
|
||||
val ktorClientOkHttp = "io.ktor:ktor-client-okhttp:${Versions.ktor}"
|
||||
val ktorClient = "io.ktor:ktor-client-android:${Versions.ktor}"
|
||||
val ktorClientSerialization = "io.ktor:ktor-client-serialization-jvm:${Versions.ktor}"
|
||||
val serialization = "org.jetbrains.kotlinx:kotlinx-serialization-runtime:${Versions.kotlinSerialization}"
|
||||
val timber = "com.jakewharton.timber:timber:${Versions.timber}"
|
||||
}
|
||||
|
||||
object Desktop {
|
||||
val libui = "com.github.msink:libui:0.1.8"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
object PluginsDeps {
|
||||
val kotlinSerializationPlugin = "kotlinx-serialization"
|
||||
val kotlinSerializationPlugin = "plugin.serialization"
|
||||
val multiplatform = "multiplatform"
|
||||
val node = "com.github.node-gradle.node"
|
||||
val mavenPublish = "maven-publish"
|
||||
@ -113,5 +158,8 @@ object PluginsDeps {
|
||||
val taskTree = "com.dorongold.task-tree"
|
||||
val androidLibrary = "com.android.library"
|
||||
val kotlinAndroidExtensions = "kotlin-android-extensions"
|
||||
val androidApplication = "com.android.application"
|
||||
val kotlinAndroid = "kotlin-android"
|
||||
val kapt = "kotlin-kapt"
|
||||
}
|
||||
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -16,6 +16,6 @@
|
||||
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
11
macBuild-buildLibsodium.sh
Executable file
@ -0,0 +1,11 @@
|
||||
set -e
|
||||
#!/bin/sh
|
||||
#this will hopefully download all konan dependancies that we use in the build scripts
|
||||
./gradlew multiplatform-crypto-api:build
|
||||
#now let's build linux deps
|
||||
cd sodiumWrapper
|
||||
./makeMacosX86-64.sh
|
||||
./makeIosWatchosTvos.sh
|
||||
#now we can do the delegated build
|
||||
cd ..
|
||||
set +e
|
10
macBuild.sh
@ -5,12 +5,12 @@ set -e
|
||||
#now let's build linux deps
|
||||
cd sodiumWrapper
|
||||
./makeMacosX86-64.sh
|
||||
./makeIos.sh
|
||||
./makeTvos.sh
|
||||
./makeWatchos.sh
|
||||
./makeIosWatchosTvos.sh
|
||||
#now we can do the delegated build
|
||||
cd ..
|
||||
./gradlew multiplatform-crypto-delegated:build
|
||||
#and finally pure build
|
||||
#pure build
|
||||
./gradlew multiplatform-crypto:build
|
||||
set +e
|
||||
#libsodium bindings
|
||||
./gradlew multiplatform-crypto-libsodium-bindings:build
|
||||
set +e
|
||||
|
15
macBuildAndPublishSnapshot-bindings.sh
Executable file
@ -0,0 +1,15 @@
|
||||
set -e
|
||||
#!/bin/sh
|
||||
./gradlew multiplatform-crypto-libsodium-bindings:publishMacosX64PublicationToSnapshotRepository
|
||||
|
||||
./gradlew multiplatform-crypto-libsodium-bindings:publishIosArm32PublicationToSnapshotRepository \
|
||||
multiplatform-crypto-libsodium-bindings:publishIosArm64PublicationToSnapshotRepository \
|
||||
multiplatform-crypto-libsodium-bindings:publishIosX64PublicationToSnapshotRepository
|
||||
|
||||
./gradlew multiplatform-crypto-libsodium-bindings:publishWatchosArm32PublicationToSnapshotRepository \
|
||||
multiplatform-crypto-libsodium-bindings:publishWatchosArm64PublicationToSnapshotRepository \
|
||||
multiplatform-crypto-libsodium-bindings:publishWatchosX86PublicationToSnapshotRepository
|
||||
|
||||
./gradlew multiplatform-crypto-libsodium-bindings:publishTvosArm64PublicationToSnapshotRepository \
|
||||
multiplatform-crypto-libsodium-bindings:publishTvosX64PublicationToSnapshotRepository
|
||||
set +e
|
15
macBuildAndPublishSnapshot-delegated.sh
Executable file
@ -0,0 +1,15 @@
|
||||
set -e
|
||||
#!/bin/sh
|
||||
./gradlew multiplatform-crypto-delegated:publishMacosX64PublicationToSnapshotRepository
|
||||
|
||||
./gradlew multiplatform-crypto-delegated:publishIosArm32PublicationToSnapshotRepository \
|
||||
multiplatform-crypto-delegated:publishIosArm64PublicationToSnapshotRepository \
|
||||
multiplatform-crypto-delegated:publishIosX64PublicationToSnapshotRepository
|
||||
|
||||
./gradlew multiplatform-crypto-delegated:publishWatchosArm32PublicationToSnapshotRepository \
|
||||
multiplatform-crypto-delegated:publishWatchosArm64PublicationToSnapshotRepository \
|
||||
multiplatform-crypto-delegated:publishWatchosX86PublicationToSnapshotRepository
|
||||
|
||||
./gradlew multiplatform-crypto-delegated:publishTvosArm64PublicationToSnapshotRepository \
|
||||
multiplatform-crypto-delegated:publishTvosX64PublicationToSnapshotRepository
|
||||
set +e
|
@ -297,22 +297,28 @@ kotlin {
|
||||
val macos64Bit = setOf(
|
||||
"macosX64"
|
||||
)
|
||||
val ios64Bit = setOf(
|
||||
"iosArm64", "iosX64"
|
||||
val iosArm = setOf(
|
||||
"iosArm64", "iosArm32"
|
||||
)
|
||||
val ios32Bit = setOf(
|
||||
"iosArm32"
|
||||
val iosSimulator = setOf(
|
||||
"iosX64"
|
||||
)
|
||||
val mingw64Bit = setOf(
|
||||
"mingwX64"
|
||||
)
|
||||
|
||||
val tvos64Bit = setOf(
|
||||
"tvosArm64", "tvosX64"
|
||||
val tvosArm = setOf(
|
||||
"tvosArm64"
|
||||
)
|
||||
val tvosSimulator = setOf(
|
||||
"tvosX64"
|
||||
)
|
||||
|
||||
val watchos32Bit = setOf(
|
||||
"watchosX86", "watchosArm32", "watchosArm64"
|
||||
val watchosArm = setOf(
|
||||
"watchosArm32", "watchosArm64"
|
||||
)
|
||||
val watchosSimulator = setOf(
|
||||
"watchosX86"
|
||||
)
|
||||
|
||||
targets.withType<KotlinNativeTarget> {
|
||||
@ -347,7 +353,7 @@ kotlin {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
}
|
||||
//All ioses share the same static library
|
||||
if (ios64Bit.contains(this@withType.name)) {
|
||||
if (iosArm.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
@ -359,19 +365,19 @@ kotlin {
|
||||
)
|
||||
}
|
||||
|
||||
if (ios32Bit.contains(this@withType.name)) {
|
||||
if (iosSimulator.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-ios/include")
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-ios-simulators/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-ios/lib/libsodium.a"
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-ios-simulators/lib/libsodium.a"
|
||||
)
|
||||
}
|
||||
|
||||
if (tvos64Bit.contains(this@withType.name)) {
|
||||
if (tvosArm.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
@ -383,7 +389,19 @@ kotlin {
|
||||
)
|
||||
}
|
||||
|
||||
if (watchos32Bit.contains(this@withType.name)) {
|
||||
if (tvosSimulator.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-tvos-simulators/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-tvos-simulators/lib/libsodium.a"
|
||||
)
|
||||
}
|
||||
|
||||
if (watchosArm.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
@ -395,6 +413,18 @@ kotlin {
|
||||
)
|
||||
}
|
||||
|
||||
if (watchosSimulator.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-watchos-simulators/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-watchos-simulators/lib/libsodium.a"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -226,7 +226,9 @@ class XChaCha20Poly1305Test {
|
||||
expected.contentEquals(result) && decrypted.contentEquals(data)
|
||||
}
|
||||
val messedUpTag = result.copyOf()
|
||||
messedUpTag[messedUpTag.size - 3] = 0U
|
||||
messedUpTag[messedUpTag.size - 2] = 0U
|
||||
messedUpTag[messedUpTag.size - 1] = 0U
|
||||
assertFails {
|
||||
val decryptorForWrongTag = XChaCha20Poly1305Delegated(key, state, header, true)
|
||||
val plaintext = decryptorForWrongTag.decrypt(messedUpTag)
|
||||
|
@ -53,14 +53,14 @@ repositories {
|
||||
|
||||
}
|
||||
group = ReleaseInfo.group
|
||||
version = ReleaseInfo.version
|
||||
version = ReleaseInfo.bindingsVersion
|
||||
|
||||
val ideaActive = isInIdea()
|
||||
println("Idea active: $ideaActive")
|
||||
android {
|
||||
compileSdkVersion(29)
|
||||
defaultConfig {
|
||||
minSdkVersion(24)
|
||||
minSdkVersion(21)
|
||||
targetSdkVersion(29)
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
@ -77,10 +77,10 @@ android {
|
||||
|
||||
kotlin {
|
||||
val hostOsName = getHostOsName()
|
||||
android()
|
||||
runningOnLinuxx86_64 {
|
||||
println("Configuring Linux X86-64 targets")
|
||||
jvm()
|
||||
android()
|
||||
js {
|
||||
browser {
|
||||
testTask {
|
||||
@ -145,107 +145,103 @@ kotlin {
|
||||
println("Configuring Linux Arm 32 targets")
|
||||
|
||||
}
|
||||
|
||||
runningOnMacos {
|
||||
println("Configuring macos targets")
|
||||
iosX64() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
iosArm64() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
iosArm32() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
macosX64() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
compilations.getByName("main") {
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-macos-x86-64/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-macos-x86-64/lib/libsodium.a"
|
||||
)
|
||||
}
|
||||
}
|
||||
tvosX64() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tvosArm64() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
watchosArm64() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
watchosArm32() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
watchosX86() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
println("Configuring macos targets")
|
||||
iosX64() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
runningOnWindows {
|
||||
println("Configuring Mingw targets")
|
||||
mingwX64() {
|
||||
binaries {
|
||||
staticLib {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
compilations.getByName("main") {
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-mingw-x86-64/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-mingw-x86-64/lib/libsodium.a"
|
||||
)
|
||||
iosArm64() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
iosArm32() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
macosX64() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
compilations.getByName("main") {
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-macos-x86-64/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-macos-x86-64/lib/libsodium.a"
|
||||
)
|
||||
}
|
||||
}
|
||||
tvosX64() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tvosArm64() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
watchosArm64() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
watchosArm32() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
watchosX86() {
|
||||
binaries {
|
||||
framework {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
println("Configuring Mingw targets")
|
||||
mingwX64() {
|
||||
binaries {
|
||||
staticLib {
|
||||
optimized = true
|
||||
}
|
||||
}
|
||||
compilations.getByName("main") {
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-mingw-x86-64/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-mingw-x86-64/lib/libsodium.a"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
println(targets.names)
|
||||
|
||||
sourceSets {
|
||||
@ -301,22 +297,28 @@ kotlin {
|
||||
val macos64Bit = setOf(
|
||||
"macosX64"
|
||||
)
|
||||
val ios64Bit = setOf(
|
||||
"iosArm64", "iosX64"
|
||||
val iosArm = setOf(
|
||||
"iosArm64", "iosArm32"
|
||||
)
|
||||
val ios32Bit = setOf(
|
||||
"iosArm32"
|
||||
val iosSimulator = setOf(
|
||||
"iosX64"
|
||||
)
|
||||
val mingw64Bit = setOf(
|
||||
"mingwX64"
|
||||
)
|
||||
|
||||
val tvos64Bit = setOf(
|
||||
"tvosArm64", "tvosX64"
|
||||
val tvosArm = setOf(
|
||||
"tvosArm64"
|
||||
)
|
||||
val tvosSimulator = setOf(
|
||||
"tvosX64"
|
||||
)
|
||||
|
||||
val watchos32Bit = setOf(
|
||||
"watchosX86", "watchosArm32", "watchosArm64"
|
||||
val watchosArm = setOf(
|
||||
"watchosArm32", "watchosArm64"
|
||||
)
|
||||
val watchosSimulator = setOf(
|
||||
"watchosX86"
|
||||
)
|
||||
|
||||
targets.withType<KotlinNativeTarget> {
|
||||
@ -327,12 +329,12 @@ kotlin {
|
||||
defaultSourceSet.dependsOn(nativeMain)
|
||||
}
|
||||
if (linuxArm64Bit.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(
|
||||
createWorkaroundNativeMainSourceSet(
|
||||
this@withType.name,
|
||||
nativeDependencies
|
||||
)
|
||||
defaultSourceSet.dependsOn(
|
||||
createWorkaroundNativeMainSourceSet(
|
||||
this@withType.name,
|
||||
nativeDependencies
|
||||
)
|
||||
)
|
||||
|
||||
compilations.getByName("main") {
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
@ -351,7 +353,7 @@ kotlin {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
}
|
||||
//All ioses share the same static library
|
||||
if (ios64Bit.contains(this@withType.name)) {
|
||||
if (iosArm.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
@ -363,19 +365,19 @@ kotlin {
|
||||
)
|
||||
}
|
||||
|
||||
if (ios32Bit.contains(this@withType.name)) {
|
||||
if (iosSimulator.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-ios/include")
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-ios-simulators/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-ios/lib/libsodium.a"
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-ios-simulators/lib/libsodium.a"
|
||||
)
|
||||
}
|
||||
|
||||
if (tvos64Bit.contains(this@withType.name)) {
|
||||
if (tvosArm.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
@ -387,7 +389,19 @@ kotlin {
|
||||
)
|
||||
}
|
||||
|
||||
if (watchos32Bit.contains(this@withType.name)) {
|
||||
if (tvosSimulator.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-tvos-simulators/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-tvos-simulators/lib/libsodium.a"
|
||||
)
|
||||
}
|
||||
|
||||
if (watchosArm.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
@ -399,6 +413,18 @@ kotlin {
|
||||
)
|
||||
}
|
||||
|
||||
if (watchosSimulator.contains(this@withType.name)) {
|
||||
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies))
|
||||
println("Setting ios cinterop for $this")
|
||||
val libsodiumCinterop by cinterops.creating {
|
||||
defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
|
||||
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-watchos-simulators/include")
|
||||
}
|
||||
kotlinOptions.freeCompilerArgs = listOf(
|
||||
"-include-binary", "${project.rootDir}/sodiumWrapper/static-watchos-simulators/lib/libsodium.a"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -410,7 +436,27 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
val androidMain by getting {
|
||||
isNotRunningInIdea {
|
||||
kotlin.srcDirs("src/androidSpecific", "src/jvmMain/kotlin")
|
||||
}
|
||||
isRunningInIdea {
|
||||
kotlin.srcDirs("src/androidSpecific")
|
||||
}
|
||||
dependencies {
|
||||
implementation("com.goterl.lazycode:lazysodium-android:4.2.0@aar")
|
||||
implementation("net.java.dev.jna:jna:5.5.0@aar")
|
||||
}
|
||||
}
|
||||
|
||||
val androidTest by getting {
|
||||
dependencies {
|
||||
implementation(kotlin(Deps.Jvm.test))
|
||||
implementation(kotlin(Deps.Jvm.testJUnit))
|
||||
implementation("androidx.test:runner:1.2.0")
|
||||
implementation("androidx.test:rules:1.2.0")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
runningOnLinuxx86_64 {
|
||||
@ -434,27 +480,7 @@ kotlin {
|
||||
implementation(kotlin(Deps.Jvm.reflection))
|
||||
}
|
||||
}
|
||||
val androidMain by getting {
|
||||
isNotRunningInIdea {
|
||||
kotlin.srcDirs("src/androidSpecific", "src/jvmMain/kotlin")
|
||||
}
|
||||
isRunningInIdea {
|
||||
kotlin.srcDirs("src/androidSpecific")
|
||||
}
|
||||
dependencies {
|
||||
implementation("com.goterl.lazycode:lazysodium-android:4.2.0@aar")
|
||||
implementation("net.java.dev.jna:jna:5.5.0@aar")
|
||||
}
|
||||
}
|
||||
|
||||
val androidTest by getting {
|
||||
dependencies {
|
||||
implementation(kotlin(Deps.Jvm.test))
|
||||
implementation(kotlin(Deps.Jvm.testJUnit))
|
||||
implementation("androidx.test:runner:1.2.0")
|
||||
implementation("androidx.test:rules:1.2.0")
|
||||
}
|
||||
}
|
||||
|
||||
val jsMain by getting {
|
||||
dependencies {
|
||||
|
@ -53,6 +53,8 @@ class AuthenticatedEncryptionWithAssociatedDataTest {
|
||||
assertFailsWith(AeadCorrupedOrTamperedDataException::class) {
|
||||
val tamperedTag = encrypted.copyOf()
|
||||
tamperedTag[3] = 0U
|
||||
tamperedTag[1] = 0U
|
||||
tamperedTag[0] = 0U
|
||||
AuthenticatedEncryptionWithAssociatedData.xChaCha20Poly1305IetfDecrypt(
|
||||
tamperedTag,
|
||||
associatedData,
|
||||
@ -105,6 +107,8 @@ class AuthenticatedEncryptionWithAssociatedDataTest {
|
||||
assertFailsWith(AeadCorrupedOrTamperedDataException::class) {
|
||||
val tamperedTag = encrypted.tag.copyOf()
|
||||
tamperedTag[3] = 0U
|
||||
tamperedTag[1] = 0U
|
||||
tamperedTag[0] = 0U
|
||||
AuthenticatedEncryptionWithAssociatedData.xChaCha20Poly1305IetfDecryptDetached(
|
||||
encrypted.data,
|
||||
tamperedTag,
|
||||
@ -156,6 +160,8 @@ class AuthenticatedEncryptionWithAssociatedDataTest {
|
||||
assertFailsWith(AeadCorrupedOrTamperedDataException::class) {
|
||||
val tamperedTag = encrypted.copyOf()
|
||||
tamperedTag[3] = 0U
|
||||
tamperedTag[1] = 0U
|
||||
tamperedTag[0] = 0U
|
||||
AuthenticatedEncryptionWithAssociatedData.chaCha20Poly1305IetfDecrypt(
|
||||
tamperedTag,
|
||||
associatedData,
|
||||
@ -207,6 +213,8 @@ class AuthenticatedEncryptionWithAssociatedDataTest {
|
||||
assertFailsWith(AeadCorrupedOrTamperedDataException::class) {
|
||||
val tamperedTag = encrypted.tag.copyOf()
|
||||
tamperedTag[3] = 0U
|
||||
tamperedTag[1] = 0U
|
||||
tamperedTag[0] = 0U
|
||||
AuthenticatedEncryptionWithAssociatedData.chaCha20Poly1305IetfDecryptDetached(
|
||||
encrypted.data,
|
||||
tamperedTag,
|
||||
@ -257,6 +265,8 @@ class AuthenticatedEncryptionWithAssociatedDataTest {
|
||||
assertFailsWith(AeadCorrupedOrTamperedDataException::class) {
|
||||
val tamperedTag = encrypted.copyOf()
|
||||
tamperedTag[3] = 0U
|
||||
tamperedTag[1] = 0U
|
||||
tamperedTag[0] = 0U
|
||||
AuthenticatedEncryptionWithAssociatedData.chaCha20Poly1305Decrypt(
|
||||
tamperedTag,
|
||||
associatedData,
|
||||
@ -307,6 +317,8 @@ class AuthenticatedEncryptionWithAssociatedDataTest {
|
||||
assertFailsWith(AeadCorrupedOrTamperedDataException::class) {
|
||||
val tamperedTag = encrypted.tag.copyOf()
|
||||
tamperedTag[3] = 0U
|
||||
tamperedTag[1] = 0U
|
||||
tamperedTag[0] = 0U
|
||||
AuthenticatedEncryptionWithAssociatedData.chaCha20Poly1305DecryptDetached(
|
||||
encrypted.data,
|
||||
tamperedTag,
|
||||
|
@ -40,6 +40,8 @@ class SecretBoxTest {
|
||||
assertFailsWith(SecretBoxCorruptedOrTamperedDataExceptionOrInvalidKey::class) {
|
||||
val tamperedTag = encrypted.copyOf()
|
||||
tamperedTag[2] = 0U
|
||||
tamperedTag[1] = 0U
|
||||
tamperedTag[0] = 0U
|
||||
SecretBox.openEasy(tamperedTag, nonce, key)
|
||||
}
|
||||
}
|
||||
@ -73,6 +75,8 @@ class SecretBoxTest {
|
||||
assertFailsWith(SecretBoxCorruptedOrTamperedDataExceptionOrInvalidKey::class) {
|
||||
val tamperedTag = encrypted.tag.copyOf()
|
||||
tamperedTag[2] = 0U
|
||||
tamperedTag[1] = 0U
|
||||
tamperedTag[0] = 0U
|
||||
SecretBox.openDetached(encrypted.data, tamperedTag, nonce, key)
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +75,8 @@ class SecretStreamTest {
|
||||
}
|
||||
assertFailsWith(SecretStreamCorruptedOrTamperedDataException::class) {
|
||||
encrypted[encrypted.size - 5] = 0U
|
||||
encrypted[encrypted.size - 4] = 0U
|
||||
encrypted[encrypted.size - 3] = 0U
|
||||
val decryptState = SecretStream.xChaCha20Poly1305InitPull(key, stateAndHeader.header)
|
||||
val decrypted =
|
||||
SecretStream.xChaCha20Poly1305Pull(decryptState.state, encrypted, ubyteArrayOf())
|
||||
|
@ -24,6 +24,8 @@ class SignatureTest {
|
||||
assertFailsWith(InvalidSignatureException::class) {
|
||||
val tamperedMessage = signedMessage.copyOf()
|
||||
tamperedMessage[crypto_sign_BYTES + 1] = 0U
|
||||
tamperedMessage[crypto_sign_BYTES + 2] = 0U
|
||||
tamperedMessage[crypto_sign_BYTES + 3] = 0U
|
||||
Signature.open(tamperedMessage, keys.publicKey)
|
||||
}
|
||||
}
|
||||
@ -65,6 +67,8 @@ class SignatureTest {
|
||||
assertFailsWith(InvalidSignatureException::class) {
|
||||
val tamperedSignature = signature.copyOf()
|
||||
tamperedSignature[crypto_sign_BYTES - 1] = 0U
|
||||
tamperedSignature[crypto_sign_BYTES - 2] = 0U
|
||||
tamperedSignature[crypto_sign_BYTES - 3] = 0U
|
||||
Signature.finalVerify(verificationState, tamperedSignature, keys.publicKey)
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import libsodium.sodium_memcmp
|
||||
import libsodium.sodium_memzero
|
||||
import libsodium.sodium_pad
|
||||
import libsodium.sodium_unpad
|
||||
import platform.posix.size_tVar
|
||||
|
||||
/**
|
||||
* Created by Ugljesa Jovanovic
|
||||
@ -60,15 +61,15 @@ actual object LibsodiumUtil {
|
||||
actual fun unpad(paddedData: UByteArray, blocksize: Int) : UByteArray {
|
||||
val paddedDataCopy = paddedData.copyOf()
|
||||
val paddedDataCopyPinned = paddedDataCopy.pin()
|
||||
var newSize = ULongArray(1) { 0UL }
|
||||
val newSizePinned = newSize.pin()
|
||||
var newSizeULong = ULongArray(1) { 0UL }
|
||||
val newSizePinned = newSizeULong.pin()
|
||||
sodium_unpad(
|
||||
newSizePinned.addressOf(0),
|
||||
newSizePinned.addressOf(0) as kotlinx.cinterop.CValuesRef<platform.posix.size_tVar>, // TODO Find a better solution for this!
|
||||
paddedDataCopyPinned.toPtr(),
|
||||
paddedData.size.convert(),
|
||||
blocksize.convert()
|
||||
)
|
||||
val unpaddedSize = newSize[0]
|
||||
val unpaddedSize = newSizeULong[0]
|
||||
if (unpaddedSize > Int.MAX_VALUE.toULong()) {
|
||||
throw RuntimeException("Unsupported array size (larger than Integer max value) $unpaddedSize")
|
||||
}
|
||||
@ -126,7 +127,7 @@ actual object LibsodiumUtil {
|
||||
data,
|
||||
data.length.convert(),
|
||||
null,
|
||||
binLenPinned.addressOf(0),
|
||||
binLenPinned.addressOf(0) as kotlinx.cinterop.CValuesRef<platform.posix.size_tVar>, // TODO Find a better solution for this!
|
||||
null,
|
||||
variant.value
|
||||
|
||||
|
@ -49,6 +49,7 @@ val ideaActive = System.getProperty("idea.active") == "true"
|
||||
|
||||
kotlin {
|
||||
val hostOsName = getHostOsName()
|
||||
val bla =1
|
||||
runningOnLinuxx86_64 {
|
||||
jvm()
|
||||
js {
|
||||
|
@ -17,42 +17,56 @@
|
||||
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
|
||||
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
|
||||
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
|
||||
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
|
||||
import org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask
|
||||
|
||||
plugins {
|
||||
kotlin(PluginsDeps.multiplatform)
|
||||
id (PluginsDeps.mavenPublish)
|
||||
id (PluginsDeps.signing)
|
||||
id (PluginsDeps.node) version Versions.nodePlugin
|
||||
id(PluginsDeps.kapt)
|
||||
id(PluginsDeps.androidApplication)
|
||||
id(PluginsDeps.kotlinAndroidExtensions)
|
||||
id(PluginsDeps.mavenPublish)
|
||||
id(PluginsDeps.signing)
|
||||
kotlin(PluginsDeps.kotlinSerializationPlugin) version Versions.kotlinSerializationPlugin
|
||||
|
||||
}
|
||||
org.jetbrains.kotlin.gradle.targets.js.npm.NpmResolverPlugin.apply(project)
|
||||
|
||||
val sonatypeStaging = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
|
||||
val sonatypeSnapshots = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
|
||||
val sonatypePassword : String? by project
|
||||
|
||||
val sonatypeUsername : String? by project
|
||||
|
||||
val sonatypePasswordEnv : String? = System.getenv()["SONATYPE_PASSWORD"]
|
||||
val sonatypeUsernameEnv : String? = System.getenv()["SONATYPE_USERNAME"]
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven("https://dl.bintray.com/terl/lazysodium-maven")
|
||||
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
|
||||
}
|
||||
group = "com.ionspin.kotlin"
|
||||
version = "0.0.4-SNAPSHOT"
|
||||
version = "0.1.0-SNAPSHOT"
|
||||
|
||||
val ideaActive = System.getProperty("idea.active") == "true"
|
||||
|
||||
kotlin {
|
||||
val hostOsName = getHostOsName()
|
||||
if (ideaActive) {
|
||||
when (hostOsName) {
|
||||
"linux" -> linuxX64("native")
|
||||
"macos" -> macosX64("native")
|
||||
"windows" -> mingwX64("native")
|
||||
}
|
||||
}
|
||||
android()
|
||||
runningOnLinuxx86_64 {
|
||||
jvm()
|
||||
js {
|
||||
browser {
|
||||
webpackTask {
|
||||
|
||||
}
|
||||
testTask {
|
||||
enabled = false //Until I sort out testing on travis
|
||||
useKarma {
|
||||
@ -61,69 +75,96 @@ kotlin {
|
||||
}
|
||||
}
|
||||
nodejs {
|
||||
|
||||
testTask {
|
||||
useMocha() {
|
||||
timeout = "10s"
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries.executable()
|
||||
|
||||
}
|
||||
|
||||
|
||||
linuxX64("linux") {
|
||||
|
||||
binaries {
|
||||
|
||||
executable {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Linux 32 is using target-sysroot-2-raspberrypi which is missing getrandom and explicit_bzero in stdlib
|
||||
// so konanc can't build klib because getrandom missing will cause sodium_misuse()
|
||||
// so 32bit will be only available from non-delegated flavor
|
||||
// linuxArm32Hfp() {
|
||||
|
||||
//Disable for now as libui doesnt support arm64
|
||||
// linuxArm64() {
|
||||
// binaries {
|
||||
// executable {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
linuxArm64() {
|
||||
binaries {
|
||||
executable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
runningOnMacos {
|
||||
iosX64() {
|
||||
val iosX64Target = iosX64() {
|
||||
binaries {
|
||||
framework {
|
||||
baseName = "LibsodiumBindings"
|
||||
export(Deps.Common.libsodiumBindings)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
val iosArm64Target = iosArm64() {
|
||||
binaries {
|
||||
framework {
|
||||
baseName = "LibsodiumBindings"
|
||||
export(Deps.Common.libsodiumBindings)
|
||||
}
|
||||
}
|
||||
}
|
||||
iosArm64() {
|
||||
val iosArm32Target = iosArm32() {
|
||||
binaries {
|
||||
framework {
|
||||
|
||||
baseName = "LibsodiumBindings"
|
||||
export(Deps.Common.libsodiumBindings)
|
||||
}
|
||||
}
|
||||
}
|
||||
val macosX64Target = macosX64()
|
||||
val tvosX64Target = tvosX64()
|
||||
val tvosArm64Target = tvosArm64()
|
||||
val watchosArm64Target = watchosArm64()
|
||||
val watchosArm32Target = watchosArm32()
|
||||
val watchosX86Target = watchosX86()
|
||||
|
||||
iosArm32() {
|
||||
binaries {
|
||||
framework {
|
||||
|
||||
}
|
||||
}
|
||||
configure(listOf(macosX64Target)) {
|
||||
binaries.executable {}
|
||||
}
|
||||
macosX64() {
|
||||
binaries {
|
||||
executable {
|
||||
|
||||
}
|
||||
}
|
||||
// configure(listOf(
|
||||
// iosX64Target, iosArm64Target, iosArm32Target,
|
||||
// tvosX64Target, tvosArm64Target, watchosArm64Target,
|
||||
// watchosArm32Target, watchosX86Target)
|
||||
// ) {
|
||||
// binaries.framework {
|
||||
// baseName = "LibsodiumBindings"
|
||||
// export(Deps.Common.libsodiumBindings)
|
||||
// }
|
||||
// }
|
||||
val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
|
||||
println("Mode $mode")
|
||||
// Create a task to build a fat framework.
|
||||
tasks.create("packForXcode", FatFrameworkTask::class) {
|
||||
// The fat framework must have the same base name as the initial frameworks.
|
||||
baseName = "LibsodiumBindings"
|
||||
// The default destination directory is '<build directory>/fat-framework'.
|
||||
destinationDir = File(buildDir, "xcode-frameworks")
|
||||
// Specify the frameworks to be merged.
|
||||
from(
|
||||
iosX64Target.binaries.getFramework(mode),
|
||||
iosArm64Target.binaries.getFramework(mode),
|
||||
iosArm32Target.binaries.getFramework(mode)
|
||||
)
|
||||
}
|
||||
}
|
||||
runningOnWindows {
|
||||
@ -138,13 +179,16 @@ kotlin {
|
||||
|
||||
println(targets.names)
|
||||
|
||||
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
implementation(kotlin(Deps.Common.stdLib))
|
||||
implementation(kotlin(Deps.Common.test))
|
||||
implementation(Deps.Common.kotlinBigNum)
|
||||
implementation(project(":multiplatform-crypto-libsodium-bindings"))
|
||||
implementation(Deps.Common.serialization)
|
||||
api(Deps.Common.libsodiumBindings)
|
||||
}
|
||||
}
|
||||
val commonTest by getting {
|
||||
@ -154,17 +198,83 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
val androidMain by getting {
|
||||
|
||||
val nativeMain by creating {
|
||||
dependsOn(commonMain)
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${Versions.kotlin}")
|
||||
implementation("androidx.appcompat:appcompat:1.2.0")
|
||||
implementation("androidx.core:core-ktx:1.3.2")
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.0.2")
|
||||
implementation("com.google.android.material:material:1.3.0-alpha03")
|
||||
// implementation("androidx.ui:ui-tooling:$composeDevVersion")
|
||||
// implementation("androidx.ui:ui-layout:$composeDevVersion")
|
||||
// implementation("androidx.ui:ui-material:$composeDevVersion")
|
||||
// implementation("androidx.ui:ui-foundation:$composeDevVersion")
|
||||
// implementation("androidx.ui:ui-framework:$composeDevVersion")
|
||||
implementation(Deps.Android.coroutines)
|
||||
implementation(Deps.Android.timber)
|
||||
// implementation("androidx.compose:compose-runtime:$composeDevVersion")
|
||||
}
|
||||
}
|
||||
val androidTest by getting {
|
||||
dependencies {
|
||||
implementation(kotlin(Deps.Jvm.test))
|
||||
implementation(kotlin(Deps.Jvm.testJUnit))
|
||||
implementation(Deps.Jvm.coroutinesTest)
|
||||
implementation(kotlin(Deps.Jvm.reflection))
|
||||
implementation(Deps.Jvm.coroutinesCore)
|
||||
}
|
||||
}
|
||||
|
||||
val nativeTest by creating {
|
||||
dependsOn(commonTest)
|
||||
dependencies {
|
||||
|
||||
|
||||
// val nativeMain by creating {
|
||||
// dependsOn(commonMain)
|
||||
// dependencies {
|
||||
// implementation(Deps.Desktop.libui)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// val nativeTest by creating {
|
||||
// dependsOn(commonTest)
|
||||
// dependencies {
|
||||
// }
|
||||
// }
|
||||
|
||||
val nativeMain = if (ideaActive) {
|
||||
val nativeMain by getting {
|
||||
dependsOn(commonMain)
|
||||
dependencies {
|
||||
implementation(Deps.Desktop.libui)
|
||||
}
|
||||
}
|
||||
nativeMain
|
||||
} else {
|
||||
val nativeMain by creating {
|
||||
dependsOn(commonMain)
|
||||
dependencies {
|
||||
implementation(Deps.Desktop.libui)
|
||||
}
|
||||
}
|
||||
nativeMain
|
||||
}
|
||||
|
||||
val nativeTest = if (ideaActive) {
|
||||
val nativeTest by getting {
|
||||
dependsOn(commonTest)
|
||||
dependencies {
|
||||
implementation(Deps.Native.coroutines)
|
||||
}
|
||||
}
|
||||
nativeTest
|
||||
} else {
|
||||
val nativeTest by creating {
|
||||
dependsOn(commonTest)
|
||||
dependencies {
|
||||
implementation(Deps.Native.coroutines)
|
||||
}
|
||||
}
|
||||
nativeTest
|
||||
}
|
||||
|
||||
runningOnLinuxx86_64 {
|
||||
@ -185,6 +295,19 @@ kotlin {
|
||||
val jsMain by getting {
|
||||
dependencies {
|
||||
implementation(kotlin(Deps.Js.stdLib))
|
||||
implementation(Deps.Js.coroutines)
|
||||
|
||||
// React
|
||||
implementation(Deps.Js.React.react)
|
||||
implementation(Deps.Js.React.reactDom)
|
||||
implementation(npm(Deps.Js.Npm.reactPair.first, Deps.Js.Npm.reactPair.second))
|
||||
implementation(npm(Deps.Js.Npm.reactDomPair.first, Deps.Js.Npm.reactDomPair.second))
|
||||
|
||||
// Styled
|
||||
implementation(Deps.Js.React.styled)
|
||||
implementation(npm(Deps.Js.Npm.styledComponentsPair.first, Deps.Js.Npm.styledComponentsPair.second))
|
||||
implementation(npm(Deps.Js.Npm.inlineStylePrefixesPair.first, Deps.Js.Npm.inlineStylePrefixesPair.second))
|
||||
|
||||
}
|
||||
}
|
||||
val jsTest by getting {
|
||||
@ -192,24 +315,20 @@ kotlin {
|
||||
implementation(kotlin(Deps.Js.test))
|
||||
}
|
||||
}
|
||||
|
||||
val linuxMain by getting {
|
||||
dependsOn(nativeMain)
|
||||
}
|
||||
val linuxTest by getting {
|
||||
dependsOn(nativeTest)
|
||||
}
|
||||
// val linuxArm32HfpMain by getting {
|
||||
|
||||
// val linuxArm64Main by getting {
|
||||
// dependsOn(nativeMain)
|
||||
// }
|
||||
// val linuxArm32HfpTest by getting {
|
||||
// val linuxArm64Test by getting {
|
||||
// dependsOn(nativeTest)
|
||||
// }
|
||||
val linuxArm64Main by getting {
|
||||
dependsOn(nativeMain)
|
||||
}
|
||||
val linuxArm64Test by getting {
|
||||
dependsOn(nativeTest)
|
||||
}
|
||||
}
|
||||
|
||||
runningOnMacos {
|
||||
@ -265,6 +384,82 @@ kotlin {
|
||||
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion(29)
|
||||
defaultConfig {
|
||||
applicationId = "com.ionspin.kotlin.crypto.sample"
|
||||
minSdkVersion(21)
|
||||
targetSdkVersion(29)
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
getByName("release") {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
sourceSets {
|
||||
val main by getting
|
||||
main.manifest.srcFile("src/androidMain/AndroidManifest.xml")
|
||||
main.java.srcDirs("src/androidMain/kotlin")
|
||||
main.res.srcDirs("src/androidMain/res")
|
||||
}
|
||||
packagingOptions {
|
||||
exclude("META-INF/library_release.kotlin_module")
|
||||
exclude("META-INF/kotlinx-serialization-runtime.kotlin_module")
|
||||
exclude("META-INF/ktor-http.kotlin_module")
|
||||
exclude("META-INF/ktor-utils.kotlin_module")
|
||||
exclude("META-INF/ktor-io.kotlin_module")
|
||||
exclude("META-INF/ktor-*")
|
||||
}
|
||||
compileOptions {
|
||||
setSourceCompatibility(JavaVersion.VERSION_1_8)
|
||||
setTargetCompatibility(JavaVersion.VERSION_1_8)
|
||||
}
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
}
|
||||
|
||||
// buildFeatures {
|
||||
// // Enables Jetpack Compose for this module
|
||||
// this.compose = true
|
||||
// }
|
||||
|
||||
// composeOptions {
|
||||
// kotlinCompilerExtensionVersion = "0.1.0-dev05"
|
||||
// }
|
||||
|
||||
// Magic for compose dev08, but it doesn't work with serialization plugin because of IR. Leave here for future reference.
|
||||
// project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class.java)
|
||||
// .configureEach {
|
||||
// println("Task: $this")
|
||||
// if (this.name.contains("Android")) {
|
||||
// println("Setting plugins: $this")
|
||||
// this.kotlinOptions.freeCompilerArgs += listOf(
|
||||
// "-P",
|
||||
// "plugin:androidx.compose.plugins.idea:enabled=true"
|
||||
// )
|
||||
// this.kotlinOptions.freeCompilerArgs += "-Xplugin=${project.rootDir}/compose-compiler-0.1.0-dev08.jar"
|
||||
// this.kotlinOptions.freeCompilerArgs += "-Xuse-ir"
|
||||
// }
|
||||
// }
|
||||
// project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class.java)
|
||||
// .forEach { compile ->
|
||||
// compile.kotlinOptions.freeCompilerArgs += listOf(
|
||||
// "-P",
|
||||
// "plugin:androidx.compose.plugins.idea:enabled=true"
|
||||
// )
|
||||
// compile.kotlinOptions.freeCompilerArgs += "-Xplugin=${project.rootDir}/compose-compiler-0.1.0-dev08.jar"
|
||||
// compile.kotlinOptions.freeCompilerArgs += "-Xuse-ir"
|
||||
// println("Compile: $compile")
|
||||
// println("Compiler free args ${compile.kotlinOptions.freeCompilerArgs}")
|
||||
// }
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
|
||||
@ -292,20 +487,7 @@ tasks {
|
||||
}
|
||||
}
|
||||
|
||||
// val legacyjsNodeTest by getting(KotlinJsTest::class) {
|
||||
//
|
||||
// testLogging {
|
||||
// events("PASSED", "FAILED", "SKIPPED")
|
||||
// showStandardStreams = true
|
||||
// }
|
||||
// }
|
||||
|
||||
// val jsIrBrowserTest by getting(KotlinJsTest::class) {
|
||||
// testLogging {
|
||||
// events("PASSED", "FAILED", "SKIPPED")
|
||||
// showStandardStreams = true
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
if (getHostOsName() == "windows") {
|
||||
@ -320,6 +502,27 @@ tasks {
|
||||
|
||||
}
|
||||
|
||||
fun org.jetbrains.kotlin.gradle.plugin.mpp.Executable.windowsResources(rcFileName: String) {
|
||||
val taskName = linkTaskName.replaceFirst("link", "windres")
|
||||
val inFile = compilation.defaultSourceSet.resources.sourceDirectories.singleFile.resolve(rcFileName)
|
||||
val outFile = buildDir.resolve("processedResources/$taskName.res")
|
||||
|
||||
val windresTask = tasks.create<Exec>(taskName) {
|
||||
val konanUserDir = System.getenv("KONAN_DATA_DIR") ?: "${System.getProperty("user.home")}/.konan"
|
||||
val konanLlvmDir = "$konanUserDir/dependencies/msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1/bin"
|
||||
|
||||
inputs.file(inFile)
|
||||
outputs.file(outFile)
|
||||
commandLine("$konanLlvmDir/windres", inFile, "-D_${buildType.name}", "-O", "coff", "-o", outFile)
|
||||
environment("PATH", "$konanLlvmDir;${System.getenv("PATH")}")
|
||||
|
||||
dependsOn(compilation.compileKotlinTask)
|
||||
}
|
||||
|
||||
linkTask.dependsOn(windresTask)
|
||||
linkerOpts(outFile.toString())
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
648
sample/iosApp/iosApp.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,648 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
5745FD43253E4477006B7D0E /* LibsodiumBindings.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5745FD42253E4477006B7D0E /* LibsodiumBindings.framework */; };
|
||||
5745FD44253E4477006B7D0E /* LibsodiumBindings.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5745FD42253E4477006B7D0E /* LibsodiumBindings.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
7555FF7F242A565900829871 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF7E242A565900829871 /* AppDelegate.swift */; };
|
||||
7555FF81242A565900829871 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF80242A565900829871 /* SceneDelegate.swift */; };
|
||||
7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; };
|
||||
7555FF85242A565B00829871 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7555FF84242A565B00829871 /* Assets.xcassets */; };
|
||||
7555FF88242A565B00829871 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7555FF87242A565B00829871 /* Preview Assets.xcassets */; };
|
||||
7555FF8B242A565B00829871 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7555FF89242A565B00829871 /* LaunchScreen.storyboard */; };
|
||||
7555FF96242A565B00829871 /* iosAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF95242A565B00829871 /* iosAppTests.swift */; };
|
||||
7555FFA1242A565B00829871 /* iosAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FFA0242A565B00829871 /* iosAppUITests.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
7555FF92242A565B00829871 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 7555FF73242A565900829871 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 7555FF7A242A565900829871;
|
||||
remoteInfo = iosApp;
|
||||
};
|
||||
7555FF9D242A565B00829871 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 7555FF73242A565900829871 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 7555FF7A242A565900829871;
|
||||
remoteInfo = iosApp;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
5745FD45253E4477006B7D0E /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
5745FD44253E4477006B7D0E /* LibsodiumBindings.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
5745FD42253E4477006B7D0E /* LibsodiumBindings.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LibsodiumBindings.framework; path = "../build/xcode-frameworks/LibsodiumBindings.framework"; sourceTree = "<group>"; };
|
||||
7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7555FF7E242A565900829871 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
7555FF80242A565900829871 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
|
||||
7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||
7555FF84242A565B00829871 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
7555FF87242A565B00829871 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
||||
7555FF8A242A565B00829871 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
7555FF91242A565B00829871 /* iosAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = iosAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7555FF95242A565B00829871 /* iosAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosAppTests.swift; sourceTree = "<group>"; };
|
||||
7555FF97242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
7555FF9C242A565B00829871 /* iosAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = iosAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7555FFA0242A565B00829871 /* iosAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosAppUITests.swift; sourceTree = "<group>"; };
|
||||
7555FFA2242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
7555FFB1242A642300829871 /* sample.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = sample.framework; path = "../build/xcode-frameworks/sample.framework"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
7555FF78242A565900829871 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5745FD43253E4477006B7D0E /* LibsodiumBindings.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7555FF8E242A565B00829871 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7555FF99242A565B00829871 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
7555FF72242A565900829871 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7555FF7D242A565900829871 /* iosApp */,
|
||||
7555FF94242A565B00829871 /* iosAppTests */,
|
||||
7555FF9F242A565B00829871 /* iosAppUITests */,
|
||||
7555FF7C242A565900829871 /* Products */,
|
||||
7555FFB0242A642200829871 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7555FF7C242A565900829871 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7555FF7B242A565900829871 /* iosApp.app */,
|
||||
7555FF91242A565B00829871 /* iosAppTests.xctest */,
|
||||
7555FF9C242A565B00829871 /* iosAppUITests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7555FF7D242A565900829871 /* iosApp */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7555FF7E242A565900829871 /* AppDelegate.swift */,
|
||||
7555FF80242A565900829871 /* SceneDelegate.swift */,
|
||||
7555FF82242A565900829871 /* ContentView.swift */,
|
||||
7555FF84242A565B00829871 /* Assets.xcassets */,
|
||||
7555FF89242A565B00829871 /* LaunchScreen.storyboard */,
|
||||
7555FF8C242A565B00829871 /* Info.plist */,
|
||||
7555FF86242A565B00829871 /* Preview Content */,
|
||||
);
|
||||
path = iosApp;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7555FF86242A565B00829871 /* Preview Content */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7555FF87242A565B00829871 /* Preview Assets.xcassets */,
|
||||
);
|
||||
path = "Preview Content";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7555FF94242A565B00829871 /* iosAppTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7555FF95242A565B00829871 /* iosAppTests.swift */,
|
||||
7555FF97242A565B00829871 /* Info.plist */,
|
||||
);
|
||||
path = iosAppTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7555FF9F242A565B00829871 /* iosAppUITests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7555FFA0242A565B00829871 /* iosAppUITests.swift */,
|
||||
7555FFA2242A565B00829871 /* Info.plist */,
|
||||
);
|
||||
path = iosAppUITests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7555FFB0242A642200829871 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5745FD42253E4477006B7D0E /* LibsodiumBindings.framework */,
|
||||
7555FFB1242A642300829871 /* sample.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
7555FF7A242A565900829871 /* iosApp */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */;
|
||||
buildPhases = (
|
||||
7555FFB5242A651A00829871 /* ShellScript */,
|
||||
7555FF77242A565900829871 /* Sources */,
|
||||
7555FF78242A565900829871 /* Frameworks */,
|
||||
7555FF79242A565900829871 /* Resources */,
|
||||
5745FD45253E4477006B7D0E /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = iosApp;
|
||||
productName = iosApp;
|
||||
productReference = 7555FF7B242A565900829871 /* iosApp.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
7555FF90242A565B00829871 /* iosAppTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 7555FFA8242A565B00829871 /* Build configuration list for PBXNativeTarget "iosAppTests" */;
|
||||
buildPhases = (
|
||||
7555FF8D242A565B00829871 /* Sources */,
|
||||
7555FF8E242A565B00829871 /* Frameworks */,
|
||||
7555FF8F242A565B00829871 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
7555FF93242A565B00829871 /* PBXTargetDependency */,
|
||||
);
|
||||
name = iosAppTests;
|
||||
productName = iosAppTests;
|
||||
productReference = 7555FF91242A565B00829871 /* iosAppTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
7555FF9B242A565B00829871 /* iosAppUITests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 7555FFAB242A565B00829871 /* Build configuration list for PBXNativeTarget "iosAppUITests" */;
|
||||
buildPhases = (
|
||||
7555FF98242A565B00829871 /* Sources */,
|
||||
7555FF99242A565B00829871 /* Frameworks */,
|
||||
7555FF9A242A565B00829871 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
7555FF9E242A565B00829871 /* PBXTargetDependency */,
|
||||
);
|
||||
name = iosAppUITests;
|
||||
productName = iosAppUITests;
|
||||
productReference = 7555FF9C242A565B00829871 /* iosAppUITests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.ui-testing";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
7555FF73242A565900829871 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 1130;
|
||||
LastUpgradeCheck = 1130;
|
||||
ORGANIZATIONNAME = orgName;
|
||||
TargetAttributes = {
|
||||
7555FF7A242A565900829871 = {
|
||||
CreatedOnToolsVersion = 11.3.1;
|
||||
};
|
||||
7555FF90242A565B00829871 = {
|
||||
CreatedOnToolsVersion = 11.3.1;
|
||||
TestTargetID = 7555FF7A242A565900829871;
|
||||
};
|
||||
7555FF9B242A565B00829871 = {
|
||||
CreatedOnToolsVersion = 11.3.1;
|
||||
TestTargetID = 7555FF7A242A565900829871;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 7555FF72242A565900829871;
|
||||
productRefGroup = 7555FF7C242A565900829871 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
7555FF7A242A565900829871 /* iosApp */,
|
||||
7555FF90242A565B00829871 /* iosAppTests */,
|
||||
7555FF9B242A565B00829871 /* iosAppUITests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
7555FF79242A565900829871 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7555FF8B242A565B00829871 /* LaunchScreen.storyboard in Resources */,
|
||||
7555FF88242A565B00829871 /* Preview Assets.xcassets in Resources */,
|
||||
7555FF85242A565B00829871 /* Assets.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7555FF8F242A565B00829871 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7555FF9A242A565B00829871 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
7555FFB5242A651A00829871 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "cd \"$SRCROOT/..\"\n../gradlew :sample:packForXCode -PXCODE_CONFIGURATION=${CONFIGURATION}\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
7555FF77242A565900829871 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7555FF7F242A565900829871 /* AppDelegate.swift in Sources */,
|
||||
7555FF81242A565900829871 /* SceneDelegate.swift in Sources */,
|
||||
7555FF83242A565900829871 /* ContentView.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7555FF8D242A565B00829871 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7555FF96242A565B00829871 /* iosAppTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7555FF98242A565B00829871 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7555FFA1242A565B00829871 /* iosAppUITests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
7555FF93242A565B00829871 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 7555FF7A242A565900829871 /* iosApp */;
|
||||
targetProxy = 7555FF92242A565B00829871 /* PBXContainerItemProxy */;
|
||||
};
|
||||
7555FF9E242A565B00829871 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 7555FF7A242A565900829871 /* iosApp */;
|
||||
targetProxy = 7555FF9D242A565B00829871 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
7555FF89242A565B00829871 /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
7555FF8A242A565B00829871 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
7555FFA3242A565B00829871 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
7555FFA4242A565B00829871 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
7555FFA6242A565B00829871 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = 5U57WAFNJ6;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../build/xcode-frameworks";
|
||||
INFOPLIST_FILE = iosApp/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ionspin.kotlin.crypto.sample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
7555FFA7242A565B00829871 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = 5U57WAFNJ6;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../build/xcode-frameworks";
|
||||
INFOPLIST_FILE = iosApp/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ionspin.kotlin.crypto.sample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
7555FFA9242A565B00829871 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
INFOPLIST_FILE = iosAppTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = orgIdentifier.iosAppTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iosApp.app/iosApp";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
7555FFAA242A565B00829871 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
INFOPLIST_FILE = iosAppTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = orgIdentifier.iosAppTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iosApp.app/iosApp";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
7555FFAC242A565B00829871 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
INFOPLIST_FILE = iosAppUITests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = orgIdentifier.iosAppUITests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_TARGET_NAME = iosApp;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
7555FFAD242A565B00829871 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
INFOPLIST_FILE = iosAppUITests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = orgIdentifier.iosAppUITests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_TARGET_NAME = iosApp;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
7555FFA3242A565B00829871 /* Debug */,
|
||||
7555FFA4242A565B00829871 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
7555FFA6242A565B00829871 /* Debug */,
|
||||
7555FFA7242A565B00829871 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
7555FFA8242A565B00829871 /* Build configuration list for PBXNativeTarget "iosAppTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
7555FFA9242A565B00829871 /* Debug */,
|
||||
7555FFAA242A565B00829871 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
7555FFAB242A565B00829871 /* Build configuration list for PBXNativeTarget "iosAppUITests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
7555FFAC242A565B00829871 /* Debug */,
|
||||
7555FFAD242A565B00829871 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 7555FF73242A565900829871 /* Project object */;
|
||||
}
|
7
sample/iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>iosApp.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
29
sample/iosApp/iosApp/AppDelegate.swift
Normal file
@ -0,0 +1,29 @@
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
// MARK: UISceneSession Lifecycle
|
||||
|
||||
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
|
||||
// Called when a new scene session is being created.
|
||||
// Use this method to select a configuration to create the new scene with.
|
||||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
|
||||
// Called when the user discards a scene session.
|
||||
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
|
||||
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,98 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
6
sample/iosApp/iosApp/Assets.xcassets/Contents.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
25
sample/iosApp/iosApp/Base.lproj/LaunchScreen.storyboard
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
21
sample/iosApp/iosApp/ContentView.swift
Normal file
@ -0,0 +1,21 @@
|
||||
import SwiftUI
|
||||
import LibsodiumBindings
|
||||
|
||||
|
||||
struct ContentView: View {
|
||||
var body: some View {
|
||||
|
||||
Text("Hello, World! \(Sample.init().hashSomething())")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func test() {
|
||||
|
||||
}
|
||||
|
||||
struct ContentView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ContentView()
|
||||
}
|
||||
}
|
62
sample/iosApp/iosApp/Info.plist
Normal file
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
<false/>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict>
|
||||
<key>UIWindowSceneSessionRoleApplication</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UISceneConfigurationName</key>
|
||||
<string>Default Configuration</string>
|
||||
<key>UISceneDelegateClassName</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
56
sample/iosApp/iosApp/SceneDelegate.swift
Normal file
@ -0,0 +1,56 @@
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
|
||||
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
|
||||
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
|
||||
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
|
||||
|
||||
// Create the SwiftUI view that provides the window contents.
|
||||
let contentView = ContentView()
|
||||
|
||||
// Use a UIHostingController as window root view controller.
|
||||
if let windowScene = scene as? UIWindowScene {
|
||||
let window = UIWindow(windowScene: windowScene)
|
||||
window.rootViewController = UIHostingController(rootView: contentView)
|
||||
self.window = window
|
||||
window.makeKeyAndVisible()
|
||||
}
|
||||
}
|
||||
|
||||
func sceneDidDisconnect(_ scene: UIScene) {
|
||||
// Called as the scene is being released by the system.
|
||||
// This occurs shortly after the scene enters the background, or when its session is discarded.
|
||||
// Release any resources associated with this scene that can be re-created the next time the scene connects.
|
||||
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
|
||||
}
|
||||
|
||||
func sceneDidBecomeActive(_ scene: UIScene) {
|
||||
// Called when the scene has moved from an inactive state to an active state.
|
||||
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
|
||||
}
|
||||
|
||||
func sceneWillResignActive(_ scene: UIScene) {
|
||||
// Called when the scene will move from an active state to an inactive state.
|
||||
// This may occur due to temporary interruptions (ex. an incoming phone call).
|
||||
}
|
||||
|
||||
func sceneWillEnterForeground(_ scene: UIScene) {
|
||||
// Called as the scene transitions from the background to the foreground.
|
||||
// Use this method to undo the changes made on entering the background.
|
||||
}
|
||||
|
||||
func sceneDidEnterBackground(_ scene: UIScene) {
|
||||
// Called as the scene transitions from the foreground to the background.
|
||||
// Use this method to save data, release shared resources, and store enough scene-specific state information
|
||||
// to restore the scene back to its current state.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
22
sample/iosApp/iosAppTests/Info.plist
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
26
sample/iosApp/iosAppTests/iosAppTests.swift
Normal file
@ -0,0 +1,26 @@
|
||||
import XCTest
|
||||
@testable import appName
|
||||
|
||||
class appNameTests: XCTestCase {
|
||||
|
||||
override func setUp() {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
func testExample() {
|
||||
// This is an example of a functional test case.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
}
|
||||
|
||||
func testPerformanceExample() {
|
||||
// This is an example of a performance test case.
|
||||
self.measure {
|
||||
// Put the code you want to measure the time of here.
|
||||
}
|
||||
}
|
||||
|
||||
}
|
22
sample/iosApp/iosAppUITests/Info.plist
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
35
sample/iosApp/iosAppUITests/iosAppUITests.swift
Normal file
@ -0,0 +1,35 @@
|
||||
import XCTest
|
||||
|
||||
class appNameUITests: XCTestCase {
|
||||
|
||||
override func setUp() {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
|
||||
// In UI tests it is usually best to stop immediately when a failure occurs.
|
||||
continueAfterFailure = false
|
||||
|
||||
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
func testExample() {
|
||||
// UI tests must launch the application that they test.
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
|
||||
// Use recording to get started writing UI tests.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
}
|
||||
|
||||
func testLaunchPerformance() {
|
||||
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) {
|
||||
// This measures how long it takes to launch your application.
|
||||
measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) {
|
||||
XCUIApplication().launch()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
29
sample/src/androidMain/AndroidManifest.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (c) 2020 Ugljesa Jovanovic (ugljesa.jovanovic@ionspin.com)
|
||||
-->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.ionspin.kotlin.crypto.sample">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:name=".LibsodiumBindingsSampleApp"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"> <!-- Just for development -->
|
||||
<activity android:name=".MainActivity"
|
||||
android:windowSoftInputMode="adjustPan|adjustResize"
|
||||
>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Ugljesa Jovanovic (ugljesa.jovanovic@ionspin.com)
|
||||
*/
|
||||
|
||||
package com.ionspin.kotlin.crypto.sample
|
||||
|
||||
import android.app.Application
|
||||
import com.ionspin.kotlin.crypto.LibsodiumInitializer
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import timber.log.Timber
|
||||
|
||||
/**
|
||||
* @author [Ugljesa Jovanovic](ugi@mobilabsolutions.com)
|
||||
*/
|
||||
class LibsodiumBindingsSampleApp : Application() {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
Timber.plant(Timber.DebugTree())
|
||||
val initialization = GlobalScope.async {
|
||||
LibsodiumInitializer.initialize()
|
||||
}
|
||||
runBlocking {
|
||||
initialization.await()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Ugljesa Jovanovic (ugljesa.jovanovic@ionspin.com)
|
||||
*/
|
||||
|
||||
package com.ionspin.kotlin.crypto.sample
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.ionspin.kotlin.crypto.hash.Hash
|
||||
import com.ionspin.kotlin.crypto.util.encodeToUByteArray
|
||||
import com.ionspin.kotlin.crypto.util.toHexString
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
val hash = Hash.sha512("123".encodeToUByteArray())
|
||||
helloWorldTextView.setText("Hash (SHA512) of 123: ${hash.toHexString()}")
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
<!--
|
||||
~ Copyright (c) 2020 Ugljesa Jovanovic (ugljesa.jovanovic@ionspin.com)
|
||||
-->
|
||||
|
||||
<vector xmlns:aapt="http://schemas.android.com/aapt"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1" />
|
||||
</vector>
|
174
sample/src/androidMain/res/drawable/ic_launcher_background.xml
Normal file
@ -0,0 +1,174 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2020 Ugljesa Jovanovic (ugljesa.jovanovic@ionspin.com)
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
</vector>
|
19
sample/src/androidMain/res/layout/activity_main.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2020 Ugljesa Jovanovic (ugljesa.jovanovic@ionspin.com)
|
||||
-->
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/helloWorldTextView"
|
||||
tools:text="Hello world"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2020 Ugljesa Jovanovic (ugljesa.jovanovic@ionspin.com)
|
||||
-->
|
||||
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2020 Ugljesa Jovanovic (ugljesa.jovanovic@ionspin.com)
|
||||
-->
|
||||
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
BIN
sample/src/androidMain/res/mipmap-hdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
sample/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
sample/src/androidMain/res/mipmap-mdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
sample/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
sample/src/androidMain/res/mipmap-xhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
sample/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
sample/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
sample/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
sample/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
sample/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 16 KiB |
11
sample/src/androidMain/res/values/colors.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2020 Ugljesa Jovanovic (ugljesa.jovanovic@ionspin.com)
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<color name="colorPrimary">#0069A1</color>
|
||||
<color name="colorPrimaryDark">#004970</color>
|
||||
<color name="colorAccent">#FF5722</color>
|
||||
<color name="lighterBackground">#FF656565</color>
|
||||
</resources>
|
8
sample/src/androidMain/res/values/dimen.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2020 Ugljesa Jovanovic (ugljesa.jovanovic@ionspin.com)
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<dimen name="omnipresentDimension">16dp</dimen>
|
||||
</resources>
|
7
sample/src/androidMain/res/values/strings.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<!--
|
||||
~ Copyright (c) 2020 Ugljesa Jovanovic (ugljesa.jovanovic@ionspin.com)
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="app_name">Lbsodium Bindings Sample</string>
|
||||
</resources>
|
26
sample/src/androidMain/res/values/styles.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<!--
|
||||
~ Copyright (c) 2020 Ugljesa Jovanovic (ugljesa.jovanovic@ionspin.com)
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="buttonStyle">@style/MyCustomButton</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="MyCustomButton" parent="Widget.AppCompat.Button">
|
||||
|
||||
<item name="android:textColor">@android:color/primary_text_dark</item>
|
||||
<item name="android:backgroundTint">@color/colorPrimary</item>
|
||||
<!-- <item name="android:textStyle">bold</item>-->
|
||||
<!-- <item name="android:paddingLeft">16dp</item>-->
|
||||
<!-- <item name="android:paddingRight">16dp</item>-->
|
||||
</style>
|
||||
|
||||
</resources>
|
@ -1,6 +1,8 @@
|
||||
package com.ionspin.kotlin.crypto.sample
|
||||
|
||||
import com.ionspin.kotlin.crypto.hash.Hash
|
||||
import com.ionspin.kotlin.crypto.util.LibsodiumRandom
|
||||
import com.ionspin.kotlin.crypto.util.encodeToUByteArray
|
||||
import com.ionspin.kotlin.crypto.util.toHexString
|
||||
|
||||
|
||||
@ -9,4 +11,9 @@ object Sample {
|
||||
val random = LibsodiumRandom.buf(32)
|
||||
println("Random: ${random.toHexString()}")
|
||||
}
|
||||
|
||||
fun hashSomething() : String {
|
||||
val hash = Hash.sha512("123".encodeToUByteArray())
|
||||
return "Hash (SHA512) of 123: ${hash.toHexString()}"
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
package com.ionspin.kotlin.crypto.sample.di
|
||||
|
||||
import kotlinx.serialization.json.Json
|
||||
|
||||
/**
|
||||
* Created by Ugljesa Jovanovic
|
||||
* ugljesa.jovanovic@ionspin.com
|
||||
* on 17-Oct-2020
|
||||
*/
|
||||
object ServiceLocator : ServiceLocatorInterface {
|
||||
override val Storage: StorageModule = StorageModule.StorageServiceLocator()
|
||||
|
||||
|
||||
}
|
||||
|
||||
interface ServiceLocatorInterface {
|
||||
val Storage: StorageModule
|
||||
}
|
||||
|
||||
interface StorageModule {
|
||||
val json: Json
|
||||
|
||||
class StorageServiceLocator : StorageModule {
|
||||
override val json = Json {
|
||||
prettyPrint = true
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.ionspin.kotlin.crypto.sample.ui
|
||||
|
||||
/**
|
||||
* Created by Ugljesa Jovanovic
|
||||
* ugljesa.jovanovic@ionspin.com
|
||||
* on 17-Oct-2020
|
||||
*/
|
||||
class LandingController {
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
import com.ionspin.kotlin.crypto.hash.Hash
|
||||
import com.ionspin.kotlin.crypto.util.encodeToUByteArray
|
||||
import com.ionspin.kotlin.crypto.util.toHexString
|
||||
import kotlinx.css.br
|
||||
import react.RBuilder
|
||||
import react.RComponent
|
||||
import react.RProps
|
||||
import react.RState
|
||||
import react.ReactElement
|
||||
import react.dom.h1
|
||||
|
||||
external interface RAppState : RState {
|
||||
var currentState: String
|
||||
}
|
||||
|
||||
external interface RAppProps : RProps {
|
||||
|
||||
}
|
||||
|
||||
class App(props: RAppProps) : RComponent<RAppProps, RAppState>(props) {
|
||||
override fun RBuilder.render() {
|
||||
val hash = Hash.sha512("123".encodeToUByteArray())
|
||||
h1 {
|
||||
+"Hash (SHA512) of 123: ${hash.toHexString()}"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun RBuilder.app(handler: RAppProps.() -> Unit): ReactElement {
|
||||
return child(App::class) {
|
||||
this.attrs(handler)
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
import com.ionspin.kotlin.crypto.LibsodiumInitializer
|
||||
import com.ionspin.kotlin.crypto.hash.Hash
|
||||
import com.ionspin.kotlin.crypto.util.LibsodiumRandom
|
||||
import com.ionspin.kotlin.crypto.util.encodeToUByteArray
|
||||
import com.ionspin.kotlin.crypto.util.toHexString
|
||||
import react.dom.render
|
||||
import kotlinx.browser.document
|
||||
import kotlin.browser.window
|
||||
|
||||
fun main() {
|
||||
val runningOnNode = jsTypeOf(window) == "undefined"
|
||||
if (!runningOnNode) {
|
||||
LibsodiumInitializer.initializeWithCallback {
|
||||
render(document.getElementById("root")) {
|
||||
app {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LibsodiumInitializer.initializeWithCallback {
|
||||
val hash = Hash.sha512("123".encodeToUByteArray())
|
||||
println("Hash (SHA512) of 123: ${hash.toHexString()}")
|
||||
}
|
||||
}
|
||||
}
|
12
sample/src/jsMain/resources/index.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Libsodium bindings sample app!</title>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script src="sample.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,5 +1,6 @@
|
||||
import com.ionspin.kotlin.crypto.sample.Sample
|
||||
|
||||
fun main() {
|
||||
fun main() : Unit {
|
||||
Sample.runSample()
|
||||
ui()
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
import com.ionspin.kotlin.crypto.hash.Hash
|
||||
import com.ionspin.kotlin.crypto.util.encodeToUByteArray
|
||||
import com.ionspin.kotlin.crypto.util.toHexString
|
||||
import libui.ktx.TextArea
|
||||
import libui.ktx.appWindow
|
||||
import libui.ktx.button
|
||||
import libui.ktx.textarea
|
||||
import libui.ktx.vbox
|
||||
|
||||
fun ui() = appWindow(
|
||||
title = "Hello",
|
||||
width = 320,
|
||||
height = 240
|
||||
) {
|
||||
val hash = Hash.sha512("123".encodeToUByteArray())
|
||||
val text = "Hash (SHA512) of 123: ${hash.toHexString()}"
|
||||
vbox {
|
||||
lateinit var scroll: TextArea
|
||||
|
||||
button("Test") {
|
||||
action {
|
||||
scroll.append(text.trimMargin())
|
||||
}
|
||||
}
|
||||
scroll = textarea {
|
||||
readonly = true
|
||||
stretchy = true
|
||||
}
|
||||
}
|
||||
}
|
7
sample/webpack.config.d/devServer.config.js
Normal file
@ -0,0 +1,7 @@
|
||||
config.devServer = config.devServer || {}
|
||||
config.devServer.port = 8081
|
||||
config.devServer.open = false
|
||||
config.devServer.watchOptions = {
|
||||
"aggregateTimeout": 1000,
|
||||
"poll": 1000
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
## and then borrowed and slightly modified from https://github.com/datkt/sodium/configure
|
||||
## borrowed from https://github.com/sodium-friends/sodium-native/blob/master/configure
|
||||
PREFIX="${PREFIX:-$PWD/static-mingw-x86-64}"
|
||||
KONAN="${KONAN:-$HOME/.konan}"
|
||||
KONAN="C:/Windows/System32/config/systemprofile/.konan"
|
||||
ARCH=${ARCH:-$(uname -m)}
|
||||
echo $PREFIX
|
||||
echo $KONAN
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit b0ed382e71ff52e5ecef8691d62dfe7a04a803f7
|
||||
Subproject commit 1a9ef3db870ba0d98d04a469bdb9b0cd2379a9e3
|
@ -1,5 +0,0 @@
|
||||
cd libsodium
|
||||
./dist-build/ios.sh
|
||||
mkdir ../static-ios
|
||||
cp -R ./libsodium-ios/lib ../static-ios/lib
|
||||
cp -R ./libsodium-ios/include ../static-ios/include
|
24
sodiumWrapper/makeIosWatchosTvos.sh
Executable file
@ -0,0 +1,24 @@
|
||||
cd libsodium
|
||||
./dist-build/apple-xcframework.sh
|
||||
|
||||
mkdir ../static-ios
|
||||
mkdir ../static-ios-simulators
|
||||
mkdir ../static-watchos
|
||||
mkdir ../static-watchos-simulators
|
||||
mkdir ../static-tvos
|
||||
mkdir ../static-tvos-simulators
|
||||
|
||||
cp -R ./libsodium-apple/ios/lib ../static-ios/lib
|
||||
cp -R ./libsodium-apple/ios/include ../static-ios
|
||||
cp -R ./libsodium-apple/ios-simulators/lib ../static-ios-simulators/lib
|
||||
cp -R ./libsodium-apple/ios-simulators/include ../static-ios-simulators
|
||||
|
||||
cp -R ./libsodium-apple/watchos/lib ../static-watchos/lib
|
||||
cp -R ./libsodium-apple/watchos/include ../static-watchos
|
||||
cp -R ./libsodium-apple/watchos-simulators/lib ../static-watchos-simulators/lib
|
||||
cp -R ./libsodium-apple/watchos-simulators/include ../static-watchos-simulators
|
||||
|
||||
cp -R ./libsodium-apple/tvos/lib ../static-tvos/lib
|
||||
cp -R ./libsodium-apple/tvos/include ../static-tvos
|
||||
cp -R ./libsodium-apple/tvos-simulators/lib ../static-tvos-simulators/lib
|
||||
cp -R ./libsodium-apple/tvos-simulators/include ../static-tvos-simulators
|
@ -1,15 +1,15 @@
|
||||
set -e
|
||||
#!/bin/sh
|
||||
#this will hopefully download all konan dependancies that we use in the build scripts
|
||||
|
||||
./gradlew clean
|
||||
./gradlew multiplatform-crypto-api:build
|
||||
cd sodiumWrapper
|
||||
echo "Starting mingw libsodium build"
|
||||
./configureMingw64.sh
|
||||
echo "Configure done"
|
||||
$GNU_MAKE -j4 -C libsodium clean
|
||||
$GNU_MAKE -j4 -C libsodium
|
||||
$GNU_MAKE -j4 -C libsodium install
|
||||
make -j4 -C libsodium clean
|
||||
make -j4 -C libsodium
|
||||
make -j4 -C libsodium install
|
||||
echo "completed libsodium build"
|
||||
#now we can do the delegated build
|
||||
cd ..
|
||||
|
@ -1,5 +1,6 @@
|
||||
set -e
|
||||
#!/bin/sh
|
||||
./gradlew clean
|
||||
./gradlew multiplatform-crypto-api:build
|
||||
./gradlew multiplatform-crypto:build
|
||||
set +e
|
||||
|
@ -1,15 +1,15 @@
|
||||
set -e
|
||||
#!/bin/sh
|
||||
#this will hopefully download all konan dependancies that we use in the build scripts
|
||||
|
||||
./gradlew clean
|
||||
./gradlew multiplatform-crypto-api:build
|
||||
cd sodiumWrapper
|
||||
echo "Starting mingw libsodium build"
|
||||
./configureMingw64.sh
|
||||
echo "Configure done"
|
||||
$GNU_MAKE -j4 -C libsodium clean
|
||||
$GNU_MAKE -j4 -C libsodium
|
||||
$GNU_MAKE -j4 -C libsodium install
|
||||
make -j4 -C libsodium clean
|
||||
make -j4 -C libsodium
|
||||
make -j4 -C libsodium install
|
||||
echo "completed libsodium build"
|
||||
#now we can do the delegated build
|
||||
cd ..
|
||||
|
@ -1,8 +1,8 @@
|
||||
set -e
|
||||
#!/bin/sh
|
||||
#this will hopefully download all konan dependancies that we use in the build scripts
|
||||
|
||||
./gradlew clean
|
||||
./gradlew multiplatform-crypto-api:build
|
||||
./gradlew multiplatform-crypto:build
|
||||
./gradlew multiplatform-crypto:publishMingwX64PublicationToSnapshotRepository
|
||||
set +e
|
||||
set +e
|
||||
|