public abstract class ApkUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ApkUtils.ZipSections
Information about the ZIP sections of an APK.
|
Modifier and Type | Method and Description |
---|---|
static ApkUtils.ZipSections |
findZipSections(DataSource apk)
Finds the main ZIP sections of the provided APK.
|
static int |
getMinSdkVersionFromBinaryAndroidManifest(ByteBuffer androidManifestContents)
Returns the lowest Android platform version (API Level) supported by an APK with the
provided
AndroidManifest.xml . |
static void |
setZipEocdCentralDirectoryOffset(ByteBuffer zipEndOfCentralDirectory,
long offset)
Sets the offset of the start of the ZIP Central Directory in the APK's ZIP End of Central
Directory record.
|
public static ApkUtils.ZipSections findZipSections(DataSource apk) throws IOException, ZipFormatException
IOException
- if an I/O error occurred while reading the APKZipFormatException
- if the APK is malformedpublic static void setZipEocdCentralDirectoryOffset(ByteBuffer zipEndOfCentralDirectory, long offset)
zipEndOfCentralDirectory
- APK's ZIP End of Central Directory recordoffset
- offset of the ZIP Central Directory relative to the start of the archive. Must
be between 0
and 2^32 - 1
inclusive.public static int getMinSdkVersionFromBinaryAndroidManifest(ByteBuffer androidManifestContents) throws MinSdkVersionException
AndroidManifest.xml
.androidManifestContents
- contents of AndroidManifest.xml
in binary Android
resource formatMinSdkVersionException
- if an error occurred while determining the API LevelCopyright © 2016. All rights reserved.