// Path: src/com/crossbowffs/quotelock/utils/Xlog.java
// public final class Xlog {
//     private static final String LOG_TAG = BuildConfig.LOG_TAG;
//     private static final int LOG_LEVEL = BuildConfig.LOG_LEVEL;
//     private static final boolean LOG_TO_XPOSED = BuildConfig.LOG_TO_XPOSED;
// 
//     private Xlog() { }
// 
//     private static void log(int priority, String tag, String message, Object... args) {
//         if (priority < LOG_LEVEL) {
//             return;
//         }
// 
//         message = String.format(message, args);
//         if (args.length > 0 && args[args.length - 1] instanceof Throwable) {
//             Throwable throwable = (Throwable)args[args.length - 1];
//             String stacktraceStr = Log.getStackTraceString(throwable);
//             message = message + '\n' + stacktraceStr;
//         }
// 
//         Log.println(priority, LOG_TAG, tag + ": " + message);
//         if (LOG_TO_XPOSED) {
//             Log.println(priority, "Xposed", LOG_TAG + ": " + tag + ": " + message);
//         }
//     }
// 
//     public static void v(String tag, String message, Object... args) {
//         log(Log.VERBOSE, tag, message, args);
//     }
// 
//     public static void d(String tag, String message, Object... args) {
//         log(Log.DEBUG, tag, message, args);
//     }
// 
//     public static void i(String tag, String message, Object... args) {
//         log(Log.INFO, tag, message, args);
//     }
// 
//     public static void w(String tag, String message, Object... args) {
//         log(Log.WARN, tag, message, args);
//     }
// 
//     public static void e(String tag, String message, Object... args) {
//         log(Log.ERROR, tag, message, args);
//     }
// }
// 
// Path: src/com/crossbowffs/quotelock/utils/XposedUtils.java
// public final class XposedUtils {
//     private static final int MODULE_VERSION = BuildConfig.MODULE_VERSION;
//     private static final String XPOSED_PACKAGE = "de.robv.android.xposed.installer";
//     private static final String XPOSED_ACTION = XPOSED_PACKAGE + ".OPEN_SECTION";
//     private static final String XPOSED_EXTRA_SECTION = "section";
//     public static final String XPOSED_SECTION_MODULES = "modules";
//     public static final String XPOSED_SECTION_INSTALL = "install";
// 
//     private XposedUtils() { }
// 
//     public static boolean isModuleEnabled() {
//         return getModuleVersion() >= 0;
//     }
// 
//     public static boolean isModuleUpdated() {
//         return MODULE_VERSION != getModuleVersion();
//     }
// 
//     private static int getModuleVersion() {
//         // This method is hooked by the module to return the
//         // value of BuildConfig.MODULE_VERSION, as seen from the
//         // module side.
//         return -1;
//     }
// 
//     public static boolean isXposedInstalled(Context context) {
//         PackageManager packageManager = context.getPackageManager();
//         try {
//             packageManager.getPackageInfo(XPOSED_PACKAGE, 0);
//             return true;
//         } catch (PackageManager.NameNotFoundException e) {
//             return false;
//         }
//     }
// 
//     public static boolean startXposedActivity(Context context, String section) {
//         Intent intent = new Intent(XPOSED_ACTION);
//         intent.putExtra(XPOSED_EXTRA_SECTION, section);
//         try {
//             context.startActivity(intent);
//             return true;
//         } catch (ActivityNotFoundException e) {
//             return false;
//         }
//     }
// }


import com.crossbowffs.quotelock.BuildConfig;
import com.crossbowffs.quotelock.utils.Xlog;
import com.crossbowffs.quotelock.utils.XposedUtils;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodReplacement;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;
package com.crossbowffs.quotelock.xposed;


public class XposedUtilsHook implements IXposedHookLoadPackage {
    private static final String TAG = XposedUtilsHook.class.getSimpleName();
    private static final String QUOTELOCK_PACKAGE = BuildConfig.APPLICATION_ID;
    private static final int MODULE_VERSION = BuildConfig.MODULE_VERSION;

    private static void hookXposedUtils(XC_LoadPackage.LoadPackageParam lpparam) {
        String className = XposedUtils.class.getName();

// Path: src/com/crossbowffs/quotelock/utils/Xlog.java
// public final class Xlog {
//     private static final String LOG_TAG = BuildConfig.LOG_TAG;
//     private static final int LOG_LEVEL = BuildConfig.LOG_LEVEL;
//     private static final boolean LOG_TO_XPOSED = BuildConfig.LOG_TO_XPOSED;
// 
//     private Xlog() { }
// 
//     private static void log(int priority, String tag, String message, Object... args) {
//         if (priority < LOG_LEVEL) {
//             return;
//         }
// 
//         message = String.format(message, args);
//         if (args.length > 0 && args[args.length - 1] instanceof Throwable) {
//             Throwable throwable = (Throwable)args[args.length - 1];
//             String stacktraceStr = Log.getStackTraceString(throwable);
//             message = message + '\n' + stacktraceStr;
//         }
// 
//         Log.println(priority, LOG_TAG, tag + ": " + message);
//         if (LOG_TO_XPOSED) {
//             Log.println(priority, "Xposed", LOG_TAG + ": " + tag + ": " + message);
//         }
//     }
// 
//     public static void v(String tag, String message, Object... args) {
//         log(Log.VERBOSE, tag, message, args);
//     }
// 
//     public static void d(String tag, String message, Object... args) {
//         log(Log.DEBUG, tag, message, args);
//     }
// 
//     public static void i(String tag, String message, Object... args) {
//         log(Log.INFO, tag, message, args);
//     }
// 
//     public static void w(String tag, String message, Object... args) {
//         log(Log.WARN, tag, message, args);
//     }
// 
//     public static void e(String tag, String message, Object... args) {
//         log(Log.ERROR, tag, message, args);
//     }
// }
// 
// Path: src/com/crossbowffs/quotelock/utils/XposedUtils.java
// public final class XposedUtils {
//     private static final int MODULE_VERSION = BuildConfig.MODULE_VERSION;
//     private static final String XPOSED_PACKAGE = "de.robv.android.xposed.installer";
//     private static final String XPOSED_ACTION = XPOSED_PACKAGE + ".OPEN_SECTION";
//     private static final String XPOSED_EXTRA_SECTION = "section";
//     public static final String XPOSED_SECTION_MODULES = "modules";
//     public static final String XPOSED_SECTION_INSTALL = "install";
// 
//     private XposedUtils() { }
// 
//     public static boolean isModuleEnabled() {
//         return getModuleVersion() >= 0;
//     }
// 
//     public static boolean isModuleUpdated() {
//         return MODULE_VERSION != getModuleVersion();
//     }
// 
//     private static int getModuleVersion() {
//         // This method is hooked by the module to return the
//         // value of BuildConfig.MODULE_VERSION, as seen from the
//         // module side.
//         return -1;
//     }
// 
//     public static boolean isXposedInstalled(Context context) {
//         PackageManager packageManager = context.getPackageManager();
//         try {
//             packageManager.getPackageInfo(XPOSED_PACKAGE, 0);
//             return true;
//         } catch (PackageManager.NameNotFoundException e) {
//             return false;
//         }
//     }
// 
//     public static boolean startXposedActivity(Context context, String section) {
//         Intent intent = new Intent(XPOSED_ACTION);
//         intent.putExtra(XPOSED_EXTRA_SECTION, section);
//         try {
//             context.startActivity(intent);
//             return true;
//         } catch (ActivityNotFoundException e) {
//             return false;
//         }
//     }
// }


// Path: src/com/crossbowffs/quotelock/xposed/XposedUtilsHook.java
import com.crossbowffs.quotelock.BuildConfig;
import com.crossbowffs.quotelock.utils.Xlog;
import com.crossbowffs.quotelock.utils.XposedUtils;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodReplacement;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;

package com.crossbowffs.quotelock.xposed;


public class XposedUtilsHook implements IXposedHookLoadPackage {
    private static final String TAG = XposedUtilsHook.class.getSimpleName();
    private static final String QUOTELOCK_PACKAGE = BuildConfig.APPLICATION_ID;
    private static final int MODULE_VERSION = BuildConfig.MODULE_VERSION;

    private static void hookXposedUtils(XC_LoadPackage.LoadPackageParam lpparam) {
        String className = XposedUtils.class.getName();

        Xlog.i(TAG, "Hooking Xposed module status checker");