Files
ctf/2024/insomnihack/mobile/Notes/smali/androidx/profileinstaller/DeviceProfileWriter.smali
2025-06-06 03:13:31 +02:00

994 lines
28 KiB
Smali

.class public Landroidx/profileinstaller/DeviceProfileWriter;
.super Ljava/lang/Object;
.source "DeviceProfileWriter.java"
# instance fields
.field private final mApkName:Ljava/lang/String;
.field private final mAssetManager:Landroid/content/res/AssetManager;
.field private final mCurProfile:Ljava/io/File;
.field private final mDesiredVersion:[B
.field private mDeviceSupportsAotProfile:Z
.field private final mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
.field private final mExecutor:Ljava/util/concurrent/Executor;
.field private mProfile:[Landroidx/profileinstaller/DexProfileData;
.field private final mProfileMetaSourceLocation:Ljava/lang/String;
.field private final mProfileSourceLocation:Ljava/lang/String;
.field private mTranscodedProfile:[B
# direct methods
.method public constructor <init>(Landroid/content/res/AssetManager;Ljava/util/concurrent/Executor;Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)V
.locals 1
.line 102
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, 0x0
.line 80
iput-boolean v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDeviceSupportsAotProfile:Z
.line 103
iput-object p1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mAssetManager:Landroid/content/res/AssetManager;
.line 104
iput-object p2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mExecutor:Ljava/util/concurrent/Executor;
.line 105
iput-object p3, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
.line 106
iput-object p4, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mApkName:Ljava/lang/String;
.line 107
iput-object p5, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfileSourceLocation:Ljava/lang/String;
.line 108
iput-object p6, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfileMetaSourceLocation:Ljava/lang/String;
.line 109
iput-object p7, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mCurProfile:Ljava/io/File;
.line 110
invoke-static {}, Landroidx/profileinstaller/DeviceProfileWriter;->desiredVersion()[B
move-result-object p1
iput-object p1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDesiredVersion:[B
return-void
.end method
.method private addMetadata([Landroidx/profileinstaller/DexProfileData;[B)Landroidx/profileinstaller/DeviceProfileWriter;
.locals 3
const/4 v0, 0x0
.line 253
:try_start_0
iget-object v1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mAssetManager:Landroid/content/res/AssetManager;
iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfileMetaSourceLocation:Ljava/lang/String;
invoke-direct {p0, v1, v2}, Landroidx/profileinstaller/DeviceProfileWriter;->openStreamFromAssets(Landroid/content/res/AssetManager;Ljava/lang/String;)Ljava/io/InputStream;
move-result-object v1
:try_end_0
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_2
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0
if-eqz v1, :cond_2
.line 255
:try_start_1
sget-object v2, Landroidx/profileinstaller/ProfileTranscoder;->MAGIC_PROFM:[B
invoke-static {v1, v2}, Landroidx/profileinstaller/ProfileTranscoder;->readHeader(Ljava/io/InputStream;[B)[B
move-result-object v2
.line 256
invoke-static {v1, v2, p2, p1}, Landroidx/profileinstaller/ProfileTranscoder;->readMeta(Ljava/io/InputStream;[B[B[Landroidx/profileinstaller/DexProfileData;)[Landroidx/profileinstaller/DexProfileData;
move-result-object p1
iput-object p1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
if-eqz v1, :cond_0
.line 264
:try_start_2
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
:try_end_2
.catch Ljava/io/FileNotFoundException; {:try_start_2 .. :try_end_2} :catch_2
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_1
.catch Ljava/lang/IllegalStateException; {:try_start_2 .. :try_end_2} :catch_0
:cond_0
return-object p0
:catchall_0
move-exception p1
if-eqz v1, :cond_1
.line 253
:try_start_3
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_1
goto :goto_0
:catchall_1
move-exception p2
:try_start_4
invoke-virtual {p1, p2}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:cond_1
:goto_0
throw p1
:cond_2
if-eqz v1, :cond_3
.line 264
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
:try_end_4
.catch Ljava/io/FileNotFoundException; {:try_start_4 .. :try_end_4} :catch_2
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_1
.catch Ljava/lang/IllegalStateException; {:try_start_4 .. :try_end_4} :catch_0
goto :goto_1
:catch_0
move-exception p1
.line 270
iput-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
.line 271
iget-object p2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
const/16 v1, 0x8
invoke-interface {p2, v1, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
goto :goto_1
:catch_1
move-exception p1
.line 268
iget-object p2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
const/4 v1, 0x7
invoke-interface {p2, v1, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
goto :goto_1
:catch_2
move-exception p1
.line 265
iget-object p2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
const/16 v1, 0x9
invoke-interface {p2, v1, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
:cond_3
:goto_1
return-object v0
.end method
.method private assertDeviceAllowsProfileInstallerAotWritesCalled()V
.locals 2
.line 136
iget-boolean v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDeviceSupportsAotProfile:Z
if-eqz v0, :cond_0
return-void
.line 137
:cond_0
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "This device doesn\'t support aot. Did you call deviceSupportsAotProfile()?"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method private static desiredVersion()[B
.locals 3
.line 363
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x21
const/4 v2, 0x0
if-le v0, v1, :cond_0
return-object v2
.line 368
:cond_0
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
packed-switch v0, :pswitch_data_0
return-object v2
.line 386
:pswitch_0
sget-object v0, Landroidx/profileinstaller/ProfileVersion;->V015_S:[B
return-object v0
.line 381
:pswitch_1
sget-object v0, Landroidx/profileinstaller/ProfileVersion;->V010_P:[B
return-object v0
.line 376
:pswitch_2
sget-object v0, Landroidx/profileinstaller/ProfileVersion;->V009_O_MR1:[B
return-object v0
.line 374
:pswitch_3
sget-object v0, Landroidx/profileinstaller/ProfileVersion;->V005_O:[B
return-object v0
.line 371
:pswitch_4
sget-object v0, Landroidx/profileinstaller/ProfileVersion;->V001_N:[B
return-object v0
nop
:pswitch_data_0
.packed-switch 0x18
:pswitch_4
:pswitch_4
:pswitch_3
:pswitch_2
:pswitch_1
:pswitch_1
:pswitch_1
:pswitch_0
:pswitch_0
:pswitch_0
.end packed-switch
.end method
.method private getProfileInputStream(Landroid/content/res/AssetManager;)Ljava/io/InputStream;
.locals 2
.line 210
:try_start_0
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfileSourceLocation:Ljava/lang/String;
invoke-direct {p0, p1, v0}, Landroidx/profileinstaller/DeviceProfileWriter;->openStreamFromAssets(Landroid/content/res/AssetManager;Ljava/lang/String;)Ljava/io/InputStream;
move-result-object p1
:try_end_0
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_1
:catch_0
move-exception p1
.line 214
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
const/4 v1, 0x7
invoke-interface {v0, v1, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
goto :goto_0
:catch_1
move-exception p1
.line 212
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
const/4 v1, 0x6
invoke-interface {v0, v1, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
:goto_0
const/4 p1, 0x0
:goto_1
return-object p1
.end method
.method private openStreamFromAssets(Landroid/content/res/AssetManager;Ljava/lang/String;)Ljava/io/InputStream;
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 190
:try_start_0
invoke-virtual {p1, p2}, Landroid/content/res/AssetManager;->openFd(Ljava/lang/String;)Landroid/content/res/AssetFileDescriptor;
move-result-object p1
.line 191
invoke-virtual {p1}, Landroid/content/res/AssetFileDescriptor;->createInputStream()Ljava/io/FileInputStream;
move-result-object p1
:try_end_0
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception p1
.line 193
invoke-virtual {p1}, Ljava/io/FileNotFoundException;->getMessage()Ljava/lang/String;
move-result-object p1
const/4 p2, 0x0
if-eqz p1, :cond_0
.line 194
const-string v0, "compressed"
invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result p1
if-eqz p1, :cond_0
.line 195
iget-object p1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
const/4 v0, 0x5
invoke-interface {p1, v0, p2}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onDiagnosticReceived(ILjava/lang/Object;)V
:cond_0
move-object p1, p2
:goto_0
return-object p1
.end method
.method private readProfileInternal(Ljava/io/InputStream;)[Landroidx/profileinstaller/DexProfileData;
.locals 4
const/4 v0, 0x7
.line 228
:try_start_0
sget-object v1, Landroidx/profileinstaller/ProfileTranscoder;->MAGIC_PROF:[B
invoke-static {p1, v1}, Landroidx/profileinstaller/ProfileTranscoder;->readHeader(Ljava/io/InputStream;[B)[B
move-result-object v1
.line 229
iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mApkName:Ljava/lang/String;
invoke-static {p1, v1, v2}, Landroidx/profileinstaller/ProfileTranscoder;->readProfile(Ljava/io/InputStream;[BLjava/lang/String;)[Landroidx/profileinstaller/DexProfileData;
move-result-object v1
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2
.catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_1
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 236
:try_start_1
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
:try_end_1
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
goto :goto_1
:catch_0
move-exception p1
.line 238
iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
invoke-interface {v2, v0, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
goto :goto_1
:catchall_0
move-exception v1
goto :goto_2
:catch_1
move-exception v1
.line 233
:try_start_2
iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
const/16 v3, 0x8
invoke-interface {v2, v3, v1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
.line 236
:try_start_3
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
:try_end_3
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_3
goto :goto_0
:catch_2
move-exception v1
.line 231
:try_start_4
iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
invoke-interface {v2, v0, v1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_0
.line 236
:try_start_5
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
:try_end_5
.catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_3
goto :goto_0
:catch_3
move-exception p1
.line 238
iget-object v1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
invoke-interface {v1, v0, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
:goto_0
const/4 v1, 0x0
:goto_1
return-object v1
.line 236
:goto_2
:try_start_6
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
:try_end_6
.catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_4
goto :goto_3
:catch_4
move-exception p1
.line 238
iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
invoke-interface {v2, v0, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
.line 240
:goto_3
throw v1
.end method
.method private static requiresMetadata()Z
.locals 4
.line 395
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x21
const/4 v2, 0x0
if-le v0, v1, :cond_0
return v2
.line 400
:cond_0
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x18
const/4 v3, 0x1
if-eq v0, v1, :cond_1
const/16 v1, 0x19
if-eq v0, v1, :cond_1
packed-switch v0, :pswitch_data_0
return v2
:cond_1
:pswitch_0
return v3
:pswitch_data_0
.packed-switch 0x1f
:pswitch_0
:pswitch_0
:pswitch_0
.end packed-switch
.end method
.method private result(ILjava/lang/Object;)V
.locals 2
.line 87
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mExecutor:Ljava/util/concurrent/Executor;
new-instance v1, Landroidx/profileinstaller/DeviceProfileWriter$$ExternalSyntheticLambda0;
invoke-direct {v1, p0, p1, p2}, Landroidx/profileinstaller/DeviceProfileWriter$$ExternalSyntheticLambda0;-><init>(Landroidx/profileinstaller/DeviceProfileWriter;ILjava/lang/Object;)V
invoke-interface {v0, v1}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
return-void
.end method
# virtual methods
.method public deviceAllowsProfileInstallerAotWrites()Z
.locals 3
.line 118
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDesiredVersion:[B
const/4 v1, 0x0
if-nez v0, :cond_0
.line 119
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v0
const/4 v2, 0x3
invoke-direct {p0, v2, v0}, Landroidx/profileinstaller/DeviceProfileWriter;->result(ILjava/lang/Object;)V
return v1
.line 123
:cond_0
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mCurProfile:Ljava/io/File;
invoke-virtual {v0}, Ljava/io/File;->canWrite()Z
move-result v0
if-nez v0, :cond_1
const/4 v0, 0x4
const/4 v2, 0x0
.line 127
invoke-direct {p0, v0, v2}, Landroidx/profileinstaller/DeviceProfileWriter;->result(ILjava/lang/Object;)V
return v1
:cond_1
const/4 v0, 0x1
.line 131
iput-boolean v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDeviceSupportsAotProfile:Z
return v0
.end method
.method synthetic lambda$result$0$androidx-profileinstaller-DeviceProfileWriter(ILjava/lang/Object;)V
.locals 1
.line 87
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
invoke-interface {v0, p1, p2}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
return-void
.end method
.method public read()Landroidx/profileinstaller/DeviceProfileWriter;
.locals 2
.line 159
invoke-direct {p0}, Landroidx/profileinstaller/DeviceProfileWriter;->assertDeviceAllowsProfileInstallerAotWritesCalled()V
.line 160
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDesiredVersion:[B
if-nez v0, :cond_0
return-object p0
.line 164
:cond_0
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mAssetManager:Landroid/content/res/AssetManager;
invoke-direct {p0, v0}, Landroidx/profileinstaller/DeviceProfileWriter;->getProfileInputStream(Landroid/content/res/AssetManager;)Ljava/io/InputStream;
move-result-object v0
if-eqz v0, :cond_1
.line 166
invoke-direct {p0, v0}, Landroidx/profileinstaller/DeviceProfileWriter;->readProfileInternal(Ljava/io/InputStream;)[Landroidx/profileinstaller/DexProfileData;
move-result-object v0
iput-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
.line 168
:cond_1
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
if-eqz v0, :cond_2
.line 170
invoke-static {}, Landroidx/profileinstaller/DeviceProfileWriter;->requiresMetadata()Z
move-result v1
if-eqz v1, :cond_2
.line 171
iget-object v1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDesiredVersion:[B
invoke-direct {p0, v0, v1}, Landroidx/profileinstaller/DeviceProfileWriter;->addMetadata([Landroidx/profileinstaller/DexProfileData;[B)Landroidx/profileinstaller/DeviceProfileWriter;
move-result-object v0
if-eqz v0, :cond_2
return-object v0
:cond_2
return-object p0
.end method
.method public transcodeIfNeeded()Landroidx/profileinstaller/DeviceProfileWriter;
.locals 4
.line 296
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
.line 297
iget-object v1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDesiredVersion:[B
if-eqz v0, :cond_2
if-nez v1, :cond_0
goto :goto_2
.line 301
:cond_0
invoke-direct {p0}, Landroidx/profileinstaller/DeviceProfileWriter;->assertDeviceAllowsProfileInstallerAotWritesCalled()V
const/4 v2, 0x0
.line 302
:try_start_0
new-instance v3, Ljava/io/ByteArrayOutputStream;
invoke-direct {v3}, Ljava/io/ByteArrayOutputStream;-><init>()V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0
.line 303
:try_start_1
invoke-static {v3, v1}, Landroidx/profileinstaller/ProfileTranscoder;->writeHeader(Ljava/io/OutputStream;[B)V
.line 304
invoke-static {v3, v1, v0}, Landroidx/profileinstaller/ProfileTranscoder;->transcodeAndWriteBody(Ljava/io/OutputStream;[B[Landroidx/profileinstaller/DexProfileData;)Z
move-result v0
if-nez v0, :cond_1
.line 311
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
const/4 v1, 0x5
invoke-interface {v0, v1, v2}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
.line 315
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 320
:try_start_2
invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->close()V
:try_end_2
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_1
.catch Ljava/lang/IllegalStateException; {:try_start_2 .. :try_end_2} :catch_0
return-object p0
.line 319
:cond_1
:try_start_3
invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
move-result-object v0
iput-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mTranscodedProfile:[B
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
.line 320
:try_start_4
invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->close()V
:try_end_4
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_1
.catch Ljava/lang/IllegalStateException; {:try_start_4 .. :try_end_4} :catch_0
goto :goto_1
:catchall_0
move-exception v0
.line 302
:try_start_5
invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->close()V
:try_end_5
.catchall {:try_start_5 .. :try_end_5} :catchall_1
goto :goto_0
:catchall_1
move-exception v1
:try_start_6
invoke-virtual {v0, v1}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:goto_0
throw v0
:try_end_6
.catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_1
.catch Ljava/lang/IllegalStateException; {:try_start_6 .. :try_end_6} :catch_0
:catch_0
move-exception v0
.line 323
iget-object v1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
const/16 v3, 0x8
invoke-interface {v1, v3, v0}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
goto :goto_1
:catch_1
move-exception v0
.line 321
iget-object v1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
const/4 v3, 0x7
invoke-interface {v1, v3, v0}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
.line 325
:goto_1
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
:cond_2
:goto_2
return-object p0
.end method
.method public write()Z
.locals 5
.line 338
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mTranscodedProfile:[B
const/4 v1, 0x0
if-nez v0, :cond_0
return v1
.line 342
:cond_0
invoke-direct {p0}, Landroidx/profileinstaller/DeviceProfileWriter;->assertDeviceAllowsProfileInstallerAotWritesCalled()V
const/4 v2, 0x0
.line 344
:try_start_0
new-instance v3, Ljava/io/ByteArrayInputStream;
invoke-direct {v3, v0}, Ljava/io/ByteArrayInputStream;-><init>([B)V
:try_end_0
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_4
.line 345
:try_start_1
new-instance v0, Ljava/io/FileOutputStream;
iget-object v4, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mCurProfile:Ljava/io/File;
invoke-direct {v0, v4}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_2
.line 347
:try_start_2
invoke-static {v3, v0}, Landroidx/profileinstaller/Encoding;->writeAll(Ljava/io/InputStream;Ljava/io/OutputStream;)V
const/4 v4, 0x1
.line 348
invoke-direct {p0, v4, v2}, Landroidx/profileinstaller/DeviceProfileWriter;->result(ILjava/lang/Object;)V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
.line 350
:try_start_3
invoke-virtual {v0}, Ljava/io/OutputStream;->close()V
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_2
:try_start_4
invoke-virtual {v3}, Ljava/io/InputStream;->close()V
:try_end_4
.catch Ljava/io/FileNotFoundException; {:try_start_4 .. :try_end_4} :catch_1
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_0
.catchall {:try_start_4 .. :try_end_4} :catchall_4
.line 355
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mTranscodedProfile:[B
.line 356
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
return v4
:catchall_0
move-exception v4
.line 343
:try_start_5
invoke-virtual {v0}, Ljava/io/OutputStream;->close()V
:try_end_5
.catchall {:try_start_5 .. :try_end_5} :catchall_1
goto :goto_0
:catchall_1
move-exception v0
:try_start_6
invoke-virtual {v4, v0}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:goto_0
throw v4
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_2
:catchall_2
move-exception v0
:try_start_7
invoke-virtual {v3}, Ljava/io/InputStream;->close()V
:try_end_7
.catchall {:try_start_7 .. :try_end_7} :catchall_3
goto :goto_1
:catchall_3
move-exception v3
:try_start_8
invoke-virtual {v0, v3}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:goto_1
throw v0
:try_end_8
.catch Ljava/io/FileNotFoundException; {:try_start_8 .. :try_end_8} :catch_1
.catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_0
.catchall {:try_start_8 .. :try_end_8} :catchall_4
:catchall_4
move-exception v0
goto :goto_3
:catch_0
move-exception v0
const/4 v3, 0x7
.line 353
:try_start_9
invoke-direct {p0, v3, v0}, Landroidx/profileinstaller/DeviceProfileWriter;->result(ILjava/lang/Object;)V
goto :goto_2
:catch_1
move-exception v0
const/4 v3, 0x6
.line 351
invoke-direct {p0, v3, v0}, Landroidx/profileinstaller/DeviceProfileWriter;->result(ILjava/lang/Object;)V
:try_end_9
.catchall {:try_start_9 .. :try_end_9} :catchall_4
.line 355
:goto_2
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mTranscodedProfile:[B
.line 356
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
return v1
.line 355
:goto_3
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mTranscodedProfile:[B
.line 356
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
.line 357
throw v0
.end method