EmulateSdCardUtils.smali

.class public Lcom/cleanmaster/junk/util/EmulateSdCardUtils;
.super Ljava/lang/Object;
.source "EmulateSdCardUtils.java"


# static fields
.field public static s_bSdcardDataSame:Z


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 14
    invoke-static {}, Lcom/cleanmaster/junk/util/EmulateSdCardUtils;->IsSdCardDataSamePart()Z

    move-result v0

    sput-boolean v0, Lcom/cleanmaster/junk/util/EmulateSdCardUtils;->s_bSdcardDataSame:Z

    return-void
.end method

.method public constructor <init>()V
    .registers 1

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

    return-void
.end method

.method private static CheckSdcardDataPartSame2()Z
    .registers 8

    .prologue
    const/4 v0, 0x1

    const/4 v3, 0x0

    .line 51
    new-instance v4, Ljava/io/File;

    const-string v1, "/proc/self/mounts"

    invoke-direct {v4, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 53
    invoke-virtual {v4}, Ljava/io/File;->exists()Z

    move-result v1

    if-eqz v1, :cond_5e

    invoke-virtual {v4}, Ljava/io/File;->isDirectory()Z

    move-result v1

    if-nez v1, :cond_5e

    .line 54
    const/4 v2, 0x0

    .line 56
    :try_start_16
    new-instance v1, Ljava/io/BufferedReader;

    new-instance v5, Ljava/io/InputStreamReader;

    new-instance v6, Ljava/io/FileInputStream;

    invoke-direct {v6, v4}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    invoke-direct {v5, v6}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;)V

    invoke-direct {v1, v5}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
    :try_end_25
    .catch Ljava/lang/Exception; {:try_start_16 .. :try_end_25} :catch_81
    .catchall {:try_start_16 .. :try_end_25} :catchall_8e

    .line 58
    :cond_25
    :try_start_25
    invoke-virtual {v1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    move-result-object v2

    .line 59
    if-eqz v2, :cond_59

    .line 60
    const-string v4, " "

    invoke-virtual {v2, v4}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v2

    .line 61
    if-eqz v2, :cond_25

    array-length v4, v2

    const/4 v5, 0x3

    if-le v4, v5, :cond_25

    .line 62
    const/4 v4, 0x1

    aget-object v4, v2, v4

    .line 63
    const/4 v5, 0x2

    aget-object v5, v2, v5

    .line 65
    const-string v6, "ext"

    invoke-virtual {v5, v6}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_5f

    .line 66
    const-string v6, "/storage_int"

    invoke-virtual {v4, v6}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_5f

    .line 67
    const/4 v6, 0x0

    aget-object v6, v2, v6

    const-string v7, "/dev/block"

    invoke-virtual {v6, v7}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
    :try_end_55
    .catch Ljava/lang/Exception; {:try_start_25 .. :try_end_55} :catch_9d
    .catchall {:try_start_25 .. :try_end_55} :catchall_9b

    move-result v6

    if-eqz v6, :cond_5f

    move v0, v3

    .line 92
    :cond_59
    :goto_59
    if-eqz v1, :cond_5e

    .line 94
    :try_start_5b
    invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
    :try_end_5e
    .catch Ljava/lang/Exception; {:try_start_5b .. :try_end_5e} :catch_7c

    .line 101
    :cond_5e
    :goto_5e
    return v0

    .line 74
    :cond_5f
    :try_start_5f
    const-string v6, "ext"

    invoke-virtual {v5, v6}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_25

    .line 75
    const-string v5, "/data/media"

    invoke-virtual {v4, v5}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_25

    .line 76
    const/4 v4, 0x0

    aget-object v2, v2, v4

    const-string v4, "/dev/block"

    invoke-virtual {v2, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
    :try_end_77
    .catch Ljava/lang/Exception; {:try_start_5f .. :try_end_77} :catch_9d
    .catchall {:try_start_5f .. :try_end_77} :catchall_9b

    move-result v2

    if-eqz v2, :cond_25

    move v0, v3

    .line 78
    goto :goto_59

    .line 95
    :catch_7c
    move-exception v1

    .line 96
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_5e

    .line 89
    :catch_81
    move-exception v1

    move-object v1, v2

    .line 92
    :goto_83
    if-eqz v1, :cond_5e

    .line 94
    :try_start_85
    invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
    :try_end_88
    .catch Ljava/lang/Exception; {:try_start_85 .. :try_end_88} :catch_89

    goto :goto_5e

    .line 95
    :catch_89
    move-exception v1

    .line 96
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_5e

    .line 92
    :catchall_8e
    move-exception v0

    move-object v1, v2

    :goto_90
    if-eqz v1, :cond_95

    .line 94
    :try_start_92
    invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
    :try_end_95
    .catch Ljava/lang/Exception; {:try_start_92 .. :try_end_95} :catch_96

    .line 97
    :cond_95
    :goto_95
    throw v0

    .line 95
    :catch_96
    move-exception v1

    .line 96
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_95

    .line 92
    :catchall_9b
    move-exception v0

    goto :goto_90

    .line 89
    :catch_9d
    move-exception v2

    goto :goto_83
.end method

.method private static IsSdCardDataSamePart()Z
    .registers 2
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "NewApi"
        }
    .end annotation

    .prologue
    .line 34
    const-string v0, "1"

    const-string v1, "ro.mtk_shared_sdcard"

    invoke-static {v1}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_10

    .line 35
    const/4 v0, 0x1

    .line 45
    :goto_f
    return v0

    .line 38
    :cond_10
    invoke-static {}, Lcom/cleanmaster/junk/util/EmulateSdCardUtils;->isExtStorageEmulated()Z

    move-result v0

    if-nez v0, :cond_18

    .line 39
    const/4 v0, 0x0

    goto :goto_f

    .line 42
    :cond_18
    invoke-static {}, Lcom/cleanmaster/junk/util/EmulateSdCardUtils;->CheckSdcardDataPartSame2()Z

    move-result v0

    goto :goto_f
.end method

.method public static isExtStorageEmulated()Z
    .registers 1
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "NewApi"
        }
    .end annotation

    .prologue
    .line 24
    :try_start_0
    invoke-static {}, Landroid/os/Environment;->isExternalStorageEmulated()Z
    :try_end_3
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_3} :catch_5

    move-result v0

    .line 28
    :goto_4
    return v0

    .line 25
    :catch_5
    move-exception v0

    .line 26
    invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V

    .line 28
    const/4 v0, 0x0

    goto :goto_4
.end method