Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/danielceinos/cooper

Cool User agent interceptor for Okhttp3
https://github.com/danielceinos/cooper

agent android header interceptor kotlin kotlin-android kotlin-library library okhttp okhttp3 user-agent

Last synced: about 22 hours ago
JSON representation

Cool User agent interceptor for Okhttp3

Awesome Lists containing this project

README

        

Cooper, interceptor for [OkHttp3](https://github.com/square/okhttp) to add bran new shine User-Agent header
--------

[![](https://jitpack.io/v/danielceinos/User-Agent-Interceptor.svg)](https://jitpack.io/#danielceinos/User-Agent-Interceptor)

This interceptor adds a useful User Agent header value.

Following this format:

`User-Agent:Your awesome app name / 1.0.1(2830803); StandAloneInstall; (Google; Android SDK built for x86_64; SDK 28; Android 9)`

AppName / VersionName(VersionCode); Installer package; (manufacturer; model; SDK version; Android version code)

Usage
--------

```kotlin
val client = OkHttpClient.Builder()
client.addInterceptor(CooperInterceptor(context))
```
Install
--------

Last release:

[![](https://jitpack.io/v/danielceinos/User-Agent-Interceptor.svg)](https://jitpack.io/#danielceinos/User-Agent-Interceptor)

Add it in your root build.gradle at the end of repositories:

```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```

Add the dependency

```groovy
dependencies {
implementation 'com.github.danielceinos:Cooper:X.Y.Z'
}
```