{"id":13537691,"url":"https://github.com/orhanobut/hawk","last_synced_at":"2025-05-14T06:11:23.327Z","repository":{"id":27558303,"uuid":"31040213","full_name":"orhanobut/hawk","owner":"orhanobut","description":"✔️ Secure, simple key-value storage for Android","archived":false,"fork":false,"pushed_at":"2022-07-10T10:09:05.000Z","size":967,"stargazers_count":3984,"open_issues_count":50,"forks_count":392,"subscribers_count":97,"default_branch":"master","last_synced_at":"2025-05-12T01:07:32.310Z","etag":null,"topics":["android","encryption","hawk","key-value-store","preferences","security","sharedpreferences","storage"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orhanobut.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-19T22:25:23.000Z","updated_at":"2025-05-05T12:06:05.000Z","dependencies_parsed_at":"2022-07-08T05:59:08.387Z","dependency_job_id":null,"html_url":"https://github.com/orhanobut/hawk","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhanobut%2Fhawk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhanobut%2Fhawk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhanobut%2Fhawk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhanobut%2Fhawk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orhanobut","download_url":"https://codeload.github.com/orhanobut/hawk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254079901,"owners_count":22011284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","encryption","hawk","key-value-store","preferences","security","sharedpreferences","storage"],"created_at":"2024-08-01T09:01:02.195Z","updated_at":"2025-05-14T06:11:23.246Z","avatar_url":"https://github.com/orhanobut.png","language":"Java","readme":"[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Hawk-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1568)      [![API](https://img.shields.io/badge/API-10%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=10)   [![Join the chat at https://gitter.im/orhanobut/hawk](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/orhanobut/hawk?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)  [![](https://img.shields.io/badge/AndroidWeekly-%23141-blue.svg)](http://androidweekly.net/issues/issue-141) \u003ca href=\"http://www.methodscount.com/?lib=com.orhanobut%3Ahawk%3A2.0.0%2B\"\u003e\u003cimg src=\"https://img.shields.io/badge/Methods and size-core: 188 | deps: 1242 | 21 KB-e91e63.svg\"/\u003e\u003c/a\u003e [![Build Status](https://travis-ci.org/orhanobut/hawk.svg?branch=master)](https://travis-ci.org/orhanobut/hawk)\n\n\u003cimg align='right' src='https://github.com/orhanobut/hawk/blob/master/art/hawk-logo.png' width='128' height='128'/\u003e\n\n### Hawk 2.0\nSecure, simple key-value storage for android\n\n#### Important Note\nThis version has no backward compatibility with Hawk 1+ versions. If you still want to use old versions, [check here](https://github.com/orhanobut/hawk/tree/hawk1)\n\n### Download\n```groovy\ncompile \"com.orhanobut:hawk:2.0.1\"\n```\n\n### Initialize\n```java\nHawk.init(context).build();\n```\n### Usage\nSave any type (Any object, primitives, lists, sets, maps ...)\n```java\nHawk.put(key, T);\n```\nGet the original value with the original type\n```java\nT value = Hawk.get(key);\n```\nDelete any entry\n```java\nHawk.delete(key);\n```\nCheck if any key exists\n```java\nHawk.contains(key);\n```\nCheck total entry count\n```java\nHawk.count();\n```\nGet crazy and delete everything\n```java\nHawk.deleteAll();\n```\n\n### How does Hawk work?\n\n\u003cimg src='https://github.com/orhanobut/hawk/blob/master/art/how-hawk-works.png'/\u003e\n\n### More options\n- Everything is pluggable, therefore you can change any layer with your custom implementation.\n- NoEncryption implementation is provided out of box If you want to disable crypto.\n```java\nHawk.init(context)\n  .setEncryption(new NoEncryption())\n  .setLogInterceptor(new MyLogInterceptor())\n  .setConverter(new MyConverter())\n  .setParser(new MyParser())\n  .setStorage(new MyStorage())\n  .build();\n```\n\n### License\n\u003cpre\u003e\nCopyright 2016 Orhan Obut\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\u003c/pre\u003e\n\n\n","funding_links":[],"categories":["Java","Libs","数据库","SharedPreference"],"sub_categories":["\u003cA NAME=\"Utility\"\u003e\u003c/A\u003eUtility"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhanobut%2Fhawk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forhanobut%2Fhawk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhanobut%2Fhawk/lists"}