diff --git a/app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt b/app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt index b7f47273..eb54daae 100644 --- a/app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/LoginActivity.kt @@ -34,9 +34,6 @@ import com.keylesspalace.tusky.entity.AccessToken import com.keylesspalace.tusky.entity.AppCredentials import com.keylesspalace.tusky.network.MastodonApi import com.keylesspalace.tusky.util.ThemeUtils -import com.keylesspalace.tusky.util.getNonNullString -import com.keylesspalace.tusky.util.rickRoll -import com.keylesspalace.tusky.util.shouldRickRoll import kotlinx.android.synthetic.main.activity_login.* import okhttp3.HttpUrl import retrofit2.Call @@ -137,11 +134,6 @@ class LoginActivity : BaseActivity(), Injectable { return } - if (shouldRickRoll(this, domain)) { - rickRoll(this) - return - } - val callback = object : Callback { override fun onResponse(call: Call, response: Response) { diff --git a/app/src/main/java/com/keylesspalace/tusky/util/RickRoll.kt b/app/src/main/java/com/keylesspalace/tusky/util/RickRoll.kt deleted file mode 100644 index 03c3339f..00000000 --- a/app/src/main/java/com/keylesspalace/tusky/util/RickRoll.kt +++ /dev/null @@ -1,20 +0,0 @@ -package com.keylesspalace.tusky.util - -import android.content.Context -import android.content.Intent -import android.net.Uri -import com.keylesspalace.tusky.R - -fun shouldRickRoll(context: Context, domain: String) = - context.resources.getStringArray(R.array.rick_roll_domains).any { candidate -> - domain.equals(candidate, true) || domain.endsWith(".$candidate", true) - } - -fun rickRoll(context: Context) { - val uri = Uri.parse(context.getString(R.string.rick_roll_url)) - val intent = Intent(Intent.ACTION_VIEW, uri).apply { - addCategory(Intent.CATEGORY_BROWSABLE) - addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - } - context.startActivity(intent) -} diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index 03704a8f..791cfdf7 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -111,13 +111,6 @@ %1$s; %2$s; %3$s, %14$s %4$s, %5$s; %6$s, %7$s, %8$s, %9$s, %10$s; %11$s, %12$s, %13$s - - gab.com - gab.ai - - - https://www.youtube.com/watch?v=dQw4w9WgXcQ - @string/poll_duration_5_min diff --git a/app/src/test/java/com/keylesspalace/tusky/util/RickRollTest.kt b/app/src/test/java/com/keylesspalace/tusky/util/RickRollTest.kt deleted file mode 100644 index c307e552..00000000 --- a/app/src/test/java/com/keylesspalace/tusky/util/RickRollTest.kt +++ /dev/null @@ -1,34 +0,0 @@ -package com.keylesspalace.tusky.util - -import android.app.Activity -import androidx.test.ext.junit.runners.AndroidJUnit4 -import com.keylesspalace.tusky.FakeTuskyApplication -import org.junit.Assert.assertFalse -import org.junit.Assert.assertTrue -import org.junit.Before -import org.junit.Test -import org.junit.runner.RunWith -import org.robolectric.Robolectric -import org.robolectric.annotation.Config - -@Config(application = FakeTuskyApplication::class, sdk = [28]) -@RunWith(AndroidJUnit4::class) -class RickRollTest { - private lateinit var activity: Activity - @Before - fun setupActivity() { - val controller = Robolectric.buildActivity(Activity::class.java) - activity = controller.get() - } - - @Test - fun testShouldRickRoll() { - listOf("gab.Com", "social.gab.ai", "whatever.GAB.com").forEach { - rollableDomain -> assertTrue(shouldRickRoll(activity, rollableDomain)) - } - - listOf("chaos.social", "notgab.com").forEach { - notRollableDomain -> assertFalse(shouldRickRoll(activity, notRollableDomain)) - } - } -}