// Path: app/src/main/java/me/wavever/ganklock/MyApplication.java
// public class MyApplication extends Application{
// 
//     private static Context context;
// 
//     private static PreferenceUtil sp;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         context = getApplicationContext();
//         if (PreferenceUtil.getBoolean(Config.GANK_LOCK_IS_OPEN)) {
//             context.startService(new Intent(context, LockService.class));
//         }
//     }
// 
//     /**
//      * 获得一个全局的Context对象
//      */
//     public static Context getContext() {
//         return context;
//     }
// }


import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager;
import me.wavever.ganklock.MyApplication;
package me.wavever.ganklock.utils;


public class PreferenceUtil {
    private static SharedPreferences prefs;
    private static Editor editor;


    static {
// Path: app/src/main/java/me/wavever/ganklock/MyApplication.java
// public class MyApplication extends Application{
// 
//     private static Context context;
// 
//     private static PreferenceUtil sp;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         context = getApplicationContext();
//         if (PreferenceUtil.getBoolean(Config.GANK_LOCK_IS_OPEN)) {
//             context.startService(new Intent(context, LockService.class));
//         }
//     }
// 
//     /**
//      * 获得一个全局的Context对象
//      */
//     public static Context getContext() {
//         return context;
//     }
// }


// Path: app/src/main/java/me/wavever/ganklock/utils/PreferenceUtil.java
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager;
import me.wavever.ganklock.MyApplication;

package me.wavever.ganklock.utils;


public class PreferenceUtil {
    private static SharedPreferences prefs;
    private static Editor editor;


    static {
        prefs = PreferenceManager.getDefaultSharedPreferences(MyApplication.getContext());