Adding JamWifi, a Mac app that is useful to do deauthentication attacks
[iot2.git] / iotjava / iotruntime / master / ClassRuntimeInstrumenterMaster.java
index 5c453e92dc5551e8f2f725dd29735355dcd0478c..f516a9dd3c504e35c4fd496a455bb3b2175aaffb 100644 (file)
@@ -44,7 +44,7 @@ import iotruntime.slave.IoTRelation;
  * @version     1.0
  * @since       2015-12-01
  */
-public class ClassRuntimeInstrumenterMaster extends ClassVisitor implements Opcodes {
+public final class ClassRuntimeInstrumenterMaster extends ClassVisitor implements Opcodes {
 
        /**
         *  ClassRuntimeInstrumenterMaster class properties
@@ -67,7 +67,8 @@ public class ClassRuntimeInstrumenterMaster extends ClassVisitor implements Opco
         * ClassRuntimeInstrumenterMaster class constants
         */
        private static final int INT_NUM_CLASS_TYPE = 3;
-       private static final String STR_IOT_ANNOTATION_SIGNATURE = "Liotchecker/qual/config;";
+       //private static final String STR_IOT_ANNOTATION_SIGNATURE = "Liotchecker/qual/config;";
+       private static final String STR_IOT_ANNOTATION_SIGNATURE = "Liotcode/annotation/config;";
        private static final String STR_IOT_SET_SIGNATURE = "Liotruntime/slave/IoTSet;";
        private static final String STR_IOT_RELATION_SIGNATURE = "Liotruntime/slave/IoTRelation;";
        private static final String STR_IOT_CONSTRAINT_SIGNATURE = "Liotcode/annotation/constraint;";
@@ -106,16 +107,6 @@ public class ClassRuntimeInstrumenterMaster extends ClassVisitor implements Opco
                super.visit(version, access, name, signature, superName, interfaces);
        }
 
-       /**
-        * Visit class annotation
-        */
-       @Override
-       public AnnotationVisitor visitAnnotation(String desc,
-               boolean visible) {
-
-               return super.visitAnnotation(desc, visible);
-       }
-
        /**
         * Make a visit to a field.
         */
@@ -229,8 +220,6 @@ public class ClassRuntimeInstrumenterMaster extends ClassVisitor implements Opco
                 *  5) Initialize the field of the instrumented class objects with actual field objects
                 *  6) Run the init() function of the instrumented class
                 *
-                * @param  typeRef  int
-                * @param  typePath TypePath
                 * @param  desc     String
                 * @param  visible  boolean
                 * @return          AnnotationVisitor
@@ -239,10 +228,10 @@ public class ClassRuntimeInstrumenterMaster extends ClassVisitor implements Opco
                 *  This method visits annotation that is meta-annotated as TYPE_USE, so we can instrument @config here
                 */
                @Override
-               public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, 
-                       String desc, boolean visible) {
+               public AnnotationVisitor visitAnnotation(String desc,
+                       boolean visible) {
 
-                       //RuntimeOutput.print("ClassRuntimeInstrumenterMaster@AnnotationTypeVisitor: " + desc, bVerbose);
+                       RuntimeOutput.print("ClassRuntimeInstrumenterMaster@AnnotationVisitor: " + desc, bVerbose);
 
                        // Check annotation description @config
                        if(desc.equals(STR_IOT_ANNOTATION_SIGNATURE)) {
@@ -271,7 +260,7 @@ public class ClassRuntimeInstrumenterMaster extends ClassVisitor implements Opco
                                        throw new Error("ClassRuntimeInstrumenterMaster@AnnotationTypeVisitor: " + strFieldDesc + " not recognized!");
                                }
                        }
-                       return super.visitTypeAnnotation(typeRef, typePath, desc, visible);
+                       return super.visitAnnotation(desc, visible);
                }
        }