Skip to content

Commit

Permalink
Lint kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
ForceTower committed Apr 13, 2024
1 parent f2a8584 commit caba046
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.preference.PreferenceManager
import com.forcetower.core.lifecycle.Event
import com.google.android.gms.games.AchievementsClient
import com.google.android.gms.games.GamesClient
import com.google.android.gms.games.GamesSignInClient
import com.google.android.gms.games.PlayGames
import kotlinx.coroutines.tasks.await


class GooglePlayGamesInstance(
private val activity: Activity
) : ContextWrapper(activity) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/forcetower/uefs/UApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class UApplication : Application(), Configuration.Provider {
}
super.onCreate()

PlayGamesSdk.initialize(this);
PlayGamesSdk.initialize(this)
setupDayNightTheme(this)
defineWorker()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ object ActivityScopedModule {
@Provides
fun providePlayGames(activity: Activity): GooglePlayGamesInstance =
GooglePlayGamesInstance(activity)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.preferencesDataStoreFile
import androidx.preference.PreferenceManager
import androidx.room.Room
import com.forcetower.uefs.GooglePlayGamesInstance
import com.forcetower.uefs.core.storage.apidatabase.APIDatabase
import com.forcetower.uefs.core.storage.database.M50TO51
import com.forcetower.uefs.core.storage.database.M51TO52
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ data class SimplifiedPublicKey(

data class PasskeyAssert(
val publicKey: SimplifiedPublicKey
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ data class PublicKey(

data class PasskeyRegister(
val publicKey: PublicKey
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.forcetower.uefs.core.model.edge.RegisterPasskeyStart
import com.forcetower.uefs.core.model.unes.AccessToken
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.POST

interface EdgeService {
Expand All @@ -22,4 +21,4 @@ interface EdgeService {

@POST("passkeys/register/finish")
suspend fun registerPasskeyFinish(@Body data: RegisterPasskeyCredential)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ class EdgeAuthRepository @Inject constructor(
suspend fun registerFinish(flowId: String, credential: String) {
return service.registerPasskeyFinish(RegisterPasskeyCredential(flowId, credential))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ class CompleteAssertionUseCase @Inject constructor(
Timber.d("Credential: $response")
auth.completeAssertion(flowId, response)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ class RegisterPasskeyUseCase @Inject constructor(
suspend fun finish(flowId: String, credential: String) {
return edge.registerFinish(flowId, credential)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ class StartAssertionUseCase @Inject constructor(
val parsed = gson.fromJson(data.challenge, PasskeyAssert::class.java)
return data.copy(challenge = gson.toJson(parsed.publicKey))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LoginFormViewModel @Inject constructor(
runCatching {
val data = registerPasskey.start()
_register.value = data
}.onFailure {
}.onFailure {
Timber.e(it, "Failed to request challenge")
}
}
Expand Down Expand Up @@ -71,4 +71,4 @@ class LoginFormViewModel @Inject constructor(
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ package com.forcetower.uefs.feature.login

import android.content.SharedPreferences
import android.os.Bundle
import android.util.Patterns
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -70,7 +69,6 @@ class LoginFragment : UFragment() {
allowOnlyUEFS()
return FragmentLoginFormBinding.inflate(inflater, container, false).also {
binding = it
Patterns.EMAIL_ADDRESS
binding.btnInstitution.setOnClickListener {
showInstitutionSelector()
}
Expand Down Expand Up @@ -114,7 +112,7 @@ class LoginFragment : UFragment() {
request = request,
)
handlePasskeyRegistrationResult(result, start)
} catch (e : CreateCredentialException) {
} catch (e: CreateCredentialException) {
Timber.e(e, "Failed to create passkey")
showSnack("Não foi possível recuperar credenciais.")
}
Expand Down Expand Up @@ -150,7 +148,7 @@ class LoginFragment : UFragment() {
request = request
)
onCredentialSignInCompleted(result)
} catch (e : GetCredentialException) {
} catch (e: GetCredentialException) {
Timber.e(e, "Failed to get credentials")
showSnack("Não foi possível recuperar credenciais.")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,11 @@

package com.forcetower.uefs.feature.shared

import android.content.Intent
import android.os.Bundle
import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.StringRes
import com.forcetower.uefs.GooglePlayGamesInstance
import com.forcetower.uefs.PLAY_GAMES_ACHIEVEMENTS
import com.forcetower.uefs.PLAY_GAMES_SIGN_IN
import com.forcetower.uefs.R
import com.google.android.gms.auth.api.signin.GoogleSignIn
import com.google.android.gms.auth.api.signin.GoogleSignInAccount
import com.google.android.gms.auth.api.signin.GoogleSignInStatusCodes.SIGN_IN_CANCELLED
import com.google.android.gms.auth.api.signin.GoogleSignInStatusCodes.SIGN_IN_CURRENTLY_IN_PROGRESS
import com.google.android.gms.common.ConnectionResult.NETWORK_ERROR
import com.google.android.gms.common.api.ApiException
import com.google.android.material.snackbar.Snackbar
import kotlinx.coroutines.tasks.await
import timber.log.Timber
Expand Down

0 comments on commit caba046

Please sign in to comment.