mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-25 16:42:30 -06:00
917 lines
26 KiB
Smali
917 lines
26 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
|
|
|
|
iput-boolean v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDeviceSupportsAotProfile:Z
|
|
|
|
iput-object p1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mAssetManager:Landroid/content/res/AssetManager;
|
|
|
|
iput-object p2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
iput-object p3, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
iput-object p4, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mApkName:Ljava/lang/String;
|
|
|
|
iput-object p5, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfileSourceLocation:Ljava/lang/String;
|
|
|
|
iput-object p6, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfileMetaSourceLocation:Ljava/lang/String;
|
|
|
|
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
|
|
|
|
: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;
|
|
|
|
.line 253
|
|
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
|
|
|
|
iput-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
|
|
|
|
iget-object p0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
const/16 p2, 0x8
|
|
|
|
.line 271
|
|
invoke-interface {p0, p2, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
|
|
|
|
goto :goto_1
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
iget-object p0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
const/4 p2, 0x7
|
|
|
|
.line 268
|
|
invoke-interface {p0, p2, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
|
|
|
|
goto :goto_1
|
|
|
|
:catch_2
|
|
move-exception p1
|
|
|
|
iget-object p0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
const/16 p2, 0x9
|
|
|
|
.line 265
|
|
invoke-interface {p0, p2, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
|
|
|
|
:cond_3
|
|
:goto_1
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private assertDeviceAllowsProfileInstallerAotWritesCalled()V
|
|
.locals 1
|
|
|
|
iget-boolean p0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDeviceSupportsAotProfile:Z
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 137
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v0, "This device doesn\'t support aot. Did you call deviceSupportsAotProfile()?"
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static desiredVersion()[B
|
|
.locals 4
|
|
|
|
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
|
|
|
|
:cond_0
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v3, 0x20
|
|
|
|
if-eq v0, v3, :cond_1
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
return-object v2
|
|
|
|
.line 386
|
|
:cond_1
|
|
sget-object v0, Landroidx/profileinstaller/ProfileVersion;->V015_S:[B
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private getProfileInputStream(Landroid/content/res/AssetManager;)Ljava/io/InputStream;
|
|
.locals 1
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfileSourceLocation:Ljava/lang/String;
|
|
|
|
.line 210
|
|
invoke-direct {p0, p1, v0}, Landroidx/profileinstaller/DeviceProfileWriter;->openStreamFromAssets(Landroid/content/res/AssetManager;Ljava/lang/String;)Ljava/io/InputStream;
|
|
|
|
move-result-object p0
|
|
: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
|
|
|
|
iget-object p0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
const/4 v0, 0x7
|
|
|
|
.line 214
|
|
invoke-interface {p0, v0, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
|
|
|
|
goto :goto_0
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
iget-object p0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
const/4 v0, 0x6
|
|
|
|
.line 212
|
|
invoke-interface {p0, v0, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
|
|
|
|
:goto_0
|
|
const/4 p0, 0x0
|
|
|
|
:goto_1
|
|
return-object p0
|
|
.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 p0
|
|
: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
|
|
|
|
const-string v0, "compressed"
|
|
|
|
.line 194
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object p0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
const/4 p1, 0x5
|
|
|
|
.line 195
|
|
invoke-interface {p0, p1, p2}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onDiagnosticReceived(ILjava/lang/Object;)V
|
|
|
|
:cond_0
|
|
move-object p0, p2
|
|
|
|
:goto_0
|
|
return-object p0
|
|
.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
|
|
|
|
iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mApkName:Ljava/lang/String;
|
|
|
|
.line 229
|
|
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
|
|
|
|
iget-object p0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
.line 238
|
|
invoke-interface {p0, 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
|
|
|
|
:try_start_2
|
|
iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
const/16 v3, 0x8
|
|
|
|
.line 233
|
|
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
|
|
|
|
:try_start_4
|
|
iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
.line 231
|
|
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
|
|
|
|
iget-object p0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
.line 238
|
|
invoke-interface {p0, 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
|
|
|
|
iget-object p0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
.line 238
|
|
invoke-interface {p0, 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
|
|
|
|
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
|
|
|
|
:cond_0
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v3, 0x20
|
|
|
|
if-eq v0, v3, :cond_1
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
return v2
|
|
|
|
:cond_1
|
|
const/4 v0, 0x1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private result(ILjava/lang/Object;)V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
.line 87
|
|
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
|
|
|
|
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDesiredVersion:[B
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
.line 119
|
|
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
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mCurProfile:Ljava/io/File;
|
|
|
|
.line 123
|
|
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
|
|
|
|
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 0
|
|
|
|
.line 0
|
|
iget-object p0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
.line 87
|
|
invoke-interface {p0, 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
|
|
|
|
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDesiredVersion:[B
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mAssetManager:Landroid/content/res/AssetManager;
|
|
|
|
.line 164
|
|
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;
|
|
|
|
: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
|
|
|
|
iget-object v1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDesiredVersion:[B
|
|
|
|
.line 171
|
|
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
|
|
|
|
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
|
|
|
|
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
|
|
|
|
iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
const/4 v1, 0x5
|
|
|
|
.line 311
|
|
invoke-interface {v0, v1, v2}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
|
|
|
|
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
|
|
|
|
iget-object v1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
const/16 v3, 0x8
|
|
|
|
.line 323
|
|
invoke-interface {v1, v3, v0}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
|
|
|
|
goto :goto_1
|
|
|
|
:catch_1
|
|
move-exception v0
|
|
|
|
iget-object v1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;
|
|
|
|
const/4 v3, 0x7
|
|
|
|
.line 321
|
|
invoke-interface {v1, v3, v0}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V
|
|
|
|
: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
|
|
|
|
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
|
|
|
|
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mTranscodedProfile:[B
|
|
|
|
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
|
|
|
|
:goto_2
|
|
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mTranscodedProfile:[B
|
|
|
|
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
|
|
|
|
return v1
|
|
|
|
:goto_3
|
|
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mTranscodedProfile:[B
|
|
|
|
iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData;
|
|
|
|
.line 357
|
|
throw v0
|
|
.end method
|