// 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 int KCANOTIFY_QTDB_VERSION = 3;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final List<String> PREFS_BOOLEAN_LIST = Arrays.asList(PREF_BOOLEAN_ARRAY);
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static Boolean getBooleanPreferences(Context ctx, String key) {
//     SharedPreferences pref = ctx.getSharedPreferences("pref", Context.MODE_PRIVATE);
//     return pref.getBoolean(key, false);
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static int getId(String resourceName, Class<?> c) {
//     try {
//         Field idField = c.getDeclaredField(resourceName);
//         return idField.getInt(idField);
//     } catch (Exception e) {
//         throw new RuntimeException("No resource ID found for: "
//                 + resourceName + " / " + c, e);
//     }
// }
// 
// 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, "");
// }


import android.content.SharedPreferences;
import android.graphics.PorterDuff;
import android.os.Bundle;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonSyntaxException;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import static com.antest1.kcanotify.KcaConstants.KCANOTIFY_DB_VERSION;
import static com.antest1.kcanotify.KcaConstants.KCANOTIFY_QTDB_VERSION;
import static com.antest1.kcanotify.KcaConstants.PREFS_BOOLEAN_LIST;
import static com.antest1.kcanotify.KcaUtils.getBooleanPreferences;
import static com.antest1.kcanotify.KcaUtils.getId;
import static com.antest1.kcanotify.KcaUtils.getStringPreferences;

            String[] type_key_list = type_key.split(" ");
            key = type_key_list[1];
            view_key.setText(key);

            view_format.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (value_text == null || value_text.length() > 0) {
                        is_formatted = !is_formatted;
                        setText(type_key);
                    }
                }
            });

            view_delete.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    if (value_text != null) {
                        if (type_key.startsWith(DB_PREFIX)) {
                            dbHelper.deleteValue(key);
                        } else if (type_key.startsWith(QT_PREFIX)) {
                            questTracker.clearQuestTrack();
                        } else if (type_key.startsWith(DQ_PREFIX)) {
                            dbHelper.clearQuest();
                        } else  if (type_key.startsWith(PREF_PREFIX)) {
                            SharedPreferences pref = getSharedPreferences("pref", MODE_PRIVATE);
                            SharedPreferences.Editor editor = pref.edit();
                            String value = SettingActivity.getDefaultValue(key);
                            if (value.startsWith("R.string.")) {
// 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 int KCANOTIFY_QTDB_VERSION = 3;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final List<String> PREFS_BOOLEAN_LIST = Arrays.asList(PREF_BOOLEAN_ARRAY);
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static Boolean getBooleanPreferences(Context ctx, String key) {
//     SharedPreferences pref = ctx.getSharedPreferences("pref", Context.MODE_PRIVATE);
//     return pref.getBoolean(key, false);
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static int getId(String resourceName, Class<?> c) {
//     try {
//         Field idField = c.getDeclaredField(resourceName);
//         return idField.getInt(idField);
//     } catch (Exception e) {
//         throw new RuntimeException("No resource ID found for: "
//                 + resourceName + " / " + c, e);
//     }
// }
// 
// 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/KcaInspectorDetailActivity.java
import android.content.SharedPreferences;
import android.graphics.PorterDuff;
import android.os.Bundle;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonSyntaxException;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import static com.antest1.kcanotify.KcaConstants.KCANOTIFY_DB_VERSION;
import static com.antest1.kcanotify.KcaConstants.KCANOTIFY_QTDB_VERSION;
import static com.antest1.kcanotify.KcaConstants.PREFS_BOOLEAN_LIST;
import static com.antest1.kcanotify.KcaUtils.getBooleanPreferences;
import static com.antest1.kcanotify.KcaUtils.getId;
import static com.antest1.kcanotify.KcaUtils.getStringPreferences;


            String[] type_key_list = type_key.split(" ");
            key = type_key_list[1];
            view_key.setText(key);

            view_format.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (value_text == null || value_text.length() > 0) {
                        is_formatted = !is_formatted;
                        setText(type_key);
                    }
                }
            });

            view_delete.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    if (value_text != null) {
                        if (type_key.startsWith(DB_PREFIX)) {
                            dbHelper.deleteValue(key);
                        } else if (type_key.startsWith(QT_PREFIX)) {
                            questTracker.clearQuestTrack();
                        } else if (type_key.startsWith(DQ_PREFIX)) {
                            dbHelper.clearQuest();
                        } else  if (type_key.startsWith(PREF_PREFIX)) {
                            SharedPreferences pref = getSharedPreferences("pref", MODE_PRIVATE);
                            SharedPreferences.Editor editor = pref.edit();
                            String value = SettingActivity.getDefaultValue(key);
                            if (value.startsWith("R.string.")) {
                                editor.putString(key, getString(getId(value.replace("R.string.", ""), R.string.class)));