All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.appmetrica.gradle.aarcheck.api.parser.Parser.kt Maven / Gradle / Ivy

The newest version!
package io.appmetrica.gradle.aarcheck.api.parser

import io.appmetrica.gradle.aarcheck.api.Class
import io.appmetrica.gradle.aarcheck.utils.extractEntry
import java.io.File
import java.util.jar.JarFile
import java.util.zip.ZipFile

abstract class Parser {
    abstract fun parseJar(jarFile: JarFile): List

    open fun parseJar(jarFile: File): List {
        return JarFile(jarFile).use(::parseJar)
    }

    open fun parseAar(aarFile: File): List {
        return ZipFile(aarFile).use { zipFile ->
            parseJar(zipFile.extractEntry("classes.jar"))
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy