Interface IApkUnit
- All Superinterfaces:
IEventSource
,IUnit
,IUnitCreator
,IUserDataSupport
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.
-
Method Summary
Modifier and TypeMethodDescriptionConvenience method to create a limited environment to emulate this APK.Convenience method to create a generic unpacker, backed by anemulated-android
object, that can be used to attempt to retrieve resources unpacked at runtime..dynamic()
Dynamic state.Get the list of activity classes declared by the applications.Get the application name.Convenience method to retrieve theAssets
folder unit (may not exist).getDex()
Convenience method to retrieve the main DEX unit of this APK.Convenience method to retrieve theLibraries
folder unit (may not exist).Convenience method to retrieve the ELF SO (Shared Object) unitsLibraries
for the provided target architecture.Get the main activity name.Convenience method to retrieve the Android manifest unit of this APK.Get the package name exposed in the Android Manifest file.Get the list of permissions requested by the application.Get the list of provider classes declared by the applications.Get the list of receiver classes declared by the applications.Convenience method to retrieve theResources
folder unit (may not exist).Get the list of service classes declared by the applications.Retrieve the APK signature scheme version 2 block.Retrieve the APK signature scheme version 2 block.int
Retrieve a flag indicating which signing schemes are used in this APK.boolean
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.boolean
Determine if the app can be debugged, per the Android Manifest entry isDebuggable.boolean
Determine if the bytecode of this APK is split over two or more DEX files.Methods inherited from interface com.pnfsoftware.jeb.util.events.IEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, removeListener, setParentSource
Methods inherited from interface com.pnfsoftware.jeb.core.units.IUnit
addChild, addChild, canBePersisted, dispose, generateQuickState, getChildren, getContributions, getCreationTimestamp, getDescription, getExtraInputs, getFormatter, getFormatType, getIconData, getInput, getInterpreters, getLock, getName, getNotes, getNotificationManager, getParent, getParentArtifact, getParentProject, getPropertyDefinitionManager, getPropertyManager, getRealName, getStatus, getUid, getUnitProcessor, initializePropertyObjects, isDisposed, isProcessed, isStale, isTransientChild, notifyGenericChange, postDeserialization, process, removeChild, setName, setNotes, setParent, setRealName, setUnitProcessor
Methods inherited from interface com.pnfsoftware.jeb.core.IUserDataSupport
clearAllData, getAllData, getData, setData
-
Method Details
-
getPackageName
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
-
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
-
hasApplication
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.- Returns:
-
getApplicationName
String getApplicationName()Get the application name.- Returns:
- the application name, null if the APK does not contain an application
-
isDebuggable
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
-
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
-
getMainActivity
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
-
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
-
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
-
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
-
isMultiDex
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
-
getDex
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
-
getManifest
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
-
getLibraries
IUnit getLibraries()Convenience method to retrieve theLibraries
folder unit (may not exist).- Returns:
- a container that contains platform-dependent libraries.
-
getLibrariesForArch
Convenience method to retrieve the ELF SO (Shared Object) unitsLibraries
for the provided target architecture.- Returns:
- a list of ELF units, possibly empty
-
getAssets
IUnit getAssets()Convenience method to retrieve theAssets
folder unit (may not exist).- Returns:
-
getResources
IUnit getResources()Convenience method to retrieve theResources
folder unit (may not exist).- Returns:
-
getSignatureSchemeVersionFlags
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
-
getSignatureSchemeV2Block
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)
-
getSignatureSchemeV3Block
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)
-
dynamic
IDexDynamic dynamic()Dynamic state.- Returns:
- Dynamic state
-
createEmulatedAndroid
IEmulatedAndroid createEmulatedAndroid()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).- Returns:
- an emulated Android environment
-
createGenericUnpacker
IGenericUnpacker createGenericUnpacker()Convenience method to create a generic unpacker, backed by anemulated-android
object, that can be used to attempt to retrieve resources unpacked at runtime..- Returns:
- an emulated Android environment
-