🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

br.dev.dig.storage:serializer-gson

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

br.dev.dig.storage:serializer-gson

Simple library for NoSQL wrapper with cryptography support

Source
mavenMaven
Version
1.2.0
Version published
Maintainers
1
Source

Simple Storage for Java and Android

AppVeyor AppVeyor tests Maven Central License

Windows - Supported Linux - Supported MacOS - Partial

  • Like simple NoSQL database
  • Supports customizable serialization (gson,moshi... your choice)
  • Supports customizable encryption
  • No external dependenciesÂą
  • Requires simple NoSQL implementation²

¹ Core features does not require dependencies ² Simple Storage works like a layer above others type of storage

Reason

As an Android developer, Hawk is outdated and contains external outdated libraries.

How to use - Simple

  • Include maven central as repository

  • Simple storage for Android:

dependencies {
    â‹®
    implementation "br.dev.dig.storage:simple-android:${lastest_version}"
    â‹®
}

  • Creating storage:
private fun createStorage(): Storage {
    val builder = StorageSimpleAndroidBuilder()
    // Hardcoded random string
    builder.masterKey("123456") 
    // Using SharedPreferences file `local`
    builder.preferences(getSharedPreferences("local", Context.MODE_PRIVATE))
    return builder.build()
}
  • Use Storage instance:
val storage = createStorage()

val name = storage.get("name", String::class.java)
// OR
val name = storage.get<String>("name")

val age = storage.get("name", Int::class.java)
// OR
val age = storage.get<Int>("name")

For java users, there is StoragePrimitiveWrapper to provide methods to mimic kotlin style.

Migration

Every update in whatever operation of the Storage, old content will be unrecognizable by new configuration, then you need a migration.

Since key can be hashed (normal mode), there is no automatic way to migrate, unless you known every key used.

There is StorageMigration from br.dev.dig.storage:migration to migrate Storages to a new one, on demand. Just provide the new storage, alongside with olders. Also can be used to migrate your current storage library to this new storage library.

License

CC BY-ND 4.0

  • You can use and re-dist freely.
  • You can also modify, but only for yourself.
  • You can use it as a part of your project, but without modifications in this project.
  • You can expand this project creating implementations of each operation interface.

FAQs

Package last updated on 26 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts