From 6943976bf150c723cd55cbfb145257ce14471f91 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 7 Apr 2018 14:41:28 -0400 Subject: 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 --- app/build.gradle | 38 +++------------------- .../main/kotlin/com/pitchedapps/frost/FrostApp.kt | 14 ++++++-- .../frost/activities/BaseMainActivity.kt | 4 +-- .../pitchedapps/frost/activities/LoginActivity.kt | 4 +-- .../com/pitchedapps/frost/enums/OverlayContext.kt | 2 +- .../com/pitchedapps/frost/facebook/FbConst.kt | 5 +-- .../com/pitchedapps/frost/views/AccountItem.kt | 4 +-- app/src/main/res/layout/activity_frame_wrapper.xml | 4 ++- .../main/res/layout/activity_tab_customizer.xml | 4 ++- 9 files changed, 31 insertions(+), 48 deletions(-) (limited to 'app') 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 { override fun onResourceReady(resource: Drawable?, model: Any?, target: Target?, 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 { override fun onResourceReady(resource: Drawable?, model: Any?, target: Target?, 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 @@ \ 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 @@ + android:layout_height="match_parent" + xmlns:tools="http://schemas.android.com/tools" + tools:ignore="MergeRootFrame">