public interface

IApkUnit

implements IUnit
com.pnfsoftware.jeb.core.units.code.android.IApkUnit

Class Overview

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.

Summary

Public Methods
abstract IDexDynamic dynamic()
Dynamic state.
abstract List<String> getActivities()
Get the list of activity classes declared by the applications.
abstract String getApplicationName()
Get the application name.
abstract IUnit getAssetsUnit()
Convenience method to retrieve Assets unit
abstract IDexUnit getDex()
Convenience method to retrieve the main DEX unit of this APK.
abstract IUnit getLibrariesUnit()
Convenience method to retrieve the Libraries Unit (may not exist)
abstract String getMainActivity()
Get the main activity name.
abstract IXmlUnit getManifest()
Convenience method to retrieve the Android manifest unit of this APK.
abstract String getPackageName()
Get the package name exposed in the Android Manifest file.
abstract List<String> getPermissions()
Get the list of permissions requested by the application.
abstract List<String> getProviders()
Get the list of provider classes declared by the applications.
abstract List<String> getReceivers()
Get the list of receiver classes declared by the applications.
abstract IUnit getResourceUnit()
Convenience method to retrieve Resource unit
abstract List<String> getServices()
Get the list of service classes declared by the applications.
abstract APKSigSchemeV2Block getSignatureSchemeV2Block()
Retrieve the APK signature scheme version 2 block.
abstract APKSigSchemeV3Block getSignatureSchemeV3Block()
Retrieve the APK signature scheme version 2 block.
abstract int getSignatureSchemeVersionFlags()
Retrieve a flag indicating which signing schemes are used in this APK.
abstract boolean hasApplication()
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(), isDebuggable(), getActivities(), getMainActivity(), getServices(), getProviders(), getReceivers()) should not be used.
abstract boolean isDebuggable()
Determine if the app can be debugged, per the Android Manifest entry isDebuggable.
abstract boolean isMultiDex()
Determine if the bytecode of this APK is split over two or more DEX files.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.IUnitCreator
From interface com.pnfsoftware.jeb.core.units.IUnit
From interface com.pnfsoftware.jeb.util.events.IEventSource

Public Methods

public abstract IDexDynamic dynamic ()

Dynamic state.

Returns
  • Dynamic state

public abstract List<String> getActivities ()

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.

Returns
  • a list of fully-qualified class names

public abstract String getApplicationName ()

Get the application name.

Returns
  • the application name, null if the APK does not contain an application

public abstract IUnit getAssetsUnit ()

Convenience method to retrieve Assets unit

public abstract IDexUnit getDex ()

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 to retrieve other/more sub-units.

Returns
  • a DEX unit representing the bytecode of the app, null on error

public abstract IUnit getLibrariesUnit ()

Convenience method to retrieve the Libraries Unit (may not exist)

Returns
  • a container that contains platform dependent-libraires.

public abstract String getMainActivity ()

Get the main activity name. This is a convenience method; users can retrieve the Manifest unit to examine the entire manifest file.

Returns
  • the main activity name, null on error or if none was found

public abstract IXmlUnit getManifest ()

Convenience method to retrieve the Android manifest unit of this APK.

Use UnitUtil to retrieve other/more sub-units.

Returns
  • an XML unit representing the manifest, null on error

public abstract String getPackageName ()

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.

Returns
  • the application package name

public abstract List<String> getPermissions ()

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.

Returns
  • the list of permissions declared to be used in the Android manifest

public abstract List<String> getProviders ()

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.

Returns
  • a list of fully-qualified class names

public abstract List<String> getReceivers ()

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.

Returns
  • a list of fully-qualified class names

public abstract IUnit getResourceUnit ()

Convenience method to retrieve Resource unit

public abstract List<String> getServices ()

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.

Returns
  • a list of fully-qualified class names

public abstract APKSigSchemeV2Block getSignatureSchemeV2Block ()

Retrieve the APK signature scheme version 2 block. The specifications of this block are detailed here: https://source.android.com/security/apksigning/v2

Returns
  • a signature block, null if there is none (eg, if the APK is not signed using the v2 scheme)

public abstract APKSigSchemeV3Block getSignatureSchemeV3Block ()

Retrieve the APK signature scheme version 2 block. The specifications of this block are detailed here: https://source.android.com/security/apksigning/v3

Returns
  • a signature block, null if there is none (eg, if the APK is not signed using the v3 scheme)

public abstract int getSignatureSchemeVersionFlags ()

Retrieve a flag indicating which signing schemes are used in this APK.

Returns
  • 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

public abstract boolean hasApplication ()

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(), isDebuggable(), getActivities(), getMainActivity(), getServices(), getProviders(), getReceivers()) should not be used.

public abstract boolean isDebuggable ()

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.

Returns
  • true if the application is legally debuggable, false otherwise

public abstract boolean isMultiDex ()

Determine if the bytecode of this APK is split over two or more DEX files.

Returns
  • true for multi-DEX apps, false otherwise