Search in sources :

Example 61 with JsonPrimitive

use of com.google.gson.JsonPrimitive in project intellij-plugins by JetBrains.

the class TypeHierarchyItem method toJson.

public JsonObject toJson() {
    JsonObject jsonObject = new JsonObject();
    jsonObject.add("classElement", classElement.toJson());
    if (displayName != null) {
        jsonObject.addProperty("displayName", displayName);
    }
    if (memberElement != null) {
        jsonObject.add("memberElement", memberElement.toJson());
    }
    if (superclass != null) {
        jsonObject.addProperty("superclass", superclass);
    }
    JsonArray jsonArrayInterfaces = new JsonArray();
    for (int elt : interfaces) {
        jsonArrayInterfaces.add(new JsonPrimitive(elt));
    }
    jsonObject.add("interfaces", jsonArrayInterfaces);
    JsonArray jsonArrayMixins = new JsonArray();
    for (int elt : mixins) {
        jsonArrayMixins.add(new JsonPrimitive(elt));
    }
    jsonObject.add("mixins", jsonArrayMixins);
    JsonArray jsonArraySubclasses = new JsonArray();
    for (int elt : subclasses) {
        jsonArraySubclasses.add(new JsonPrimitive(elt));
    }
    jsonObject.add("subclasses", jsonArraySubclasses);
    return jsonObject;
}
Also used : JsonArray(com.google.gson.JsonArray) JsonPrimitive(com.google.gson.JsonPrimitive) JsonObject(com.google.gson.JsonObject)

Example 62 with JsonPrimitive

use of com.google.gson.JsonPrimitive in project intellij-plugins by JetBrains.

the class Occurrences method toJson.

public JsonObject toJson() {
    JsonObject jsonObject = new JsonObject();
    jsonObject.add("element", element.toJson());
    JsonArray jsonArrayOffsets = new JsonArray();
    for (int elt : offsets) {
        jsonArrayOffsets.add(new JsonPrimitive(elt));
    }
    jsonObject.add("offsets", jsonArrayOffsets);
    jsonObject.addProperty("length", length);
    return jsonObject;
}
Also used : JsonArray(com.google.gson.JsonArray) JsonPrimitive(com.google.gson.JsonPrimitive) JsonObject(com.google.gson.JsonObject)

Example 63 with JsonPrimitive

use of com.google.gson.JsonPrimitive in project gerrit by GerritCodeReview.

the class EditDeserializer method add.

private void add(final JsonArray a, final Edit src) {
    a.add(new JsonPrimitive(src.getBeginA()));
    a.add(new JsonPrimitive(src.getEndA()));
    a.add(new JsonPrimitive(src.getBeginB()));
    a.add(new JsonPrimitive(src.getEndB()));
}
Also used : JsonPrimitive(com.google.gson.JsonPrimitive)

Example 64 with JsonPrimitive

use of com.google.gson.JsonPrimitive in project gerrit by GerritCodeReview.

the class ParameterParser method formToJson.

@VisibleForTesting
static JsonObject formToJson(Map<String, String[]> map, Set<String> query) throws BadRequestException {
    JsonObject inputObject = new JsonObject();
    for (Map.Entry<String, String[]> ent : map.entrySet()) {
        String key = ent.getKey();
        String[] values = ent.getValue();
        if (query.contains(key) || values.length == 0) {
            // Implementations of views should avoid duplicate naming.
            continue;
        }
        JsonObject obj = inputObject;
        int dot = key.indexOf('.');
        if (0 <= dot) {
            String property = key.substring(0, dot);
            JsonElement e = inputObject.get(property);
            if (e == null) {
                obj = new JsonObject();
                inputObject.add(property, obj);
            } else if (e.isJsonObject()) {
                obj = e.getAsJsonObject();
            } else {
                throw new BadRequestException(String.format("key %s conflicts with %s", key, property));
            }
            key = key.substring(dot + 1);
        }
        if (obj.get(key) != null) {
            // again indicates something has gone very wrong.
            throw new BadRequestException("invalid form input, use JSON instead");
        } else if (values.length == 1) {
            obj.addProperty(key, values[0]);
        } else {
            JsonArray list = new JsonArray();
            for (String v : values) {
                list.add(new JsonPrimitive(v));
            }
            obj.add(key, list);
        }
    }
    return inputObject;
}
Also used : JsonArray(com.google.gson.JsonArray) JsonPrimitive(com.google.gson.JsonPrimitive) JsonElement(com.google.gson.JsonElement) JsonObject(com.google.gson.JsonObject) BadRequestException(com.google.gerrit.extensions.restapi.BadRequestException) Map(java.util.Map) DynamicMap(com.google.gerrit.extensions.registration.DynamicMap) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 65 with JsonPrimitive

use of com.google.gson.JsonPrimitive in project kcanotify by antest1.

the class KcaService method handleServiceMessage.

public void handleServiceMessage(Message msg) {
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    String url = msg.getData().getString("url");
    byte[] raw = msg.getData().getByteArray("data");
    Reader data = new InputStreamReader(new ByteArrayInputStream(raw));
    String request = msg.getData().getString("request");
    KcaCustomToast customToast = new KcaCustomToast(getApplicationContext());
    if (!prefs.getBoolean(PREF_SVC_ENABLED, false) || url.length() == 0 || viewNotificationBuilder == null) {
        return;
    }
    JsonObject jsonDataObj;
    try {
        String init = new String(Arrays.copyOfRange(raw, 0, 7));
        if (init.contains("svdata=")) {
            data.skip("svdata=".length());
        }
        jsonDataObj = new JsonParser().parse(data).getAsJsonObject();
        if (url.startsWith(KCA_VERSION)) {
            isInitState = false;
            isPortAccessed = false;
            api_start2_init = false;
            api_start2_loading_flag = true;
            KcaFleetViewService.setReadyFlag(false);
            //Toast.makeText(contextWithLocale, "KCA_VERSION", Toast.LENGTH_LONG).show();
            JsonObject api_version = jsonDataObj.get("api").getAsJsonObject();
            kca_version = api_version.get("api_start2").getAsString();
            Log.e("KCA", kca_version);
            if (!getStringPreferences(getApplicationContext(), PREF_KCA_VERSION).equals(kca_version)) {
                api_start2_down_mode = true;
            } else {
                api_start2_down_mode = false;
                JsonObject kcDataObj = dbHelper.getJsonObjectValue(DB_KEY_STARTDATA);
                //Log.e("KCA", kcDataObj.toJSONString());
                if (kcDataObj != null && kcDataObj.has("api_data")) {
                    //Toast.makeText(contextWithLocale, "Load Kancolle Data", Toast.LENGTH_LONG).show();
                    KcaApiData.getKcGameData(kcDataObj.getAsJsonObject("api_data"));
                    setPreferences(getApplicationContext(), PREF_KCA_VERSION, kca_version);
                }
            }
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(getApplicationContext())) {
            // Can not draw overlays: pass
            } else {
                startService(new Intent(this, KcaViewButtonService.class));
                startService(new Intent(this, KcaQuestViewService.class));
                startService(new Intent(this, KcaAkashiViewService.class));
            }
            return;
        //Toast.makeText(contextWithLocale, getPreferences("kca_version") + " " + String.valueOf(api_start2_down_mode), Toast.LENGTH_LONG).show();
        }
        if (url.startsWith(API_WORLD_GET_ID)) {
            return;
        }
        if (url.startsWith(API_REQ_MEMBER_GET_INCENTIVE)) {
            return;
        }
        if (url.startsWith(API_START2)) {
            //Log.e("KCA", "Load Kancolle Data");
            //Toast.makeText(contextWithLocale, "API_START2", Toast.LENGTH_LONG).show();
            api_start2_data = jsonDataObj.toString();
            dbHelper.putValue(DB_KEY_STARTDATA, api_start2_data);
            if (jsonDataObj.has("api_data")) {
                //Toast.makeText(contextWithLocale, "Load Kancolle Data", Toast.LENGTH_LONG).show();
                KcaApiData.getKcGameData(jsonDataObj.getAsJsonObject("api_data"));
                if (kca_version != null) {
                    setPreferences(getApplicationContext(), "kca_version", kca_version);
                }
            }
            return;
        }
        if (url.startsWith(API_GET_MEMBER_REQUIRED_INFO)) {
            if (jsonDataObj.has("api_data")) {
                //dbHelper.putValue(DB_KEY_USEREQUIP, jsonDataObj.getAsJsonObject("api_data").getAsJsonArray("api_slot_item").toString());
                JsonObject requiredInfoApiData = jsonDataObj.getAsJsonObject("api_data");
                int size2 = KcaApiData.putSlotItemDataToDB(requiredInfoApiData.getAsJsonArray("api_slot_item"));
                int userId = KcaApiData.getUserId(requiredInfoApiData);
                Log.e("KCA", "Total Items: " + String.valueOf(size2));
                if (size2 > 0)
                    isUserItemDataLoaded = true;
                if (api_start2_data == null && api_start2_down_mode) {
                    customToast.showToast(getStringWithLocale(R.string.kca_toast_get_data_at_settings), Toast.LENGTH_LONG, ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryDark));
                // new retrieveApiStartData().execute("", "down", "");
                // setFrontViewNotifier(FRONT_NONE, 0, getStringWithLocale(R.string.kca_toast_loading_data));
                }
            }
            return;
        }
        if (url.startsWith(API_GET_MEMBER_DECK)) {
            //Log.e("KCA", "Expedition Handler Called");
            if (jsonDataObj.has("api_data")) {
                dbHelper.putValue(DB_KEY_DECKPORT, jsonDataObj.getAsJsonArray("api_data").toString());
                processExpeditionInfo();
            }
            return;
        }
        if (url.startsWith(API_REQ_MISSION_RESULT)) {
            int deck_id = -1;
            String[] requestData = request.split("&");
            for (int i = 0; i < requestData.length; i++) {
                String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                if (decodedData.startsWith("api_deck_id")) {
                    deck_id = Integer.valueOf(decodedData.replace("api_deck_id=", "")) - 1;
                    break;
                }
            }
            notifiManager.cancel(getNotificationId(NOTI_EXP, deck_id));
            if (jsonDataObj.has("api_data")) {
                JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                if (api_data.has("api_clear_result") && api_data.get("api_clear_result").getAsInt() > 0) {
                    questTracker.updateIdCountTracker("402");
                    questTracker.updateIdCountTracker("403");
                    questTracker.updateIdCountTracker("404");
                    String api_name = jsonDataObj.get("api_quest_name").getAsString();
                    if (api_name.contains("\\u6771\\u4eac\\u6025\\u884c")) {
                        // 도쿄급행
                        questTracker.updateIdCountTracker("410");
                        questTracker.updateIdCountTracker("411");
                    } else if (api_name.equals("\\u6d77\\u4e0a\\u8b77\\u885b\\u4efb\\u52d9")) {
                        // 해상호위
                        questTracker.updateIdCountTracker("424");
                    }
                    updateQuestView();
                }
                if (api_data.has("api_get_exp")) {
                    dbHelper.updateExpScore(api_data.get("api_get_exp").getAsInt());
                }
            }
        }
        if (url.startsWith(API_GET_MEMBER_NDOCK)) {
            if (jsonDataObj.has("api_data")) {
                JsonArray api_data = jsonDataObj.getAsJsonArray("api_data");
                processDockingInfo(api_data);
            }
            return;
        }
        if (url.startsWith(API_REQ_NYUKYO_START)) {
            questTracker.updateIdCountTracker("503");
            updateQuestView();
            return;
        }
        if (url.startsWith(API_REQ_NYUKYO_SPEEDCHAGNE)) {
            int ndock_id = -1;
            String[] requestData = request.split("&");
            for (int i = 0; i < requestData.length; i++) {
                String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                if (decodedData.startsWith("api_ndock_id")) {
                    ndock_id = Integer.valueOf(decodedData.replace("api_ndock_id=", "")) - 1;
                    break;
                }
            }
            if (ndock_id != -1)
                processDockingSpeedup(ndock_id);
            return;
        }
        if (url.startsWith(API_REQ_HOKYU_CHARGE)) {
            questTracker.updateIdCountTracker("504");
            updateQuestView();
            return;
        }
        if (url.startsWith(API_PORT)) {
            isPortAccessed = true;
            stopService(new Intent(this, KcaBattleViewService.class));
            startService(new Intent(this, KcaViewButtonService.class).setAction(KcaViewButtonService.DEACTIVATE_BATTLEVIEW_ACTION));
            startService(new Intent(this, KcaViewButtonService.class).setAction(KcaViewButtonService.RESET_FAIRY_STATUS_ACTION));
            if (jsonDataObj.has("api_data")) {
                JsonObject reqPortApiData = jsonDataObj.getAsJsonObject("api_data");
                KcaApiData.getPortData(reqPortApiData);
                if (reqPortApiData.has("api_deck_port")) {
                    dbHelper.putValue(DB_KEY_DECKPORT, reqPortApiData.getAsJsonArray("api_deck_port").toString());
                    dbHelper.test();
                }
            }
        }
        if (url.startsWith(API_GET_MEMBER_SLOT_ITEM)) {
            if (jsonDataObj.has("api_data")) {
                JsonArray api_data = jsonDataObj.get("api_data").getAsJsonArray();
                KcaApiData.putSlotItemDataToDB(api_data);
                isUserItemDataLoaded = true;
            }
        }
        if (!API_QUEST_REQS.contains(url) && !url.equals(API_GET_MEMBER_MATERIAL) && KcaQuestViewService.getQuestMode()) {
            startService(new Intent(this, KcaViewButtonService.class).setAction(KcaViewButtonService.DEACTIVATE_QUESTVIEW_ACTION));
            KcaQuestViewService.setQuestMode(false);
            startService(new Intent(this, KcaQuestViewService.class).setAction(KcaQuestViewService.CLOSE_QUESTVIEW_ACTION));
            updateQuestView();
        }
        if (url.startsWith(API_GET_MEMBER_QUESTLIST)) {
            startService(new Intent(this, KcaViewButtonService.class).setAction(KcaViewButtonService.ACTIVATE_QUESTVIEW_ACTION));
            KcaQuestViewService.setQuestMode(true);
            int api_tab_id = -1;
            String[] requestData = request.split("&");
            for (int i = 0; i < requestData.length; i++) {
                String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                if (decodedData.startsWith("api_tab_id")) {
                    api_tab_id = Integer.valueOf(decodedData.replace("api_tab_id=", ""));
                    break;
                }
            }
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(getApplicationContext())) {
            // Can not draw overlays: pass
            } else if (jsonDataObj.has("api_data")) {
                JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                KcaQuestViewService.setApiData(api_data);
                startService(new Intent(this, KcaViewButtonService.class).setAction(KcaViewButtonService.FAIRY_VISIBLE));
                startService(new Intent(getBaseContext(), KcaQuestViewService.class).setAction(REFRESH_QUESTVIEW_ACTION).putExtra("tab_id", api_tab_id));
            }
        }
        if (url.startsWith(API_REQ_QUEST_CLEARITEMGET)) {
            int quest_id = 0;
            String[] requestData = request.split("&");
            for (int i = 0; i < requestData.length; i++) {
                String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                if (decodedData.startsWith("api_quest_id")) {
                    quest_id = Integer.valueOf(decodedData.replace("api_quest_id=", ""));
                    break;
                }
            }
            Log.e("KCA", "clear " + String.valueOf(quest_id));
            dbHelper.removeQuest(quest_id);
            questTracker.removeQuestTrack(quest_id, true);
        }
        // Game Data Dependent Tasks
        if (!isUserItemDataLoaded) {
            customToast.showToast(getStringWithLocale(R.string.kca_toast_restart_at_kcanotify), Toast.LENGTH_LONG, ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryDark));
        } else if (!checkDataLoadTriggered()) {
            if (!api_start2_loading_flag) {
                customToast.showToast(getStringWithLocale(R.string.kca_toast_get_data_at_settings), Toast.LENGTH_LONG, ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryDark));
            //new retrieveApiStartData().execute("", "down", "");
            }
        } else if (api_start2_loading_flag) {
            setFrontViewNotifier(FRONT_NONE, 0, getStringWithLocale(R.string.kca_toast_loading_data));
        } else {
            if (url.startsWith(API_PORT)) {
                KcaFleetViewService.setReadyFlag(true);
                heavyDamagedMode = HD_NONE;
                currentNodeInfo = "";
                Log.e("KCA", "Port Handler Called");
                if (jsonDataObj.has("api_data")) {
                    JsonObject reqPortApiData = jsonDataObj.getAsJsonObject("api_data");
                    int size = KcaApiData.getPortData(reqPortApiData);
                    if (reqPortApiData.has("api_combined_flag")) {
                        int combined_flag = reqPortApiData.get("api_combined_flag").getAsInt();
                        isCombined = (combined_flag > 0);
                        KcaBattle.isCombined = isCombined;
                        KcaBattle.cleanEscapeList();
                    }
                    if (reqPortApiData.has("api_basic")) {
                        processBasicInfo(reqPortApiData.getAsJsonObject("api_basic"));
                    }
                    //Log.e("KCA", "Total Ships: " + String.valueOf(size));
                    if (reqPortApiData.has("api_deck_port")) {
                        processExpeditionInfo();
                        updateFleetView();
                    }
                    if (reqPortApiData.has("api_ndock")) {
                        JsonArray nDockData = reqPortApiData.getAsJsonArray("api_ndock");
                        processDockingInfo(nDockData);
                    }
                }
                setFrontViewNotifier(FRONT_NONE, 0, null);
                updateFleetView();
                isInBattle = false;
            }
            if (url.startsWith(API_REQ_MAP_SELECT_EVENTMAP_RANK)) {
                String[] requestData = request.split("&");
                int mapno = 0;
                int rank = 0;
                for (int i = 0; i < requestData.length; i++) {
                    String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                    if (decodedData.startsWith("api_map_no")) {
                        mapno = Integer.valueOf(decodedData.replace("api_map_no=", ""));
                        break;
                    } else if (decodedData.startsWith("api_rank")) {
                        rank = Integer.valueOf(decodedData.replace("api_rank=", ""));
                        break;
                    }
                }
                KcaApiData.setEventMapDifficulty(mapno, rank);
            }
            if (url.startsWith(API_GET_MEMBER_MAPINFO) || url.startsWith(API_GET_MEMBER_MISSION)) {
                if (url.startsWith(API_GET_MEMBER_MAPINFO) && jsonDataObj.has("api_data")) {
                    JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                    JsonArray api_map_info = api_data.getAsJsonArray("api_map_info");
                    int eventMapCount = 0;
                    for (JsonElement map : api_map_info) {
                        JsonObject mapData = map.getAsJsonObject();
                        if (mapData.has("api_eventmap")) {
                            eventMapCount += 1;
                            JsonObject eventData = mapData.getAsJsonObject("api_eventmap");
                            if (eventData.has("api_selected_rank"))
                                KcaApiData.setEventMapDifficulty(eventMapCount, eventData.get("api_selected_rank").getAsInt());
                        }
                    }
                }
                // Notification Part
                String message = "";
                boolean isHeavyDamagedFlag = false;
                boolean isNotSuppliedFlag = false;
                JsonArray portdeckdata = dbHelper.getJsonArrayValue(DB_KEY_DECKPORT);
                if (isCurrentPortDeckDataReady()) {
                    for (int i = 0; i < portdeckdata.size(); i++) {
                        if (url.startsWith(API_GET_MEMBER_MISSION) && i == 0)
                            continue;
                        if (KcaDeckInfo.checkNotSuppliedExist(portdeckdata, i)) {
                            isNotSuppliedFlag = true;
                            message = message.concat(String.format(getStringWithLocale(R.string.not_supplied), i + 1)).concat("\n");
                        }
                    }
                    if (url.startsWith(API_GET_MEMBER_MAPINFO)) {
                        int firstHeavyDamaged = KcaDeckInfo.checkHeavyDamageExist(portdeckdata, 0);
                        int secondHeavyDamaged = 0;
                        if (portdeckdata.size() >= 2) {
                            secondHeavyDamaged = KcaDeckInfo.checkHeavyDamageExist(portdeckdata, 1);
                        }
                        int checkvalue = 0;
                        if (isCombined) {
                            checkvalue = Math.max(firstHeavyDamaged, secondHeavyDamaged);
                        } else {
                            checkvalue = firstHeavyDamaged;
                        }
                        switch(checkvalue) {
                            case HD_DAMECON:
                            case HD_DANGER:
                                isHeavyDamagedFlag = true;
                                if (checkvalue == HD_DANGER) {
                                    message = message.concat(getStringWithLocale(R.string.heavy_damaged)).concat("\n");
                                } else if (checkvalue == HD_DAMECON) {
                                    message = message.concat(getStringWithLocale(R.string.heavy_damaged_damecon)).concat("\n");
                                }
                                break;
                            default:
                                break;
                        }
                    }
                    if (message.length() > 0) {
                        boolean hcondition = (isHeavyDamagedFlag && isHDVibrateEnabled());
                        boolean ncondition = (isNotSuppliedFlag && isNSVibrateEnabled());
                        if (hcondition || ncondition) {
                            String soundKind = getStringPreferences(getApplicationContext(), PREF_KCA_NOTI_SOUND_KIND);
                            if (soundKind.equals(getString(R.string.sound_kind_value_normal)) || soundKind.equals(getString(R.string.sound_kind_value_mixed))) {
                                if (mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_NORMAL) {
                                    Uri notificationUri = Uri.parse(getStringPreferences(getApplicationContext(), PREF_KCA_NOTI_RINGTONE));
                                    Log.e("KCA", getStringPreferences(getApplicationContext(), PREF_KCA_NOTI_RINGTONE));
                                    KcaUtils.playNotificationSound(mediaPlayer, getApplicationContext(), notificationUri);
                                }
                            }
                            vibrator.vibrate(1000);
                        }
                        int toastColor;
                        if (hcondition)
                            toastColor = R.color.colorHeavyDmgStatePanel;
                        else
                            toastColor = R.color.colorWarningPanel;
                        customToast.showToast(message.trim(), Toast.LENGTH_LONG, ContextCompat.getColor(getApplicationContext(), toastColor));
                    }
                    setFrontViewNotifier(FRONT_NONE, 0, null);
                }
            }
            if (url.startsWith(API_GET_MEMBER_MAPINFO) || url.startsWith(API_GET_MEMBER_PRACTICE)) {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(getApplicationContext())) {
                // Can not draw overlays: pass
                } else {
                    Intent qintent = new Intent(this, KcaBattleViewService.class);
                    startService(qintent);
                }
            }
            if (API_BATTLE_REQS.contains(url) && isCurrentPortDeckDataReady()) {
                if (jsonDataObj.has("api_data")) {
                    JsonObject battleApiData = jsonDataObj.getAsJsonObject("api_data");
                    if (url.equals(API_REQ_MAP_START) || url.equals(API_REQ_PRACTICE_BATTLE)) {
                        JsonArray portdeckdata = dbHelper.getJsonArrayValue(DB_KEY_DECKPORT);
                        isInBattle = true;
                        int deck_id = 0;
                        String[] requestData = request.split("&");
                        for (int i = 0; i < requestData.length; i++) {
                            String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                            if (decodedData.startsWith("api_deck_id")) {
                                deck_id = Integer.valueOf(decodedData.replace("api_deck_id=", "")) - 1;
                                break;
                            }
                        }
                        JsonObject api_data = new JsonObject();
                        JsonArray api_deck_data = new JsonArray();
                        JsonArray api_ship_data = new JsonArray();
                        int checkvalue = 0;
                        if (isCombined) {
                            JsonObject first = portdeckdata.get(0).getAsJsonObject();
                            JsonObject second = portdeckdata.get(1).getAsJsonObject();
                            api_deck_data.add(first);
                            JsonArray firstShipInfo = first.getAsJsonArray("api_ship");
                            for (JsonElement e : firstShipInfo) {
                                int ship_id = e.getAsInt();
                                if (ship_id != -1)
                                    api_ship_data.add(KcaApiData.getUserShipDataById(ship_id, "all"));
                            }
                            api_deck_data.add(second);
                            JsonArray secondShipInfo = second.getAsJsonArray("api_ship");
                            for (JsonElement e : secondShipInfo) {
                                int ship_id = e.getAsInt();
                                if (ship_id != -1)
                                    api_ship_data.add(KcaApiData.getUserShipDataById(ship_id, "all"));
                            }
                            KcaBattle.dameconflag = KcaDeckInfo.getDameconStatus(api_deck_data, 0);
                            KcaBattle.dameconcbflag = KcaDeckInfo.getDameconStatus(api_deck_data, 1);
                            int firstHeavyDamaged = KcaDeckInfo.checkHeavyDamageExist(portdeckdata, 0);
                            int secondHeavyDamaged = 0;
                            if (portdeckdata.size() >= 2) {
                                secondHeavyDamaged = KcaDeckInfo.checkHeavyDamageExist(portdeckdata, 1);
                            }
                            checkvalue = Math.max(firstHeavyDamaged, secondHeavyDamaged);
                        } else {
                            JsonObject fleet = portdeckdata.get(deck_id).getAsJsonObject();
                            int fleetHeavyDamaged = KcaDeckInfo.checkHeavyDamageExist(portdeckdata, deck_id);
                            checkvalue = fleetHeavyDamaged;
                            api_deck_data.add(fleet);
                            JsonArray firstShipInfo = fleet.getAsJsonArray("api_ship");
                            for (JsonElement e : firstShipInfo) {
                                int ship_id = e.getAsInt();
                                if (ship_id != -1)
                                    api_ship_data.add(KcaApiData.getUserShipDataById(ship_id, "all"));
                            }
                            KcaBattle.dameconflag = KcaDeckInfo.getDameconStatus(api_deck_data, 0);
                        }
                        api_data.add("api_deck_data", api_deck_data);
                        api_data.add("api_ship_data", api_ship_data);
                        KcaBattle.setDeckPortData(api_data);
                        KcaBattle.setStartHeavyDamageExist(checkvalue);
                        if (getBooleanPreferences(getApplicationContext(), PREF_KCA_BATTLEVIEW_USE)) {
                            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(getApplicationContext())) {
                            // Can not draw overlays: pass
                            } else {
                                startService(new Intent(this, KcaViewButtonService.class).setAction(KcaViewButtonService.ACTIVATE_BATTLEVIEW_ACTION));
                                startService(new Intent(this, KcaBattleViewService.class));
                            }
                        }
                    }
                    KcaBattle.processData(dbHelper, url, battleApiData);
                } else if (url.equals(API_REQ_COMBINED_GOBACKPORT)) {
                    KcaBattle.processData(dbHelper, url, null);
                }
                updateFleetView();
            }
            if (url.startsWith(API_GET_MEMBER_SHIP_DECK) && isCurrentPortDeckDataReady()) {
                if (jsonDataObj.has("api_data")) {
                    JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                    JsonArray api_deck_data = (JsonArray) api_data.get("api_deck_data");
                    KcaApiData.updatePortDataOnBattle(api_data);
                    for (int i = 0; i < api_deck_data.size(); i++) {
                        if (i == 0) {
                            KcaBattle.dameconflag = KcaDeckInfo.getDameconStatus(api_deck_data, 0);
                        } else if (i == 1) {
                            KcaBattle.dameconcbflag = KcaDeckInfo.getDameconStatus(api_deck_data, 1);
                        }
                    }
                    KcaBattle.setDeckPortData(api_data);
                    updateFleetView();
                }
            }
            if (url.startsWith(API_REQ_MISSION_RETURN)) {
                //Log.e("KCA", "Expedition Handler Called");
                if (jsonDataObj.has("api_data")) {
                    JsonObject reqGetMemberDeckApiData = jsonDataObj.getAsJsonObject("api_data");
                    cancelExpeditionInfo(reqGetMemberDeckApiData);
                }
                return;
            }
            if (url.startsWith(API_REQ_MEMBER_GET_PRACTICE_ENEMYINFO)) {
                if (jsonDataObj.has("api_data")) {
                    JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                    KcaBattle.currentEnemyDeckName = api_data.get("api_deckname").getAsString();
                }
            }
            if (isCurrentPortDeckDataReady()) {
                if (url.startsWith(API_REQ_KOUSYOU_CREATETIEM)) {
                    String[] requestData = request.split("&");
                    int[] materials = { 0, 0, 0, 0 };
                    JsonArray portdeckdata = dbHelper.getJsonArrayValue(DB_KEY_DECKPORT);
                    int flagship = KcaDeckInfo.getKcShipList(portdeckdata, 0)[0];
                    for (int i = 0; i < requestData.length; i++) {
                        String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                        if (decodedData.startsWith("api_item1")) {
                            materials[0] = Integer.valueOf(decodedData.replace("api_item1=", ""));
                        }
                        if (decodedData.startsWith("api_item2")) {
                            materials[1] = Integer.valueOf(decodedData.replace("api_item2=", ""));
                        }
                        if (decodedData.startsWith("api_item3")) {
                            materials[2] = Integer.valueOf(decodedData.replace("api_item3=", ""));
                        }
                        if (decodedData.startsWith("api_item4")) {
                            materials[3] = Integer.valueOf(decodedData.replace("api_item4=", ""));
                        }
                    }
                    if (jsonDataObj.has("api_data")) {
                        JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                        int itemKcId = KcaApiData.updateSlotItemData(api_data);
                        if (isOpendbEnabled()) {
                            KcaOpendbAPI.sendEquipDevData(flagship, materials[0], materials[1], materials[2], materials[3], itemKcId);
                        }
                        questTracker.updateIdCountTracker("605");
                        questTracker.updateIdCountTracker("607");
                        updateQuestView();
                    }
                }
                if (url.startsWith(API_REQ_KOUSYOU_DESTROYITEM)) {
                    String[] requestData = request.split("&");
                    for (int i = 0; i < requestData.length; i++) {
                        String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                        if (decodedData.startsWith("api_slotitem_ids")) {
                            String itemlist = decodedData.replace("api_slotitem_ids=", "");
                            String[] itemlist_array = itemlist.split(",");
                            for (String item : itemlist_array) {
                                JsonObject status = getUserItemStatusById(Integer.parseInt(item), "alv", "type");
                                if (status.has("type")) {
                                    if (status.getAsJsonArray("type").get(2).getAsInt() == T2_MACHINE_GUN) {
                                        questTracker.updateIdCountTracker("638");
                                    }
                                }
                            }
                            KcaApiData.removeSlotItemData(itemlist);
                            break;
                        }
                    }
                    questTracker.updateIdCountTracker("613");
                    updateQuestView();
                }
                if (url.startsWith(API_REQ_KOUSYOU_CREATESHIP)) {
                    String[] requestData = request.split("&");
                    for (int i = 0; i < requestData.length; i++) {
                        String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                        if (decodedData.startsWith("api_kdock_id=")) {
                            checkKdockId = Integer.valueOf(decodedData.replace("api_kdock_id=", "")) - 1;
                            break;
                        }
                    }
                    questTracker.updateIdCountTracker("606");
                    questTracker.updateIdCountTracker("608");
                    updateQuestView();
                }
                if (url.startsWith(API_REQ_KOUSYOU_GETSHIP)) {
                    if (jsonDataObj.has("api_data")) {
                        JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                        KcaApiData.addUserShip(api_data);
                    }
                }
                if (url.startsWith(API_REQ_KAISOU_SLOTSET)) {
                    kaisouProcessFlag = true;
                }
                if (url.startsWith(API_REQ_KAISOU_SLOTSET_EX)) {
                    kaisouProcessFlag = true;
                }
                if (url.startsWith(API_REQ_KAISOU_UNSLOTSET_ALL)) {
                    kaisouProcessFlag = true;
                }
                if (url.startsWith(API_GET_MEMBER_KDOCK)) {
                    Log.e("KCA", String.valueOf(checkKdockId));
                    if (checkKdockId != -1 && jsonDataObj.has("api_data")) {
                        JsonArray api_data = jsonDataObj.getAsJsonArray("api_data");
                        JsonObject api_kdock = api_data.get(checkKdockId).getAsJsonObject();
                        JsonArray portdeckdata = dbHelper.getJsonArrayValue(DB_KEY_DECKPORT);
                        int flagship = KcaDeckInfo.getKcShipList(portdeckdata, 0)[0];
                        int[] materials = { 0, 0, 0, 0, 0 };
                        for (int i = 0; i < materials.length; i++) {
                            materials[i] = api_kdock.get(String.format("api_item%d", i + 1)).getAsInt();
                        }
                        int created_ship_id = api_kdock.get("api_created_ship_id").getAsInt();
                        if (isOpendbEnabled()) {
                            KcaOpendbAPI.sendShipDevData(flagship, materials[0], materials[1], materials[2], materials[3], materials[4], created_ship_id);
                        }
                        checkKdockId = -1;
                    }
                }
                if (url.startsWith(API_REQ_KOUSYOU_DESTROYSHIP)) {
                    String targetShip = "";
                    String[] requestData = request.split("&");
                    for (int i = 0; i < requestData.length; i++) {
                        String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                        if (decodedData.startsWith("api_ship_id")) {
                            targetShip = decodedData.replace("api_ship_id=", "");
                            KcaApiData.deleteUserShip(targetShip);
                            break;
                        }
                    }
                    JsonArray portdeckdata = dbHelper.getJsonArrayValue(DB_KEY_DECKPORT);
                    for (int i = 0; i < portdeckdata.size(); i++) {
                        JsonObject deckData = portdeckdata.get(i).getAsJsonObject();
                        JsonArray deckShipData = deckData.get("api_ship").getAsJsonArray();
                        for (int j = 0; j < deckShipData.size(); j++) {
                            if (targetShip.equals(String.valueOf(deckShipData.get(j).getAsInt()))) {
                                deckShipData.set(j, new JsonPrimitive(-1));
                                deckData.add("api_ship", deckShipData);
                                portdeckdata.set(i, deckData);
                                dbHelper.putValue(DB_KEY_DECKPORT, portdeckdata.toString());
                                break;
                            }
                        }
                    }
                    questTracker.updateIdCountTracker("609");
                    updateQuestView();
                    updateFleetView();
                }
                if (url.startsWith(API_REQ_HENSEI_CHANGE)) {
                    String[] requestData = request.split("&");
                    int deckIdx = -1;
                    int shipIdx = -1;
                    int shipId = -3;
                    for (int i = 0; i < requestData.length; i++) {
                        String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                        if (decodedData.startsWith("api_ship_idx=")) {
                            shipIdx = Integer.valueOf(decodedData.replace("api_ship_idx=", ""));
                        } else if (decodedData.startsWith("api_ship_id=")) {
                            shipId = Integer.valueOf(decodedData.replace("api_ship_id=", ""));
                        } else if (decodedData.startsWith("api_id=")) {
                            deckIdx = Integer.valueOf(decodedData.replace("api_id=", "")) - 1;
                        }
                    }
                    if (deckIdx != -1) {
                        JsonArray portdeckdata = dbHelper.getJsonArrayValue(DB_KEY_DECKPORT);
                        JsonObject targetDeckIdxData = portdeckdata.get(deckIdx).getAsJsonObject();
                        JsonArray targetDeckIdxShipIdata = targetDeckIdxData.get("api_ship").getAsJsonArray();
                        if (shipId == -2) {
                            for (int i = 1; i < 6; i++) {
                                targetDeckIdxShipIdata.set(i, new JsonPrimitive(-1));
                            }
                        } else if (shipId == -1) {
                            // remove ship
                            targetDeckIdxShipIdata.remove(shipIdx);
                            targetDeckIdxShipIdata.add(new JsonPrimitive(-1));
                        } else {
                            // add ship
                            int originalDeckIdx = -1;
                            int originalShipIdx = -1;
                            // check whether target ship is in deck
                            for (int i = 0; i < portdeckdata.size(); i++) {
                                JsonArray deckData = portdeckdata.get(i).getAsJsonObject().get("api_ship").getAsJsonArray();
                                for (int j = 0; j < deckData.size(); j++) {
                                    if (shipId == deckData.get(j).getAsInt()) {
                                        originalDeckIdx = i;
                                        originalShipIdx = j;
                                        break;
                                    }
                                }
                            }
                            if (originalDeckIdx != -1) {
                                // if in deck
                                JsonObject sourceDeckIdxData = portdeckdata.get(originalDeckIdx).getAsJsonObject();
                                JsonArray sourceDeckIdxShipIdata = sourceDeckIdxData.get("api_ship").getAsJsonArray();
                                JsonElement replacement = targetDeckIdxShipIdata.get(shipIdx);
                                if (replacement.getAsInt() != -1) {
                                    sourceDeckIdxShipIdata.set(originalShipIdx, replacement);
                                } else {
                                    sourceDeckIdxShipIdata.remove(originalShipIdx);
                                    sourceDeckIdxShipIdata.add(new JsonPrimitive(-1));
                                    sourceDeckIdxData.add("api_ship", sourceDeckIdxShipIdata);
                                    portdeckdata.set(originalDeckIdx, sourceDeckIdxData);
                                }
                            }
                            // replace
                            targetDeckIdxShipIdata.set(shipIdx, new JsonPrimitive(shipId));
                        }
                        targetDeckIdxData.add("api_ship", targetDeckIdxShipIdata);
                        portdeckdata.set(deckIdx, targetDeckIdxData);
                        dbHelper.putValue(DB_KEY_DECKPORT, portdeckdata.toString());
                    }
                    updateFleetView();
                }
                if (url.startsWith(API_REQ_HENSEI_PRESET) && isCurrentPortDeckDataReady()) {
                    String[] requestData = request.split("&");
                    int deckIdx = -1;
                    for (int i = 0; i < requestData.length; i++) {
                        String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                        if (decodedData.startsWith("api_deck_id=")) {
                            deckIdx = Integer.valueOf(decodedData.replace("api_deck_id=", "")) - 1;
                            break;
                        }
                    }
                    if (deckIdx != -1) {
                        if (jsonDataObj.has("api_data")) {
                            JsonArray portdeckdata = dbHelper.getJsonArrayValue(DB_KEY_DECKPORT);
                            JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                            portdeckdata.set(deckIdx, api_data);
                            dbHelper.putValue(DB_KEY_DECKPORT, portdeckdata.toString());
                        }
                    }
                    updateFleetView();
                }
                if (url.startsWith(API_REQ_HENSEI_COMBINED)) {
                    if (jsonDataObj.has("api_data")) {
                        JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                        int api_combined = api_data.get("api_combined").getAsInt();
                        isCombined = (api_combined > 0);
                        KcaBattle.isCombined = api_combined > 0;
                    }
                    Log.e("KCA", "Combined: " + String.valueOf(isCombined));
                    updateFleetView();
                }
                if (url.startsWith(API_GET_MEMBER_SHIP3)) {
                    String[] requestData = request.split("&");
                    int userShipId = -1;
                    for (int i = 0; i < requestData.length; i++) {
                        String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                        if (decodedData.startsWith("api_shipid=")) {
                            userShipId = Integer.valueOf(decodedData.replace("api_shipid=", ""));
                            break;
                        }
                    }
                    if (userShipId != -1) {
                        if (jsonDataObj.has("api_data")) {
                            JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                            dbHelper.putValue(DB_KEY_DECKPORT, api_data.get("api_deck_data").getAsJsonArray().toString());
                            dbHelper.test();
                            KcaApiData.updateUserShip(api_data.get("api_ship_data").getAsJsonArray().get(0).getAsJsonObject());
                        }
                    }
                    if (kaisouProcessFlag) {
                        toastInfo();
                        kaisouProcessFlag = false;
                        updateFleetView();
                    }
                }
                if (url.startsWith(API_REQ_KAISOU_SLOT_EXCHANGE)) {
                    String[] requestData = request.split("&");
                    int userShipId = -1;
                    for (int i = 0; i < requestData.length; i++) {
                        String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                        if (decodedData.startsWith("api_id=")) {
                            userShipId = Integer.valueOf(decodedData.replace("api_id=", ""));
                            break;
                        }
                    }
                    if (userShipId != -1 && jsonDataObj.has("api_data")) {
                        JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                        KcaApiData.updateUserShipSlot(userShipId, api_data);
                    }
                    updateFleetView();
                    toastInfo();
                }
                if (url.startsWith(API_REQ_KAISOU_SLOT_DEPRIVE)) {
                    if (jsonDataObj.has("api_data")) {
                        JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                        JsonObject api_ship_data = api_data.get("api_ship_data").getAsJsonObject();
                        KcaApiData.updateUserShip(api_ship_data.get("api_set_ship").getAsJsonObject());
                        KcaApiData.updateUserShip(api_ship_data.get("api_unset_ship").getAsJsonObject());
                    }
                    updateFleetView();
                    toastInfo();
                }
                if (url.startsWith(API_REQ_KAISOU_POWERUP)) {
                    String[] requestData = request.split("&");
                    int targetId = -1;
                    String itemIds = "";
                    for (int i = 0; i < requestData.length; i++) {
                        String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                        if (decodedData.startsWith("api_id=")) {
                            targetId = Integer.valueOf(decodedData.replace("api_id=", ""));
                        }
                        if (decodedData.startsWith("api_id_items=")) {
                            itemIds = decodedData.replace("api_id_items=", "");
                        }
                    }
                    if (jsonDataObj.has("api_data")) {
                        JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                        dbHelper.putValue(DB_KEY_DECKPORT, api_data.getAsJsonArray("api_deck").toString());
                        dbHelper.test();
                        updateUserShip(api_data.getAsJsonObject("api_ship"));
                        KcaApiData.deleteUserShip(itemIds);
                        if (api_data.has("api_powerup_flag") && api_data.get("api_powerup_flag").getAsInt() == 1) {
                            questTracker.updateIdCountTracker("702");
                            questTracker.updateIdCountTracker("703");
                            updateQuestView();
                        }
                    }
                    updateFleetView();
                }
                if (url.equals(API_REQ_KOUSYOU_REMOEL_SLOT)) {
                    JsonArray portdeckdata = dbHelper.getJsonArrayValue(DB_KEY_DECKPORT);
                    int[] kcShipData = KcaDeckInfo.getKcShipList(portdeckdata, 0);
                    int flagship = kcShipData[0];
                    int assistant = kcShipData[1];
                    String[] requestData = request.split("&");
                    int certainFlag = 0;
                    int itemId = 0;
                    for (int i = 0; i < requestData.length; i++) {
                        String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                        if (decodedData.startsWith("api_certain_flag=")) {
                            certainFlag = Integer.valueOf(decodedData.replace("api_certain_flag=", ""));
                        }
                        if (decodedData.startsWith("api_slot_id=")) {
                            itemId = Integer.valueOf(decodedData.replace("api_slot_id=", ""));
                        }
                    }
                    JsonObject itemData = KcaApiData.getUserItemStatusById(itemId, "slotitem_id,level", "");
                    int itemKcId = itemData.get("slotitem_id").getAsInt();
                    int level = itemData.get("level").getAsInt();
                    int api_remodel_flag = 0;
                    if (jsonDataObj.has("api_data")) {
                        JsonObject api_data = jsonDataObj.getAsJsonObject("api_data");
                        api_remodel_flag = api_data.get("api_remodel_flag").getAsInt();
                        if (certainFlag == 1 || api_remodel_flag == 1) {
                            JsonObject api_after_slot = api_data.get("api_after_slot").getAsJsonObject();
                            JsonArray api_slot_item = new JsonArray();
                            api_slot_item.add(api_after_slot);
                            for (int i = 0; i < api_slot_item.size(); i++) {
                                JsonObject item = api_slot_item.get(i).getAsJsonObject();
                                dbHelper.putItemValue(item.get("api_id").getAsInt(), item.toString());
                            }
                        }
                        JsonElement use_slot_id = api_data.get("api_use_slot_id");
                        List<String> use_slot_id_list = new ArrayList<String>();
                        if (use_slot_id != null) {
                            for (JsonElement id : use_slot_id.getAsJsonArray()) {
                                use_slot_id_list.add(id.getAsString());
                            }
                            KcaApiData.removeSlotItemData(joinStr(use_slot_id_list, ","));
                        }
                    }
                    if (certainFlag != 1 && isOpendbEnabled()) {
                        KcaOpendbAPI.sendRemodelData(flagship, assistant, itemKcId, level, api_remodel_flag);
                    }
                    questTracker.updateIdCountTracker("619");
                    updateQuestView();
                }
            }
        }
        if (url.equals(KCA_API_VPN_DATA_ERROR)) {
            // VPN Data Dump Send
            String api_url = jsonDataObj.get("uri").getAsString();
            String api_request = jsonDataObj.get("request").getAsString();
            String api_response = jsonDataObj.get("response").getAsString();
            String api_error = jsonDataObj.get("error").getAsString();
            List<String> filtered_resquest_list = new ArrayList<String>();
            try {
                String[] requestData = api_request.split("&");
                for (int i = 0; i < requestData.length; i++) {
                    String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                    if (!decodedData.startsWith("api_token")) {
                        filtered_resquest_list.add(requestData[i]);
                    }
                }
                api_request = joinStr(filtered_resquest_list, "&");
            } catch (UnsupportedEncodingException e1) {
                e1.printStackTrace();
            }
            customToast.showToast(getStringWithLocale(R.string.service_failed_msg), Toast.LENGTH_SHORT, ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryDark));
            dbHelper.recordErrorLog(ERROR_TYPE_VPN, api_url, api_request, api_response, api_error);
        }
    } catch (JsonSyntaxException e) {
        //Log.e("KCA", "ParseError");
        //Log.e("KCA", data);
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
        String api_request = "";
        List<String> filtered_resquest_list = new ArrayList<String>();
        try {
            String[] requestData = request.split("&");
            for (int i = 0; i < requestData.length; i++) {
                String decodedData = URLDecoder.decode(requestData[i], "utf-8");
                if (!decodedData.startsWith("api_token")) {
                    filtered_resquest_list.add(requestData[i]);
                }
            }
            api_request = joinStr(filtered_resquest_list, "&");
        } catch (UnsupportedEncodingException e1) {
            e1.printStackTrace();
        }
        String process_data = raw.toString();
        if (url.contains(API_PORT)) {
            process_data = "PORT DATA OMITTED";
        }
        dbHelper.recordErrorLog(ERROR_TYPE_SERVICE, url, api_request, process_data, getStringFromException(e));
    }
}
Also used : JsonPrimitive(com.google.gson.JsonPrimitive) ArrayList(java.util.ArrayList) Reader(java.io.Reader) InputStreamReader(java.io.InputStreamReader) JsonObject(com.google.gson.JsonObject) Uri(android.net.Uri) List(java.util.List) ArrayList(java.util.ArrayList) JsonParser(com.google.gson.JsonParser) InputStreamReader(java.io.InputStreamReader) SharedPreferences(android.content.SharedPreferences) UnsupportedEncodingException(java.io.UnsupportedEncodingException) PendingIntent(android.app.PendingIntent) Intent(android.content.Intent) KcaUtils.getStringFromException(com.antest1.kcanotify.KcaUtils.getStringFromException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) JsonSyntaxException(com.google.gson.JsonSyntaxException) JsonArray(com.google.gson.JsonArray) JsonSyntaxException(com.google.gson.JsonSyntaxException) ByteArrayInputStream(java.io.ByteArrayInputStream) JsonElement(com.google.gson.JsonElement)

Aggregations

JsonPrimitive (com.google.gson.JsonPrimitive)230 JsonObject (com.google.gson.JsonObject)137 JsonArray (com.google.gson.JsonArray)118 JsonElement (com.google.gson.JsonElement)106 Test (org.testng.annotations.Test)56 Test (org.junit.Test)12 Map (java.util.Map)10 Matchers.anyString (org.mockito.Matchers.anyString)8 JsonProcessorInjectionMap (com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap)7 Gson (com.google.gson.Gson)6 HashMap (java.util.HashMap)5 GsonBuilder (com.google.gson.GsonBuilder)4 JsonParser (com.google.gson.JsonParser)4 ArrayList (java.util.ArrayList)4 Date (java.util.Date)4 Type (java.lang.reflect.Type)3 HashSet (java.util.HashSet)3 Matcher (java.util.regex.Matcher)3 LobWrapper (angularBeans.io.LobWrapper)2 DatasetCreationSpec (co.cask.cdap.internal.dataset.DatasetCreationSpec)2