// TODO currently support only dexes, here is how to do for jar
// TODO https://github.com/adamheinrich/native-utils/blob/master/NativeUtils.java
private static File extractElf(String elfName,
                                   File apkFile) {
        File file = new File("classes.dex");
        ZipInputStream zipFile;
        try {
            zipFile = new ZipInputStream(new FileInputStream(apkFile));
            ZipEntry zipEntry;
            while (true) {
                zipEntry = zipFile.getNextEntry();
                if (zipEntry == null) {
                    break;
                }
                if (zipEntry.getName().equals(elfName)) {
                    String fName = elfName;
                    String ext = "so";
                    file = SherlockHash.INSTANCE.getFileFromZipStream(apkFile, zipFile, fName, ext);
                    break;
                }
            }
            zipFile.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return file;
    }
private static File extractElf(String elfName,
File apkFile) {
File file = new File("classes.dex");
ZipInputStream zipFile;
try {
zipFile = new ZipInputStream(new FileInputStream(apkFile));
ZipEntry zipEntry;
while (true) {
zipEntry = zipFile.getNextEntry();
if (zipEntry == null) {
break;
}
if (zipEntry.getName().equals(elfName)) {
String fName = elfName;
String ext = "so";
file = SherlockHash.INSTANCE.getFileFromZipStream(apkFile, zipFile, fName, ext);
break;
}
}
zipFile.close();
} catch (Exception e) {
e.printStackTrace();
}
return file;
}
private static File extractElf(String elfName,
File apkFile) {
File file = new File("classes.dex");
ZipInputStream zipFile;
try {
zipFile = new ZipInputStream(new FileInputStream(apkFile));
ZipEntry zipEntry;
while (true) {
zipEntry = zipFile.getNextEntry();
if (zipEntry == null) {
break;
}
if (zipEntry.getName().equals(elfName)) {
String fName = elfName;
String ext = "so";
file = SherlockHash.INSTANCE.getFileFromZipStream(apkFile, zipFile, fName, ext);
break;
}
}
zipFile.close();
} catch (Exception e) {
e.printStackTrace();
}
return file;
}
private static File extractElf(String elfName,
File apkFile) {
File file = new File("classes.dex");
ZipInputStream zipFile;
try {
zipFile = new ZipInputStream(new FileInputStream(apkFile));
ZipEntry zipEntry;
while (true) {
zipEntry = zipFile.getNextEntry();
if (zipEntry == null) {
break;
}
if (zipEntry.getName().equals(elfName)) {
String fName = elfName;
String ext = "so";
file = SherlockHash.INSTANCE.getFileFromZipStream(apkFile, zipFile, fName, ext);
break;
}
}
zipFile.close();
} catch (Exception e) {
e.printStackTrace();
}
return file;
}