From 9f74d71852546fdb7484289b5de9a0ae4707ffd5 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 29 Dec 2018 16:06:01 -0500 Subject: Fix like button and disable cookie update, resolves #1203 --- app/src/main/assets/css/core/_svg.scss | 8 +++++++- app/src/main/assets/css/themes/custom.css | 8 +++++++- app/src/main/assets/css/themes/material_amoled.css | 8 +++++++- app/src/main/assets/css/themes/material_dark.css | 8 +++++++- app/src/main/assets/css/themes/material_glass.css | 8 +++++++- app/src/main/assets/css/themes/material_light.css | 8 +++++++- app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt | 6 +++--- app/src/main/res/xml/frost_changelog.xml | 2 +- docs/Changelog.md | 1 + 9 files changed, 47 insertions(+), 10 deletions(-) diff --git a/app/src/main/assets/css/core/_svg.scss b/app/src/main/assets/css/core/_svg.scss index 8534954f..45d4a253 100644 --- a/app/src/main/assets/css/core/_svg.scss +++ b/app/src/main/assets/css/core/_svg.scss @@ -17,12 +17,18 @@ $video: ''; $like_selected: ''; +/* + * 2018/12/29 + * Previously ._15km ._15ko::before; however, reaction changes no longer affect this element + * The robust measure seems to be a[data-sigil~="like-reaction-flyout"] along with [data-sigil~="like"] for an unliked post + * and [data-sigil~="unlike"] for a liked post + */ ._15km ._15ko::before { @include background-svg($like); background-position: center !important; } -._15km ._15ko._2q8z::before { +._15km ._15ko._77la::before { @include background-svg($like_selected); background-position: center !important; } diff --git a/app/src/main/assets/css/themes/custom.css b/app/src/main/assets/css/themes/custom.css index a64e964f..c7fb237b 100644 --- a/app/src/main/assets/css/themes/custom.css +++ b/app/src/main/assets/css/themes/custom.css @@ -295,12 +295,18 @@ button ._v89 ._54k8._1fl1 { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="$T$" viewBox="0 0 50 50"%3E%3Cpath fill="none" d="M13 26h24v24H13z"/%3E%3Cpath d="M30 31.5V28c0-.55-.45-1-1-1H17c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z"/%3E%3C/svg%3E') no-repeat !important; } +/* + * 2018/12/29 + * Previously ._15km ._15ko::before; however, reaction changes no longer affect this element + * The robust measure seems to be a[data-sigil~="like-reaction-flyout"] along with [data-sigil~="like"] for an unliked post + * and [data-sigil~="unlike"] for a liked post + */ ._15km ._15ko::before { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="$T$" viewBox="0 0 24 24"%3E%3Cpath fill="none" d="M0 0h24v24H0z"/%3E%3Cpath d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91l-.01-.01L23 10z"/%3E%3C/svg%3E') no-repeat !important; background-position: center !important; } -._15km ._15ko._2q8z::before { +._15km ._15ko._77la::before { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="$A$" viewBox="0 0 24 24"%3E%3Cpath fill="none" d="M0 0h24v24H0z"/%3E%3Cpath d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91l-.01-.01L23 10z"/%3E%3C/svg%3E') no-repeat !important; background-position: center !important; } diff --git a/app/src/main/assets/css/themes/material_amoled.css b/app/src/main/assets/css/themes/material_amoled.css index d4cf8233..669ce789 100644 --- a/app/src/main/assets/css/themes/material_amoled.css +++ b/app/src/main/assets/css/themes/material_amoled.css @@ -295,12 +295,18 @@ button ._v89 ._54k8._1fl1 { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%23fff" viewBox="0 0 50 50"%3E%3Cpath fill="none" d="M13 26h24v24H13z"/%3E%3Cpath d="M30 31.5V28c0-.55-.45-1-1-1H17c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z"/%3E%3C/svg%3E') no-repeat !important; } +/* + * 2018/12/29 + * Previously ._15km ._15ko::before; however, reaction changes no longer affect this element + * The robust measure seems to be a[data-sigil~="like-reaction-flyout"] along with [data-sigil~="like"] for an unliked post + * and [data-sigil~="unlike"] for a liked post + */ ._15km ._15ko::before { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%23fff" viewBox="0 0 24 24"%3E%3Cpath fill="none" d="M0 0h24v24H0z"/%3E%3Cpath d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91l-.01-.01L23 10z"/%3E%3C/svg%3E') no-repeat !important; background-position: center !important; } -._15km ._15ko._2q8z::before { +._15km ._15ko._77la::before { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%235d86dd" viewBox="0 0 24 24"%3E%3Cpath fill="none" d="M0 0h24v24H0z"/%3E%3Cpath d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91l-.01-.01L23 10z"/%3E%3C/svg%3E') no-repeat !important; background-position: center !important; } diff --git a/app/src/main/assets/css/themes/material_dark.css b/app/src/main/assets/css/themes/material_dark.css index e13f5600..67994c44 100644 --- a/app/src/main/assets/css/themes/material_dark.css +++ b/app/src/main/assets/css/themes/material_dark.css @@ -295,12 +295,18 @@ button ._v89 ._54k8._1fl1 { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%23fff" viewBox="0 0 50 50"%3E%3Cpath fill="none" d="M13 26h24v24H13z"/%3E%3Cpath d="M30 31.5V28c0-.55-.45-1-1-1H17c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z"/%3E%3C/svg%3E') no-repeat !important; } +/* + * 2018/12/29 + * Previously ._15km ._15ko::before; however, reaction changes no longer affect this element + * The robust measure seems to be a[data-sigil~="like-reaction-flyout"] along with [data-sigil~="like"] for an unliked post + * and [data-sigil~="unlike"] for a liked post + */ ._15km ._15ko::before { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%23fff" viewBox="0 0 24 24"%3E%3Cpath fill="none" d="M0 0h24v24H0z"/%3E%3Cpath d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91l-.01-.01L23 10z"/%3E%3C/svg%3E') no-repeat !important; background-position: center !important; } -._15km ._15ko._2q8z::before { +._15km ._15ko._77la::before { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%235d86dd" viewBox="0 0 24 24"%3E%3Cpath fill="none" d="M0 0h24v24H0z"/%3E%3Cpath d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91l-.01-.01L23 10z"/%3E%3C/svg%3E') no-repeat !important; background-position: center !important; } diff --git a/app/src/main/assets/css/themes/material_glass.css b/app/src/main/assets/css/themes/material_glass.css index 0d4cb726..8682d83c 100644 --- a/app/src/main/assets/css/themes/material_glass.css +++ b/app/src/main/assets/css/themes/material_glass.css @@ -295,12 +295,18 @@ button ._v89 ._54k8._1fl1 { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%23fff" viewBox="0 0 50 50"%3E%3Cpath fill="none" d="M13 26h24v24H13z"/%3E%3Cpath d="M30 31.5V28c0-.55-.45-1-1-1H17c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z"/%3E%3C/svg%3E') no-repeat !important; } +/* + * 2018/12/29 + * Previously ._15km ._15ko::before; however, reaction changes no longer affect this element + * The robust measure seems to be a[data-sigil~="like-reaction-flyout"] along with [data-sigil~="like"] for an unliked post + * and [data-sigil~="unlike"] for a liked post + */ ._15km ._15ko::before { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%23fff" viewBox="0 0 24 24"%3E%3Cpath fill="none" d="M0 0h24v24H0z"/%3E%3Cpath d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91l-.01-.01L23 10z"/%3E%3C/svg%3E') no-repeat !important; background-position: center !important; } -._15km ._15ko._2q8z::before { +._15km ._15ko._77la::before { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%235d86dd" viewBox="0 0 24 24"%3E%3Cpath fill="none" d="M0 0h24v24H0z"/%3E%3Cpath d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91l-.01-.01L23 10z"/%3E%3C/svg%3E') no-repeat !important; background-position: center !important; } diff --git a/app/src/main/assets/css/themes/material_light.css b/app/src/main/assets/css/themes/material_light.css index f3c6cc92..8c2859fa 100644 --- a/app/src/main/assets/css/themes/material_light.css +++ b/app/src/main/assets/css/themes/material_light.css @@ -295,12 +295,18 @@ button ._v89 ._54k8._1fl1 { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 50 50"%3E%3Cpath fill="none" d="M13 26h24v24H13z"/%3E%3Cpath d="M30 31.5V28c0-.55-.45-1-1-1H17c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z"/%3E%3C/svg%3E') no-repeat !important; } +/* + * 2018/12/29 + * Previously ._15km ._15ko::before; however, reaction changes no longer affect this element + * The robust measure seems to be a[data-sigil~="like-reaction-flyout"] along with [data-sigil~="like"] for an unliked post + * and [data-sigil~="unlike"] for a liked post + */ ._15km ._15ko::before { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"%3E%3Cpath fill="none" d="M0 0h24v24H0z"/%3E%3Cpath d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91l-.01-.01L23 10z"/%3E%3C/svg%3E') no-repeat !important; background-position: center !important; } -._15km ._15ko._2q8z::before { +._15km ._15ko._77la::before { background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%233b5998" viewBox="0 0 24 24"%3E%3Cpath fill="none" d="M0 0h24v24H0z"/%3E%3Cpath d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91l-.01-.01L23 10z"/%3E%3C/svg%3E') no-repeat !important; background-position: center !important; } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt index 47c0ecc4..e0be7d87 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt @@ -104,9 +104,9 @@ object FbCookie { val dbCookie = loadFbCookie(Prefs.userId)?.cookie if (dbCookie != null && webCookie == null) { L.d { "DbCookie found & WebCookie is null; setting webcookie" } - GlobalScope.launch(Dispatchers.Main) { - manager.suspendSetWebCookie(dbCookie) - } +// GlobalScope.launch(Dispatchers.Main) { +// manager.suspendSetWebCookie(dbCookie) +// } } } diff --git a/app/src/main/res/xml/frost_changelog.xml b/app/src/main/res/xml/frost_changelog.xml index 3dae4a5d..c57ea038 100644 --- a/app/src/main/res/xml/frost_changelog.xml +++ b/app/src/main/res/xml/frost_changelog.xml @@ -9,7 +9,7 @@ - + diff --git a/docs/Changelog.md b/docs/Changelog.md index e6372f3d..9bb3cdb3 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -3,6 +3,7 @@ ## v2.2.0 * Rewrite a lot of internal logic to optimize loading * Change default user agent to new android version, previously a desktop user agent +* Add back group management page when clicking the respective notification ## v2.1.2 * Fix message notifications with just one other user -- cgit v1.2.3 From 83cc2597925d5727dcad021818bfae9e768ab00c Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 29 Dec 2018 16:30:11 -0500 Subject: Completely remove fbcookie's invoke function --- .../com/pitchedapps/frost/facebook/FbCookieTest.kt | 13 +++++++++++++ app/src/main/assets/css/core/_svg.scss | 4 ++-- app/src/main/assets/css/themes/custom.css | 4 ++-- app/src/main/assets/css/themes/material_amoled.css | 4 ++-- app/src/main/assets/css/themes/material_dark.css | 4 ++-- app/src/main/assets/css/themes/material_glass.css | 4 ++-- app/src/main/assets/css/themes/material_light.css | 4 ++-- .../kotlin/com/pitchedapps/frost/facebook/FbCookie.kt | 18 +++++------------- 8 files changed, 30 insertions(+), 25 deletions(-) create mode 100644 app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt new file mode 100644 index 00000000..d5c8d2e1 --- /dev/null +++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt @@ -0,0 +1,13 @@ +package com.pitchedapps.frost.facebook + +import android.webkit.CookieManager +import org.junit.Test +import kotlin.test.assertTrue + +class FbCookieTest { + + @Test + fun managerAcceptsCookie() { + assertTrue(CookieManager.getInstance().acceptCookie(), "Cookie manager should accept cookie by default") + } +} \ No newline at end of file diff --git a/app/src/main/assets/css/core/_svg.scss b/app/src/main/assets/css/core/_svg.scss index 45d4a253..fa5b0531 100644 --- a/app/src/main/assets/css/core/_svg.scss +++ b/app/src/main/assets/css/core/_svg.scss @@ -19,8 +19,8 @@ $like_selected: '