// Path: app/src/main/java/org/wordcamp/android/utils/Utils.java
// public class Utils {
// 
//     public static boolean isLollipopOrAbove() {
//         return Build.VERSION.SDK_INT >= 21;
//     }
// 
//     public static String getDeviceInfo() {
//         return "\n\n Device info :- \n"
//                 + "API : " + Build.VERSION.SDK_INT + "\n "              // API Level
//                 + "Device : " + Build.DEVICE + "\n"                     // Device
//                 + "Manufacturer : " + Build.MANUFACTURER + "\n"         // Manufacturer
//                 + "Model : " + Build.MODEL + "\n"                       // Model
//                 + "Product : " + Build.PRODUCT;
//     }
// }


import android.app.ProgressDialog;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SwitchCompat;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import org.wordcamp.android.utils.Utils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

        @Override
        protected String doInBackground(String... params) {
            if (bugSwitch.isChecked()) {
                try {
                    Process process = Runtime.getRuntime().exec("logcat -d");
                    BufferedReader bufferedReader = new BufferedReader(
                            new InputStreamReader(process.getInputStream()));

                    StringBuilder log = new StringBuilder();
                    String line;
                    while ((line = bufferedReader.readLine()) != null) {
                        log.append(line);
                        log.append("\n");
                    }
                    return log.toString();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

            return null;
        }

        @Override
        protected void onPostExecute(String appLogs) {
            super.onPostExecute(appLogs);
            dialog.dismiss();
            StringBuilder emailMessage = new StringBuilder(descr.getText().toString());
            emailMessage.append("\n\n\n=================================\n");
// Path: app/src/main/java/org/wordcamp/android/utils/Utils.java
// public class Utils {
// 
//     public static boolean isLollipopOrAbove() {
//         return Build.VERSION.SDK_INT >= 21;
//     }
// 
//     public static String getDeviceInfo() {
//         return "\n\n Device info :- \n"
//                 + "API : " + Build.VERSION.SDK_INT + "\n "              // API Level
//                 + "Device : " + Build.DEVICE + "\n"                     // Device
//                 + "Manufacturer : " + Build.MANUFACTURER + "\n"         // Manufacturer
//                 + "Model : " + Build.MODEL + "\n"                       // Model
//                 + "Product : " + Build.PRODUCT;
//     }
// }


// Path: app/src/main/java/org/wordcamp/android/FeedbackActivity.java
import android.app.ProgressDialog;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SwitchCompat;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import org.wordcamp.android.utils.Utils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


        @Override
        protected String doInBackground(String... params) {
            if (bugSwitch.isChecked()) {
                try {
                    Process process = Runtime.getRuntime().exec("logcat -d");
                    BufferedReader bufferedReader = new BufferedReader(
                            new InputStreamReader(process.getInputStream()));

                    StringBuilder log = new StringBuilder();
                    String line;
                    while ((line = bufferedReader.readLine()) != null) {
                        log.append(line);
                        log.append("\n");
                    }
                    return log.toString();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

            return null;
        }

        @Override
        protected void onPostExecute(String appLogs) {
            super.onPostExecute(appLogs);
            dialog.dismiss();
            StringBuilder emailMessage = new StringBuilder(descr.getText().toString());
            emailMessage.append("\n\n\n=================================\n");
            emailMessage.append(Utils.getDeviceInfo());