// Path: provider/src/main/java/com/raygun/raygun4android/logging/RaygunLogger.java
// public class RaygunLogger {
// 
//     public static void d(String string) {
//         if (string != null) {
//             Timber.tag(RaygunSettings.LOGGING_TAG).d(string);
//         }
//     }
// 
//     public static void i(String string) {
//         if (string != null) {
//             Timber.tag(RaygunSettings.LOGGING_TAG).i(string);
//         }
//     }
// 
//     public static void w(String string) {
//         if (string != null) {
//             Timber.tag(RaygunSettings.LOGGING_TAG).w(string);
//         }
//     }
// 
//     public static void e(String string) {
//         if (string != null) {
//             Timber.tag(RaygunSettings.LOGGING_TAG).e(string);
//         }
//     }
// 
//     public static void v(String string) {
//         if (string != null) {
//             Timber.tag(RaygunSettings.LOGGING_TAG).v(string);
//         }
//     }
// 
//     public static void responseCode(int responseCode) {
//         switch (responseCode) {
//             case RaygunSettings.RESPONSE_CODE_ACCEPTED:
//                 RaygunLogger.d("Request succeeded");
//                 break;
//             case RaygunSettings.RESPONSE_CODE_BAD_MESSAGE:
//                 RaygunLogger.e("Bad message - could not parse the provided JSON. Check all fields are present, especially both occurredOn (ISO 8601 DateTime) and details { } at the top level");
//                 break;
//             case RaygunSettings.RESPONSE_CODE_INVALID_API_KEY:
//                 RaygunLogger.e("Invalid API Key - The value specified in the header X-ApiKey did not match with an application in Raygun");
//                 break;
//             case RaygunSettings.RESPONSE_CODE_LARGE_PAYLOAD:
//                 RaygunLogger.e("Request entity too large - The maximum size of a JSON payload is 128KB");
//                 break;
//             case RaygunSettings.RESPONSE_CODE_RATE_LIMITED:
//                 RaygunLogger.e("Too Many Requests - Plan limit exceeded for month or plan expired");
//                 break;
//             default:
//                 RaygunLogger.d("Response status code: " + responseCode);
// 
//         }
//     }
// 
// }


import android.app.ActivityManager;
import android.content.Context;
import android.os.Build;
import android.os.Environment;
import android.os.StatFs;
import android.util.DisplayMetrics;
import android.view.WindowManager;
import com.raygun.raygun4android.logging.RaygunLogger;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.Date;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
                currentOrientation = "Undefined";
            }

            DisplayMetrics metrics = new DisplayMetrics();
            ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getMetrics(metrics);
            windowsBoundWidth = metrics.widthPixels;
            windowsBoundHeight = metrics.heightPixels;

            TimeZone tz = TimeZone.getDefault();
            Date now = new Date();
            utcOffset = TimeUnit.SECONDS.convert(tz.getOffset(now.getTime()), TimeUnit.MILLISECONDS) / 3600;
            locale = context.getResources().getConfiguration().locale.toString();

            ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
            ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
            am.getMemoryInfo(mi);
            availablePhysicalMemory = mi.availMem / 0x100000;

            Pattern p = Pattern.compile("^\\D*(\\d*).*$");
            Matcher m = p.matcher(getTotalRam());
            m.find();
            String match = m.group(1);
            totalPhysicalMemory = Long.parseLong(match) / 0x400;

            StatFs stat = new StatFs(Environment.getDataDirectory().getPath());

            long availableBlocks = (long) stat.getAvailableBlocks();
            long blockSize = (long) stat.getBlockSize();
            diskSpaceFree = (availableBlocks * blockSize) / 0x100000;
        } catch (Exception e) {
// Path: provider/src/main/java/com/raygun/raygun4android/logging/RaygunLogger.java
// public class RaygunLogger {
// 
//     public static void d(String string) {
//         if (string != null) {
//             Timber.tag(RaygunSettings.LOGGING_TAG).d(string);
//         }
//     }
// 
//     public static void i(String string) {
//         if (string != null) {
//             Timber.tag(RaygunSettings.LOGGING_TAG).i(string);
//         }
//     }
// 
//     public static void w(String string) {
//         if (string != null) {
//             Timber.tag(RaygunSettings.LOGGING_TAG).w(string);
//         }
//     }
// 
//     public static void e(String string) {
//         if (string != null) {
//             Timber.tag(RaygunSettings.LOGGING_TAG).e(string);
//         }
//     }
// 
//     public static void v(String string) {
//         if (string != null) {
//             Timber.tag(RaygunSettings.LOGGING_TAG).v(string);
//         }
//     }
// 
//     public static void responseCode(int responseCode) {
//         switch (responseCode) {
//             case RaygunSettings.RESPONSE_CODE_ACCEPTED:
//                 RaygunLogger.d("Request succeeded");
//                 break;
//             case RaygunSettings.RESPONSE_CODE_BAD_MESSAGE:
//                 RaygunLogger.e("Bad message - could not parse the provided JSON. Check all fields are present, especially both occurredOn (ISO 8601 DateTime) and details { } at the top level");
//                 break;
//             case RaygunSettings.RESPONSE_CODE_INVALID_API_KEY:
//                 RaygunLogger.e("Invalid API Key - The value specified in the header X-ApiKey did not match with an application in Raygun");
//                 break;
//             case RaygunSettings.RESPONSE_CODE_LARGE_PAYLOAD:
//                 RaygunLogger.e("Request entity too large - The maximum size of a JSON payload is 128KB");
//                 break;
//             case RaygunSettings.RESPONSE_CODE_RATE_LIMITED:
//                 RaygunLogger.e("Too Many Requests - Plan limit exceeded for month or plan expired");
//                 break;
//             default:
//                 RaygunLogger.d("Response status code: " + responseCode);
// 
//         }
//     }
// 
// }


// Path: provider/src/main/java/com/raygun/raygun4android/messages/crashreporting/RaygunEnvironmentMessage.java
import android.app.ActivityManager;
import android.content.Context;
import android.os.Build;
import android.os.Environment;
import android.os.StatFs;
import android.util.DisplayMetrics;
import android.view.WindowManager;
import com.raygun.raygun4android.logging.RaygunLogger;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.Date;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

                currentOrientation = "Undefined";
            }

            DisplayMetrics metrics = new DisplayMetrics();
            ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getMetrics(metrics);
            windowsBoundWidth = metrics.widthPixels;
            windowsBoundHeight = metrics.heightPixels;

            TimeZone tz = TimeZone.getDefault();
            Date now = new Date();
            utcOffset = TimeUnit.SECONDS.convert(tz.getOffset(now.getTime()), TimeUnit.MILLISECONDS) / 3600;
            locale = context.getResources().getConfiguration().locale.toString();

            ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
            ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
            am.getMemoryInfo(mi);
            availablePhysicalMemory = mi.availMem / 0x100000;

            Pattern p = Pattern.compile("^\\D*(\\d*).*$");
            Matcher m = p.matcher(getTotalRam());
            m.find();
            String match = m.group(1);
            totalPhysicalMemory = Long.parseLong(match) / 0x400;

            StatFs stat = new StatFs(Environment.getDataDirectory().getPath());

            long availableBlocks = (long) stat.getAvailableBlocks();
            long blockSize = (long) stat.getBlockSize();
            diskSpaceFree = (availableBlocks * blockSize) / 0x100000;
        } catch (Exception e) {
            RaygunLogger.w("Couldn't get all env data: " + e);