{"id":17713579,"url":"https://github.com/tberchanov/strictpro","last_synced_at":"2026-01-23T12:56:26.464Z","repository":{"id":258282889,"uuid":"871098274","full_name":"tberchanov/StrictPro","owner":"tberchanov","description":"StrctiMode API wrapper with additional opportunities.","archived":false,"fork":false,"pushed_at":"2024-10-17T16:08:51.000Z","size":430,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-19T12:41:17.662Z","etag":null,"topics":["android","kotlin","quality","strict-mode","strictmode"],"latest_commit_sha":null,"homepage":"","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/tberchanov.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-11T09:10:52.000Z","updated_at":"2024-10-17T16:08:56.000Z","dependencies_parsed_at":"2024-10-19T00:57:49.734Z","dependency_job_id":null,"html_url":"https://github.com/tberchanov/StrictPro","commit_stats":null,"previous_names":["tberchanov/strictpro"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tberchanov%2FStrictPro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tberchanov%2FStrictPro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tberchanov%2FStrictPro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tberchanov%2FStrictPro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tberchanov","download_url":"https://codeload.github.com/tberchanov/StrictPro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252547715,"owners_count":21766038,"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","kotlin","quality","strict-mode","strictmode"],"created_at":"2024-10-25T10:05:24.687Z","updated_at":"2026-01-23T12:56:26.421Z","avatar_url":"https://github.com/tberchanov.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eStrictPro 🚀\u003c/h1\u003e\n\u003cbr\u003e\n\n**StrictPro** is a powerful library designed to extend and improve Android's [StrictMode](https://developer.android.com/reference/android/os/StrictMode.html) by offering more flexibility and informative UI for violations. It addresses some of the common limitations developers face with StrictMode.\n\n\u003cimg src=\"./img/strict-pro-cover.png\" /\u003e\n\n## Why Use StrictPro? 🤔\n\nStrictMode is an important tool for catching common mistakes in Android development. However, developers often encounter the following issues:\n\n- 🚫 **False positives**: Violations that are detected but not actionable.\n- 🔄 **Compatibility issues**: Some StrictMode configurations require specific Android API versions, leading to unnecessary boilerplate code.\n- 📉 **No UI representation**: Limited visibility of violations makes debugging harder.\n\nStrictPro solves these problems by providing a flexible wrapper around StrictMode, adding more advanced features, and enhancing its capabilities.\n\n## Installation 🛠️\n\nAdd StrictPro to your project by including the following in your `build.gradle.kts` file:\n\n```kotlin\nandroid {\n    compileSdk = 35\n    defaultConfig {\n        targetSdk = 35\n        minSdk = 21 // Required minimum API is 21\n    }\n}\n\ndependencies {    \n    val libVersion = \"1.0.0\"\n    debugImplementation(\"com.github.tberchanov.StrictPro:strictpro:$libVersion\")\n    releaseImplementation(\"com.github.tberchanov.StrictPro:strictpro.stubs:$libVersion\")\n}\n```\n\nEnsure the JitPack repository is declared in your `settings.gradle.kts`:\n```kotlin\ndependencyResolutionManagement {\n    repositories {\n        maven { url = uri(\"https://jitpack.io\") }\n    }\n}\n```\n\n`strictpro.stubs` library contains empty implementation of the public library interface. Additionally, it is not containing 3rd party dependencies, so consumer app will not get transitive dependencies, which may impact the app size.\n\nIt is recommended to use `strictpro.stubs` for production builds.\n\nUsage Example 💻\n------\nIn your `MainApplication.kt`, you can configure StrictPro with customizable penalties:\n```kotlin\nclass MainApplication: Application() {\n\n    override fun onCreate() {\n        StrictPro.setVmPolicy(\n            StrictPro.VmPolicy.Builder()\n                .detectAll()\n                .penaltyLog()\n                .penaltyDialog()\n                .penaltyFlashScreen()\n                .setWhiteList {\n                    // Defines penalty for the violation by substring in stack. Do nothing on violation if penalty is null.\n                    contains(\"some substring in stack\", null)\n                    // Defines penalty for the violation by base64 encoded stack.\n                    base64(\"base64 encoded stack trace\", ViolationPenalty.Ignore)\n                    base64(\"another base64 encoded stack trace\", ViolationPenalty.Dialog)\n                    // Custom logic to define penalty for the violation. Do nothing on violation if penalty is null.\n                    condition { violation -\u003e\n                        // some custom logic\n                        ViolationPenalty.FlashScreen\n                    }\n                }\n                .build(),\n        )\n        StrictPro.setThreadPolicy(\n            StrictPro.ThreadPolicy.Builder()\n                .detectAll()\n                .detectExplicitGc() // Call requires API level 34 or higher, otherwise it will be ignored.\n                .penaltyLog()\n                .penaltyDialog()\n                .penaltyFlashScreen()\n                .setWhiteList {\n                    // Defines penalty for the violation by substring in stack. Do nothing on violation if penalty is null.\n                    contains(\"some substring in stack\", null)\n                    // Defines penalty for the violation by base64 encoded stack.\n                    base64(\"base64 encoded stack trace\", ViolationPenalty.Ignore)\n                    base64(\"another base64 encoded stack trace\", ViolationPenalty.Dialog)\n                    // Custom logic to define penalty for the violation. Do nothing on violation if penalty is null.\n                    condition { violation -\u003e\n                        // some custom logic\n                        ViolationPenalty.FlashScreen\n                    }\n                }\n                .build(),\n        )\n    }\n}\n```\n\nStrictProUI ✨\n------\n\nStrictProUI is the additional library that displays all StrictMode violations happened in your application.\n\n\u003cimg src=\"./img/StrictProUI.png\" /\u003e\n\nThere are the ways to open StrictProUI:\n- Use shortcut that appears on long press on you application launcher icon. \n- Click StrictPro launcher icon with the same icon as your application. \n- Programatically open `StrictProUiActivity` from your application dev settings.\n\nTo setup StrictProUI:\n```kotlin\ndependencies {    \n    val libVersion = \"1.0.0\"\n    debugImplementation(\"com.github.tberchanov.StrictPro:strictpro.ui:$libVersion\")\n    releaseImplementation(\"com.github.tberchanov.StrictPro:strictpro.ui.stubs:$libVersion\")\n}\n```\n\nSample `app` 📱\n------\nRun the sample `app` to trigger StrictMode violations and explore StrictPro’s features.\n\n\u003cimg src=\"./img/strict-pro-example.gif\" width=\"300\" /\u003e\n\nFuture plans / TODO ⏳:\n---\n\n* Add dialog rate limiting (trottling).\n\n* Add timing and other metadata to the DropBox penalty log.\n\n* Implement more penalties executors: NotificationPenaltyExecutor, ToastPenaltyExecutor, VibrationPenaltyExecutor, SoundPenaltyExecutor.\n\n* StrictPro UI, add import/export violations feature.\n\nUseful Resources 📚\n---\nLearn more about StrictMode and its uses:\n\n* https://medium.com/wizeline-mobile/raising-the-bar-with-android-strictmode-7042d8a9e67b\n\n* https://medium.com/mobile-app-development-publication/android-strict-mode-selective-code-suppression-37ee0d999f6b#.kszw12gs1\n\n* https://medium.com/mobile-app-development-publication/walk-through-hell-with-android-strictmode-7e8605168032\n\n* https://elye-project.medium.com/hell-level-4-unleashed-by-android-strict-mode-dare-you-challenge-it-1dc9048bb4fb\n\n* https://firebase.blog/posts/2017/07/find-more-bugs-using-strictmode-with/\n\n## License 📜\n\nThis project is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftberchanov%2Fstrictpro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftberchanov%2Fstrictpro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftberchanov%2Fstrictpro/lists"}