mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-06 20:39:26 +01:00
118 lines
5.5 KiB
Java
118 lines
5.5 KiB
Java
package androidx.room.util;
|
|
|
|
import android.database.Cursor;
|
|
import androidx.annotation.RestrictTo;
|
|
import androidx.sqlite.db.SupportSQLiteDatabase;
|
|
import com.amazon.alexa.redesign.view.container.CardStudioAgentSpaceMetrics;
|
|
import defpackage.a$$ExternalSyntheticOutline0;
|
|
import kotlin.Metadata;
|
|
import kotlin.io.CloseableKt;
|
|
import kotlin.jvm.JvmField;
|
|
import kotlin.jvm.JvmStatic;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\b\u0007\u0018\u0000 \f2\u00020\u0001:\u0001\fB\u0017\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0003¢\u0006\u0002\u0010\u0005J\u0013\u0010\u0006\u001a\u00020\u00072\b\u0010\b\u001a\u0004\u0018\u00010\u0001H\u0096\u0002J\b\u0010\t\u001a\u00020\nH\u0016J\b\u0010\u000b\u001a\u00020\u0003H\u0016R\u0010\u0010\u0002\u001a\u00020\u00038\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0012\u0010\u0004\u001a\u0004\u0018\u00010\u00038\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Landroidx/room/util/ViewInfo;", "", "name", "", "sql", "(Ljava/lang/String;Ljava/lang/String;)V", "equals", "", CardStudioAgentSpaceMetrics.DimensionValue.SCHEME_OTHER, "hashCode", "", "toString", "Companion", "room-runtime_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
|
/* loaded from: classes14.dex */
|
|
public final class ViewInfo {
|
|
|
|
/* renamed from: Companion, reason: from kotlin metadata */
|
|
@NotNull
|
|
public static final Companion INSTANCE = new Companion(null);
|
|
|
|
@JvmField
|
|
@NotNull
|
|
public final String name;
|
|
|
|
@JvmField
|
|
@Nullable
|
|
public final String sql;
|
|
|
|
public ViewInfo(@NotNull String str, @Nullable String str2) {
|
|
str.getClass();
|
|
this.name = str;
|
|
this.sql = str2;
|
|
}
|
|
|
|
@JvmStatic
|
|
@NotNull
|
|
public static final ViewInfo read(@NotNull SupportSQLiteDatabase supportSQLiteDatabase, @NotNull String str) {
|
|
return INSTANCE.read(supportSQLiteDatabase, str);
|
|
}
|
|
|
|
public boolean equals(@Nullable Object other) {
|
|
if (this == other) {
|
|
return true;
|
|
}
|
|
if (!(other instanceof ViewInfo)) {
|
|
return false;
|
|
}
|
|
ViewInfo viewInfo = (ViewInfo) other;
|
|
if (Intrinsics.areEqual(this.name, viewInfo.name)) {
|
|
String str = this.sql;
|
|
String str2 = viewInfo.sql;
|
|
if (str != null ? Intrinsics.areEqual(str, str2) : str2 == null) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public int hashCode() {
|
|
int hashCode = this.name.hashCode() * 31;
|
|
String str = this.sql;
|
|
return hashCode + (str != null ? str.hashCode() : 0);
|
|
}
|
|
|
|
@NotNull
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder("ViewInfo{name='");
|
|
sb.append(this.name);
|
|
sb.append("', sql='");
|
|
return a$$ExternalSyntheticOutline0.m(sb, this.sql, "'}");
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0018\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0007¨\u0006\t"}, d2 = {"Landroidx/room/util/ViewInfo$Companion;", "", "()V", "read", "Landroidx/room/util/ViewInfo;", "database", "Landroidx/sqlite/db/SupportSQLiteDatabase;", "viewName", "", "room-runtime_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
@SourceDebugExtension({"SMAP\nViewInfo.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ViewInfo.kt\nandroidx/room/util/ViewInfo$Companion\n+ 2 CursorUtil.kt\nandroidx/room/util/CursorUtil\n*L\n1#1,83:1\n145#2,7:84\n*S KotlinDebug\n*F\n+ 1 ViewInfo.kt\nandroidx/room/util/ViewInfo$Companion\n*L\n73#1:84,7\n*E\n"})
|
|
public static final class Companion {
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
@JvmStatic
|
|
@NotNull
|
|
public final ViewInfo read(@NotNull SupportSQLiteDatabase database, @NotNull String viewName) {
|
|
ViewInfo viewInfo;
|
|
database.getClass();
|
|
viewName.getClass();
|
|
Cursor query = database.query("SELECT name, sql FROM sqlite_master WHERE type = 'view' AND name = '" + viewName + '\'');
|
|
try {
|
|
if (query.moveToFirst()) {
|
|
String string = query.getString(0);
|
|
string.getClass();
|
|
viewInfo = new ViewInfo(string, query.getString(1));
|
|
} else {
|
|
viewInfo = new ViewInfo(viewName, null);
|
|
}
|
|
CloseableKt.closeFinally(query, null);
|
|
return viewInfo;
|
|
} catch (Throwable th) {
|
|
try {
|
|
throw th;
|
|
} catch (Throwable th2) {
|
|
CloseableKt.closeFinally(query, th);
|
|
throw th2;
|
|
}
|
|
}
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
}
|
|
}
|