From 295eceece371b516e771de93b6127bf728999483 Mon Sep 17 00:00:00 2001 From: jeff Date: Sat, 26 Jul 2014 19:24:00 -0400 Subject: initial commit so far source analysis is working. =) --- src/cuchaz/enigma/ClassFile.java | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/cuchaz/enigma/ClassFile.java (limited to 'src/cuchaz/enigma/ClassFile.java') diff --git a/src/cuchaz/enigma/ClassFile.java b/src/cuchaz/enigma/ClassFile.java new file mode 100644 index 0000000..221a119 --- /dev/null +++ b/src/cuchaz/enigma/ClassFile.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2014 Jeff Martin. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Public License v3.0 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/gpl.html + * + * Contributors: + * Jeff Martin - initial API and implementation + ******************************************************************************/ +package cuchaz.enigma; + +import java.util.regex.Pattern; + +public class ClassFile +{ + private static Pattern m_obfuscatedClassPattern; + + static + { + m_obfuscatedClassPattern = Pattern.compile( "^[a-z]+$" ); + } + + private String m_name; + + public ClassFile( String name ) + { + m_name = name; + } + + public String getName( ) + { + return m_name; + } + + public boolean isObfuscated( ) + { + return m_obfuscatedClassPattern.matcher( m_name ).matches(); + } + + public String getPath( ) + { + return m_name.replace( ".", "/" ) + ".class"; + } +} -- cgit v1.2.3