apkfuckery/com.discord/smali/androidx/room/InvalidationTracker$1.smali

355 lines
10 KiB
Smali
Raw Normal View History

2019-02-04 20:08:30 +00:00
.class Landroidx/room/InvalidationTracker$1;
.super Ljava/lang/Object;
2019-02-04 20:29:01 +00:00
.source "InvalidationTracker.java"
2019-02-04 20:08:30 +00:00
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/room/InvalidationTracker;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Landroidx/room/InvalidationTracker;
# direct methods
.method constructor <init>(Landroidx/room/InvalidationTracker;)V
.locals 0
iput-object p1, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private checkUpdatedTable()Z
.locals 7
iget-object v0, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-object v0, v0, Landroidx/room/InvalidationTracker;->mDatabase:Landroidx/room/RoomDatabase;
2019-05-03 18:53:54 +00:00
iget-object v1, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
iget-object v1, v1, Landroidx/room/InvalidationTracker;->mQueryArgs:[Ljava/lang/Object;
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
const-string v2, "SELECT * FROM room_table_modification_log WHERE version > ? ORDER BY version ASC;"
2019-02-04 20:08:30 +00:00
2019-05-03 18:53:54 +00:00
invoke-virtual {v0, v2, v1}, Landroidx/room/RoomDatabase;->query(Ljava/lang/String;[Ljava/lang/Object;)Landroid/database/Cursor;
2019-02-04 20:08:30 +00:00
move-result-object v0
const/4 v1, 0x1
const/4 v2, 0x0
const/4 v3, 0x0
:goto_0
:try_start_0
invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z
move-result v4
if-eqz v4, :cond_0
invoke-interface {v0, v2}, Landroid/database/Cursor;->getLong(I)J
move-result-wide v3
invoke-interface {v0, v1}, Landroid/database/Cursor;->getInt(I)I
move-result v5
iget-object v6, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-object v6, v6, Landroidx/room/InvalidationTracker;->mTableVersions:[J
aput-wide v3, v6, v5
iget-object v5, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iput-wide v3, v5, Landroidx/room/InvalidationTracker;->mMaxVersion:J
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
const/4 v3, 0x1
goto :goto_0
:cond_0
invoke-interface {v0}, Landroid/database/Cursor;->close()V
return v3
:catchall_0
move-exception v1
invoke-interface {v0}, Landroid/database/Cursor;->close()V
throw v1
2019-02-04 20:29:01 +00:00
return-void
2019-02-04 20:08:30 +00:00
.end method
# virtual methods
.method public run()V
2019-02-04 20:29:01 +00:00
.locals 5
2019-02-04 20:08:30 +00:00
iget-object v0, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-object v0, v0, Landroidx/room/InvalidationTracker;->mDatabase:Landroidx/room/RoomDatabase;
invoke-virtual {v0}, Landroidx/room/RoomDatabase;->getCloseLock()Ljava/util/concurrent/locks/Lock;
move-result-object v0
const/4 v1, 0x0
:try_start_0
invoke-interface {v0}, Ljava/util/concurrent/locks/Lock;->lock()V
iget-object v2, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
invoke-virtual {v2}, Landroidx/room/InvalidationTracker;->ensureInitialization()Z
move-result v2
:try_end_0
2019-02-17 02:24:41 +00:00
.catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_1
2019-02-04 20:29:01 +00:00
.catch Landroid/database/sqlite/SQLiteException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_1
2019-02-04 20:08:30 +00:00
if-nez v2, :cond_0
invoke-interface {v0}, Ljava/util/concurrent/locks/Lock;->unlock()V
return-void
:cond_0
:try_start_1
iget-object v2, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-object v2, v2, Landroidx/room/InvalidationTracker;->mPendingRefresh:Ljava/util/concurrent/atomic/AtomicBoolean;
const/4 v3, 0x1
invoke-virtual {v2, v3, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;->compareAndSet(ZZ)Z
move-result v2
:try_end_1
2019-02-17 02:24:41 +00:00
.catch Ljava/lang/IllegalStateException; {:try_start_1 .. :try_end_1} :catch_1
2019-02-04 20:29:01 +00:00
.catch Landroid/database/sqlite/SQLiteException; {:try_start_1 .. :try_end_1} :catch_0
.catchall {:try_start_1 .. :try_end_1} :catchall_1
2019-02-04 20:08:30 +00:00
if-nez v2, :cond_1
invoke-interface {v0}, Ljava/util/concurrent/locks/Lock;->unlock()V
return-void
:cond_1
:try_start_2
iget-object v2, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-object v2, v2, Landroidx/room/InvalidationTracker;->mDatabase:Landroidx/room/RoomDatabase;
invoke-virtual {v2}, Landroidx/room/RoomDatabase;->inTransaction()Z
move-result v2
:try_end_2
2019-02-17 02:24:41 +00:00
.catch Ljava/lang/IllegalStateException; {:try_start_2 .. :try_end_2} :catch_1
2019-02-04 20:29:01 +00:00
.catch Landroid/database/sqlite/SQLiteException; {:try_start_2 .. :try_end_2} :catch_0
.catchall {:try_start_2 .. :try_end_2} :catchall_1
2019-02-04 20:08:30 +00:00
if-eqz v2, :cond_2
invoke-interface {v0}, Ljava/util/concurrent/locks/Lock;->unlock()V
return-void
:cond_2
:try_start_3
iget-object v2, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-object v2, v2, Landroidx/room/InvalidationTracker;->mCleanupStatement:Landroidx/sqlite/db/SupportSQLiteStatement;
invoke-interface {v2}, Landroidx/sqlite/db/SupportSQLiteStatement;->executeUpdateDelete()I
iget-object v2, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-object v2, v2, Landroidx/room/InvalidationTracker;->mQueryArgs:[Ljava/lang/Object;
iget-object v3, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-wide v3, v3, Landroidx/room/InvalidationTracker;->mMaxVersion:J
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v3
aput-object v3, v2, v1
iget-object v2, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-object v2, v2, Landroidx/room/InvalidationTracker;->mDatabase:Landroidx/room/RoomDatabase;
iget-boolean v2, v2, Landroidx/room/RoomDatabase;->mWriteAheadLoggingEnabled:Z
if-eqz v2, :cond_3
iget-object v2, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-object v2, v2, Landroidx/room/InvalidationTracker;->mDatabase:Landroidx/room/RoomDatabase;
invoke-virtual {v2}, Landroidx/room/RoomDatabase;->getOpenHelper()Landroidx/sqlite/db/SupportSQLiteOpenHelper;
move-result-object v2
invoke-interface {v2}, Landroidx/sqlite/db/SupportSQLiteOpenHelper;->getWritableDatabase()Landroidx/sqlite/db/SupportSQLiteDatabase;
move-result-object v2
:try_end_3
2019-02-17 02:24:41 +00:00
.catch Ljava/lang/IllegalStateException; {:try_start_3 .. :try_end_3} :catch_1
2019-02-04 20:29:01 +00:00
.catch Landroid/database/sqlite/SQLiteException; {:try_start_3 .. :try_end_3} :catch_0
.catchall {:try_start_3 .. :try_end_3} :catchall_1
2019-02-04 20:08:30 +00:00
:try_start_4
invoke-interface {v2}, Landroidx/sqlite/db/SupportSQLiteDatabase;->beginTransaction()V
invoke-direct {p0}, Landroidx/room/InvalidationTracker$1;->checkUpdatedTable()Z
2019-02-04 20:29:01 +00:00
move-result v1
2019-02-04 20:08:30 +00:00
invoke-interface {v2}, Landroidx/sqlite/db/SupportSQLiteDatabase;->setTransactionSuccessful()V
2019-02-04 20:29:01 +00:00
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_0
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
:try_start_5
2019-02-04 20:08:30 +00:00
invoke-interface {v2}, Landroidx/sqlite/db/SupportSQLiteDatabase;->endTransaction()V
2019-02-17 02:24:41 +00:00
goto :goto_1
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
:catchall_0
2019-02-04 20:08:30 +00:00
move-exception v3
invoke-interface {v2}, Landroidx/sqlite/db/SupportSQLiteDatabase;->endTransaction()V
throw v3
:cond_3
invoke-direct {p0}, Landroidx/room/InvalidationTracker$1;->checkUpdatedTable()Z
2019-02-04 20:29:01 +00:00
move-result v1
:try_end_5
2019-02-17 02:24:41 +00:00
.catch Ljava/lang/IllegalStateException; {:try_start_5 .. :try_end_5} :catch_1
2019-02-04 20:29:01 +00:00
.catch Landroid/database/sqlite/SQLiteException; {:try_start_5 .. :try_end_5} :catch_0
.catchall {:try_start_5 .. :try_end_5} :catchall_1
2019-02-04 20:08:30 +00:00
2019-02-17 02:24:41 +00:00
goto :goto_1
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
:catchall_1
2019-02-04 20:08:30 +00:00
move-exception v1
2019-02-17 02:24:41 +00:00
goto :goto_3
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
:catch_0
2019-02-04 20:08:30 +00:00
move-exception v2
2019-02-17 02:24:41 +00:00
goto :goto_0
:catch_1
move-exception v2
:goto_0
2019-02-04 20:29:01 +00:00
:try_start_6
const-string v3, "ROOM"
2019-02-04 20:08:30 +00:00
const-string v4, "Cannot run invalidation tracker. Is the db closed?"
2019-02-04 20:29:01 +00:00
invoke-static {v3, v4, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_1
2019-02-04 20:08:30 +00:00
2019-02-17 02:24:41 +00:00
:goto_1
2019-02-04 20:08:30 +00:00
invoke-interface {v0}, Ljava/util/concurrent/locks/Lock;->unlock()V
2019-02-04 20:29:01 +00:00
if-eqz v1, :cond_5
2019-02-04 20:08:30 +00:00
iget-object v0, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-object v0, v0, Landroidx/room/InvalidationTracker;->mObserverMap:Landroidx/arch/core/internal/SafeIterableMap;
monitor-enter v0
2019-02-04 20:29:01 +00:00
:try_start_7
2019-02-04 20:08:30 +00:00
iget-object v1, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-object v1, v1, Landroidx/room/InvalidationTracker;->mObserverMap:Landroidx/arch/core/internal/SafeIterableMap;
invoke-virtual {v1}, Landroidx/arch/core/internal/SafeIterableMap;->iterator()Ljava/util/Iterator;
move-result-object v1
2019-02-17 02:24:41 +00:00
:goto_2
2019-02-04 20:08:30 +00:00
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_4
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/util/Map$Entry;
invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/room/InvalidationTracker$ObserverWrapper;
iget-object v3, p0, Landroidx/room/InvalidationTracker$1;->this$0:Landroidx/room/InvalidationTracker;
iget-object v3, v3, Landroidx/room/InvalidationTracker;->mTableVersions:[J
invoke-virtual {v2, v3}, Landroidx/room/InvalidationTracker$ObserverWrapper;->checkForInvalidation([J)V
2019-02-17 02:24:41 +00:00
goto :goto_2
2019-02-04 20:08:30 +00:00
:cond_4
monitor-exit v0
return-void
2019-02-04 20:29:01 +00:00
:catchall_2
2019-02-04 20:08:30 +00:00
move-exception v1
monitor-exit v0
2019-02-04 20:29:01 +00:00
:try_end_7
.catchall {:try_start_7 .. :try_end_7} :catchall_2
2019-02-04 20:08:30 +00:00
throw v1
:cond_5
return-void
2019-02-17 02:24:41 +00:00
:goto_3
2019-02-04 20:08:30 +00:00
invoke-interface {v0}, Ljava/util/concurrent/locks/Lock;->unlock()V
throw v1
2019-02-04 20:29:01 +00:00
return-void
2019-02-04 20:08:30 +00:00
.end method