// Path: opencv/sdk/java/src/org/opencv/android/OpenCVLoader.java
// public class OpenCVLoader
// {
//     /**
//      * OpenCV Library version 2.4.2.
//      */
//     public static final String OPENCV_VERSION_2_4_2 = "2.4.2";
// 
//     /**
//      * OpenCV Library version 2.4.3.
//      */
//     public static final String OPENCV_VERSION_2_4_3 = "2.4.3";
// 
//     /**
//      * OpenCV Library version 2.4.4.
//      */
//     public static final String OPENCV_VERSION_2_4_4 = "2.4.4";
// 
//     /**
//      * OpenCV Library version 2.4.5.
//      */
//     public static final String OPENCV_VERSION_2_4_5 = "2.4.5";
// 
// 
//     /**
//      * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java").
//      * @return Returns true is initialization of OpenCV was successful.
//      */
//     public static boolean initDebug()
//     {
//         return StaticHelper.initOpenCV();
//     }
// 
//     /**
//      * Loads and initializes OpenCV library using OpenCV Engine service.
//      * @param Version OpenCV library version.
//      * @param AppContext application context for connecting to the service.
//      * @param Callback object, that implements LoaderCallbackInterface for handling the connection status.
//      * @return Returns true if initialization of OpenCV is successful.
//      */
//     public static boolean initAsync(String Version, Context AppContext,
//             LoaderCallbackInterface Callback)
//     {
//         return AsyncServiceHelper.initOpenCV(Version, AppContext, Callback);
//     }
// }


import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.AssetManager;
import android.hardware.Camera;
import android.hardware.Camera.CameraInfo;
import android.os.*;
import android.util.Log;
import android.view.View;
import android.widget.*;
import android.hardware.Camera.PictureCallback;
import android.hardware.Camera.ShutterCallback;
import android.app.Dialog;
import android.view.View.OnClickListener;
import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import java.io.*;
import java.lang.Process;
import java.util.Timer;
import java.util.TimerTask;
            }



        });
    }

    private class checkDevAsync extends AsyncTask<Void, Void, String> {
        protected String doInBackground(Void... params) {
            Runtime rt = Runtime.getRuntime();
            try{
                Process proc = rt.exec("/system/xbin/bash " + scriptdir + "testdebug.sh");
                InputStream is = proc.getInputStream();
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String line;
                while ((line = br.readLine()) != null) {
                    if (line.equals("ENABLED") || line.equals("RECOVERY") || line.equals("DISABLED")){
                        System.out.println(line);
                        return line;
                    }
                }

            }
            catch (Exception e){
                e.printStackTrace();
            }
            return "fail";
        }

// Path: opencv/sdk/java/src/org/opencv/android/OpenCVLoader.java
// public class OpenCVLoader
// {
//     /**
//      * OpenCV Library version 2.4.2.
//      */
//     public static final String OPENCV_VERSION_2_4_2 = "2.4.2";
// 
//     /**
//      * OpenCV Library version 2.4.3.
//      */
//     public static final String OPENCV_VERSION_2_4_3 = "2.4.3";
// 
//     /**
//      * OpenCV Library version 2.4.4.
//      */
//     public static final String OPENCV_VERSION_2_4_4 = "2.4.4";
// 
//     /**
//      * OpenCV Library version 2.4.5.
//      */
//     public static final String OPENCV_VERSION_2_4_5 = "2.4.5";
// 
// 
//     /**
//      * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java").
//      * @return Returns true is initialization of OpenCV was successful.
//      */
//     public static boolean initDebug()
//     {
//         return StaticHelper.initOpenCV();
//     }
// 
//     /**
//      * Loads and initializes OpenCV library using OpenCV Engine service.
//      * @param Version OpenCV library version.
//      * @param AppContext application context for connecting to the service.
//      * @param Callback object, that implements LoaderCallbackInterface for handling the connection status.
//      * @return Returns true if initialization of OpenCV is successful.
//      */
//     public static boolean initAsync(String Version, Context AppContext,
//             LoaderCallbackInterface Callback)
//     {
//         return AsyncServiceHelper.initOpenCV(Version, AppContext, Callback);
//     }
// }


// Path: Poke-A-Droid/src/main/java/com/os3/pokeadroid/MainActivity.java
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.AssetManager;
import android.hardware.Camera;
import android.hardware.Camera.CameraInfo;
import android.os.*;
import android.util.Log;
import android.view.View;
import android.widget.*;
import android.hardware.Camera.PictureCallback;
import android.hardware.Camera.ShutterCallback;
import android.app.Dialog;
import android.view.View.OnClickListener;
import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import java.io.*;
import java.lang.Process;
import java.util.Timer;
import java.util.TimerTask;

            }



        });
    }

    private class checkDevAsync extends AsyncTask<Void, Void, String> {
        protected String doInBackground(Void... params) {
            Runtime rt = Runtime.getRuntime();
            try{
                Process proc = rt.exec("/system/xbin/bash " + scriptdir + "testdebug.sh");
                InputStream is = proc.getInputStream();
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String line;
                while ((line = br.readLine()) != null) {
                    if (line.equals("ENABLED") || line.equals("RECOVERY") || line.equals("DISABLED")){
                        System.out.println(line);
                        return line;
                    }
                }

            }
            catch (Exception e){
                e.printStackTrace();
            }
            return "fail";
        }

        protected void onPostExecute(String result) {