ClassDataSectionPatchAlgorithm.smali
.class public Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/ClassDataSectionPatchAlgorithm;
.super Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/DexSectionPatchAlgorithm;
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/DexSectionPatchAlgorithm",
"<",
"Lcom/tencent/tinker/android/dex/ClassData;",
">;"
}
.end annotation
# instance fields
.field private patchedClassDataSec:Lcom/tencent/tinker/android/dex/Dex$Section;
.field private patchedClassDataTocSec:Lcom/tencent/tinker/android/dex/TableOfContents$Section;
# direct methods
.method public constructor <init>(Lcom/tencent/tinker/commons/dexpatcher/struct/DexPatchFile;Lcom/tencent/tinker/android/dex/Dex;Lcom/tencent/tinker/android/dex/Dex;Lcom/tencent/tinker/commons/dexpatcher/util/SparseIndexMap;)V
.registers 6
const/4 v0, 0x0
invoke-direct {p0, p1, p2, p4}, Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/DexSectionPatchAlgorithm;-><init>(Lcom/tencent/tinker/commons/dexpatcher/struct/DexPatchFile;Lcom/tencent/tinker/android/dex/Dex;Lcom/tencent/tinker/commons/dexpatcher/util/SparseIndexMap;)V
iput-object v0, p0, Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/ClassDataSectionPatchAlgorithm;->patchedClassDataTocSec:Lcom/tencent/tinker/android/dex/TableOfContents$Section;
iput-object v0, p0, Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/ClassDataSectionPatchAlgorithm;->patchedClassDataSec:Lcom/tencent/tinker/android/dex/Dex$Section;
if-eqz p3, :cond_1a
invoke-virtual {p3}, Lcom/tencent/tinker/android/dex/Dex;->getTableOfContents()Lcom/tencent/tinker/android/dex/TableOfContents;
move-result-object v0
iget-object v0, v0, Lcom/tencent/tinker/android/dex/TableOfContents;->classDatas:Lcom/tencent/tinker/android/dex/TableOfContents$Section;
iput-object v0, p0, Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/ClassDataSectionPatchAlgorithm;->patchedClassDataTocSec:Lcom/tencent/tinker/android/dex/TableOfContents$Section;
iget-object v0, p0, Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/ClassDataSectionPatchAlgorithm;->patchedClassDataTocSec:Lcom/tencent/tinker/android/dex/TableOfContents$Section;
invoke-virtual {p3, v0}, Lcom/tencent/tinker/android/dex/Dex;->openSection(Lcom/tencent/tinker/android/dex/TableOfContents$Section;)Lcom/tencent/tinker/android/dex/Dex$Section;
move-result-object v0
iput-object v0, p0, Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/ClassDataSectionPatchAlgorithm;->patchedClassDataSec:Lcom/tencent/tinker/android/dex/Dex$Section;
:cond_1a
return-void
.end method
# virtual methods
.method protected adjustItem(Lcom/tencent/tinker/commons/dexpatcher/util/AbstractIndexMap;Lcom/tencent/tinker/android/dex/ClassData;)Lcom/tencent/tinker/android/dex/ClassData;
.registers 4
invoke-virtual {p1, p2}, Lcom/tencent/tinker/commons/dexpatcher/util/AbstractIndexMap;->adjust(Lcom/tencent/tinker/android/dex/ClassData;)Lcom/tencent/tinker/android/dex/ClassData;
move-result-object v0
return-object v0
.end method
.method protected bridge synthetic adjustItem(Lcom/tencent/tinker/commons/dexpatcher/util/AbstractIndexMap;Ljava/lang/Comparable;)Ljava/lang/Comparable;
.registers 4
check-cast p2, Lcom/tencent/tinker/android/dex/ClassData;
invoke-virtual {p0, p1, p2}, Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/ClassDataSectionPatchAlgorithm;->adjustItem(Lcom/tencent/tinker/commons/dexpatcher/util/AbstractIndexMap;Lcom/tencent/tinker/android/dex/ClassData;)Lcom/tencent/tinker/android/dex/ClassData;
move-result-object v0
return-object v0
.end method
.method protected getItemSize(Lcom/tencent/tinker/android/dex/ClassData;)I
.registers 3
invoke-virtual {p1}, Lcom/tencent/tinker/android/dex/ClassData;->byteCountInDex()I
move-result v0
return v0
.end method
.method protected bridge synthetic getItemSize(Ljava/lang/Comparable;)I
.registers 3
check-cast p1, Lcom/tencent/tinker/android/dex/ClassData;
invoke-virtual {p0, p1}, Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/ClassDataSectionPatchAlgorithm;->getItemSize(Lcom/tencent/tinker/android/dex/ClassData;)I
move-result v0
return v0
.end method
.method protected getTocSection(Lcom/tencent/tinker/android/dex/Dex;)Lcom/tencent/tinker/android/dex/TableOfContents$Section;
.registers 3
invoke-virtual {p1}, Lcom/tencent/tinker/android/dex/Dex;->getTableOfContents()Lcom/tencent/tinker/android/dex/TableOfContents;
move-result-object v0
iget-object v0, v0, Lcom/tencent/tinker/android/dex/TableOfContents;->classDatas:Lcom/tencent/tinker/android/dex/TableOfContents$Section;
return-object v0
.end method
.method protected markDeletedIndexOrOffset(Lcom/tencent/tinker/commons/dexpatcher/util/SparseIndexMap;II)V
.registers 4
invoke-virtual {p1, p3}, Lcom/tencent/tinker/commons/dexpatcher/util/SparseIndexMap;->markClassDataDeleted(I)V
return-void
.end method
.method protected nextItem(Lcom/tencent/tinker/android/dex/io/DexDataBuffer;)Lcom/tencent/tinker/android/dex/ClassData;
.registers 3
invoke-virtual {p1}, Lcom/tencent/tinker/android/dex/io/DexDataBuffer;->readClassData()Lcom/tencent/tinker/android/dex/ClassData;
move-result-object v0
return-object v0
.end method
.method protected bridge synthetic nextItem(Lcom/tencent/tinker/android/dex/io/DexDataBuffer;)Ljava/lang/Comparable;
.registers 3
invoke-virtual {p0, p1}, Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/ClassDataSectionPatchAlgorithm;->nextItem(Lcom/tencent/tinker/android/dex/io/DexDataBuffer;)Lcom/tencent/tinker/android/dex/ClassData;
move-result-object v0
return-object v0
.end method
.method protected updateIndexOrOffset(Lcom/tencent/tinker/commons/dexpatcher/util/SparseIndexMap;IIII)V
.registers 6
if-eq p3, p5, :cond_5
invoke-virtual {p1, p3, p5}, Lcom/tencent/tinker/commons/dexpatcher/util/SparseIndexMap;->mapClassDataOffset(II)V
:cond_5
return-void
.end method
.method protected writePatchedItem(Lcom/tencent/tinker/android/dex/ClassData;)I
.registers 4
iget-object v0, p0, Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/ClassDataSectionPatchAlgorithm;->patchedClassDataTocSec:Lcom/tencent/tinker/android/dex/TableOfContents$Section;
iget v1, v0, Lcom/tencent/tinker/android/dex/TableOfContents$Section;->size:I
add-int/lit8 v1, v1, 0x1
iput v1, v0, Lcom/tencent/tinker/android/dex/TableOfContents$Section;->size:I
iget-object v0, p0, Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/ClassDataSectionPatchAlgorithm;->patchedClassDataSec:Lcom/tencent/tinker/android/dex/Dex$Section;
invoke-virtual {v0, p1}, Lcom/tencent/tinker/android/dex/Dex$Section;->writeClassData(Lcom/tencent/tinker/android/dex/ClassData;)I
move-result v0
return v0
.end method
.method protected bridge synthetic writePatchedItem(Ljava/lang/Comparable;)I
.registers 3
check-cast p1, Lcom/tencent/tinker/android/dex/ClassData;
invoke-virtual {p0, p1}, Lcom/tencent/tinker/commons/dexpatcher/algorithms/patch/ClassDataSectionPatchAlgorithm;->writePatchedItem(Lcom/tencent/tinker/android/dex/ClassData;)I
move-result v0
return v0
.end method