From da3d83ce6427baace981376622d7593cd15bc8c5 Mon Sep 17 00:00:00 2001 From: takahirom Date: Tue, 27 Aug 2024 21:02:18 +0900 Subject: [PATCH] Remove unused activity and intent filter --- app-android/build.gradle.kts | 4 +- app-android/src/main/AndroidManifest.xml | 18 ----- .../confsched/ResolveDynamicLinksActivity.kt | 67 ------------------- 3 files changed, 2 insertions(+), 87 deletions(-) delete mode 100644 app-android/src/main/java/io/github/droidkaigi/confsched/ResolveDynamicLinksActivity.kt diff --git a/app-android/build.gradle.kts b/app-android/build.gradle.kts index a4cf03eb1..d9e9d6105 100644 --- a/app-android/build.gradle.kts +++ b/app-android/build.gradle.kts @@ -25,8 +25,8 @@ android { buildConfig = true } defaultConfig { - versionCode = 2 - versionName = "1.0.0" + versionCode = 3 + versionName = "1.0.1" } signingConfigs { create("dev") { diff --git a/app-android/src/main/AndroidManifest.xml b/app-android/src/main/AndroidManifest.xml index 27dd16aa5..690a5929b 100644 --- a/app-android/src/main/AndroidManifest.xml +++ b/app-android/src/main/AndroidManifest.xml @@ -32,24 +32,6 @@ - - - - - - - - - - - - - - diff --git a/app-android/src/main/java/io/github/droidkaigi/confsched/ResolveDynamicLinksActivity.kt b/app-android/src/main/java/io/github/droidkaigi/confsched/ResolveDynamicLinksActivity.kt deleted file mode 100644 index 337c6c6ca..000000000 --- a/app-android/src/main/java/io/github/droidkaigi/confsched/ResolveDynamicLinksActivity.kt +++ /dev/null @@ -1,67 +0,0 @@ -package io.github.droidkaigi.confsched - -import android.content.Intent -import android.content.Intent.CATEGORY_BROWSABLE -import android.content.Intent.FLAG_ACTIVITY_NEW_TASK -import android.content.Intent.FLAG_ACTIVITY_REQUIRE_DEFAULT -import android.net.Uri -import android.os.Bundle -import android.widget.Toast -import androidx.activity.ComponentActivity -import com.google.firebase.dynamiclinks.FirebaseDynamicLinks -import io.github.droidkaigi.confsched.model.Lang.ENGLISH -import io.github.droidkaigi.confsched.model.Lang.JAPANESE -import io.github.droidkaigi.confsched.model.Lang.MIXED -import io.github.droidkaigi.confsched.model.defaultLang - -class ResolveDynamicLinksActivity : ComponentActivity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - - FirebaseDynamicLinks.getInstance() - .getDynamicLink(intent) - .addOnSuccessListener(this) { pendingDynamicLinkData -> - if (pendingDynamicLinkData != null) { - val deepLink = pendingDynamicLinkData.link - handleDeepLink(deepLink) - } else { - val message = when (defaultLang()) { - MIXED -> "Please connect to the network/ネットワークに接続してください" - JAPANESE -> "ネットワークに接続してください" - ENGLISH -> "Please connect to the network" - } - Toast.makeText(this, message, Toast.LENGTH_SHORT).show() - finishAndRemoveTask() - } - } - .addOnFailureListener { - finishAndRemoveTask() - } - } - - private fun handleDeepLink(deepLink: Uri?) { - if (deepLink == null || deepLink.host != "2024.droidkaigi.jp") { - // For a security reason. - // Activities that can handle ACTION_VIEW must check the authority of Uri. - finishAndRemoveTask() - return - } - val mainIntent = Intent(this, MainActivity::class.java).apply { - flags = FLAG_ACTIVITY_NEW_TASK - } - startActivity(mainIntent) - try { - val intent = Intent(Intent.ACTION_VIEW, deepLink).apply { - // Disable showing up chooser dialog and don't allow open this link by other apps even if users choose the default app manually. - `package` = packageName - addCategory(CATEGORY_BROWSABLE) - // new task is important for gateway activities like this - flags = FLAG_ACTIVITY_NEW_TASK or FLAG_ACTIVITY_REQUIRE_DEFAULT - } - startActivity(intent) - } finally { - finishAndRemoveTask() - } - } -}