{"id":21065060,"url":"https://github.com/prolificinteractive/patrons","last_synced_at":"2026-04-26T17:31:32.482Z","repository":{"id":144531923,"uuid":"89511376","full_name":"prolificinteractive/patrons","owner":"prolificinteractive","description":"SharedPreferences wrappers with an encryption package.","archived":false,"fork":false,"pushed_at":"2019-02-08T15:10:59.000Z","size":291,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-12-29T19:36:14.699Z","etag":null,"topics":["android","conceal","sharedpreferences"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prolificinteractive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-26T17:59:42.000Z","updated_at":"2019-02-08T15:09:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed7b1199-5966-494a-ab2d-81b821419cae","html_url":"https://github.com/prolificinteractive/patrons","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/prolificinteractive/patrons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prolificinteractive%2Fpatrons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prolificinteractive%2Fpatrons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prolificinteractive%2Fpatrons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prolificinteractive%2Fpatrons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prolificinteractive","download_url":"https://codeload.github.com/prolificinteractive/patrons/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prolificinteractive%2Fpatrons/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32307010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T17:23:19.671Z","status":"ssl_error","status_checked_at":"2026-04-26T17:23:19.195Z","response_time":129,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","conceal","sharedpreferences"],"created_at":"2024-11-19T17:53:20.518Z","updated_at":"2026-04-26T17:31:32.453Z","avatar_url":"https://github.com/prolificinteractive.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Patrons\n[![Travis branch](https://img.shields.io/travis/prolificinteractive/patrons/master.svg)](https://travis-ci.org/prolificinteractive/patrons) [![](https://jitpack.io/v/prolificinteractive/patrons.svg)](https://jitpack.io/#prolificinteractive/patrons)\n\n\n\n_Let your patron do the work._\n\nA Patron is a preference wrapper. Come also with an encryption system.\n\n## Features\n\nUse the adequate patron for the preference value type you would like to store.\n\nPatrons handle all types handled by shared preferences:\n- boolean\n- float\n- float\n- int\n- String\n- StringSet\n\nPatrons also provide an encrypted version of the shared preferences. Use `patrons-conceal` to encrypt your preference values.\n\n## Installation\n\nStep 1. Add the JitPack repository to your build file\n\n```groovy\nallprojects {\n  repositories {\n    ...\n    maven { url 'https://jitpack.io' }\n  }\n}\n```\n\nStep 2. Add the dependency\n\n```groovy\ndependencies {\n  implementation 'com.github.prolificinteractive.patrons:patron:${patronsVersion}'\n\n  // If you want patrons with encryption of your shared preferences\n  implementation 'com.github.prolificinteractive.patrons:patron-conceal:${patronsVersion}'\n}\n```\n\n## Usage\n\nA default patron exists for all shared preferences types.\n\n#### Boolean\n```kotlin\nval boolPref: Preference\u003cBoolean\u003e = BooleanPreference(prefs, \"key\")\n```\n\n#### Float\n```kotlin\nval floatPref: Preference\u003cFloat\u003e = FloatPreference(prefs, \"key\")\n```\n\n#### Integer\n```kotlin\nval intPref: Preference\u003cInteger\u003e = IntPreference(prefs, \"key\")\n```\n\n#### Long\n```kotlin\nval longPref: Preference\u003cLong\u003e = LongPreference(prefs, \"key\")\n```\n\n#### String\n```kotlin\nval stringPref: Preference\u003cString\u003e = StringPreference(prefs, \"key\")\n```\n\n#### String Set\n```kotlin\nval stringSetPref: Preference\u003cSet\u003cString\u003e\u003e = StringSetPreference(prefs, \"key\")\n```\n\n### Conceal\n\nInit Conceal in your application class:\n\n```java\nimport com.facebook.soloader.SoLoader;\n\npublic class MyApplication extends Application {\n  @Override\n  public void onCreate() {\n    super.onCreate();\n    SoLoader.init(this, false);\n  }\n}\n```\n\n## Encryption\n\n### SharedPreferences Backed Keychain\n\n```kotlin\nval prefs = ConcealSharedPreferences(context)\n```\n\n### Keystore Backed Keychain\n\nBy default, preference's key is __NOT__ encrypted but the behaviour can be customized by passing your own custom [KeyEncryption](patron-conceal/src/main/java/com/prolificinteractive/patrons/conceal/KeyEncryption.kt)\n\n```kotlin\nval defaultPref = PreferenceManager.getDefaultSharedPreferences(context)\nval concealedPrefs = ConcealSharedPreferences(\n  this,\n  defaultPref,\n  NoKeyEncryption(),\n  ConcealEncryption(\n    context,\n    \"conceal_encryption\",\n    AndroidConceal\n      .get()\n      .createDefaultCrypto(KeystoreBackedKeychain(context, defaultPref))\n    )\n)\n```\n\n### Proguard\n\nTODO\n\n## Contributing to Patrons\n\nTo report a bug or enhancement request, feel free to file an issue under the respective heading.\n\nIf you wish to contribute to the project, fork this repo and submit a pull request. Code contributions should follow the standards specified in the [Prolific Android Style Guide](https://github.com/prolificinteractive/android-code-styles).\n\n## License\n\n![prolific](https://s3.amazonaws.com/prolificsitestaging/logos/Prolific_Logo_Full_Color.png)\n\nCopyright (c) 2018 Prolific Interactive\n\nPatrons is maintained and sponsored by Prolific Interactive. It may be redistributed under the terms specified in the [LICENSE] file.\n\n[LICENSE]: ./LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprolificinteractive%2Fpatrons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprolificinteractive%2Fpatrons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprolificinteractive%2Fpatrons/lists"}