// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String DB_KEY_DECKPORT = "key_deckport";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final int KCANOTIFY_DB_VERSION = 5;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String PREF_KCA_SEEK_CN = "kca_seek_cn";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final int SEEK_PURE = 0;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static Context getContextWithLocale(Context ac, Context bc) {
//     Locale locale;
//     String[] pref_locale = getStringPreferences(ac, PREF_KCA_LANGUAGE).split("-");
//     if (pref_locale[0].toLowerCase().equals("default") || pref_locale.length < 2) {
//         locale = Locale.getDefault();
//     } else {
//         locale = new Locale(pref_locale[0], pref_locale[1]);
//     }
//     Configuration configuration = new Configuration(ac.getResources().getConfiguration());
//     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
//         configuration.setLocale(locale);
//         return bc.createConfigurationContext(configuration);
//     } else {
//         configuration.locale = locale;
//         DisplayMetrics metrics = new DisplayMetrics();
//         bc.getResources().updateConfiguration(configuration, bc.getResources().getDisplayMetrics());
//         return bc;
//     }
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static String getStringPreferences(Context ctx, String key) {
//     SharedPreferences pref = ctx.getSharedPreferences("pref", Context.MODE_PRIVATE);
//     try {
//         return String.valueOf(pref.getInt(key, 0));
//     } catch (Exception e) {
//         // Nothing to do
//     }
//     return pref.getString(key, "");
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static int getWindowLayoutType() {
//     int windowLayoutType = -1;
//     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
//         windowLayoutType = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
//     } else {
//         windowLayoutType = WindowManager.LayoutParams.TYPE_PHONE;
//     }
//     return windowLayoutType;
// }


import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.os.Build;
import android.os.IBinder;
import android.provider.Settings;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationManagerCompat;
import androidx.core.content.ContextCompat;
import android.util.Log;
import android.view.Display;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import java.util.Calendar;
import static com.antest1.kcanotify.KcaConstants.DB_KEY_DECKPORT;
import static com.antest1.kcanotify.KcaConstants.KCANOTIFY_DB_VERSION;
import static com.antest1.kcanotify.KcaConstants.PREF_KCA_SEEK_CN;
import static com.antest1.kcanotify.KcaConstants.SEEK_PURE;
import static com.antest1.kcanotify.KcaUtils.getContextWithLocale;
import static com.antest1.kcanotify.KcaUtils.getStringPreferences;
import static com.antest1.kcanotify.KcaUtils.getWindowLayoutType;
    }

    @Override
    public void onDestroy() {
        if (mManager != null) mManager.removeView(mView);
        super.onDestroy();
    }

    private void stopPopup() {
        active = false;
        stopSelf();
    }

    private void setText() {
        if (fchk_info != null) {
            int target = recent_no;
            String target_str;
            if (recent_no == 4) {
                target = 0;
                target_str = "0,1";
            } else {
                target_str = String.valueOf(target);
            }

            if (KcaApiData.isGameDataLoaded() && KcaApiData.checkUserShipDataLoaded() && portdeckdata != null) {
                int cn = getSeekCn();
                String seekType = getSeekType();

                switch (current_func) {
                    case FCHK_FUNC_SEEKTP:
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String DB_KEY_DECKPORT = "key_deckport";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final int KCANOTIFY_DB_VERSION = 5;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String PREF_KCA_SEEK_CN = "kca_seek_cn";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final int SEEK_PURE = 0;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static Context getContextWithLocale(Context ac, Context bc) {
//     Locale locale;
//     String[] pref_locale = getStringPreferences(ac, PREF_KCA_LANGUAGE).split("-");
//     if (pref_locale[0].toLowerCase().equals("default") || pref_locale.length < 2) {
//         locale = Locale.getDefault();
//     } else {
//         locale = new Locale(pref_locale[0], pref_locale[1]);
//     }
//     Configuration configuration = new Configuration(ac.getResources().getConfiguration());
//     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
//         configuration.setLocale(locale);
//         return bc.createConfigurationContext(configuration);
//     } else {
//         configuration.locale = locale;
//         DisplayMetrics metrics = new DisplayMetrics();
//         bc.getResources().updateConfiguration(configuration, bc.getResources().getDisplayMetrics());
//         return bc;
//     }
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static String getStringPreferences(Context ctx, String key) {
//     SharedPreferences pref = ctx.getSharedPreferences("pref", Context.MODE_PRIVATE);
//     try {
//         return String.valueOf(pref.getInt(key, 0));
//     } catch (Exception e) {
//         // Nothing to do
//     }
//     return pref.getString(key, "");
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static int getWindowLayoutType() {
//     int windowLayoutType = -1;
//     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
//         windowLayoutType = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
//     } else {
//         windowLayoutType = WindowManager.LayoutParams.TYPE_PHONE;
//     }
//     return windowLayoutType;
// }


// Path: app/src/main/java/com/antest1/kcanotify/KcaFleetCheckPopupService.java
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.os.Build;
import android.os.IBinder;
import android.provider.Settings;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationManagerCompat;
import androidx.core.content.ContextCompat;
import android.util.Log;
import android.view.Display;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import java.util.Calendar;
import static com.antest1.kcanotify.KcaConstants.DB_KEY_DECKPORT;
import static com.antest1.kcanotify.KcaConstants.KCANOTIFY_DB_VERSION;
import static com.antest1.kcanotify.KcaConstants.PREF_KCA_SEEK_CN;
import static com.antest1.kcanotify.KcaConstants.SEEK_PURE;
import static com.antest1.kcanotify.KcaUtils.getContextWithLocale;
import static com.antest1.kcanotify.KcaUtils.getStringPreferences;
import static com.antest1.kcanotify.KcaUtils.getWindowLayoutType;

    }

    @Override
    public void onDestroy() {
        if (mManager != null) mManager.removeView(mView);
        super.onDestroy();
    }

    private void stopPopup() {
        active = false;
        stopSelf();
    }

    private void setText() {
        if (fchk_info != null) {
            int target = recent_no;
            String target_str;
            if (recent_no == 4) {
                target = 0;
                target_str = "0,1";
            } else {
                target_str = String.valueOf(target);
            }

            if (KcaApiData.isGameDataLoaded() && KcaApiData.checkUserShipDataLoaded() && portdeckdata != null) {
                int cn = getSeekCn();
                String seekType = getSeekType();

                switch (current_func) {
                    case FCHK_FUNC_SEEKTP:
                        int seekValue_0 = (int) deckInfoCalc.getSeekValue(portdeckdata, target_str, SEEK_PURE, KcaBattle.getEscapeFlag());