INNER CODE UNIT · Java

getSupportedABIs

KeepSafe/ReLinker · relinker/src/main/java/com/getkeepsafe/relinker/ApkLibraryInstaller.java:119

    private String[] getSupportedABIs(Context context, String mappedLibraryName) {
        String p = "lib" + File.separatorChar + "([^\\" + File.separatorChar + "]*)" + File.separatorChar + mappedLibraryName;
        Pattern pattern = Pattern.compile(p);
        ZipFile zipFile;
        Set<String> supportedABIs = new HashSet<String>();
        for (String sourceDir : sourceDirectories(context)) {
            try {
                zipFile = new ZipFile(new File(sourceDir), ZipFile.OPEN_READ);
            } catch (IOException ignored) {
                continue;
            }

            Enumeration<? extends ZipEntry> elements = zipFile.entries();
            while (elements.hasMoreElements()) {
                ZipEntry el = elements.nextElement();
                Matcher match = pattern.matcher(el.getName());
                if (match.matches()) {
                    supportedABIs.add(match.group(1));

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…