504 lines
13 KiB
Smali
504 lines
13 KiB
Smali
.class public Lcom/tencent/mmkv/MMKVContentProvider;
|
|
.super Landroid/content/ContentProvider;
|
|
.source "MMKVContentProvider.java"
|
|
|
|
|
|
# static fields
|
|
.field private static a:Landroid/net/Uri;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 38
|
|
invoke-direct {p0}, Landroid/content/ContentProvider;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method protected static a(Landroid/content/Context;)Landroid/net/Uri;
|
|
.locals 2
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.line 49
|
|
sget-object v0, Lcom/tencent/mmkv/MMKVContentProvider;->a:Landroid/net/Uri;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 50
|
|
sget-object p0, Lcom/tencent/mmkv/MMKVContentProvider;->a:Landroid/net/Uri;
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p0, :cond_1
|
|
|
|
return-object v0
|
|
|
|
.line 55
|
|
:cond_1
|
|
invoke-static {p0}, Lcom/tencent/mmkv/MMKVContentProvider;->b(Landroid/content/Context;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
if-nez p0, :cond_2
|
|
|
|
return-object v0
|
|
|
|
.line 59
|
|
:cond_2
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "content://"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
|
|
|
|
move-result-object p0
|
|
|
|
sput-object p0, Lcom/tencent/mmkv/MMKVContentProvider;->a:Landroid/net/Uri;
|
|
|
|
.line 60
|
|
sget-object p0, Lcom/tencent/mmkv/MMKVContentProvider;->a:Landroid/net/Uri;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private a(Ljava/lang/String;IILjava/lang/String;)Landroid/os/Bundle;
|
|
.locals 1
|
|
|
|
.line 64
|
|
invoke-virtual {p0}, Lcom/tencent/mmkv/MMKVContentProvider;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0, p1, p2, p3, p4}, Lcom/tencent/mmkv/MMKV;->a(Landroid/content/Context;Ljava/lang/String;IILjava/lang/String;)Lcom/tencent/mmkv/MMKV;
|
|
|
|
move-result-object p2
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
.line 66
|
|
new-instance p3, Lcom/tencent/mmkv/ParcelableMMKV;
|
|
|
|
invoke-direct {p3, p2}, Lcom/tencent/mmkv/ParcelableMMKV;-><init>(Lcom/tencent/mmkv/MMKV;)V
|
|
|
|
const-string p4, "MMKV"
|
|
|
|
.line 67
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " fd = "
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
.line 68
|
|
invoke-virtual {p2}, Lcom/tencent/mmkv/MMKV;->ashmemFD()I
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, ", meta fd = "
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Lcom/tencent/mmkv/MMKV;->ashmemMetaFD()I
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
.line 67
|
|
invoke-static {p4, p1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
.line 69
|
|
new-instance p1, Landroid/os/Bundle;
|
|
|
|
invoke-direct {p1}, Landroid/os/Bundle;-><init>()V
|
|
|
|
const-string p2, "KEY"
|
|
|
|
.line 70
|
|
invoke-virtual {p1, p2, p3}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method protected static a(Landroid/content/Context;I)Ljava/lang/String;
|
|
.locals 2
|
|
|
|
const-string v0, "activity"
|
|
|
|
.line 114
|
|
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Landroid/app/ActivityManager;
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
.line 118
|
|
invoke-virtual {p0}, Landroid/app/ActivityManager;->getRunningAppProcesses()Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/app/ActivityManager$RunningAppProcessInfo;
|
|
|
|
.line 119
|
|
iget v1, v0, Landroid/app/ActivityManager$RunningAppProcessInfo;->pid:I
|
|
|
|
if-ne v1, p1, :cond_0
|
|
|
|
.line 120
|
|
iget-object p0, v0, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;
|
|
|
|
return-object p0
|
|
|
|
:cond_1
|
|
const-string p0, ""
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private static b(Landroid/content/Context;)Ljava/lang/String;
|
|
.locals 2
|
|
|
|
.line 78
|
|
:try_start_0
|
|
new-instance v0, Landroid/content/ComponentName;
|
|
|
|
const-class v1, Lcom/tencent/mmkv/MMKVContentProvider;
|
|
|
|
.line 79
|
|
invoke-virtual {v1}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, p0, v1}, Landroid/content/ComponentName;-><init>(Landroid/content/Context;Ljava/lang/String;)V
|
|
|
|
.line 80
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 82
|
|
invoke-virtual {p0, v0, v1}, Landroid/content/pm/PackageManager;->getProviderInfo(Landroid/content/ComponentName;I)Landroid/content/pm/ProviderInfo;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 84
|
|
iget-object p0, p0, Landroid/content/pm/ProviderInfo;->authority:Ljava/lang/String;
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 88
|
|
invoke-virtual {p0}, Ljava/lang/Exception;->printStackTrace()V
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public call(Ljava/lang/String;Ljava/lang/String;Landroid/os/Bundle;)Landroid/os/Bundle;
|
|
.locals 2
|
|
.param p1 # Ljava/lang/String;
|
|
.annotation build Landroid/support/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Landroid/os/Bundle;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
|
|
const-string v0, "mmkvFromAshmemID"
|
|
|
|
.line 131
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
const-string p1, "KEY_SIZE"
|
|
|
|
.line 133
|
|
invoke-virtual {p3, p1}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I
|
|
|
|
move-result p1
|
|
|
|
const-string v0, "KEY_MODE"
|
|
|
|
.line 134
|
|
invoke-virtual {p3, v0}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I
|
|
|
|
move-result v0
|
|
|
|
const-string v1, "KEY_CRYPT"
|
|
|
|
.line 135
|
|
invoke-virtual {p3, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
.line 136
|
|
invoke-direct {p0, p2, p1, v0, p3}, Lcom/tencent/mmkv/MMKVContentProvider;->a(Ljava/lang/String;IILjava/lang/String;)Landroid/os/Bundle;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public delete(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;)I
|
|
.locals 0
|
|
.param p1 # Landroid/net/Uri;
|
|
.annotation build Landroid/support/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # [Ljava/lang/String;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 169
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
const-string p2, "Not implement in MMKV"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public getType(Landroid/net/Uri;)Ljava/lang/String;
|
|
.locals 0
|
|
.param p1 # Landroid/net/Uri;
|
|
.annotation build Landroid/support/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
|
|
.locals 0
|
|
.param p1 # Landroid/net/Uri;
|
|
.annotation build Landroid/support/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/content/ContentValues;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.line 175
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
const-string p2, "Not implement in MMKV"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public onCreate()Z
|
|
.locals 3
|
|
|
|
.line 95
|
|
invoke-virtual {p0}, Lcom/tencent/mmkv/MMKVContentProvider;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return v1
|
|
|
|
.line 99
|
|
:cond_0
|
|
invoke-static {v0}, Lcom/tencent/mmkv/MMKVContentProvider;->b(Landroid/content/Context;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
return v1
|
|
|
|
.line 104
|
|
:cond_1
|
|
sget-object v1, Lcom/tencent/mmkv/MMKVContentProvider;->a:Landroid/net/Uri;
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
.line 105
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "content://"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 106
|
|
invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/tencent/mmkv/MMKVContentProvider;->a:Landroid/net/Uri;
|
|
|
|
:cond_2
|
|
const/4 v0, 0x1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
|
|
.locals 0
|
|
.param p1 # Landroid/net/Uri;
|
|
.annotation build Landroid/support/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # [Ljava/lang/String;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Ljava/lang/String;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p4 # [Ljava/lang/String;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p5 # Ljava/lang/String;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.line 155
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
const-string p2, "Not implement in MMKV"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I
|
|
.locals 0
|
|
.param p1 # Landroid/net/Uri;
|
|
.annotation build Landroid/support/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/content/ContentValues;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Ljava/lang/String;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p4 # [Ljava/lang/String;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 163
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
const-string p2, "Not implement in MMKV"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|