Skip to content

danielceinos/Cooper

Repository files navigation

Cooper, interceptor for OkHttp3 to add bran new shine User-Agent header

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

val client = OkHttpClient.Builder()
client.addInterceptor(CooperInterceptor(context))

Install

Last release:

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

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

Add the dependency

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