CheckEmulator.smali
.class public Lcom/aliyun/security/yunceng/android/sdk/umid/CheckEmulator;
.super Ljava/lang/Object;
.source "SourceFile"
# direct methods
.method static constructor <clinit>()V
.registers 1
.line 85
const-string/jumbo v0, "yunceng"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
.line 86
return-void
.end method
.method public constructor <init>()V
.registers 1
.line 7
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 8
return-void
.end method
.method private static a(Ljava/io/File;)[B
.registers 8
.param p0, "libFile" # Ljava/io/File;
.line 65
const/4 v0, 0x0
if-eqz p0, :cond_3c
invoke-virtual {p0}, Ljava/io/File;->exists()Z
move-result v1
if-eqz v1, :cond_3c
.line 67
:try_start_9
new-instance v1, Ljava/io/FileInputStream;
invoke-direct {v1, p0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
.line 68
.local v1, "in":Ljava/io/FileInputStream;
const/16 v2, 0x10
new-array v3, v2, [B
.line 69
.local v3, "bytes":[B
invoke-virtual {v1, v3}, Ljava/io/FileInputStream;->read([B)I
move-result v4
.line 70
.local v4, "count":I
invoke-virtual {v1}, Ljava/io/FileInputStream;->close()V
.line 71
const/4 v5, 0x0
aget-byte v5, v3, v5
const/16 v6, 0x7f
if-ne v5, v6, :cond_3a
const/4 v5, 0x1
aget-byte v5, v3, v5
const/16 v6, 0x45
if-ne v5, v6, :cond_3a
const/4 v5, 0x2
aget-byte v5, v3, v5
const/16 v6, 0x4c
if-ne v5, v6, :cond_3a
const/4 v5, 0x3
aget-byte v5, v3, v5
:try_end_31
.catch Ljava/lang/Exception; {:try_start_9 .. :try_end_31} :catch_3b
const/16 v6, 0x46
if-eq v5, v6, :cond_36
goto :goto_3a
.line 73
:cond_36
if-ne v4, v2, :cond_39
move-object v0, v3
:cond_39
return-object v0
.line 72
:cond_3a
:goto_3a
return-object v0
.line 74
.end local v1 # "in":Ljava/io/FileInputStream;
.end local v3 # "bytes":[B
.end local v4 # "count":I
:catch_3b
move-exception v1
.line 78
:cond_3c
return-object v0
.end method
.method private b()Z
.registers 7
.line 23
new-instance v0, Ljava/io/File;
const-string v1, "/proc/cpuinfo"
invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 24
.local v0, "cpuInfo":Ljava/io/File;
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v1
if-eqz v1, :cond_2d
.line 26
:try_start_d
new-instance v1, Ljava/io/FileInputStream;
invoke-direct {v1, v0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
.line 27
.local v1, "in":Ljava/io/FileInputStream;
const/16 v2, 0x200
new-array v2, v2, [B
.line 28
.local v2, "bytes":[B
invoke-virtual {v1, v2}, Ljava/io/FileInputStream;->read([B)I
move-result v3
.line 29
.local v3, "count":I
invoke-virtual {v1}, Ljava/io/FileInputStream;->close()V
.line 30
if-eqz v3, :cond_2b
.line 31
new-instance v4, Ljava/lang/String;
invoke-direct {v4, v2}, Ljava/lang/String;-><init>([B)V
const-string v5, "arch64"
invoke-virtual {v4, v5}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v4
:try_end_2a
.catch Ljava/lang/Exception; {:try_start_d .. :try_end_2a} :catch_2c
return v4
.line 34
.end local v1 # "in":Ljava/io/FileInputStream;
.end local v2 # "bytes":[B
.end local v3 # "count":I
:cond_2b
goto :goto_2d
.line 33
:catch_2c
move-exception v1
.line 36
:cond_2d
:goto_2d
const/4 v1, 0x0
return v1
.end method
.method private c()Z
.registers 11
.line 40
const-string v0, "/system/lib/libc.so"
.line 41
.local v0, "SYSTEM_LIB_C_PATH":Ljava/lang/String;
const-string v1, "/system/lib64/libc.so"
.line 42
.local v1, "SYSTEM_LIB_C_PATH_64":Ljava/lang/String;
const/4 v2, 0x2
.line 43
.local v2, "ELFCLASS64":I
const/4 v3, 0x4
.line 45
.local v3, "EI_CLASS":I
new-instance v4, Ljava/io/File;
const-string v5, "/system/lib/libc.so"
invoke-direct {v4, v5}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 46
.local v4, "libcFile":Ljava/io/File;
invoke-virtual {v4}, Ljava/io/File;->exists()Z
move-result v5
const/4 v6, 0x1
const/4 v7, 0x2
const/4 v8, 0x4
if-eqz v5, :cond_21
.line 47
invoke-static {v4}, Lcom/aliyun/security/yunceng/android/sdk/umid/CheckEmulator;->a(Ljava/io/File;)[B
move-result-object v5
.line 48
.local v5, "header":[B
if-eqz v5, :cond_21
aget-byte v9, v5, v8
if-ne v9, v7, :cond_21
.line 49
return v6
.line 53
.end local v5 # "header":[B
:cond_21
new-instance v5, Ljava/io/File;
const-string v9, "/system/lib64/libc.so"
invoke-direct {v5, v9}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 54
.local v5, "libcFile64":Ljava/io/File;
invoke-virtual {v5}, Ljava/io/File;->exists()Z
move-result v9
if-eqz v9, :cond_39
.line 55
invoke-static {v5}, Lcom/aliyun/security/yunceng/android/sdk/umid/CheckEmulator;->a(Ljava/io/File;)[B
move-result-object v9
.line 56
.local v9, "header":[B
if-eqz v9, :cond_39
aget-byte v8, v9, v8
if-ne v8, v7, :cond_39
.line 57
return v6
.line 61
.end local v9 # "header":[B
:cond_39
const/4 v6, 0x0
return v6
.end method
.method private native detect_cache_raw()I
.end method
# virtual methods
.method public a()I
.registers 3
.line 16
:try_start_0
invoke-direct {p0}, Lcom/aliyun/security/yunceng/android/sdk/umid/CheckEmulator;->detect_cache_raw()I
move-result v0
:try_end_4
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_4} :catch_5
return v0
.line 17
:catch_5
move-exception v0
.line 18
.local v0, "e":Ljava/lang/Exception;
const/16 v1, 0x3e8
return v1
.end method