Skip to content

Cache doesn't exists when use encryption #1

@githubgist123

Description

@githubgist123

When I use encryption and save cache. After closing app completely and after launching cache doesn't exists.


val cache: Cache<String> = Cache.Builder()
            .encryptStrategy(KeyStoreEncryptStrategy(this))   //or Des3EncryptStrategy
            .build(applicationContext)

        mBinding.btnWrite.setOnClickListener {
            cache["test"] = "Hello World"
        }

        mBinding.btnRead.setOnClickListener {
            val fromCache = cache["test"]

            if (fromCache != null) {
                Log.d(TAG, "Cache exists")
            } else {
                Log.d(TAG, "Cache doesn't exist")
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions