package org.probedroid;

import org.probedroid.support.MethodBundle;

public abstract class Instrument {
    public void prepareNativeBridge(String pathLib) {
        System.load(pathLib);
    }

    public void instrumentMethod(boolean isStatic, String nameClass,
            String nameMethod, String signatureMethod, MethodBundle bundle)
            throws ClassNotFoundException, NoSuchMethodException,
            IllegalArgumentException {
        instrumentMethodNative(isStatic, nameClass, nameMethod,
                signatureMethod, bundle);
    }

    public abstract void onApplicationStart();

    public abstract void onApplicationStop();

    private native void instrumentMethodNative(boolean isStatic,
            String nameClass, String nameMethod, String signatureMethod,
            MethodBundle bundle) throws ClassNotFoundException,
            NoSuchMethodException, IllegalArgumentException;
}

@@ -63,16 +63,1114 @@
 undle;%0A%0A
+/**%0A * The entry point of ProbeDroid which defines the callbacks indicating the%0A * change of app life cycle and also provides the interfaces for analysts to%0A * register the instrumentation gadgets for interested methods. %3Cb%3E%3Ci%3EAnalysts%0A * should inherit this Instrument class as the main class of their analysis%0A * package.%3C/i%3E%3C/b%3E%0A *%0A * %3Cpre class=%22prettyprint%22%3E%0A * public class MyInstrument extends Instrument %7B%0A *%0A *     &#064;Override%0A *     public void onApplicationStart() %7B%0A *         // Do some initialization.%0A *%0A *         // Register the instrumentation gadgets.%0A *         String nameClass = &quot;java.lang.StringBuilder&quot;;%0A *         String nameMethod = &quot;toString&quot;;%0A *         String signatureMethod = &quot;()Ljava/lang/String;&quot;;%0A *         BundleStringBuilder bundleBuilder = new BundleStringBuilder(false, true);%0A *         instrumentMethod(false, nameClass, nameMethod, signatureMethod,%0A *                 bundleBuilder);%0A *     %7D%0A *%0A *     &#064;Override%0A *     public void onApplicationStop() %7B%0A *         // Do some finalization.%0A *     %7D%0A * %7D%0A * %3C/pre%3E%0A */%0A
 public a
@@ -1195,16 +1195,46 @@
 rument %7B
+%0A%0A    /**%0A     * @hide%0A     */
 %0A    pub
@@ -1325,414 +1325,2083 @@
     
-public void instrumentMethod(boolean isStatic, String nameClass,%0A            String nameMethod, String signatureMethod, MethodBundle bundle)%0A            throws ClassNotFoundException, NoSuchMethodException,%0A            IllegalArgumentException %7B%0A        instrumentMethodNative(isStatic, nameClass, nameMethod,%0A                signatureMethod, bundle);%0A    %7D%0A%0A    public abstract void onApplicationStart();%0A
+/**%0A     * Let analyst to %3Cb%3E%3Ci%3Eregister instrument gadget for the interested%0A     * method.%3C/i%3E%3C/b%3E Currently, the abstract method or native method is not%0A     * supported yet.%0A     *%0A     * @param isStatic%0A     *            The flag indicating whether the target method is static or%0A     *            not.%0A     * @param nameClass%0A     *            The name of the class defining the target method.%0A     * @param nameMethod%0A     *            The target method name.%0A     * @param signatureMethod%0A     *            The target method signature representing the data types of%0A     *            arguments and return value.%0A     * @param bundle%0A     *            The instrument gadget for the target method.%0A     *%0A     *%0A     * @throws ClassNotFoundException%0A     *             The class defining the target method cannot be found.%0A     *%0A     * @throws NoSuchMethodException%0A     *             The target method cannot be resolved (Probably due to wrong%0A     *             signature).%0A     * @throws IllegalArgumentException%0A     *             Illegal arguments passed to this method (Probably null String%0A     *             or MethodBundle).%0A     *%0A     */%0A    public void instrumentMethod(boolean isStatic, String nameClass,%0A            String nameMethod, String signatureMethod, MethodBundle bundle)%0A            throws ClassNotFoundException, NoSuchMethodException,%0A            IllegalArgumentException %7B%0A        instrumentMethodNative(isStatic, nameClass, nameMethod,%0A                signatureMethod, bundle);%0A    %7D%0A%0A    /**%0A     * The callback indicating that the instrumented app is just launched.%0A     * %3Cb%3E%3Ci%3EAnalyst should override this method for initialization.%3C/i%3E%3C/b%3E%0A     * Like registering the instrumentation gadgets or creating the custom%0A     * profiling utilities.%0A     */%0A    public abstract void onApplicationStart();%0A%0A    /**%0A     * The callback indicating that the instrumented app is just terminated.%0A     * %3Cb%3E%3Ci%3EAnalyst should override this method for finalization.%3C/i%3E%3C/b%3E Like%0A     * dumping the profiled information to the external storage.%0A     */
 %0A   

Update the javadoc comment for Instrument class.