Coder Social home page Coder Social logo

netguru / kissme Goto Github PK

View Code? Open in Web Editor NEW
407.0 20.0 29.0 1008 KB

Kissme: Kotlin Secure Storage Multiplatform

License: Apache License 2.0

Kotlin 68.80% Swift 8.26% Objective-C 21.77% Shell 1.17%
kotlin kotlin-multiplatform kotlin-library android ios cross-platform library storage secure encryption

kissme's Introduction

Kissme: Kotlin Secure Storage Multiplatform

Android Arsenal Build Status

Kissme is an open-source library providing encrypted key-value storage.

It can be integrated seamlessly in Kotlin projects built with Kotlin Multiplatform, Kotlin/Native, and Kotlin Android plugins.

Kissme allows storing key-value data in common code modules without any additional boilerplate code.

Currently library supports the following platforms:

  • Android (API >= 23)
  • iOS (ios_arm64 and ios_x64 targets)

Download

To use this library in your project, add Netguru and Binryprefs maven urls to the repositories block:

repositories {
    maven {  url 'https://dl.bintray.com/netguru/maven/' }
    maven { url "https://jitpack.io" }
}

Then add following dependencies to the common module build.gradle:

    sourceSets {
        commonMain {
            dependencies {
                implementation 'com.netguru.kissme:common:0.2.5'     
            }
        }
        androidMain {
            dependencies {
                implementation 'com.netguru.kissme:android:0.2.5'
            }
        }
        iosMain {
            dependencies {
                implementation 'com.netguru.kissme:ios:0.2.5'
            }
        }
    }

Remember to enable GRADLE_METADATA in settings.gradle:

enableFeaturePreview('GRADLE_METADATA')

Usage

Just start with creating an instance of Kissme class somewhere in your common module and enjoy! It's as simple as that. You don't have to initialize it by yourself nor to pass Android Context. Everything is done automatically.

val storage = Kissme(name = "my_secret_storage")

The name parameter is optional. You can omit it if you want to use default storage. Kissme allows you to store and persist multiple data types:

  • String
  • Int
  • Long
  • Float
  • Double
  • Boolean

If you want to store something, just call:

storage.putString(key = "someKey", value = "value")

If you want to get stored value - use:

storage.getString(key = "someKey", defaultValue = "default")

All get() functions will return defaultValue parameter if storage doesn't contain selected key.

You can get all keys stored in Kissme storage by calling:

storage.getAll()

You can check if Kissme storage contains selected key by calling:

storage.contains(key = "someKey")

You can also remove selected key from storage:

storage.remove(key = "someKey")

Last, but not least, you can remove all data stored in Kissme storage:

storage.clear()

About

Kissme allows to store key-value pairs in platform-specific way securely.

Android

Android implementation uses binaryprefs library under the hood in order to provide a robust key-value storage mechanism. The keys and values are encrypted using XOR and AES encryption accordingly. The data encryption and encryption keys storing generating mechanisms are fully automated and is applied to the stored data by default. All the encryption keys are stored in the Android KeyStore.

In order to acquire the application Context instance required for data storing operations the library registers an internal ContentProvider.

iOS

The iOS implementation is using native iOS Keychain. The Secure Enclave is a hardware-based key manager that's isolated from processor. It allows you to store, delete, fetch passwords and accounts. Keychain is simple wrapper build upon Security interface to store, save, and fetch not only passwords, but also accounts.

Running sample app

Sample app uses Maven Local for resolving Kissme dependencies. Before running sample app you need to:

  1. Build the library - ./gradlew build
  2. Publish dependencies to Maven Local - ./gradlew publishToMavenLocal
  3. Run selected library. If you want to run iOS app - you need to properly configure Xcode. Please check: https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html#setting-up-xcode before running iOS sample app.

Development roadmap

  1. Configure integration tests on iOS
  2. Add CI
  3. Add support for Android API < 23
  4. Automate KeychainWrapper framework generation
  5. Migrate to kotlin-multiplatform Gradle plugin
  6. Clean up .pom dependencies declarations
  7. Add experimental JavaScript support - call for ideas

Kissme is an open source project developed and maintained by Kotlin community. Feel free to contribute to the project.

License

Copyright 2018 Netguru

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

kissme's People

Contributors

adasiewiczr avatar freszu avatar kkalisz avatar liewjuntung avatar samiuelson avatar sebastian-grabinski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kissme's Issues

Unresolved reference: Kissme

I'm using intellij ide to build multiplatform shared db, following setup guide, i got Unresolved reference: Kissme, this unresolved error pointing to my commonMain, using expect/actual to get Kissme class didn't found on androidMain while on commonMain is found but appear with this error.
here's my setup on shared module,

apply plugin: 'kotlin-multiplatform'

group versions.group
version versions.shareddb

kotlin {
    targets {
        fromPreset(presets.jvm, 'android')
    }
    sourceSets {
        commonMain.dependencies {
            implementation kotlinLibraries.standardCommon
            implementation protobufLibraries.pbAndKCommon
            implementation dao.sqldelightCommon
            implementation dao.kissmeCommon
            implementation project(':model')
        }

        androidMain.dependencies {
            implementation kotlinLibraries.standardAndroid
            implementation protobufLibraries.pbAndK
            implementation dao.sqldelightAndroid
            implementation dao.kissmeAndroid
            implementation project(':model')
        }
    }
}

configurations {
    compileClasspath
}

0.2.5: Unresolved References when building on iOS

I am building a multiplatform (Android/iOS) project using the Kissme library, and everything works great on Android. But when I try to build the iosBinaries task, I get the following errors:

Unresolved Reference: netguru
Unresolved Reference: Kissme

I saw that there was a pre-existing issue about this several months ago (#55), but it was closed without a resolution. Has there been any progress on fixing it?

Unable to make iOS Archive with Bitcode

I'm using the latest version of Kissme and tried to create an archive of the app with the multiplatform library.

Step to replicate:

  1. XCode > Product > Archive
  2. Error: bitcode bundle could not be generated

Is project still alive?

Hello,

Is this project still alive?

Tried cloning and building however it's completely messed up to bring back to life.

Any luck it could be updated?

0.2.3 Version not found

I set up the repositories in my module build.gradle like so:

buildscript {
    repositories {
        maven { url 'https://dl.bintray.com/netguru/maven/' }
        maven { url "https://jitpack.io" }
    }
  ...
}
...

dependencies {
    implementation "com.netguru.kissme:kissme-common:0.2.3"
    implementation "com.netguru.kissme:kissme-android:0.2.3"
...
}

But I get an error when I'm syncing my gradle project:

ERROR: Failed to resolve: com.netguru.kissme:kissme-common:0.2.3
ERROR: Failed to resolve: com.netguru.kissme:kissme-android:0.2.3

Just a little question.

Hello, your project looks awesome, thanks for your job! I would like to know is there any ability to rename the name of the storage after i'll set it up? Thanks.

Unable to resolve kissme-ios

I am having issues resolving the ios implementation of this lib.
No issues with common and android.

Important Code:
Project build Gradle

buildscript {
    ext.kotlin_version = '1.3.41'
    ext.kissme_version = "0.2.3"
    
    
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url "https://kotlin.bintray.com/kotlinx" }
        maven { url "https://dl.bintray.com/netguru/maven/" }
        maven { url "https://jitpack.io" }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
        classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url "https://kotlin.bintray.com/kotlinx" }
        maven { url "https://dl.bintray.com/netguru/maven/" }
        maven { url "https://jitpack.io" }
    }
}

Common Build Gradle

sourceSets {
        commonMain.dependencies {
            implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutines_version"
            implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serialization_version"

//            Multiplatform Key value pair storage solution
            implementation "com.netguru.kissme:kissme-common:$kissme_version"
        }

        androidMain.dependencies {
            implementation "com.netguru.kissme:kissme-android:$kissme_version"
        }

        iOSMain.dependencies {
            implementation "com.netguru.kissme:kissme-ios:$kissme_version"
            
        }
    }

Screen Shot 2019-08-19 at 11 40 45 AM

I have double checked the bintray links : https://dl.bintray.com/netguru/maven/com/netguru/kissme/kissme-ios

and it all seems to be in order, but no matter what I do I can't seem to get the ios to resolve, and of course that means no build

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.