// Path: hoko/src/main/java/com/hokolinks/utils/log/HokoLog.java
// public class HokoLog {
//     /**
//      * The Log TAG
//      */
//     public static final String TAG = "HOKO";
// 
//     /**
//      * Verbose is false by default
//      */
//     private static boolean sVerbose = false;
// 
//     /**
//      * Prints a debug message.
//      *
//      * @param message The message.
//      */
//     public static void d(String message) {
//         if (sVerbose) {
//             android.util.Log.d(TAG, message);
//         }
//     }
// 
//     /**
//      * Prints a debug exception.
//      *
//      * @param exception The exception.
//      */
//     public static void d(Exception exception) {
//         if (sVerbose) {
//             android.util.Log.d(TAG, exception.getMessage(), exception);
//         }
//     }
// 
//     /**
//      * Prints a message as an error.
//      *
//      * @param message The message.
//      */
//     public static void e(String message) {
//         android.util.Log.e(TAG, message);
//     }
// 
//     /**
//      * Prints an exception as an error.
//      *
//      * @param exception The exception.
//      */
//     public static void e(Exception exception) {
//         android.util.Log.e(TAG, exception.getMessage(), exception);
//     }
// 
//     /**
//      * Prints an error.
//      *
//      * @param error The exception.
//      */
//     public static void e(Error error) {
//         android.util.Log.e(TAG, error.getMessage(), error);
//     }
// 
//     public static boolean isVerbose() {
//         return sVerbose;
//     }
// 
//     public static void setVerbose(boolean verbose) {
//         HokoLog.sVerbose = verbose;
//     }
// 
// }


import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import com.hokolinks.utils.log.HokoLog;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Calendar;
import java.util.Locale;
import java.util.UUID;
package com.hokolinks.utils;




/**
 * Utils serves many purposes, but mostly loading and saving objects/strings to file or
 * to the SharedPreferences. It also provides utility methods to generate random UUIDs and
 * sanitizing routes.
 */
public class Utils {

    // Hoko folder name
    private static final String FOLDER_NAME = "hoko";
    // Hoko SharedPreferences key
    private static final String SHARED_PREFERENCES_STRING_KEY = "com.hoko.string";

    /**
     * Checks where the application has a given permission granted on the AndroidManifest.xml file.
     *
     * @param permission The permission to be checked.
     * @param context    A context object.
     * @return true if has permission, false otherwise.
     */
    public static boolean hasPermission(String permission, Context context) {
        try {
            PackageManager packageManager = context.getPackageManager();
            if (packageManager.checkPermission(permission, context.getPackageName())
                    == PackageManager.PERMISSION_GRANTED) {
                return true;
            } else {
// Path: hoko/src/main/java/com/hokolinks/utils/log/HokoLog.java
// public class HokoLog {
//     /**
//      * The Log TAG
//      */
//     public static final String TAG = "HOKO";
// 
//     /**
//      * Verbose is false by default
//      */
//     private static boolean sVerbose = false;
// 
//     /**
//      * Prints a debug message.
//      *
//      * @param message The message.
//      */
//     public static void d(String message) {
//         if (sVerbose) {
//             android.util.Log.d(TAG, message);
//         }
//     }
// 
//     /**
//      * Prints a debug exception.
//      *
//      * @param exception The exception.
//      */
//     public static void d(Exception exception) {
//         if (sVerbose) {
//             android.util.Log.d(TAG, exception.getMessage(), exception);
//         }
//     }
// 
//     /**
//      * Prints a message as an error.
//      *
//      * @param message The message.
//      */
//     public static void e(String message) {
//         android.util.Log.e(TAG, message);
//     }
// 
//     /**
//      * Prints an exception as an error.
//      *
//      * @param exception The exception.
//      */
//     public static void e(Exception exception) {
//         android.util.Log.e(TAG, exception.getMessage(), exception);
//     }
// 
//     /**
//      * Prints an error.
//      *
//      * @param error The exception.
//      */
//     public static void e(Error error) {
//         android.util.Log.e(TAG, error.getMessage(), error);
//     }
// 
//     public static boolean isVerbose() {
//         return sVerbose;
//     }
// 
//     public static void setVerbose(boolean verbose) {
//         HokoLog.sVerbose = verbose;
//     }
// 
// }


// Path: hoko/src/main/java/com/hokolinks/utils/Utils.java
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import com.hokolinks.utils.log.HokoLog;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Calendar;
import java.util.Locale;
import java.util.UUID;

package com.hokolinks.utils;




/**
 * Utils serves many purposes, but mostly loading and saving objects/strings to file or
 * to the SharedPreferences. It also provides utility methods to generate random UUIDs and
 * sanitizing routes.
 */
public class Utils {

    // Hoko folder name
    private static final String FOLDER_NAME = "hoko";
    // Hoko SharedPreferences key
    private static final String SHARED_PREFERENCES_STRING_KEY = "com.hoko.string";

    /**
     * Checks where the application has a given permission granted on the AndroidManifest.xml file.
     *
     * @param permission The permission to be checked.
     * @param context    A context object.
     * @return true if has permission, false otherwise.
     */
    public static boolean hasPermission(String permission, Context context) {
        try {
            PackageManager packageManager = context.getPackageManager();
            if (packageManager.checkPermission(permission, context.getPackageName())
                    == PackageManager.PERMISSION_GRANTED) {
                return true;
            } else {
                HokoLog.e("Requesting permission " + permission