• Stars
    star
    4,670
  • Rank 8,965 (Top 0.2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An in-app HTTP inspector for Android OkHttp clients

Chuck

Chuck is a simple in-app HTTP inspector for Android OkHttp clients. Chuck intercepts and persists all HTTP requests and responses inside your application, and provides a UI for inspecting their content.

Chuck

Apps using Chuck will display a notification showing a summary of ongoing HTTP activity. Tapping on the notification launches the full Chuck UI. Apps can optionally suppress the notification, and launch the Chuck UI directly from within their own interface. HTTP interactions and their contents can be exported via a share intent.

The main Chuck activity is launched in its own task, allowing it to be displayed alongside the host app UI using Android 7.x multi-window support.

Multi-Window

Chuck requires Android 4.1+ and OkHttp 3.x.

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.

Setup

Add the dependency in your build.gradle file. Add it alongside the no-op variant to isolate Chuck from release builds as follows:

 dependencies {
   debugCompile 'com.readystatesoftware.chuck:library:1.1.0'
   releaseCompile 'com.readystatesoftware.chuck:library-no-op:1.1.0'
 }

In your application code, create an instance of ChuckInterceptor (you'll need to provide it with a Context, because Android) and add it as an interceptor when building your OkHttp client:

OkHttpClient client = new OkHttpClient.Builder()
  .addInterceptor(new ChuckInterceptor(context))
  .build();

That's it! Chuck will now record all HTTP interactions made by your OkHttp client. You can optionally disable the notification by calling showNotification(false) on the interceptor instance, and launch the Chuck UI directly within your app with the intent from Chuck.getLaunchIntent().

FAQ

  • Why are some of my request headers missing?
  • Why are retries and redirects not being captured discretely?
  • Why are my encoded request/response bodies not appearing as plain text?

Please refer to this section of the OkHttp wiki. You can choose to use Chuck as either an application or network interceptor, depending on your requirements.

Acknowledgements

Chuck uses the following open source libraries:

  • OkHttp - Copyright Square, Inc.
  • Gson - Copyright Google Inc.
  • Cupboard - Copyright Little Robots.

License

Copyright (C) 2017 Jeff Gilfelt.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

SystemBarTint

[DEPRECATED] Apply background tinting to the Android system UI when using KitKat translucent modes
Java
5,367
star
2

android-viewbadger

[DEPRECATED] A simple way to "badge" any given Android view at runtime without having to cater for it in layout
Java
3,019
star
3

android-sqlite-asset-helper

An Android helper class to manage database creation and version management using an application's raw asset files
Java
2,145
star
4

android-actionbarstylegenerator

[DEPRECATED] Easily create a simple, attractive and seamless custom action bar style for your Android application
JavaScript
1,006
star
5

android-mapviewballoons

[DEPRECATED] Simple information balloon annotation for Android MapView
Java
851
star
6

android-adt-templates

A small collection of ADT templates to help quickly scaffold common Activity and UI patterns.
633
star
7

GhostLog

Android app that displays the logcat buffer in a system overlay window
Java
382
star
8

androidicons-adt-template

Android Studio / Eclipse ADT template for androidicons.com resources
190
star
9

android-simpl3r

Amazon S3 multipart file upload for Android, made simple
Java
182
star
10

android-resource-navigator

Chrome Extension providing enhanced resource navigation for GitHub hosted Android projects
JavaScript
170
star
11

NotificationLog

Use an expanded notification as a makeshift Android log output console
Java
160
star
12

android-protobuf-example

Google Protocol Buffer Example on Android
Java
91
star
13

ThisWayUp

Sample app for my Droidcon London 2013 talk - "This Way Up: Implementing Effective Navigation"
Java
84
star
14

android-jsonarrayadapter

An easy adapter to map JSON data to views defined in an XML layout
Java
66
star
15

android-countdown

A simple Android chronometer view that counts down to a given time
Java
32
star
16

SQLook

Examine an Android SQLite database using a client application of your choice
Python
22
star
17

RoughCut

Experimental port of Android's private video editor API
Java
16
star
18

android-sdk-samples-search

[DEPRECATED] Chrome extension that adds a 'sample code' link for class references at developer.android.com
JavaScript
15
star
19

android-geras

Android sensor feed for Geras IoT time series database
Java
11
star
20

Novocation

An attempt jar-ify location.
Java
6
star