public class NativeLibraryHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
NativeLibraryHelper.Handle
A handle to an opened package, consisting of one or more APKs.
|
Modifier and Type | Field and Description |
---|---|
static String |
CLEAR_ABI_OVERRIDE |
static String |
LIB_DIR_NAME |
static String |
LIB64_DIR_NAME |
Constructor and Description |
---|
NativeLibraryHelper() |
Modifier and Type | Method and Description |
---|---|
static int |
copyNativeBinaries(NativeLibraryHelper.Handle handle,
File sharedLibraryDir,
String abi)
Copies native binaries to a shared library directory.
|
static int |
copyNativeBinariesForSupportedAbi(NativeLibraryHelper.Handle handle,
File libraryRoot,
String[] abiList,
boolean useIsaSubdir) |
static int |
copyNativeBinariesWithOverride(NativeLibraryHelper.Handle handle,
File libraryRoot,
String abiOverride) |
static int |
findSupportedAbi(NativeLibraryHelper.Handle handle,
String[] supportedAbis)
Checks if a given APK contains native code for any of the provided
supportedAbis . |
static boolean |
hasRenderscriptBitcode(NativeLibraryHelper.Handle handle) |
static void |
removeNativeBinariesFromDirLI(File nativeLibraryRoot,
boolean deleteRootDir)
Remove the native binaries of a given package.
|
static void |
removeNativeBinariesLI(String nativeLibraryPath) |
static long |
sumNativeBinariesWithOverride(NativeLibraryHelper.Handle handle,
String abiOverride) |
public static final String LIB_DIR_NAME
public static final String LIB64_DIR_NAME
public static final String CLEAR_ABI_OVERRIDE
public static int copyNativeBinaries(NativeLibraryHelper.Handle handle, File sharedLibraryDir, String abi)
handle
- APK file to scan for native librariessharedLibraryDir
- directory for libraries to be copied toPackageManager.INSTALL_SUCCEEDED
if successful or another
error code from that class if notpublic static int findSupportedAbi(NativeLibraryHelper.Handle handle, String[] supportedAbis)
supportedAbis
. Returns an index into supportedAbis
if a matching
ABI is found, PackageManager.NO_NATIVE_LIBRARIES
if the
APK doesn't contain any native code, and
PackageManager.INSTALL_FAILED_NO_MATCHING_ABIS
if none of the ABIs match.public static void removeNativeBinariesLI(String nativeLibraryPath)
public static void removeNativeBinariesFromDirLI(File nativeLibraryRoot, boolean deleteRootDir)
public static int copyNativeBinariesForSupportedAbi(NativeLibraryHelper.Handle handle, File libraryRoot, String[] abiList, boolean useIsaSubdir) throws IOException
IOException
public static int copyNativeBinariesWithOverride(NativeLibraryHelper.Handle handle, File libraryRoot, String abiOverride)
public static long sumNativeBinariesWithOverride(NativeLibraryHelper.Handle handle, String abiOverride) throws IOException
IOException
public static boolean hasRenderscriptBitcode(NativeLibraryHelper.Handle handle) throws IOException
IOException