io.appmetrica.gradle.aarcheck.api.parser.javassist.JavassistParser.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aar-check Show documentation
Show all versions of aar-check Show documentation
Provides plugin for check aar
The newest version!
package io.appmetrica.gradle.aarcheck.api.parser.javassist
import io.appmetrica.gradle.aarcheck.api.Class
import io.appmetrica.gradle.aarcheck.api.parser.Parser
import io.appmetrica.gradle.aarcheck.utils.NamesUtils
import io.appmetrica.gradle.aarcheck.utils.isClass
import javassist.ClassPool
import java.util.jar.JarFile
import kotlin.streams.toList
class JavassistParser : Parser() {
override fun parseJar(jarFile: JarFile): List {
val classPool = ClassPool()
classPool.appendClassPath(jarFile.name)
return jarFile.stream().filter { it.isClass() }.map { jarEntry ->
val ctClass = classPool.get(NamesUtils.getFullClassName(jarEntry.name))
JavassistClass.from(ctClass)
}.toList()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy