|
|
@ -1,21 +1,22 @@ |
|
|
|
/* |
|
|
|
/* ClassBundle Copyright (C) 1998-1999 Jochen Hoenicke. |
|
|
|
* ClassBundle (c) 1998 Jochen Hoenicke |
|
|
|
|
|
|
|
* |
|
|
|
* |
|
|
|
* You may distribute under the terms of the GNU General Public License. |
|
|
|
* This program is free software; you can redistribute it and/or modify |
|
|
|
|
|
|
|
* it under the terms of the GNU General Public License as published by |
|
|
|
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option) |
|
|
|
|
|
|
|
* any later version. |
|
|
|
* |
|
|
|
* |
|
|
|
* IN NO EVENT SHALL JOCHEN HOENICKE BE LIABLE TO ANY PARTY FOR DIRECT, |
|
|
|
* This program is distributed in the hope that it will be useful, |
|
|
|
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF |
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
* THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF JOCHEN HOENICKE |
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
* HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
|
|
* GNU General Public License for more details. |
|
|
|
* |
|
|
|
* |
|
|
|
* JOCHEN HOENICKE SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT |
|
|
|
* You should have received a copy of the GNU General Public License |
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
|
|
|
* along with this program; see the file COPYING. If not, write to |
|
|
|
* PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" |
|
|
|
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
|
|
* BASIS, AND JOCHEN HOENICKE HAS NO OBLIGATION TO PROVIDE MAINTENANCE, |
|
|
|
|
|
|
|
* SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
|
|
|
|
|
|
|
* |
|
|
|
* |
|
|
|
* $Id$ |
|
|
|
* $Id$ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
package jode.obfuscator; |
|
|
|
package jode.obfuscator; |
|
|
|
import jode.Obfuscator; |
|
|
|
import jode.Obfuscator; |
|
|
|
import jode.bytecode.ClassInfo; |
|
|
|
import jode.bytecode.ClassInfo; |
|
|
@ -27,6 +28,14 @@ public class ClassBundle { |
|
|
|
|
|
|
|
|
|
|
|
int preserveRule; |
|
|
|
int preserveRule; |
|
|
|
PackageIdentifier basePackage; |
|
|
|
PackageIdentifier basePackage; |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* the identifiers that must be analyzed. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
///#ifdef JDK12
|
|
|
|
|
|
|
|
/// Set toAnalyze = new HashSet();
|
|
|
|
|
|
|
|
///#else
|
|
|
|
|
|
|
|
Stack toAnalyze = new Stack(); |
|
|
|
|
|
|
|
///#endif
|
|
|
|
|
|
|
|
|
|
|
|
public ClassBundle() { |
|
|
|
public ClassBundle() { |
|
|
|
basePackage = new PackageIdentifier(this, null, "", false); |
|
|
|
basePackage = new PackageIdentifier(this, null, "", false); |
|
|
@ -67,8 +76,34 @@ public class ClassBundle { |
|
|
|
while (enum.hasMoreElements()) { |
|
|
|
while (enum.hasMoreElements()) { |
|
|
|
basePackage.preserveIdentifier((String) enum.nextElement()); |
|
|
|
basePackage.preserveIdentifier((String) enum.nextElement()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
analyze(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///#ifdef JDK12
|
|
|
|
|
|
|
|
/// public void analyzeIdentifier(Identifier i) {
|
|
|
|
|
|
|
|
/// if (!toAnalyze.contains(i))
|
|
|
|
|
|
|
|
/// toAnalyze.add(i);
|
|
|
|
|
|
|
|
/// }
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// public void analyze() {
|
|
|
|
|
|
|
|
/// while(!toAnalyze.isEmpty()) {
|
|
|
|
|
|
|
|
/// Identifier ident = (Identifier) toAnalyze.iterator().next();
|
|
|
|
|
|
|
|
/// toAnalyze.remove(ident);
|
|
|
|
|
|
|
|
/// ident.analyze();
|
|
|
|
|
|
|
|
/// }
|
|
|
|
|
|
|
|
/// }
|
|
|
|
|
|
|
|
///#else
|
|
|
|
|
|
|
|
public void analyzeIdentifier(Identifier i) { |
|
|
|
|
|
|
|
if (!toAnalyze.contains(i)) |
|
|
|
|
|
|
|
toAnalyze.addElement(i); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void analyze() { |
|
|
|
|
|
|
|
while (!toAnalyze.isEmpty()) |
|
|
|
|
|
|
|
((Identifier) toAnalyze.pop()).analyze(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
///#endif
|
|
|
|
|
|
|
|
|
|
|
|
public void buildTable(int renameRule) { |
|
|
|
public void buildTable(int renameRule) { |
|
|
|
basePackage.buildTable(renameRule); |
|
|
|
basePackage.buildTable(renameRule); |
|
|
|
} |
|
|
|
} |
|
|
@ -123,4 +158,3 @@ public class ClassBundle { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|