.class public Landroidx/profileinstaller/DeviceProfileWriter; .super Ljava/lang/Object; .source "SourceFile" # annotations .annotation build Landroidx/annotation/RequiresApi; value = 0x13 .end annotation .annotation build Landroidx/annotation/RestrictTo; value = { .enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope; } .end annotation # instance fields .field private final mApkName:Ljava/lang/String; .annotation build Landroidx/annotation/NonNull; .end annotation .end field .field private final mAssetManager:Landroid/content/res/AssetManager; .annotation build Landroidx/annotation/NonNull; .end annotation .end field .field private final mCurProfile:Ljava/io/File; .annotation build Landroidx/annotation/NonNull; .end annotation .end field .field private final mDesiredVersion:[B .annotation build Landroidx/annotation/Nullable; .end annotation .end field .field private mDeviceSupportsAotProfile:Z .field private final mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; .annotation build Landroidx/annotation/NonNull; .end annotation .end field .field private final mExecutor:Ljava/util/concurrent/Executor; .annotation build Landroidx/annotation/NonNull; .end annotation .end field .field private mProfile:[Landroidx/profileinstaller/DexProfileData; .annotation build Landroidx/annotation/Nullable; .end annotation .end field .field private final mProfileMetaSourceLocation:Ljava/lang/String; .annotation build Landroidx/annotation/NonNull; .end annotation .end field .field private final mProfileSourceLocation:Ljava/lang/String; .annotation build Landroidx/annotation/NonNull; .end annotation .end field .field private mTranscodedProfile:[B .annotation build Landroidx/annotation/Nullable; .end annotation .end field # direct methods .method public static synthetic $r8$lambda$ERhlvXCSfTRq-n5iULYjO-Ntn-w(Landroidx/profileinstaller/DeviceProfileWriter;ILjava/lang/Object;)V .locals 0 .line 0 invoke-direct {p0, p1, p2}, Landroidx/profileinstaller/DeviceProfileWriter;->lambda$result$0(ILjava/lang/Object;)V return-void .end method .method public constructor (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 .param p1 # Landroid/content/res/AssetManager; .annotation build Landroidx/annotation/NonNull; .end annotation .end param .param p2 # Ljava/util/concurrent/Executor; .annotation build Landroidx/annotation/NonNull; .end annotation .end param .param p3 # Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; .annotation build Landroidx/annotation/NonNull; .end annotation .end param .param p4 # Ljava/lang/String; .annotation build Landroidx/annotation/NonNull; .end annotation .end param .param p5 # Ljava/lang/String; .annotation build Landroidx/annotation/NonNull; .end annotation .end param .param p6 # Ljava/lang/String; .annotation build Landroidx/annotation/NonNull; .end annotation .end param .param p7 # Ljava/io/File; .annotation build Landroidx/annotation/NonNull; .end annotation .end param .annotation build Landroidx/annotation/RestrictTo; value = { .enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope; } .end annotation .line 102 invoke-direct {p0}, Ljava/lang/Object;->()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 .annotation build Landroidx/annotation/Nullable; .end annotation 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 268 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_0 .line 270 :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 271 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 .line 279 :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 return-object p0 :catch_0 move-exception p1 goto :goto_1 :catch_1 move-exception p1 goto :goto_2 :catch_2 move-exception p1 goto :goto_3 :catchall_0 move-exception p1 .line 268 :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 :goto_0 throw p1 :cond_0 if-eqz v1, :cond_1 .line 279 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_4 :goto_1 iput-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData; iget-object p2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; const/16 v1, 0x8 .line 286 invoke-interface {p2, v1, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V goto :goto_4 :goto_2 iget-object p2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; const/4 v1, 0x7 .line 283 invoke-interface {p2, v1, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V goto :goto_4 :goto_3 iget-object p2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; const/16 v1, 0x9 .line 280 invoke-interface {p2, v1, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V :cond_1 :goto_4 return-object v0 .end method .method private assertDeviceAllowsProfileInstallerAotWritesCalled()V .locals 2 iget-boolean v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDeviceSupportsAotProfile:Z if-eqz v0, :cond_0 return-void .line 152 :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;->(Ljava/lang/String;)V throw v0 .end method .method private static desiredVersion()[B .locals 3 .annotation build Landroidx/annotation/Nullable; .end annotation sget v0, Landroid/os/Build$VERSION;->SDK_INT:I const/16 v1, 0x22 const/4 v2, 0x0 if-le v0, v1, :cond_0 return-object v2 :cond_0 packed-switch v0, :pswitch_data_0 return-object v2 .line 402 :pswitch_0 sget-object v0, Landroidx/profileinstaller/ProfileVersion;->V015_S:[B return-object v0 .line 396 :pswitch_1 sget-object v0, Landroidx/profileinstaller/ProfileVersion;->V010_P:[B return-object v0 .line 391 :pswitch_2 sget-object v0, Landroidx/profileinstaller/ProfileVersion;->V009_O_MR1:[B return-object v0 .line 389 :pswitch_3 sget-object v0, Landroidx/profileinstaller/ProfileVersion;->V005_O:[B return-object v0 :pswitch_data_0 .packed-switch 0x1a :pswitch_3 :pswitch_2 :pswitch_1 :pswitch_1 :pswitch_1 :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_0 .end packed-switch .end method .method private getProfileInputStream(Landroid/content/res/AssetManager;)Ljava/io/InputStream; .locals 2 .annotation build Landroidx/annotation/Nullable; .end annotation :try_start_0 iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfileSourceLocation:Ljava/lang/String; .line 225 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_3 :catch_0 move-exception p1 goto :goto_0 :catch_1 move-exception p1 goto :goto_1 :goto_0 iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; const/4 v1, 0x7 .line 229 invoke-interface {v0, v1, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V goto :goto_2 :goto_1 iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; const/4 v1, 0x6 .line 227 invoke-interface {v0, v1, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V :goto_2 const/4 p1, 0x0 :goto_3 return-object p1 .end method .method private synthetic lambda$result$0(ILjava/lang/Object;)V .locals 1 iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; .line 87 invoke-interface {v0, p1, p2}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V return-void .end method .method private openStreamFromAssets(Landroid/content/res/AssetManager;Ljava/lang/String;)Ljava/io/InputStream; .locals 1 .annotation build Landroidx/annotation/Nullable; .end annotation .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 205 :try_start_0 invoke-virtual {p1, p2}, Landroid/content/res/AssetManager;->openFd(Ljava/lang/String;)Landroid/content/res/AssetFileDescriptor; move-result-object p1 .line 206 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 208 invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object p1 const/4 p2, 0x0 if-eqz p1, :cond_0 const-string v0, "compressed" .line 209 invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z move-result p1 if-eqz p1, :cond_0 iget-object p1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; const/4 v0, 0x5 .line 210 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 .annotation build Landroidx/annotation/Nullable; .end annotation const/4 v0, 0x7 .line 243 :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 244 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 251 :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_3 :catch_0 move-exception p1 iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; .line 253 invoke-interface {v2, v0, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V goto :goto_3 :catchall_0 move-exception v1 goto :goto_4 :catch_1 move-exception v1 goto :goto_0 :catch_2 move-exception v1 goto :goto_1 :goto_0 :try_start_2 iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; const/16 v3, 0x8 .line 248 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 251 :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_2 :catch_3 move-exception p1 iget-object v1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; .line 253 invoke-interface {v1, v0, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V goto :goto_2 :goto_1 :try_start_4 iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; .line 246 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 251 :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_2 const/4 v1, 0x0 :goto_3 return-object v1 :goto_4 :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_5 :catch_4 move-exception p1 iget-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; .line 253 invoke-interface {v2, v0, p1}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V .line 255 :goto_5 throw v1 .end method .method private static requiresMetadata()Z .locals 3 sget v0, Landroid/os/Build$VERSION;->SDK_INT:I const/16 v1, 0x22 const/4 v2, 0x0 if-le v0, v1, :cond_0 return v2 :cond_0 packed-switch v0, :pswitch_data_0 return v2 :pswitch_0 const/4 v0, 0x1 return v0 :pswitch_data_0 .packed-switch 0x1f :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_0 .end packed-switch .end method .method private result(ILjava/lang/Object;)V .locals 2 .param p2 # Ljava/lang/Object; .annotation build Landroidx/annotation/Nullable; .end annotation .end param 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;->(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 4 .annotation build Landroidx/annotation/RestrictTo; value = { .enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope; } .end annotation 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 129 invoke-virtual {v0}, Ljava/io/File;->exists()Z move-result v0 const/4 v2, 0x0 const/4 v3, 0x4 if-eqz v0, :cond_1 iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mCurProfile:Ljava/io/File; .line 130 invoke-virtual {v0}, Ljava/io/File;->canWrite()Z move-result v0 if-nez v0, :cond_2 .line 131 invoke-direct {p0, v3, v2}, Landroidx/profileinstaller/DeviceProfileWriter;->result(ILjava/lang/Object;)V return v1 :cond_1 :try_start_0 iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mCurProfile:Ljava/io/File; .line 136 invoke-virtual {v0}, Ljava/io/File;->createNewFile()Z :try_end_0 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0 :cond_2 const/4 v0, 0x1 iput-boolean v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDeviceSupportsAotProfile:Z return v0 .line 140 :catch_0 invoke-direct {p0, v3, v2}, Landroidx/profileinstaller/DeviceProfileWriter;->result(ILjava/lang/Object;)V return v1 .end method .method public read()Landroidx/profileinstaller/DeviceProfileWriter; .locals 2 .annotation build Landroidx/annotation/NonNull; .end annotation .annotation build Landroidx/annotation/RestrictTo; value = { .enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope; } .end annotation .line 174 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 179 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 181 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 185 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 186 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 .annotation build Landroidx/annotation/NonNull; .end annotation .annotation build Landroidx/annotation/RestrictTo; value = { .enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope; } .end annotation 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_5 .line 316 :cond_0 invoke-direct {p0}, Landroidx/profileinstaller/DeviceProfileWriter;->assertDeviceAllowsProfileInstallerAotWritesCalled()V const/4 v2, 0x0 .line 317 :try_start_0 new-instance v3, Ljava/io/ByteArrayOutputStream; invoke-direct {v3}, Ljava/io/ByteArrayOutputStream;->()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 318 :try_start_1 invoke-static {v3, v1}, Landroidx/profileinstaller/ProfileTranscoder;->writeHeader(Ljava/io/OutputStream;[B)V .line 319 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 326 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 335 :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 :catch_0 move-exception v0 goto :goto_2 :catch_1 move-exception v0 goto :goto_3 :catchall_0 move-exception v0 goto :goto_0 .line 334 :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 335 :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_4 .line 317 :goto_0 :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_1 :catchall_1 move-exception v1 :try_start_6 invoke-virtual {v0, v1}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V :goto_1 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 :goto_2 iget-object v1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; const/16 v3, 0x8 .line 338 invoke-interface {v1, v3, v0}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V goto :goto_4 :goto_3 iget-object v1, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mDiagnostics:Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback; const/4 v3, 0x7 .line 336 invoke-interface {v1, v3, v0}, Landroidx/profileinstaller/ProfileInstaller$DiagnosticsCallback;->onResultReceived(ILjava/lang/Object;)V :goto_4 iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData; :cond_2 :goto_5 return-object p0 .end method .method public write()Z .locals 5 .annotation build Landroidx/annotation/RestrictTo; value = { .enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope; } .end annotation iget-object v0, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mTranscodedProfile:[B const/4 v1, 0x0 if-nez v0, :cond_0 return v1 .line 357 :cond_0 invoke-direct {p0}, Landroidx/profileinstaller/DeviceProfileWriter;->assertDeviceAllowsProfileInstallerAotWritesCalled()V const/4 v2, 0x0 .line 359 :try_start_0 new-instance v3, Ljava/io/ByteArrayInputStream; invoke-direct {v3, v0}, Ljava/io/ByteArrayInputStream;->([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_0 .line 360 :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;->(Ljava/io/File;)V :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_1 .line 362 :try_start_2 invoke-static {v3, v0}, Landroidx/profileinstaller/Encoding;->writeAll(Ljava/io/InputStream;Ljava/io/OutputStream;)V const/4 v4, 0x1 .line 363 invoke-direct {p0, v4, v2}, Landroidx/profileinstaller/DeviceProfileWriter;->result(ILjava/lang/Object;)V :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_2 .line 365 :try_start_3 invoke-virtual {v0}, Ljava/io/OutputStream;->close()V :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_1 :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_0 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 v0 goto :goto_7 :catch_0 move-exception v0 goto :goto_3 :catch_1 move-exception v0 goto :goto_5 :catchall_1 move-exception v0 goto :goto_1 :catchall_2 move-exception v4 .line 358 :try_start_5 invoke-virtual {v0}, Ljava/io/OutputStream;->close()V :try_end_5 .catchall {:try_start_5 .. :try_end_5} :catchall_3 goto :goto_0 :catchall_3 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_1 :goto_1 :try_start_7 invoke-virtual {v3}, Ljava/io/InputStream;->close()V :try_end_7 .catchall {:try_start_7 .. :try_end_7} :catchall_4 goto :goto_2 :catchall_4 move-exception v3 :try_start_8 invoke-virtual {v0, v3}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V :goto_2 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_0 :goto_3 const/4 v3, 0x7 .line 368 :try_start_9 invoke-direct {p0, v3, v0}, Landroidx/profileinstaller/DeviceProfileWriter;->result(ILjava/lang/Object;)V :try_end_9 .catchall {:try_start_9 .. :try_end_9} :catchall_0 :goto_4 iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mTranscodedProfile:[B iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData; goto :goto_6 :goto_5 const/4 v3, 0x6 .line 366 :try_start_a invoke-direct {p0, v3, v0}, Landroidx/profileinstaller/DeviceProfileWriter;->result(ILjava/lang/Object;)V :try_end_a .catchall {:try_start_a .. :try_end_a} :catchall_0 goto :goto_4 :goto_6 return v1 :goto_7 iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mTranscodedProfile:[B iput-object v2, p0, Landroidx/profileinstaller/DeviceProfileWriter;->mProfile:[Landroidx/profileinstaller/DexProfileData; .line 372 throw v0 .end method