{"id":13990193,"url":"https://github.com/jainsahab/AndroidSnooper","last_synced_at":"2025-07-22T12:31:08.534Z","repository":{"id":41506635,"uuid":"82467358","full_name":"jainsahab/AndroidSnooper","owner":"jainsahab","description":"Android library to record the network calls through the interceptor mechanism of the http clients.","archived":false,"fork":false,"pushed_at":"2022-03-09T22:55:02.000Z","size":9328,"stargazers_count":168,"open_issues_count":4,"forks_count":22,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-08T01:51:17.358Z","etag":null,"topics":["android","android-library","debugging","debugging-tool","http-client","http-inspection","interceptor","java"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/jainsahab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-19T15:07:04.000Z","updated_at":"2025-02-27T06:37:53.000Z","dependencies_parsed_at":"2022-08-25T15:50:47.589Z","dependency_job_id":null,"html_url":"https://github.com/jainsahab/AndroidSnooper","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/jainsahab/AndroidSnooper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jainsahab%2FAndroidSnooper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jainsahab%2FAndroidSnooper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jainsahab%2FAndroidSnooper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jainsahab%2FAndroidSnooper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jainsahab","download_url":"https://codeload.github.com/jainsahab/AndroidSnooper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jainsahab%2FAndroidSnooper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266495916,"owners_count":23938623,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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","android-library","debugging","debugging-tool","http-client","http-inspection","interceptor","java"],"created_at":"2024-08-09T13:02:26.613Z","updated_at":"2025-07-22T12:31:08.122Z","avatar_url":"https://github.com/jainsahab.png","language":"Kotlin","readme":"# Android Snooper\n\n![Build Status](https://github.com/jainsahab/AndroidSnooper/workflows/AndroidSnooper%20CI/badge.svg?branch=master\u0026event=push)[![codecov](https://codecov.io/gh/jainsahab/AndroidSnooper/branch/master/graph/badge.svg)](https://codecov.io/gh/jainsahab/AndroidSnooper)[![Maven Central](https://img.shields.io/maven-central/v/com.github.jainsahab/Snooper.svg)](https://mvnrepository.com/artifact/com.github.jainsahab/Snooper)[![BCH compliance](https://bettercodehub.com/edge/badge/jainsahab/AndroidSnooper?branch=master)](https://bettercodehub.com/)[![HitCount](http://hits.dwyl.com/jainsahab/AndroidSnooper.svg)](http://hits.dwyl.com/jainsahab/AndroidSnooper)\n\n\n## Introduction\nAndroid Snooper is a library which helps in debugging issues while running the applications on android devices. One of the basic features provided includes HTTP inspection, which observes all the HTTP calls made by the app. When the device is shaked, history of all the HTTP requests is presented with their responses and allows search, copy and sharing of the request/response. This library is inspired by the `Network Request History` feature of [FLEX](https://github.com/Flipboard/FLEX) app for iOS.\n\n![Snooper](assets/snooper_demo.gif)\n\n## How to use?\nAndroid Snooper works on the [interceptor pattern](https://en.wikipedia.org/wiki/Interceptor_pattern) which is supported by almost every HTTP client. All you need to do is initialize Android Snooper using `AndroidSnooper.init(this);` statement in your Application class and set an instance of `SnooperInterceptor` to the list of your network interceptors.\nAs of now Snooper supports the interceptors for the following libraries:\n\n* [Spring Android Rest Template](http://projects.spring.io/spring-android/)\n* [Square's OkHttp Client](https://github.com/square/okhttp)\n\nDidn't get your HTTP client's name in the list? No worries, You can still write your own implementation by using `Android Snooper's` core module and let Android Snooper know about the request being made. Below is given a dummy implementation.\n```java\n    AndroidSnooper androidSnooper = AndroidSnooper.getInstance();\n    HttpCall httpCall = new HttpCall.Builder()\n      .withUrl(httpRequest.getUrl())\n      .withPayload(httpRequest.getRequestPayload())\n      .withMethod(httpRequest.getMethod())\n      .withResponseBody(httpResponse.getResponseBody())\n      .withStatusCode(httpResponse.getRawStatusCode())\n      .withStatusText(httpResponse.getStatusCode())\n      .withRequestHeaders(httpRequest.getHeaders())\n      .withResponseHeaders(httpResponse.getHeaders())\n      .build();\n    androidSnooper.record(httpCall);\n```\nThe above implementation ought to be part of your custom interceptor where you will have access to the required `Request` and `Response` object to jot down the required data for Android Snooper to work properly.\n\n**Warning:** Android Snooper records each and every HTTP call intercepted by it. The sole purpose of Android snooper is to help in *debugging*, hence **only Debug or QA builds** are the perfect candidates for integrating the library. Sensitive information such as **Auth Tokens**, **Headers**, etc are not supposed to be exposed and hence production apps should not integrate the library.\n\n## Integration\n```groovy\n    repositories {\n        mavenCentral()\n    }\n\n    // when using Android Snooper's core module\n    compile ('com.github.jainsahab:Snooper:1.5.5@aar'){\n      transitive = true\n    }\n\n    // Android Snooper library for \"Spring Android Rest Template\"\n    compile ('com.github.jainsahab:Snooper-Spring:1.5.5@aar'){\n      transitive = true\n    }\n    \n    // Android Snooper library for \"Square's Okhttp\"\n    compile ('com.github.jainsahab:Snooper-Okhttp:1.5.5@aar'){\n      transitive = true\n    }\n```\nSnapshot versions are available in [Sonatype's snapshots repository](https://oss.sonatype.org/content/repositories/snapshots).\n\n## Contributing\nIf you would like to contribute code to `AndroidSnooper` you can do so by forking the repository and create a Pull request. You can also create an Issue to report bugs or features that you want to see in `AndroidSnooper` library.\n\n## Attributions\nThis library uses:\n* Icons made by [Madebyoliver](http://www.flaticon.com/authors/madebyoliver), [Freepik](http://www.freepik.com) and [Gregor Cresnar](http://www.flaticon.com/authors/gregor-cresnar) from [www.flaticon.com](http://www.flaticon.com) is licensed by \u003ca href=\"http://creativecommons.org/licenses/by/3.0/\" title=\"Creative Commons BY 3.0\" target=\"_blank\"\u003eCC 3.0 BY\u003c/a\u003e.\n\n\nLICENSE\n-------\n\n```LICENSE\nCopyright (C) 2017 Prateek Jain\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```","funding_links":[],"categories":["Kotlin","Debug"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjainsahab%2FAndroidSnooper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjainsahab%2FAndroidSnooper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjainsahab%2FAndroidSnooper/lists"}