{"id":13604073,"url":"https://github.com/Ashok-Varma/Gander","last_synced_at":"2025-04-11T22:32:37.195Z","repository":{"id":41377496,"uuid":"135972985","full_name":"Ashok-Varma/Gander","owner":"Ashok-Varma","description":"Gander is a simple in-app HTTP inspector for Android OkHttp clients. Gander intercepts and persists all HTTP requests and responses inside your application, and provides a UI for inspecting their content.","archived":false,"fork":false,"pushed_at":"2021-11-25T15:30:31.000Z","size":5763,"stargazers_count":291,"open_issues_count":9,"forks_count":39,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-07T08:42:03.057Z","etag":null,"topics":["android","android-network-status","chuck","gander","network-debug","network-monitoring","network-visualization","notifications","okhttpclient"],"latest_commit_sha":null,"homepage":null,"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/Ashok-Varma.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}},"created_at":"2018-06-04T05:03:46.000Z","updated_at":"2024-11-02T08:01:06.000Z","dependencies_parsed_at":"2022-09-05T18:12:47.461Z","dependency_job_id":null,"html_url":"https://github.com/Ashok-Varma/Gander","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashok-Varma%2FGander","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashok-Varma%2FGander/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashok-Varma%2FGander/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashok-Varma%2FGander/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ashok-Varma","download_url":"https://codeload.github.com/Ashok-Varma/Gander/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248489889,"owners_count":21112657,"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","android-network-status","chuck","gander","network-debug","network-monitoring","network-visualization","notifications","okhttpclient"],"created_at":"2024-08-01T19:00:39.374Z","updated_at":"2025-04-11T22:32:32.181Z","avatar_url":"https://github.com/Ashok-Varma.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# Gander \n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://android-arsenal.com/api?level=16\"\u003e\u003cimg alt=\"API\" src=\"https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://travis-ci.com/Ashok-Varma/Gander\"\u003e\u003cimg alt=\"Build Status\" src=\"https://travis-ci.com/Ashok-Varma/Gander.svg?branch=master\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://androidweekly.net/issues/issue-337\"\u003e\u003cimg alt=\"Javadoc\" src=\"https://img.shields.io/badge/Android%20Weekly-%23337-orange.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/Ashok-Varma/Gander/master/LogoDesigns/logotype1.1.png\"/\u003e\u003c/p\u003e\n\n\n## What is this library about?\nGander is a simple in-app HTTP inspector for Android OkHttp clients. Gander intercepts and persists all HTTP requests and responses inside your application, and provides a UI for inspecting their content.\n\n![Gander](assets/gander.gif)\n\n**get sample apk from [Google Play Store][googlePlayStoreLink]**\n\n## Features\n1. Apps using Gander will display a notification showing a summary of ongoing HTTP activity. Tapping on the notification launches the full Gander UI. Apps can optionally suppress the notification, and launch the Gander UI directly from within their own interface. HTTP interactions and their contents can be exported via a share intent.\n2. Search HTTP Activity and also request and response \n3. The main Gander activity is launched in its own task, allowing it to be displayed alongside the host app UI using Android 7.x multi-window support.\n4. Gander Provides following variants\n    - Persistence : Saves logs to disk and TTL can be controlled\n    - In Memory Database : Logs will be in memory as long as the app lifecycle. \n    - No Op : This does nothing. So if users want Gander only in debug builds they can releaseCompile NoOp without dealing with variants, if(Build.DEBUG) ..etc \n \n\n![Multi-Window](assets/multiwindow.gif) \n\nGander requires Android 4.1+ and OkHttp 3.x.\n\n**Warning**: The data generated and stored when using this interceptor may contain sensitive information such as Authorization or Cookie headers, and the contents of request and response bodies. It is intended for use during development, and not in release builds or other production deployments.\n\n## Setup\n\n### Download\n\nBased on your IDE you can import library in one of the following ways\n\n##### Gradle:\nAdd the dependency in your `build.gradle` file. Add it alongside the `no-op` variant to isolate Gander from release builds as follows:\n```gradle\n// if persistence is needed (Uses Room to store the calls in DB)\ndebugImplementation 'com.ashokvarma.android:gander-persistence:3.1.0'\n\n// if persistence is not needed (Data retained in memory lost on app close)\ndebugImplementation 'com.ashokvarma.android:gander-imdb:3.1.0'\n\n\nreleaseImplementation 'com.ashokvarma.android:gander-no-op:3.1.0'\n```\nIf you want this in library in both release and debug builds, then try this : \n```gradle\n// if persistence is needed (Uses Room to store the calls in DB)\nimplementation 'com.ashokvarma.android:gander-persistence:3.1.0'\n\n// if persistence is not needed (Data retained in memory lost on app close)\nimplementation 'com.ashokvarma.android:gander-imdb:3.1.0'\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eor grab via Maven:\u003c/summary\u003e\n  \n      \u003c!--if persistence is needed (Uses Room to store the calls in DB)--\u003e\n      \u003cdependency\u003e\n        \u003cgroupId\u003ecom.ashokvarma.android\u003c/groupId\u003e\n        \u003cartifactId\u003egander-persistence\u003c/artifactId\u003e\n        \u003cversion\u003e3.1.0\u003c/version\u003e\n        \u003ctype\u003epom\u003c/type\u003e\n      \u003c/dependency\u003e\n      \u003c!--if persistence is not needed (Data lost once app is dead)--\u003e\n      \u003cdependency\u003e\n        \u003cgroupId\u003ecom.ashokvarma.android\u003c/groupId\u003e\n        \u003cartifactId\u003egander-imdb\u003c/artifactId\u003e\n        \u003cversion\u003e3.1.0\u003c/version\u003e\n        \u003ctype\u003epom\u003c/type\u003e\n      \u003c/dependency\u003e\n\u003c/details\u003e\n\nor Download the latest Gander [Persistence JAR][persistenceMavenAarDownload] / [IMDB JAR][imdbMavenAarDownload]\n\n### Usage\n\n##### In your application onCreate\n```java\n  @Override\n    public void onCreate() {\n        super.onCreate();\n        // For Persistence (Uses Room to store the calls in DB)\n        Gander.setGanderStorage(GanderPersistence.getInstance(this));\n        // For In Memory DB (Data retained in memory lost on app close)\n        Gander.setGanderStorage(GanderIMDB.getInstance());\n    }\n```\n\nCreate an instance of `GanderInterceptor` and add it as an interceptor when building your OkHttp client:\n\n```java\nOkHttpClient client = new OkHttpClient.Builder()\n  .addInterceptor(new GanderInterceptor(context))\n  .build();\n```\n\nThat's it! Gander will now record all HTTP interactions made by this OkHttp client.\n\n##### Show Sticky/Normal Notification\nSticky =\u003e true and Normal =\u003e false\n```java\nnew GanderInterceptor(context).showNotification(true/false)\n```\n\n### Other Settings\n##### Check stored data\nLaunch the Gander UI directly within your app with the intent from `Gander.getLaunchIntent()`.\n```java\nstartActivity(Gander.getLaunchIntent(this));\n```\n\n##### Add app shortcut to your app\n```java\nGander.addAppShortcut(this);\n```\n\n##### Redact Headers\nYou can redact headers that may contain sensitive information by calling `redactHeader()`.\n```java\nnew GanderInterceptor(context)\n    .redactHeader(\"Authorization\")\n    .redactHeader(\"Cookie\");\n```\n\n##### Max Length\nSet Response Max length to store\n```java\nnew GanderInterceptor(context).maxContentLength(10240L)//the maximum length (in bytes)\n```\n\n##### Retention Period\nSet the retention period for HTTP transaction data captured\n```java\nnew GanderInterceptor(context).retainDataFor(Period.ONE_WEEK)\n```\n\n##### Chaining\nYou can chain all the method calls and pass it to OkHttp\n```java\nnew OkHttpClient.Builder()\n.addInterceptor(new GanderInterceptor(context)\n                     .showNotification(false)\n                     .maxContentLength(250000L)\n                     .retainDataFor(GanderInterceptor.Period.FOREVER)\n                     .redactHeader(\"Authorization\"))\n```\n\n## FAQ\n- Why are some of my request headers missing?\n- Why are retries and redirects not being captured discretely?\n- Why are my encoded request/response bodies not appearing as plain text?\n\nPlease refer to [this section of the OkHttp wiki](https://github.com/square/okhttp/wiki/Interceptors#choosing-between-application-and-network-interceptors). You can choose to use Gander as either an application or network interceptor, depending on your requirements.\n\n##### Diff between Chuck and Gander:\n1. Gander uses Room for db instead of Cupboard\n2. Removed Gson Dependency\n3. Improved Search\n4. Improved Performance (PagedList, BackGround Load for Text, other minor pref boosts)\n5. Minor fixes (Notification Channel Creation ..etc)\n6. Many new features (Search highlight, app shortcut, Improved Notifications ..etc)\n\n## Find this library useful? :heart:\nSupport it by joining __[stargazers](https://github.com/Ashok-Varma/Gander/stargazers)__ for this repository. :star:\n    \n## Other Open Source Libraries\n1. [SqliteManager](https://github.com/Ashok-Varma/SqliteManager) : Sqlite Manager is a Dev Debug tool that helps to manage(Edit, Add, Clear) your android Sqlite Databases.\n2. [SharedPrefManager](https://github.com/Ashok-Varma/SharedPrefManager) : SharedPref Manager is a Dev Debug tool that helps to manage(Edit, Add, Clear) your android Shared Preferences. \n3. [BottomNavigation](https://github.com/Ashok-Varma/BottomNavigation) : This Library helps users to use Bottom Navigation Bar (A new pattern from google) with ease and allows ton of customizations.\n\n## Acknowledgements\nChuck (parent repo)\n- [Chuck][chuckLink] - Copyright Jeff Gilfelt, Inc.\n##### Thanks to [Jeff Gilfelt][jgilfeltLink] for his amazing library [Chuck][chuckLink]. This repo is a fork from Chuck, later on moved and released as separate project, since chuck is no longer maintained.\n\nAwesome Icon Designer\n- [Jibbie Eguna][jbeguna04Link] - He contributed the Icon to Gander.\n\nGander uses the following open source libraries:\n- [OkHttp][okhttpLink] - Copyright Square, Inc.\n\n\nLicense\n-------\n\n    Copyright (C) 2018 Ashok Varma.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n[persistenceMavenAarDownload]: https://repo1.maven.org/maven2/com/ashokvarma/android/gander-persistence/3.1.0/gander-persistence-3.1.0.aar\n[imdbMavenAarDownload]: https://repo1.maven.org/maven2/com/ashokvarma/android/gander-imdb/3.1.0/gander-imdb-3.1.0.aar\n[googlePlayStoreLink]: https://play.google.com/store/apps/details?id=com.ashokvarma.gander.sample\n[chuckLink]: https://github.com/jgilfelt/chuck\n[jgilfeltLink]: https://github.com/jgilfelt\n[okhttpLink]: https://github.com/square/okhttp\n[jbeguna04Link]: https://github.com/jbeguna04\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAshok-Varma%2FGander","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAshok-Varma%2FGander","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAshok-Varma%2FGander/lists"}