From b1b9fd6026735312b69b50266fe0e9d9d8fa7d67 Mon Sep 17 00:00:00 2001 From: Tlaster Date: Tue, 14 Apr 2020 14:31:07 +0800 Subject: [PATCH] Update buildin api key --- .../main/java/org/mariotaku/twidere/TwidereConstants.java | 6 +++--- twidere/src/main/assets/data/default_api_configs.json | 6 +++--- .../org/mariotaku/twidere/util/MicroBlogAPIFactory.java | 2 +- .../kotlin/org/mariotaku/twidere/activity/SignInActivity.kt | 1 - 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/TwidereConstants.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/TwidereConstants.java index 13ed6d0a3..5ac4f53f7 100644 --- a/twidere.component.common/src/main/java/org/mariotaku/twidere/TwidereConstants.java +++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/TwidereConstants.java @@ -64,10 +64,10 @@ public interface TwidereConstants extends SharedPreferenceConstants, IntentConst String ETAG_MASTODON_APPS_PREFERENCES_NAME = "mastodon_apps"; String ACCOUNT_PREFERENCES_NAME_PREFIX = "account_preferences_"; - String TWITTER_CONSUMER_KEY = "0WEJk1x6AlgtjGRhyABXw"; - String TWITTER_CONSUMER_SECRET = "gWXNqEFhO3fMkAqoIKpTdjK0MOJs68xnOky0FRdDTP8"; + String TWITTER_CONSUMER_KEY = "wmtrtTaVOjUnH5pWQp4LDI5Qs"; + String TWITTER_CONSUMER_SECRET = "E9Q9u2yK0COJae2tLcNEdY75OPA3bxqJiGZQztraHaQUtoI2cu"; - String DEFAULT_TWITTER_API_URL_FORMAT = "https://[DOMAIN.]twitter.com/"; + String DEFAULT_TWITTER_API_URL_FORMAT = "https://[DOMAIN].twitter.com/"; String SCHEME_HTTP = "http"; String SCHEME_HTTPS = "https"; diff --git a/twidere/src/main/assets/data/default_api_configs.json b/twidere/src/main/assets/data/default_api_configs.json index 88ddaac18..8416dafe1 100644 --- a/twidere/src/main/assets/data/default_api_configs.json +++ b/twidere/src/main/assets/data/default_api_configs.json @@ -3,12 +3,12 @@ "name": "Twidere", "type": "twitter", "localized_name": "@string/provider_default", - "api_url_format": "https://[DOMAIN.]twitter.com/", + "api_url_format": "https://[DOMAIN].twitter.com/", "auth_type": "oauth", "same_oauth_url": true, "no_version_suffix": false, - "consumer_key": "i5XtSVfoWjLjKlnrvhiLPMZC0", - "consumer_secret": "sQncmZ2atQR6tKbqnnAtqjrECqN8k6FD4p4OoNS0XTDkUz3HGH", + "consumer_key": "wmtrtTaVOjUnH5pWQp4LDI5Qs", + "consumer_secret": "E9Q9u2yK0COJae2tLcNEdY75OPA3bxqJiGZQztraHaQUtoI2cu", "sign_up_url": "https://twitter.com/signup" }, { diff --git a/twidere/src/main/java/org/mariotaku/twidere/util/MicroBlogAPIFactory.java b/twidere/src/main/java/org/mariotaku/twidere/util/MicroBlogAPIFactory.java index 61ed2b846..a85f8a342 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/util/MicroBlogAPIFactory.java +++ b/twidere/src/main/java/org/mariotaku/twidere/util/MicroBlogAPIFactory.java @@ -125,7 +125,7 @@ public class MicroBlogAPIFactory implements TwidereConstants { // Not an url if (idxOfSlash < 0) return format; final int startOfHost = idxOfSlash + 3; - if (startOfHost < 0) return getApiBaseUrl("https://[DOMAIN.]twitter.com/", domain); + if (startOfHost < 0) return getApiBaseUrl(DEFAULT_TWITTER_API_URL_FORMAT, domain); final int endOfHost = format.indexOf('/', startOfHost); final String host = endOfHost != -1 ? format.substring(startOfHost, endOfHost) : format.substring(startOfHost); final StringBuilder sb = new StringBuilder(); diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/activity/SignInActivity.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/activity/SignInActivity.kt index 04efc0f8f..406761525 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/activity/SignInActivity.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/activity/SignInActivity.kt @@ -1188,7 +1188,6 @@ class SignInActivity : BaseActivity(), OnClickListener, TextWatcher, private val FRAGMENT_TAG_SIGN_IN_PROGRESS = "sign_in_progress" private val EXTRA_API_LAST_CHANGE = "api_last_change" - private val DEFAULT_TWITTER_API_URL_FORMAT = "https://[DOMAIN.]twitter.com/" @Throws(IOException::class) internal fun detectAccountType(twitter: MicroBlog, user: User, type: String?): Pair {