251 lines
4.8 KiB
Smali
251 lines
4.8 KiB
Smali
.class public final Lcom/vk/common/g/ImageHelper;
|
|
.super Ljava/lang/Object;
|
|
.source "ImageHelper.kt"
|
|
|
|
|
|
# static fields
|
|
.field public static final a:Lcom/vk/common/g/ImageHelper;
|
|
|
|
.field private static final b:[Ljava/lang/String;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
.line 10
|
|
new-instance v0, Lcom/vk/common/g/ImageHelper;
|
|
|
|
invoke-direct {v0}, Lcom/vk/common/g/ImageHelper;-><init>()V
|
|
|
|
sput-object v0, Lcom/vk/common/g/ImageHelper;->a:Lcom/vk/common/g/ImageHelper;
|
|
|
|
const-string v0, "orientation"
|
|
|
|
.line 12
|
|
filled-new-array {v0}, [Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/vk/common/g/ImageHelper;->b:[Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 10
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final a(Landroid/content/Context;Landroid/net/Uri;)I
|
|
.locals 10
|
|
|
|
const-string v0, "context"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->b(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "imageFileUri"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->b(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
.line 16
|
|
invoke-virtual {p2}, Landroid/net/Uri;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "imageFileUri.toString()"
|
|
|
|
invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v1, "content:"
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x2
|
|
|
|
invoke-static {v0, v1, v3, v4, v2}, Lkotlin/text/f;->b(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 18
|
|
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
|
|
|
move-result-object v4
|
|
|
|
sget-object v6, Lcom/vk/common/g/ImageHelper;->b:[Ljava/lang/String;
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
move-object v5, p2
|
|
|
|
invoke-virtual/range {v4 .. v9}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Ljava/io/Closeable;
|
|
|
|
check-cast v2, Ljava/lang/Throwable;
|
|
|
|
:try_start_0
|
|
move-object v1, p1
|
|
|
|
check-cast v1, Landroid/database/Cursor;
|
|
|
|
.line 19
|
|
invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
.line 20
|
|
invoke-interface {v1, v3}, Landroid/database/Cursor;->getInt(I)I
|
|
|
|
move-result v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
.line 22
|
|
:goto_0
|
|
sget-object v4, Lkotlin/Unit;->a:Lkotlin/Unit;
|
|
:try_end_0
|
|
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 18
|
|
invoke-static {p1, v2}, Lkotlin/io/Closeable;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
|
|
goto :goto_2
|
|
|
|
:catchall_0
|
|
move-exception p2
|
|
|
|
goto :goto_1
|
|
|
|
:catch_0
|
|
move-exception p2
|
|
|
|
move-object v2, p2
|
|
|
|
:try_start_1
|
|
throw v2
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
:goto_1
|
|
invoke-static {p1, v2}, Lkotlin/io/Closeable;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
|
|
throw p2
|
|
|
|
:cond_1
|
|
const/4 v1, 0x0
|
|
|
|
:goto_2
|
|
if-eqz v0, :cond_2
|
|
|
|
if-nez v1, :cond_8
|
|
|
|
.line 25
|
|
:cond_2
|
|
sget-object p1, Lcom/vk/core/util/AppContextHolder;->a:Landroid/content/Context;
|
|
|
|
invoke-static {p1, p2}, Lcom/vk/core/f/FilePathUtils;->a(Landroid/content/Context;Landroid/net/Uri;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
.line 26
|
|
move-object p2, p1
|
|
|
|
check-cast p2, Ljava/lang/CharSequence;
|
|
|
|
if-eqz p2, :cond_4
|
|
|
|
invoke-interface {p2}, Ljava/lang/CharSequence;->length()I
|
|
|
|
move-result p2
|
|
|
|
if-nez p2, :cond_3
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
const/4 p2, 0x0
|
|
|
|
goto :goto_4
|
|
|
|
:cond_4
|
|
:goto_3
|
|
const/4 p2, 0x1
|
|
|
|
:goto_4
|
|
if-nez p2, :cond_8
|
|
|
|
.line 27
|
|
new-instance p2, Landroid/media/ExifInterface;
|
|
|
|
invoke-direct {p2, p1}, Landroid/media/ExifInterface;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string p1, "Orientation"
|
|
|
|
.line 28
|
|
invoke-virtual {p2, p1, v3}, Landroid/media/ExifInterface;->getAttributeInt(Ljava/lang/String;I)I
|
|
|
|
move-result p1
|
|
|
|
const/4 p2, 0x3
|
|
|
|
if-eq p1, p2, :cond_7
|
|
|
|
const/4 p2, 0x6
|
|
|
|
if-eq p1, p2, :cond_6
|
|
|
|
const/16 p2, 0x8
|
|
|
|
if-eq p1, p2, :cond_5
|
|
|
|
const/4 v1, 0x0
|
|
|
|
goto :goto_5
|
|
|
|
:cond_5
|
|
const/16 v3, 0x10e
|
|
|
|
const/16 v1, 0x10e
|
|
|
|
goto :goto_5
|
|
|
|
:cond_6
|
|
const/16 v3, 0x5a
|
|
|
|
const/16 v1, 0x5a
|
|
|
|
goto :goto_5
|
|
|
|
:cond_7
|
|
const/16 v3, 0xb4
|
|
|
|
const/16 v1, 0xb4
|
|
|
|
:cond_8
|
|
:goto_5
|
|
return v1
|
|
.end method
|