SandMark version 3.0


sandmark.obfuscate.loop
Class ApplicationObject

java.lang.Object
  |
  +--sandmark.obfuscate.loop.ApplicationObject
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
ClassObject, MethodObject

public class ApplicationObject
extends java.lang.Object
implements java.lang.Comparable

An ApplicationObject is any "thingie" that can be obfuscated by a sandmark obfuscation. Methods, classes, and whole applications are examples of what is represented by an ApplicationObject.

Author:
Kelly Heffner (kheffner@cs.arizona.edu)

Nested Class Summary
protected  class ApplicationObject.StatisticalInfo
           
 
Field Summary
protected  java.util.ArrayList currStats
           
protected  float obfLevelRemaining
           
 
Constructor Summary
ApplicationObject()
           
ApplicationObject(Stats stats)
           
 
Method Summary
 void addAlgorithm(Algorithm candidate)
          Adds an algorithm to the pool of candidates for this object.
 void addSubObject(ApplicationObject sub)
          Specifies that another ApplicationObject is a subobject of this ApplicationObject.
 int compareTo(java.lang.Object other)
          Compares two ApplicationObjects by their natrual ordering.
protected  java.util.ArrayList computeStats(Stats stats)
           
(package private)  java.util.ArrayList getCandidates()
          Gets the list of algorithms that could still be run on this object.
 java.lang.String getKey()
           
 float getObfLevelRemaining()
           
(package private)  java.util.ArrayList getRequiredProperties()
          Gets the list of properties that need to be run on this object.
(package private)  java.util.ArrayList getRunProperties()
          Gets the list of properties that have been run on this object.
(package private)  java.util.ArrayList getSuggestedProperties()
          Gets the list of properties that should to be run on this object.
 boolean isDone()
          Determines whether or not this ApplicationObject has been obfuscated enough.
 boolean isSubobjectOf(ApplicationObject sub)
           
 boolean isTargetOf(Algorithm alg)
          Returns true if the algorithm can be applied to this type of application object.
 void runAlgorithm(Algorithm candidate, ClassFileCollection cfc)
           
 void runAlgorithm(Algorithm candidate, ClassFileCollection cfc, DependencyMap map)
           
protected  boolean runIt(Algorithm candidate, ClassFileCollection cfc)
           
 void setObfLevelRemaining(float i)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

obfLevelRemaining

protected float obfLevelRemaining

currStats

protected java.util.ArrayList currStats
Constructor Detail

ApplicationObject

public ApplicationObject()

ApplicationObject

public ApplicationObject(Stats stats)
Method Detail

computeStats

protected java.util.ArrayList computeStats(Stats stats)

runIt

protected boolean runIt(Algorithm candidate,
                        ClassFileCollection cfc)

runAlgorithm

public void runAlgorithm(Algorithm candidate,
                         ClassFileCollection cfc,
                         DependencyMap map)

runAlgorithm

public void runAlgorithm(Algorithm candidate,
                         ClassFileCollection cfc)

getObfLevelRemaining

public float getObfLevelRemaining()

setObfLevelRemaining

public void setObfLevelRemaining(float i)

addAlgorithm

public void addAlgorithm(Algorithm candidate)
Adds an algorithm to the pool of candidates for this object.

Parameters:
candidate - the algorithm to add to the pool

addSubObject

public void addSubObject(ApplicationObject sub)
Specifies that another ApplicationObject is a subobject of this ApplicationObject. Such a relation would be between a method inside a class, the method object would be a subobject of the class.

Parameters:
sub - the object which is a subobject to this

isSubobjectOf

public boolean isSubobjectOf(ApplicationObject sub)

compareTo

public int compareTo(java.lang.Object other)
Compares two ApplicationObjects by their natrual ordering. One ApplicationObject comes before another ApplicationObject if its remaining obfuscation level is greater than the other objects remaining obfuscation level. This sorting is useful for the priority queue of things to be obfuscated in the obfuscation loop.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
other - the ApplicationObject to compare to
Returns:
other's obfuscation level - this objects obfuscation level

isDone

public boolean isDone()
Determines whether or not this ApplicationObject has been obfuscated enough.

Returns:
true if this object has been obfuscated enough

getCandidates

java.util.ArrayList getCandidates()
Gets the list of algorithms that could still be run on this object.

Returns:
candidate list (not a copy)

getRunProperties

java.util.ArrayList getRunProperties()
Gets the list of properties that have been run on this object. This returns the original list (not a copy).

Returns:
run properties list

getRequiredProperties

java.util.ArrayList getRequiredProperties()
Gets the list of properties that need to be run on this object. This returns the original list (not a copy).

Returns:
run properties list

getSuggestedProperties

java.util.ArrayList getSuggestedProperties()
Gets the list of properties that should to be run on this object. This returns the original list (not a copy).

Returns:
run properties list

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getKey

public java.lang.String getKey()

isTargetOf

public boolean isTargetOf(Algorithm alg)
Returns true if the algorithm can be applied to this type of application object.


SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003