# Interface: com.pnfsoftware.jeb.core.units.code.android.IApkUnit
- Super interfaces: `com.pnfsoftware.jeb.core.units.IUnit`

Interface for units representing Android "application packages", aka APK files. Units  representing APKs are not obliged to implement this interface.  

  JEB's internal APK handler plugin produces units which do implement this interface.

## Abstract Method: addResource
- parameter: `resId`, type: `int`
- parameter: `config`, type: `java.lang.String`
- parameter: `bytes`, type: `byte[]`
- return type: `com.pnfsoftware.jeb.core.units.IUnit`

Description: Add a resource to the APK resource tree. Currently, this method is limited to current APK  resources \(id: 0x7Fttrrrr\)
parameter: resId: resource id
parameter: config: resource configuration \(empty string for the default config\)
parameter: bytes: resource bytes
return: the newly\-created unit, or null on error

## Abstract Method: createEmulatedAndroid
- return type: `com.pnfsoftware.jeb.core.units.code.android.IEmulatedAndroid`

Description: Convenience method to create a limited environment to emulate this APK. Currently, the  emulated environment is a simple Arm 64\-bit \(aarch64\) Android 13 system \(API level 33\).
return: an emulated Android environment

## Abstract Method: createGenericUnpacker
- return type: `com.pnfsoftware.jeb.core.units.code.android.IGenericUnpacker`

Description: Convenience method to create a generic unpacker, backed by an [emulated\-android](com.pnfsoftware.jeb.core.units.code.android.IEmulatedAndroid.md) object, that can be used to attempt to retrieve resources unpacked at  runtime..
return: an emulated Android environment

## Abstract Method: dynamic
- return type: `com.pnfsoftware.jeb.core.units.code.android.IDexDynamic`

Description: Dynamic state.
return: Dynamic state

## Abstract Method: getActivities
- return type: `java.util.List<java.lang.String>`

Description: Get the list of activity classes declared by the applications. This is a convenience method;  users can retrieve the Manifest unit to examine the entire manifest file.
return: a list of fully\-qualified class names

## Abstract Method: getApplicationComponentFactory
- return type: `java.lang.String`

Description: Get the application component factory.
return: the application component factory, null if the APK does not declare a custom factory

## Abstract Method: getApplicationName
- return type: `java.lang.String`

Description: Get the application name.
return: the application name, null if the APK does not contain an application

## Abstract Method: getAssets
- return type: `com.pnfsoftware.jeb.core.units.IUnit`

Description: Convenience method to retrieve the `Assets` folder unit \(may not exist\).
return: the assets folder unit, or null

## Abstract Method: getCertificate
- return type: `com.pnfsoftware.jeb.core.units.ICertificateUnit`

Description: Convenience method to retrieve the primary certificate unit of this APK. Use the methods  `getSignatureSchemeXxx` to determine if additional signing schemes were used.
return: a certificate unit of null if none were found \(the APK is not signed\)

## Abstract Method: getDex
- return type: `com.pnfsoftware.jeb.core.units.code.android.IDexUnit`

Description: Convenience method to retrieve the main DEX unit of this APK. The primary DEX unit may  represent the merger of several DEX files, in the case of multi\-DEX applications.  

  Use [UnitUtil](com.pnfsoftware.jeb.core.units.UnitUtil.md) to retrieve other/more sub\-units.
return: a DEX unit representing the bytecode of the app, null on error

## Abstract Method: getLibraries
- return type: `com.pnfsoftware.jeb.core.units.IUnit`

Description: Convenience method to retrieve the `Libraries` folder unit \(may not exist\).
return: a container that contains platform\-dependent libraries.

## Abstract Method: getLibrariesForArch
- parameter: `abi`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AndroidPlatformABI`
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.codeobject.IELFUnit>`

Description: Convenience method to retrieve the ELF SO \(Shared Object\) units `Libraries` for the  provided target architecture.
parameter: abi: target architecture
return: a list of ELF units, possibly empty

## Abstract Method: getMainActivity
- return type: `java.lang.String`

Description: Get the main activity name. This is a convenience method; users can retrieve the Manifest  unit to examine the entire manifest file.
return: the main activity name, null on error or if none was found

## Abstract Method: getManifest
- return type: `com.pnfsoftware.jeb.core.units.IXmlUnit`

Description: Convenience method to retrieve the Android manifest unit of this APK.  

  Use [UnitUtil](com.pnfsoftware.jeb.core.units.UnitUtil.md) to retrieve other/more sub\-units.
return: an XML unit representing the manifest, null on error

## Abstract Method: getPackageName
- return type: `java.lang.String`

Description: Get the package name exposed in the Android Manifest file. This is a convenience method;  users can retrieve the Manifest unit to examine the entire manifest file.
return: the application package name

## Abstract Method: getPermissions
- return type: `java.util.List<java.lang.String>`

Description: Get the list of permissions requested by the application. This is a convenience method; users  can retrieve the Manifest unit to examine the entire manifest file.
return: the list of permissions declared to be used in the Android manifest

## Abstract Method: getProviders
- return type: `java.util.List<java.lang.String>`

Description: Get the list of provider classes declared by the applications. This is a convenience method;  users can retrieve the Manifest unit to examine the entire manifest file.
return: a list of fully\-qualified class names

## Abstract Method: getReceivers
- return type: `java.util.List<java.lang.String>`

Description: Get the list of receiver classes declared by the applications. This is a convenience method;  users can retrieve the Manifest unit to examine the entire manifest file.
return: a list of fully\-qualified class names

## Abstract Method: getResources
- return type: `com.pnfsoftware.jeb.core.units.IUnit`

Description: Convenience method to retrieve the `Resources` folder unit \(may not exist\).
return: the resources folder unit, or null

## Abstract Method: getResourcesInfo
- return type: `com.pnfsoftware.jeb.core.units.code.android.IApkResourcesInfo`

Description: Get an information object holding a high\-level view of the resources present in this APK.
return: info object \(may be null\)

## Abstract Method: getServices
- return type: `java.util.List<java.lang.String>`

Description: Get the list of service classes declared by the applications. This is a convenience method;  users can retrieve the Manifest unit to examine the entire manifest file.
return: a list of fully\-qualified class names

## Abstract Method: getSignatureSchemeV2Block
- return type: `com.pnfsoftware.jeb.core.units.code.android.APKSigSchemeV2Block`

Description: Retrieve the APK signature scheme version 2 block. The specifications of this block are  detailed here: https://source.android.com/security/apksigning/v2
return: a signature block, null if there is none \(eg, if the APK is not signed using the v2          scheme\)

## Abstract Method: getSignatureSchemeV3Block
- return type: `com.pnfsoftware.jeb.core.units.code.android.APKSigSchemeV3Block`

Description: Retrieve the APK signature scheme version 2 block. The specifications of this block are  detailed here: https://source.android.com/security/apksigning/v3
return: a signature block, null if there is none \(eg, if the APK is not signed using the v3          scheme\)

## Abstract Method: getSignatureSchemeVersionFlags
- return type: `int`

Description: Retrieve a flag indicating which signing schemes are used in this APK.
return: a combination of flags: bit \#0 is on if v1 is used; bit \#1 is on if v2 is used; bit          \#2 is on if v3 is used

## Abstract Method: hasApplication
- return type: `boolean`

Description: Determine whether or not the APK contains an application \(Application tag in the Android  manifest\); if there is no app, other application\-related methods  \([#getApplicationName()](#getApplicationName()), [#isDebuggable()](#isDebuggable()), [#getActivities()](#getActivities()),  [#getMainActivity()](#getMainActivity()), [#getServices()](#getServices()), [#getProviders()](#getProviders()),  [#getReceivers()](#getReceivers())\) should not be used.
return: true if the manifest declares an application tag

## Abstract Method: isDebuggable
- return type: `boolean`

Description: Determine if the app can be debugged, per the Android Manifest entry isDebuggable. This is a  convenience method; users can retrieve the Manifest unit to examine the entire manifest file.
return: true if the application is legally debuggable, false otherwise

## Abstract Method: isMultiDex
- return type: `boolean`

Description: Determine if the bytecode of this APK is split over two or more DEX files.
return: true for multi\-DEX apps, false otherwise

