# PerfettoSdkHandshake.LibrarySource

Artifact: [androidx.tracing:tracing-perfetto-handshake](https://developer.android.com/jetpack/androidx/releases/tracing) [View Source](https://cs.android.com/search?q=file:androidx/tracing/perfetto/handshake/PerfettoSdkHandshake.kt+class:androidx.tracing.perfetto.handshake.PerfettoSdkHandshake.LibrarySource) Added in [1.0.1](https://developer.android.com/jetpack/androidx/releases/tracing#1.0.1)

*** ** * ** ***


```
public sealed class PerfettoSdkHandshake.LibrarySource
```

<br />

*** ** * ** ***

Provides means to sideload Perfetto SDK native binaries

## Summary

| ### Protected constructors |
|---|
| `https://developer.android.com/reference/androidx/tracing/perfetto/handshake/PerfettoSdkHandshake.LibrarySource#LibrarySource()()` |

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/tracing/perfetto/handshake/PerfettoSdkHandshake.LibrarySource` | `https://developer.android.com/reference/androidx/tracing/perfetto/handshake/PerfettoSdkHandshake.LibrarySource#aarLibrarySource(java.io.File,java.io.File,kotlin.Function2)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html aarFile, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html tempDirectory, @https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> moveLibFileFromTmpDirToAppDir )` Provides means to sideload Perfetto SDK native binaries with a library AAR used as a source |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/tracing/perfetto/handshake/PerfettoSdkHandshake.LibrarySource` | `https://developer.android.com/reference/androidx/tracing/perfetto/handshake/PerfettoSdkHandshake.LibrarySource#apkLibrarySource(java.io.File,java.io.File,kotlin.Function2)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html apkFile, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html tempDirectory, @https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> moveLibFileFromTmpDirToAppDir )` Provides means to sideload Perfetto SDK native binaries with an APK containing the library used as a source |

## Protected constructors

### LibrarySource

```
protected LibrarySource()
```

## Public methods

### aarLibrarySource

Added in [1.0.1](https://developer.android.com/jetpack/androidx/releases/tracing#1.0.1)

```
public static final @NonNull PerfettoSdkHandshake.LibrarySource aarLibrarySource(
    @NonNull File aarFile,
    @NonNull File tempDirectory,
    @NonNull Function2<@NonNull File, @NonNull File, Unit> moveLibFileFromTmpDirToAppDir
)
```

Provides means to sideload Perfetto SDK native binaries with a library AAR used as a source

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html aarFile` | an AAR file containing `libtracing_perfetto.so` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html tempDirectory` | a directory directly accessible to the caller process (used for extraction of the binaries from the zip) |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> moveLibFileFromTmpDirToAppDir` | a function capable of moving the binary file from the `https://developer.android.com/reference/androidx/tracing/perfetto/handshake/PerfettoSdkHandshake.LibrarySource.Companion#aarLibrarySource(java.io.File,java.io.File,kotlin.Function2)` to an app accessible folder |

### apkLibrarySource

Added in [1.0.1](https://developer.android.com/jetpack/androidx/releases/tracing#1.0.1)

```
public static final @NonNull PerfettoSdkHandshake.LibrarySource apkLibrarySource(
    @NonNull File apkFile,
    @NonNull File tempDirectory,
    @NonNull Function2<@NonNull File, @NonNull File, Unit> moveLibFileFromTmpDirToAppDir
)
```

Provides means to sideload Perfetto SDK native binaries with an APK containing the library used as a source

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html apkFile` | an APK file containing `libtracing_perfetto.so` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html tempDirectory` | a directory directly accessible to the caller process (used for extraction of the binaries from the zip) |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> moveLibFileFromTmpDirToAppDir` | a function capable of moving the binary file from the `https://developer.android.com/reference/androidx/tracing/perfetto/handshake/PerfettoSdkHandshake.LibrarySource.Companion#apkLibrarySource(java.io.File,java.io.File,kotlin.Function2)` to an app accessible folder |