Skip to content

Commit

Permalink
fixed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lalwani committed May 30, 2024
1 parent cdb27e2 commit dbd7224
Show file tree
Hide file tree
Showing 26 changed files with 302 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package com.uber.sdk2.auth.internal
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.util.Log
import com.uber.sdk2.auth.AppDiscovering
import com.uber.sdk2.auth.request.CrossApp

Expand All @@ -27,6 +28,7 @@ import com.uber.sdk2.auth.request.CrossApp
*/
class AppDiscovery(val context: Context) : AppDiscovering {
override fun findAppForSso(uri: Uri, appPriority: Iterable<CrossApp>): String? {
Log.d("yyyy", "SSO URI: ${uri.toString()}")
val intent = Intent(Intent.ACTION_VIEW, uri)

// Use PackageManager to find activities that can handle the Intent
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/kotlin/com/uber/sdk2/core/config/UriConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ object UriConfig {
.appendQueryParameter(REDIRECT_PARAM, redirectUri)
.appendQueryParameter(SCOPE_PARAM, scopes)
.appendQueryParameter(SDK_VERSION_PARAM, BuildConfig.VERSION_NAME)
.appendQueryParameter(PLATFORM_PARAM, "android")
.appendQueryParameter(CODE_CHALLENGE_METHOD, CODE_CHALLENGE_METHOD_VAL)
return builder.build()
}

Expand All @@ -80,4 +82,6 @@ object UriConfig {
const val SDK_VERSION_PARAM = "sdk_version"
const val CODE_CHALLENGE_PARAM = "code_challenge"
const val REQUEST_URI = "request_uri"
const val CODE_CHALLENGE_METHOD = "code_challenge_method"
const val CODE_CHALLENGE_METHOD_VAL = "S256"
}
114 changes: 58 additions & 56 deletions samples/auth-demo/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,67 +1,69 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
/*
* Copyright (C) 1936. Uber Technologies
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
}

android {
namespace = "com.ubercab.presidio.auth_demo"
compileSdk = 34
namespace = "com.ubercab.presidio.auth_demo"
compileSdk = 34

defaultConfig {
applicationId = "com.ubercab.presidio.auth_demo"
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "1.0"
defaultConfig {
applicationId = "com.ubercab.presidio.auth_demo"
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { useSupportLibrary = true }
}

buildTypes {
getByName("debug") { matchingFallbacks += listOf("release") }
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.11"
buildTypes {
getByName("debug") { matchingFallbacks += listOf("release") }
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions { jvmTarget = "1.8" }
buildFeatures { compose = true }
composeOptions { kotlinCompilerExtensionVersion = "1.5.11" }
}

dependencies {

implementation(libs.core.ktx)
implementation(libs.lifecycle.runtime.ktx)
implementation(libs.activity.compose)
implementation(platform(libs.compose.bom))
implementation(libs.ui)
implementation(libs.ui.graphics)
implementation(libs.ui.tooling.preview)
implementation(libs.material3)
implementation(project(":authentication"))
testImplementation(libs.junit.junit)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.test.espresso.espresso.core)
androidTestImplementation(platform(libs.compose.bom))
androidTestImplementation(libs.ui.test.junit4)
debugImplementation(libs.ui.tooling)
debugImplementation(libs.ui.test.manifest)
}
implementation(libs.core.ktx)
implementation(libs.lifecycle.runtime.ktx)
implementation(libs.activity.compose)
implementation(platform(libs.compose.bom))
implementation(libs.ui)
implementation(libs.ui.graphics)
implementation(libs.ui.tooling.preview)
implementation(libs.material3)
implementation(project(":authentication"))
testImplementation(libs.junit.junit)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.test.espresso.espresso.core)
androidTestImplementation(platform(libs.compose.bom))
androidTestImplementation(libs.ui.test.junit4)
debugImplementation(libs.ui.tooling)
debugImplementation(libs.ui.test.manifest)
}
Loading

0 comments on commit dbd7224

Please sign in to comment.