{"id":3608,"url":"https://github.com/prashantsolanki3/Secure-Pref-Manager","last_synced_at":"2025-08-03T20:32:46.631Z","repository":{"id":87635125,"uuid":"45629919","full_name":"prashantsolanki3/Secure-Pref-Manager","owner":"prashantsolanki3","description":"Secure Preference Manager for android. It uses various Encryption to protect your application's Shared Preferences.","archived":false,"fork":false,"pushed_at":"2016-12-08T16:10:53.000Z","size":143,"stargazers_count":70,"open_issues_count":3,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-25T22:34:57.063Z","etag":null,"topics":["android","encryption","hide-preferences","security","sharedpreferences"],"latest_commit_sha":null,"homepage":"https://prashantsolanki3.github.io/Secure-Pref-Manager/","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/prashantsolanki3.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}},"created_at":"2015-11-05T18:11:06.000Z","updated_at":"2023-10-18T23:19:44.000Z","dependencies_parsed_at":"2024-01-02T21:21:17.209Z","dependency_job_id":"e25f5b0f-db68-40cd-bc81-0ca7fc5c34f9","html_url":"https://github.com/prashantsolanki3/Secure-Pref-Manager","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashantsolanki3%2FSecure-Pref-Manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashantsolanki3%2FSecure-Pref-Manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashantsolanki3%2FSecure-Pref-Manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashantsolanki3%2FSecure-Pref-Manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prashantsolanki3","download_url":"https://codeload.github.com/prashantsolanki3/Secure-Pref-Manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228567009,"owners_count":17937983,"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","hide-preferences","security","sharedpreferences"],"created_at":"2024-01-05T20:16:46.303Z","updated_at":"2024-12-07T05:30:42.432Z","avatar_url":"https://github.com/prashantsolanki3.png","language":"Java","funding_links":[],"categories":["Security","Libraries"],"sub_categories":["Utility"],"readme":"# Secure-Pref-Manager\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Secure%20Preference%20Manager-brightgreen.svg?style=flat-square)](http://android-arsenal.com/details/1/2747)\n[![Travis CI](https://travis-ci.org/prashantsolanki3/Secure-Pref-Manager.svg)](https://travis-ci.org/prashantsolanki3/Secure-Pref-Manager)\n##Secure Preference Manager is a simple Library to help you protect your Shared Preferences.\nSecure Preference Manager for android. It uses various encryption techniques to protect your application's Shared Preferences.\n\n##Setup\nAdd jitpack to your project’s repositories.\n\n```\nrepositories {\n        // ...\n        maven { url \"https://jitpack.io\" }\n    }\n```\n\nThen add Secure-Pref-Manager to your Module’s dependencies\n\n```\ndependencies {\n\t        compile 'com.github.prashantsolanki3:Secure-Pref-Manager:0.25'\n\t}\n```\n\n##Usage\n\n###Initialize SecurePrefManager anywhere before using it.\n\n* Basic Initialization\n\n```\n       new SecurePrefManagerInit.Initializer(getApplicationContext())\n               .initialize();\n```\n\n*  Recommended Initialization\n  * AES Encryption by Default.\n  * Auto Generated Key.\n\n```\n       new SecurePrefManagerInit.Initializer(getApplicationContext())\n               .useEncryption(true)\n               .initialize();\n```\n\n* Advance Initialization: Only if you wanna add Custom Encryption Methods.\n\n```\n       new SecurePrefManagerInit.Initializer(getApplicationContext())\n               .useEncryption(true)\n               .setCustomEncryption(new Encryptor(getApplicationContext()) {\n                   @Override\n                   public String encrypt(String s) throws Exception {\n                       // Your Encryption Algorithm\n                       return encryptedString;\n                   }\n\n                   @Override\n                   public String decrypt(String s) throws Exception {\n                       // Your Decryption Algorithm\n                       return decryptedString;\n                   }\n               })\n               .initialize();\n```\n\n### Adding and Retrieving Preferences\n\n* Adding\n```\n        SecurePrefManager.with(this)\n                .set(\"user_name\")\n                .value(\"LoremIpsum\")\n                .go();\n```\n\n* Retrieving\n\n```\n        String userName = SecurePrefManager.with(this)\n                .get(\"user_name\")\n                .defaultValue(\"unknown\")\n                .go();\n```\n\n### Hide Preferences from 3rd Party applications (EXPERIMENTAL)\n\n* Unhide Preferences when the activity starts\n```\n@Override\n    protected void onStart() {\n        super.onStart();\n        SecurePrefManager.with(getApplicationContext())\n                .unhide(new HidePreferences.PreferenceUpdateListener() {\n                    @Override\n                    public void onFailure() {\n                        Log.d(\"unhiding\", \"Failed\");\n                    }\n\n                    @Override\n                    public void onProgress(int p, int max) {\n                        Log.d(\"unhiding\", \"Progress: \" + p + \"/\" + max);\n                    }\n\n                    @Override\n                    public void onSuccess() {\n                        Log.d(\"unhiding\", \"Success\");\n                    }\n                });\n    }\n```\n* Hide preferences when leaving the activity\n\n```\n@Override\n    protected void onPause() {\n        SecurePrefManager.with(getApplicationContext())\n                .hide(new HidePreferences.PreferenceUpdateListener() {\n                    @Override\n                    public void onFailure() {\n\n                    }\n\n                    @Override\n                    public void onProgress(int p, int max) {\n\n                    }\n\n                    @Override\n                    public void onSuccess() {\n\n                    }\n                });\n    }\n```\n\n\n### Have Fun!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprashantsolanki3%2FSecure-Pref-Manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprashantsolanki3%2FSecure-Pref-Manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprashantsolanki3%2FSecure-Pref-Manager/lists"}