604 lines
14 KiB
Smali
604 lines
14 KiB
Smali
.class public Lcom/moji/mjweather/weather/avatar/AvatarRectManager;
|
|
.super Ljava/lang/Object;
|
|
.source "AvatarRectManager.java"
|
|
|
|
|
|
# instance fields
|
|
.field private a:Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;
|
|
|
|
|
|
# direct methods
|
|
.method constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
.line 17
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 18
|
|
new-instance v0, Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;
|
|
|
|
invoke-direct {v0, p1}, Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;-><init>(Landroid/content/Context;)V
|
|
|
|
iput-object v0, p0, Lcom/moji/mjweather/weather/avatar/AvatarRectManager;->a:Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method a(Ljava/lang/String;)Lcom/moji/mjweather/weather/avatar/AdRect;
|
|
.locals 11
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 61
|
|
:try_start_0
|
|
iget-object v1, p0, Lcom/moji/mjweather/weather/avatar/AvatarRectManager;->a:Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;
|
|
|
|
invoke-virtual {v1}, Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;
|
|
|
|
move-result-object v1
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_4
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
:try_start_1
|
|
const-string v3, "AVATAR_RECT"
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const-string v5, "md5=?"
|
|
|
|
const/4 v2, 0x1
|
|
|
|
.line 62
|
|
new-array v6, v2, [Ljava/lang/String;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object p1, v6, v2
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
move-object v2, v1
|
|
|
|
invoke-virtual/range {v2 .. v9}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
|
|
|
|
move-result-object p1
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_3
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
.line 63
|
|
:try_start_2
|
|
invoke-interface {p1}, Landroid/database/Cursor;->moveToFirst()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
.line 64
|
|
new-instance v2, Lcom/moji/mjweather/weather/avatar/AdRect;
|
|
|
|
invoke-direct {v2}, Lcom/moji/mjweather/weather/avatar/AdRect;-><init>()V
|
|
:try_end_2
|
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_2
|
|
|
|
:try_start_3
|
|
const-string v0, "left"
|
|
|
|
.line 65
|
|
invoke-interface {p1, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
|
|
|
move-result v0
|
|
|
|
invoke-interface {p1, v0}, Landroid/database/Cursor;->getInt(I)I
|
|
|
|
move-result v0
|
|
|
|
iput v0, v2, Lcom/moji/mjweather/weather/avatar/AdRect;->left:I
|
|
|
|
const-string v0, "right"
|
|
|
|
.line 66
|
|
invoke-interface {p1, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
|
|
|
move-result v0
|
|
|
|
invoke-interface {p1, v0}, Landroid/database/Cursor;->getInt(I)I
|
|
|
|
move-result v0
|
|
|
|
iput v0, v2, Lcom/moji/mjweather/weather/avatar/AdRect;->right:I
|
|
|
|
const-string v0, "top"
|
|
|
|
.line 67
|
|
invoke-interface {p1, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
|
|
|
move-result v0
|
|
|
|
invoke-interface {p1, v0}, Landroid/database/Cursor;->getInt(I)I
|
|
|
|
move-result v0
|
|
|
|
iput v0, v2, Lcom/moji/mjweather/weather/avatar/AdRect;->top:I
|
|
|
|
const-string v0, "bottom"
|
|
|
|
.line 68
|
|
invoke-interface {p1, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
|
|
|
move-result v0
|
|
|
|
invoke-interface {p1, v0}, Landroid/database/Cursor;->getInt(I)I
|
|
|
|
move-result v0
|
|
|
|
iput v0, v2, Lcom/moji/mjweather/weather/avatar/AdRect;->bottom:I
|
|
:try_end_3
|
|
.catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_0
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_2
|
|
|
|
move-object v0, v2
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
goto :goto_4
|
|
|
|
:cond_0
|
|
:goto_0
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 75
|
|
:try_start_4
|
|
invoke-interface {p1}, Landroid/database/Cursor;->close()V
|
|
|
|
goto :goto_1
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
:goto_1
|
|
if-eqz v1, :cond_2
|
|
|
|
.line 78
|
|
invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->close()V
|
|
|
|
.line 80
|
|
:cond_2
|
|
iget-object p1, p0, Lcom/moji/mjweather/weather/avatar/AvatarRectManager;->a:Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;
|
|
|
|
invoke-virtual {p1}, Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;->close()V
|
|
:try_end_4
|
|
.catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_1
|
|
|
|
goto :goto_8
|
|
|
|
:goto_2
|
|
const-string v1, "AvatarRectManager"
|
|
|
|
.line 82
|
|
invoke-static {v1, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
goto :goto_8
|
|
|
|
:catch_2
|
|
move-exception v2
|
|
|
|
move-object v10, v2
|
|
|
|
move-object v2, v0
|
|
|
|
move-object v0, v10
|
|
|
|
goto :goto_4
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
move-object v10, v0
|
|
|
|
move-object v0, p1
|
|
|
|
move-object p1, v10
|
|
|
|
goto :goto_9
|
|
|
|
:catch_3
|
|
move-exception p1
|
|
|
|
move-object v2, v0
|
|
|
|
goto :goto_3
|
|
|
|
:catchall_1
|
|
move-exception p1
|
|
|
|
move-object v1, v0
|
|
|
|
move-object v0, p1
|
|
|
|
move-object p1, v1
|
|
|
|
goto :goto_9
|
|
|
|
:catch_4
|
|
move-exception p1
|
|
|
|
move-object v1, v0
|
|
|
|
move-object v2, v1
|
|
|
|
:goto_3
|
|
move-object v0, p1
|
|
|
|
move-object p1, v2
|
|
|
|
:goto_4
|
|
:try_start_5
|
|
const-string v3, "AvatarRectManager"
|
|
|
|
.line 71
|
|
invoke-static {v3, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
:try_end_5
|
|
.catchall {:try_start_5 .. :try_end_5} :catchall_2
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
.line 75
|
|
:try_start_6
|
|
invoke-interface {p1}, Landroid/database/Cursor;->close()V
|
|
|
|
goto :goto_5
|
|
|
|
:catch_5
|
|
move-exception p1
|
|
|
|
goto :goto_6
|
|
|
|
:cond_3
|
|
:goto_5
|
|
if-eqz v1, :cond_4
|
|
|
|
.line 78
|
|
invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->close()V
|
|
|
|
.line 80
|
|
:cond_4
|
|
iget-object p1, p0, Lcom/moji/mjweather/weather/avatar/AvatarRectManager;->a:Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;
|
|
|
|
invoke-virtual {p1}, Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;->close()V
|
|
:try_end_6
|
|
.catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_5
|
|
|
|
goto :goto_7
|
|
|
|
:goto_6
|
|
const-string v0, "AvatarRectManager"
|
|
|
|
.line 82
|
|
invoke-static {v0, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
:goto_7
|
|
move-object v0, v2
|
|
|
|
:goto_8
|
|
return-object v0
|
|
|
|
:catchall_2
|
|
move-exception v0
|
|
|
|
:goto_9
|
|
if-eqz p1, :cond_5
|
|
|
|
.line 75
|
|
:try_start_7
|
|
invoke-interface {p1}, Landroid/database/Cursor;->close()V
|
|
|
|
goto :goto_a
|
|
|
|
:catch_6
|
|
move-exception p1
|
|
|
|
goto :goto_b
|
|
|
|
:cond_5
|
|
:goto_a
|
|
if-eqz v1, :cond_6
|
|
|
|
.line 78
|
|
invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->close()V
|
|
|
|
.line 80
|
|
:cond_6
|
|
iget-object p1, p0, Lcom/moji/mjweather/weather/avatar/AvatarRectManager;->a:Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;
|
|
|
|
invoke-virtual {p1}, Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;->close()V
|
|
:try_end_7
|
|
.catch Ljava/lang/Exception; {:try_start_7 .. :try_end_7} :catch_6
|
|
|
|
goto :goto_c
|
|
|
|
:goto_b
|
|
const-string v1, "AvatarRectManager"
|
|
|
|
.line 82
|
|
invoke-static {v1, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
.line 84
|
|
:goto_c
|
|
throw v0
|
|
.end method
|
|
|
|
.method a(Ljava/lang/String;Lcom/moji/mjweather/weather/avatar/AdRect;)Z
|
|
.locals 7
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p2, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
.line 26
|
|
:try_start_0
|
|
iget-object v2, p0, Lcom/moji/mjweather/weather/avatar/AvatarRectManager;->a:Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;
|
|
|
|
invoke-virtual {v2}, Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;
|
|
|
|
move-result-object v2
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
.line 27
|
|
:try_start_1
|
|
new-instance v3, Landroid/content/ContentValues;
|
|
|
|
invoke-direct {v3}, Landroid/content/ContentValues;-><init>()V
|
|
|
|
const-string v4, "md5"
|
|
|
|
.line 28
|
|
invoke-virtual {v3, v4, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const-string v4, "left"
|
|
|
|
.line 29
|
|
iget v5, p2, Lcom/moji/mjweather/weather/avatar/AdRect;->left:I
|
|
|
|
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v3, v4, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V
|
|
|
|
const-string v4, "top"
|
|
|
|
.line 30
|
|
iget v5, p2, Lcom/moji/mjweather/weather/avatar/AdRect;->top:I
|
|
|
|
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v3, v4, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V
|
|
|
|
const-string v4, "right"
|
|
|
|
.line 31
|
|
iget v5, p2, Lcom/moji/mjweather/weather/avatar/AdRect;->right:I
|
|
|
|
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v3, v4, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V
|
|
|
|
const-string v4, "bottom"
|
|
|
|
.line 32
|
|
iget p2, p2, Lcom/moji/mjweather/weather/avatar/AdRect;->bottom:I
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {v3, v4, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V
|
|
|
|
const-string p2, "AVATAR_RECT"
|
|
|
|
const-string v4, "md5=?"
|
|
|
|
const/4 v5, 0x1
|
|
|
|
.line 33
|
|
new-array v6, v5, [Ljava/lang/String;
|
|
|
|
aput-object p1, v6, v0
|
|
|
|
invoke-virtual {v2, p2, v3, v4, v6}, Landroid/database/sqlite/SQLiteDatabase;->update(Ljava/lang/String;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
const-string p1, "AVATAR_RECT"
|
|
|
|
.line 36
|
|
invoke-virtual {v2, p1, v1, v3}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J
|
|
|
|
move-result-wide p1
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
long-to-int p1, p1
|
|
|
|
:cond_1
|
|
if-eqz p1, :cond_3
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
.line 46
|
|
:try_start_2
|
|
invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->close()V
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
goto :goto_1
|
|
|
|
.line 48
|
|
:cond_2
|
|
:goto_0
|
|
iget-object p1, p0, Lcom/moji/mjweather/weather/avatar/AvatarRectManager;->a:Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;
|
|
|
|
invoke-virtual {p1}, Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;->close()V
|
|
:try_end_2
|
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
|
|
|
|
goto :goto_2
|
|
|
|
:goto_1
|
|
const-string p2, "AvatarRectManager"
|
|
|
|
.line 50
|
|
invoke-static {p2, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
:goto_2
|
|
return v5
|
|
|
|
:cond_3
|
|
if-eqz v2, :cond_4
|
|
|
|
.line 46
|
|
:try_start_3
|
|
invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->close()V
|
|
|
|
.line 48
|
|
:cond_4
|
|
iget-object p1, p0, Lcom/moji/mjweather/weather/avatar/AvatarRectManager;->a:Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;
|
|
|
|
invoke-virtual {p1}, Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;->close()V
|
|
:try_end_3
|
|
.catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_3
|
|
|
|
goto :goto_6
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_7
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
move-object v1, v2
|
|
|
|
goto :goto_3
|
|
|
|
:catchall_1
|
|
move-exception p1
|
|
|
|
move-object v2, v1
|
|
|
|
goto :goto_7
|
|
|
|
:catch_2
|
|
move-exception p1
|
|
|
|
:goto_3
|
|
:try_start_4
|
|
const-string p2, "AvatarRectManager"
|
|
|
|
.line 42
|
|
invoke-static {p2, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_1
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
.line 46
|
|
:try_start_5
|
|
invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->close()V
|
|
|
|
goto :goto_4
|
|
|
|
:catch_3
|
|
move-exception p1
|
|
|
|
goto :goto_5
|
|
|
|
.line 48
|
|
:cond_5
|
|
:goto_4
|
|
iget-object p1, p0, Lcom/moji/mjweather/weather/avatar/AvatarRectManager;->a:Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;
|
|
|
|
invoke-virtual {p1}, Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;->close()V
|
|
:try_end_5
|
|
.catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_3
|
|
|
|
goto :goto_6
|
|
|
|
:goto_5
|
|
const-string p2, "AvatarRectManager"
|
|
|
|
.line 50
|
|
invoke-static {p2, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
:goto_6
|
|
return v0
|
|
|
|
:goto_7
|
|
if-eqz v2, :cond_6
|
|
|
|
.line 46
|
|
:try_start_6
|
|
invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->close()V
|
|
|
|
goto :goto_8
|
|
|
|
:catch_4
|
|
move-exception p2
|
|
|
|
goto :goto_9
|
|
|
|
.line 48
|
|
:cond_6
|
|
:goto_8
|
|
iget-object p2, p0, Lcom/moji/mjweather/weather/avatar/AvatarRectManager;->a:Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;
|
|
|
|
invoke-virtual {p2}, Lcom/moji/mjweather/weather/avatar/AvatarRectDBHelper;->close()V
|
|
:try_end_6
|
|
.catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_4
|
|
|
|
goto :goto_a
|
|
|
|
:goto_9
|
|
const-string v0, "AvatarRectManager"
|
|
|
|
.line 50
|
|
invoke-static {v0, p2}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
.line 52
|
|
:goto_a
|
|
throw p1
|
|
.end method
|