Skip to content

Commit

Permalink
MBL-1262: QA party bug fixes (#1971)
Browse files Browse the repository at this point in the history
* - Navigation issues when changing between app to log in

* - Chrome Tab does not get killed when going to background
- Removed task affinity, StrandHogg Attack affecting android 10 or lower devices do not affect now as loggin/signup happens on  chrome tab

* - change password triggers oauth flow is feature flag enabled

* - linter
  • Loading branch information
Arkariang committed Mar 7, 2024
1 parent 8901ea1 commit a46e185
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
7 changes: 2 additions & 5 deletions app/src/main/AndroidManifest.xml
Expand Up @@ -70,7 +70,6 @@
android:label="@string/app_name"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/SplashTheme">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
Expand Down Expand Up @@ -111,7 +110,6 @@
android:name=".ui.activities.ResetPasswordActivity"
android:parentActivityName=".ui.activities.LoginActivity"
android:windowSoftInputMode="adjustResize"
android:taskAffinity=""
android:theme="@style/Login" />
<activity
android:name=".ui.activities.SetPasswordActivity"
Expand Down Expand Up @@ -149,7 +147,7 @@
android:name=".ui.activities.LoginToutActivity"
android:parentActivityName=".ui.activities.DiscoveryActivity"
android:theme="@style/Login"
android:launchMode="singleInstancePerTask"
android:launchMode="singleTop"
android:exported="true">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
Expand Down Expand Up @@ -213,7 +211,6 @@
android:theme="@style/SettingsActivity" />
<activity
android:name=".ui.activities.SignupActivity"
android:taskAffinity=""
android:parentActivityName=".ui.activities.LoginToutActivity"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Login" />
Expand Down Expand Up @@ -256,7 +253,7 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="*.kickstarter.com"
android:host="www.kickstarter.com"
android:scheme="https" />
</intent-filter>
<!-- Website Main page deeplink -->
Expand Down
Expand Up @@ -33,6 +33,7 @@ class ChangePasswordActivity : ComponentActivity() {
private val viewModel: ChangePasswordViewModel by viewModels {
viewModelFactory
}
private var oAuthIsEnabled = false

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand All @@ -46,6 +47,8 @@ class ChangePasswordActivity : ComponentActivity() {
theme = env.sharedPreferences()
?.getInt(SharedPreferenceKey.APP_THEME, AppThemes.MATCH_SYSTEM.ordinal)
?: AppThemes.MATCH_SYSTEM.ordinal

oAuthIsEnabled = env.featureFlagClient()?.getBoolean(FlagKey.ANDROID_OAUTH) ?: false
}

setContent {
Expand Down Expand Up @@ -98,10 +101,15 @@ class ChangePasswordActivity : ComponentActivity() {
private fun logout(email: String) {
this.logout?.execute()
ApplicationUtils.startNewDiscoveryActivity(this)
startActivity(
val intent = if (oAuthIsEnabled) {
Intent(this, LoginToutActivity::class.java)
} else {
Intent(this, LoginActivity::class.java)
.putExtra(IntentKey.LOGIN_REASON, LoginReason.CHANGE_PASSWORD)
.putExtra(IntentKey.EMAIL, email)
}
startActivity(
intent
)
}

Expand Down
Expand Up @@ -275,7 +275,6 @@ class LoginToutActivity : ComponentActivity() {
val authorizationUri = Uri.parse(url)

val tabIntent = CustomTabsIntent.Builder().build()
tabIntent.intent.flags = Intent.FLAG_ACTIVITY_NO_HISTORY

val packageName = ChromeTabsHelper.getPackageNameToUse(this)
tabIntent.intent.setPackage(packageName)
Expand Down

0 comments on commit a46e185

Please sign in to comment.