ii.smali

.class public abstract Lcom/google/obf/ii;
.super Ljava/lang/Object;
.source "IMASDK"

# interfaces
.implements Lcom/google/obf/ih;


# instance fields
.field protected a:Landroid/view/MotionEvent;

.field protected b:Landroid/util/DisplayMetrics;

.field protected c:Lcom/google/obf/in;

.field private d:Lcom/google/obf/io;


# direct methods
.method protected constructor <init>(Landroid/content/Context;Lcom/google/obf/in;Lcom/google/obf/io;)V
    .registers 4

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    iput-object p2, p0, Lcom/google/obf/ii;->c:Lcom/google/obf/in;

    .line 3
    iput-object p3, p0, Lcom/google/obf/ii;->d:Lcom/google/obf/io;

    .line 4
    :try_start_7
    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object p1

    iput-object p1, p0, Lcom/google/obf/ii;->b:Landroid/util/DisplayMetrics;
    :try_end_11
    .catch Ljava/lang/UnsupportedOperationException; {:try_start_7 .. :try_end_11} :catch_12

    goto :goto_1d

    .line 7
    :catch_12
    new-instance p1, Landroid/util/DisplayMetrics;

    invoke-direct {p1}, Landroid/util/DisplayMetrics;-><init>()V

    iput-object p1, p0, Lcom/google/obf/ii;->b:Landroid/util/DisplayMetrics;

    const/high16 p2, 0x3f800000    # 1.0f

    .line 8
    iput p2, p1, Landroid/util/DisplayMetrics;->density:F

    :goto_1d
    return-void
.end method

.method private a(Landroid/content/Context;Ljava/lang/String;Z)Ljava/lang/String;
    .registers 5

    const/4 v0, 0x7

    .line 12
    :try_start_1
    monitor-enter p0
    :try_end_2
    .catch Ljava/security/NoSuchAlgorithmException; {:try_start_1 .. :try_end_2} :catch_2f
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_1 .. :try_end_2} :catch_2a
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_2} :catch_24

    .line 13
    :try_start_2
    invoke-direct {p0}, Lcom/google/obf/ii;->a()V

    if-eqz p3, :cond_b

    .line 15
    invoke-virtual {p0, p1}, Lcom/google/obf/ii;->c(Landroid/content/Context;)V

    goto :goto_e

    .line 16
    :cond_b
    invoke-virtual {p0, p1}, Lcom/google/obf/ii;->b(Landroid/content/Context;)V

    .line 17
    :goto_e
    invoke-direct {p0}, Lcom/google/obf/ii;->b()[B

    move-result-object p1

    .line 18
    monitor-exit p0
    :try_end_13
    .catchall {:try_start_2 .. :try_end_13} :catchall_21

    .line 19
    :try_start_13
    array-length p3, p1

    if-nez p3, :cond_1c

    const/4 p1, 0x5

    .line 20
    invoke-static {p1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object p1

    goto :goto_33

    .line 21
    :cond_1c
    invoke-virtual {p0, p1, p2}, Lcom/google/obf/ii;->a([BLjava/lang/String;)Ljava/lang/String;

    move-result-object p1
    :try_end_20
    .catch Ljava/security/NoSuchAlgorithmException; {:try_start_13 .. :try_end_20} :catch_2f
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_13 .. :try_end_20} :catch_2a
    .catch Ljava/io/IOException; {:try_start_13 .. :try_end_20} :catch_24

    goto :goto_33

    :catchall_21
    move-exception p1

    .line 18
    :try_start_22
    monitor-exit p0
    :try_end_23
    .catchall {:try_start_22 .. :try_end_23} :catchall_21

    :try_start_23
    throw p1
    :try_end_24
    .catch Ljava/security/NoSuchAlgorithmException; {:try_start_23 .. :try_end_24} :catch_2f
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_23 .. :try_end_24} :catch_2a
    .catch Ljava/io/IOException; {:try_start_23 .. :try_end_24} :catch_24

    :catch_24
    const/4 p1, 0x3

    .line 30
    invoke-static {p1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object p1

    goto :goto_33

    .line 27
    :catch_2a
    invoke-static {v0}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object p1

    goto :goto_33

    .line 24
    :catch_2f
    invoke-static {v0}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object p1

    :goto_33
    return-object p1
.end method

.method private a()V
    .registers 2

    .line 36
    iget-object v0, p0, Lcom/google/obf/ii;->d:Lcom/google/obf/io;

    invoke-interface {v0}, Lcom/google/obf/io;->a()V

    return-void
.end method

.method private b()[B
    .registers 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 38
    iget-object v0, p0, Lcom/google/obf/ii;->d:Lcom/google/obf/io;

    invoke-interface {v0}, Lcom/google/obf/io;->b()[B

    move-result-object v0

    return-object v0
.end method


# virtual methods
.method public a(Landroid/content/Context;)Ljava/lang/String;
    .registers 4

    const/4 v0, 0x0

    const/4 v1, 0x0

    .line 10
    invoke-direct {p0, p1, v0, v1}, Lcom/google/obf/ii;->a(Landroid/content/Context;Ljava/lang/String;Z)Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method

.method public a(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;
    .registers 4

    const/4 v0, 0x1

    .line 11
    invoke-direct {p0, p1, p2, v0}, Lcom/google/obf/ii;->a(Landroid/content/Context;Ljava/lang/String;Z)Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method

.method protected a(Ljava/lang/String;)Ljava/lang/String;
    .registers 6

    if-eqz p1, :cond_2b

    const-string v0, "^[a-fA-F0-9]{8}-([a-fA-F0-9]{4}-){3}[a-fA-F0-9]{12}$"

    .line 73
    invoke-virtual {p1, v0}, Ljava/lang/String;->matches(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_2b

    .line 74
    invoke-static {p1}, Ljava/util/UUID;->fromString(Ljava/lang/String;)Ljava/util/UUID;

    move-result-object p1

    const/16 v0, 0x10

    new-array v0, v0, [B

    .line 76
    invoke-static {v0}, Ljava/nio/ByteBuffer;->wrap([B)Ljava/nio/ByteBuffer;

    move-result-object v1

    .line 77
    invoke-virtual {p1}, Ljava/util/UUID;->getMostSignificantBits()J

    move-result-wide v2

    invoke-virtual {v1, v2, v3}, Ljava/nio/ByteBuffer;->putLong(J)Ljava/nio/ByteBuffer;

    .line 78
    invoke-virtual {p1}, Ljava/util/UUID;->getLeastSignificantBits()J

    move-result-wide v2

    invoke-virtual {v1, v2, v3}, Ljava/nio/ByteBuffer;->putLong(J)Ljava/nio/ByteBuffer;

    .line 79
    iget-object p1, p0, Lcom/google/obf/ii;->c:Lcom/google/obf/in;

    const/4 v1, 0x1

    invoke-interface {p1, v0, v1}, Lcom/google/obf/in;->a([BZ)Ljava/lang/String;

    move-result-object p1

    :cond_2b
    return-object p1
.end method

.method a([BLjava/lang/String;)Ljava/lang/String;
    .registers 7
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/security/NoSuchAlgorithmException;,
            Ljava/io/UnsupportedEncodingException;,
            Ljava/io/IOException;
        }
    .end annotation

    .line 39
    array-length v0, p1

    const/16 v1, 0xef

    if-le v0, v1, :cond_13

    .line 40
    invoke-direct {p0}, Lcom/google/obf/ii;->a()V

    const/16 p1, 0x14

    const-wide/16 v2, 0x1

    .line 41
    invoke-virtual {p0, p1, v2, v3}, Lcom/google/obf/ii;->a(IJ)V

    .line 42
    invoke-direct {p0}, Lcom/google/obf/ii;->b()[B

    move-result-object p1

    .line 43
    :cond_13
    array-length v0, p1

    const/16 v2, 0xf0

    if-ge v0, v1, :cond_3b

    .line 44
    array-length v0, p1

    sub-int/2addr v1, v0

    new-array v0, v1, [B

    .line 45
    new-instance v1, Ljava/security/SecureRandom;

    invoke-direct {v1}, Ljava/security/SecureRandom;-><init>()V

    invoke-virtual {v1, v0}, Ljava/security/SecureRandom;->nextBytes([B)V

    .line 46
    invoke-static {v2}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;

    move-result-object v1

    array-length v2, p1

    int-to-byte v2, v2

    .line 47
    invoke-virtual {v1, v2}, Ljava/nio/ByteBuffer;->put(B)Ljava/nio/ByteBuffer;

    move-result-object v1

    .line 48
    invoke-virtual {v1, p1}, Ljava/nio/ByteBuffer;->put([B)Ljava/nio/ByteBuffer;

    move-result-object p1

    .line 49
    invoke-virtual {p1, v0}, Ljava/nio/ByteBuffer;->put([B)Ljava/nio/ByteBuffer;

    move-result-object p1

    .line 50
    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->array()[B

    move-result-object p1

    goto :goto_4d

    .line 52
    :cond_3b
    invoke-static {v2}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;

    move-result-object v0

    array-length v1, p1

    int-to-byte v1, v1

    .line 53
    invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->put(B)Ljava/nio/ByteBuffer;

    move-result-object v0

    .line 54
    invoke-virtual {v0, p1}, Ljava/nio/ByteBuffer;->put([B)Ljava/nio/ByteBuffer;

    move-result-object p1

    .line 55
    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->array()[B

    move-result-object p1

    :goto_4d
    const-string v0, "MD5"

    .line 56
    invoke-static {v0}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/String;)Ljava/security/MessageDigest;

    move-result-object v0

    .line 57
    invoke-virtual {v0, p1}, Ljava/security/MessageDigest;->update([B)V

    .line 58
    invoke-virtual {v0}, Ljava/security/MessageDigest;->digest()[B

    move-result-object v0

    const/16 v1, 0x100

    .line 59
    invoke-static {v1}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;

    move-result-object v2

    .line 60
    invoke-virtual {v2, v0}, Ljava/nio/ByteBuffer;->put([B)Ljava/nio/ByteBuffer;

    move-result-object v0

    .line 61
    invoke-virtual {v0, p1}, Ljava/nio/ByteBuffer;->put([B)Ljava/nio/ByteBuffer;

    move-result-object p1

    .line 62
    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->array()[B

    move-result-object p1

    new-array v0, v1, [B

    .line 64
    new-instance v1, Lcom/google/obf/ig;

    invoke-direct {v1}, Lcom/google/obf/ig;-><init>()V

    invoke-virtual {v1, p1, v0}, Lcom/google/obf/ig;->a([B[B)V

    if-eqz p2, :cond_81

    .line 65
    invoke-virtual {p2}, Ljava/lang/String;->length()I

    move-result p1

    if-lez p1, :cond_81

    .line 66
    invoke-virtual {p0, p2, v0}, Lcom/google/obf/ii;->a(Ljava/lang/String;[B)V

    .line 67
    :cond_81
    iget-object p1, p0, Lcom/google/obf/ii;->c:Lcom/google/obf/in;

    const/4 p2, 0x1

    invoke-interface {p1, v0, p2}, Lcom/google/obf/in;->a([BZ)Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method

.method protected a(IJ)V
    .registers 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 32
    iget-object v0, p0, Lcom/google/obf/ii;->d:Lcom/google/obf/io;

    invoke-interface {v0, p1, p2, p3}, Lcom/google/obf/io;->a(IJ)V

    return-void
.end method

.method protected a(ILjava/lang/String;)V
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 34
    iget-object v0, p0, Lcom/google/obf/ii;->d:Lcom/google/obf/io;

    invoke-interface {v0, p1, p2}, Lcom/google/obf/io;->a(ILjava/lang/String;)V

    return-void
.end method

.method a(Ljava/lang/String;[B)V
    .registers 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/UnsupportedEncodingException;
        }
    .end annotation

    .line 68
    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v0

    const/16 v1, 0x20

    if-le v0, v1, :cond_d

    const/4 v0, 0x0

    .line 69
    invoke-virtual {p1, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p1

    :cond_d
    const-string v0, "UTF-8"

    .line 70
    invoke-virtual {p1, v0}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object p1

    .line 71
    new-instance v0, Lcom/google/obf/jz;

    invoke-direct {v0, p1}, Lcom/google/obf/jz;-><init>([B)V

    invoke-virtual {v0, p2}, Lcom/google/obf/jz;->a([B)V

    return-void
.end method

.method protected abstract b(Landroid/content/Context;)V
.end method

.method protected abstract c(Landroid/content/Context;)V
.end method