コード例 #1
0
  public void visitProgramClass(ProgramClass programClass) {
    String name = programClass.getName();
    String newName = ClassObfuscator.newClassName(programClass);

    ps.println(
        ClassUtil.externalClassName(name) + " -> " + ClassUtil.externalClassName(newName) + ":");

    // Print out the class members.
    programClass.fieldsAccept(this);
    programClass.methodsAccept(this);
  }
コード例 #2
0
 public void visitLibraryClass(LibraryClass libraryClass) {
   notePrinter.print(
       libraryClass.getName(),
       "Note: duplicate definition of library class ["
           + ClassUtil.externalClassName(libraryClass.getName())
           + "]");
 }
コード例 #3
0
 public void visitProgramClass(ProgramClass programClass) {
   notePrinter.print(
       programClass.getName(),
       "Note: duplicate definition of program class ["
           + ClassUtil.externalClassName(programClass.getName())
           + "]");
 }
コード例 #4
0
ファイル: ClassReader.java プロジェクト: dweiss/proguard
  public void read(DataEntry dataEntry) throws IOException {
    try {
      // Get the input stream.
      InputStream inputStream = dataEntry.getInputStream();

      // Wrap it into a data input stream.
      DataInputStream dataInputStream = new DataInputStream(inputStream);

      // Create a Clazz representation.
      Clazz clazz;
      if (isLibrary) {
        clazz = new LibraryClass();
        clazz.accept(
            new LibraryClassReader(
                dataInputStream, skipNonPublicLibraryClasses, skipNonPublicLibraryClassMembers));
      } else {
        clazz = new ProgramClass();
        clazz.accept(new ProgramClassReader(dataInputStream));
      }

      // Apply the visitor, if we have a real class.
      String className = clazz.getName();
      if (className != null) {
        if (!dataEntry
                .getName()
                .replace(File.pathSeparatorChar, ClassConstants.PACKAGE_SEPARATOR)
                .equals(className + ClassConstants.CLASS_FILE_EXTENSION)
            && warningPrinter != null) {
          warningPrinter.print(
              className,
              "Warning: class ["
                  + dataEntry.getName()
                  + "] unexpectedly contains class ["
                  + ClassUtil.externalClassName(className)
                  + "]");
        }

        clazz.accept(classVisitor);
      }

      dataEntry.closeInputStream();
    } catch (Exception ex) {
      throw (IOException)
          new IOException(
                  "Can't process class [" + dataEntry.getName() + "] (" + ex.getMessage() + ")")
              .initCause(ex);
    }
  }