7857 lines
195 KiB
Smali
7857 lines
195 KiB
Smali
.class public Lcom/mbridge/msdk/foundation/tools/FastKV;
|
|
.super Ljava/lang/Object;
|
|
.source "SourceFile"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/mbridge/msdk/foundation/tools/FastKV$c;,
|
|
Lcom/mbridge/msdk/foundation/tools/FastKV$Builder;,
|
|
Lcom/mbridge/msdk/foundation/tools/FastKV$b;,
|
|
Lcom/mbridge/msdk/foundation/tools/FastKV$a;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field static final ASYNC_BLOCKING:I = 0x1
|
|
|
|
.field private static final A_SUFFIX:Ljava/lang/String; = ".kva"
|
|
|
|
.field private static final BASE_GC_BYTES_THRESHOLD:I = 0x1000
|
|
|
|
.field private static final BASE_GC_KEYS_THRESHOLD:I = 0x50
|
|
|
|
.field private static final BOTH_FILES_ERROR:Ljava/lang/String; = "both files error"
|
|
|
|
.field private static final B_SUFFIX:Ljava/lang/String; = ".kvb"
|
|
|
|
.field private static final C_SUFFIX:Ljava/lang/String; = ".kvc"
|
|
|
|
.field private static final DATA_SIZE_LIMIT:I = 0x20000000
|
|
|
|
.field private static final DATA_START:I = 0xc
|
|
|
|
.field private static final DOUBLE_LIMIT:I
|
|
|
|
.field private static final EMPTY_ARRAY:[B
|
|
|
|
.field static final GC_FINISH:Ljava/lang/String; = "gc finish"
|
|
|
|
.field private static final INTERNAL_LIMIT:I = 0x800
|
|
|
|
.field private static final MAP_FAILED:Ljava/lang/String; = "map failed"
|
|
|
|
.field static final NON_BLOCKING:I = 0x0
|
|
|
|
.field private static final OPEN_FILE_FAILED:Ljava/lang/String; = "open file failed"
|
|
|
|
.field private static final PAGE_SIZE:I
|
|
|
|
.field private static final PARSE_DATA_FAILED:Ljava/lang/String; = "parse dara failed"
|
|
|
|
.field static final SYNC_BLOCKING:I = 0x2
|
|
|
|
.field private static final TEMP_SUFFIX:Ljava/lang/String; = ".tmp"
|
|
|
|
.field static final TRUNCATE_FINISH:Ljava/lang/String; = "truncate finish"
|
|
|
|
.field private static final TRUNCATE_THRESHOLD:I
|
|
|
|
.field private static final TYPE_SIZE:[I
|
|
|
|
|
|
# instance fields
|
|
.field private aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.field private aChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
.field private autoCommit:Z
|
|
|
|
.field private bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.field private bChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
.field private checksum:J
|
|
|
|
.field private final data:Ljava/util/Map;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/String;",
|
|
"Lcom/mbridge/msdk/foundation/tools/g$b;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private dataEnd:I
|
|
|
|
.field private final encoderMap:Ljava/util/Map;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/String;",
|
|
"Lcom/mbridge/msdk/foundation/tools/FastKV$a;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final executor:Ljava/util/concurrent/Executor;
|
|
|
|
.field private fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.field private invalidBytes:I
|
|
|
|
.field private final invalids:Ljava/util/ArrayList;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/ArrayList<",
|
|
"Lcom/mbridge/msdk/foundation/tools/FastKV$c;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final logger:Lcom/mbridge/msdk/foundation/tools/FastKV$b;
|
|
|
|
.field private final name:Ljava/lang/String;
|
|
|
|
.field private final path:Ljava/lang/String;
|
|
|
|
.field private removeStart:I
|
|
|
|
.field private sizeChanged:Z
|
|
|
|
.field private tempExternalName:Ljava/lang/String;
|
|
|
|
.field private updateSize:I
|
|
|
|
.field private updateStart:I
|
|
|
|
.field private writingMode:I
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
new-array v0, v0, [B
|
|
|
|
sput-object v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->EMPTY_ARRAY:[B
|
|
|
|
.line 38
|
|
invoke-static {}, Lcom/mbridge/msdk/foundation/tools/ar;->a()I
|
|
|
|
move-result v0
|
|
|
|
sput v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->PAGE_SIZE:I
|
|
|
|
shl-int/lit8 v0, v0, 0x1
|
|
|
|
const/16 v1, 0x4000
|
|
|
|
.line 39
|
|
invoke-static {v0, v1}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result v0
|
|
|
|
sput v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->DOUBLE_LIMIT:I
|
|
|
|
shl-int/lit8 v0, v0, 0x1
|
|
|
|
sput v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->TRUNCATE_THRESHOLD:I
|
|
|
|
const/4 v0, 0x6
|
|
|
|
new-array v0, v0, [I
|
|
|
|
fill-array-data v0, :array_0
|
|
|
|
sput-object v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->TYPE_SIZE:[I
|
|
|
|
return-void
|
|
|
|
:array_0
|
|
.array-data 4
|
|
0x0
|
|
0x1
|
|
0x4
|
|
0x4
|
|
0x8
|
|
0x8
|
|
.end array-data
|
|
.end method
|
|
|
|
.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;[Lcom/mbridge/msdk/foundation/tools/FastKV$a;I)V
|
|
.locals 3
|
|
|
|
.line 69
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 44
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 46
|
|
new-instance v0, Lcom/mbridge/msdk/foundation/tools/t;
|
|
|
|
invoke-direct {v0}, Lcom/mbridge/msdk/foundation/tools/t;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->executor:Ljava/util/concurrent/Executor;
|
|
|
|
.line 47
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
.line 48
|
|
sget-object v0, Lcom/mbridge/msdk/foundation/tools/r;->b:Lcom/mbridge/msdk/foundation/tools/FastKV$b;
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->logger:Lcom/mbridge/msdk/foundation/tools/FastKV$b;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->autoCommit:Z
|
|
|
|
iput-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
iput-object p2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
iput p4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
.line 74
|
|
new-instance p1, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
|
|
|
.line 75
|
|
sget-object p2, Lcom/mbridge/msdk/foundation/tools/ao;->a:Lcom/mbridge/msdk/foundation/tools/ao;
|
|
|
|
const-string p4, "StringSet"
|
|
|
|
.line 76
|
|
invoke-interface {p1, p4, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
.line 77
|
|
array-length p2, p3
|
|
|
|
if-lez p2, :cond_1
|
|
|
|
.line 78
|
|
array-length p2, p3
|
|
|
|
const/4 p4, 0x0
|
|
|
|
:goto_0
|
|
if-ge p4, p2, :cond_1
|
|
|
|
aget-object v0, p3, p4
|
|
|
|
.line 79
|
|
invoke-interface {v0}, Lcom/mbridge/msdk/foundation/tools/FastKV$a;->a()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
.line 80
|
|
invoke-interface {p1, v1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
.line 81
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "duplicate encoder tag:"
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/String;)V
|
|
|
|
goto :goto_1
|
|
|
|
.line 83
|
|
:cond_0
|
|
invoke-interface {p1, v1, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:goto_1
|
|
add-int/lit8 p4, p4, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iput-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->encoderMap:Ljava/util/Map;
|
|
|
|
.line 88
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->loadData()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic access$000(Lcom/mbridge/msdk/foundation/tools/FastKV;)Z
|
|
.locals 0
|
|
|
|
.line 17
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->writeToCFile()Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method private addObject(Ljava/lang/String;Ljava/lang/Object;[BB)V
|
|
.locals 6
|
|
|
|
.line 92
|
|
invoke-direct {p0, p1, p3, p4}, Lcom/mbridge/msdk/foundation/tools/FastKV;->saveArray(Ljava/lang/String;[BB)I
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->tempExternalName:Ljava/lang/String;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
:goto_0
|
|
move v5, v1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:goto_1
|
|
if-eqz v5, :cond_1
|
|
|
|
const/4 p2, 0x0
|
|
|
|
iput-object p2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->tempExternalName:Ljava/lang/String;
|
|
|
|
const/16 p2, 0x20
|
|
|
|
move v4, p2
|
|
|
|
move-object v3, v0
|
|
|
|
goto :goto_2
|
|
|
|
.line 102
|
|
:cond_1
|
|
array-length p3, p3
|
|
|
|
move-object v3, p2
|
|
|
|
move v4, p3
|
|
|
|
:goto_2
|
|
const/4 p2, 0x6
|
|
|
|
if-ne p4, p2, :cond_2
|
|
|
|
.line 107
|
|
new-instance p2, Lcom/mbridge/msdk/foundation/tools/g$i;
|
|
|
|
iget v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateStart:I
|
|
|
|
check-cast v3, Ljava/lang/String;
|
|
|
|
move-object v0, p2
|
|
|
|
invoke-direct/range {v0 .. v5}, Lcom/mbridge/msdk/foundation/tools/g$i;-><init>(IILjava/lang/String;IZ)V
|
|
|
|
goto :goto_3
|
|
|
|
:cond_2
|
|
const/4 p2, 0x7
|
|
|
|
if-ne p4, p2, :cond_3
|
|
|
|
.line 109
|
|
new-instance p2, Lcom/mbridge/msdk/foundation/tools/g$a;
|
|
|
|
iget v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateStart:I
|
|
|
|
move-object v0, p2
|
|
|
|
invoke-direct/range {v0 .. v5}, Lcom/mbridge/msdk/foundation/tools/g$a;-><init>(IILjava/lang/Object;IZ)V
|
|
|
|
goto :goto_3
|
|
|
|
.line 111
|
|
:cond_3
|
|
new-instance p2, Lcom/mbridge/msdk/foundation/tools/g$h;
|
|
|
|
iget v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateStart:I
|
|
|
|
move-object v0, p2
|
|
|
|
invoke-direct/range {v0 .. v5}, Lcom/mbridge/msdk/foundation/tools/g$h;-><init>(IILjava/lang/Object;IZ)V
|
|
|
|
:goto_3
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 113
|
|
invoke-interface {p3, p1, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 114
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateChange()V
|
|
|
|
:cond_4
|
|
return-void
|
|
.end method
|
|
|
|
.method private addOrUpdate(Ljava/lang/String;Ljava/lang/Object;[BLcom/mbridge/msdk/foundation/tools/g$j;B)V
|
|
.locals 1
|
|
|
|
if-nez p4, :cond_0
|
|
|
|
.line 120
|
|
invoke-direct {p0, p1, p2, p3, p5}, Lcom/mbridge/msdk/foundation/tools/FastKV;->addObject(Ljava/lang/String;Ljava/lang/Object;[BB)V
|
|
|
|
goto :goto_1
|
|
|
|
.line 122
|
|
:cond_0
|
|
iget-boolean p5, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->b:Z
|
|
|
|
if-nez p5, :cond_2
|
|
|
|
iget p5, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->e:I
|
|
|
|
array-length v0, p3
|
|
|
|
if-eq p5, v0, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
.line 125
|
|
:cond_1
|
|
iget p1, p4, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
invoke-direct {p0, p1, p3}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateBytes(I[B)V
|
|
|
|
.line 126
|
|
iput-object p2, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
goto :goto_1
|
|
|
|
.line 123
|
|
:cond_2
|
|
:goto_0
|
|
invoke-direct {p0, p1, p2, p3, p4}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateObject(Ljava/lang/String;Ljava/lang/Object;[BLcom/mbridge/msdk/foundation/tools/g$j;)V
|
|
|
|
.line 129
|
|
:goto_1
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private bytesThreshold()I
|
|
.locals 3
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
const/16 v1, 0x4000
|
|
|
|
if-gt v0, v1, :cond_0
|
|
|
|
const/16 v0, 0x1000
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
const/high16 v2, 0x10000
|
|
|
|
if-gt v0, v2, :cond_1
|
|
|
|
const/16 v1, 0x2000
|
|
|
|
:cond_1
|
|
return v1
|
|
.end method
|
|
|
|
.method private checkGC()V
|
|
.locals 3
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalidBytes:I
|
|
|
|
.line 141
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->bytesThreshold()I
|
|
|
|
move-result v1
|
|
|
|
shl-int/lit8 v1, v1, 0x1
|
|
|
|
if-ge v0, v1, :cond_1
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v0
|
|
|
|
iget v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
const/16 v2, 0x4000
|
|
|
|
if-ge v1, v2, :cond_0
|
|
|
|
const/16 v1, 0x50
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/16 v1, 0xa0
|
|
|
|
:goto_0
|
|
if-lt v0, v1, :cond_2
|
|
|
|
:cond_1
|
|
const/4 v0, 0x0
|
|
|
|
.line 142
|
|
invoke-virtual {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->gc(I)V
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|
|
|
|
.method private checkIfCommit()V
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-boolean v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->autoCommit:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 148
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->commitToCFile()Z
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private checkKey(Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 153
|
|
invoke-virtual {p1}, Ljava/lang/String;->isEmpty()Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 154
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "key is empty"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private checkKeySize(I)V
|
|
.locals 1
|
|
|
|
const/16 v0, 0xff
|
|
|
|
if-gt p1, v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 160
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "key\'s length must less than 256"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private checkValueSize(IZ)V
|
|
.locals 0
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
const/16 p2, 0x20
|
|
|
|
if-ne p1, p2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 167
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string p2, "name size not match"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
if-ltz p1, :cond_2
|
|
|
|
const/16 p2, 0x800
|
|
|
|
if-ge p1, p2, :cond_2
|
|
|
|
:goto_0
|
|
return-void
|
|
|
|
.line 171
|
|
:cond_2
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string p2, "value size out of bound"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private clearData()V
|
|
.locals 5
|
|
|
|
const/16 v0, 0xc
|
|
|
|
iput v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
iput-wide v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 235
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->clearInvalid()V
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 236
|
|
invoke-interface {v2}, Ljava/util/Map;->clear()V
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 237
|
|
iget-object v3, v2, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
array-length v3, v3
|
|
|
|
sget v4, Lcom/mbridge/msdk/foundation/tools/FastKV;->PAGE_SIZE:I
|
|
|
|
if-eq v3, v4, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v3, 0x0
|
|
|
|
.line 240
|
|
invoke-virtual {v2, v3, v3}, Lcom/mbridge/msdk/foundation/tools/q;->b(II)V
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
const/4 v3, 0x4
|
|
|
|
.line 241
|
|
invoke-virtual {v2, v3, v0, v1}, Lcom/mbridge/msdk/foundation/tools/q;->a(IJ)V
|
|
|
|
goto :goto_1
|
|
|
|
.line 238
|
|
:cond_1
|
|
:goto_0
|
|
new-instance v0, Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
sget v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->PAGE_SIZE:I
|
|
|
|
invoke-direct {v0, v1}, Lcom/mbridge/msdk/foundation/tools/q;-><init>(I)V
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
.method private clearInvalid()V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalidBytes:I
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
.line 253
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private commitToCFile()Z
|
|
.locals 3
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->executor:Ljava/util/concurrent/Executor;
|
|
|
|
.line 263
|
|
new-instance v2, Lcom/mbridge/msdk/foundation/tools/FastKV$1;
|
|
|
|
invoke-direct {v2, p0}, Lcom/mbridge/msdk/foundation/tools/FastKV$1;-><init>(Lcom/mbridge/msdk/foundation/tools/FastKV;)V
|
|
|
|
invoke-interface {v0, v2}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v2, 0x2
|
|
|
|
if-ne v0, v2, :cond_1
|
|
|
|
.line 270
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->writeToCFile()Z
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return v1
|
|
.end method
|
|
|
|
.method private copyBuffer(Ljava/nio/MappedByteBuffer;Ljava/nio/MappedByteBuffer;I)V
|
|
.locals 7
|
|
|
|
.line 309
|
|
invoke-virtual {p1}, Ljava/nio/Buffer;->capacity()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p2}, Ljava/nio/Buffer;->capacity()I
|
|
|
|
move-result v1
|
|
|
|
if-eq v0, v1, :cond_2
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
if-ne p2, v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
:goto_0
|
|
move-object v1, v0
|
|
|
|
goto :goto_1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
goto :goto_0
|
|
|
|
.line 312
|
|
:goto_1
|
|
sget-object v2, Ljava/nio/channels/FileChannel$MapMode;->READ_WRITE:Ljava/nio/channels/FileChannel$MapMode;
|
|
|
|
const-wide/16 v3, 0x0
|
|
|
|
invoke-virtual {p1}, Ljava/nio/Buffer;->capacity()I
|
|
|
|
move-result v0
|
|
|
|
int-to-long v5, v0
|
|
|
|
invoke-virtual/range {v1 .. v6}, Ljava/nio/channels/FileChannel;->map(Ljava/nio/channels/FileChannel$MapMode;JJ)Ljava/nio/MappedByteBuffer;
|
|
|
|
move-result-object v0
|
|
|
|
.line 313
|
|
sget-object v1, Ljava/nio/ByteOrder;->LITTLE_ENDIAN:Ljava/nio/ByteOrder;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
if-ne p2, v1, :cond_1
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:goto_2
|
|
move-object p2, v0
|
|
|
|
goto :goto_4
|
|
|
|
.line 321
|
|
:goto_3
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
.line 322
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->toBlockingMode()V
|
|
|
|
return-void
|
|
|
|
.line 326
|
|
:cond_2
|
|
:goto_4
|
|
invoke-virtual {p1}, Ljava/nio/MappedByteBuffer;->rewind()Ljava/nio/Buffer;
|
|
|
|
.line 327
|
|
invoke-virtual {p2}, Ljava/nio/MappedByteBuffer;->rewind()Ljava/nio/Buffer;
|
|
|
|
.line 328
|
|
invoke-virtual {p1, p3}, Ljava/nio/MappedByteBuffer;->limit(I)Ljava/nio/Buffer;
|
|
|
|
.line 329
|
|
invoke-virtual {p2, p1}, Ljava/nio/ByteBuffer;->put(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;
|
|
|
|
.line 330
|
|
invoke-virtual {p1}, Ljava/nio/Buffer;->capacity()I
|
|
|
|
move-result p2
|
|
|
|
invoke-virtual {p1, p2}, Ljava/nio/MappedByteBuffer;->limit(I)Ljava/nio/Buffer;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private countInvalid(II)V
|
|
.locals 2
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalidBytes:I
|
|
|
|
sub-int v1, p2, p1
|
|
|
|
add-int/2addr v0, v1
|
|
|
|
iput v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalidBytes:I
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
.line 335
|
|
new-instance v1, Lcom/mbridge/msdk/foundation/tools/FastKV$c;
|
|
|
|
invoke-direct {v1, p1, p2}, Lcom/mbridge/msdk/foundation/tools/FastKV$c;-><init>(II)V
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private deleteCFiles()V
|
|
.locals 4
|
|
|
|
.line 198
|
|
:try_start_0
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, ".kvc"
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v0, v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-static {v0}, Lcom/mbridge/msdk/foundation/tools/ar;->a(Ljava/io/File;)V
|
|
|
|
.line 199
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, ".tmp"
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v0, v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-static {v0}, Lcom/mbridge/msdk/foundation/tools/ar;->a(Ljava/io/File;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
.line 201
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private ensureSize(I)V
|
|
.locals 11
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 344
|
|
iget-object v0, v0, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
array-length v0, v0
|
|
|
|
iget v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
add-int/2addr v1, p1
|
|
|
|
if-lt v1, v0, :cond_1
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalidBytes:I
|
|
|
|
if-le v2, p1, :cond_0
|
|
|
|
.line 347
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->bytesThreshold()I
|
|
|
|
move-result v3
|
|
|
|
if-le v2, v3, :cond_0
|
|
|
|
.line 348
|
|
invoke-virtual {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->gc(I)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 350
|
|
:cond_0
|
|
invoke-direct {p0, v0, v1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getNewCapacity(II)I
|
|
|
|
move-result p1
|
|
|
|
.line 351
|
|
new-array v0, p1, [B
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 352
|
|
iget-object v1, v1, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-static {v1, v3, v0, v3, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 353
|
|
iput-object v0, v1, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
:try_start_0
|
|
iget-object v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
.line 356
|
|
sget-object v0, Ljava/nio/channels/FileChannel$MapMode;->READ_WRITE:Ljava/nio/channels/FileChannel$MapMode;
|
|
|
|
const-wide/16 v6, 0x0
|
|
|
|
int-to-long v1, p1
|
|
|
|
move-object v5, v0
|
|
|
|
move-wide v8, v1
|
|
|
|
invoke-virtual/range {v4 .. v9}, Ljava/nio/channels/FileChannel;->map(Ljava/nio/channels/FileChannel$MapMode;JJ)Ljava/nio/MappedByteBuffer;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 357
|
|
sget-object v4, Ljava/nio/ByteOrder;->LITTLE_ENDIAN:Ljava/nio/ByteOrder;
|
|
|
|
invoke-virtual {p1, v4}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v5, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
const-wide/16 v7, 0x0
|
|
|
|
move-object v6, v0
|
|
|
|
move-wide v9, v1
|
|
|
|
.line 358
|
|
invoke-virtual/range {v5 .. v10}, Ljava/nio/channels/FileChannel;->map(Ljava/nio/channels/FileChannel$MapMode;JJ)Ljava/nio/MappedByteBuffer;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 359
|
|
invoke-virtual {p1, v4}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 361
|
|
new-instance v0, Ljava/lang/Exception;
|
|
|
|
const-string v1, "map failed"
|
|
|
|
invoke-direct {v0, v1, p1}, Ljava/lang/Exception;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
iget-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
add-int/lit8 v0, v0, -0xc
|
|
|
|
.line 362
|
|
invoke-virtual {p1, v3, v0}, Lcom/mbridge/msdk/foundation/tools/q;->b(II)V
|
|
|
|
iget-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
const/4 v0, 0x4
|
|
|
|
iget-wide v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 363
|
|
invoke-virtual {p1, v0, v1, v2}, Lcom/mbridge/msdk/foundation/tools/q;->a(IJ)V
|
|
|
|
.line 364
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->toBlockingMode()V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private error(Ljava/lang/Exception;)V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->logger:Lcom/mbridge/msdk/foundation/tools/FastKV$b;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
.line 247
|
|
invoke-interface {v0, v1, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV$b;->a(Ljava/lang/String;Ljava/lang/Exception;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private error(Ljava/lang/String;)V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->logger:Lcom/mbridge/msdk/foundation/tools/FastKV$b;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
.line 373
|
|
new-instance v2, Ljava/lang/Exception;
|
|
|
|
invoke-direct {v2, p1}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-interface {v0, v1, v2}, Lcom/mbridge/msdk/foundation/tools/FastKV$b;->a(Ljava/lang/String;Ljava/lang/Exception;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private fastPutString(Ljava/lang/String;Ljava/lang/String;Lcom/mbridge/msdk/foundation/tools/g$i;)V
|
|
.locals 9
|
|
|
|
.line 378
|
|
invoke-static {p2}, Lcom/mbridge/msdk/foundation/tools/q;->a(Ljava/lang/String;)I
|
|
|
|
move-result v4
|
|
|
|
const/4 v0, 0x6
|
|
|
|
if-nez p3, :cond_0
|
|
|
|
.line 380
|
|
invoke-static {p1}, Lcom/mbridge/msdk/foundation/tools/q;->a(Ljava/lang/String;)I
|
|
|
|
move-result p3
|
|
|
|
.line 381
|
|
invoke-direct {p0, p3}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkKeySize(I)V
|
|
|
|
add-int/lit8 v1, p3, 0x4
|
|
|
|
add-int v2, v1, v4
|
|
|
|
iput v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateSize:I
|
|
|
|
.line 384
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->preparePutBytes()V
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 385
|
|
invoke-virtual {v2, v0}, Lcom/mbridge/msdk/foundation/tools/q;->a(B)V
|
|
|
|
.line 386
|
|
invoke-direct {p0, p1, p3}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putKey(Ljava/lang/String;I)V
|
|
|
|
.line 387
|
|
invoke-direct {p0, p2, v4}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putStringValue(Ljava/lang/String;I)V
|
|
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 388
|
|
new-instance v6, Lcom/mbridge/msdk/foundation/tools/g$i;
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateStart:I
|
|
|
|
add-int v3, v2, v1
|
|
|
|
const/4 v5, 0x0
|
|
|
|
move-object v0, v6
|
|
|
|
move v1, v2
|
|
|
|
move v2, v3
|
|
|
|
move-object v3, p2
|
|
|
|
invoke-direct/range {v0 .. v5}, Lcom/mbridge/msdk/foundation/tools/g$i;-><init>(IILjava/lang/String;IZ)V
|
|
|
|
invoke-interface {p3, p1, v6}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 389
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateChange()V
|
|
|
|
goto/16 :goto_2
|
|
|
|
.line 393
|
|
:cond_0
|
|
iget p1, p3, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
iget v1, p3, Lcom/mbridge/msdk/foundation/tools/g$j;->c:I
|
|
|
|
sub-int v1, p1, v1
|
|
|
|
.line 394
|
|
iget v2, p3, Lcom/mbridge/msdk/foundation/tools/g$j;->e:I
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
if-ne v2, v4, :cond_2
|
|
|
|
iget-wide v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
iget-object v6, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 395
|
|
invoke-virtual {v6, p1, v2}, Lcom/mbridge/msdk/foundation/tools/q;->a(II)J
|
|
|
|
move-result-wide v6
|
|
|
|
xor-long/2addr v0, v6
|
|
|
|
iput-wide v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 396
|
|
invoke-virtual {p2}, Ljava/lang/String;->length()I
|
|
|
|
move-result p1
|
|
|
|
if-ne v4, p1, :cond_1
|
|
|
|
iget-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 398
|
|
iget-object p1, p1, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v0, p3, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
invoke-virtual {p2, v3, v4, p1, v0}, Ljava/lang/String;->getBytes(II[BI)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 400
|
|
iget v0, p3, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
iput v0, p1, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
.line 401
|
|
invoke-virtual {p1, p2}, Lcom/mbridge/msdk/foundation/tools/q;->b(Ljava/lang/String;)V
|
|
|
|
.line 403
|
|
:goto_0
|
|
iget p1, p3, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
iput p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateStart:I
|
|
|
|
iput v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateSize:I
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
add-int p1, v1, v4
|
|
|
|
iput p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateSize:I
|
|
|
|
.line 407
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->preparePutBytes()V
|
|
|
|
iget-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 408
|
|
invoke-virtual {p1, v0}, Lcom/mbridge/msdk/foundation/tools/q;->a(B)V
|
|
|
|
add-int/lit8 p1, v1, -0x3
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 410
|
|
iget-object v6, v2, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v7, p3, Lcom/mbridge/msdk/foundation/tools/g$j;->c:I
|
|
|
|
const/4 v8, 0x1
|
|
|
|
add-int/2addr v7, v8
|
|
|
|
iget v2, v2, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
invoke-static {v6, v7, v6, v2, p1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 411
|
|
iget v6, v2, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
add-int/2addr v6, p1
|
|
|
|
iput v6, v2, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
.line 412
|
|
invoke-direct {p0, p2, v4}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putStringValue(Ljava/lang/String;I)V
|
|
|
|
.line 414
|
|
iget p1, p3, Lcom/mbridge/msdk/foundation/tools/g$j;->c:I
|
|
|
|
iget v2, p3, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
iget v6, p3, Lcom/mbridge/msdk/foundation/tools/g$j;->e:I
|
|
|
|
add-int/2addr v2, v6
|
|
|
|
invoke-direct {p0, v0, p1, v2}, Lcom/mbridge/msdk/foundation/tools/FastKV;->remove(BII)V
|
|
|
|
.line 416
|
|
iget-boolean p1, p3, Lcom/mbridge/msdk/foundation/tools/g$j;->b:Z
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
.line 417
|
|
iget-object p1, p3, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
move-object v5, p1
|
|
|
|
check-cast v5, Ljava/lang/String;
|
|
|
|
.line 420
|
|
:cond_3
|
|
iput-boolean v3, p3, Lcom/mbridge/msdk/foundation/tools/g$j;->b:Z
|
|
|
|
iget p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateStart:I
|
|
|
|
.line 421
|
|
iput p1, p3, Lcom/mbridge/msdk/foundation/tools/g$j;->c:I
|
|
|
|
add-int/2addr p1, v1
|
|
|
|
.line 422
|
|
iput p1, p3, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
.line 423
|
|
iput v4, p3, Lcom/mbridge/msdk/foundation/tools/g$j;->e:I
|
|
|
|
move v3, v8
|
|
|
|
.line 425
|
|
:goto_1
|
|
iput-object p2, p3, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
.line 426
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateChange()V
|
|
|
|
if-eqz v3, :cond_4
|
|
|
|
.line 428
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkGC()V
|
|
|
|
:cond_4
|
|
if-eqz v5, :cond_5
|
|
|
|
.line 431
|
|
new-instance p1, Ljava/io/File;
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2, v5}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-static {p1}, Lcom/mbridge/msdk/foundation/tools/ar;->a(Ljava/io/File;)V
|
|
|
|
.line 434
|
|
:cond_5
|
|
:goto_2
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private getArrayFromFile(Lcom/mbridge/msdk/foundation/tools/g$a;)[B
|
|
.locals 3
|
|
|
|
.line 577
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object p1, p1, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
check-cast p1, Ljava/lang/String;
|
|
|
|
invoke-direct {v0, v1, p1}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 579
|
|
:try_start_0
|
|
invoke-static {v0}, Lcom/mbridge/msdk/foundation/tools/ar;->b(Ljava/io/File;)[B
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget-object p1, Lcom/mbridge/msdk/foundation/tools/FastKV;->EMPTY_ARRAY:[B
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:goto_0
|
|
return-object p1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 582
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
sget-object p1, Lcom/mbridge/msdk/foundation/tools/FastKV;->EMPTY_ARRAY:[B
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private getNewCapacity(II)I
|
|
.locals 1
|
|
|
|
const/high16 v0, 0x20000000
|
|
|
|
if-gt p2, v0, :cond_3
|
|
|
|
sget v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->PAGE_SIZE:I
|
|
|
|
if-gt p2, v0, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
:goto_0
|
|
if-ge p1, p2, :cond_2
|
|
|
|
sget v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->DOUBLE_LIMIT:I
|
|
|
|
if-gt p1, v0, :cond_1
|
|
|
|
shl-int/lit8 p1, p1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
add-int/2addr p1, v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return p1
|
|
|
|
.line 675
|
|
:cond_3
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string p2, "data size out of limit"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private getObjectFromFile(Lcom/mbridge/msdk/foundation/tools/g$h;)Ljava/lang/Object;
|
|
.locals 4
|
|
|
|
.line 588
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object p1, p1, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
check-cast p1, Ljava/lang/String;
|
|
|
|
invoke-direct {v0, v1, p1}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 590
|
|
:try_start_0
|
|
invoke-static {v0}, Lcom/mbridge/msdk/foundation/tools/ar;->b(Ljava/io/File;)[B
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 592
|
|
aget-byte v0, p1, v0
|
|
|
|
and-int/lit16 v0, v0, 0xff
|
|
|
|
.line 595
|
|
new-instance v1, Ljava/lang/String;
|
|
|
|
sget-object v2, Ljava/nio/charset/StandardCharsets;->UTF_8:Ljava/nio/charset/Charset;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-direct {v1, p1, v3, v0, v2}, Ljava/lang/String;-><init>([BIILjava/nio/charset/Charset;)V
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->encoderMap:Ljava/util/Map;
|
|
|
|
.line 599
|
|
invoke-interface {v2, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/mbridge/msdk/foundation/tools/FastKV$a;
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
add-int/2addr v0, v3
|
|
|
|
.line 602
|
|
array-length v1, p1
|
|
|
|
sub-int/2addr v1, v0
|
|
|
|
invoke-interface {v2, p1, v0, v1}, Lcom/mbridge/msdk/foundation/tools/FastKV$a;->a([BII)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
goto :goto_0
|
|
|
|
.line 604
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/Exception;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "No encoder for tag:"
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->warning(Ljava/lang/Exception;)V
|
|
|
|
goto :goto_1
|
|
|
|
.line 607
|
|
:cond_1
|
|
new-instance p1, Ljava/lang/Exception;
|
|
|
|
const-string v0, "Read object data failed"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->warning(Ljava/lang/Exception;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 610
|
|
:goto_0
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
:goto_1
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private getStringFromFile(Lcom/mbridge/msdk/foundation/tools/g$i;)Ljava/lang/String;
|
|
.locals 4
|
|
|
|
const-string v0, ""
|
|
|
|
.line 559
|
|
iget-object p1, p1, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
check-cast p1, Ljava/lang/String;
|
|
|
|
.line 560
|
|
new-instance v1, Ljava/io/File;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v1, v2, p1}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 562
|
|
:try_start_0
|
|
invoke-static {v1}, Lcom/mbridge/msdk/foundation/tools/ar;->b(Ljava/io/File;)[B
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 565
|
|
array-length v1, p1
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v1, Ljava/lang/String;
|
|
|
|
sget-object v2, Ljava/nio/charset/StandardCharsets;->UTF_8:Ljava/nio/charset/Charset;
|
|
|
|
invoke-direct {v1, p1, v2}, Ljava/lang/String;-><init>([BLjava/nio/charset/Charset;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
move-object v0, v1
|
|
|
|
:goto_0
|
|
return-object v0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 571
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
:cond_1
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private info(Ljava/lang/String;)V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->logger:Lcom/mbridge/msdk/foundation/tools/FastKV$b;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
.line 718
|
|
invoke-interface {v0, v1, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV$b;->a(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private isABFileEqual()Z
|
|
.locals 6
|
|
|
|
.line 723
|
|
new-instance v0, Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
iget v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
invoke-direct {v0, v1}, Lcom/mbridge/msdk/foundation/tools/q;-><init>(I)V
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 724
|
|
invoke-virtual {v1}, Ljava/nio/MappedByteBuffer;->rewind()Ljava/nio/Buffer;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-object v2, v0, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
const/4 v4, 0x0
|
|
|
|
.line 725
|
|
invoke-virtual {v1, v2, v4, v3}, Ljava/nio/ByteBuffer;->get([BII)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 726
|
|
iget-object v1, v1, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget-object v0, v0, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
move v2, v4
|
|
|
|
:goto_0
|
|
iget v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
if-ge v2, v3, :cond_1
|
|
|
|
.line 729
|
|
aget-byte v3, v1, v2
|
|
|
|
aget-byte v5, v0, v2
|
|
|
|
if-eq v3, v5, :cond_0
|
|
|
|
return v4
|
|
|
|
:cond_0
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v0, 0x1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private declared-synchronized loadData()V
|
|
.locals 4
|
|
|
|
monitor-enter p0
|
|
|
|
.line 738
|
|
:try_start_0
|
|
invoke-static {}, Ljava/lang/System;->nanoTime()J
|
|
|
|
move-result-wide v0
|
|
|
|
.line 739
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->loadFromCFile()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
.line 740
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->loadFromABFile()V
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
:goto_0
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
.line 743
|
|
new-instance v2, Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
sget v3, Lcom/mbridge/msdk/foundation/tools/FastKV;->PAGE_SIZE:I
|
|
|
|
invoke-direct {v2, v3}, Lcom/mbridge/msdk/foundation/tools/q;-><init>(I)V
|
|
|
|
iput-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
:cond_1
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->logger:Lcom/mbridge/msdk/foundation/tools/FastKV$b;
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
.line 746
|
|
invoke-static {}, Ljava/lang/System;->nanoTime()J
|
|
|
|
move-result-wide v2
|
|
|
|
sub-long/2addr v2, v0
|
|
|
|
const-wide/32 v0, 0xf4240
|
|
|
|
div-long/2addr v2, v0
|
|
|
|
.line 747
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "loading finish, data len:"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, ", get keys:"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
invoke-interface {v1}, Ljava/util/Map;->size()I
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, ", use time:"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, " ms"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->info(Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 749
|
|
:cond_2
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method private loadFromABFile()V
|
|
.locals 21
|
|
|
|
move-object/from16 v1, p0
|
|
|
|
const-string v0, "rw"
|
|
|
|
.line 752
|
|
new-instance v2, Ljava/io/File;
|
|
|
|
iget-object v3, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
new-instance v4, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v5, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v5, ".kva"
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-direct {v2, v3, v4}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 753
|
|
new-instance v3, Ljava/io/File;
|
|
|
|
iget-object v4, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
new-instance v5, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v6, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v6, ".kvb"
|
|
|
|
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-direct {v3, v4, v5}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 755
|
|
:try_start_0
|
|
invoke-static {v2}, Lcom/mbridge/msdk/foundation/tools/ar;->c(Ljava/io/File;)Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_9
|
|
|
|
invoke-static {v3}, Lcom/mbridge/msdk/foundation/tools/ar;->c(Ljava/io/File;)Z
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
goto/16 :goto_2
|
|
|
|
.line 760
|
|
:cond_0
|
|
new-instance v4, Ljava/io/RandomAccessFile;
|
|
|
|
invoke-direct {v4, v2, v0}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
.line 761
|
|
new-instance v5, Ljava/io/RandomAccessFile;
|
|
|
|
invoke-direct {v5, v3, v0}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
.line 762
|
|
invoke-virtual {v4}, Ljava/io/RandomAccessFile;->length()J
|
|
|
|
move-result-wide v6
|
|
|
|
.line 763
|
|
invoke-virtual {v5}, Ljava/io/RandomAccessFile;->length()J
|
|
|
|
move-result-wide v8
|
|
|
|
.line 764
|
|
invoke-virtual {v4}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->aChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
.line 765
|
|
invoke-virtual {v5}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->bChannel:Ljava/nio/channels/FileChannel;
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:try_start_1
|
|
iget-object v10, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->aChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
.line 767
|
|
sget-object v0, Ljava/nio/channels/FileChannel$MapMode;->READ_WRITE:Ljava/nio/channels/FileChannel$MapMode;
|
|
|
|
const-wide/16 v12, 0x0
|
|
|
|
const-wide/16 v4, 0x0
|
|
|
|
cmp-long v17, v6, v4
|
|
|
|
if-lez v17, :cond_1
|
|
|
|
move-wide v14, v6
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
sget v11, Lcom/mbridge/msdk/foundation/tools/FastKV;->PAGE_SIZE:I
|
|
|
|
int-to-long v14, v11
|
|
|
|
:goto_0
|
|
move-object v11, v0
|
|
|
|
invoke-virtual/range {v10 .. v15}, Ljava/nio/channels/FileChannel;->map(Ljava/nio/channels/FileChannel$MapMode;JJ)Ljava/nio/MappedByteBuffer;
|
|
|
|
move-result-object v10
|
|
|
|
iput-object v10, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 768
|
|
sget-object v15, Ljava/nio/ByteOrder;->LITTLE_ENDIAN:Ljava/nio/ByteOrder;
|
|
|
|
invoke-virtual {v10, v15}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v11, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->bChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
cmp-long v4, v8, v4
|
|
|
|
if-lez v4, :cond_2
|
|
|
|
move-wide/from16 v19, v8
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
sget v5, Lcom/mbridge/msdk/foundation/tools/FastKV;->PAGE_SIZE:I
|
|
|
|
int-to-long v13, v5
|
|
|
|
move-wide/from16 v19, v13
|
|
|
|
:goto_1
|
|
move-object v12, v0
|
|
|
|
const-wide/16 v13, 0x0
|
|
|
|
move-object v0, v15
|
|
|
|
move-wide/from16 v15, v19
|
|
|
|
.line 769
|
|
invoke-virtual/range {v11 .. v16}, Ljava/nio/channels/FileChannel;->map(Ljava/nio/channels/FileChannel$MapMode;JJ)Ljava/nio/MappedByteBuffer;
|
|
|
|
move-result-object v5
|
|
|
|
iput-object v5, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 770
|
|
invoke-virtual {v5, v0}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
|
|
:try_end_1
|
|
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
|
|
|
|
.line 777
|
|
:try_start_2
|
|
new-instance v0, Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
iget-object v2, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
invoke-virtual {v2}, Ljava/nio/Buffer;->capacity()I
|
|
|
|
move-result v2
|
|
|
|
invoke-direct {v0, v2}, Lcom/mbridge/msdk/foundation/tools/q;-><init>(I)V
|
|
|
|
iput-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
const/16 v0, 0xc
|
|
|
|
if-nez v17, :cond_3
|
|
|
|
if-nez v4, :cond_3
|
|
|
|
iput v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
goto/16 :goto_4
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
goto/16 :goto_3
|
|
|
|
:cond_3
|
|
iget-object v2, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 782
|
|
invoke-virtual {v2}, Ljava/nio/ByteBuffer;->getInt()I
|
|
|
|
move-result v2
|
|
|
|
iget-object v3, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 783
|
|
invoke-virtual {v3}, Ljava/nio/ByteBuffer;->getLong()J
|
|
|
|
move-result-wide v3
|
|
|
|
iget-object v5, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 784
|
|
invoke-virtual {v5}, Ljava/nio/ByteBuffer;->getInt()I
|
|
|
|
move-result v5
|
|
|
|
iget-object v10, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 785
|
|
invoke-virtual {v10}, Ljava/nio/ByteBuffer;->getLong()J
|
|
|
|
move-result-wide v10
|
|
|
|
const/4 v12, 0x0
|
|
|
|
const-wide/16 v13, 0xc
|
|
|
|
if-ltz v2, :cond_6
|
|
|
|
int-to-long v0, v2
|
|
|
|
sub-long v16, v6, v13
|
|
|
|
cmp-long v0, v0, v16
|
|
|
|
if-gtz v0, :cond_5
|
|
|
|
add-int/lit8 v0, v2, 0xc
|
|
|
|
move-object/from16 v1, p0
|
|
|
|
iput v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
iget-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 790
|
|
invoke-virtual {v0}, Ljava/nio/MappedByteBuffer;->rewind()Ljava/nio/Buffer;
|
|
|
|
iget-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-object v15, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 791
|
|
iget-object v15, v15, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v13, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
invoke-virtual {v0, v15, v12, v13}, Ljava/nio/ByteBuffer;->get([BII)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
const/16 v13, 0xc
|
|
|
|
.line 792
|
|
invoke-virtual {v0, v13, v2}, Lcom/mbridge/msdk/foundation/tools/q;->a(II)J
|
|
|
|
move-result-wide v18
|
|
|
|
cmp-long v0, v3, v18
|
|
|
|
if-nez v0, :cond_6
|
|
|
|
invoke-direct/range {p0 .. p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->parseData()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_6
|
|
|
|
iput-wide v3, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
cmp-long v0, v6, v8
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
.line 798
|
|
invoke-direct/range {p0 .. p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->isABFileEqual()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_a
|
|
|
|
.line 799
|
|
:cond_4
|
|
new-instance v0, Ljava/lang/Exception;
|
|
|
|
const-string v2, "B file error"
|
|
|
|
invoke-direct {v0, v2}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-direct {v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->warning(Ljava/lang/Exception;)V
|
|
|
|
iget-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-object v2, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget v3, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
.line 800
|
|
invoke-direct {v1, v0, v2, v3}, Lcom/mbridge/msdk/foundation/tools/FastKV;->copyBuffer(Ljava/nio/MappedByteBuffer;Ljava/nio/MappedByteBuffer;I)V
|
|
|
|
goto/16 :goto_4
|
|
|
|
:cond_5
|
|
move-object/from16 v1, p0
|
|
|
|
:cond_6
|
|
if-ltz v5, :cond_8
|
|
|
|
int-to-long v2, v5
|
|
|
|
const-wide/16 v6, 0xc
|
|
|
|
sub-long/2addr v8, v6
|
|
|
|
cmp-long v0, v2, v8
|
|
|
|
if-gtz v0, :cond_8
|
|
|
|
iget-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 805
|
|
invoke-interface {v0}, Ljava/util/Map;->clear()V
|
|
|
|
.line 806
|
|
invoke-direct/range {p0 .. p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->clearInvalid()V
|
|
|
|
add-int/lit8 v0, v5, 0xc
|
|
|
|
iput v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
iget-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 808
|
|
iget-object v0, v0, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
array-length v0, v0
|
|
|
|
iget-object v2, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
invoke-virtual {v2}, Ljava/nio/Buffer;->capacity()I
|
|
|
|
move-result v2
|
|
|
|
if-eq v0, v2, :cond_7
|
|
|
|
.line 809
|
|
new-instance v0, Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
iget-object v2, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
invoke-virtual {v2}, Ljava/nio/Buffer;->capacity()I
|
|
|
|
move-result v2
|
|
|
|
invoke-direct {v0, v2}, Lcom/mbridge/msdk/foundation/tools/q;-><init>(I)V
|
|
|
|
iput-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
:cond_7
|
|
iget-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 811
|
|
invoke-virtual {v0}, Ljava/nio/MappedByteBuffer;->rewind()Ljava/nio/Buffer;
|
|
|
|
iget-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-object v2, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 812
|
|
iget-object v2, v2, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v3, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
invoke-virtual {v0, v2, v12, v3}, Ljava/nio/ByteBuffer;->get([BII)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
const/16 v2, 0xc
|
|
|
|
.line 813
|
|
invoke-virtual {v0, v2, v5}, Lcom/mbridge/msdk/foundation/tools/q;->a(II)J
|
|
|
|
move-result-wide v2
|
|
|
|
cmp-long v0, v10, v2
|
|
|
|
if-nez v0, :cond_8
|
|
|
|
invoke-direct/range {p0 .. p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->parseData()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_8
|
|
|
|
.line 814
|
|
new-instance v0, Ljava/lang/Exception;
|
|
|
|
const-string v2, "A file error"
|
|
|
|
invoke-direct {v0, v2}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-direct {v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->warning(Ljava/lang/Exception;)V
|
|
|
|
iget-object v0, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-object v2, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget v3, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
.line 815
|
|
invoke-direct {v1, v0, v2, v3}, Lcom/mbridge/msdk/foundation/tools/FastKV;->copyBuffer(Ljava/nio/MappedByteBuffer;Ljava/nio/MappedByteBuffer;I)V
|
|
|
|
iput-wide v10, v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
goto :goto_4
|
|
|
|
:cond_8
|
|
const-string v0, "both files error"
|
|
|
|
.line 821
|
|
invoke-direct {v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/String;)V
|
|
|
|
.line 822
|
|
invoke-direct/range {p0 .. p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->resetData()V
|
|
|
|
goto :goto_4
|
|
|
|
:catch_1
|
|
move-exception v0
|
|
|
|
.line 772
|
|
invoke-direct {v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
.line 773
|
|
invoke-direct/range {p0 .. p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->toBlockingMode()V
|
|
|
|
.line 774
|
|
invoke-direct {v1, v2, v3}, Lcom/mbridge/msdk/foundation/tools/FastKV;->tryBlockingIO(Ljava/io/File;Ljava/io/File;)V
|
|
|
|
return-void
|
|
|
|
.line 756
|
|
:cond_9
|
|
:goto_2
|
|
new-instance v0, Ljava/lang/Exception;
|
|
|
|
const-string v2, "open file failed"
|
|
|
|
invoke-direct {v0, v2}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-direct {v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
.line 757
|
|
invoke-direct/range {p0 .. p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->toBlockingMode()V
|
|
:try_end_2
|
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
|
|
|
|
return-void
|
|
|
|
.line 827
|
|
:goto_3
|
|
invoke-direct {v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
.line 828
|
|
invoke-direct/range {p0 .. p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->clearData()V
|
|
|
|
.line 829
|
|
invoke-direct/range {p0 .. p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->toBlockingMode()V
|
|
|
|
:cond_a
|
|
:goto_4
|
|
return-void
|
|
.end method
|
|
|
|
.method private loadFromCFile()Z
|
|
.locals 6
|
|
|
|
.line 835
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, ".kvc"
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v0, v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 836
|
|
new-instance v1, Ljava/io/File;
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v4, ".tmp"
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {v1, v2, v3}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 839
|
|
:try_start_0
|
|
invoke-virtual {v0}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 841
|
|
:cond_0
|
|
invoke-virtual {v1}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
move-object v0, v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_4
|
|
|
|
.line 845
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->loadWithBlockingIO(Ljava/io/File;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
if-nez v0, :cond_5
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 847
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->writeToABFile(Lcom/mbridge/msdk/foundation/tools/q;)Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
const-string v0, "recover from c file"
|
|
|
|
.line 848
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->info(Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
|
|
|
|
.line 850
|
|
:try_start_1
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->deleteCFiles()V
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
|
|
|
|
move v2, v1
|
|
|
|
goto :goto_2
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
move v2, v1
|
|
|
|
goto :goto_1
|
|
|
|
:catch_1
|
|
move-exception v0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
:try_start_2
|
|
iput v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
goto :goto_2
|
|
|
|
.line 856
|
|
:cond_3
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->clearData()V
|
|
|
|
.line 857
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->deleteCFiles()V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
.line 863
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v4, ".kva"
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {v0, v1, v3}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 864
|
|
new-instance v1, Ljava/io/File;
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
new-instance v4, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v5, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v5, ".kvb"
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-direct {v1, v3, v4}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 865
|
|
invoke-virtual {v0}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_5
|
|
|
|
invoke-virtual {v1}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_5
|
|
|
|
.line 866
|
|
invoke-direct {p0, v0, v1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->tryBlockingIO(Ljava/io/File;Ljava/io/File;)V
|
|
:try_end_2
|
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1
|
|
|
|
goto :goto_2
|
|
|
|
.line 871
|
|
:goto_1
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
:cond_5
|
|
:goto_2
|
|
return v2
|
|
.end method
|
|
|
|
.method private loadWithBlockingIO(Ljava/io/File;)Z
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 877
|
|
invoke-virtual {p1}, Ljava/io/File;->length()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v2, v0, v2
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
const-wide/32 v4, 0x20000000
|
|
|
|
cmp-long v2, v0, v4
|
|
|
|
if-lez v2, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
long-to-int v0, v0
|
|
|
|
sget v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->PAGE_SIZE:I
|
|
|
|
.line 882
|
|
invoke-direct {p0, v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getNewCapacity(II)I
|
|
|
|
move-result v1
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 884
|
|
iget-object v4, v2, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
array-length v4, v4
|
|
|
|
if-ne v4, v1, :cond_1
|
|
|
|
.line 886
|
|
iput v3, v2, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
goto :goto_0
|
|
|
|
.line 888
|
|
:cond_1
|
|
new-instance v2, Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
new-array v1, v1, [B
|
|
|
|
invoke-direct {v2, v1}, Lcom/mbridge/msdk/foundation/tools/q;-><init>([B)V
|
|
|
|
iput-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 891
|
|
:goto_0
|
|
iget-object v1, v2, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
invoke-static {p1, v1, v0}, Lcom/mbridge/msdk/foundation/tools/ar;->a(Ljava/io/File;[BI)V
|
|
|
|
.line 892
|
|
invoke-virtual {v2}, Lcom/mbridge/msdk/foundation/tools/q;->c()I
|
|
|
|
move-result p1
|
|
|
|
.line 893
|
|
invoke-virtual {v2}, Lcom/mbridge/msdk/foundation/tools/q;->b()J
|
|
|
|
move-result-wide v4
|
|
|
|
add-int/lit8 v1, p1, 0xc
|
|
|
|
iput v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
if-ltz p1, :cond_2
|
|
|
|
const/16 v1, 0xc
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
if-gt p1, v0, :cond_2
|
|
|
|
.line 895
|
|
invoke-virtual {v2, v1, p1}, Lcom/mbridge/msdk/foundation/tools/q;->a(II)J
|
|
|
|
move-result-wide v0
|
|
|
|
cmp-long p1, v4, v0
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->parseData()I
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
iput-wide v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:cond_2
|
|
:goto_1
|
|
return v3
|
|
.end method
|
|
|
|
.method private mergeInvalids()V
|
|
.locals 6
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
.line 903
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v0
|
|
|
|
add-int/lit8 v0, v0, -0x1
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
.line 904
|
|
invoke-virtual {v1, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/mbridge/msdk/foundation/tools/FastKV$c;
|
|
|
|
:goto_0
|
|
if-lez v0, :cond_1
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
add-int/lit8 v3, v0, -0x1
|
|
|
|
.line 906
|
|
invoke-virtual {v2, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/mbridge/msdk/foundation/tools/FastKV$c;
|
|
|
|
.line 907
|
|
iget v4, v1, Lcom/mbridge/msdk/foundation/tools/FastKV$c;->b:I
|
|
|
|
iget v5, v2, Lcom/mbridge/msdk/foundation/tools/FastKV$c;->a:I
|
|
|
|
if-ne v4, v5, :cond_0
|
|
|
|
.line 908
|
|
iget v1, v1, Lcom/mbridge/msdk/foundation/tools/FastKV$c;->a:I
|
|
|
|
iput v1, v2, Lcom/mbridge/msdk/foundation/tools/FastKV$c;->a:I
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
.line 909
|
|
invoke-virtual {v1, v0}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object;
|
|
|
|
:cond_0
|
|
move-object v1, v2
|
|
|
|
move v0, v3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method private parseData()I
|
|
.locals 14
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
const/16 v1, 0xc
|
|
|
|
.line 917
|
|
iput v1, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
:goto_0
|
|
const/4 v1, -0x1
|
|
|
|
.line 919
|
|
:try_start_0
|
|
iget v3, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const-string v4, "parse dara failed"
|
|
|
|
const/4 v5, 0x0
|
|
|
|
if-ge v3, v2, :cond_11
|
|
|
|
.line 921
|
|
:try_start_1
|
|
invoke-virtual {v0}, Lcom/mbridge/msdk/foundation/tools/q;->a()B
|
|
|
|
move-result v2
|
|
|
|
and-int/lit8 v6, v2, 0x3f
|
|
|
|
int-to-byte v6, v6
|
|
|
|
const/4 v7, 0x1
|
|
|
|
if-lt v6, v7, :cond_10
|
|
|
|
const/16 v8, 0x8
|
|
|
|
if-gt v6, v8, :cond_10
|
|
|
|
.line 926
|
|
invoke-virtual {v0}, Lcom/mbridge/msdk/foundation/tools/q;->a()B
|
|
|
|
move-result v8
|
|
|
|
and-int/lit16 v8, v8, 0xff
|
|
|
|
const v9, 0xffff
|
|
|
|
const/4 v10, 0x5
|
|
|
|
if-gez v2, :cond_1
|
|
|
|
.line 928
|
|
iget v2, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
add-int/2addr v2, v8
|
|
|
|
iput v2, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
if-gt v6, v10, :cond_0
|
|
|
|
sget-object v2, Lcom/mbridge/msdk/foundation/tools/FastKV;->TYPE_SIZE:[I
|
|
|
|
.line 929
|
|
aget v2, v2, v6
|
|
|
|
goto :goto_1
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
goto/16 :goto_6
|
|
|
|
:cond_0
|
|
invoke-virtual {v0}, Lcom/mbridge/msdk/foundation/tools/q;->d()S
|
|
|
|
move-result v2
|
|
|
|
and-int/2addr v2, v9
|
|
|
|
:goto_1
|
|
iget-object v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 930
|
|
iget v5, v4, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
add-int/2addr v5, v2
|
|
|
|
iput v5, v4, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
.line 931
|
|
invoke-direct {p0, v3, v5}, Lcom/mbridge/msdk/foundation/tools/FastKV;->countInvalid(II)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 934
|
|
:cond_1
|
|
invoke-virtual {v0, v8}, Lcom/mbridge/msdk/foundation/tools/q;->a(I)Ljava/lang/String;
|
|
|
|
move-result-object v8
|
|
|
|
.line 935
|
|
iget v11, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
if-gt v6, v10, :cond_7
|
|
|
|
if-eq v6, v7, :cond_5
|
|
|
|
const/4 v2, 0x2
|
|
|
|
if-eq v6, v2, :cond_4
|
|
|
|
const/4 v2, 0x3
|
|
|
|
if-eq v6, v2, :cond_3
|
|
|
|
const/4 v2, 0x4
|
|
|
|
if-eq v6, v2, :cond_2
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 951
|
|
new-instance v3, Lcom/mbridge/msdk/foundation/tools/g$d;
|
|
|
|
.line 3094
|
|
invoke-virtual {v0}, Lcom/mbridge/msdk/foundation/tools/q;->b()J
|
|
|
|
move-result-wide v4
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/Double;->longBitsToDouble(J)D
|
|
|
|
move-result-wide v4
|
|
|
|
.line 951
|
|
invoke-direct {v3, v11, v4, v5}, Lcom/mbridge/msdk/foundation/tools/g$d;-><init>(ID)V
|
|
|
|
invoke-interface {v2, v8, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 945
|
|
new-instance v3, Lcom/mbridge/msdk/foundation/tools/g$g;
|
|
|
|
invoke-virtual {v0}, Lcom/mbridge/msdk/foundation/tools/q;->b()J
|
|
|
|
move-result-wide v4
|
|
|
|
invoke-direct {v3, v11, v4, v5}, Lcom/mbridge/msdk/foundation/tools/g$g;-><init>(IJ)V
|
|
|
|
invoke-interface {v2, v8, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 948
|
|
new-instance v3, Lcom/mbridge/msdk/foundation/tools/g$e;
|
|
|
|
.line 2104
|
|
invoke-virtual {v0}, Lcom/mbridge/msdk/foundation/tools/q;->c()I
|
|
|
|
move-result v4
|
|
|
|
invoke-static {v4}, Ljava/lang/Float;->intBitsToFloat(I)F
|
|
|
|
move-result v4
|
|
|
|
.line 948
|
|
invoke-direct {v3, v11, v4}, Lcom/mbridge/msdk/foundation/tools/g$e;-><init>(IF)V
|
|
|
|
invoke-interface {v2, v8, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto/16 :goto_0
|
|
|
|
:cond_4
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 942
|
|
new-instance v3, Lcom/mbridge/msdk/foundation/tools/g$f;
|
|
|
|
invoke-virtual {v0}, Lcom/mbridge/msdk/foundation/tools/q;->c()I
|
|
|
|
move-result v4
|
|
|
|
invoke-direct {v3, v11, v4}, Lcom/mbridge/msdk/foundation/tools/g$f;-><init>(II)V
|
|
|
|
invoke-interface {v2, v8, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto/16 :goto_0
|
|
|
|
:cond_5
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 939
|
|
new-instance v3, Lcom/mbridge/msdk/foundation/tools/g$c;
|
|
|
|
invoke-virtual {v0}, Lcom/mbridge/msdk/foundation/tools/q;->a()B
|
|
|
|
move-result v4
|
|
|
|
if-ne v4, v7, :cond_6
|
|
|
|
move v5, v7
|
|
|
|
:cond_6
|
|
invoke-direct {v3, v11, v5}, Lcom/mbridge/msdk/foundation/tools/g$c;-><init>(IZ)V
|
|
|
|
invoke-interface {v2, v8, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto/16 :goto_0
|
|
|
|
.line 955
|
|
:cond_7
|
|
invoke-virtual {v0}, Lcom/mbridge/msdk/foundation/tools/q;->d()S
|
|
|
|
move-result v10
|
|
|
|
and-int/2addr v9, v10
|
|
|
|
and-int/lit8 v2, v2, 0x40
|
|
|
|
if-eqz v2, :cond_8
|
|
|
|
goto :goto_2
|
|
|
|
:cond_8
|
|
move v7, v5
|
|
|
|
.line 957
|
|
:goto_2
|
|
invoke-direct {p0, v9, v7}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkValueSize(IZ)V
|
|
|
|
const/4 v2, 0x6
|
|
|
|
if-eq v6, v2, :cond_f
|
|
|
|
const/4 v2, 0x7
|
|
|
|
if-eq v6, v2, :cond_d
|
|
|
|
if-eqz v7, :cond_9
|
|
|
|
.line 969
|
|
invoke-virtual {v0, v9}, Lcom/mbridge/msdk/foundation/tools/q;->a(I)Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
iget-object v10, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 970
|
|
new-instance v12, Lcom/mbridge/msdk/foundation/tools/g$h;
|
|
|
|
add-int/lit8 v4, v11, 0x2
|
|
|
|
const/4 v7, 0x1
|
|
|
|
move-object v2, v12
|
|
|
|
move v6, v9
|
|
|
|
invoke-direct/range {v2 .. v7}, Lcom/mbridge/msdk/foundation/tools/g$h;-><init>(IILjava/lang/Object;IZ)V
|
|
|
|
invoke-interface {v10, v8, v12}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto/16 :goto_0
|
|
|
|
.line 972
|
|
:cond_9
|
|
invoke-virtual {v0}, Lcom/mbridge/msdk/foundation/tools/q;->a()B
|
|
|
|
move-result v2
|
|
|
|
and-int/lit16 v2, v2, 0xff
|
|
|
|
.line 973
|
|
invoke-virtual {v0, v2}, Lcom/mbridge/msdk/foundation/tools/q;->a(I)Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
iget-object v6, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->encoderMap:Ljava/util/Map;
|
|
|
|
.line 974
|
|
invoke-interface {v6, v5}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
check-cast v6, Lcom/mbridge/msdk/foundation/tools/FastKV$a;
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
sub-int v10, v9, v2
|
|
|
|
if-ltz v10, :cond_c
|
|
|
|
if-eqz v6, :cond_a
|
|
|
|
.line 981
|
|
:try_start_2
|
|
iget-object v2, v0, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v4, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
invoke-interface {v6, v2, v4, v10}, Lcom/mbridge/msdk/foundation/tools/FastKV$a;->a([BII)Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
if-eqz v5, :cond_b
|
|
|
|
iget-object v12, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 983
|
|
new-instance v13, Lcom/mbridge/msdk/foundation/tools/g$h;
|
|
|
|
add-int/lit8 v4, v11, 0x2
|
|
|
|
const/4 v7, 0x0
|
|
|
|
move-object v2, v13
|
|
|
|
move v6, v9
|
|
|
|
invoke-direct/range {v2 .. v7}, Lcom/mbridge/msdk/foundation/tools/g$h;-><init>(IILjava/lang/Object;IZ)V
|
|
|
|
invoke-interface {v12, v8, v13}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
:try_end_2
|
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1
|
|
|
|
goto :goto_3
|
|
|
|
:catch_1
|
|
move-exception v2
|
|
|
|
.line 986
|
|
:try_start_3
|
|
invoke-direct {p0, v2}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
goto :goto_3
|
|
|
|
.line 989
|
|
:cond_a
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v3, "object with tag: "
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, " without encoder"
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {p0, v2}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/String;)V
|
|
|
|
.line 991
|
|
:cond_b
|
|
:goto_3
|
|
iget v2, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
add-int/2addr v2, v10
|
|
|
|
iput v2, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
goto/16 :goto_0
|
|
|
|
.line 977
|
|
:cond_c
|
|
new-instance v0, Ljava/lang/Exception;
|
|
|
|
invoke-direct {v0, v4}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_d
|
|
if-eqz v7, :cond_e
|
|
|
|
.line 964
|
|
invoke-virtual {v0, v9}, Lcom/mbridge/msdk/foundation/tools/q;->a(I)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
:goto_4
|
|
move-object v5, v2
|
|
|
|
goto :goto_5
|
|
|
|
.line 4065
|
|
:cond_e
|
|
new-array v2, v9, [B
|
|
|
|
.line 4066
|
|
iget-object v4, v0, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v6, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
invoke-static {v4, v6, v2, v5, v9}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
|
|
|
|
.line 4067
|
|
iget v4, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
add-int/2addr v4, v9
|
|
|
|
iput v4, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
goto :goto_4
|
|
|
|
:goto_5
|
|
iget-object v10, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 965
|
|
new-instance v12, Lcom/mbridge/msdk/foundation/tools/g$a;
|
|
|
|
add-int/lit8 v4, v11, 0x2
|
|
|
|
move-object v2, v12
|
|
|
|
move v6, v9
|
|
|
|
invoke-direct/range {v2 .. v7}, Lcom/mbridge/msdk/foundation/tools/g$a;-><init>(IILjava/lang/Object;IZ)V
|
|
|
|
invoke-interface {v10, v8, v12}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto/16 :goto_0
|
|
|
|
.line 960
|
|
:cond_f
|
|
invoke-virtual {v0, v9}, Lcom/mbridge/msdk/foundation/tools/q;->a(I)Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
iget-object v10, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 961
|
|
new-instance v12, Lcom/mbridge/msdk/foundation/tools/g$i;
|
|
|
|
add-int/lit8 v4, v11, 0x2
|
|
|
|
move-object v2, v12
|
|
|
|
move v6, v9
|
|
|
|
invoke-direct/range {v2 .. v7}, Lcom/mbridge/msdk/foundation/tools/g$i;-><init>(IILjava/lang/String;IZ)V
|
|
|
|
invoke-interface {v10, v8, v12}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto/16 :goto_0
|
|
|
|
.line 924
|
|
:cond_10
|
|
new-instance v0, Ljava/lang/Exception;
|
|
|
|
invoke-direct {v0, v4}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
:try_end_3
|
|
.catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_0
|
|
|
|
:cond_11
|
|
if-eq v3, v2, :cond_12
|
|
|
|
.line 1002
|
|
new-instance v0, Ljava/lang/Exception;
|
|
|
|
invoke-direct {v0, v4}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->warning(Ljava/lang/Exception;)V
|
|
|
|
return v1
|
|
|
|
:cond_12
|
|
return v5
|
|
|
|
.line 998
|
|
:goto_6
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->warning(Ljava/lang/Exception;)V
|
|
|
|
return v1
|
|
.end method
|
|
|
|
.method private preparePutBytes()V
|
|
.locals 2
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateSize:I
|
|
|
|
.line 1009
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->ensureSize(I)V
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
iput v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateStart:I
|
|
|
|
iget v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateSize:I
|
|
|
|
add-int/2addr v1, v0
|
|
|
|
iput v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1012
|
|
iput v0, v1, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->sizeChanged:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private putKey(Ljava/lang/String;I)V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
int-to-byte v1, p2
|
|
|
|
.line 1147
|
|
invoke-virtual {v0, v1}, Lcom/mbridge/msdk/foundation/tools/q;->a(B)V
|
|
|
|
.line 1148
|
|
invoke-virtual {p1}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
if-ne p2, v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1150
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v0, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {p1, v2, p2, v1, v0}, Ljava/lang/String;->getBytes(II[BI)V
|
|
|
|
iget-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1151
|
|
iget v0, p1, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
add-int/2addr v0, p2
|
|
|
|
iput v0, p1, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object p2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1153
|
|
invoke-virtual {p2, p1}, Lcom/mbridge/msdk/foundation/tools/q;->b(Ljava/lang/String;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private putStringValue(Ljava/lang/String;I)V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
int-to-short v1, p2
|
|
|
|
.line 1247
|
|
invoke-virtual {v0, v1}, Lcom/mbridge/msdk/foundation/tools/q;->a(S)V
|
|
|
|
.line 1248
|
|
invoke-virtual {p1}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
if-ne p2, v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1250
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v0, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {p1, v2, p2, v1, v0}, Ljava/lang/String;->getBytes(II[BI)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object p2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1252
|
|
invoke-virtual {p2, p1}, Lcom/mbridge/msdk/foundation/tools/q;->b(Ljava/lang/String;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private remove(BII)V
|
|
.locals 8
|
|
|
|
.line 1290
|
|
invoke-direct {p0, p2, p3}, Lcom/mbridge/msdk/foundation/tools/FastKV;->countInvalid(II)V
|
|
|
|
or-int/lit8 p1, p1, -0x80
|
|
|
|
int-to-byte p1, p1
|
|
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1292
|
|
iget-object p3, p3, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
aget-byte v0, p3, p2
|
|
|
|
and-int/lit8 v1, p2, 0x7
|
|
|
|
shl-int/lit8 v1, v1, 0x3
|
|
|
|
iget-wide v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
xor-int/2addr v0, p1
|
|
|
|
int-to-long v4, v0
|
|
|
|
const-wide/16 v6, 0xff
|
|
|
|
and-long/2addr v4, v6
|
|
|
|
shl-long v0, v4, v1
|
|
|
|
xor-long/2addr v0, v2
|
|
|
|
iput-wide v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1295
|
|
aput-byte p1, p3, p2
|
|
|
|
iput p2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->removeStart:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private resetBuffer(Ljava/nio/MappedByteBuffer;)V
|
|
.locals 8
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 206
|
|
invoke-virtual {p1}, Ljava/nio/Buffer;->capacity()I
|
|
|
|
move-result v0
|
|
|
|
sget v1, Lcom/mbridge/msdk/foundation/tools/FastKV;->PAGE_SIZE:I
|
|
|
|
if-eq v0, v1, :cond_2
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
if-ne p1, v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
:goto_0
|
|
move-object v2, v0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
goto :goto_0
|
|
|
|
:goto_1
|
|
int-to-long v3, v1
|
|
|
|
.line 208
|
|
invoke-virtual {v2, v3, v4}, Ljava/nio/channels/FileChannel;->truncate(J)Ljava/nio/channels/FileChannel;
|
|
|
|
.line 209
|
|
sget-object v3, Ljava/nio/channels/FileChannel$MapMode;->READ_WRITE:Ljava/nio/channels/FileChannel$MapMode;
|
|
|
|
const-wide/16 v4, 0x0
|
|
|
|
int-to-long v6, v1
|
|
|
|
invoke-virtual/range {v2 .. v7}, Ljava/nio/channels/FileChannel;->map(Ljava/nio/channels/FileChannel$MapMode;JJ)Ljava/nio/MappedByteBuffer;
|
|
|
|
move-result-object v0
|
|
|
|
.line 210
|
|
sget-object v1, Ljava/nio/ByteOrder;->LITTLE_ENDIAN:Ljava/nio/ByteOrder;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
if-ne p1, v1, :cond_1
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
:goto_2
|
|
move-object p1, v0
|
|
|
|
:cond_2
|
|
const/4 v0, 0x0
|
|
|
|
.line 218
|
|
invoke-virtual {p1, v0, v0}, Ljava/nio/ByteBuffer;->putInt(II)Ljava/nio/ByteBuffer;
|
|
|
|
const/4 v0, 0x4
|
|
|
|
const-wide/16 v1, 0x0
|
|
|
|
.line 219
|
|
invoke-virtual {p1, v0, v1, v2}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private resetData()V
|
|
.locals 3
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 186
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->resetBuffer(Ljava/nio/MappedByteBuffer;)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 187
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->resetBuffer(Ljava/nio/MappedByteBuffer;)V
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 189
|
|
:catch_0
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->toBlockingMode()V
|
|
|
|
.line 192
|
|
:cond_0
|
|
:goto_0
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->clearData()V
|
|
|
|
.line 193
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-static {v0}, Lcom/mbridge/msdk/foundation/tools/ar;->a(Ljava/io/File;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private saveArray(Ljava/lang/String;[BB)I
|
|
.locals 4
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->tempExternalName:Ljava/lang/String;
|
|
|
|
.line 1301
|
|
array-length v0, p2
|
|
|
|
const/16 v1, 0x800
|
|
|
|
if-ge v0, v1, :cond_0
|
|
|
|
.line 1302
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/mbridge/msdk/foundation/tools/FastKV;->wrapArray(Ljava/lang/String;[BB)I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
|
|
.line 1304
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "large value, key: "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, ", size: "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
array-length v1, p2
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->info(Ljava/lang/String;)V
|
|
|
|
.line 1305
|
|
invoke-static {}, Lcom/mbridge/msdk/foundation/tools/ar;->b()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 1306
|
|
new-instance v1, Ljava/io/File;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v1, v2, v0}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 1307
|
|
invoke-static {v1, p2}, Lcom/mbridge/msdk/foundation/tools/ar;->a(Ljava/io/File;[B)Z
|
|
|
|
move-result p2
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->tempExternalName:Ljava/lang/String;
|
|
|
|
const/16 p2, 0x20
|
|
|
|
new-array v2, p2, [B
|
|
|
|
.line 1311
|
|
invoke-virtual {v0, v1, p2, v2, v1}, Ljava/lang/String;->getBytes(II[BI)V
|
|
|
|
or-int/lit8 p2, p3, 0x40
|
|
|
|
int-to-byte p2, p2
|
|
|
|
.line 1312
|
|
invoke-direct {p0, p1, v2, p2}, Lcom/mbridge/msdk/foundation/tools/FastKV;->wrapArray(Ljava/lang/String;[BB)I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
|
|
:cond_1
|
|
const-string p1, "save large value failed"
|
|
|
|
.line 1314
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/String;)V
|
|
|
|
return v1
|
|
.end method
|
|
|
|
.method private shiftCheckSum(JI)J
|
|
.locals 2
|
|
|
|
and-int/lit8 p3, p3, 0x7
|
|
|
|
shl-int/lit8 p3, p3, 0x3
|
|
|
|
shl-long v0, p1, p3
|
|
|
|
rsub-int/lit8 p3, p3, 0x40
|
|
|
|
ushr-long/2addr p1, p3
|
|
|
|
or-long/2addr p1, v0
|
|
|
|
return-wide p1
|
|
.end method
|
|
|
|
.method private syncABBuffer(Ljava/nio/MappedByteBuffer;)V
|
|
.locals 3
|
|
|
|
iget-boolean v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->sizeChanged:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
add-int/lit8 v0, v0, -0xc
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 1327
|
|
invoke-virtual {p1, v1, v0}, Ljava/nio/ByteBuffer;->putInt(II)Ljava/nio/ByteBuffer;
|
|
|
|
:cond_0
|
|
const/4 v0, 0x4
|
|
|
|
iget-wide v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1329
|
|
invoke-virtual {p1, v0, v1, v2}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->removeStart:I
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1331
|
|
iget-object v1, v1, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
aget-byte v1, v1, v0
|
|
|
|
invoke-virtual {p1, v0, v1}, Ljava/nio/ByteBuffer;->put(IB)Ljava/nio/ByteBuffer;
|
|
|
|
:cond_1
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateSize:I
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateStart:I
|
|
|
|
.line 1334
|
|
invoke-virtual {p1, v0}, Ljava/nio/MappedByteBuffer;->position(I)Ljava/nio/Buffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1335
|
|
iget-object v0, v0, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateStart:I
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateSize:I
|
|
|
|
invoke-virtual {p1, v0, v1, v2}, Ljava/nio/ByteBuffer;->put([BII)Ljava/nio/ByteBuffer;
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|
|
|
|
.method private toBlockingMode()V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
iput v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
.line 224
|
|
invoke-static {v0}, Lcom/mbridge/msdk/foundation/tools/ar;->a(Ljava/io/Closeable;)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
.line 225
|
|
invoke-static {v0}, Lcom/mbridge/msdk/foundation/tools/ar;->a(Ljava/io/Closeable;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private truncate(I)V
|
|
.locals 10
|
|
|
|
sget v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->PAGE_SIZE:I
|
|
|
|
add-int/2addr p1, v0
|
|
|
|
.line 1346
|
|
invoke-direct {p0, v0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getNewCapacity(II)I
|
|
|
|
move-result p1
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1347
|
|
iget-object v0, v0, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
array-length v1, v0
|
|
|
|
if-lt p1, v1, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 1350
|
|
:cond_0
|
|
new-array v1, p1, [B
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
const/4 v3, 0x0
|
|
|
|
.line 1351
|
|
invoke-static {v0, v3, v1, v3, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1352
|
|
iput-object v1, v0, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
int-to-long v7, p1
|
|
|
|
.line 1355
|
|
invoke-virtual {v0, v7, v8}, Ljava/nio/channels/FileChannel;->truncate(J)Ljava/nio/channels/FileChannel;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
.line 1356
|
|
sget-object p1, Ljava/nio/channels/FileChannel$MapMode;->READ_WRITE:Ljava/nio/channels/FileChannel$MapMode;
|
|
|
|
const-wide/16 v3, 0x0
|
|
|
|
move-object v2, p1
|
|
|
|
move-wide v5, v7
|
|
|
|
invoke-virtual/range {v1 .. v6}, Ljava/nio/channels/FileChannel;->map(Ljava/nio/channels/FileChannel$MapMode;JJ)Ljava/nio/MappedByteBuffer;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1357
|
|
sget-object v9, Ljava/nio/ByteOrder;->LITTLE_ENDIAN:Ljava/nio/ByteOrder;
|
|
|
|
invoke-virtual {v0, v9}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
.line 1358
|
|
invoke-virtual {v0, v7, v8}, Ljava/nio/channels/FileChannel;->truncate(J)Ljava/nio/channels/FileChannel;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
const-wide/16 v3, 0x0
|
|
|
|
move-object v2, p1
|
|
|
|
move-wide v5, v7
|
|
|
|
.line 1359
|
|
invoke-virtual/range {v1 .. v6}, Ljava/nio/channels/FileChannel;->map(Ljava/nio/channels/FileChannel$MapMode;JJ)Ljava/nio/MappedByteBuffer;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1360
|
|
invoke-virtual {p1, v9}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 1362
|
|
new-instance v0, Ljava/lang/Exception;
|
|
|
|
const-string v1, "map failed"
|
|
|
|
invoke-direct {v0, v1, p1}, Ljava/lang/Exception;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
.line 1363
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->toBlockingMode()V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const-string p1, "truncate finish"
|
|
|
|
.line 1366
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->info(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private tryBlockingIO(Ljava/io/File;Ljava/io/File;)V
|
|
.locals 0
|
|
|
|
.line 1371
|
|
:try_start_0
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->loadWithBlockingIO(Ljava/io/File;)Z
|
|
|
|
move-result p1
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 1375
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->warning(Ljava/lang/Exception;)V
|
|
|
|
.line 1377
|
|
:cond_0
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->clearData()V
|
|
|
|
.line 1379
|
|
:try_start_1
|
|
invoke-direct {p0, p2}, Lcom/mbridge/msdk/foundation/tools/FastKV;->loadWithBlockingIO(Ljava/io/File;)Z
|
|
|
|
move-result p1
|
|
:try_end_1
|
|
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
return-void
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
.line 1383
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->warning(Ljava/lang/Exception;)V
|
|
|
|
.line 1385
|
|
:cond_1
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->clearData()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private updateBoolean(BI)V
|
|
.locals 4
|
|
|
|
iget-wide v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
const-wide/16 v2, 0x1
|
|
|
|
.line 1389
|
|
invoke-direct {p0, v2, v3, p2}, Lcom/mbridge/msdk/foundation/tools/FastKV;->shiftCheckSum(JI)J
|
|
|
|
move-result-wide v2
|
|
|
|
xor-long/2addr v0, v2
|
|
|
|
iput-wide v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
const/4 v3, 0x4
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1391
|
|
invoke-virtual {v2, v3, v0, v1}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1392
|
|
invoke-virtual {v0, p2, p1}, Ljava/nio/ByteBuffer;->put(IB)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-wide v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1393
|
|
invoke-virtual {v0, v3, v1, v2}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1394
|
|
invoke-virtual {v0, p2, p1}, Ljava/nio/ByteBuffer;->put(IB)Ljava/nio/ByteBuffer;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1396
|
|
invoke-virtual {v2, v3, v0, v1}, Lcom/mbridge/msdk/foundation/tools/q;->a(IJ)V
|
|
|
|
:goto_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1398
|
|
iget-object v0, v0, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
aput-byte p1, v0, p2
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private updateBytes(I[B)V
|
|
.locals 6
|
|
|
|
.line 1402
|
|
array-length v0, p2
|
|
|
|
iget-wide v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1403
|
|
invoke-virtual {v3, p1, v0}, Lcom/mbridge/msdk/foundation/tools/q;->a(II)J
|
|
|
|
move-result-wide v3
|
|
|
|
xor-long/2addr v1, v3
|
|
|
|
iput-wide v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1404
|
|
iput p1, v1, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
.line 1405
|
|
invoke-virtual {v1, p2}, Lcom/mbridge/msdk/foundation/tools/q;->a([B)V
|
|
|
|
iget-wide v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1406
|
|
invoke-virtual {v3, p1, v0}, Lcom/mbridge/msdk/foundation/tools/q;->a(II)J
|
|
|
|
move-result-wide v3
|
|
|
|
xor-long v0, v1, v3
|
|
|
|
iput-wide v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
const/4 v3, 0x4
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
const/4 v1, -0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 1408
|
|
invoke-virtual {v0, v2, v1}, Ljava/nio/ByteBuffer;->putInt(II)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-wide v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1409
|
|
invoke-virtual {v0, v3, v4, v5}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1410
|
|
invoke-virtual {v0, p1}, Ljava/nio/MappedByteBuffer;->position(I)Ljava/nio/Buffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1411
|
|
invoke-virtual {v0, p2}, Ljava/nio/ByteBuffer;->put([B)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
add-int/lit8 v1, v1, -0xc
|
|
|
|
.line 1412
|
|
invoke-virtual {v0, v2, v1}, Ljava/nio/ByteBuffer;->putInt(II)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-wide v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1413
|
|
invoke-virtual {v0, v3, v1, v2}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1414
|
|
invoke-virtual {v0, p1}, Ljava/nio/MappedByteBuffer;->position(I)Ljava/nio/Buffer;
|
|
|
|
iget-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1415
|
|
invoke-virtual {p1, p2}, Ljava/nio/ByteBuffer;->put([B)Ljava/nio/ByteBuffer;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1417
|
|
invoke-virtual {p1, v3, v0, v1}, Lcom/mbridge/msdk/foundation/tools/q;->a(IJ)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private updateChange()V
|
|
.locals 5
|
|
|
|
iget-wide v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
iget v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateStart:I
|
|
|
|
iget v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateSize:I
|
|
|
|
.line 1422
|
|
invoke-virtual {v2, v3, v4}, Lcom/mbridge/msdk/foundation/tools/q;->a(II)J
|
|
|
|
move-result-wide v2
|
|
|
|
xor-long/2addr v0, v2
|
|
|
|
iput-wide v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
const/4 v2, -0x1
|
|
|
|
.line 1429
|
|
invoke-virtual {v0, v1, v2}, Ljava/nio/ByteBuffer;->putInt(II)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1430
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->syncABBuffer(Ljava/nio/MappedByteBuffer;)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
add-int/lit8 v2, v2, -0xc
|
|
|
|
.line 1431
|
|
invoke-virtual {v0, v1, v2}, Ljava/nio/ByteBuffer;->putInt(II)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1436
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->syncABBuffer(Ljava/nio/MappedByteBuffer;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-boolean v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->sizeChanged:Z
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
add-int/lit8 v2, v2, -0xc
|
|
|
|
.line 1439
|
|
invoke-virtual {v0, v1, v2}, Lcom/mbridge/msdk/foundation/tools/q;->b(II)V
|
|
|
|
:cond_1
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
const/4 v2, 0x4
|
|
|
|
iget-wide v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1441
|
|
invoke-virtual {v0, v2, v3, v4}, Lcom/mbridge/msdk/foundation/tools/q;->a(IJ)V
|
|
|
|
:goto_0
|
|
iput-boolean v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->sizeChanged:Z
|
|
|
|
iput v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->removeStart:I
|
|
|
|
iput v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateSize:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private updateInt32(IJI)V
|
|
.locals 4
|
|
|
|
iget-wide v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1449
|
|
invoke-direct {p0, p2, p3, p4}, Lcom/mbridge/msdk/foundation/tools/FastKV;->shiftCheckSum(JI)J
|
|
|
|
move-result-wide p2
|
|
|
|
xor-long/2addr p2, v0
|
|
|
|
iput-wide p2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
const/4 v1, 0x4
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1451
|
|
invoke-virtual {v0, v1, p2, p3}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object p2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1452
|
|
invoke-virtual {p2, p4, p1}, Ljava/nio/ByteBuffer;->putInt(II)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object p2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-wide v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1453
|
|
invoke-virtual {p2, v1, v2, v3}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object p2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1454
|
|
invoke-virtual {p2, p4, p1}, Ljava/nio/ByteBuffer;->putInt(II)Ljava/nio/ByteBuffer;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1456
|
|
invoke-virtual {v0, v1, p2, p3}, Lcom/mbridge/msdk/foundation/tools/q;->a(IJ)V
|
|
|
|
:goto_0
|
|
iget-object p2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1458
|
|
invoke-virtual {p2, p4, p1}, Lcom/mbridge/msdk/foundation/tools/q;->b(II)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private updateInt64(JJI)V
|
|
.locals 4
|
|
|
|
iget-wide v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1462
|
|
invoke-direct {p0, p3, p4, p5}, Lcom/mbridge/msdk/foundation/tools/FastKV;->shiftCheckSum(JI)J
|
|
|
|
move-result-wide p3
|
|
|
|
xor-long/2addr p3, v0
|
|
|
|
iput-wide p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
const/4 v1, 0x4
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1464
|
|
invoke-virtual {v0, v1, p3, p4}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1465
|
|
invoke-virtual {p3, p5, p1, p2}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-wide v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1466
|
|
invoke-virtual {p3, v1, v2, v3}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1467
|
|
invoke-virtual {p3, p5, p1, p2}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1469
|
|
invoke-virtual {v0, v1, p3, p4}, Lcom/mbridge/msdk/foundation/tools/q;->a(IJ)V
|
|
|
|
:goto_0
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1471
|
|
invoke-virtual {p3, p5, p1, p2}, Lcom/mbridge/msdk/foundation/tools/q;->a(IJ)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private updateObject(Ljava/lang/String;Ljava/lang/Object;[BLcom/mbridge/msdk/foundation/tools/g$j;)V
|
|
.locals 6
|
|
|
|
.line 1475
|
|
invoke-virtual {p4}, Lcom/mbridge/msdk/foundation/tools/g$b;->a()B
|
|
|
|
move-result v0
|
|
|
|
invoke-direct {p0, p1, p3, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->saveArray(Ljava/lang/String;[BB)I
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
.line 1477
|
|
iget-boolean v0, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->b:Z
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
check-cast v0, Ljava/lang/String;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-object v0, v1
|
|
|
|
.line 1478
|
|
:goto_0
|
|
invoke-virtual {p4}, Lcom/mbridge/msdk/foundation/tools/g$b;->a()B
|
|
|
|
move-result v2
|
|
|
|
iget v3, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->c:I
|
|
|
|
iget v4, p4, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
iget v5, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->e:I
|
|
|
|
add-int/2addr v4, v5
|
|
|
|
invoke-direct {p0, v2, v3, v4}, Lcom/mbridge/msdk/foundation/tools/FastKV;->remove(BII)V
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->tempExternalName:Ljava/lang/String;
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
const/4 v3, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
iget v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateStart:I
|
|
|
|
.line 1480
|
|
iput v4, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->c:I
|
|
|
|
.line 1481
|
|
iput p1, p4, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
.line 1482
|
|
iput-boolean v3, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->b:Z
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
.line 1484
|
|
iput-object v2, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
const/16 p1, 0x20
|
|
|
|
.line 1485
|
|
iput p1, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->e:I
|
|
|
|
iput-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->tempExternalName:Ljava/lang/String;
|
|
|
|
goto :goto_2
|
|
|
|
.line 1488
|
|
:cond_2
|
|
iput-object p2, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
.line 1489
|
|
array-length p1, p3
|
|
|
|
iput p1, p4, Lcom/mbridge/msdk/foundation/tools/g$j;->e:I
|
|
|
|
.line 1491
|
|
:goto_2
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateChange()V
|
|
|
|
.line 1492
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkGC()V
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
.line 1494
|
|
new-instance p1, Ljava/io/File;
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2, v0}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-static {p1}, Lcom/mbridge/msdk/foundation/tools/ar;->a(Ljava/io/File;)V
|
|
|
|
:cond_3
|
|
return-void
|
|
.end method
|
|
|
|
.method private updateOffset(I[I)V
|
|
.locals 7
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1500
|
|
invoke-interface {v0}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object v0
|
|
|
|
.line 1501
|
|
invoke-interface {v0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/mbridge/msdk/foundation/tools/g$b;
|
|
|
|
.line 1502
|
|
iget v2, v1, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
if-le v2, p1, :cond_0
|
|
|
|
.line 5016
|
|
array-length v3, p2
|
|
|
|
shr-int/lit8 v3, v3, 0x1
|
|
|
|
add-int/lit8 v3, v3, -0x1
|
|
|
|
const/4 v4, 0x0
|
|
|
|
:goto_1
|
|
if-gt v4, v3, :cond_3
|
|
|
|
add-int v5, v4, v3
|
|
|
|
ushr-int/lit8 v5, v5, 0x1
|
|
|
|
shl-int/lit8 v6, v5, 0x1
|
|
|
|
.line 5019
|
|
aget v6, p2, v6
|
|
|
|
if-ge v6, v2, :cond_1
|
|
|
|
add-int/lit8 v5, v5, 0x1
|
|
|
|
move v4, v5
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
if-le v6, v2, :cond_2
|
|
|
|
add-int/lit8 v5, v5, -0x1
|
|
|
|
move v3, v5
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
move v3, v5
|
|
|
|
:cond_3
|
|
shl-int/lit8 v2, v3, 0x1
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
.line 1504
|
|
aget v2, p2, v2
|
|
|
|
.line 1505
|
|
iget v3, v1, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
sub-int/2addr v3, v2
|
|
|
|
iput v3, v1, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
.line 1506
|
|
invoke-virtual {v1}, Lcom/mbridge/msdk/foundation/tools/g$b;->a()B
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x6
|
|
|
|
if-lt v3, v4, :cond_0
|
|
|
|
.line 1507
|
|
check-cast v1, Lcom/mbridge/msdk/foundation/tools/g$j;
|
|
|
|
iget v3, v1, Lcom/mbridge/msdk/foundation/tools/g$j;->c:I
|
|
|
|
sub-int/2addr v3, v2
|
|
|
|
iput v3, v1, Lcom/mbridge/msdk/foundation/tools/g$j;->c:I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
return-void
|
|
.end method
|
|
|
|
.method private warning(Ljava/lang/Exception;)V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->logger:Lcom/mbridge/msdk/foundation/tools/FastKV$b;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
.line 300
|
|
invoke-interface {v0, v1, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV$b;->b(Ljava/lang/String;Ljava/lang/Exception;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private wrapArray(Ljava/lang/String;[BB)I
|
|
.locals 1
|
|
|
|
.line 1514
|
|
array-length v0, p2
|
|
|
|
add-int/lit8 v0, v0, 0x2
|
|
|
|
invoke-direct {p0, p1, p3, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->wrapHeader(Ljava/lang/String;BI)V
|
|
|
|
iget-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1515
|
|
array-length p3, p2
|
|
|
|
int-to-short p3, p3
|
|
|
|
invoke-virtual {p1, p3}, Lcom/mbridge/msdk/foundation/tools/q;->a(S)V
|
|
|
|
iget-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1516
|
|
iget p3, p1, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
.line 1517
|
|
invoke-virtual {p1, p2}, Lcom/mbridge/msdk/foundation/tools/q;->a([B)V
|
|
|
|
return p3
|
|
.end method
|
|
|
|
.method private wrapHeader(Ljava/lang/String;B)V
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->TYPE_SIZE:[I
|
|
|
|
.line 1522
|
|
aget v0, v0, p2
|
|
|
|
invoke-direct {p0, p1, p2, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->wrapHeader(Ljava/lang/String;BI)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private wrapHeader(Ljava/lang/String;BI)V
|
|
.locals 2
|
|
|
|
.line 1526
|
|
invoke-static {p1}, Lcom/mbridge/msdk/foundation/tools/q;->a(Ljava/lang/String;)I
|
|
|
|
move-result v0
|
|
|
|
.line 1527
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkKeySize(I)V
|
|
|
|
add-int/lit8 v1, v0, 0x2
|
|
|
|
add-int/2addr v1, p3
|
|
|
|
iput v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateSize:I
|
|
|
|
.line 1529
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->preparePutBytes()V
|
|
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1530
|
|
invoke-virtual {p3, p2}, Lcom/mbridge/msdk/foundation/tools/q;->a(B)V
|
|
|
|
.line 1531
|
|
invoke-direct {p0, p1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putKey(Ljava/lang/String;I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private writeToABFile(Lcom/mbridge/msdk/foundation/tools/q;)Z
|
|
.locals 12
|
|
|
|
const-string v0, "rw"
|
|
|
|
.line 1535
|
|
iget-object v1, p1, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
array-length v1, v1
|
|
|
|
.line 1536
|
|
new-instance v2, Ljava/io/File;
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
new-instance v4, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v5, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v5, ".kva"
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-direct {v2, v3, v4}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 1537
|
|
new-instance v3, Ljava/io/File;
|
|
|
|
iget-object v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
new-instance v5, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v6, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v6, ".kvb"
|
|
|
|
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-direct {v3, v4, v5}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const/4 v4, 0x0
|
|
|
|
.line 1539
|
|
:try_start_0
|
|
invoke-static {v2}, Lcom/mbridge/msdk/foundation/tools/ar;->c(Ljava/io/File;)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_0
|
|
|
|
invoke-static {v3}, Lcom/mbridge/msdk/foundation/tools/ar;->c(Ljava/io/File;)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_0
|
|
|
|
.line 1542
|
|
new-instance v5, Ljava/io/RandomAccessFile;
|
|
|
|
invoke-direct {v5, v2, v0}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
.line 1543
|
|
new-instance v2, Ljava/io/RandomAccessFile;
|
|
|
|
invoke-direct {v2, v3, v0}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
int-to-long v0, v1
|
|
|
|
.line 1544
|
|
invoke-virtual {v5, v0, v1}, Ljava/io/RandomAccessFile;->setLength(J)V
|
|
|
|
.line 1545
|
|
invoke-virtual {v2, v0, v1}, Ljava/io/RandomAccessFile;->setLength(J)V
|
|
|
|
.line 1546
|
|
invoke-virtual {v5}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;
|
|
|
|
move-result-object v3
|
|
|
|
iput-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
.line 1547
|
|
invoke-virtual {v2}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;
|
|
|
|
move-result-object v2
|
|
|
|
iput-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
iget-object v6, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
.line 1548
|
|
sget-object v2, Ljava/nio/channels/FileChannel$MapMode;->READ_WRITE:Ljava/nio/channels/FileChannel$MapMode;
|
|
|
|
const-wide/16 v8, 0x0
|
|
|
|
move-object v7, v2
|
|
|
|
move-wide v10, v0
|
|
|
|
invoke-virtual/range {v6 .. v11}, Ljava/nio/channels/FileChannel;->map(Ljava/nio/channels/FileChannel$MapMode;JJ)Ljava/nio/MappedByteBuffer;
|
|
|
|
move-result-object v3
|
|
|
|
iput-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1549
|
|
sget-object v5, Ljava/nio/ByteOrder;->LITTLE_ENDIAN:Ljava/nio/ByteOrder;
|
|
|
|
invoke-virtual {v3, v5}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v6, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bChannel:Ljava/nio/channels/FileChannel;
|
|
|
|
const-wide/16 v8, 0x0
|
|
|
|
move-object v7, v2
|
|
|
|
move-wide v10, v0
|
|
|
|
.line 1550
|
|
invoke-virtual/range {v6 .. v11}, Ljava/nio/channels/FileChannel;->map(Ljava/nio/channels/FileChannel$MapMode;JJ)Ljava/nio/MappedByteBuffer;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1551
|
|
invoke-virtual {v0, v5}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1552
|
|
iget-object v1, p1, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
invoke-virtual {v0, v1, v4, v2}, Ljava/nio/ByteBuffer;->put([BII)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 1553
|
|
iget-object p1, p1, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
invoke-virtual {v0, p1, v4, v1}, Ljava/nio/ByteBuffer;->put([BII)Ljava/nio/ByteBuffer;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
goto :goto_0
|
|
|
|
.line 1540
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/Exception;
|
|
|
|
const-string v0, "open file failed"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
.line 1556
|
|
:goto_0
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
return v4
|
|
.end method
|
|
|
|
.method private declared-synchronized writeToCFile()Z
|
|
.locals 6
|
|
|
|
monitor-enter p0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 277
|
|
:try_start_0
|
|
new-instance v1, Ljava/io/File;
|
|
|
|
iget-object v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v4, ".tmp"
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {v1, v2, v3}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 278
|
|
invoke-static {v1}, Lcom/mbridge/msdk/foundation/tools/ar;->c(Ljava/io/File;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
.line 279
|
|
new-instance v2, Ljava/io/RandomAccessFile;
|
|
|
|
const-string v3, "rw"
|
|
|
|
invoke-direct {v2, v1, v3}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
iget v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
int-to-long v3, v3
|
|
|
|
.line 280
|
|
invoke-virtual {v2, v3, v4}, Ljava/io/RandomAccessFile;->setLength(J)V
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 281
|
|
iget-object v3, v3, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
invoke-virtual {v2, v3, v0, v4}, Ljava/io/RandomAccessFile;->write([BII)V
|
|
|
|
.line 282
|
|
invoke-virtual {v2}, Ljava/io/RandomAccessFile;->close()V
|
|
|
|
.line 283
|
|
new-instance v2, Ljava/io/File;
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
new-instance v4, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v5, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v5, ".kvc"
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-direct {v2, v3, v4}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 284
|
|
invoke-virtual {v2}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
invoke-virtual {v2}, Ljava/io/File;->delete()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
goto :goto_3
|
|
|
|
:catch_0
|
|
move-exception v1
|
|
|
|
goto :goto_1
|
|
|
|
.line 285
|
|
:cond_0
|
|
:goto_0
|
|
invoke-virtual {v1, v2}, Ljava/io/File;->renameTo(Ljava/io/File;)Z
|
|
|
|
move-result v1
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
.line 286
|
|
monitor-exit p0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
return v0
|
|
|
|
.line 288
|
|
:cond_1
|
|
:try_start_1
|
|
new-instance v1, Ljava/lang/Exception;
|
|
|
|
const-string v2, "rename failed"
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, v1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->warning(Ljava/lang/Exception;)V
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
goto :goto_2
|
|
|
|
.line 293
|
|
:goto_1
|
|
:try_start_2
|
|
invoke-direct {p0, v1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
.line 295
|
|
:cond_2
|
|
:goto_2
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:goto_3
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public declared-synchronized clear()V
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
.line 177
|
|
:try_start_0
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->resetData()V
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 179
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->deleteCFiles()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
goto :goto_1
|
|
|
|
.line 181
|
|
:cond_0
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public declared-synchronized commit()Z
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:try_start_0
|
|
iput-boolean v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->autoCommit:Z
|
|
|
|
.line 258
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->commitToCFile()Z
|
|
|
|
move-result v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public declared-synchronized contains(Ljava/lang/String;)Z
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 305
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return p1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized disableAutoCommit()V
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
iput-boolean v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->autoCommit:Z
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 341
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public declared-synchronized force()V
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 440
|
|
invoke-virtual {v0}, Ljava/nio/MappedByteBuffer;->force()Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 441
|
|
invoke-virtual {v0}, Ljava/nio/MappedByteBuffer;->force()Ljava/nio/MappedByteBuffer;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
goto :goto_1
|
|
|
|
.line 443
|
|
:cond_0
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public gc(I)V
|
|
.locals 17
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
.line 446
|
|
invoke-static {v1}, Ljava/util/Collections;->sort(Ljava/util/List;)V
|
|
|
|
.line 447
|
|
invoke-direct/range {p0 .. p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->mergeInvalids()V
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 449
|
|
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/mbridge/msdk/foundation/tools/FastKV$c;
|
|
|
|
.line 450
|
|
iget v3, v1, Lcom/mbridge/msdk/foundation/tools/FastKV$c;->b:I
|
|
|
|
iget v4, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
iget v5, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalidBytes:I
|
|
|
|
sub-int v5, v4, v5
|
|
|
|
add-int/lit8 v6, v5, -0xc
|
|
|
|
sub-int v7, v5, v3
|
|
|
|
sub-int/2addr v4, v3
|
|
|
|
add-int v8, v4, v7
|
|
|
|
const/4 v9, 0x1
|
|
|
|
if-ge v6, v8, :cond_0
|
|
|
|
move v8, v9
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move v8, v2
|
|
|
|
:goto_0
|
|
if-nez v8, :cond_1
|
|
|
|
iget-wide v10, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
iget-object v12, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 457
|
|
invoke-virtual {v12, v3, v4}, Lcom/mbridge/msdk/foundation/tools/q;->a(II)J
|
|
|
|
move-result-wide v12
|
|
|
|
xor-long/2addr v10, v12
|
|
|
|
iput-wide v10, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
:cond_1
|
|
iget-object v4, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
.line 460
|
|
invoke-virtual {v4}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v4
|
|
|
|
iget v10, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
iget-object v11, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
add-int/lit8 v12, v4, -0x1
|
|
|
|
.line 461
|
|
invoke-virtual {v11, v12}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v11
|
|
|
|
check-cast v11, Lcom/mbridge/msdk/foundation/tools/FastKV$c;
|
|
|
|
iget v11, v11, Lcom/mbridge/msdk/foundation/tools/FastKV$c;->a:I
|
|
|
|
sub-int/2addr v10, v11
|
|
|
|
if-lez v10, :cond_2
|
|
|
|
move v11, v4
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
move v11, v12
|
|
|
|
:goto_1
|
|
shl-int/2addr v11, v9
|
|
|
|
.line 463
|
|
new-array v11, v11, [I
|
|
|
|
.line 464
|
|
iget v13, v1, Lcom/mbridge/msdk/foundation/tools/FastKV$c;->b:I
|
|
|
|
.line 465
|
|
iget v1, v1, Lcom/mbridge/msdk/foundation/tools/FastKV$c;->a:I
|
|
|
|
move v14, v9
|
|
|
|
:goto_2
|
|
if-ge v14, v4, :cond_3
|
|
|
|
iget-object v15, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->invalids:Ljava/util/ArrayList;
|
|
|
|
.line 467
|
|
invoke-virtual {v15, v14}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v15
|
|
|
|
check-cast v15, Lcom/mbridge/msdk/foundation/tools/FastKV$c;
|
|
|
|
.line 468
|
|
iget v2, v15, Lcom/mbridge/msdk/foundation/tools/FastKV$c;->b:I
|
|
|
|
sub-int/2addr v2, v1
|
|
|
|
iget-object v9, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 469
|
|
iget-object v9, v9, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
invoke-static {v9, v1, v9, v13, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
|
|
|
|
add-int/lit8 v9, v14, -0x1
|
|
|
|
const/16 v16, 0x1
|
|
|
|
shl-int/lit8 v9, v9, 0x1
|
|
|
|
.line 471
|
|
aput v1, v11, v9
|
|
|
|
add-int/lit8 v9, v9, 0x1
|
|
|
|
sub-int/2addr v1, v13
|
|
|
|
.line 472
|
|
aput v1, v11, v9
|
|
|
|
add-int/2addr v13, v2
|
|
|
|
.line 474
|
|
iget v1, v15, Lcom/mbridge/msdk/foundation/tools/FastKV$c;->a:I
|
|
|
|
add-int/lit8 v14, v14, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v9, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
if-lez v10, :cond_4
|
|
|
|
iget-object v2, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 477
|
|
iget-object v2, v2, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
invoke-static {v2, v1, v2, v13, v10}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
|
|
|
|
const/4 v2, 0x1
|
|
|
|
shl-int/lit8 v4, v12, 0x1
|
|
|
|
.line 479
|
|
aput v1, v11, v4
|
|
|
|
add-int/2addr v4, v2
|
|
|
|
sub-int/2addr v1, v13
|
|
|
|
.line 480
|
|
aput v1, v11, v4
|
|
|
|
.line 482
|
|
:cond_4
|
|
invoke-direct/range {p0 .. p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->clearInvalid()V
|
|
|
|
if-eqz v8, :cond_5
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
const/16 v2, 0xc
|
|
|
|
.line 485
|
|
invoke-virtual {v1, v2, v6}, Lcom/mbridge/msdk/foundation/tools/q;->a(II)J
|
|
|
|
move-result-wide v1
|
|
|
|
iput-wide v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
goto :goto_3
|
|
|
|
:cond_5
|
|
iget-wide v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
iget-object v4, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 487
|
|
invoke-virtual {v4, v3, v7}, Lcom/mbridge/msdk/foundation/tools/q;->a(II)J
|
|
|
|
move-result-wide v8
|
|
|
|
xor-long/2addr v1, v8
|
|
|
|
iput-wide v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
:goto_3
|
|
iput v5, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->dataEnd:I
|
|
|
|
iget v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
const/4 v2, 0x4
|
|
|
|
if-nez v1, :cond_6
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
const/4 v4, -0x1
|
|
|
|
const/4 v8, 0x0
|
|
|
|
.line 492
|
|
invoke-virtual {v1, v8, v4}, Ljava/nio/ByteBuffer;->putInt(II)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-wide v9, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 493
|
|
invoke-virtual {v1, v2, v9, v10}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 494
|
|
invoke-virtual {v1, v3}, Ljava/nio/MappedByteBuffer;->position(I)Ljava/nio/Buffer;
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-object v4, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 495
|
|
iget-object v4, v4, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
invoke-virtual {v1, v4, v3, v7}, Ljava/nio/ByteBuffer;->put([BII)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 496
|
|
invoke-virtual {v1, v8, v6}, Ljava/nio/ByteBuffer;->putInt(II)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 497
|
|
invoke-virtual {v1, v8, v6}, Ljava/nio/ByteBuffer;->putInt(II)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-wide v8, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 498
|
|
invoke-virtual {v1, v2, v8, v9}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
.line 499
|
|
invoke-virtual {v1, v3}, Ljava/nio/MappedByteBuffer;->position(I)Ljava/nio/Buffer;
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-object v2, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 500
|
|
iget-object v2, v2, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
invoke-virtual {v1, v2, v3, v7}, Ljava/nio/ByteBuffer;->put([BII)Ljava/nio/ByteBuffer;
|
|
|
|
goto :goto_4
|
|
|
|
:cond_6
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
.line 502
|
|
invoke-virtual {v1, v4, v6}, Lcom/mbridge/msdk/foundation/tools/q;->b(II)V
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
iget-wide v6, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 503
|
|
invoke-virtual {v1, v2, v6, v7}, Lcom/mbridge/msdk/foundation/tools/q;->a(IJ)V
|
|
|
|
.line 506
|
|
:goto_4
|
|
invoke-direct {v0, v3, v11}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateOffset(I[I)V
|
|
|
|
add-int v5, v5, p1
|
|
|
|
iget-object v1, v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 508
|
|
iget-object v1, v1, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
array-length v1, v1
|
|
|
|
sub-int/2addr v1, v5
|
|
|
|
sget v2, Lcom/mbridge/msdk/foundation/tools/FastKV;->TRUNCATE_THRESHOLD:I
|
|
|
|
if-le v1, v2, :cond_7
|
|
|
|
.line 509
|
|
invoke-direct {v0, v5}, Lcom/mbridge/msdk/foundation/tools/FastKV;->truncate(I)V
|
|
|
|
:cond_7
|
|
const-string v1, "gc finish"
|
|
|
|
.line 511
|
|
invoke-direct {v0, v1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->info(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public declared-synchronized getAll()Ljava/util/Map;
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/Object;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 515
|
|
invoke-interface {v0}, Ljava/util/Map;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 517
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-object v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
goto/16 :goto_2
|
|
|
|
.line 519
|
|
:cond_0
|
|
:try_start_1
|
|
new-instance v1, Ljava/util/HashMap;
|
|
|
|
mul-int/lit8 v0, v0, 0x4
|
|
|
|
div-int/lit8 v0, v0, 0x3
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
invoke-direct {v1, v0}, Ljava/util/HashMap;-><init>(I)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 520
|
|
invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/util/Map$Entry;
|
|
|
|
.line 521
|
|
invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/lang/String;
|
|
|
|
.line 522
|
|
invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/mbridge/msdk/foundation/tools/g$b;
|
|
|
|
.line 524
|
|
invoke-virtual {v2}, Lcom/mbridge/msdk/foundation/tools/g$b;->a()B
|
|
|
|
move-result v4
|
|
|
|
packed-switch v4, :pswitch_data_0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
.line 549
|
|
:pswitch_0
|
|
move-object v4, v2
|
|
|
|
check-cast v4, Lcom/mbridge/msdk/foundation/tools/g$h;
|
|
|
|
.line 550
|
|
iget-boolean v5, v4, Lcom/mbridge/msdk/foundation/tools/g$j;->b:Z
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
invoke-direct {p0, v4}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getObjectFromFile(Lcom/mbridge/msdk/foundation/tools/g$h;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
check-cast v2, Lcom/mbridge/msdk/foundation/tools/g$h;
|
|
|
|
iget-object v2, v2, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
goto :goto_1
|
|
|
|
.line 545
|
|
:pswitch_1
|
|
check-cast v2, Lcom/mbridge/msdk/foundation/tools/g$a;
|
|
|
|
.line 546
|
|
iget-boolean v4, v2, Lcom/mbridge/msdk/foundation/tools/g$j;->b:Z
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
invoke-direct {p0, v2}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getArrayFromFile(Lcom/mbridge/msdk/foundation/tools/g$a;)[B
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
iget-object v2, v2, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
goto :goto_1
|
|
|
|
.line 541
|
|
:pswitch_2
|
|
check-cast v2, Lcom/mbridge/msdk/foundation/tools/g$i;
|
|
|
|
.line 542
|
|
iget-boolean v4, v2, Lcom/mbridge/msdk/foundation/tools/g$j;->b:Z
|
|
|
|
if-eqz v4, :cond_3
|
|
|
|
invoke-direct {p0, v2}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getStringFromFile(Lcom/mbridge/msdk/foundation/tools/g$i;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
iget-object v2, v2, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
goto :goto_1
|
|
|
|
.line 538
|
|
:pswitch_3
|
|
check-cast v2, Lcom/mbridge/msdk/foundation/tools/g$d;
|
|
|
|
iget-wide v4, v2, Lcom/mbridge/msdk/foundation/tools/g$d;->b:D
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/Double;->valueOf(D)Ljava/lang/Double;
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_1
|
|
|
|
.line 535
|
|
:pswitch_4
|
|
check-cast v2, Lcom/mbridge/msdk/foundation/tools/g$g;
|
|
|
|
iget-wide v4, v2, Lcom/mbridge/msdk/foundation/tools/g$g;->b:J
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_1
|
|
|
|
.line 532
|
|
:pswitch_5
|
|
check-cast v2, Lcom/mbridge/msdk/foundation/tools/g$e;
|
|
|
|
iget v2, v2, Lcom/mbridge/msdk/foundation/tools/g$e;->b:F
|
|
|
|
invoke-static {v2}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_1
|
|
|
|
.line 529
|
|
:pswitch_6
|
|
check-cast v2, Lcom/mbridge/msdk/foundation/tools/g$f;
|
|
|
|
iget v2, v2, Lcom/mbridge/msdk/foundation/tools/g$f;->b:I
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_1
|
|
|
|
.line 526
|
|
:pswitch_7
|
|
check-cast v2, Lcom/mbridge/msdk/foundation/tools/g$c;
|
|
|
|
iget-boolean v2, v2, Lcom/mbridge/msdk/foundation/tools/g$c;->b:Z
|
|
|
|
invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
|
|
|
|
move-result-object v2
|
|
|
|
.line 553
|
|
:goto_1
|
|
invoke-interface {v1, v3, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 555
|
|
:cond_4
|
|
monitor-exit p0
|
|
|
|
return-object v1
|
|
|
|
:goto_2
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
|
|
:pswitch_data_0
|
|
.packed-switch 0x1
|
|
:pswitch_7
|
|
:pswitch_6
|
|
:pswitch_5
|
|
:pswitch_4
|
|
:pswitch_3
|
|
:pswitch_2
|
|
:pswitch_1
|
|
:pswitch_0
|
|
.end packed-switch
|
|
.end method
|
|
|
|
.method public getArray(Ljava/lang/String;)[B
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->EMPTY_ARRAY:[B
|
|
|
|
.line 616
|
|
invoke-virtual {p0, p1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getArray(Ljava/lang/String;[B)[B
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public declared-synchronized getArray(Ljava/lang/String;[B)[B
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 620
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/mbridge/msdk/foundation/tools/g$a;
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 622
|
|
iget-boolean p2, p1, Lcom/mbridge/msdk/foundation/tools/g$j;->b:Z
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getArrayFromFile(Lcom/mbridge/msdk/foundation/tools/g$a;)[B
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
iget-object p1, p1, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
check-cast p1, [B
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-object p1
|
|
|
|
.line 624
|
|
:cond_1
|
|
monitor-exit p0
|
|
|
|
return-object p2
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized getBoolean(Ljava/lang/String;)Z
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 628
|
|
:try_start_0
|
|
invoke-virtual {p0, p1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getBoolean(Ljava/lang/String;Z)Z
|
|
|
|
move-result p1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return p1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized getBoolean(Ljava/lang/String;Z)Z
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 632
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/mbridge/msdk/foundation/tools/g$c;
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 633
|
|
:cond_0
|
|
iget-boolean p2, p1, Lcom/mbridge/msdk/foundation/tools/g$c;->b:Z
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return p2
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public getDouble(Ljava/lang/String;)D
|
|
.locals 2
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
.line 637
|
|
invoke-virtual {p0, p1, v0, v1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getDouble(Ljava/lang/String;D)D
|
|
|
|
move-result-wide v0
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public declared-synchronized getDouble(Ljava/lang/String;D)D
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 641
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/mbridge/msdk/foundation/tools/g$d;
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 642
|
|
:cond_0
|
|
iget-wide p2, p1, Lcom/mbridge/msdk/foundation/tools/g$d;->b:D
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-wide p2
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public getFloat(Ljava/lang/String;)F
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 646
|
|
invoke-virtual {p0, p1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getFloat(Ljava/lang/String;F)F
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public declared-synchronized getFloat(Ljava/lang/String;F)F
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 650
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/mbridge/msdk/foundation/tools/g$e;
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 651
|
|
:cond_0
|
|
iget p2, p1, Lcom/mbridge/msdk/foundation/tools/g$e;->b:F
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return p2
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public getInt(Ljava/lang/String;)I
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 655
|
|
invoke-virtual {p0, p1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getInt(Ljava/lang/String;I)I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public declared-synchronized getInt(Ljava/lang/String;I)I
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 659
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/mbridge/msdk/foundation/tools/g$f;
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 660
|
|
:cond_0
|
|
iget p2, p1, Lcom/mbridge/msdk/foundation/tools/g$f;->b:I
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return p2
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized getLong(Ljava/lang/String;)J
|
|
.locals 2
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 664
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/mbridge/msdk/foundation/tools/g$g;
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
.line 665
|
|
:cond_0
|
|
iget-wide v0, p1, Lcom/mbridge/msdk/foundation/tools/g$g;->b:J
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-wide v0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized getLong(Ljava/lang/String;J)J
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 669
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/mbridge/msdk/foundation/tools/g$g;
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 670
|
|
:cond_0
|
|
iget-wide p2, p1, Lcom/mbridge/msdk/foundation/tools/g$g;->b:J
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-wide p2
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized getObject(Ljava/lang/String;)Ljava/lang/Object;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/lang/String;",
|
|
")TT;"
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 709
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/mbridge/msdk/foundation/tools/g$h;
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 711
|
|
iget-boolean v0, p1, Lcom/mbridge/msdk/foundation/tools/g$j;->b:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getObjectFromFile(Lcom/mbridge/msdk/foundation/tools/g$h;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
iget-object p1, p1, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-object p1
|
|
|
|
.line 713
|
|
:cond_1
|
|
monitor-exit p0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public getString(Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 1
|
|
|
|
const-string v0, ""
|
|
|
|
.line 692
|
|
invoke-virtual {p0, p1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public declared-synchronized getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 696
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/mbridge/msdk/foundation/tools/g$i;
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 698
|
|
iget-boolean p2, p1, Lcom/mbridge/msdk/foundation/tools/g$j;->b:Z
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getStringFromFile(Lcom/mbridge/msdk/foundation/tools/g$i;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
iget-object p1, p1, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
check-cast p1, Ljava/lang/String;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-object p1
|
|
|
|
.line 700
|
|
:cond_1
|
|
monitor-exit p0
|
|
|
|
return-object p2
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized getStringSet(Ljava/lang/String;)Ljava/util/Set;
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
")",
|
|
"Ljava/util/Set<",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
.line 704
|
|
:try_start_0
|
|
invoke-virtual {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->getObject(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Ljava/util/Set;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-object p1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public putAll(Ljava/util/Map;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/Object;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1017
|
|
invoke-virtual {p0, p1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putAll(Ljava/util/Map;Ljava/util/Map;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public declared-synchronized putAll(Ljava/util/Map;Ljava/util/Map;)V
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/Object;",
|
|
">;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Class;",
|
|
"Lcom/mbridge/msdk/foundation/tools/FastKV$a;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1022
|
|
:try_start_0
|
|
invoke-interface {p1}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {p1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_b
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/Map$Entry;
|
|
|
|
.line 1023
|
|
invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/String;
|
|
|
|
.line 1024
|
|
invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 1025
|
|
invoke-virtual {v1}, Ljava/lang/String;->isEmpty()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
.line 1026
|
|
instance-of v2, v0, Ljava/lang/String;
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 1027
|
|
check-cast v0, Ljava/lang/String;
|
|
|
|
invoke-virtual {p0, v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putString(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto/16 :goto_1
|
|
|
|
.line 1028
|
|
:cond_1
|
|
instance-of v2, v0, Ljava/lang/Boolean;
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
.line 1029
|
|
check-cast v0, Ljava/lang/Boolean;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0, v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putBoolean(Ljava/lang/String;Z)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 1030
|
|
:cond_2
|
|
instance-of v2, v0, Ljava/lang/Integer;
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
.line 1031
|
|
check-cast v0, Ljava/lang/Integer;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0, v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putInt(Ljava/lang/String;I)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 1032
|
|
:cond_3
|
|
instance-of v2, v0, Ljava/lang/Long;
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
.line 1033
|
|
check-cast v0, Ljava/lang/Long;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-virtual {p0, v1, v2, v3}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putLong(Ljava/lang/String;J)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 1034
|
|
:cond_4
|
|
instance-of v2, v0, Ljava/lang/Float;
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
.line 1035
|
|
check-cast v0, Ljava/lang/Float;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Float;->floatValue()F
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0, v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putFloat(Ljava/lang/String;F)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 1036
|
|
:cond_5
|
|
instance-of v2, v0, Ljava/lang/Double;
|
|
|
|
if-eqz v2, :cond_6
|
|
|
|
.line 1037
|
|
check-cast v0, Ljava/lang/Double;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Double;->doubleValue()D
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-virtual {p0, v1, v2, v3}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putDouble(Ljava/lang/String;D)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 1038
|
|
:cond_6
|
|
instance-of v2, v0, Ljava/util/Set;
|
|
|
|
if-eqz v2, :cond_7
|
|
|
|
.line 1039
|
|
move-object v2, v0
|
|
|
|
check-cast v2, Ljava/util/Set;
|
|
|
|
.line 1040
|
|
invoke-interface {v2}, Ljava/util/Set;->isEmpty()Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_0
|
|
|
|
invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
instance-of v2, v2, Ljava/lang/String;
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
.line 1042
|
|
check-cast v0, Ljava/util/Set;
|
|
|
|
invoke-virtual {p0, v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putStringSet(Ljava/lang/String;Ljava/util/Set;)V
|
|
|
|
goto/16 :goto_0
|
|
|
|
.line 1044
|
|
:cond_7
|
|
instance-of v2, v0, [B
|
|
|
|
if-eqz v2, :cond_8
|
|
|
|
.line 1045
|
|
check-cast v0, [B
|
|
|
|
invoke-virtual {p0, v1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putArray(Ljava/lang/String;[B)V
|
|
|
|
goto/16 :goto_0
|
|
|
|
:cond_8
|
|
if-eqz p2, :cond_a
|
|
|
|
.line 1048
|
|
invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {p2, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/mbridge/msdk/foundation/tools/FastKV$a;
|
|
|
|
if-eqz v2, :cond_9
|
|
|
|
.line 1051
|
|
invoke-virtual {p0, v1, v0, v2}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putObject(Ljava/lang/String;Ljava/lang/Object;Lcom/mbridge/msdk/foundation/tools/FastKV$a;)V
|
|
|
|
goto/16 :goto_0
|
|
|
|
.line 1053
|
|
:cond_9
|
|
new-instance v1, Ljava/lang/Exception;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v3, "missing encoder for type:"
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v1, v0}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, v1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->warning(Ljava/lang/Exception;)V
|
|
|
|
goto/16 :goto_0
|
|
|
|
.line 1056
|
|
:cond_a
|
|
new-instance v0, Ljava/lang/Exception;
|
|
|
|
const-string v1, "missing encoders"
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->warning(Ljava/lang/Exception;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
goto/16 :goto_0
|
|
|
|
.line 1061
|
|
:cond_b
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized putArray(Ljava/lang/String;[B)V
|
|
.locals 7
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1064
|
|
:try_start_0
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkKey(Ljava/lang/String;)V
|
|
|
|
if-nez p2, :cond_0
|
|
|
|
.line 1066
|
|
invoke-virtual {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->remove(Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1068
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
move-object v5, v0
|
|
|
|
check-cast v5, Lcom/mbridge/msdk/foundation/tools/g$a;
|
|
|
|
const/4 v6, 0x7
|
|
|
|
move-object v1, p0
|
|
|
|
move-object v2, p1
|
|
|
|
move-object v3, p2
|
|
|
|
move-object v4, p2
|
|
|
|
.line 1069
|
|
invoke-direct/range {v1 .. v6}, Lcom/mbridge/msdk/foundation/tools/FastKV;->addOrUpdate(Ljava/lang/String;Ljava/lang/Object;[BLcom/mbridge/msdk/foundation/tools/g$j;B)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 1071
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized putBoolean(Ljava/lang/String;Z)V
|
|
.locals 3
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1074
|
|
:try_start_0
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkKey(Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1075
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/mbridge/msdk/foundation/tools/g$c;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 1077
|
|
invoke-direct {p0, p1, v1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->wrapHeader(Ljava/lang/String;B)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1078
|
|
iget v1, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
int-to-byte v2, p2
|
|
|
|
.line 1079
|
|
invoke-virtual {v0, v2}, Lcom/mbridge/msdk/foundation/tools/q;->a(B)V
|
|
|
|
.line 1080
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateChange()V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1081
|
|
new-instance v2, Lcom/mbridge/msdk/foundation/tools/g$c;
|
|
|
|
invoke-direct {v2, v1, p2}, Lcom/mbridge/msdk/foundation/tools/g$c;-><init>(IZ)V
|
|
|
|
invoke-interface {v0, p1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 1082
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_1
|
|
|
|
.line 1083
|
|
:cond_0
|
|
iget-boolean p1, v0, Lcom/mbridge/msdk/foundation/tools/g$c;->b:Z
|
|
|
|
if-eq p1, p2, :cond_1
|
|
|
|
.line 1084
|
|
iput-boolean p2, v0, Lcom/mbridge/msdk/foundation/tools/g$c;->b:Z
|
|
|
|
int-to-byte p1, p2
|
|
|
|
.line 1085
|
|
iget p2, v0, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateBoolean(BI)V
|
|
|
|
.line 1086
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 1088
|
|
:cond_1
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized putDouble(Ljava/lang/String;D)V
|
|
.locals 7
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1091
|
|
:try_start_0
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkKey(Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1092
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/mbridge/msdk/foundation/tools/g$d;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x5
|
|
|
|
.line 1094
|
|
invoke-direct {p0, p1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->wrapHeader(Ljava/lang/String;B)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1095
|
|
iget v1, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
.line 1096
|
|
invoke-static {p2, p3}, Ljava/lang/Double;->doubleToRawLongBits(D)J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-virtual {v0, v2, v3}, Lcom/mbridge/msdk/foundation/tools/q;->a(J)V
|
|
|
|
.line 1097
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateChange()V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1098
|
|
new-instance v2, Lcom/mbridge/msdk/foundation/tools/g$d;
|
|
|
|
invoke-direct {v2, v1, p2, p3}, Lcom/mbridge/msdk/foundation/tools/g$d;-><init>(ID)V
|
|
|
|
invoke-interface {v0, p1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 1099
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_1
|
|
|
|
.line 1100
|
|
:cond_0
|
|
iget-wide v1, v0, Lcom/mbridge/msdk/foundation/tools/g$d;->b:D
|
|
|
|
cmpl-double p1, v1, p2
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 1101
|
|
invoke-static {p2, p3}, Ljava/lang/Double;->doubleToRawLongBits(D)J
|
|
|
|
move-result-wide v2
|
|
|
|
.line 1102
|
|
iget-wide v4, v0, Lcom/mbridge/msdk/foundation/tools/g$d;->b:D
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/Double;->doubleToRawLongBits(D)J
|
|
|
|
move-result-wide v4
|
|
|
|
xor-long/2addr v4, v2
|
|
|
|
.line 1103
|
|
iput-wide p2, v0, Lcom/mbridge/msdk/foundation/tools/g$d;->b:D
|
|
|
|
.line 1104
|
|
iget v6, v0, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
move-object v1, p0
|
|
|
|
invoke-direct/range {v1 .. v6}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateInt64(JJI)V
|
|
|
|
.line 1105
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 1107
|
|
:cond_1
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized putFloat(Ljava/lang/String;F)V
|
|
.locals 5
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1110
|
|
:try_start_0
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkKey(Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1111
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/mbridge/msdk/foundation/tools/g$e;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x3
|
|
|
|
.line 1113
|
|
invoke-direct {p0, p1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->wrapHeader(Ljava/lang/String;B)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1114
|
|
iget v1, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
.line 1115
|
|
invoke-static {p2}, Ljava/lang/Float;->floatToRawIntBits(F)I
|
|
|
|
move-result v2
|
|
|
|
invoke-virtual {v0, v2}, Lcom/mbridge/msdk/foundation/tools/q;->b(I)V
|
|
|
|
.line 1116
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateChange()V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1117
|
|
new-instance v2, Lcom/mbridge/msdk/foundation/tools/g$e;
|
|
|
|
invoke-direct {v2, v1, p2}, Lcom/mbridge/msdk/foundation/tools/g$e;-><init>(IF)V
|
|
|
|
invoke-interface {v0, p1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 1118
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_1
|
|
|
|
.line 1119
|
|
:cond_0
|
|
iget p1, v0, Lcom/mbridge/msdk/foundation/tools/g$e;->b:F
|
|
|
|
cmpl-float p1, p1, p2
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 1120
|
|
invoke-static {p2}, Ljava/lang/Float;->floatToRawIntBits(F)I
|
|
|
|
move-result p1
|
|
|
|
.line 1121
|
|
iget v1, v0, Lcom/mbridge/msdk/foundation/tools/g$e;->b:F
|
|
|
|
invoke-static {v1}, Ljava/lang/Float;->floatToRawIntBits(F)I
|
|
|
|
move-result v1
|
|
|
|
xor-int/2addr v1, p1
|
|
|
|
int-to-long v1, v1
|
|
|
|
const-wide v3, 0xffffffffL
|
|
|
|
and-long/2addr v1, v3
|
|
|
|
.line 1122
|
|
iput p2, v0, Lcom/mbridge/msdk/foundation/tools/g$e;->b:F
|
|
|
|
.line 1123
|
|
iget p2, v0, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
invoke-direct {p0, p1, v1, v2, p2}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateInt32(IJI)V
|
|
|
|
.line 1124
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 1126
|
|
:cond_1
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized putInt(Ljava/lang/String;I)V
|
|
.locals 5
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1129
|
|
:try_start_0
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkKey(Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1130
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/mbridge/msdk/foundation/tools/g$f;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x2
|
|
|
|
.line 1132
|
|
invoke-direct {p0, p1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->wrapHeader(Ljava/lang/String;B)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1133
|
|
iget v1, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
.line 1134
|
|
invoke-virtual {v0, p2}, Lcom/mbridge/msdk/foundation/tools/q;->b(I)V
|
|
|
|
.line 1135
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateChange()V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1136
|
|
new-instance v2, Lcom/mbridge/msdk/foundation/tools/g$f;
|
|
|
|
invoke-direct {v2, v1, p2}, Lcom/mbridge/msdk/foundation/tools/g$f;-><init>(II)V
|
|
|
|
invoke-interface {v0, p1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 1137
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_1
|
|
|
|
.line 1138
|
|
:cond_0
|
|
iget p1, v0, Lcom/mbridge/msdk/foundation/tools/g$f;->b:I
|
|
|
|
if-eq p1, p2, :cond_1
|
|
|
|
xor-int/2addr p1, p2
|
|
|
|
int-to-long v1, p1
|
|
|
|
const-wide v3, 0xffffffffL
|
|
|
|
and-long/2addr v1, v3
|
|
|
|
.line 1140
|
|
iput p2, v0, Lcom/mbridge/msdk/foundation/tools/g$f;->b:I
|
|
|
|
.line 1141
|
|
iget p1, v0, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
invoke-direct {p0, p2, v1, v2, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateInt32(IJI)V
|
|
|
|
.line 1142
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 1144
|
|
:cond_1
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized putLong(Ljava/lang/String;J)V
|
|
.locals 9
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1158
|
|
:try_start_0
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkKey(Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1159
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/mbridge/msdk/foundation/tools/g$g;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x4
|
|
|
|
.line 1161
|
|
invoke-direct {p0, p1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->wrapHeader(Ljava/lang/String;B)V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
.line 1162
|
|
iget v1, v0, Lcom/mbridge/msdk/foundation/tools/q;->b:I
|
|
|
|
.line 1163
|
|
invoke-virtual {v0, p2, p3}, Lcom/mbridge/msdk/foundation/tools/q;->a(J)V
|
|
|
|
.line 1164
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateChange()V
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1165
|
|
new-instance v2, Lcom/mbridge/msdk/foundation/tools/g$g;
|
|
|
|
invoke-direct {v2, v1, p2, p3}, Lcom/mbridge/msdk/foundation/tools/g$g;-><init>(IJ)V
|
|
|
|
invoke-interface {v0, p1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 1166
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_1
|
|
|
|
.line 1167
|
|
:cond_0
|
|
iget-wide v1, v0, Lcom/mbridge/msdk/foundation/tools/g$g;->b:J
|
|
|
|
cmp-long p1, v1, p2
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
xor-long v6, p2, v1
|
|
|
|
.line 1169
|
|
iput-wide p2, v0, Lcom/mbridge/msdk/foundation/tools/g$g;->b:J
|
|
|
|
.line 1170
|
|
iget v8, v0, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
move-object v3, p0
|
|
|
|
move-wide v4, p2
|
|
|
|
invoke-direct/range {v3 .. v8}, Lcom/mbridge/msdk/foundation/tools/FastKV;->updateInt64(JJI)V
|
|
|
|
.line 1171
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 1173
|
|
:cond_1
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized putObject(Ljava/lang/String;Ljava/lang/Object;Lcom/mbridge/msdk/foundation/tools/FastKV$a;)V
|
|
.locals 9
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/lang/String;",
|
|
"TT;",
|
|
"Lcom/mbridge/msdk/foundation/tools/FastKV$a<",
|
|
"TT;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1177
|
|
:try_start_0
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkKey(Ljava/lang/String;)V
|
|
|
|
if-eqz p3, :cond_4
|
|
|
|
.line 1181
|
|
invoke-interface {p3}, Lcom/mbridge/msdk/foundation/tools/FastKV$a;->a()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
.line 1182
|
|
invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
invoke-virtual {v0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v1
|
|
|
|
const/16 v2, 0x32
|
|
|
|
if-gt v1, v2, :cond_3
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->encoderMap:Ljava/util/Map;
|
|
|
|
.line 1185
|
|
invoke-interface {v1, v0}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
if-nez p2, :cond_0
|
|
|
|
.line 1190
|
|
invoke-virtual {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->remove(Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 1191
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_1
|
|
|
|
.line 1195
|
|
:cond_0
|
|
:try_start_1
|
|
invoke-interface {p3, p2}, Lcom/mbridge/msdk/foundation/tools/FastKV$a;->a(Ljava/lang/Object;)[B
|
|
|
|
move-result-object p3
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p3
|
|
|
|
.line 1197
|
|
:try_start_2
|
|
invoke-direct {p0, p3}, Lcom/mbridge/msdk/foundation/tools/FastKV;->error(Ljava/lang/Exception;)V
|
|
|
|
const/4 p3, 0x0
|
|
|
|
:goto_0
|
|
if-nez p3, :cond_1
|
|
|
|
.line 1200
|
|
invoke-virtual {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->remove(Ljava/lang/String;)V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
.line 1201
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
.line 1205
|
|
:cond_1
|
|
:try_start_3
|
|
invoke-static {v0}, Lcom/mbridge/msdk/foundation/tools/q;->a(Ljava/lang/String;)I
|
|
|
|
move-result v1
|
|
|
|
.line 1206
|
|
new-instance v2, Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
add-int/lit8 v3, v1, 0x1
|
|
|
|
array-length v4, p3
|
|
|
|
add-int/2addr v3, v4
|
|
|
|
invoke-direct {v2, v3}, Lcom/mbridge/msdk/foundation/tools/q;-><init>(I)V
|
|
|
|
int-to-byte v1, v1
|
|
|
|
.line 1207
|
|
invoke-virtual {v2, v1}, Lcom/mbridge/msdk/foundation/tools/q;->a(B)V
|
|
|
|
.line 1208
|
|
invoke-virtual {v2, v0}, Lcom/mbridge/msdk/foundation/tools/q;->b(Ljava/lang/String;)V
|
|
|
|
.line 1209
|
|
invoke-virtual {v2, p3}, Lcom/mbridge/msdk/foundation/tools/q;->a([B)V
|
|
|
|
iget-object v6, v2, Lcom/mbridge/msdk/foundation/tools/q;->a:[B
|
|
|
|
iget-object p3, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1212
|
|
invoke-interface {p3, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p3
|
|
|
|
move-object v7, p3
|
|
|
|
check-cast v7, Lcom/mbridge/msdk/foundation/tools/g$h;
|
|
|
|
const/16 v8, 0x8
|
|
|
|
move-object v3, p0
|
|
|
|
move-object v4, p1
|
|
|
|
move-object v5, p2
|
|
|
|
.line 1213
|
|
invoke-direct/range {v3 .. v8}, Lcom/mbridge/msdk/foundation/tools/FastKV;->addOrUpdate(Ljava/lang/String;Ljava/lang/Object;[BLcom/mbridge/msdk/foundation/tools/g$j;B)V
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_0
|
|
|
|
.line 1214
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
.line 1186
|
|
:cond_2
|
|
:try_start_4
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "Encoder hasn\'t been registered"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 1183
|
|
:cond_3
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string p3, "Invalid encoder tag:"
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 1179
|
|
:cond_4
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "Encoder is null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_0
|
|
|
|
.line 1183
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized putString(Ljava/lang/String;Ljava/lang/String;)V
|
|
.locals 7
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1217
|
|
:try_start_0
|
|
invoke-direct {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkKey(Ljava/lang/String;)V
|
|
|
|
if-nez p2, :cond_0
|
|
|
|
.line 1219
|
|
invoke-virtual {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->remove(Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1221
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
move-object v5, v0
|
|
|
|
check-cast v5, Lcom/mbridge/msdk/foundation/tools/g$i;
|
|
|
|
.line 1222
|
|
invoke-virtual {p2}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
mul-int/lit8 v0, v0, 0x3
|
|
|
|
const/16 v1, 0x800
|
|
|
|
if-ge v0, v1, :cond_1
|
|
|
|
.line 1225
|
|
invoke-direct {p0, p1, p2, v5}, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastPutString(Ljava/lang/String;Ljava/lang/String;Lcom/mbridge/msdk/foundation/tools/g$i;)V
|
|
|
|
goto :goto_2
|
|
|
|
.line 1229
|
|
:cond_1
|
|
invoke-virtual {p2}, Ljava/lang/String;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
sget-object v0, Lcom/mbridge/msdk/foundation/tools/FastKV;->EMPTY_ARRAY:[B
|
|
|
|
:goto_0
|
|
move-object v4, v0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
sget-object v0, Ljava/nio/charset/StandardCharsets;->UTF_8:Ljava/nio/charset/Charset;
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_0
|
|
|
|
:goto_1
|
|
const/4 v6, 0x6
|
|
|
|
move-object v1, p0
|
|
|
|
move-object v2, p1
|
|
|
|
move-object v3, p2
|
|
|
|
.line 1233
|
|
invoke-direct/range {v1 .. v6}, Lcom/mbridge/msdk/foundation/tools/FastKV;->addOrUpdate(Ljava/lang/String;Ljava/lang/Object;[BLcom/mbridge/msdk/foundation/tools/g$j;B)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 1236
|
|
:goto_2
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_3
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized putStringSet(Ljava/lang/String;Ljava/util/Set;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/Set<",
|
|
"Ljava/lang/String;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
if-nez p2, :cond_0
|
|
|
|
.line 1240
|
|
:try_start_0
|
|
invoke-virtual {p0, p1}, Lcom/mbridge/msdk/foundation/tools/FastKV;->remove(Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_1
|
|
|
|
.line 1242
|
|
:cond_0
|
|
sget-object v0, Lcom/mbridge/msdk/foundation/tools/ao;->a:Lcom/mbridge/msdk/foundation/tools/ao;
|
|
|
|
invoke-virtual {p0, p1, p2, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->putObject(Ljava/lang/String;Ljava/lang/Object;Lcom/mbridge/msdk/foundation/tools/FastKV$a;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 1244
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized remove(Ljava/lang/String;)V
|
|
.locals 6
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1257
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/mbridge/msdk/foundation/tools/g$b;
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->data:Ljava/util/Map;
|
|
|
|
.line 1260
|
|
invoke-interface {v1, p1}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 1261
|
|
invoke-virtual {v0}, Lcom/mbridge/msdk/foundation/tools/g$b;->a()B
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x5
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-gt v1, v2, :cond_0
|
|
|
|
.line 1263
|
|
invoke-static {p1}, Lcom/mbridge/msdk/foundation/tools/q;->a(Ljava/lang/String;)I
|
|
|
|
move-result p1
|
|
|
|
.line 1264
|
|
iget v0, v0, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
add-int/lit8 p1, p1, 0x2
|
|
|
|
sub-int p1, v0, p1
|
|
|
|
sget-object v2, Lcom/mbridge/msdk/foundation/tools/FastKV;->TYPE_SIZE:[I
|
|
|
|
.line 1265
|
|
aget v2, v2, v1
|
|
|
|
add-int/2addr v0, v2
|
|
|
|
invoke-direct {p0, v1, p1, v0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->remove(BII)V
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_2
|
|
|
|
.line 1267
|
|
:cond_0
|
|
check-cast v0, Lcom/mbridge/msdk/foundation/tools/g$j;
|
|
|
|
.line 1268
|
|
iget p1, v0, Lcom/mbridge/msdk/foundation/tools/g$j;->c:I
|
|
|
|
iget v2, v0, Lcom/mbridge/msdk/foundation/tools/g$b;->a:I
|
|
|
|
iget v4, v0, Lcom/mbridge/msdk/foundation/tools/g$j;->e:I
|
|
|
|
add-int/2addr v2, v4
|
|
|
|
invoke-direct {p0, v1, p1, v2}, Lcom/mbridge/msdk/foundation/tools/FastKV;->remove(BII)V
|
|
|
|
.line 1269
|
|
iget-boolean p1, v0, Lcom/mbridge/msdk/foundation/tools/g$j;->b:Z
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
iget-object p1, v0, Lcom/mbridge/msdk/foundation/tools/g$j;->d:Ljava/lang/Object;
|
|
|
|
move-object v3, p1
|
|
|
|
check-cast v3, Ljava/lang/String;
|
|
|
|
:cond_1
|
|
:goto_0
|
|
or-int/lit8 p1, v1, -0x80
|
|
|
|
int-to-byte p1, p1
|
|
|
|
iget v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->writingMode:I
|
|
|
|
const/4 v1, 0x4
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-wide v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1273
|
|
invoke-virtual {v0, v1, v4, v5}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->aBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget v2, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->removeStart:I
|
|
|
|
.line 1274
|
|
invoke-virtual {v0, v2, p1}, Ljava/nio/ByteBuffer;->put(IB)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget-wide v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1275
|
|
invoke-virtual {v0, v1, v4, v5}, Ljava/nio/ByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->bBuffer:Ljava/nio/MappedByteBuffer;
|
|
|
|
iget v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->removeStart:I
|
|
|
|
.line 1276
|
|
invoke-virtual {v0, v1, p1}, Ljava/nio/ByteBuffer;->put(IB)Ljava/nio/ByteBuffer;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
iget-object p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->fastBuffer:Lcom/mbridge/msdk/foundation/tools/q;
|
|
|
|
iget-wide v4, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->checksum:J
|
|
|
|
.line 1278
|
|
invoke-virtual {p1, v1, v4, v5}, Lcom/mbridge/msdk/foundation/tools/q;->a(IJ)V
|
|
|
|
:goto_1
|
|
const/4 p1, 0x0
|
|
|
|
iput p1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->removeStart:I
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
.line 1282
|
|
new-instance p1, Ljava/io/File;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p1, v0, v3}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-static {p1}, Lcom/mbridge/msdk/foundation/tools/ar;->a(Ljava/io/File;)V
|
|
|
|
.line 1284
|
|
:cond_3
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkGC()V
|
|
|
|
.line 1285
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/foundation/tools/FastKV;->checkIfCommit()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 1287
|
|
:cond_4
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:goto_2
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized toString()Ljava/lang/String;
|
|
.locals 2
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1341
|
|
:try_start_0
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "FastKV: path:"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->path:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, " name:"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/foundation/tools/FastKV;->name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-object v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|