/*
 *     Created by Angel Leon (@gubatron), Alden Torres (aldenml)
 *     Copyright (c) 2011-2026, FrostWire(R). All rights reserved.
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

package org.team_hermes.wireshare.android.core;

import org.team_hermes.wireshare.android.BuildConfig;

/**
 * Static class containing all constants in one place.
 *
 * @author Angel Leon (@gubatron)
 * @author Alden Torres (@aldenml)
 * @author Jose Molina (@votaguz)
 */
public final class Constants {

    /**
     * isDevelopment
     */
    public static final boolean IS_BASIC_AND_DEBUG = BuildConfig.FLAVOR.equals("basic") && BuildConfig.DEBUG;
    public static final boolean IS_GOOGLE_PLAY_DISTRIBUTION = BuildConfig.FLAVOR.equals("basic");

    private static final String BUILD_PREFIX = !IS_GOOGLE_PLAY_DISTRIBUTION ? "1000" : "";

    /**
     * should manually match the manifest, here for convenience so we can ask for it from static contexts without
     * needing to pass the Android app context to obtain the PackageManager instance.
     */
    public static final String FROSTWIRE_BUILD = BUILD_PREFIX + (BuildConfig.VERSION_CODE % 1000);

    public static final String APP_PACKAGE_NAME = "org.team_hermes.wireshare.android";

    public static final String FROSTWIRE_VERSION_STRING = BuildConfig.VERSION_NAME;

    public static final int JOB_ID_ENGINE_SERVICE = 10001;
    public static final int JOB_ID_MUSIC_PLAYBACK_SERVICE = 20001;

    // preference keys
    public static final String PREF_KEY_CORE_UUID = "frostwire.prefs.core.uuid";
    public static final String PREF_KEY_CORE_LAST_SEEN_VERSION_BUILD = "frostwire.prefs.core.last_seen_version_build";
    public static final String PREF_KEY_MAIN_APPLICATION_ON_CREATE_TIMESTAMP = "frostwire.prefs.core.main_application_on_create_timestamp";

    public static final String PREF_KEY_NETWORK_ENABLE_DHT = "frostwire.prefs.network.enable_dht";

    public static final String PREF_KEY_NETWORK_USE_WIFI_ONLY = "frostwire.prefs.network.use_wifi_only";
    public static final String PREF_KEY_NETWORK_BITTORRENT_ON_VPN_ONLY = "frostwire.prefs.network.bittorrent_on_vpn_only";

    // I2P Configuration
    public static final String PREF_KEY_NETWORK_I2P_ENABLED = "frostwire.prefs.network.i2p_enabled";
    public static final String PREF_KEY_NETWORK_I2P_HOSTNAME = "frostwire.prefs.network.i2p_hostname";
    public static final String PREF_KEY_NETWORK_I2P_PORT = "frostwire.prefs.network.i2p_port";
    public static final String PREF_KEY_NETWORK_I2P_ALLOW_MIXED = "frostwire.prefs.network.i2p_allow_mixed";
    public static final String PREF_KEY_NETWORK_I2P_INBOUND_QUANTITY = "frostwire.prefs.network.i2p_inbound_quantity";
    public static final String PREF_KEY_NETWORK_I2P_OUTBOUND_QUANTITY = "frostwire.prefs.network.i2p_outbound_quantity";
    public static final String PREF_KEY_NETWORK_I2P_INBOUND_LENGTH = "frostwire.prefs.network.i2p_inbound_length";
    public static final String PREF_KEY_NETWORK_I2P_OUTBOUND_LENGTH = "frostwire.prefs.network.i2p_outbound_length";

    public static final String PREF_KEY_SEARCH_COUNT_DOWNLOAD_FOR_TORRENT_DEEP_SCAN = "frostwire.prefs.search.count_download_for_torrent_deep_scan";
    public static final String PREF_KEY_SEARCH_COUNT_ROUNDS_FOR_TORRENT_DEEP_SCAN = "frostwire.prefs.search.count_rounds_for_torrent_deep_scan";
    public static final String PREF_KEY_SEARCH_INTERVAL_MS_FOR_TORRENT_DEEP_SCAN = "frostwire.prefs.search.interval_ms_for_torrent_deep_scan";
    public static final String PREF_KEY_SEARCH_MIN_SEEDS_FOR_TORRENT_DEEP_SCAN = "frostwire.prefs.search.min_seeds_for_torrent_deep_scan";
    public static final String PREF_KEY_SEARCH_MIN_SEEDS_FOR_TORRENT_RESULT = "frostwire.prefs.search.min_seeds_for_torrent_result";
    public static final String PREF_KEY_SEARCH_MAX_TORRENT_FILES_TO_INDEX = "frostwire.prefs.search.max_torrent_files_to_index";
    public static final String PREF_KEY_SEARCH_FULLTEXT_SEARCH_RESULTS_LIMIT = "frostwire.prefs.search.fulltext_search_results_limit";

    public static final String PREF_KEY_SEARCH_USE_ZOOQLE = "frostwire.prefs.search.use_zooqle";
    public static final String PREF_KEY_SEARCH_USE_SOUNDCLOUD = "frostwire.prefs.search.use_soundcloud";
    public static final String PREF_KEY_SEARCH_USE_ARCHIVEORG = "frostwire.prefs.search.use_archiveorg";
    public static final String PREF_KEY_SEARCH_USE_FROSTCLICK = "frostwire.prefs.search.use_frostclick";
    public static final String PREF_KEY_SEARCH_USE_NYAA = "frostwire.prefs.search.use_nyaa";
    public static final String PREF_KEY_SEARCH_USE_TPB = "frostwire.prefs.search.use_tpb";
    public static final String PREF_KEY_SEARCH_USE_ONE337X = "frostwire.prefs.search.use_one337x";
    public static final String PREF_KEY_SEARCH_USE_TORRENTZ2 = "frostwire.prefs.search.use_torrentz2";
    public static final String PREF_KEY_SEARCH_USE_IDOPE = "frostwire.prefs.search.use_idope";
    public static final String PREF_KEY_SEARCH_USE_MAGNETDL = "frostwire.prefs.search.use_magnetdl";
    public static final String PREF_KEY_SEARCH_USE_TELLURIDE_COURIER = "frostwire.prefs.search.use_telluride_courier";
    public static final String PREF_KEY_SEARCH_USE_YT = "frostwire.prefs.search.use_yt";
    public static final String PREF_KEY_SEARCH_USE_TORRENTSCSV = "frostwire.prefs.search.use_torrentscsv";
    public static final String PREF_KEY_SEARCH_USE_KNABEN = "frostwire.prefs.search.use_knaben";

    public static final String PREF_KEY_GUI_VIBRATE_ON_FINISHED_DOWNLOAD = "frostwire.prefs.gui.vibrate_on_finished_download";
    public static final String PREF_KEY_GUI_LAST_MEDIA_TYPE_FILTER = "frostwire.prefs.gui.last_media_type_filter";
    public static final String PREF_KEY_GUI_TOS_ACCEPTED = "frostwire.prefs.gui.tos_accepted";
    public static final String PREF_KEY_GUI_FINISHED_DOWNLOADS_BETWEEN_RATINGS_REMINDER = "frostwire.prefs.gui.finished_downloads_between_ratings_reminder";
    public static final String PREF_KEY_GUI_INITIAL_SETTINGS_COMPLETE = "frostwire.prefs.gui.initial_settings_complete";
    public static final String PREF_KEY_GUI_ENABLE_PERMANENT_STATUS_NOTIFICATION = "frostwire.prefs.gui.enable_permanent_status_notification";
    public static final String PREF_KEY_GUI_SEARCH_KEYWORDFILTERDRAWER_TIP_TOUCHTAGS_DISMISSED = "frostwire.prefs.gui.search.keywordfilterdrawer.tip_touchtags_dismissed";
    public static final String PREF_KEY_GUI_SEARCH_FILTER_DRAWER_BUTTON_CLICKED = "frostwire.prefs.gui.search.search.filter_drawer_button_clicked";
    public static final String PREF_KEY_GUI_SHOW_TRANSFERS_ON_DOWNLOAD_START = "frostwire.prefs.gui.show_transfers_on_download_start";
    public static final String PREF_KEY_GUI_SHOW_NEW_TRANSFER_DIALOG = "frostwire.prefs.gui.show_new_transfer_dialog";
    public static final String PREF_KEY_GUI_SUPPORT_VPN_THRESHOLD = "frostwire.prefs.gui.support_vpn_threshold";
    public static final String PREF_KEY_GUI_INSTALLATION_TIMESTAMP = "frostwire.prefs.gui.installation_timestamp";

    public static final String PREF_KEY_GUI_PLAYER_REPEAT_MODE = "org.team_hermes.wireshare.android.player.REPEAT_MODE";
    public static final String PREF_KEY_GUI_PLAYER_SHUFFLE_ENABLED = "org.team_hermes.wireshare.android.player.SHUFFLE_ENABLED";
    public static final String PREF_KEY_GUI_DISTRACTION_FREE_SEARCH = "frostwire.prefs.gui.distraction_free_search";

    public static final String PREF_KEY_GUI_THEME_MODE = "frostwire.prefs.gui.theme_mode";

    public static final String PREF_KEY_TORRENT_MAX_DOWNLOAD_SPEED = "frostwire.prefs.torrent.max_download_speed";
    public static final String PREF_KEY_TORRENT_MAX_UPLOAD_SPEED = "frostwire.prefs.torrent.max_upload_speed";
    public static final String PREF_KEY_TORRENT_MAX_DOWNLOADS = "frostwire.prefs.torrent.max_downloads";
    public static final String PREF_KEY_TORRENT_MAX_UPLOADS = "frostwire.prefs.torrent.max_uploads";
    public static final String PREF_KEY_TORRENT_MAX_TOTAL_CONNECTIONS = "frostwire.prefs.torrent.max_total_connections";
    public static final String PREF_KEY_TORRENT_MAX_PEERS = "frostwire.prefs.torrent.max_peers";
    public static final String PREF_KEY_TORRENT_SEED_FINISHED_TORRENTS = "frostwire.prefs.torrent.seed_finished_torrents";
    public static final String PREF_KEY_TORRENT_SEED_FINISHED_TORRENTS_WIFI_ONLY = "frostwire.prefs.torrent.seed_finished_torrents_wifi_only";
    public static final String PREF_KEY_TORRENT_DELETE_STARTED_TORRENT_FILES = "frostwire.prefs.torrent.delete_started_torrent_files";
    public static final String PREF_KEY_TORRENT_TRANSFER_DETAIL_LAST_SELECTED_TAB_INDEX = "frostwire.prefs.torrent.transfer_detail_last_selected_tab_index";
    public static final String PREF_KEY_TORRENT_SEQUENTIAL_TRANSFERS_ENABLED = "frostwire.prefs.torrent.sequential_transfers_enabled";

    // Incoming connection port range settings
    public static final String PREF_KEY_TORRENT_INCOMING_PORT_START = "frostwire.prefs.torrent.incoming_port_start";
    public static final String PREF_KEY_TORRENT_INCOMING_PORT_END = "frostwire.prefs.torrent.incoming_port_end";

    public static final String PREF_KEY_STORAGE_PATH = "frostwire.prefs.storage.path";

    public static final String ACTION_REQUEST_SHUTDOWN = "org.team_hermes.wireshare.android.ACTION_REQUEST_SHUTDOWN";
    public static final String ACTION_SHOW_TRANSFERS = "org.team_hermes.wireshare.android.ACTION_SHOW_TRANSFERS";
    public static final String ACTION_SHOW_VPN_STATUS_PROTECTED = "org.team_hermes.wireshare.android.ACTION_SHOW_VPN_STATUS_PROTECTED";
    public static final String ACTION_SHOW_VPN_STATUS_UNPROTECTED = "org.team_hermes.wireshare.android.ACTION_SHOW_VPN_STATUS_UNPROTECTED";
    public static final String ACTION_START_TRANSFER_FROM_PREVIEW = "org.team_hermes.wireshare.android.ACTION_START_TRANSFER_FROM_PREVIEW";
    public static final String ACTION_MEDIA_PLAYER_PLAY = "org.team_hermes.wireshare.android.ACTION_MEDIA_PLAYER_PLAY";
    public static final String ACTION_MEDIA_PLAYER_STOPPED = "org.team_hermes.wireshare.android.ACTION_MEDIA_PLAYER_STOPPED";
    public static final String ACTION_MEDIA_PLAYER_PAUSED = "org.team_hermes.wireshare.android.ACTION_MEDIA_PLAYER_PAUSED";
    public static final String ACTION_REFRESH_FINGER = "org.team_hermes.wireshare.android.ACTION_REFRESH_FINGER";
    public static final String ACTION_NOTIFY_SDCARD_MOUNTED = "org.team_hermes.wireshare.android.ACTION_NOTIFY_SDCARD_MOUNTED";

    public static final String ACTION_NOTIFY_UPDATE_AVAILABLE = "org.team_hermes.wireshare.android.NOTIFY_UPDATE_AVAILABLE";
    public static final String ACTION_NOTIFY_DATA_INTERNET_CONNECTION = "org.team_hermes.wireshare.android.NOTIFY_CHECK_INTERNET_CONNECTION";

    public static final String EXTRA_DOWNLOAD_COMPLETE_NOTIFICATION = "org.team_hermes.wireshare.android.EXTRA_DOWNLOAD_COMPLETE_NOTIFICATION";
    public static final String EXTRA_DOWNLOAD_COMPLETE_PATH = "org.team_hermes.wireshare.android.EXTRA_DOWNLOAD_COMPLETE_PATH";
    public static final String EXTRA_REFRESH_FILE_TYPE = "org.team_hermes.wireshare.android.EXTRA_REFRESH_FILE_TYPE";
    public static final String EXTRA_FINISH_MAIN_ACTIVITY = "org.team_hermes.wireshare.android.EXTRA_FINISH_MAIN_ACTIVITY";

    public static final String MY_FILES_FRAGMENT_LISTVIEW_FIRST_VISIBLE_POSITION = "org.team_hermes.wireshare.android.BROWSE_PEER_FRAGMENT_LISTVIEW_FIRST_VISIBLE_POSITION.";

    // generic file types
    public static final byte FILE_TYPE_AUDIO = 0x00;
    public static final byte FILE_TYPE_PICTURES = 0x01;
    public static final byte FILE_TYPE_VIDEOS = 0x02;
    public static final byte FILE_TYPE_DOCUMENTS = 0x03;
    public static final byte FILE_TYPE_APPLICATIONS = 0x04;
    public static final byte FILE_TYPE_RINGTONES = 0x05;
    public static final byte FILE_TYPE_TORRENTS = 0x06;
    public static final byte FILE_TYPE_FILES = 0x07;
    public static final byte FILE_TYPE_UNKNOWN = 0x08;

    public static final String MIME_TYPE_ANDROID_PACKAGE_ARCHIVE = "application/vnd.android.package-archive";
    public static final String MIME_TYPE_BITTORRENT = "application/x-bittorrent";

    /**
     * URL where WireShare checks for software updates
     */
    public static final String WIRESHARE_HOME_URL = "https://example.invalid/wireshare";
    public static final String SERVER_UPDATE_URL = "";
    public static final String FROSTWIRE_MORE_RESULTS = WIRESHARE_HOME_URL;
    public static final String SERVER_PROMOTIONS_URL = "";
    public static final String SUPPORT_URL = "https://www.reddit.com/r/WireShare/";
    public static final String TERMS_OF_USE_URL = WIRESHARE_HOME_URL;
    public static final String ALL_FEATURED_DOWNLOADS_URL = WIRESHARE_HOME_URL;
    public static final String FROSTWIRE_PREVIEW_DOT_COM_URL = WIRESHARE_HOME_URL;
    public static final String FROSTWIRE_ANDROID_DOWNLOAD_PAGE_URL = WIRESHARE_HOME_URL;
    public static final String FROSTWIRE_ANDROID_GOOGLE_PLAY_URL = "https://play.google.com/store/apps/details?id=org.team_hermes.wireshare.android";

    public static final String USER_AGENT = "WireShare/android-" + (Constants.IS_GOOGLE_PLAY_DISTRIBUTION ? "basic" : "plus") + "/" + Constants.FROSTWIRE_VERSION_STRING + "/" + Constants.FROSTWIRE_BUILD;

    /**
     * Social Media official URLS
     */
    public static final String SOCIAL_URL_FACEBOOK_PAGE = WIRESHARE_HOME_URL;
    public static final String SOCIAL_URL_TWITTER_PAGE = WIRESHARE_HOME_URL;
    public static final String SOCIAL_URL_REDDIT_PAGE = SUPPORT_URL;
    public static final String SOCIAL_URL_GITHUB_PAGE = WIRESHARE_HOME_URL;
    public static final String SOCIAL_URL_SLACK_PAGE = WIRESHARE_HOME_URL;

    public static final String FROSTWIRE_BLOG_URL = WIRESHARE_HOME_URL;

    public static final String FROSTWIRE_GIVE_URL = WIRESHARE_HOME_URL;
    public static final String STICKERS_SHOP_URL = WIRESHARE_HOME_URL;
    public static final String CONTACT_US_URL = WIRESHARE_HOME_URL;
    public static final String TRANSLATE_HELP_URL = WIRESHARE_HOME_URL;
    public static final String CHANGELOG_URL = WIRESHARE_HOME_URL;

    public static final String FROSTWIRE_VPN_URL = WIRESHARE_HOME_URL;

    public static final String PIA_VPN_URL = WIRESHARE_HOME_URL;
    public static final String EXPRESSVPN_URL = WIRESHARE_HOME_URL;
    public static final String NORDVPN_URL = WIRESHARE_HOME_URL;

    public static final int NOTIFICATION_FROSTWIRE_STATUS = 112000;
    public static final int NOTIFICATION_DOWNLOAD_TRANSFER_FINISHED = 112001;
    public static final int NOTIFICATION_FROSTWIRE_PLAYER_STATUS = 112002;

    public static final String FROSTWIRE_NOTIFICATION_CHANNEL_ID = "wireshare";
    public static final String FROSTWIRE_ANDROID_FAQ_HOW_TO_ADD_SONGS_TO_PLAYLIST_URL = WIRESHARE_HOME_URL;

    private Constants() {
    }
}
