diff options
author | Allan Wang <me@allanwang.ca> | 2019-04-13 19:52:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-13 19:52:24 -0400 |
commit | e8c52e6ab127dae71d51b7b54c98bfd724568de3 (patch) | |
tree | 44b5a182e95afa8400a365d0bd35071ea22cc4cf /app/src/main/kotlin/com/pitchedapps/frost/facebook | |
parent | bf84c42b083153701c4f9d4c96f0a3399e01c37f (diff) | |
download | frost-e8c52e6ab127dae71d51b7b54c98bfd724568de3.tar.gz frost-e8c52e6ab127dae71d51b7b54c98bfd724568de3.tar.bz2 frost-e8c52e6ab127dae71d51b7b54c98bfd724568de3.zip |
Update user agent (#1400)
* Rename user agent and update chrome for desktop, resolves #1387
* Rename more basic to desktop
* Apply spotless
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt | 8 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt index 8bca6b67..f6316470 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt @@ -29,11 +29,11 @@ const val FB_LOGIN_URL = "${FB_URL_BASE}login" const val FB_HOME_URL = "${FB_URL_BASE}home.php" // Default user agent -const val USER_AGENT_FULL = +const val USER_AGENT_MOBILE = "Mozilla/5.0 (Linux; Android 8.0.0; ONEPLUS A3000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36" -// Basic user agent; non mobile version -const val USER_AGENT_BASIC = - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36" +// Desktop agent, for pages like messages +const val USER_AGENT_DESKTOP = + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Safari/537.36" /** * Animation transition delay, just to ensure that the styles diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt index b49fd970..8a89b973 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt @@ -22,7 +22,7 @@ import com.pitchedapps.frost.facebook.FB_JSON_URL_MATCHER import com.pitchedapps.frost.facebook.FB_REV_MATCHER import com.pitchedapps.frost.facebook.FB_URL_BASE import com.pitchedapps.frost.facebook.FB_USER_MATCHER -import com.pitchedapps.frost.facebook.USER_AGENT_BASIC +import com.pitchedapps.frost.facebook.USER_AGENT_DESKTOP import com.pitchedapps.frost.facebook.get import com.pitchedapps.frost.kotlin.Flyweight import com.pitchedapps.frost.utils.L @@ -97,7 +97,7 @@ internal fun List<Pair<String, Any?>>.withEmptyData(vararg key: String): List<Pa internal fun String?.requestBuilder(): Request.Builder { val builder = Request.Builder() - .header("User-Agent", USER_AGENT_BASIC) + .header("User-Agent", USER_AGENT_DESKTOP) if (this != null) builder.header("Cookie", this) // .cacheControl(CacheControl.FORCE_NETWORK) |