Platform.smali
.class abstract Lretrofit/Platform;
.super Ljava/lang/Object;
.source "Platform.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lretrofit/Platform$OkClientInstantiator;,
Lretrofit/Platform$AppEngine;,
Lretrofit/Platform$Android;,
Lretrofit/Platform$Base;
}
.end annotation
# static fields
.field static final HAS_RX_JAVA:Z
.field private static final PLATFORM:Lretrofit/Platform;
# direct methods
.method static constructor <clinit>()V
.registers 1
.line 38
invoke-static {}, Lretrofit/Platform;->findPlatform()Lretrofit/Platform;
move-result-object v0
sput-object v0, Lretrofit/Platform;->PLATFORM:Lretrofit/Platform;
.line 40
invoke-static {}, Lretrofit/Platform;->hasRxJavaOnClasspath()Z
move-result v0
sput-boolean v0, Lretrofit/Platform;->HAS_RX_JAVA:Z
return-void
.end method
.method constructor <init>()V
.registers 1
.line 37
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method static synthetic access$300()Z
.registers 1
.line 37
invoke-static {}, Lretrofit/Platform;->hasOkHttpOnClasspath()Z
move-result v0
return v0
.end method
.method private static findPlatform()Lretrofit/Platform;
.registers 2
const/4 v0, 0x0
:try_start_1
const-string v1, "android.os.Build"
.line 48
invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
.line 49
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
if-eqz v1, :cond_11
.line 50
new-instance v1, Lretrofit/Platform$Android;
invoke-direct {v1, v0}, Lretrofit/Platform$Android;-><init>(Lretrofit/Platform$1;)V
:try_end_f
.catch Ljava/lang/ClassNotFoundException; {:try_start_1 .. :try_end_f} :catch_10
return-object v1
:catch_10
nop
:cond_11
const-string v1, "com.google.appengine.runtime.version"
.line 55
invoke-static {v1}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
if-eqz v1, :cond_1f
.line 56
new-instance v1, Lretrofit/Platform$AppEngine;
invoke-direct {v1, v0}, Lretrofit/Platform$AppEngine;-><init>(Lretrofit/Platform$1;)V
return-object v1
.line 59
:cond_1f
new-instance v1, Lretrofit/Platform$Base;
invoke-direct {v1, v0}, Lretrofit/Platform$Base;-><init>(Lretrofit/Platform$1;)V
return-object v1
.end method
.method static get()Lretrofit/Platform;
.registers 1
.line 43
sget-object v0, Lretrofit/Platform;->PLATFORM:Lretrofit/Platform;
return-object v0
.end method
.method private static hasOkHttpOnClasspath()Z
.registers 4
const/4 v0, 0x1
const/4 v1, 0x0
:try_start_2
const-string v2, "com.squareup.okhttp.OkUrlFactory"
.line 173
invoke-static {v2}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
:try_end_7
.catch Ljava/lang/ClassNotFoundException; {:try_start_2 .. :try_end_7} :catch_9
const/4 v2, 0x1
goto :goto_a
:catch_9
const/4 v2, 0x0
:goto_a
:try_start_a
const-string v3, "com.squareup.okhttp.OkHttpClient"
.line 180
invoke-static {v3}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
:try_end_f
.catch Ljava/lang/ClassNotFoundException; {:try_start_a .. :try_end_f} :catch_10
goto :goto_11
:catch_10
const/4 v0, 0x0
:goto_11
if-ne v0, v2, :cond_14
return v0
.line 186
:cond_14
new-instance v0, Ljava/lang/RuntimeException;
const-string v1, "Retrofit detected an unsupported OkHttp on the classpath.\nTo use OkHttp with this version of Retrofit, you\'ll need:\n1. com.squareup.okhttp:okhttp:1.6.0 (or newer)\n2. com.squareup.okhttp:okhttp-urlconnection:1.6.0 (or newer)\nNote that OkHttp 2.0.0+ is supported!"
invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method private static hasRxJavaOnClasspath()Z
.registers 1
:try_start_0
const-string v0, "rx.Observable"
.line 209
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
:try_end_5
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_5} :catch_7
const/4 v0, 0x1
return v0
:catch_7
const/4 v0, 0x0
return v0
.end method
# virtual methods
.method abstract defaultCallbackExecutor()Ljava/util/concurrent/Executor;
.end method
.method abstract defaultClient()Lretrofit/client/Client$Provider;
.end method
.method abstract defaultConverter()Lretrofit/converter/Converter;
.end method
.method abstract defaultHttpExecutor()Ljava/util/concurrent/Executor;
.end method
.method abstract defaultLog()Lretrofit/RestAdapter$Log;
.end method