~ubuntu-branches/ubuntu/maverick/proguard/maverick

« back to all changes in this revision

Viewing changes to src/proguard/wtk/ProGuardObfuscator.java

  • Committer: Bazaar Package Importer
  • Author(s): Sam Clegg
  • Date: 2005-11-13 09:42:59 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051113094259-432zf4yyw4890mmn
Tags: 3.4-1
* New upstream release (Closes: #338355)
* debian/control: bump standards version
* debian/copyright: update FSF address
* increase java stack size for proguard and proguardgui

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: ProGuardObfuscator.java,v 1.12 2004/08/15 12:39:30 eric Exp $
 
1
/* $Id: ProGuardObfuscator.java,v 1.15 2005/06/11 13:13:16 eric Exp $
2
2
 *
3
3
 * ProGuard -- shrinking, optimization, and obfuscation of Java class files.
4
4
 *
5
 
 * Copyright (c) 2002-2004 Eric Lafortune (eric@graphics.cornell.edu)
 
5
 * Copyright (c) 2002-2005 Eric Lafortune (eric@graphics.cornell.edu)
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify it
8
8
 * under the terms of the GNU General Public License as published by the Free
69
69
                    String emptyAPI)
70
70
    throws IOException
71
71
    {
 
72
        // Create the ProGuard configuration.
 
73
        Configuration configuration = new Configuration();
 
74
 
 
75
        // Parse the default configuration file.
 
76
        ConfigurationParser parser = new ConfigurationParser(this.getClass().getResource(DEFAULT_CONFIGURATION));
 
77
 
72
78
        try
73
79
        {
74
 
            // Create the ProGuard configuration.
75
 
            Configuration configuration = new Configuration();
76
 
 
77
 
            // Parse the default configuration file.
78
 
            ConfigurationParser parser = new ConfigurationParser(this.getClass().getResource(DEFAULT_CONFIGURATION));
79
80
            parser.parse(configuration);
80
81
 
81
82
            // Fill out the library class path.
83
84
 
84
85
            // Fill out the program class path (input and output).
85
86
            configuration.programJars = new ClassPath();
86
 
            configuration.programJars.add(new ClassPathEntry(jarFileName, false));
87
 
            configuration.programJars.add(new ClassPathEntry(obfuscatedJarFile.getPath(), true));
 
87
            configuration.programJars.add(new ClassPathEntry(new File(jarFileName), false));
 
88
            configuration.programJars.add(new ClassPathEntry(obfuscatedJarFile, true));
88
89
 
89
90
            // The preverify tool seems to unpack the resulting class files,
90
91
            // so we must not use mixed-case class names on Windows.
100
101
        {
101
102
            throw new IOException(ex.getMessage());
102
103
        }
 
104
        finally
 
105
        {
 
106
            parser.close();
 
107
        }
103
108
    }
104
109
 
105
110
 
124
129
 
125
130
            // Create and add the found class path entry.
126
131
            ClassPathEntry classPathEntry =
127
 
                new ClassPathEntry(classPathString.substring(index, next_index),
 
132
                new ClassPathEntry(new File(classPathString.substring(index, next_index)),
128
133
                                   false);
129
134
 
130
135
            classPath.add(classPathEntry);