Class ClassFileSourceImpl
java.lang.Object
org.benf.cfr.reader.state.ClassFileSourceImpl
- All Implemented Interfaces:
ClassFileSource, ClassFileSource2
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface ClassFileSource
ClassFileSource.Factory -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ClassFileRelocatorprivate ClassRenamerprivate Map<String, ClassFileSourceImpl.JarSourceEntry> private static final booleanprivate final Options -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.addJarContent(String jarPath, AnalysisType analysisType) CFR would like to know about all classes contained within the jar atjarPathprivate voidaddToRelativeClassPath(File file, String jarClassPath) private static booleanCheckJrt()private byte[]getBytesFromFile(InputStream is, long length) getClassFileContent(String inputPath) Given a path to a class file, return a pair of * the content, as a byte array.private Map<String, ClassFileSourceImpl.JarSourceEntry> private byte[]getContentByFromReflectedClass(String inputPath) private byte[]getInternalContent(String inputPath) getManifestContent(ZipFile zipFile) getPossiblyRenamedPath(String path) It's possible that an obfuscator might have generated a bizarre and magic file inside a jar such that it's path is too big to read.private byte[]getUrlContent(URL url) voidinformAnalysisRelativePathDetail(String usePath, String specPath) CFR has loaded your class, and it has decided that if it were in the correct location, it would instead be atclassFilePath.private JarContentprocessClassPathFile(File file, boolean dump, AnalysisType analysisType) private voidprocessClassPathFile(File file, String absolutePath, Map<String, ClassFileSourceImpl.JarSourceEntry> classToPathMap, AnalysisType analysisType, boolean dump) private voidprocessToClassPath(boolean dump, String path)
-
Field Details
-
explicitJars
-
classToPathMap
-
options
-
classRenamer
-
classRelocator
-
JrtPresent
private static final boolean JrtPresent -
packMap
-
-
Constructor Details
-
ClassFileSourceImpl
-
-
Method Details
-
CheckJrt
private static boolean CheckJrt() -
getBytesFromFile
- Throws:
IOException
-
getPossiblyRenamedPath
Description copied from interface:ClassFileSourceIt's possible that an obfuscator might have generated a bizarre and magic file inside a jar such that it's path is too big to read. Or it's invalid. This allows you to remap paths.- Specified by:
getPossiblyRenamedPathin interfaceClassFileSource- Parameters:
path- Path CFR would like to use- Returns:
- Remapped path.
-
getClassFileContent
Description copied from interface:ClassFileSourceGiven a path to a class file, return a pair of * the content, as a byte array. * the path where you found this.- Specified by:
getClassFileContentin interfaceClassFileSource- Parameters:
inputPath- relative path of class we wish to load.- Returns:
- Pair<byte[], String> of class file content, and file location.
- Throws:
IOException- if you can't find the class.
-
getPackageToModuleMap
-
getContentByFromReflectedClass
-
getUrlContent
-
getInternalContent
- Throws:
IOException
-
addJar
Deprecated.Description copied from interface:ClassFileSourceCFR would like to know about all classes contained within the jar atjarPath- Specified by:
addJarin interfaceClassFileSource- Parameters:
jarPath- path to a jar.- Returns:
- paths (inside jar) of all classes.
-
addJarContent
Description copied from interface:ClassFileSource2CFR would like to know about all classes contained within the jar atjarPath- Specified by:
addJarContentin interfaceClassFileSource2- Parameters:
jarPath- path to a jar.- Returns:
- @{link JarContent} for this jar.
-
getClassPathClasses
-
processToClassPath
-
addToRelativeClassPath
-
processClassPathFile
private void processClassPathFile(File file, String absolutePath, Map<String, ClassFileSourceImpl.JarSourceEntry> classToPathMap, AnalysisType analysisType, boolean dump) -
processClassPathFile
-
getManifestContent
-
informAnalysisRelativePathDetail
Description copied from interface:ClassFileSourceCFR has loaded your class, and it has decided that if it were in the correct location, it would instead be atclassFilePath. This information should be taken into account when loading any inner classes, or other classes that CFR tries to load in order to improve decompilation. Why do you care? Let's say you have a class in a top level outside its normal structure, Bob.class. It should be found at org/person/Bob.class. Implementors of this will be called back with "", and "org/person", telling you that org.person are implicit in your path. CFR may later ask you to load "org/person/Bob$1.class". You should adjust this path to match where Bob$1 actually is. This will also be called with null, null to reset.- Specified by:
informAnalysisRelativePathDetailin interfaceClassFileSource- Parameters:
usePath- the path that was used to load a class file.specPath- the path that CFR actually suspects it should have been, based on package name.
-