Rabbit-R1/android (non root)/smali/smali_classes2/androidx/media3/database/VersionTable.smali
2024-05-21 17:08:36 -04:00

313 lines
8.3 KiB
Smali

.class public final Landroidx/media3/database/VersionTable;
.super Ljava/lang/Object;
.source "VersionTable.java"
# static fields
.field private static final COLUMN_FEATURE:Ljava/lang/String; = "feature"
.field private static final COLUMN_INSTANCE_UID:Ljava/lang/String; = "instance_uid"
.field private static final COLUMN_VERSION:Ljava/lang/String; = "version"
.field public static final FEATURE_CACHE_CONTENT_METADATA:I = 0x1
.field public static final FEATURE_CACHE_FILE_METADATA:I = 0x2
.field public static final FEATURE_EXTERNAL:I = 0x3e8
.field public static final FEATURE_OFFLINE:I = 0x0
.field private static final PRIMARY_KEY:Ljava/lang/String; = "PRIMARY KEY (feature, instance_uid)"
.field private static final SQL_CREATE_TABLE_IF_NOT_EXISTS:Ljava/lang/String; = "CREATE TABLE IF NOT EXISTS ExoPlayerVersions (feature INTEGER NOT NULL,instance_uid TEXT NOT NULL,version INTEGER NOT NULL,PRIMARY KEY (feature, instance_uid))"
.field private static final TABLE_NAME:Ljava/lang/String; = "ExoPlayerVersions"
.field public static final VERSION_UNSET:I = -0x1
.field private static final WHERE_FEATURE_AND_INSTANCE_UID_EQUALS:Ljava/lang/String; = "feature = ? AND instance_uid = ?"
# direct methods
.method static constructor <clinit>()V
.locals 1
const-string v0, "media3.database"
.line 41
invoke-static {v0}, Landroidx/media3/common/MediaLibraryInfo;->registerModule(Ljava/lang/String;)V
return-void
.end method
.method private constructor <init>()V
.locals 0
.line 90
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private static featureAndInstanceUidArguments(ILjava/lang/String;)[Ljava/lang/String;
.locals 0
.line 177
invoke-static {p0}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object p0
filled-new-array {p0, p1}, [Ljava/lang/String;
move-result-object p0
return-object p0
.end method
.method public static getVersion(Landroid/database/sqlite/SQLiteDatabase;ILjava/lang/String;)I
.locals 11
.annotation system Ldalvik/annotation/Throws;
value = {
Landroidx/media3/database/DatabaseIOException;
}
.end annotation
:try_start_0
const-string v0, "ExoPlayerVersions"
.line 153
invoke-static {p0, v0}, Landroidx/media3/common/util/Util;->tableExists(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;)Z
move-result v0
const/4 v1, -0x1
if-nez v0, :cond_0
return v1
:cond_0
const-string v3, "ExoPlayerVersions"
const/4 v0, 0x1
new-array v4, v0, [Ljava/lang/String;
const-string v0, "version"
const/4 v10, 0x0
aput-object v0, v4, v10
const-string v5, "feature = ? AND instance_uid = ?"
.line 161
invoke-static {p1, p2}, Landroidx/media3/database/VersionTable;->featureAndInstanceUidArguments(ILjava/lang/String;)[Ljava/lang/String;
move-result-object v6
const/4 v7, 0x0
const/4 v8, 0x0
const/4 v9, 0x0
move-object v2, p0
.line 157
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 p0
:try_end_0
.catch Landroid/database/SQLException; {:try_start_0 .. :try_end_0} :catch_0
.line 165
:try_start_1
invoke-interface {p0}, Landroid/database/Cursor;->getCount()I
move-result p1
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
if-nez p1, :cond_2
if-eqz p0, :cond_1
.line 170
:try_start_2
invoke-interface {p0}, Landroid/database/Cursor;->close()V
:try_end_2
.catch Landroid/database/SQLException; {:try_start_2 .. :try_end_2} :catch_0
:cond_1
return v1
.line 168
:cond_2
:try_start_3
invoke-interface {p0}, Landroid/database/Cursor;->moveToNext()Z
.line 169
invoke-interface {p0, v10}, Landroid/database/Cursor;->getInt(I)I
move-result p1
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
if-eqz p0, :cond_3
.line 170
:try_start_4
invoke-interface {p0}, Landroid/database/Cursor;->close()V
:try_end_4
.catch Landroid/database/SQLException; {:try_start_4 .. :try_end_4} :catch_0
:cond_3
return p1
:catchall_0
move-exception p1
if-eqz p0, :cond_4
.line 156
:try_start_5
invoke-interface {p0}, Landroid/database/Cursor;->close()V
:try_end_5
.catchall {:try_start_5 .. :try_end_5} :catchall_1
goto :goto_0
:catchall_1
move-exception p0
:try_start_6
invoke-virtual {p1, p0}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:cond_4
:goto_0
throw p1
:try_end_6
.catch Landroid/database/SQLException; {:try_start_6 .. :try_end_6} :catch_0
:catch_0
move-exception p0
.line 172
new-instance p1, Landroidx/media3/database/DatabaseIOException;
invoke-direct {p1, p0}, Landroidx/media3/database/DatabaseIOException;-><init>(Landroid/database/SQLException;)V
throw p1
.end method
.method public static removeVersion(Landroid/database/sqlite/SQLiteDatabase;ILjava/lang/String;)V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Landroidx/media3/database/DatabaseIOException;
}
.end annotation
const-string v0, "ExoPlayerVersions"
.line 128
:try_start_0
invoke-static {p0, v0}, Landroidx/media3/common/util/Util;->tableExists(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;)Z
move-result v1
if-nez v1, :cond_0
return-void
:cond_0
const-string v1, "feature = ? AND instance_uid = ?"
.line 134
invoke-static {p1, p2}, Landroidx/media3/database/VersionTable;->featureAndInstanceUidArguments(ILjava/lang/String;)[Ljava/lang/String;
move-result-object p1
.line 131
invoke-virtual {p0, v0, v1, p1}, Landroid/database/sqlite/SQLiteDatabase;->delete(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I
:try_end_0
.catch Landroid/database/SQLException; {:try_start_0 .. :try_end_0} :catch_0
return-void
:catch_0
move-exception p0
.line 136
new-instance p1, Landroidx/media3/database/DatabaseIOException;
invoke-direct {p1, p0}, Landroidx/media3/database/DatabaseIOException;-><init>(Landroid/database/SQLException;)V
throw p1
.end method
.method public static setVersion(Landroid/database/sqlite/SQLiteDatabase;ILjava/lang/String;I)V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Landroidx/media3/database/DatabaseIOException;
}
.end annotation
:try_start_0
const-string v0, "CREATE TABLE IF NOT EXISTS ExoPlayerVersions (feature INTEGER NOT NULL,instance_uid TEXT NOT NULL,version INTEGER NOT NULL,PRIMARY KEY (feature, instance_uid))"
.line 105
invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
.line 106
new-instance v0, Landroid/content/ContentValues;
invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V
const-string v1, "feature"
.line 107
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
invoke-virtual {v0, v1, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V
const-string p1, "instance_uid"
.line 108
invoke-virtual {v0, p1, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V
const-string p1, "version"
.line 109
invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p2
invoke-virtual {v0, p1, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V
const-string p1, "ExoPlayerVersions"
const/4 p2, 0x0
.line 110
invoke-virtual {p0, p1, p2, v0}, Landroid/database/sqlite/SQLiteDatabase;->replaceOrThrow(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J
:try_end_0
.catch Landroid/database/SQLException; {:try_start_0 .. :try_end_0} :catch_0
return-void
:catch_0
move-exception p0
.line 112
new-instance p1, Landroidx/media3/database/DatabaseIOException;
invoke-direct {p1, p0}, Landroidx/media3/database/DatabaseIOException;-><init>(Landroid/database/SQLException;)V
throw p1
.end method