今奥全景相机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1607 lines
36 KiB

.class final Lcom/squareup/picasso/Utils;
.super Ljava/lang/Object;
.source "Utils.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/squareup/picasso/Utils$OkHttpLoaderCreator;,
Lcom/squareup/picasso/Utils$BitmapHoneycombMR1;,
Lcom/squareup/picasso/Utils$PicassoThread;,
Lcom/squareup/picasso/Utils$PicassoThreadFactory;,
Lcom/squareup/picasso/Utils$ActivityManagerHoneycomb;
}
.end annotation
# static fields
.field static final DEFAULT_CONNECT_TIMEOUT_MILLIS:I = 0x3a98
.field static final DEFAULT_READ_TIMEOUT_MILLIS:I = 0x4e20
.field static final DEFAULT_WRITE_TIMEOUT_MILLIS:I = 0x4e20
.field private static final KEY_PADDING:I = 0x32
.field static final KEY_SEPARATOR:C = '\n'
.field static final MAIN_THREAD_KEY_BUILDER:Ljava/lang/StringBuilder;
.field private static final MAX_DISK_CACHE_SIZE:I = 0x3200000
.field private static final MIN_DISK_CACHE_SIZE:I = 0x500000
.field static final OWNER_DISPATCHER:Ljava/lang/String; = "Dispatcher"
.field static final OWNER_HUNTER:Ljava/lang/String; = "Hunter"
.field static final OWNER_MAIN:Ljava/lang/String; = "Main"
.field private static final PICASSO_CACHE:Ljava/lang/String; = "picasso-cache"
.field static final THREAD_IDLE_NAME:Ljava/lang/String; = "Picasso-Idle"
.field static final THREAD_LEAK_CLEANING_MS:I = 0x3e8
.field static final THREAD_PREFIX:Ljava/lang/String; = "Picasso-"
.field static final VERB_BATCHED:Ljava/lang/String; = "batched"
.field static final VERB_CANCELED:Ljava/lang/String; = "canceled"
.field static final VERB_CHANGED:Ljava/lang/String; = "changed"
.field static final VERB_COMPLETED:Ljava/lang/String; = "completed"
.field static final VERB_CREATED:Ljava/lang/String; = "created"
.field static final VERB_DECODED:Ljava/lang/String; = "decoded"
.field static final VERB_DELIVERED:Ljava/lang/String; = "delivered"
.field static final VERB_ENQUEUED:Ljava/lang/String; = "enqueued"
.field static final VERB_ERRORED:Ljava/lang/String; = "errored"
.field static final VERB_EXECUTING:Ljava/lang/String; = "executing"
.field static final VERB_IGNORED:Ljava/lang/String; = "ignored"
.field static final VERB_JOINED:Ljava/lang/String; = "joined"
.field static final VERB_PAUSED:Ljava/lang/String; = "paused"
.field static final VERB_REMOVED:Ljava/lang/String; = "removed"
.field static final VERB_REPLAYING:Ljava/lang/String; = "replaying"
.field static final VERB_RESUMED:Ljava/lang/String; = "resumed"
.field static final VERB_RETRYING:Ljava/lang/String; = "retrying"
.field static final VERB_TRANSFORMED:Ljava/lang/String; = "transformed"
.field private static final WEBP_FILE_HEADER_RIFF:Ljava/lang/String; = "RIFF"
.field private static final WEBP_FILE_HEADER_SIZE:I = 0xc
.field private static final WEBP_FILE_HEADER_WEBP:Ljava/lang/String; = "WEBP"
# direct methods
.method static constructor <clinit>()V
.locals 1
.prologue
.line 65
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
sput-object v0, Lcom/squareup/picasso/Utils;->MAIN_THREAD_KEY_BUILDER:Ljava/lang/StringBuilder;
return-void
.end method
.method private constructor <init>()V
.locals 0
.prologue
.line 105
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 107
return-void
.end method
.method static calculateDiskCacheSize(Ljava/io/File;)J
.locals 6
.prologue
const-wide/32 v2, 0x500000
.line 267
.line 270
:try_start_0
new-instance v0, Landroid/os/StatFs;
invoke-virtual {p0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Landroid/os/StatFs;-><init>(Ljava/lang/String;)V
.line 271
invoke-virtual {v0}, Landroid/os/StatFs;->getBlockCount()I
move-result v1
int-to-long v4, v1
invoke-virtual {v0}, Landroid/os/StatFs;->getBlockSize()I
move-result v0
int-to-long v0, v0
mul-long/2addr v0, v4
.line 273
const-wide/16 v4, 0x32
div-long/2addr v0, v4
:try_end_0
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
.line 278
:goto_0
const-wide/32 v4, 0x3200000
invoke-static {v0, v1, v4, v5}, Ljava/lang/Math;->min(JJ)J
move-result-wide v0
invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->max(JJ)J
move-result-wide v0
return-wide v0
.line 274
:catch_0
move-exception v0
move-wide v0, v2
goto :goto_0
.end method
.method static calculateMemoryCacheSize(Landroid/content/Context;)I
.locals 5
.prologue
const/high16 v4, 0x100000
.line 282
const-string v0, "activity"
invoke-static {p0, v0}, Lcom/squareup/picasso/Utils;->getService(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/ActivityManager;
.line 283
invoke-virtual {p0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object v1
iget v1, v1, Landroid/content/pm/ApplicationInfo;->flags:I
and-int/2addr v1, v4
if-eqz v1, :cond_0
const/4 v1, 0x1
.line 284
:goto_0
invoke-virtual {v0}, Landroid/app/ActivityManager;->getMemoryClass()I
move-result v2
.line 285
if-eqz v1, :cond_1
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v3, 0xb
if-lt v1, v3, :cond_1
.line 286
invoke-static {v0}, Lcom/squareup/picasso/Utils$ActivityManagerHoneycomb;->getLargeMemoryClass(Landroid/app/ActivityManager;)I
move-result v0
.line 289
:goto_1
mul-int/2addr v0, v4
div-int/lit8 v0, v0, 0x7
return v0
.line 283
:cond_0
const/4 v1, 0x0
goto :goto_0
:cond_1
move v0, v2
goto :goto_1
.end method
.method static checkMain()V
.locals 2
.prologue
.line 136
invoke-static {}, Lcom/squareup/picasso/Utils;->isMain()Z
move-result v0
if-nez v0, :cond_0
.line 137
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Method call should happen from the main thread."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.line 139
:cond_0
return-void
.end method
.method static checkNotMain()V
.locals 2
.prologue
.line 130
invoke-static {}, Lcom/squareup/picasso/Utils;->isMain()Z
move-result v0
if-eqz v0, :cond_0
.line 131
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Method call should not happen from the main thread."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.line 133
:cond_0
return-void
.end method
.method static checkNotNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(TT;",
"Ljava/lang/String;",
")TT;"
}
.end annotation
.prologue
.line 123
if-nez p0, :cond_0
.line 124
new-instance v0, Ljava/lang/NullPointerException;
invoke-direct {v0, p1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw v0
.line 126
:cond_0
return-object p0
.end method
.method static closeQuietly(Ljava/io/InputStream;)V
.locals 1
.prologue
.line 222
if-nez p0, :cond_0
.line 227
:goto_0
return-void
.line 224
:cond_0
:try_start_0
invoke-virtual {p0}, Ljava/io/InputStream;->close()V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
.line 225
:catch_0
move-exception v0
goto :goto_0
.end method
.method static createDefaultCacheDir(Landroid/content/Context;)Ljava/io/File;
.locals 3
.prologue
.line 258
new-instance v0, Ljava/io/File;
invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object v1
invoke-virtual {v1}, Landroid/content/Context;->getCacheDir()Ljava/io/File;
move-result-object v1
const-string v2, "picasso-cache"
invoke-direct {v0, v1, v2}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
.line 259
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v1
if-nez v1, :cond_0
.line 261
invoke-virtual {v0}, Ljava/io/File;->mkdirs()Z
.line 263
:cond_0
return-object v0
.end method
.method static createDefaultDownloader(Landroid/content/Context;)Lcom/squareup/picasso/Downloader;
.locals 1
.prologue
.line 250
:try_start_0
const-string v0, "com.squareup.okhttp.OkHttpClient"
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
.line 251
invoke-static {p0}, Lcom/squareup/picasso/Utils$OkHttpLoaderCreator;->create(Landroid/content/Context;)Lcom/squareup/picasso/Downloader;
:try_end_0
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v0
.line 254
:goto_0
return-object v0
.line 252
:catch_0
move-exception v0
.line 254
new-instance v0, Lcom/squareup/picasso/UrlConnectionDownloader;
invoke-direct {v0, p0}, Lcom/squareup/picasso/UrlConnectionDownloader;-><init>(Landroid/content/Context;)V
goto :goto_0
.end method
.method static createKey(Lcom/squareup/picasso/Request;)Ljava/lang/String;
.locals 3
.prologue
.line 174
sget-object v0, Lcom/squareup/picasso/Utils;->MAIN_THREAD_KEY_BUILDER:Ljava/lang/StringBuilder;
invoke-static {p0, v0}, Lcom/squareup/picasso/Utils;->createKey(Lcom/squareup/picasso/Request;Ljava/lang/StringBuilder;)Ljava/lang/String;
move-result-object v0
.line 175
sget-object v1, Lcom/squareup/picasso/Utils;->MAIN_THREAD_KEY_BUILDER:Ljava/lang/StringBuilder;
const/4 v2, 0x0
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->setLength(I)V
.line 176
return-object v0
.end method
.method static createKey(Lcom/squareup/picasso/Request;Ljava/lang/StringBuilder;)Ljava/lang/String;
.locals 4
.prologue
const/16 v2, 0x78
const/16 v3, 0xa
.line 180
iget-object v0, p0, Lcom/squareup/picasso/Request;->stableKey:Ljava/lang/String;
if-eqz v0, :cond_4
.line 181
iget-object v0, p0, Lcom/squareup/picasso/Request;->stableKey:Ljava/lang/String;
invoke-virtual {v0}, Ljava/lang/String;->length()I
move-result v0
add-int/lit8 v0, v0, 0x32
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->ensureCapacity(I)V
.line 182
iget-object v0, p0, Lcom/squareup/picasso/Request;->stableKey:Ljava/lang/String;
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
.line 191
:goto_0
invoke-virtual {p1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
.line 193
iget v0, p0, Lcom/squareup/picasso/Request;->rotationDegrees:F
const/4 v1, 0x0
cmpl-float v0, v0, v1
if-eqz v0, :cond_1
.line 194
const-string v0, "rotation:"
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget v1, p0, Lcom/squareup/picasso/Request;->rotationDegrees:F
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
.line 195
iget-boolean v0, p0, Lcom/squareup/picasso/Request;->hasRotationPivot:Z
if-eqz v0, :cond_0
.line 196
const/16 v0, 0x40
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
move-result-object v0
iget v1, p0, Lcom/squareup/picasso/Request;->rotationPivotX:F
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
move-result-object v0
iget v1, p0, Lcom/squareup/picasso/Request;->rotationPivotY:F
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
.line 198
:cond_0
invoke-virtual {p1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
.line 200
:cond_1
invoke-virtual {p0}, Lcom/squareup/picasso/Request;->hasSize()Z
move-result v0
if-eqz v0, :cond_2
.line 201
const-string v0, "resize:"
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget v1, p0, Lcom/squareup/picasso/Request;->targetWidth:I
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
move-result-object v0
iget v1, p0, Lcom/squareup/picasso/Request;->targetHeight:I
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
.line 202
invoke-virtual {p1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
.line 204
:cond_2
iget-boolean v0, p0, Lcom/squareup/picasso/Request;->centerCrop:Z
if-eqz v0, :cond_6
.line 205
const-string v0, "centerCrop"
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
.line 210
:cond_3
:goto_1
iget-object v0, p0, Lcom/squareup/picasso/Request;->transformations:Ljava/util/List;
if-eqz v0, :cond_7
.line 212
const/4 v0, 0x0
iget-object v1, p0, Lcom/squareup/picasso/Request;->transformations:Ljava/util/List;
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v2
move v1, v0
:goto_2
if-ge v1, v2, :cond_7
.line 213
iget-object v0, p0, Lcom/squareup/picasso/Request;->transformations:Ljava/util/List;
invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/squareup/picasso/Transformation;
invoke-interface {v0}, Lcom/squareup/picasso/Transformation;->key()Ljava/lang/String;
move-result-object v0
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
.line 214
invoke-virtual {p1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
.line 212
add-int/lit8 v0, v1, 0x1
move v1, v0
goto :goto_2
.line 183
:cond_4
iget-object v0, p0, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
if-eqz v0, :cond_5
.line 184
iget-object v0, p0, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
invoke-virtual {v0}, Landroid/net/Uri;->toString()Ljava/lang/String;
move-result-object v0
.line 185
invoke-virtual {v0}, Ljava/lang/String;->length()I
move-result v1
add-int/lit8 v1, v1, 0x32
invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->ensureCapacity(I)V
.line 186
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
goto/16 :goto_0
.line 188
:cond_5
const/16 v0, 0x32
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->ensureCapacity(I)V
.line 189
iget v0, p0, Lcom/squareup/picasso/Request;->resourceId:I
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
goto/16 :goto_0
.line 206
:cond_6
iget-boolean v0, p0, Lcom/squareup/picasso/Request;->centerInside:Z
if-eqz v0, :cond_3
.line 207
const-string v0, "centerInside"
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
goto :goto_1
.line 218
:cond_7
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method static flushStackLocalLeaks(Landroid/os/Looper;)V
.locals 4
.prologue
.line 388
new-instance v0, Lcom/squareup/picasso/Utils$1;
invoke-direct {v0, p0}, Lcom/squareup/picasso/Utils$1;-><init>(Landroid/os/Looper;)V
.line 393
invoke-virtual {v0}, Landroid/os/Handler;->obtainMessage()Landroid/os/Message;
move-result-object v1
const-wide/16 v2, 0x3e8
invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z
.line 394
return-void
.end method
.method static getBitmapBytes(Landroid/graphics/Bitmap;)I
.locals 3
.prologue
.line 111
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0xc
if-lt v0, v1, :cond_0
.line 112
invoke-static {p0}, Lcom/squareup/picasso/Utils$BitmapHoneycombMR1;->getByteCount(Landroid/graphics/Bitmap;)I
move-result v0
.line 116
:goto_0
if-gez v0, :cond_1
.line 117
new-instance v0, Ljava/lang/IllegalStateException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Negative size: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.line 114
:cond_0
invoke-virtual {p0}, Landroid/graphics/Bitmap;->getRowBytes()I
move-result v0
invoke-virtual {p0}, Landroid/graphics/Bitmap;->getHeight()I
move-result v1
mul-int/2addr v0, v1
goto :goto_0
.line 119
:cond_1
return v0
.end method
.method static getLogIdsForHunter(Lcom/squareup/picasso/BitmapHunter;)Ljava/lang/String;
.locals 1
.prologue
.line 146
const-string v0, ""
invoke-static {p0, v0}, Lcom/squareup/picasso/Utils;->getLogIdsForHunter(Lcom/squareup/picasso/BitmapHunter;Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method static getLogIdsForHunter(Lcom/squareup/picasso/BitmapHunter;Ljava/lang/String;)Ljava/lang/String;
.locals 6
.prologue
.line 150
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2, p1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
.line 151
invoke-virtual {p0}, Lcom/squareup/picasso/BitmapHunter;->getAction()Lcom/squareup/picasso/Action;
move-result-object v3
.line 152
if-eqz v3, :cond_0
.line 153
iget-object v0, v3, Lcom/squareup/picasso/Action;->request:Lcom/squareup/picasso/Request;
invoke-virtual {v0}, Lcom/squareup/picasso/Request;->logId()Ljava/lang/String;
move-result-object v0
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
.line 155
:cond_0
invoke-virtual {p0}, Lcom/squareup/picasso/BitmapHunter;->getActions()Ljava/util/List;
move-result-object v4
.line 156
if-eqz v4, :cond_3
.line 157
const/4 v0, 0x0
invoke-interface {v4}, Ljava/util/List;->size()I
move-result v5
move v1, v0
:goto_0
if-ge v1, v5, :cond_3
.line 158
if-gtz v1, :cond_1
if-eqz v3, :cond_2
:cond_1
const-string v0, ", "
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
.line 159
:cond_2
invoke-interface {v4, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/squareup/picasso/Action;
iget-object v0, v0, Lcom/squareup/picasso/Action;->request:Lcom/squareup/picasso/Request;
invoke-virtual {v0}, Lcom/squareup/picasso/Request;->logId()Ljava/lang/String;
move-result-object v0
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
.line 157
add-int/lit8 v0, v1, 0x1
move v1, v0
goto :goto_0
.line 162
:cond_3
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method static getResourceId(Landroid/content/res/Resources;Lcom/squareup/picasso/Request;)I
.locals 6
.prologue
const/4 v5, 0x1
const/4 v4, 0x0
.line 339
iget v0, p1, Lcom/squareup/picasso/Request;->resourceId:I
if-nez v0, :cond_0
iget-object v0, p1, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
if-nez v0, :cond_1
.line 340
:cond_0
iget v0, p1, Lcom/squareup/picasso/Request;->resourceId:I
.line 364
:goto_0
return v0
.line 343
:cond_1
iget-object v0, p1, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
invoke-virtual {v0}, Landroid/net/Uri;->getAuthority()Ljava/lang/String;
move-result-object v2
.line 344
if-nez v2, :cond_2
new-instance v0, Ljava/io/FileNotFoundException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "No package provided: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v2, p1, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V
throw v0
.line 347
:cond_2
iget-object v0, p1, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
invoke-virtual {v0}, Landroid/net/Uri;->getPathSegments()Ljava/util/List;
move-result-object v1
.line 348
if-eqz v1, :cond_3
invoke-interface {v1}, Ljava/util/List;->isEmpty()Z
move-result v0
if-eqz v0, :cond_4
.line 349
:cond_3
new-instance v0, Ljava/io/FileNotFoundException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "No path segments: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v2, p1, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V
throw v0
.line 350
:cond_4
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v0
if-ne v0, v5, :cond_5
.line 352
const/4 v0, 0x0
:try_start_0
invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
:try_end_0
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
move-result v0
goto :goto_0
.line 353
:catch_0
move-exception v0
.line 354
new-instance v0, Ljava/io/FileNotFoundException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Last path segment is not a resource ID: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v2, p1, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V
throw v0
.line 356
:cond_5
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v0
const/4 v3, 0x2
if-ne v0, v3, :cond_6
.line 357
invoke-interface {v1, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
.line 358
invoke-interface {v1, v5}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v1
check-cast v1, Ljava/lang/String;
.line 360
invoke-virtual {p0, v1, v0, v2}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0
goto/16 :goto_0
.line 362
:cond_6
new-instance v0, Ljava/io/FileNotFoundException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "More than two path segments: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v2, p1, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method static getResources(Landroid/content/Context;Lcom/squareup/picasso/Request;)Landroid/content/res/Resources;
.locals 3
.prologue
.line 368
iget v0, p1, Lcom/squareup/picasso/Request;->resourceId:I
if-nez v0, :cond_0
iget-object v0, p1, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
if-nez v0, :cond_1
.line 369
:cond_0
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
.line 376
:goto_0
return-object v0
.line 372
:cond_1
iget-object v0, p1, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
invoke-virtual {v0}, Landroid/net/Uri;->getAuthority()Ljava/lang/String;
move-result-object v0
.line 373
if-nez v0, :cond_2
new-instance v0, Ljava/io/FileNotFoundException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "No package provided: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v2, p1, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V
throw v0
.line 375
:cond_2
:try_start_0
invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v1
.line 376
invoke-virtual {v1, v0}, Landroid/content/pm/PackageManager;->getResourcesForApplication(Ljava/lang/String;)Landroid/content/res/Resources;
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v0
goto :goto_0
.line 377
:catch_0
move-exception v0
.line 378
new-instance v0, Ljava/io/FileNotFoundException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Unable to obtain resources for package: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v2, p1, Lcom/squareup/picasso/Request;->uri:Landroid/net/Uri;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method static getService(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/Object;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Landroid/content/Context;",
"Ljava/lang/String;",
")TT;"
}
.end annotation
.prologue
.line 305
invoke-virtual {p0, p1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
return-object v0
.end method
.method static hasPermission(Landroid/content/Context;Ljava/lang/String;)Z
.locals 1
.prologue
.line 309
invoke-virtual {p0, p1}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I
move-result v0
if-nez v0, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method static isAirplaneModeOn(Landroid/content/Context;)Z
.locals 4
.prologue
const/4 v0, 0x0
.line 293
invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
.line 295
:try_start_0
const-string v2, "airplane_mode_on"
const/4 v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
:try_end_0
.catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_0
move-result v1
if-eqz v1, :cond_0
const/4 v0, 0x1
.line 299
:cond_0
:goto_0
return v0
.line 296
:catch_0
move-exception v1
goto :goto_0
.end method
.method static isMain()Z
.locals 2
.prologue
.line 142
invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;
move-result-object v0
invoke-virtual {v0}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;
move-result-object v0
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v1
if-ne v0, v1, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method static isWebPFile(Ljava/io/InputStream;)Z
.locals 7
.prologue
const/4 v6, 0x4
const/16 v3, 0xc
const/4 v0, 0x0
.line 328
new-array v1, v3, [B
.line 330
invoke-virtual {p0, v1, v0, v3}, Ljava/io/InputStream;->read([BII)I
move-result v2
if-ne v2, v3, :cond_0
.line 332
const-string v2, "RIFF"
new-instance v3, Ljava/lang/String;
const-string v4, "US-ASCII"
invoke-direct {v3, v1, v0, v6, v4}, Ljava/lang/String;-><init>([BIILjava/lang/String;)V
invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_0
const-string v2, "WEBP"
new-instance v3, Ljava/lang/String;
const/16 v4, 0x8
const-string v5, "US-ASCII"
invoke-direct {v3, v1, v4, v6, v5}, Ljava/lang/String;-><init>([BIILjava/lang/String;)V
.line 333
invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
const/4 v0, 0x1
.line 335
:cond_0
return v0
.end method
.method static isWebPFile([B)Z
.locals 6
.prologue
const/4 v5, 0x4
const/4 v0, 0x0
.line 323
const-string v1, "RIFF"
new-instance v2, Ljava/lang/String;
const-string v3, "US-ASCII"
invoke-direct {v2, p0, v0, v5, v3}, Ljava/lang/String;-><init>([BIILjava/lang/String;)V
invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
const-string v1, "WEBP"
new-instance v2, Ljava/lang/String;
const/16 v3, 0x8
const-string v4, "US-ASCII"
invoke-direct {v2, p0, v3, v5, v4}, Ljava/lang/String;-><init>([BIILjava/lang/String;)V
.line 324
invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
const/4 v0, 0x1
.line 323
:cond_0
return v0
.end method
.method static log(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
.locals 1
.prologue
.line 166
const-string v0, ""
invoke-static {p0, p1, p2, v0}, Lcom/squareup/picasso/Utils;->log(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
.line 167
return-void
.end method
.method static log(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
.locals 4
.prologue
.line 170
const-string v0, "Picasso"
const-string v1, "%1$-11s %2$-12s %3$s %4$s"
const/4 v2, 0x4
new-array v2, v2, [Ljava/lang/Object;
const/4 v3, 0x0
aput-object p0, v2, v3
const/4 v3, 0x1
aput-object p1, v2, v3
const/4 v3, 0x2
aput-object p2, v2, v3
const/4 v3, 0x3
aput-object p3, v2, v3
invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 171
return-void
.end method
.method static parseResponseSourceHeader(Ljava/lang/String;)Z
.locals 5
.prologue
const/4 v0, 0x1
const/4 v1, 0x0
.line 231
if-nez p0, :cond_1
.line 244
:cond_0
:goto_0
return v1
.line 234
:cond_1
const-string v2, " "
const/4 v3, 0x2
invoke-virtual {p0, v2, v3}, Ljava/lang/String;->split(Ljava/lang/String;I)[Ljava/lang/String;
move-result-object v2
.line 235
const-string v3, "CACHE"
aget-object v4, v2, v1
invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_2
move v1, v0
.line 236
goto :goto_0
.line 238
:cond_2
array-length v3, v2
if-eq v3, v0, :cond_0
.line 242
:try_start_0
const-string v3, "CONDITIONAL_CACHE"
const/4 v4, 0x0
aget-object v4, v2, v4
invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_3
const/4 v3, 0x1
aget-object v2, v2, v3
invoke-static {v2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
:try_end_0
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
move-result v2
const/16 v3, 0x130
if-ne v2, v3, :cond_3
:goto_1
move v1, v0
goto :goto_0
:cond_3
move v0, v1
goto :goto_1
.line 243
:catch_0
move-exception v0
goto :goto_0
.end method
.method static toByteArray(Ljava/io/InputStream;)[B
.locals 4
.prologue
.line 313
new-instance v0, Ljava/io/ByteArrayOutputStream;
invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V
.line 314
const/16 v1, 0x1000
new-array v1, v1, [B
.line 316
:goto_0
const/4 v2, -0x1
invoke-virtual {p0, v1}, Ljava/io/InputStream;->read([B)I
move-result v3
if-eq v2, v3, :cond_0
.line 317
const/4 v2, 0x0
invoke-virtual {v0, v1, v2, v3}, Ljava/io/ByteArrayOutputStream;->write([BII)V
goto :goto_0
.line 319
:cond_0
invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
move-result-object v0
return-object v0
.end method