aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-04-07 14:41:28 -0400
committerGitHub <noreply@github.com>2018-04-07 14:41:28 -0400
commit6943976bf150c723cd55cbfb145257ce14471f91 (patch)
treeffc05cb1385e66daed29c728f417b74e0f091ea1
parent7c1671f34328c509cf9850331225f8e4705e4abf (diff)
downloadfrost-6943976bf150c723cd55cbfb145257ce14471f91.tar.gz
frost-6943976bf150c723cd55cbfb145257ce14471f91.tar.bz2
frost-6943976bf150c723cd55cbfb145257ce14471f91.zip
Fix useragent update (#845)
* Test windows user agent * Update dependencies * Update KAU * Switch back user agent and use android base * Fix lint issues * Fix lint part 2 * Test messenger user agent * Update bugsnag release levels
-rw-r--r--.travis.yml2
-rw-r--r--app/build.gradle38
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt14
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt4
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt4
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/enums/OverlayContext.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt5
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt4
-rw-r--r--app/src/main/res/layout/activity_frame_wrapper.xml4
-rw-r--r--app/src/main/res/layout/activity_tab_customizer.xml4
-rw-r--r--build.gradle16
-rw-r--r--gradle.properties9
12 files changed, 43 insertions, 63 deletions
diff --git a/.travis.yml b/.travis.yml
index d2376120..8b7d4486 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ android:
components:
- tools
- platform-tools
- - build-tools-27.0.2
+ - build-tools-27.0.3
- android-27
- extra-android-support
- extra-android-m2repository
diff --git a/app/build.gradle b/app/build.gradle
index 83590b78..3b913a82 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,27 +1,8 @@
-plugins {
- id 'com.gladed.androidgitversion' version '0.4.3'
-}
-
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
-apply plugin: 'com.github.triplet.play'
apply plugin: 'com.getkeepsafe.dexcount'
-
-def withPlaySigning = file('../files/gplay-keys.json').exists()
-/*
- * Feel free to check the gitignore under the files/ folder to see what is required for the signing
- * It is assumed that if one of those files exist, all remaining ones exist as well
- */
-
-if (withPlaySigning)
- play {
- jsonFile = file('../files/gplay-keys.json')
- track = 'alpha'
- errorOnSizeLimit = true
- uploadImages = false
- untrackOld = true
- }
+apply plugin: 'com.gladed.androidgitversion'
android {
compileSdkVersion kau.targetSdk
@@ -64,18 +45,6 @@ android {
signingConfigs {
- if (withPlaySigning) {
- def releaseProps = new Properties()
- file("../files/play.properties").withInputStream { releaseProps.load(it) }
-
- release {
- storeFile file("../files/play.keystore")
- storePassword releaseProps.getProperty('storePassword')
- keyAlias releaseProps.getProperty('keyAlias')
- keyPassword releaseProps.getProperty('keyPassword')
- }
- }
-
debug {
storeFile file("../files/debug.keystore")
storePassword "debugKey"
@@ -89,6 +58,7 @@ android {
keyAlias "testKey"
keyPassword "testkey"
}
+
}
buildTypes {
@@ -116,7 +86,6 @@ android {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- if (withPlaySigning) signingConfig signingConfigs.release
resValue "string", "frost_name", "Frost"
resValue "string", "frost_web", "Frost Web"
}
@@ -137,7 +106,6 @@ repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
- maven { url 'https://maven.fabric.io/public' }
}
dependencies {
@@ -178,7 +146,9 @@ dependencies {
implementation"com.mikepenz:fastadapter-extensions:${kau.fastAdapter}@aar"
+ //noinspection GradleDependency
implementation "com.github.bumptech.glide:okhttp3-integration:${kau.glide}"
+ //noinspection GradleDependency
kapt "com.github.bumptech.glide:compiler:${kau.glide}"
implementation "com.fasterxml.jackson.core:jackson-databind:2.9.3"
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
index 118f7eac..cbb3d0ab 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
@@ -68,10 +68,18 @@ class FrostApp : Application() {
// refWatcher = LeakCanary.install(this)
if (!BuildConfig.DEBUG) {
Bugsnag.init(this)
- Bugsnag.setAutoCaptureSessions(true)
- Bugsnag.getClient().setUserId(Prefs.frostId)
+ val releaseStage = setOf("production", "releaseTest", "github", "release")
+ Bugsnag.setNotifyReleaseStages(*releaseStage.toTypedArray(), "unnamed")
+ val versionSegments = BuildConfig.VERSION_NAME.split("_")
+ if (versionSegments.size > 1) {
+ Bugsnag.setAppVersion(versionSegments.first())
+ Bugsnag.setReleaseStage(if (versionSegments.last() in releaseStage) versionSegments.last()
+ else "unnamed")
+ Bugsnag.setUserName(BuildConfig.VERSION_NAME)
+ }
-// setUser("userId", "user@email.com", "User Name")
+ Bugsnag.setAutoCaptureSessions(true)
+ Bugsnag.setUserId(Prefs.frostId)
}
KL.shouldLog = { BuildConfig.DEBUG }
Prefs.verboseLogging = false
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt
index 21bc2354..0cd7dacd 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt
@@ -52,7 +52,7 @@ import com.pitchedapps.frost.dbflow.loadFbTabs
import com.pitchedapps.frost.enums.MainActivityLayout
import com.pitchedapps.frost.facebook.FbCookie
import com.pitchedapps.frost.facebook.FbItem
-import com.pitchedapps.frost.facebook.PROFILE_PICTURE_URL
+import com.pitchedapps.frost.facebook.profilePictureUrl
import com.pitchedapps.frost.fragments.BaseFragment
import com.pitchedapps.frost.fragments.WebFragment
import com.pitchedapps.frost.parsers.FrostSearch
@@ -191,7 +191,7 @@ abstract class BaseMainActivity : BaseActivity(), MainActivityContract,
selectionSecondLineShown = false
cookies().forEach { (id, name) ->
profile(name = name ?: "") {
- iconUrl = PROFILE_PICTURE_URL(id)
+ iconUrl = profilePictureUrl(id)
textColor = Prefs.textColor.toLong()
selectedTextColor = Prefs.textColor.toLong()
selectedColor = 0x00000001.toLong()
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt
index 7e989fc6..dd0649b3 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt
@@ -20,7 +20,7 @@ import com.pitchedapps.frost.dbflow.CookieModel
import com.pitchedapps.frost.dbflow.fetchUsername
import com.pitchedapps.frost.dbflow.loadFbCookiesAsync
import com.pitchedapps.frost.facebook.FbCookie
-import com.pitchedapps.frost.facebook.PROFILE_PICTURE_URL
+import com.pitchedapps.frost.facebook.profilePictureUrl
import com.pitchedapps.frost.glide.FrostGlide
import com.pitchedapps.frost.glide.GlideApp
import com.pitchedapps.frost.glide.transform
@@ -110,7 +110,7 @@ class LoginActivity : BaseActivity() {
private fun loadProfile(id: Long) {
- profileLoader.load(PROFILE_PICTURE_URL(id))
+ profileLoader.load(profilePictureUrl(id))
.transform(FrostGlide.roundCorner).listener(object : RequestListener<Drawable> {
override fun onResourceReady(resource: Drawable?, model: Any?, target: Target<Drawable>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
profileSubject.onSuccess(true)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/enums/OverlayContext.kt b/app/src/main/kotlin/com/pitchedapps/frost/enums/OverlayContext.kt
index 4f37c6c7..f93a2229 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/enums/OverlayContext.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/enums/OverlayContext.kt
@@ -54,7 +54,7 @@ enum class OverlayContext(private val menuItem: FrostMenuItem?) : EnumBundle<Ove
class FrostMenuItem(
val id: Int,
val fbItem: FbItem,
- val showAsAction: Int = MenuItem.SHOW_AS_ACTION_ALWAYS) {
+ val showAsAction: Int = MenuItem.SHOW_AS_ACTION_IF_ROOM) {
fun addToMenu(context: Context, menu: Menu, index: Int) {
val item = menu.add(Menu.NONE, id, index, fbItem.titleId)
item.icon = fbItem.icon.toDrawable(context, 18)
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 6456b0d6..33f6ebe4 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt
@@ -8,12 +8,13 @@ const val FACEBOOK_COM = "facebook.com"
const val FBCDN_NET = "fbcdn.net"
const val HTTPS_FACEBOOK_COM = "https://$FACEBOOK_COM"
const val FB_URL_BASE = "https://m.$FACEBOOK_COM/"
-fun PROFILE_PICTURE_URL(id: Long) = "https://graph.facebook.com/$id/picture?type=large"
+fun profilePictureUrl(id: Long) = "https://graph.facebook.com/$id/picture?type=large"
const val FB_LOGIN_URL = "${FB_URL_BASE}login"
const val USER_AGENT_FULL = "Mozilla/5.0 (Linux; Android 4.4.2; en-us; SAMSUNG SM-G900T Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.6 Chrome/28.0.1500.94 Mobile Safari/537.36"
-const val USER_AGENT_BASIC = "Mozilla/5.0 (BB10; Kbd) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.4633 Mobile Safari/537.10+"
+const val USER_AGENT_BASIC_OLD = "Mozilla/5.0 (Linux; Android 6.0) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.4633 Mobile Safari/537.10+"
const val USER_AGENT_MESSENGER = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
+const val USER_AGENT_BASIC = USER_AGENT_MESSENGER
/**
* Animation transition delay, just to ensure that the styles
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt
index 7058ffe4..7262fa17 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt
@@ -14,7 +14,7 @@ import com.bumptech.glide.request.target.Target
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.dbflow.CookieModel
-import com.pitchedapps.frost.facebook.PROFILE_PICTURE_URL
+import com.pitchedapps.frost.facebook.profilePictureUrl
import com.pitchedapps.frost.glide.FrostGlide
import com.pitchedapps.frost.glide.GlideApp
import com.pitchedapps.frost.utils.Prefs
@@ -32,7 +32,7 @@ class AccountItem(val cookie: CookieModel?) : KauIItem<AccountItem, AccountItem.
text.setTextColor(Prefs.textColor)
if (cookie != null) {
text.text = cookie.name
- GlideApp.with(itemView).load(PROFILE_PICTURE_URL(cookie.id))
+ GlideApp.with(itemView).load(profilePictureUrl(cookie.id))
.transform(FrostGlide.roundCorner).listener(object : RequestListener<Drawable> {
override fun onResourceReady(resource: Drawable?, model: Any?, target: Target<Drawable>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
text.fadeIn()
diff --git a/app/src/main/res/layout/activity_frame_wrapper.xml b/app/src/main/res/layout/activity_frame_wrapper.xml
index e51d3391..8d625933 100644
--- a/app/src/main/res/layout/activity_frame_wrapper.xml
+++ b/app/src/main/res/layout/activity_frame_wrapper.xml
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/frame_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:fitsSystemWindows="true" /> \ No newline at end of file
+ android:fitsSystemWindows="true"
+ tools:ignore="MergeRootFrame" /> \ No newline at end of file
diff --git a/app/src/main/res/layout/activity_tab_customizer.xml b/app/src/main/res/layout/activity_tab_customizer.xml
index b72bb953..8e540f11 100644
--- a/app/src/main/res/layout/activity_tab_customizer.xml
+++ b/app/src/main/res/layout/activity_tab_customizer.xml
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ xmlns:tools="http://schemas.android.com/tools"
+ tools:ignore="MergeRootFrame">
<View
android:id="@+id/pseudo_toolbar"
diff --git a/build.gradle b/build.gradle
index c004c8ae..2db1fb74 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,25 +1,21 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
buildscript {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
- maven { url 'https://maven.fabric.io/public' }
+ maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "ca.allanwang:kau:${KAU}"
- classpath 'com.android.tools.build:gradle:3.0.1'
+ classpath 'com.android.tools.build:gradle:3.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${KOTLIN}"
classpath "com.bugsnag:bugsnag-android-gradle-plugin:${BUGSNAG_PLUGIN}"
- classpath 'com.github.triplet.gradle:play-publisher:1.2.0'
- classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
- }
-
- wrapper {
- distributionType = "all"
+ classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:${DEX_PLUGIN}"
+ classpath "gradle.plugin.com.gladed.gradle.androidgitversion:gradle-android-git-version:${GIT_PLUGIN}"
}
+
+ wrapper.setDistributionType(Wrapper.DistributionType.ALL)
}
apply plugin: 'ca.allanwang.kau'
diff --git a/gradle.properties b/gradle.properties
index ca2ddb94..e715978b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -14,20 +14,21 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro
APP_ID=Frost
APP_GROUP=com.pitchedapps
-KAU=e97db5c
-KOTLIN=1.2.30
+KAU=b3a4e35
+KOTLIN=1.2.31
BUGSNAG=4.3.2
BUGSNAG_PLUGIN=3.2.5
+DEX_PLUGIN=0.8.2
+GIT_PLUGIN=0.4.3
COMMONS_TEXT=1.2
-CRASHLYTICS=2.9.1
DBFLOW=4.2.4
EXOMEDIA=4.1.0
JSOUP=1.11.2
LEAK_CANARY=1.5.4
MATERIAL_DRAWER_KT=1.3.3
OKHTTP=3.10.0
-PAPER_PARCEL=2.0.4
+PAPER_PARCEL=2.0.5
ROBOELECTRIC=3.4
RX_ANDROID=2.0.2
RX_BINDING=2.0.0