Initial version -- added millennium read funcionality

This commit is contained in:
Pablo
2026-03-09 22:05:28 +01:00
commit 77c2ded482
2770 changed files with 141927 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
+3
View File
@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
</component>
</project>
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AppInsightsSettings">
<option name="tabSettings">
<map>
<entry key="Firebase Crashlytics">
<value>
<InsightsFilterSettings>
<option name="connection">
<ConnectionSetting>
<option name="appId" value="PLACEHOLDER" />
<option name="mobileSdkAppId" value="" />
<option name="projectId" value="" />
<option name="projectNumber" value="" />
</ConnectionSetting>
</option>
<option name="signal" value="SIGNAL_UNSPECIFIED" />
<option name="timeIntervalDays" value="THIRTY_DAYS" />
<option name="visibilityType" value="ALL" />
</InsightsFilterSettings>
</value>
</entry>
</map>
</option>
</component>
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
</component>
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Ask2AgentMigrationStateService">
<option name="migrationStatus" value="COMPLETED" />
</component>
</project>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
+50
View File
@@ -0,0 +1,50 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewDeviceShouldUseNewSpec" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewParameterProviderOnFirstParameter" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
</profile>
</component>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MarkdownSettings">
<option name="previewPanelProviderInfo">
<ProviderInfo name="Compose (experimental)" className="com.intellij.markdown.compose.preview.ComposePanelProvider" />
</option>
</component>
</project>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
</set>
</option>
</component>
</project>
Generated
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
+173
View File
@@ -0,0 +1,173 @@
# Guía de Instalación y Uso - iTartanas
## 📱 Instalación
### Opción 1: Desde Android Studio
1. Abre el proyecto en Android Studio
2. Conecta tu dispositivo Android via USB o usa un emulador con soporte NFC
3. Haz clic en el botón "Run" (▶️) o presiona `Shift + F10`
4. Selecciona tu dispositivo y espera a que se instale
### Opción 2: Compilar APK
```bash
# Desde la terminal en la raíz del proyecto
.\gradlew assembleDebug
# El APK se generará en:
# app\build\outputs\apk\debug\app-debug.apk
```
Luego puedes transferir el APK a tu dispositivo Android e instalarlo manualmente.
## ✅ Requisitos del Dispositivo
- **Android 7.0 (API 24) o superior**
- **Hardware NFC** (obligatorio)
- **NFC activado** en la configuración del dispositivo
### Cómo activar NFC:
1. Ve a **Configuración****Conexiones** (o **Dispositivos conectados**)
2. Busca la opción **NFC**
3. Activa el interruptor NFC
4. También puedes activar **Android Beam** si está disponible
## 📖 Cómo usar la aplicación
### Paso 1: Abrir la aplicación
Abre iTartanas desde el cajón de aplicaciones. Verás una pantalla con el mensaje:
```
"Acerca tu Tarjeta Millennium al lector NFC"
```
### Paso 2: Acercar la tarjeta
1. Mantén tu **Tarjeta Millennium** cerca del lector NFC de tu dispositivo
2. El lector NFC suele estar en la parte trasera del teléfono, cerca de la cámara
3. Mantén la tarjeta estable durante 1-2 segundos
### Paso 3: Ver los resultados
La aplicación mostrará automáticamente:
-**Número de Tarjeta**: En formato enmascarado (ej: `**** **** 1234 5678`)
- 💰 **Saldo**: En euros con dos decimales (ej: `12.50 €`)
## 🔍 Ubicación del lector NFC
La ubicación del lector NFC varía según el dispositivo:
- **Samsung**: Parte trasera central o superior
- **Google Pixel**: Parte trasera central
- **Xiaomi**: Parte trasera central o superior
- **OnePlus**: Parte trasera cerca de la cámara
💡 **Tip**: Puedes buscar en Internet "ubicación NFC [modelo de tu teléfono]" para encontrar la posición exacta.
## ⚠️ Solución de problemas
### La aplicación no detecta la tarjeta
**Problema**: Al acercar la tarjeta no pasa nada.
**Soluciones**:
1. Verifica que el NFC esté activado en tu dispositivo
2. Asegúrate de acercar la tarjeta a la zona correcta del lector NFC
3. Mantén la tarjeta estable durante al menos 2 segundos
4. Retira cualquier funda metálica o magnética del teléfono
5. Reinicia la aplicación
### Error: "Este dispositivo no tiene NFC"
**Problema**: Tu dispositivo no tiene hardware NFC.
**Solución**: Lamentablemente, necesitas un dispositivo con NFC para usar esta aplicación. Consulta las especificaciones de tu dispositivo.
### Error al leer la tarjeta
**Problema**: La aplicación detecta la tarjeta pero muestra un error.
**Soluciones**:
1. Intenta acercar la tarjeta de nuevo
2. Limpia suavemente la tarjeta con un paño seco
3. Asegúrate de que estás usando una Tarjeta Millennium válida
4. Verifica que la tarjeta no esté dañada
5. Intenta en una zona con menos interferencias electromagnéticas
### "Por favor, activa el NFC en configuración"
**Problema**: El NFC está desactivado.
**Solución**: Ve a Configuración → Conexiones → NFC y actívalo.
## 📊 Información mostrada
### Número de Tarjeta
- Formato: 16 dígitos en grupos de 4
- Los primeros 8 dígitos están enmascarados con asteriscos (*)
- Ejemplo: `**** **** 1234 5678`
### Saldo
- Formato: Euros con 2 decimales
- Ejemplo: `15.75 €`
- Se obtiene directamente del chip de la tarjeta
## 🔒 Privacidad y Seguridad
- ✅ La aplicación **NO** envía datos a Internet
-**NO** guarda información de tu tarjeta
- ✅ Solo lee los datos visibles en el chip NFC
- ✅ No puede modificar el saldo ni los datos de la tarjeta
- ✅ El número de tarjeta se enmascara parcialmente por seguridad
## 🛠️ Desarrollo
### Compilar desde código fuente
```bash
# Clonar el repositorio (si aplica)
git clone [URL_del_repositorio]
cd iTartanas
# Compilar
.\gradlew build
# Ejecutar tests
.\gradlew test
# Instalar en dispositivo conectado
.\gradlew installDebug
```
### Dependencias principales
- Kotlin 2.1.0
- Jetpack Compose BOM
- Material 3
- Lifecycle Runtime KTX
- Android NFC API
## 📞 Soporte
Si encuentras algún problema o tienes sugerencias, por favor:
1. Verifica que tu tarjeta Millennium sea compatible
2. Asegúrate de tener la última versión de la aplicación
3. Revisa la sección de solución de problemas de este documento
## 📝 Notas adicionales
- La aplicación solo funciona con **Tarjetas Millennium** del sistema de transporte público
- No funcionará con otras tarjetas NFC (tarjetas bancarias, pases de acceso, etc.)
- La lectura es de solo lectura, no puede modificar el saldo
- Los datos se leen en tiempo real desde el chip de la tarjeta
---
**Versión**: 1.0
**Última actualización**: Marzo 2026
+95
View File
@@ -0,0 +1,95 @@
# iTartanas - Lector de Tarjeta Millennium
Aplicación Android para leer tarjetas Millennium del sistema de transporte público mediante NFC.
## Características
**Lectura de número de tarjeta**: Obtiene y muestra el número completo de la Tarjeta Millennium
**Consulta de saldo**: Muestra el saldo actual disponible en la tarjeta
**Interfaz moderna**: Diseño con Material 3 y Jetpack Compose
**Detección automática**: Lee la tarjeta automáticamente al acercarla al dispositivo
## Requisitos
- Dispositivo Android con NFC
- Android 7.0 (API 24) o superior
- NFC activado en el dispositivo
## Funcionalidades implementadas
La aplicación implementa las siguientes funcionalidades basadas en el código original de iTranvias:
1. **Comunicación NFC con protocolo ISO-DEP**
- Selección de red de transporte
- Lectura de entorno
- Lectura de contrato
2. **Procesamiento de datos**
- Decodificación de números de tarjeta BCD a decimal
- Conversión de PAN a IEP según aplicación
- Cálculo de dígito de verificación Luhn
- Enmascaramiento de datos sensibles
- Conversión de saldo de céntimos a euros
3. **Interfaz de usuario**
- Pantalla de espera con instrucciones
- Indicador de progreso durante la lectura
- Visualización de datos: número de tarjeta y saldo
- Manejo de errores con mensajes descriptivos
## Cómo usar
1. Instala la aplicación en tu dispositivo Android
2. Asegúrate de que el NFC esté activado
3. Abre la aplicación iTartanas
4. Acerca tu Tarjeta Millennium al lector NFC del dispositivo
5. La aplicación leerá automáticamente el número de tarjeta y el saldo
## Tecnologías utilizadas
- **Kotlin**: Lenguaje de programación principal
- **Jetpack Compose**: Framework de UI moderna
- **Material 3**: Diseño de interfaz
- **Coroutines**: Manejo de operaciones asíncronas
- **NFC Android API**: Comunicación con tarjetas NFC/ISO-DEP
## Estructura del proyecto
```
app/src/main/java/com/pjpmosteiro/itartanas/
├── MainActivity.kt # Actividad principal con UI
├── nfc/
│ └── CardRepositoryImpl.kt # Lógica de lectura NFC y procesamiento
└── ui/theme/ # Tema de la aplicación
```
## Permisos
La aplicación requiere los siguientes permisos:
- `android.permission.NFC`: Para acceder al hardware NFC
- `android.hardware.nfc`: Hardware NFC requerido
## Notas técnicas
### Protocolo de comunicación
La aplicación utiliza comandos APDU para comunicarse con la tarjeta:
1. **SELECT Transport Network** (0x80 0x26 0x4F 0x11 0x0A)
2. **READ Environment** (0x80 0x32 0x00 0x00 0x18)
3. **READ Contract** (0x80 0x2E 0x01 0x00 0x20)
### Formato de datos
- **Número de tarjeta**: 16 dígitos formateados en grupos de 4
- **Saldo**: Almacenado en 3 bytes (big-endian) en céntimos, convertido a euros
## Créditos
Basado en el análisis del código decompilado de la aplicación iTranvias original.
## Licencia
Este proyecto es de código abierto para fines educativos y de aprendizaje.
+1
View File
@@ -0,0 +1 @@
/build
+58
View File
@@ -0,0 +1,58 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.compose)
}
android {
namespace = "com.pjpmosteiro.itartanas"
compileSdk {
version = release(36) {
minorApiLevel = 1
}
}
defaultConfig {
applicationId = "com.pjpmosteiro.itartanas"
minSdk = 24
targetSdk = 36
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
buildFeatures {
compose = true
}
}
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material3)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.ui.test.manifest)
}
+21
View File
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
@@ -0,0 +1,24 @@
package com.pjpmosteiro.itartanas
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.pjpmosteiro.itartanas", appContext.packageName)
}
}
+41
View File
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.NFC" />
<uses-feature
android:name="android.hardware.nfc"
android:required="true" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ITartanas">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/Theme.ITartanas">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
</intent-filter>
<meta-data
android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
</activity>
</application>
</manifest>
@@ -0,0 +1,282 @@
package com.pjpmosteiro.itartanas
import android.app.PendingIntent
import android.content.Intent
import android.nfc.NfcAdapter
import android.nfc.Tag
import android.os.Bundle
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.*
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.lifecycle.lifecycleScope
import com.pjpmosteiro.itartanas.nfc.CardData
import com.pjpmosteiro.itartanas.nfc.CardRepositoryImpl
import com.pjpmosteiro.itartanas.ui.theme.ITartanasTheme
import kotlinx.coroutines.launch
import java.util.Locale
class MainActivity : ComponentActivity() {
private var nfcAdapter: NfcAdapter? = null
private var pendingIntent: PendingIntent? = null
private val cardRepository = CardRepositoryImpl()
private var cardData by mutableStateOf<CardData?>(null)
private var isReading by mutableStateOf(false)
private var errorMessage by mutableStateOf<String?>(null)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Inicializar NFC
nfcAdapter = NfcAdapter.getDefaultAdapter(this)
if (nfcAdapter == null) {
Toast.makeText(this, "Este dispositivo no tiene NFC", Toast.LENGTH_LONG).show()
} else if (nfcAdapter?.isEnabled == false) {
Toast.makeText(this, "Por favor, activa el NFC en configuración", Toast.LENGTH_LONG).show()
}
val intent = Intent(this, javaClass).apply {
addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
}
pendingIntent = PendingIntent.getActivity(
this, 0, intent,
PendingIntent.FLAG_MUTABLE
)
enableEdgeToEdge()
setContent {
ITartanasTheme {
CardReaderScreen(
cardData = cardData,
isReading = isReading,
errorMessage = errorMessage
)
}
}
// Procesar intent si viene de NFC
handleIntent(intent)
}
override fun onResume() {
super.onResume()
nfcAdapter?.enableForegroundDispatch(this, pendingIntent, null, null)
}
override fun onPause() {
super.onPause()
nfcAdapter?.disableForegroundDispatch(this)
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
handleIntent(intent)
}
private fun handleIntent(intent: Intent) {
if (NfcAdapter.ACTION_TECH_DISCOVERED == intent.action ||
NfcAdapter.ACTION_TAG_DISCOVERED == intent.action) {
val tag: Tag? = if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.TIRAMISU) {
intent.getParcelableExtra(NfcAdapter.EXTRA_TAG, Tag::class.java)
} else {
@Suppress("DEPRECATION")
intent.getParcelableExtra(NfcAdapter.EXTRA_TAG)
}
if (tag != null) {
readCard(tag)
}
}
}
private fun readCard(tag: Tag) {
isReading = true
errorMessage = null
lifecycleScope.launch {
try {
val result = cardRepository.getCard(tag)
result.onSuccess { data ->
cardData = data
errorMessage = null
}.onFailure { error ->
errorMessage = "Error al leer la tarjeta: ${error.message}"
Toast.makeText(
this@MainActivity,
errorMessage,
Toast.LENGTH_LONG
).show()
}
} catch (e: Exception) {
errorMessage = "Error inesperado: ${e.message}"
Toast.makeText(
this@MainActivity,
errorMessage,
Toast.LENGTH_LONG
).show()
} finally {
isReading = false
}
}
}
}
@Composable
fun CardReaderScreen(
cardData: CardData?,
isReading: Boolean,
errorMessage: String?
) {
Scaffold(
modifier = Modifier.fillMaxSize()
) { innerPadding ->
Column(
modifier = Modifier
.fillMaxSize()
.padding(innerPadding)
.padding(24.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Text(
text = "Lector de Tarjeta Millennium",
fontSize = 24.sp,
fontWeight = FontWeight.Bold,
textAlign = TextAlign.Center,
modifier = Modifier.padding(bottom = 32.dp)
)
when {
isReading -> {
CircularProgressIndicator(
modifier = Modifier
.size(64.dp)
.padding(bottom = 16.dp)
)
Text("Leyendo tarjeta...")
}
cardData != null -> {
Card(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 16.dp),
elevation = CardDefaults.cardElevation(defaultElevation = 4.dp)
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(24.dp)
) {
Text(
text = "Número de Tarjeta",
fontSize = 14.sp,
color = MaterialTheme.colorScheme.secondary
)
Text(
text = cardData.id,
fontSize = 20.sp,
fontWeight = FontWeight.Bold,
modifier = Modifier.padding(top = 4.dp, bottom = 16.dp)
)
HorizontalDivider(modifier = Modifier.padding(vertical = 8.dp))
Text(
text = "Saldo",
fontSize = 14.sp,
color = MaterialTheme.colorScheme.secondary
)
Text(
text = if (cardData.balance != null) {
String.format(Locale.getDefault(), "%.2f €", cardData.balance)
} else {
"No disponible"
},
fontSize = 28.sp,
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.primary,
modifier = Modifier.padding(top = 4.dp)
)
}
}
Text(
text = "✓ Tarjeta leída correctamente",
color = MaterialTheme.colorScheme.primary,
modifier = Modifier.padding(top = 16.dp)
)
}
errorMessage != null -> {
Card(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 16.dp),
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.errorContainer
)
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(24.dp)
) {
Text(
text = "Error",
fontSize = 16.sp,
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.error
)
Text(
text = errorMessage,
fontSize = 14.sp,
color = MaterialTheme.colorScheme.onErrorContainer,
modifier = Modifier.padding(top = 8.dp)
)
}
}
}
else -> {
Icon(
painter = androidx.compose.ui.res.painterResource(
android.R.drawable.ic_dialog_info
),
contentDescription = "NFC Icon",
modifier = Modifier
.size(120.dp)
.padding(bottom = 24.dp),
tint = MaterialTheme.colorScheme.primary
)
Text(
text = "Acerca tu Tarjeta Millennium al lector NFC",
fontSize = 16.sp,
textAlign = TextAlign.Center,
modifier = Modifier.padding(bottom = 8.dp)
)
Text(
text = "La app leerá automáticamente el número de tarjeta y el saldo",
fontSize = 14.sp,
textAlign = TextAlign.Center,
color = MaterialTheme.colorScheme.secondary
)
}
}
}
}
}
@@ -0,0 +1,165 @@
package com.pjpmosteiro.itartanas.nfc
import android.nfc.Tag
import android.nfc.tech.IsoDep
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
data class CardData(
val id: String,
val balance: Double? = null,
val lastOperation: String? = null
)
class CardRepositoryImpl(
private val dispatcher: CoroutineDispatcher = Dispatchers.IO
) {
suspend fun getCard(tag: Tag): Result<CardData> = withContext(dispatcher) {
try {
val isoDep = IsoDep.get(tag)
isoDep.connect()
// Seleccionar red de transporte
val transportNetworkResponse = selectTransportNetwork(isoDep)
// Leer entorno
readEnvironment(isoDep)
// Leer contrato
val contract = readContract(isoDep)
// Obtener ID de tarjeta
val cardId = getCardId(transportNetworkResponse)
// Obtener saldo (bytes 29-31, 3 bytes, big endian, en céntimos)
val balance = toIntBigEndian(contract, 29, 3) / 100.0
isoDep.close()
Result.success(CardData(cardId, balance))
} catch (e: Exception) {
Result.failure(e)
}
}
private fun getCardId(transportNetworkResponse: ByteArray): String {
val bArrSliceArray = transportNetworkResponse.sliceArray(2 until transportNetworkResponse.size - 2)
var strBcdToDecString = bcdToDecString(bArrSliceArray)
val strSubstring = strBcdToDecString.substring(6, 8)
val str = when {
strSubstring == "04" || !strBcdToDecString.startsWith("987020") -> {
if (strSubstring != "04") "00" else null
}
else -> "01"
}
if (str != null) {
val strPanToIep = panToIep(bArrSliceArray, str)
if (strPanToIep != null) {
strBcdToDecString = strPanToIep
}
}
return groupEvery(maskFirstNChars(strBcdToDecString, 8), 4)
}
private fun selectTransportNetwork(isoDep: IsoDep): ByteArray {
return sendApdu(isoDep, byteArrayOf(0x80.toByte(), 0x26, 0x4F, 0x11, 0x0A), 12)
}
private fun readEnvironment(isoDep: IsoDep): ByteArray {
return sendApdu(isoDep, byteArrayOf(0x80.toByte(), 0x32, 0x00, 0x00, 0x18), 26)
}
private fun readContract(isoDep: IsoDep): ByteArray {
return sendApdu(isoDep, byteArrayOf(0x80.toByte(), 0x2E, 0x01, 0x00, 0x20), 34)
}
private fun sendApdu(isoDep: IsoDep, command: ByteArray, responseSize: Int, statusWord: String = "9000"): ByteArray {
val response = isoDep.transceive(command)
requireSize(response, responseSize)
requireStatusWord(response, statusWord)
return response
}
private fun requireSize(response: ByteArray, size: Int) {
if (response.size != size) {
throw IllegalArgumentException("APDU response size error: expected $size bytes but was ${response.size}")
}
}
private fun requireStatusWord(response: ByteArray, statusWord: String) {
val sw = String.format("%02X%02X", response[response.size - 2], response[response.size - 1])
if (statusWord != sw) {
throw IllegalArgumentException("APDU error: expected status word $statusWord but was $sw")
}
}
private fun toIntBigEndian(arr: ByteArray, offset: Int, length: Int): Int {
if (offset < 0 || offset + length > arr.size) {
throw IllegalArgumentException("Array too small: need $length bytes at offset $offset but size is ${arr.size}")
}
var result = 0
for (i in 0 until length) {
result = (result shl 8) or (arr[offset + i].toInt() and 0xFF)
}
return result
}
private fun bcdToDecString(arr: ByteArray): String {
if (arr.size != 8) {
throw IllegalArgumentException("8 BCD bytes were expected from PAN, but they were ${arr.size}")
}
return arr.joinToString("") { byte ->
val i = byte.toInt() and 0xFF
val high = i ushr 4
val low = byte.toInt() and 0x0F
if (high >= 10 || low >= 10) {
throw IllegalArgumentException("Byte is not valid BCD: ${String.format("%02X", i)}")
}
"$high$low"
}
}
private fun panToIep(arr: ByteArray, apli: String): String? {
if (apli.length != 2) {
throw IllegalArgumentException("Apli must have exactly 2 characters")
}
val pan16 = bcdToDecString(arr).padEnd(16, '0')
val result = pan16.substring(0, 6) + apli + pan16.substring(8, 15) + "0"
val partial = result.substring(0, 15)
return partial + luhnCheckDigit(result)
}
private fun luhnCheckDigit(str: String): Char {
var sum = 0
var i = 0
str.forEach { char ->
i++
var digit = char.digitToInt()
if (i % 2 == (str.length + 1) % 2) {
digit *= 2
}
if (digit > 9) {
digit -= 9
}
sum += digit
}
return ((10 - (sum % 10)) % 10).digitToChar()
}
private fun maskFirstNChars(str: String, n: Int): String {
if (str.length <= n) {
return "*".repeat(str.length)
}
return "*".repeat(n) + str.substring(n)
}
private fun groupEvery(str: String, n: Int, separator: String = " "): String {
return str.chunked(n).joinToString(separator)
}
}
@@ -0,0 +1,11 @@
package com.pjpmosteiro.itartanas.ui.theme
import androidx.compose.ui.graphics.Color
val Purple80 = Color(0xFFD0BCFF)
val PurpleGrey80 = Color(0xFFCCC2DC)
val Pink80 = Color(0xFFEFB8C8)
val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71)
val Pink40 = Color(0xFF7D5260)
@@ -0,0 +1,58 @@
package com.pjpmosteiro.itartanas.ui.theme
import android.app.Activity
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
private val DarkColorScheme = darkColorScheme(
primary = Purple80,
secondary = PurpleGrey80,
tertiary = Pink80
)
private val LightColorScheme = lightColorScheme(
primary = Purple40,
secondary = PurpleGrey40,
tertiary = Pink40
/* Other default colors to override
background = Color(0xFFFFFBFE),
surface = Color(0xFFFFFBFE),
onPrimary = Color.White,
onSecondary = Color.White,
onTertiary = Color.White,
onBackground = Color(0xFF1C1B1F),
onSurface = Color(0xFF1C1B1F),
*/
)
@Composable
fun ITartanasTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
// Dynamic color is available on Android 12+
dynamicColor: Boolean = true,
content: @Composable () -> Unit
) {
val colorScheme = when {
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
val context = LocalContext.current
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
}
darkTheme -> DarkColorScheme
else -> LightColorScheme
}
MaterialTheme(
colorScheme = colorScheme,
typography = Typography,
content = content
)
}
@@ -0,0 +1,34 @@
package com.pjpmosteiro.itartanas.ui.theme
import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp
// Set of Material typography styles to start with
val Typography = Typography(
bodyLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.5.sp
)
/* Other default text styles to override
titleLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 22.sp,
lineHeight = 28.sp,
letterSpacing = 0.sp
),
labelSmall = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Medium,
fontSize = 11.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp
)
*/
)
@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
@@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
+3
View File
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">iTartanas</string>
</resources>
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.ITartanas" parent="android:Theme.Material.Light.NoActionBar" />
</resources>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older than API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<tech-list>
<tech>android.nfc.tech.IsoDep</tech>
</tech-list>
</resources>
@@ -0,0 +1,17 @@
package com.pjpmosteiro.itartanas
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
+5
View File
@@ -0,0 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.compose) apply false
}
+15
View File
@@ -0,0 +1,15 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
# org.gradle.parallel=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
+12
View File
@@ -0,0 +1,12 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ec7520a1e057cd116f9544c42142a16b/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/4c4f879899012ff0a8b2e2117df03b0e/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ec7520a1e057cd116f9544c42142a16b/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/4c4f879899012ff0a8b2e2117df03b0e/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/73bcfb608d1fde9fb62e462f834a3299/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/846ee0d876d26a26f37aa1ce8de73224/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ec7520a1e057cd116f9544c42142a16b/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/4c4f879899012ff0a8b2e2117df03b0e/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9482ddec596298c84656d31d16652665/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/39701d92e1756bb2f141eb67cd4c660e/redirect
toolchainVersion=21
+31
View File
@@ -0,0 +1,31 @@
[versions]
agp = "9.1.0"
coreKtx = "1.10.1"
junit = "4.13.2"
junitVersion = "1.1.5"
espressoCore = "3.5.1"
lifecycleRuntimeKtx = "2.6.1"
activityCompose = "1.8.0"
kotlin = "2.2.10"
composeBom = "2024.09.00"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
Binary file not shown.
+9
View File
@@ -0,0 +1,9 @@
#Mon Mar 09 21:52:02 CET 2026
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=b266d5ff6b90eada6dc3b20cb090e3731302e553a27c5d3e4df1f0d76beaff06
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+251
View File
@@ -0,0 +1,251 @@
#!/bin/sh
#
# Copyright © 2015 the original authors.
#
# 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.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
Vendored
+94
View File
@@ -0,0 +1,94 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@@ -0,0 +1,20 @@
package com.google.android.gms.actions;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class ItemListIntents {
public static final String ACTION_ACCEPT_ITEM = "com.google.android.gms.actions.ACCEPT_ITEM";
public static final String ACTION_APPEND_ITEM_LIST = "com.google.android.gms.actions.APPEND_ITEM_LIST";
public static final String ACTION_CREATE_ITEM_LIST = "com.google.android.gms.actions.CREATE_ITEM_LIST";
public static final String ACTION_DELETE_ITEM = "com.google.android.gms.actions.DELETE_ITEM";
public static final String ACTION_DELETE_ITEM_LIST = "com.google.android.gms.actions.DELETE_ITEM_LIST";
public static final String ACTION_REJECT_ITEM = "com.google.android.gms.actions.REJECT_ITEM";
public static final String EXTRA_ITEM_NAME = "com.google.android.gms.actions.extra.ITEM_NAME";
public static final String EXTRA_ITEM_NAMES = "com.google.android.gms.actions.extra.ITEM_NAMES";
public static final String EXTRA_ITEM_QUERY = "com.google.android.gms.actions.extra.ITEM_QUERY";
public static final String EXTRA_LIST_NAME = "com.google.android.gms.actions.extra.LIST_NAME";
public static final String EXTRA_LIST_QUERY = "com.google.android.gms.actions.extra.LIST_QUERY";
private ItemListIntents() {
}
}
@@ -0,0 +1,15 @@
package com.google.android.gms.actions;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class NoteIntents {
public static final String ACTION_APPEND_NOTE = "com.google.android.gms.actions.APPEND_NOTE";
public static final String ACTION_CREATE_NOTE = "com.google.android.gms.actions.CREATE_NOTE";
public static final String ACTION_DELETE_NOTE = "com.google.android.gms.actions.DELETE_NOTE";
public static final String EXTRA_NAME = "com.google.android.gms.actions.extra.NAME";
public static final String EXTRA_NOTE_QUERY = "com.google.android.gms.actions.extra.NOTE_QUERY";
public static final String EXTRA_TEXT = "com.google.android.gms.actions.extra.TEXT";
private NoteIntents() {
}
}
@@ -0,0 +1,10 @@
package com.google.android.gms.actions;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class ReserveIntents {
public static final String ACTION_RESERVE_TAXI_RESERVATION = "com.google.android.gms.actions.RESERVE_TAXI_RESERVATION";
private ReserveIntents() {
}
}
@@ -0,0 +1,11 @@
package com.google.android.gms.actions;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class SearchIntents {
public static final String ACTION_SEARCH = "com.google.android.gms.actions.SEARCH_ACTION";
public static final String EXTRA_QUERY = "query";
private SearchIntents() {
}
}
@@ -0,0 +1,259 @@
package com.google.android.gms.auth.api.signin;
import android.accounts.Account;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import androidx.collection.ArraySet;
import com.google.android.gms.common.api.Scope;
import com.google.android.gms.common.internal.AccountType;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.internal.ReflectedParcelable;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
import com.google.android.gms.common.util.Clock;
import com.google.android.gms.common.util.DefaultClock;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
@Deprecated
public class GoogleSignInAccount extends AbstractSafeParcelable implements ReflectedParcelable {
public static final Parcelable.Creator<GoogleSignInAccount> CREATOR = new zab();
public static final Clock zaa = DefaultClock.getInstance();
final int zab;
final List zac;
private final String zad;
private final String zae;
private final String zaf;
private final String zag;
private final Uri zah;
private String zai;
private final long zaj;
private final String zak;
private final String zal;
private final String zam;
private final Set zan = new HashSet();
GoogleSignInAccount(int i, String str, String str2, String str3, String str4, Uri uri, String str5, long j, String str6, List list, String str7, String str8) {
this.zab = i;
this.zad = str;
this.zae = str2;
this.zaf = str3;
this.zag = str4;
this.zah = uri;
this.zai = str5;
this.zaj = j;
this.zak = str6;
this.zac = list;
this.zal = str7;
this.zam = str8;
}
public static GoogleSignInAccount createDefault() {
return zae(new Account("<<default account>>", AccountType.GOOGLE), new HashSet());
}
public static GoogleSignInAccount fromAccount(Account account) {
return zae(account, new ArraySet());
}
public static GoogleSignInAccount fromAccountAndScopes(Account account, Scope scope, Scope... scopeArr) {
Preconditions.checkNotNull(account);
Preconditions.checkNotNull(scope);
HashSet hashSet = new HashSet();
hashSet.add(scope);
hashSet.addAll(Arrays.asList(scopeArr));
return zae(account, hashSet);
}
public static GoogleSignInAccount zaa(String str, String str2, String str3, String str4, String str5, String str6, Uri uri, Long l, String str7, Set set) {
return new GoogleSignInAccount(3, str, str2, str3, str4, uri, null, l.longValue(), Preconditions.checkNotEmpty(str7), new ArrayList((Collection) Preconditions.checkNotNull(set)), str5, str6);
}
public static GoogleSignInAccount zab(String str) throws JSONException {
if (TextUtils.isEmpty(str)) {
return null;
}
JSONObject jSONObject = new JSONObject(str);
String strOptString = jSONObject.optString("photoUrl");
Uri uri = !TextUtils.isEmpty(strOptString) ? Uri.parse(strOptString) : null;
long j = Long.parseLong(jSONObject.getString("expirationTime"));
HashSet hashSet = new HashSet();
JSONArray jSONArray = jSONObject.getJSONArray("grantedScopes");
int length = jSONArray.length();
for (int i = 0; i < length; i++) {
hashSet.add(new Scope(jSONArray.getString(i)));
}
GoogleSignInAccount googleSignInAccountZaa = zaa(jSONObject.optString("id"), jSONObject.has("tokenId") ? jSONObject.optString("tokenId") : null, jSONObject.has("email") ? jSONObject.optString("email") : null, jSONObject.has("displayName") ? jSONObject.optString("displayName") : null, jSONObject.has("givenName") ? jSONObject.optString("givenName") : null, jSONObject.has("familyName") ? jSONObject.optString("familyName") : null, uri, Long.valueOf(j), jSONObject.getString("obfuscatedIdentifier"), hashSet);
googleSignInAccountZaa.zai = jSONObject.has("serverAuthCode") ? jSONObject.optString("serverAuthCode") : null;
return googleSignInAccountZaa;
}
private static GoogleSignInAccount zae(Account account, Set set) {
return zaa(null, null, account.name, null, null, null, null, 0L, account.name, set);
}
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (!(obj instanceof GoogleSignInAccount)) {
return false;
}
GoogleSignInAccount googleSignInAccount = (GoogleSignInAccount) obj;
return googleSignInAccount.zak.equals(this.zak) && googleSignInAccount.getRequestedScopes().equals(getRequestedScopes());
}
public Account getAccount() {
String str = this.zaf;
if (str == null) {
return null;
}
return new Account(str, AccountType.GOOGLE);
}
public String getDisplayName() {
return this.zag;
}
public String getEmail() {
return this.zaf;
}
public String getFamilyName() {
return this.zam;
}
public String getGivenName() {
return this.zal;
}
public Set<Scope> getGrantedScopes() {
return new HashSet(this.zac);
}
public String getId() {
return this.zad;
}
public String getIdToken() {
return this.zae;
}
public Uri getPhotoUrl() {
return this.zah;
}
public Set<Scope> getRequestedScopes() {
HashSet hashSet = new HashSet(this.zac);
hashSet.addAll(this.zan);
return hashSet;
}
public String getServerAuthCode() {
return this.zai;
}
public int hashCode() {
return ((this.zak.hashCode() + 527) * 31) + getRequestedScopes().hashCode();
}
public boolean isExpired() {
return zaa.currentTimeMillis() / 1000 >= this.zaj + (-300);
}
public GoogleSignInAccount requestExtraScopes(Scope... scopeArr) {
if (scopeArr != null) {
Collections.addAll(this.zan, scopeArr);
}
return this;
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
SafeParcelWriter.writeInt(parcel, 1, this.zab);
SafeParcelWriter.writeString(parcel, 2, getId(), false);
SafeParcelWriter.writeString(parcel, 3, getIdToken(), false);
SafeParcelWriter.writeString(parcel, 4, getEmail(), false);
SafeParcelWriter.writeString(parcel, 5, getDisplayName(), false);
SafeParcelWriter.writeParcelable(parcel, 6, getPhotoUrl(), i, false);
SafeParcelWriter.writeString(parcel, 7, getServerAuthCode(), false);
SafeParcelWriter.writeLong(parcel, 8, this.zaj);
SafeParcelWriter.writeString(parcel, 9, this.zak, false);
SafeParcelWriter.writeTypedList(parcel, 10, this.zac, false);
SafeParcelWriter.writeString(parcel, 11, getGivenName(), false);
SafeParcelWriter.writeString(parcel, 12, getFamilyName(), false);
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
}
public final String zac() {
return this.zak;
}
public final String zad() {
JSONObject jSONObject = new JSONObject();
try {
if (getId() != null) {
jSONObject.put("id", getId());
}
if (getIdToken() != null) {
jSONObject.put("tokenId", getIdToken());
}
if (getEmail() != null) {
jSONObject.put("email", getEmail());
}
if (getDisplayName() != null) {
jSONObject.put("displayName", getDisplayName());
}
if (getGivenName() != null) {
jSONObject.put("givenName", getGivenName());
}
if (getFamilyName() != null) {
jSONObject.put("familyName", getFamilyName());
}
Uri photoUrl = getPhotoUrl();
if (photoUrl != null) {
jSONObject.put("photoUrl", photoUrl.toString());
}
if (getServerAuthCode() != null) {
jSONObject.put("serverAuthCode", getServerAuthCode());
}
jSONObject.put("expirationTime", this.zaj);
jSONObject.put("obfuscatedIdentifier", this.zak);
JSONArray jSONArray = new JSONArray();
List list = this.zac;
Scope[] scopeArr = (Scope[]) list.toArray(new Scope[list.size()]);
Arrays.sort(scopeArr, new Comparator() { // from class: com.google.android.gms.auth.api.signin.zaa
@Override // java.util.Comparator
public final int compare(Object obj, Object obj2) {
Parcelable.Creator<GoogleSignInAccount> creator = GoogleSignInAccount.CREATOR;
return ((Scope) obj).getScopeUri().compareTo(((Scope) obj2).getScopeUri());
}
});
for (Scope scope : scopeArr) {
jSONArray.put(scope.getScopeUri());
}
jSONObject.put("grantedScopes", jSONArray);
jSONObject.remove("serverAuthCode");
return jSONObject.toString();
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
}
@@ -0,0 +1,418 @@
package com.google.android.gms.auth.api.signin;
import android.accounts.Account;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import com.google.android.gms.auth.api.signin.internal.GoogleSignInOptionsExtensionParcelable;
import com.google.android.gms.auth.api.signin.internal.HashAccumulator;
import com.google.android.gms.common.Scopes;
import com.google.android.gms.common.api.Api;
import com.google.android.gms.common.api.Scope;
import com.google.android.gms.common.internal.AccountType;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.internal.ReflectedParcelable;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
@Deprecated
public class GoogleSignInOptions extends AbstractSafeParcelable implements Api.ApiOptions.Optional, ReflectedParcelable {
public static final Parcelable.Creator<GoogleSignInOptions> CREATOR;
public static final GoogleSignInOptions DEFAULT_GAMES_SIGN_IN;
public static final GoogleSignInOptions DEFAULT_SIGN_IN;
public static final Scope zaa = new Scope(Scopes.PROFILE);
public static final Scope zab = new Scope("email");
public static final Scope zac = new Scope(Scopes.OPEN_ID);
public static final Scope zad;
public static final Scope zae;
private static final Comparator zag;
final int zaf;
private final ArrayList zah;
private Account zai;
private boolean zaj;
private final boolean zak;
private final boolean zal;
private String zam;
private String zan;
private ArrayList zao;
private String zap;
private Map zaq;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
public static final class Builder {
private Set zaa;
private boolean zab;
private boolean zac;
private boolean zad;
private String zae;
private Account zaf;
private String zag;
private Map zah;
private String zai;
public Builder() {
this.zaa = new HashSet();
this.zah = new HashMap();
}
private final String zaa(String str) {
Preconditions.checkNotEmpty(str);
String str2 = this.zae;
boolean z = true;
if (str2 != null && !str2.equals(str)) {
z = false;
}
Preconditions.checkArgument(z, "two different server client ids provided");
return str;
}
public Builder addExtension(GoogleSignInOptionsExtension googleSignInOptionsExtension) {
if (this.zah.containsKey(Integer.valueOf(googleSignInOptionsExtension.getExtensionType()))) {
throw new IllegalStateException("Only one extension per type may be added");
}
List<Scope> impliedScopes = googleSignInOptionsExtension.getImpliedScopes();
if (impliedScopes != null) {
this.zaa.addAll(impliedScopes);
}
this.zah.put(Integer.valueOf(googleSignInOptionsExtension.getExtensionType()), new GoogleSignInOptionsExtensionParcelable(googleSignInOptionsExtension));
return this;
}
public GoogleSignInOptions build() {
if (this.zaa.contains(GoogleSignInOptions.zae) && this.zaa.contains(GoogleSignInOptions.zad)) {
this.zaa.remove(GoogleSignInOptions.zad);
}
if (this.zad && (this.zaf == null || !this.zaa.isEmpty())) {
requestId();
}
return new GoogleSignInOptions(new ArrayList(this.zaa), this.zaf, this.zad, this.zab, this.zac, this.zae, this.zag, this.zah, this.zai);
}
public Builder requestEmail() {
this.zaa.add(GoogleSignInOptions.zab);
return this;
}
public Builder requestId() {
this.zaa.add(GoogleSignInOptions.zac);
return this;
}
public Builder requestIdToken(String str) {
this.zad = true;
zaa(str);
this.zae = str;
return this;
}
public Builder requestProfile() {
this.zaa.add(GoogleSignInOptions.zaa);
return this;
}
public Builder requestScopes(Scope scope, Scope... scopeArr) {
this.zaa.add(scope);
this.zaa.addAll(Arrays.asList(scopeArr));
return this;
}
public Builder requestServerAuthCode(String str) {
requestServerAuthCode(str, false);
return this;
}
public Builder setAccountName(String str) {
this.zaf = new Account(Preconditions.checkNotEmpty(str), AccountType.GOOGLE);
return this;
}
public Builder setHostedDomain(String str) {
this.zag = Preconditions.checkNotEmpty(str);
return this;
}
public Builder setLogSessionId(String str) {
this.zai = str;
return this;
}
public Builder requestServerAuthCode(String str, boolean z) {
this.zab = true;
zaa(str);
this.zae = str;
this.zac = z;
return this;
}
public Builder(GoogleSignInOptions googleSignInOptions) {
this.zaa = new HashSet();
this.zah = new HashMap();
Preconditions.checkNotNull(googleSignInOptions);
this.zaa = new HashSet(googleSignInOptions.zah);
this.zab = googleSignInOptions.zak;
this.zac = googleSignInOptions.zal;
this.zad = googleSignInOptions.zaj;
this.zae = googleSignInOptions.zam;
this.zaf = googleSignInOptions.zai;
this.zag = googleSignInOptions.zan;
this.zah = GoogleSignInOptions.zam(googleSignInOptions.zao);
this.zai = googleSignInOptions.zap;
}
}
static {
Scope scope = new Scope(Scopes.GAMES_LITE);
zad = scope;
zae = new Scope(Scopes.GAMES);
Builder builder = new Builder();
builder.requestId();
builder.requestProfile();
DEFAULT_SIGN_IN = builder.build();
Builder builder2 = new Builder();
builder2.requestScopes(scope, new Scope[0]);
DEFAULT_GAMES_SIGN_IN = builder2.build();
CREATOR = new zae();
zag = new zac();
}
GoogleSignInOptions(int i, ArrayList arrayList, Account account, boolean z, boolean z2, boolean z3, String str, String str2, ArrayList arrayList2, String str3) {
this(i, arrayList, account, z, z2, z3, str, str2, zam(arrayList2), str3);
}
public static GoogleSignInOptions zab(String str) throws JSONException {
if (TextUtils.isEmpty(str)) {
return null;
}
JSONObject jSONObject = new JSONObject(str);
HashSet hashSet = new HashSet();
JSONArray jSONArray = jSONObject.getJSONArray("scopes");
int length = jSONArray.length();
for (int i = 0; i < length; i++) {
hashSet.add(new Scope(jSONArray.getString(i)));
}
String strOptString = jSONObject.has("accountName") ? jSONObject.optString("accountName") : null;
return new GoogleSignInOptions(3, new ArrayList(hashSet), !TextUtils.isEmpty(strOptString) ? new Account(strOptString, AccountType.GOOGLE) : null, jSONObject.getBoolean("idTokenRequested"), jSONObject.getBoolean("serverAuthRequested"), jSONObject.getBoolean("forceCodeForRefreshToken"), jSONObject.has("serverClientId") ? jSONObject.optString("serverClientId") : null, jSONObject.has("hostedDomain") ? jSONObject.optString("hostedDomain") : null, new HashMap(), (String) null);
}
/* JADX INFO: Access modifiers changed from: private */
public static Map zam(List list) {
HashMap map = new HashMap();
if (list != null) {
Iterator it = list.iterator();
while (it.hasNext()) {
GoogleSignInOptionsExtensionParcelable googleSignInOptionsExtensionParcelable = (GoogleSignInOptionsExtensionParcelable) it.next();
map.put(Integer.valueOf(googleSignInOptionsExtensionParcelable.getType()), googleSignInOptionsExtensionParcelable);
}
}
return map;
}
/* JADX WARN: Removed duplicated region for block: B:24:0x0052 A[Catch: ClassCastException -> 0x0090, TryCatch #0 {ClassCastException -> 0x0090, blocks: (B:5:0x0004, B:7:0x000e, B:10:0x0018, B:12:0x0028, B:15:0x0035, B:17:0x0039, B:22:0x004a, B:24:0x0052, B:30:0x006a, B:32:0x0072, B:34:0x007a, B:36:0x0082, B:27:0x005d, B:20:0x0040), top: B:42:0x0004 }] */
/* JADX WARN: Removed duplicated region for block: B:27:0x005d A[Catch: ClassCastException -> 0x0090, TryCatch #0 {ClassCastException -> 0x0090, blocks: (B:5:0x0004, B:7:0x000e, B:10:0x0018, B:12:0x0028, B:15:0x0035, B:17:0x0039, B:22:0x004a, B:24:0x0052, B:30:0x006a, B:32:0x0072, B:34:0x007a, B:36:0x0082, B:27:0x005d, B:20:0x0040), top: B:42:0x0004 }] */
/* JADX WARN: Removed duplicated region for block: B:38:0x008e A[RETURN] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public boolean equals(java.lang.Object r4) {
/*
r3 = this;
r0 = 0
if (r4 != 0) goto L4
return r0
L4:
com.google.android.gms.auth.api.signin.GoogleSignInOptions r4 = (com.google.android.gms.auth.api.signin.GoogleSignInOptions) r4 // Catch: java.lang.ClassCastException -> L90
java.util.ArrayList r1 = r3.zao // Catch: java.lang.ClassCastException -> L90
boolean r1 = r1.isEmpty() // Catch: java.lang.ClassCastException -> L90
if (r1 == 0) goto L90
java.util.ArrayList r1 = r4.zao // Catch: java.lang.ClassCastException -> L90
boolean r1 = r1.isEmpty() // Catch: java.lang.ClassCastException -> L90
if (r1 != 0) goto L18
goto L90
L18:
java.util.ArrayList r1 = r3.zah // Catch: java.lang.ClassCastException -> L90
int r1 = r1.size() // Catch: java.lang.ClassCastException -> L90
java.util.ArrayList r2 = r4.getScopes() // Catch: java.lang.ClassCastException -> L90
int r2 = r2.size() // Catch: java.lang.ClassCastException -> L90
if (r1 != r2) goto L90
java.util.ArrayList r1 = r3.zah // Catch: java.lang.ClassCastException -> L90
java.util.ArrayList r2 = r4.getScopes() // Catch: java.lang.ClassCastException -> L90
boolean r1 = r1.containsAll(r2) // Catch: java.lang.ClassCastException -> L90
if (r1 != 0) goto L35
goto L90
L35:
android.accounts.Account r1 = r3.zai // Catch: java.lang.ClassCastException -> L90
if (r1 != 0) goto L40
android.accounts.Account r1 = r4.getAccount() // Catch: java.lang.ClassCastException -> L90
if (r1 != 0) goto L90
goto L4a
L40:
android.accounts.Account r2 = r4.getAccount() // Catch: java.lang.ClassCastException -> L90
boolean r1 = r1.equals(r2) // Catch: java.lang.ClassCastException -> L90
if (r1 == 0) goto L90
L4a:
java.lang.String r1 = r3.zam // Catch: java.lang.ClassCastException -> L90
boolean r1 = android.text.TextUtils.isEmpty(r1) // Catch: java.lang.ClassCastException -> L90
if (r1 == 0) goto L5d
java.lang.String r1 = r4.getServerClientId() // Catch: java.lang.ClassCastException -> L90
boolean r1 = android.text.TextUtils.isEmpty(r1) // Catch: java.lang.ClassCastException -> L90
if (r1 == 0) goto L90
goto L6a
L5d:
java.lang.String r1 = r3.zam // Catch: java.lang.ClassCastException -> L90
java.lang.String r2 = r4.getServerClientId() // Catch: java.lang.ClassCastException -> L90
boolean r1 = r1.equals(r2) // Catch: java.lang.ClassCastException -> L90
if (r1 != 0) goto L6a
goto L90
L6a:
boolean r1 = r3.zal // Catch: java.lang.ClassCastException -> L90
boolean r2 = r4.isForceCodeForRefreshToken() // Catch: java.lang.ClassCastException -> L90
if (r1 != r2) goto L90
boolean r1 = r3.zaj // Catch: java.lang.ClassCastException -> L90
boolean r2 = r4.isIdTokenRequested() // Catch: java.lang.ClassCastException -> L90
if (r1 != r2) goto L90
boolean r1 = r3.zak // Catch: java.lang.ClassCastException -> L90
boolean r2 = r4.isServerAuthCodeRequested() // Catch: java.lang.ClassCastException -> L90
if (r1 != r2) goto L90
java.lang.String r1 = r3.zap // Catch: java.lang.ClassCastException -> L90
java.lang.String r4 = r4.getLogSessionId() // Catch: java.lang.ClassCastException -> L90
boolean r4 = android.text.TextUtils.equals(r1, r4) // Catch: java.lang.ClassCastException -> L90
if (r4 == 0) goto L90
r4 = 1
return r4
L90:
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.auth.api.signin.GoogleSignInOptions.equals(java.lang.Object):boolean");
}
public Account getAccount() {
return this.zai;
}
public ArrayList<GoogleSignInOptionsExtensionParcelable> getExtensions() {
return this.zao;
}
public String getLogSessionId() {
return this.zap;
}
public Scope[] getScopeArray() {
return (Scope[]) this.zah.toArray(new Scope[this.zah.size()]);
}
public ArrayList<Scope> getScopes() {
return new ArrayList<>(this.zah);
}
public String getServerClientId() {
return this.zam;
}
public int hashCode() {
ArrayList arrayList = new ArrayList();
ArrayList arrayList2 = this.zah;
int size = arrayList2.size();
for (int i = 0; i < size; i++) {
arrayList.add(((Scope) arrayList2.get(i)).getScopeUri());
}
Collections.sort(arrayList);
HashAccumulator hashAccumulator = new HashAccumulator();
hashAccumulator.addObject(arrayList);
hashAccumulator.addObject(this.zai);
hashAccumulator.addObject(this.zam);
hashAccumulator.zaa(this.zal);
hashAccumulator.zaa(this.zaj);
hashAccumulator.zaa(this.zak);
hashAccumulator.addObject(this.zap);
return hashAccumulator.hash();
}
public boolean isForceCodeForRefreshToken() {
return this.zal;
}
public boolean isIdTokenRequested() {
return this.zaj;
}
public boolean isServerAuthCodeRequested() {
return this.zak;
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
int i2 = this.zaf;
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
SafeParcelWriter.writeInt(parcel, 1, i2);
SafeParcelWriter.writeTypedList(parcel, 2, getScopes(), false);
SafeParcelWriter.writeParcelable(parcel, 3, getAccount(), i, false);
SafeParcelWriter.writeBoolean(parcel, 4, isIdTokenRequested());
SafeParcelWriter.writeBoolean(parcel, 5, isServerAuthCodeRequested());
SafeParcelWriter.writeBoolean(parcel, 6, isForceCodeForRefreshToken());
SafeParcelWriter.writeString(parcel, 7, getServerClientId(), false);
SafeParcelWriter.writeString(parcel, 8, this.zan, false);
SafeParcelWriter.writeTypedList(parcel, 9, getExtensions(), false);
SafeParcelWriter.writeString(parcel, 10, getLogSessionId(), false);
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
}
public final String zaf() {
JSONObject jSONObject = new JSONObject();
try {
JSONArray jSONArray = new JSONArray();
Collections.sort(this.zah, zag);
Iterator it = this.zah.iterator();
while (it.hasNext()) {
jSONArray.put(((Scope) it.next()).getScopeUri());
}
jSONObject.put("scopes", jSONArray);
Account account = this.zai;
if (account != null) {
jSONObject.put("accountName", account.name);
}
jSONObject.put("idTokenRequested", this.zaj);
jSONObject.put("forceCodeForRefreshToken", this.zal);
jSONObject.put("serverAuthRequested", this.zak);
if (!TextUtils.isEmpty(this.zam)) {
jSONObject.put("serverClientId", this.zam);
}
if (!TextUtils.isEmpty(this.zan)) {
jSONObject.put("hostedDomain", this.zan);
}
return jSONObject.toString();
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
private GoogleSignInOptions(int i, ArrayList arrayList, Account account, boolean z, boolean z2, boolean z3, String str, String str2, Map map, String str3) {
this.zaf = i;
this.zah = arrayList;
this.zai = account;
this.zaj = z;
this.zak = z2;
this.zal = z3;
this.zam = str;
this.zan = str2;
this.zao = new ArrayList(map.values());
this.zaq = map;
this.zap = str3;
}
}
@@ -0,0 +1,19 @@
package com.google.android.gms.auth.api.signin;
import android.os.Bundle;
import com.google.android.gms.common.api.Scope;
import java.util.List;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
@Deprecated
public interface GoogleSignInOptionsExtension {
public static final int FITNESS = 3;
public static final int GAMES = 1;
int getExtensionType();
List<Scope> getImpliedScopes();
Bundle toBundle();
}
@@ -0,0 +1,40 @@
package com.google.android.gms.auth.api.signin.internal;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.auth.api.signin.GoogleSignInOptionsExtension;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public class GoogleSignInOptionsExtensionParcelable extends AbstractSafeParcelable {
public static final Parcelable.Creator<GoogleSignInOptionsExtensionParcelable> CREATOR = new zaa();
final int zaa;
private int zab;
private Bundle zac;
GoogleSignInOptionsExtensionParcelable(int i, int i2, Bundle bundle) {
this.zaa = i;
this.zab = i2;
this.zac = bundle;
}
public int getType() {
return this.zab;
}
@Override // android.os.Parcelable
public final void writeToParcel(Parcel parcel, int i) {
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
SafeParcelWriter.writeInt(parcel, 1, this.zaa);
SafeParcelWriter.writeInt(parcel, 2, getType());
SafeParcelWriter.writeBundle(parcel, 3, this.zac, false);
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
}
public GoogleSignInOptionsExtensionParcelable(GoogleSignInOptionsExtension googleSignInOptionsExtension) {
this(1, googleSignInOptionsExtension.getExtensionType(), googleSignInOptionsExtension.toBundle());
}
}
@@ -0,0 +1,21 @@
package com.google.android.gms.auth.api.signin.internal;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public class HashAccumulator {
private int zaa = 1;
public HashAccumulator addObject(Object obj) {
this.zaa = (this.zaa * 31) + (obj == null ? 0 : obj.hashCode());
return this;
}
public int hash() {
return this.zaa;
}
public final HashAccumulator zaa(boolean z) {
this.zaa = (this.zaa * 31) + (z ? 1 : 0);
return this;
}
}
@@ -0,0 +1,132 @@
package com.google.android.gms.auth.api.signin.internal;
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.common.internal.Preconditions;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.json.JSONException;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public class Storage {
private static final Lock zaa = new ReentrantLock();
private static Storage zab;
private final Lock zac = new ReentrantLock();
private final SharedPreferences zad;
Storage(Context context) {
this.zad = context.getSharedPreferences("com.google.android.gms.signin", 0);
}
public static Storage getInstance(Context context) {
Preconditions.checkNotNull(context);
Lock lock = zaa;
lock.lock();
try {
if (zab == null) {
zab = new Storage(context.getApplicationContext());
}
Storage storage = zab;
lock.unlock();
return storage;
} catch (Throwable th) {
zaa.unlock();
throw th;
}
}
private static final String zae(String str, String str2) {
return str + ":" + str2;
}
public void clear() {
this.zac.lock();
try {
this.zad.edit().clear().apply();
} finally {
this.zac.unlock();
}
}
public GoogleSignInAccount getSavedDefaultGoogleSignInAccount() {
String strZaa;
String strZaa2 = zaa("defaultGoogleSignInAccount");
if (TextUtils.isEmpty(strZaa2) || (strZaa = zaa(zae("googleSignInAccount", strZaa2))) == null) {
return null;
}
try {
return GoogleSignInAccount.zab(strZaa);
} catch (JSONException unused) {
return null;
}
}
public GoogleSignInOptions getSavedDefaultGoogleSignInOptions() {
String strZaa;
String strZaa2 = zaa("defaultGoogleSignInAccount");
if (TextUtils.isEmpty(strZaa2) || (strZaa = zaa(zae("googleSignInOptions", strZaa2))) == null) {
return null;
}
try {
return GoogleSignInOptions.zab(strZaa);
} catch (JSONException unused) {
return null;
}
}
public String getSavedRefreshToken() {
return zaa("refreshToken");
}
public void saveDefaultGoogleSignInAccount(GoogleSignInAccount googleSignInAccount, GoogleSignInOptions googleSignInOptions) {
Preconditions.checkNotNull(googleSignInAccount);
Preconditions.checkNotNull(googleSignInOptions);
zad("defaultGoogleSignInAccount", googleSignInAccount.zac());
Preconditions.checkNotNull(googleSignInAccount);
Preconditions.checkNotNull(googleSignInOptions);
String strZac = googleSignInAccount.zac();
zad(zae("googleSignInAccount", strZac), googleSignInAccount.zad());
zad(zae("googleSignInOptions", strZac), googleSignInOptions.zaf());
}
protected final String zaa(String str) {
this.zac.lock();
try {
return this.zad.getString(str, null);
} finally {
this.zac.unlock();
}
}
protected final void zab(String str) {
this.zac.lock();
try {
this.zad.edit().remove(str).apply();
} finally {
this.zac.unlock();
}
}
public final void zac() {
String strZaa = zaa("defaultGoogleSignInAccount");
zab("defaultGoogleSignInAccount");
if (TextUtils.isEmpty(strZaa)) {
return;
}
zab(zae("googleSignInAccount", strZaa));
zab(zae("googleSignInOptions", strZaa));
}
protected final void zad(String str, String str2) {
this.zac.lock();
try {
this.zad.edit().putString(str, str2).apply();
} finally {
this.zac.unlock();
}
}
}
@@ -0,0 +1,38 @@
package com.google.android.gms.auth.api.signin.internal;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class zaa implements Parcelable.Creator {
@Override // android.os.Parcelable.Creator
public final /* bridge */ /* synthetic */ Object createFromParcel(Parcel parcel) {
int iValidateObjectHeader = SafeParcelReader.validateObjectHeader(parcel);
Bundle bundleCreateBundle = null;
int i = 0;
int i2 = 0;
while (parcel.dataPosition() < iValidateObjectHeader) {
int header = SafeParcelReader.readHeader(parcel);
int fieldId = SafeParcelReader.getFieldId(header);
if (fieldId == 1) {
i = SafeParcelReader.readInt(parcel, header);
} else if (fieldId == 2) {
i2 = SafeParcelReader.readInt(parcel, header);
} else if (fieldId != 3) {
SafeParcelReader.skipUnknownField(parcel, header);
} else {
bundleCreateBundle = SafeParcelReader.createBundle(parcel, header);
}
}
SafeParcelReader.ensureAtEnd(parcel, iValidateObjectHeader);
return new GoogleSignInOptionsExtensionParcelable(i, i2, bundleCreateBundle);
}
@Override // android.os.Parcelable.Creator
public final /* synthetic */ Object[] newArray(int i) {
return new GoogleSignInOptionsExtensionParcelable[i];
}
}
@@ -0,0 +1,80 @@
package com.google.android.gms.auth.api.signin;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.common.api.Scope;
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
import java.util.ArrayList;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class zab implements Parcelable.Creator {
@Override // android.os.Parcelable.Creator
public final /* bridge */ /* synthetic */ Object createFromParcel(Parcel parcel) {
int iValidateObjectHeader = SafeParcelReader.validateObjectHeader(parcel);
String strCreateString = null;
String strCreateString2 = null;
String strCreateString3 = null;
String strCreateString4 = null;
Uri uri = null;
String strCreateString5 = null;
String strCreateString6 = null;
ArrayList arrayListCreateTypedList = null;
String strCreateString7 = null;
String strCreateString8 = null;
long j = 0;
int i = 0;
while (parcel.dataPosition() < iValidateObjectHeader) {
int header = SafeParcelReader.readHeader(parcel);
switch (SafeParcelReader.getFieldId(header)) {
case 1:
i = SafeParcelReader.readInt(parcel, header);
break;
case 2:
strCreateString = SafeParcelReader.createString(parcel, header);
break;
case 3:
strCreateString2 = SafeParcelReader.createString(parcel, header);
break;
case 4:
strCreateString3 = SafeParcelReader.createString(parcel, header);
break;
case 5:
strCreateString4 = SafeParcelReader.createString(parcel, header);
break;
case 6:
uri = (Uri) SafeParcelReader.createParcelable(parcel, header, Uri.CREATOR);
break;
case 7:
strCreateString5 = SafeParcelReader.createString(parcel, header);
break;
case 8:
j = SafeParcelReader.readLong(parcel, header);
break;
case 9:
strCreateString6 = SafeParcelReader.createString(parcel, header);
break;
case 10:
arrayListCreateTypedList = SafeParcelReader.createTypedList(parcel, header, Scope.CREATOR);
break;
case 11:
strCreateString7 = SafeParcelReader.createString(parcel, header);
break;
case 12:
strCreateString8 = SafeParcelReader.createString(parcel, header);
break;
default:
SafeParcelReader.skipUnknownField(parcel, header);
break;
}
}
SafeParcelReader.ensureAtEnd(parcel, iValidateObjectHeader);
return new GoogleSignInAccount(i, strCreateString, strCreateString2, strCreateString3, strCreateString4, uri, strCreateString5, j, strCreateString6, arrayListCreateTypedList, strCreateString7, strCreateString8);
}
@Override // android.os.Parcelable.Creator
public final /* synthetic */ Object[] newArray(int i) {
return new GoogleSignInAccount[i];
}
}
@@ -0,0 +1,16 @@
package com.google.android.gms.auth.api.signin;
import com.google.android.gms.common.api.Scope;
import java.util.Comparator;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
final class zac implements Comparator {
zac() {
}
@Override // java.util.Comparator
public final /* bridge */ /* synthetic */ int compare(Object obj, Object obj2) {
return ((Scope) obj).getScopeUri().compareTo(((Scope) obj2).getScopeUri());
}
}
@@ -0,0 +1,73 @@
package com.google.android.gms.auth.api.signin;
import android.accounts.Account;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.auth.api.signin.internal.GoogleSignInOptionsExtensionParcelable;
import com.google.android.gms.common.api.Scope;
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
import java.util.ArrayList;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class zae implements Parcelable.Creator {
@Override // android.os.Parcelable.Creator
public final /* bridge */ /* synthetic */ Object createFromParcel(Parcel parcel) {
int iValidateObjectHeader = SafeParcelReader.validateObjectHeader(parcel);
ArrayList arrayListCreateTypedList = null;
Account account = null;
String strCreateString = null;
String strCreateString2 = null;
ArrayList arrayListCreateTypedList2 = null;
String strCreateString3 = null;
int i = 0;
boolean z = false;
boolean z2 = false;
boolean z3 = false;
while (parcel.dataPosition() < iValidateObjectHeader) {
int header = SafeParcelReader.readHeader(parcel);
switch (SafeParcelReader.getFieldId(header)) {
case 1:
i = SafeParcelReader.readInt(parcel, header);
break;
case 2:
arrayListCreateTypedList = SafeParcelReader.createTypedList(parcel, header, Scope.CREATOR);
break;
case 3:
account = (Account) SafeParcelReader.createParcelable(parcel, header, Account.CREATOR);
break;
case 4:
z = SafeParcelReader.readBoolean(parcel, header);
break;
case 5:
z2 = SafeParcelReader.readBoolean(parcel, header);
break;
case 6:
z3 = SafeParcelReader.readBoolean(parcel, header);
break;
case 7:
strCreateString = SafeParcelReader.createString(parcel, header);
break;
case 8:
strCreateString2 = SafeParcelReader.createString(parcel, header);
break;
case 9:
arrayListCreateTypedList2 = SafeParcelReader.createTypedList(parcel, header, GoogleSignInOptionsExtensionParcelable.CREATOR);
break;
case 10:
strCreateString3 = SafeParcelReader.createString(parcel, header);
break;
default:
SafeParcelReader.skipUnknownField(parcel, header);
break;
}
}
SafeParcelReader.ensureAtEnd(parcel, iValidateObjectHeader);
return new GoogleSignInOptions(i, arrayListCreateTypedList, account, z, z2, z3, strCreateString, strCreateString2, arrayListCreateTypedList2, strCreateString3);
}
@Override // android.os.Parcelable.Creator
public final /* synthetic */ Object[] newArray(int i) {
return new GoogleSignInOptions[i];
}
}
@@ -0,0 +1,116 @@
package com.google.android.gms.base;
/* JADX INFO: loaded from: classes2.dex */
public final class R {
public static final class attr {
public static int buttonSize = 0x7f030047;
public static int circleCrop = 0x7f030058;
public static int colorScheme = 0x7f030067;
public static int imageAspectRatio = 0x7f0300ac;
public static int imageAspectRatioAdjust = 0x7f0300ad;
public static int scopeUris = 0x7f0300f9;
private attr() {
}
}
public static final class color {
public static int common_google_signin_btn_text_dark = 0x7f05002b;
public static int common_google_signin_btn_text_dark_default = 0x7f05002c;
public static int common_google_signin_btn_text_dark_disabled = 0x7f05002d;
public static int common_google_signin_btn_text_dark_focused = 0x7f05002e;
public static int common_google_signin_btn_text_dark_pressed = 0x7f05002f;
public static int common_google_signin_btn_text_light = 0x7f050030;
public static int common_google_signin_btn_text_light_default = 0x7f050031;
public static int common_google_signin_btn_text_light_disabled = 0x7f050032;
public static int common_google_signin_btn_text_light_focused = 0x7f050033;
public static int common_google_signin_btn_text_light_pressed = 0x7f050034;
public static int common_google_signin_btn_tint = 0x7f050035;
private color() {
}
}
public static final class drawable {
public static int common_full_open_on_phone = 0x7f07005a;
public static int common_google_signin_btn_icon_dark = 0x7f07005b;
public static int common_google_signin_btn_icon_dark_focused = 0x7f07005c;
public static int common_google_signin_btn_icon_dark_normal = 0x7f07005d;
public static int common_google_signin_btn_icon_dark_normal_background = 0x7f07005e;
public static int common_google_signin_btn_icon_disabled = 0x7f07005f;
public static int common_google_signin_btn_icon_light = 0x7f070060;
public static int common_google_signin_btn_icon_light_focused = 0x7f070061;
public static int common_google_signin_btn_icon_light_normal = 0x7f070062;
public static int common_google_signin_btn_icon_light_normal_background = 0x7f070063;
public static int common_google_signin_btn_text_dark = 0x7f070064;
public static int common_google_signin_btn_text_dark_focused = 0x7f070065;
public static int common_google_signin_btn_text_dark_normal = 0x7f070066;
public static int common_google_signin_btn_text_dark_normal_background = 0x7f070067;
public static int common_google_signin_btn_text_disabled = 0x7f070068;
public static int common_google_signin_btn_text_light = 0x7f070069;
public static int common_google_signin_btn_text_light_focused = 0x7f07006a;
public static int common_google_signin_btn_text_light_normal = 0x7f07006b;
public static int common_google_signin_btn_text_light_normal_background = 0x7f07006c;
public static int googleg_disabled_color_18 = 0x7f07006d;
public static int googleg_standard_color_18 = 0x7f07006e;
private drawable() {
}
}
public static final class id {
public static int adjust_height = 0x7f08003b;
public static int adjust_width = 0x7f08003c;
public static int auto = 0x7f080042;
public static int dark = 0x7f080053;
public static int icon_only = 0x7f080069;
public static int light = 0x7f080070;
public static int none = 0x7f08007b;
public static int standard = 0x7f0800a4;
public static int wide = 0x7f0800cb;
private id() {
}
}
public static final class string {
public static int common_google_play_services_enable_button = 0x7f0d0027;
public static int common_google_play_services_enable_text = 0x7f0d0028;
public static int common_google_play_services_enable_title = 0x7f0d0029;
public static int common_google_play_services_install_button = 0x7f0d002a;
public static int common_google_play_services_install_text = 0x7f0d002b;
public static int common_google_play_services_install_title = 0x7f0d002c;
public static int common_google_play_services_notification_channel_name = 0x7f0d002d;
public static int common_google_play_services_notification_ticker = 0x7f0d002e;
public static int common_google_play_services_unsupported_text = 0x7f0d0030;
public static int common_google_play_services_update_button = 0x7f0d0031;
public static int common_google_play_services_update_text = 0x7f0d0032;
public static int common_google_play_services_update_title = 0x7f0d0033;
public static int common_google_play_services_updating_text = 0x7f0d0034;
public static int common_google_play_services_wear_update_text = 0x7f0d0035;
public static int common_open_on_phone = 0x7f0d0036;
public static int common_signin_button_text = 0x7f0d0037;
public static int common_signin_button_text_long = 0x7f0d0038;
private string() {
}
}
public static final class styleable {
public static int LoadingImageView_circleCrop = 0x00000000;
public static int LoadingImageView_imageAspectRatio = 0x00000001;
public static int LoadingImageView_imageAspectRatioAdjust = 0x00000002;
public static int SignInButton_buttonSize = 0x00000000;
public static int SignInButton_colorScheme = 0x00000001;
public static int SignInButton_scopeUris = 0x00000002;
public static int[] LoadingImageView = {itranvias.sistemasolton.R.attr.circleCrop, itranvias.sistemasolton.R.attr.imageAspectRatio, itranvias.sistemasolton.R.attr.imageAspectRatioAdjust};
public static int[] SignInButton = {itranvias.sistemasolton.R.attr.buttonSize, itranvias.sistemasolton.R.attr.colorScheme, itranvias.sistemasolton.R.attr.scopeUris};
private styleable() {
}
}
private R() {
}
}
@@ -0,0 +1,208 @@
package com.google.android.gms.common;
import android.accounts.Account;
import android.content.Intent;
import android.os.Bundle;
import com.google.android.gms.common.internal.Preconditions;
import com.google.errorprone.annotations.ResultIgnorabilityUnspecified;
import java.util.ArrayList;
import java.util.List;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class AccountPicker {
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
public static class AccountChooserOptions {
private Account zza;
private boolean zzb;
private ArrayList zzc;
private ArrayList zzd;
private boolean zze;
private String zzf;
private Bundle zzg;
private boolean zzh;
private int zzi;
private String zzj;
private boolean zzk;
private zza zzl;
private String zzm;
private boolean zzn;
private boolean zzo;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
public static class Builder {
private Account zza;
private ArrayList zzb;
private ArrayList zzc;
private boolean zzd = false;
private String zze;
private Bundle zzf;
public AccountChooserOptions build() {
Preconditions.checkArgument(true, "We only support hostedDomain filter for account chip styled account picker");
Preconditions.checkArgument(true, "Consent is only valid for account chip styled account picker");
AccountChooserOptions accountChooserOptions = new AccountChooserOptions();
accountChooserOptions.zzd = this.zzc;
accountChooserOptions.zzc = this.zzb;
accountChooserOptions.zze = this.zzd;
accountChooserOptions.zzl = null;
accountChooserOptions.zzj = null;
accountChooserOptions.zzg = this.zzf;
accountChooserOptions.zza = this.zza;
accountChooserOptions.zzb = false;
accountChooserOptions.zzh = false;
accountChooserOptions.zzm = null;
accountChooserOptions.zzi = 0;
accountChooserOptions.zzf = this.zze;
accountChooserOptions.zzk = false;
accountChooserOptions.zzn = false;
accountChooserOptions.zzo = false;
return accountChooserOptions;
}
public Builder setAllowableAccounts(List<Account> list) {
this.zzb = list == null ? null : new ArrayList(list);
return this;
}
public Builder setAllowableAccountsTypes(List<String> list) {
this.zzc = list == null ? null : new ArrayList(list);
return this;
}
public Builder setAlwaysShowAccountPicker(boolean z) {
this.zzd = z;
return this;
}
public Builder setOptionsForAddingAccount(Bundle bundle) {
this.zzf = bundle;
return this;
}
public Builder setSelectedAccount(Account account) {
this.zza = account;
return this;
}
public Builder setTitleOverrideText(String str) {
this.zze = str;
return this;
}
}
static /* bridge */ /* synthetic */ boolean zzA(AccountChooserOptions accountChooserOptions) {
boolean z = accountChooserOptions.zzo;
return false;
}
static /* bridge */ /* synthetic */ boolean zzB(AccountChooserOptions accountChooserOptions) {
boolean z = accountChooserOptions.zzb;
return false;
}
static /* bridge */ /* synthetic */ boolean zzC(AccountChooserOptions accountChooserOptions) {
boolean z = accountChooserOptions.zzh;
return false;
}
static /* bridge */ /* synthetic */ boolean zzD(AccountChooserOptions accountChooserOptions) {
boolean z = accountChooserOptions.zzk;
return false;
}
static /* bridge */ /* synthetic */ int zza(AccountChooserOptions accountChooserOptions) {
int i = accountChooserOptions.zzi;
return 0;
}
static /* bridge */ /* synthetic */ zza zzd(AccountChooserOptions accountChooserOptions) {
zza zzaVar = accountChooserOptions.zzl;
return null;
}
static /* bridge */ /* synthetic */ String zze(AccountChooserOptions accountChooserOptions) {
String str = accountChooserOptions.zzj;
return null;
}
static /* bridge */ /* synthetic */ String zzf(AccountChooserOptions accountChooserOptions) {
String str = accountChooserOptions.zzm;
return null;
}
static /* bridge */ /* synthetic */ boolean zzz(AccountChooserOptions accountChooserOptions) {
boolean z = accountChooserOptions.zzn;
return false;
}
}
private AccountPicker() {
}
@ResultIgnorabilityUnspecified
@Deprecated
public static Intent newChooseAccountIntent(Account account, ArrayList<Account> arrayList, String[] strArr, boolean z, String str, String str2, String[] strArr2, Bundle bundle) {
Intent intent = new Intent();
Preconditions.checkArgument(true, "We only support hostedDomain filter for account chip styled account picker");
intent.setAction("com.google.android.gms.common.account.CHOOSE_ACCOUNT");
intent.setPackage("com.google.android.gms");
intent.putExtra("allowableAccounts", arrayList);
intent.putExtra("allowableAccountTypes", strArr);
intent.putExtra("addAccountOptions", bundle);
intent.putExtra("selectedAccount", account);
intent.putExtra("alwaysPromptForAccount", z);
intent.putExtra("descriptionTextOverride", str);
intent.putExtra("authTokenType", str2);
intent.putExtra("addAccountRequiredFeatures", strArr2);
intent.putExtra("setGmsCoreAccount", false);
intent.putExtra("overrideTheme", 0);
intent.putExtra("overrideCustomTheme", 0);
intent.putExtra("hostedDomainFilter", (String) null);
return intent;
}
public static Intent newChooseAccountIntent(AccountChooserOptions accountChooserOptions) {
Intent intent = new Intent();
AccountChooserOptions.zzD(accountChooserOptions);
AccountChooserOptions.zze(accountChooserOptions);
Preconditions.checkArgument(true, "We only support hostedDomain filter for account chip styled account picker");
AccountChooserOptions.zzd(accountChooserOptions);
Preconditions.checkArgument(true, "Consent is only valid for account chip styled account picker");
AccountChooserOptions.zzB(accountChooserOptions);
Preconditions.checkArgument(true, "Making the selected account non-clickable is only supported for the THEME_DAY_NIGHT_GOOGLE_MATERIAL2, THEME_LIGHT_GOOGLE_MATERIAL3, THEME_DARK_GOOGLE_MATERIAL3 or THEME_DAY_NIGHT_GOOGLE_MATERIAL3 themes");
AccountChooserOptions.zzD(accountChooserOptions);
intent.setAction("com.google.android.gms.common.account.CHOOSE_ACCOUNT");
intent.setPackage("com.google.android.gms");
intent.putExtra("allowableAccounts", accountChooserOptions.zzc);
if (accountChooserOptions.zzd != null) {
intent.putExtra("allowableAccountTypes", (String[]) accountChooserOptions.zzd.toArray(new String[0]));
}
intent.putExtra("addAccountOptions", accountChooserOptions.zzg);
intent.putExtra("selectedAccount", accountChooserOptions.zza);
AccountChooserOptions.zzB(accountChooserOptions);
intent.putExtra("selectedAccountIsNotClickable", false);
intent.putExtra("alwaysPromptForAccount", accountChooserOptions.zze);
intent.putExtra("descriptionTextOverride", accountChooserOptions.zzf);
AccountChooserOptions.zzC(accountChooserOptions);
intent.putExtra("setGmsCoreAccount", false);
AccountChooserOptions.zzf(accountChooserOptions);
intent.putExtra("realClientPackage", (String) null);
AccountChooserOptions.zza(accountChooserOptions);
intent.putExtra("overrideTheme", 0);
AccountChooserOptions.zzD(accountChooserOptions);
intent.putExtra("overrideCustomTheme", 0);
AccountChooserOptions.zze(accountChooserOptions);
intent.putExtra("hostedDomainFilter", (String) null);
Bundle bundle = new Bundle();
AccountChooserOptions.zzD(accountChooserOptions);
AccountChooserOptions.zzd(accountChooserOptions);
AccountChooserOptions.zzz(accountChooserOptions);
AccountChooserOptions.zzA(accountChooserOptions);
if (!bundle.isEmpty()) {
intent.putExtra("first_party_options_bundle", bundle);
}
return intent;
}
}
@@ -0,0 +1,51 @@
package com.google.android.gms.common;
import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.IBinder;
import com.google.android.gms.common.internal.Preconditions;
import com.google.errorprone.annotations.ResultIgnorabilityUnspecified;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class BlockingServiceConnection implements ServiceConnection {
boolean zza = false;
private final BlockingQueue zzb = new LinkedBlockingQueue();
@ResultIgnorabilityUnspecified
public IBinder getService() throws InterruptedException {
Preconditions.checkNotMainThread("BlockingServiceConnection.getService() called on main thread");
if (this.zza) {
throw new IllegalStateException("Cannot call get on this connection more than once");
}
this.zza = true;
return (IBinder) this.zzb.take();
}
@ResultIgnorabilityUnspecified
public IBinder getServiceWithTimeout(long j, TimeUnit timeUnit) throws InterruptedException, TimeoutException {
Preconditions.checkNotMainThread("BlockingServiceConnection.getServiceWithTimeout() called on main thread");
if (this.zza) {
throw new IllegalStateException("Cannot call get on this connection more than once");
}
this.zza = true;
IBinder iBinder = (IBinder) this.zzb.poll(j, timeUnit);
if (iBinder != null) {
return iBinder;
}
throw new TimeoutException("Timed out waiting for the service connection");
}
@Override // android.content.ServiceConnection
public final void onServiceConnected(ComponentName componentName, IBinder iBinder) {
this.zzb.add(iBinder);
}
@Override // android.content.ServiceConnection
public final void onServiceDisconnected(ComponentName componentName) {
}
}
@@ -0,0 +1,196 @@
package com.google.android.gms.common;
import android.app.Activity;
import android.app.PendingIntent;
import android.content.IntentSender;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.common.internal.Objects;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class ConnectionResult extends AbstractSafeParcelable {
public static final int API_DISABLED = 23;
public static final int API_DISABLED_FOR_CONNECTION = 24;
public static final int API_UNAVAILABLE = 16;
public static final int CANCELED = 13;
public static final int DEVELOPER_ERROR = 10;
@Deprecated
public static final int DRIVE_EXTERNAL_STORAGE_REQUIRED = 1500;
public static final int INTERNAL_ERROR = 8;
public static final int INTERRUPTED = 15;
public static final int INVALID_ACCOUNT = 5;
public static final int LICENSE_CHECK_FAILED = 11;
public static final int NETWORK_ERROR = 7;
public static final int RESOLUTION_ACTIVITY_NOT_FOUND = 22;
public static final int RESOLUTION_REQUIRED = 6;
public static final int RESTRICTED_PROFILE = 20;
public static final int SERVICE_DISABLED = 3;
public static final int SERVICE_INVALID = 9;
public static final int SERVICE_MISSING = 1;
public static final int SERVICE_MISSING_PERMISSION = 19;
public static final int SERVICE_UPDATING = 18;
public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2;
public static final int SIGN_IN_FAILED = 17;
public static final int SIGN_IN_REQUIRED = 4;
public static final int SUCCESS = 0;
public static final int TIMEOUT = 14;
public static final int UNKNOWN = -1;
final int zza;
private final int zzb;
private final PendingIntent zzc;
private final String zzd;
public static final ConnectionResult RESULT_SUCCESS = new ConnectionResult(0);
public static final Parcelable.Creator<ConnectionResult> CREATOR = new zzb();
public ConnectionResult(int i) {
this(i, null, null);
}
ConnectionResult(int i, int i2, PendingIntent pendingIntent, String str) {
this.zza = i;
this.zzb = i2;
this.zzc = pendingIntent;
this.zzd = str;
}
public ConnectionResult(int i, PendingIntent pendingIntent) {
this(i, pendingIntent, null);
}
static String zza(int i) {
if (i == 99) {
return "UNFINISHED";
}
if (i == 1500) {
return "DRIVE_EXTERNAL_STORAGE_REQUIRED";
}
switch (i) {
case -1:
return "UNKNOWN";
case 0:
return "SUCCESS";
case 1:
return "SERVICE_MISSING";
case 2:
return "SERVICE_VERSION_UPDATE_REQUIRED";
case 3:
return "SERVICE_DISABLED";
case 4:
return "SIGN_IN_REQUIRED";
case 5:
return "INVALID_ACCOUNT";
case 6:
return "RESOLUTION_REQUIRED";
case 7:
return "NETWORK_ERROR";
case 8:
return "INTERNAL_ERROR";
case 9:
return "SERVICE_INVALID";
case 10:
return "DEVELOPER_ERROR";
case 11:
return "LICENSE_CHECK_FAILED";
default:
switch (i) {
case 13:
return "CANCELED";
case 14:
return "TIMEOUT";
case 15:
return "INTERRUPTED";
case 16:
return "API_UNAVAILABLE";
case 17:
return "SIGN_IN_FAILED";
case 18:
return "SERVICE_UPDATING";
case 19:
return "SERVICE_MISSING_PERMISSION";
case 20:
return "RESTRICTED_PROFILE";
case 21:
return "API_VERSION_UPDATE_REQUIRED";
case 22:
return "RESOLUTION_ACTIVITY_NOT_FOUND";
case 23:
return "API_DISABLED";
case 24:
return "API_DISABLED_FOR_CONNECTION";
default:
return "UNKNOWN_ERROR_CODE(" + i + ")";
}
}
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof ConnectionResult)) {
return false;
}
ConnectionResult connectionResult = (ConnectionResult) obj;
return this.zzb == connectionResult.zzb && Objects.equal(this.zzc, connectionResult.zzc) && Objects.equal(this.zzd, connectionResult.zzd);
}
public int getErrorCode() {
return this.zzb;
}
public String getErrorMessage() {
return this.zzd;
}
public PendingIntent getResolution() {
return this.zzc;
}
public boolean hasResolution() {
return (this.zzb == 0 || this.zzc == null) ? false : true;
}
public int hashCode() {
return Objects.hashCode(Integer.valueOf(this.zzb), this.zzc, this.zzd);
}
public boolean isSuccess() {
return this.zzb == 0;
}
public void startResolutionForResult(Activity activity, int i) throws IntentSender.SendIntentException {
if (hasResolution()) {
PendingIntent pendingIntent = this.zzc;
Preconditions.checkNotNull(pendingIntent);
activity.startIntentSenderForResult(pendingIntent.getIntentSender(), i, null, 0, 0, 0);
}
}
public String toString() {
Objects.ToStringHelper stringHelper = Objects.toStringHelper(this);
stringHelper.add("statusCode", zza(this.zzb));
stringHelper.add("resolution", this.zzc);
stringHelper.add("message", this.zzd);
return stringHelper.toString();
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
int i2 = this.zza;
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
SafeParcelWriter.writeInt(parcel, 1, i2);
SafeParcelWriter.writeInt(parcel, 2, getErrorCode());
SafeParcelWriter.writeParcelable(parcel, 3, getResolution(), i, false);
SafeParcelWriter.writeString(parcel, 4, getErrorMessage(), false);
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
}
public ConnectionResult(int i, PendingIntent pendingIntent, String str) {
this(1, i, pendingIntent, str);
}
}
@@ -0,0 +1,60 @@
package com.google.android.gms.common;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.FragmentManager;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import com.google.android.gms.common.internal.Preconditions;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public class ErrorDialogFragment extends DialogFragment {
private Dialog zaa;
private DialogInterface.OnCancelListener zab;
private Dialog zac;
public static ErrorDialogFragment newInstance(Dialog dialog) {
return newInstance(dialog, null);
}
@Override // android.app.DialogFragment, android.content.DialogInterface.OnCancelListener
public void onCancel(DialogInterface dialogInterface) {
DialogInterface.OnCancelListener onCancelListener = this.zab;
if (onCancelListener != null) {
onCancelListener.onCancel(dialogInterface);
}
}
@Override // android.app.DialogFragment
public Dialog onCreateDialog(Bundle bundle) {
Dialog dialog = this.zaa;
if (dialog != null) {
return dialog;
}
setShowsDialog(false);
if (this.zac == null) {
this.zac = new AlertDialog.Builder((Context) Preconditions.checkNotNull(getActivity())).create();
}
return this.zac;
}
@Override // android.app.DialogFragment
public void show(FragmentManager fragmentManager, String str) {
super.show(fragmentManager, str);
}
public static ErrorDialogFragment newInstance(Dialog dialog, DialogInterface.OnCancelListener onCancelListener) {
ErrorDialogFragment errorDialogFragment = new ErrorDialogFragment();
Dialog dialog2 = (Dialog) Preconditions.checkNotNull(dialog, "Cannot display null dialog");
dialog2.setOnCancelListener(null);
dialog2.setOnDismissListener(null);
errorDialogFragment.zaa = dialog2;
if (onCancelListener != null) {
errorDialogFragment.zab = onCancelListener;
}
return errorDialogFragment;
}
}
@@ -0,0 +1,69 @@
package com.google.android.gms.common;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.common.internal.Objects;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class Feature extends AbstractSafeParcelable {
public static final Parcelable.Creator<Feature> CREATOR = new zzc();
private final String zza;
@Deprecated
private final int zzb;
private final long zzc;
public Feature(String str, int i, long j) {
this.zza = str;
this.zzb = i;
this.zzc = j;
}
public Feature(String str, long j) {
this.zza = str;
this.zzc = j;
this.zzb = -1;
}
public final boolean equals(Object obj) {
if (obj instanceof Feature) {
Feature feature = (Feature) obj;
if (((getName() != null && getName().equals(feature.getName())) || (getName() == null && feature.getName() == null)) && getVersion() == feature.getVersion()) {
return true;
}
}
return false;
}
public String getName() {
return this.zza;
}
public long getVersion() {
long j = this.zzc;
return j == -1 ? this.zzb : j;
}
public final int hashCode() {
return Objects.hashCode(getName(), Long.valueOf(getVersion()));
}
public final String toString() {
Objects.ToStringHelper stringHelper = Objects.toStringHelper(this);
stringHelper.add("name", getName());
stringHelper.add("version", Long.valueOf(getVersion()));
return stringHelper.toString();
}
@Override // android.os.Parcelable
public final void writeToParcel(Parcel parcel, int i) {
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
SafeParcelWriter.writeString(parcel, 1, getName(), false);
SafeParcelWriter.writeInt(parcel, 2, this.zzb);
SafeParcelWriter.writeLong(parcel, 3, getVersion());
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
}
}
@@ -0,0 +1,10 @@
package com.google.android.gms.common;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class FirstPartyScopes {
public static final String GAMES_1P = "https://www.googleapis.com/auth/games.firstparty";
private FirstPartyScopes() {
}
}
@@ -0,0 +1,30 @@
package com.google.android.gms.common;
import com.google.android.gms.internal.common.zzag;
import com.google.errorprone.annotations.RestrictedInheritance;
import java.util.HashMap;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
@RestrictedInheritance(allowedOnPath = ".*javatests/com/google/android/gmscore/integ/client/common/robolectric/.*", explanation = "Sub classing of GMS Core's APIs are restricted to testing fakes.", link = "go/gmscore-restrictedinheritance")
public class GmsSignatureVerifier {
private static final zzab zza;
private static final zzab zzb;
private static final HashMap zzc;
static {
zzz zzzVar = new zzz();
zzzVar.zzd("com.google.android.gms");
zzzVar.zza(204200000L);
zzzVar.zzc(zzag.zzn(zzn.zzd.zzf(), zzn.zzb.zzf()));
zzzVar.zzb(zzag.zzn(zzn.zzc.zzf(), zzn.zza.zzf()));
zza = zzzVar.zze();
zzz zzzVar2 = new zzz();
zzzVar2.zzd("com.android.vending");
zzzVar2.zza(82240000L);
zzzVar2.zzc(zzag.zzm(zzn.zzd.zzf()));
zzzVar2.zzb(zzag.zzm(zzn.zzc.zzf()));
zzb = zzzVar2.zze();
zzc = new HashMap();
}
}
@@ -0,0 +1,351 @@
package com.google.android.gms.common;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Resources;
import android.util.Log;
import android.util.TypedValue;
import android.widget.ProgressBar;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.IntentSenderRequest;
import androidx.core.app.NotificationCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import com.google.android.gms.common.api.GoogleApi;
import com.google.android.gms.common.api.GoogleApiActivity;
import com.google.android.gms.common.api.HasApiKey;
import com.google.android.gms.common.api.internal.GoogleApiManager;
import com.google.android.gms.common.api.internal.LifecycleFragment;
import com.google.android.gms.common.api.internal.zabw;
import com.google.android.gms.common.api.internal.zabx;
import com.google.android.gms.common.api.internal.zacc;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.internal.zag;
import com.google.android.gms.common.util.DeviceProperties;
import com.google.android.gms.common.util.PlatformVersion;
import com.google.android.gms.common.wrappers.InstantApps;
import com.google.android.gms.internal.base.zae;
import com.google.android.gms.internal.base.zao;
import com.google.android.gms.internal.base.zap;
import com.google.android.gms.tasks.SuccessContinuation;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.Tasks;
import com.google.errorprone.annotations.RestrictedInheritance;
import com.google.errorprone.annotations.ResultIgnorabilityUnspecified;
import java.util.ArrayList;
import java.util.Arrays;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
@RestrictedInheritance(allowedOnPath = ".*java.*/com/google/android/gms.*", allowlistAnnotations = {com.google.android.gms.internal.base.zad.class, zae.class}, explanation = "Sub classing of GMS Core's APIs are restricted to GMS Core client libs and testing fakes.", link = "go/gmscore-restrictedinheritance")
public class GoogleApiAvailability extends GoogleApiAvailabilityLight {
public static final String GOOGLE_PLAY_SERVICES_PACKAGE = "com.google.android.gms";
private String zac;
private static final Object zaa = new Object();
private static final GoogleApiAvailability zab = new GoogleApiAvailability();
public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = GoogleApiAvailabilityLight.GOOGLE_PLAY_SERVICES_VERSION_CODE;
public static GoogleApiAvailability getInstance() {
return zab;
}
public static final Task zai(HasApiKey hasApiKey, HasApiKey... hasApiKeyArr) {
Preconditions.checkNotNull(hasApiKey, "Requested API must not be null.");
for (HasApiKey hasApiKey2 : hasApiKeyArr) {
Preconditions.checkNotNull(hasApiKey2, "Requested API must not be null.");
}
ArrayList arrayList = new ArrayList(hasApiKeyArr.length + 1);
arrayList.add(hasApiKey);
arrayList.addAll(Arrays.asList(hasApiKeyArr));
return GoogleApiManager.zaj().zam(arrayList);
}
public Task<Void> checkApiAvailability(GoogleApi<?> googleApi, GoogleApi<?>... googleApiArr) {
return zai(googleApi, googleApiArr).onSuccessTask(new SuccessContinuation() { // from class: com.google.android.gms.common.zab
@Override // com.google.android.gms.tasks.SuccessContinuation
public final Task then(Object obj) {
int i = GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE;
return Tasks.forResult(null);
}
});
}
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
public int getClientVersion(Context context) {
return super.getClientVersion(context);
}
public Dialog getErrorDialog(Activity activity, int i, int i2) {
return getErrorDialog(activity, i, i2, (DialogInterface.OnCancelListener) null);
}
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
public Intent getErrorResolutionIntent(Context context, int i, String str) {
return super.getErrorResolutionIntent(context, i, str);
}
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
public PendingIntent getErrorResolutionPendingIntent(Context context, int i, int i2) {
return super.getErrorResolutionPendingIntent(context, i, i2);
}
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
public final String getErrorString(int i) {
return super.getErrorString(i);
}
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
@ResultIgnorabilityUnspecified
public int isGooglePlayServicesAvailable(Context context) {
return super.isGooglePlayServicesAvailable(context);
}
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
public final boolean isUserResolvableError(int i) {
return super.isUserResolvableError(i);
}
public Task<Void> makeGooglePlayServicesAvailable(Activity activity) {
int i = GOOGLE_PLAY_SERVICES_VERSION_CODE;
Preconditions.checkMainThread("makeGooglePlayServicesAvailable must be called from the main thread");
int iIsGooglePlayServicesAvailable = isGooglePlayServicesAvailable(activity, i);
if (iIsGooglePlayServicesAvailable == 0) {
return Tasks.forResult(null);
}
zacc zaccVarZaa = zacc.zaa(activity);
zaccVarZaa.zah(new ConnectionResult(iIsGooglePlayServicesAvailable, null), 0);
return zaccVarZaa.zad();
}
public void setDefaultNotificationChannelId(Context context, String str) {
if (PlatformVersion.isAtLeastO()) {
Preconditions.checkNotNull(((NotificationManager) Preconditions.checkNotNull(context.getSystemService("notification"))).getNotificationChannel(str));
}
synchronized (zaa) {
this.zac = str;
}
}
@ResultIgnorabilityUnspecified
public boolean showErrorDialogFragment(Activity activity, int i, int i2) {
return showErrorDialogFragment(activity, i, i2, (DialogInterface.OnCancelListener) null);
}
public void showErrorNotification(Context context, int i) {
zae(context, i, null, getErrorResolutionPendingIntent(context, i, 0, "n"));
}
final Dialog zaa(Context context, int i, zag zagVar, DialogInterface.OnCancelListener onCancelListener, DialogInterface.OnClickListener onClickListener) {
if (i == 0) {
return null;
}
TypedValue typedValue = new TypedValue();
context.getTheme().resolveAttribute(android.R.attr.alertDialogTheme, typedValue, true);
AlertDialog.Builder builder = "Theme.Dialog.Alert".equals(context.getResources().getResourceEntryName(typedValue.resourceId)) ? new AlertDialog.Builder(context, 5) : null;
if (builder == null) {
builder = new AlertDialog.Builder(context);
}
builder.setMessage(com.google.android.gms.common.internal.zac.zac(context, i));
if (onCancelListener != null) {
builder.setOnCancelListener(onCancelListener);
}
String strZab = com.google.android.gms.common.internal.zac.zab(context, i);
DialogInterface.OnClickListener onClickListener2 = zagVar;
if (strZab != null) {
if (zagVar == null) {
onClickListener2 = onClickListener;
}
builder.setPositiveButton(strZab, onClickListener2);
}
String strZaf = com.google.android.gms.common.internal.zac.zaf(context, i);
if (strZaf != null) {
builder.setTitle(strZaf);
}
Log.w("GoogleApiAvailability", String.format("Creating dialog for Google Play services availability issue. ConnectionResult=%s", Integer.valueOf(i)), new IllegalArgumentException());
return builder.create();
}
public final Dialog zab(Activity activity, DialogInterface.OnCancelListener onCancelListener) {
ProgressBar progressBar = new ProgressBar(activity, null, android.R.attr.progressBarStyleLarge);
progressBar.setIndeterminate(true);
progressBar.setVisibility(0);
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setView(progressBar);
builder.setMessage(com.google.android.gms.common.internal.zac.zac(activity, 18));
builder.setPositiveButton("", (DialogInterface.OnClickListener) null);
AlertDialog alertDialogCreate = builder.create();
zad(activity, alertDialogCreate, "GooglePlayServicesUpdatingDialog", onCancelListener);
return alertDialogCreate;
}
@ResultIgnorabilityUnspecified
public final zabx zac(Context context, zabw zabwVar) {
IntentFilter intentFilter = new IntentFilter("android.intent.action.PACKAGE_ADDED");
intentFilter.addDataScheme("package");
zabx zabxVar = new zabx(zabwVar);
zao.zaa(context, zabxVar, intentFilter);
zabxVar.zaa(context);
if (isUninstalledAppPossiblyUpdating(context, "com.google.android.gms")) {
return zabxVar;
}
zabwVar.zaa();
zabxVar.zab();
return null;
}
final void zad(Activity activity, Dialog dialog, String str, DialogInterface.OnCancelListener onCancelListener) {
try {
if (activity instanceof FragmentActivity) {
SupportErrorDialogFragment.newInstance(dialog, onCancelListener).show(((FragmentActivity) activity).getSupportFragmentManager(), str);
return;
}
} catch (NoClassDefFoundError unused) {
}
ErrorDialogFragment.newInstance(dialog, onCancelListener).show(activity.getFragmentManager(), str);
}
final void zae(Context context, int i, String str, PendingIntent pendingIntent) {
int i2;
String str2;
Log.w("GoogleApiAvailability", String.format("GMS core API Availability. ConnectionResult=%s, tag=%s", Integer.valueOf(i), null), new IllegalArgumentException());
if (i == 18) {
zaf(context);
return;
}
if (pendingIntent == null) {
if (i == 6) {
Log.w("GoogleApiAvailability", "Missing resolution for ConnectionResult.RESOLUTION_REQUIRED. Call GoogleApiAvailability#showErrorNotification(Context, ConnectionResult) instead.");
return;
}
return;
}
String strZae = com.google.android.gms.common.internal.zac.zae(context, i);
String strZad = com.google.android.gms.common.internal.zac.zad(context, i);
Resources resources = context.getResources();
NotificationManager notificationManager = (NotificationManager) Preconditions.checkNotNull(context.getSystemService("notification"));
NotificationCompat.Builder style = new NotificationCompat.Builder(context).setLocalOnly(true).setAutoCancel(true).setContentTitle(strZae).setStyle(new NotificationCompat.BigTextStyle().bigText(strZad));
if (DeviceProperties.isWearable(context)) {
Preconditions.checkState(PlatformVersion.isAtLeastKitKatWatch());
style.setSmallIcon(context.getApplicationInfo().icon).setPriority(2);
if (DeviceProperties.isWearableWithoutPlayStore(context)) {
style.addAction(com.google.android.gms.base.R.drawable.common_full_open_on_phone, resources.getString(com.google.android.gms.base.R.string.common_open_on_phone), pendingIntent);
} else {
style.setContentIntent(pendingIntent);
}
} else {
style.setSmallIcon(android.R.drawable.stat_sys_warning).setTicker(resources.getString(com.google.android.gms.base.R.string.common_google_play_services_notification_ticker)).setWhen(System.currentTimeMillis()).setContentIntent(pendingIntent).setContentText(strZad);
}
if (PlatformVersion.isAtLeastO()) {
Preconditions.checkState(PlatformVersion.isAtLeastO());
synchronized (zaa) {
str2 = this.zac;
}
if (str2 == null) {
str2 = "com.google.android.gms.availability";
NotificationChannel notificationChannel = notificationManager.getNotificationChannel("com.google.android.gms.availability");
String string = context.getResources().getString(com.google.android.gms.base.R.string.common_google_play_services_notification_channel_name);
if (notificationChannel == null) {
notificationManager.createNotificationChannel(new NotificationChannel("com.google.android.gms.availability", string, 4));
} else if (!string.contentEquals(notificationChannel.getName())) {
notificationChannel.setName(string);
notificationManager.createNotificationChannel(notificationChannel);
}
}
style.setChannelId(str2);
}
Notification notificationBuild = style.build();
if (i == 1 || i == 2 || i == 3) {
GooglePlayServicesUtilLight.sCanceledAvailabilityNotification.set(false);
i2 = 10436;
} else {
i2 = 39789;
}
notificationManager.notify(i2, notificationBuild);
}
final void zaf(Context context) {
new zad(this, context).sendEmptyMessageDelayed(1, 120000L);
}
@ResultIgnorabilityUnspecified
public final boolean zag(Activity activity, LifecycleFragment lifecycleFragment, int i, int i2, DialogInterface.OnCancelListener onCancelListener) {
Dialog dialogZaa = zaa(activity, i, zag.zad(lifecycleFragment, getErrorResolutionIntent(activity, i, "d"), 2), onCancelListener, null);
if (dialogZaa == null) {
return false;
}
zad(activity, dialogZaa, GooglePlayServicesUtil.GMS_ERROR_DIALOG, onCancelListener);
return true;
}
public final boolean zah(Context context, ConnectionResult connectionResult, int i) {
PendingIntent errorResolutionPendingIntent;
if (InstantApps.isInstantApp(context) || (errorResolutionPendingIntent = getErrorResolutionPendingIntent(context, connectionResult)) == null) {
return false;
}
zae(context, connectionResult.getErrorCode(), null, PendingIntent.getActivity(context, 0, GoogleApiActivity.zaa(context, errorResolutionPendingIntent, i, true), zap.zaa | 134217728));
return true;
}
public Dialog getErrorDialog(Activity activity, int i, int i2, DialogInterface.OnCancelListener onCancelListener) {
return zaa(activity, i, zag.zab(activity, getErrorResolutionIntent(activity, i, "d"), i2), onCancelListener, null);
}
public PendingIntent getErrorResolutionPendingIntent(Context context, ConnectionResult connectionResult) {
return connectionResult.hasResolution() ? connectionResult.getResolution() : getErrorResolutionPendingIntent(context, connectionResult.getErrorCode(), 0);
}
@Override // com.google.android.gms.common.GoogleApiAvailabilityLight
public int isGooglePlayServicesAvailable(Context context, int i) {
return super.isGooglePlayServicesAvailable(context, i);
}
@ResultIgnorabilityUnspecified
public boolean showErrorDialogFragment(Activity activity, int i, int i2, DialogInterface.OnCancelListener onCancelListener) {
Dialog errorDialog = getErrorDialog(activity, i, i2, onCancelListener);
if (errorDialog == null) {
return false;
}
zad(activity, errorDialog, GooglePlayServicesUtil.GMS_ERROR_DIALOG, onCancelListener);
return true;
}
public Task<Void> checkApiAvailability(HasApiKey<?> hasApiKey, HasApiKey<?>... hasApiKeyArr) {
return zai(hasApiKey, hasApiKeyArr).onSuccessTask(new SuccessContinuation() { // from class: com.google.android.gms.common.zaa
@Override // com.google.android.gms.tasks.SuccessContinuation
public final Task then(Object obj) {
int i = GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE;
return Tasks.forResult(null);
}
});
}
public void showErrorNotification(Context context, ConnectionResult connectionResult) {
zae(context, connectionResult.getErrorCode(), null, getErrorResolutionPendingIntent(context, connectionResult));
}
public Dialog getErrorDialog(Fragment fragment, int i, int i2) {
return getErrorDialog(fragment, i, i2, (DialogInterface.OnCancelListener) null);
}
public boolean showErrorDialogFragment(Activity activity, int i, ActivityResultLauncher<IntentSenderRequest> activityResultLauncher, DialogInterface.OnCancelListener onCancelListener) {
Dialog dialogZaa = zaa(activity, i, null, onCancelListener, new zac(this, activity, i, activityResultLauncher));
if (dialogZaa == null) {
return false;
}
zad(activity, dialogZaa, GooglePlayServicesUtil.GMS_ERROR_DIALOG, onCancelListener);
return true;
}
public Dialog getErrorDialog(Fragment fragment, int i, int i2, DialogInterface.OnCancelListener onCancelListener) {
return zaa(fragment.requireContext(), i, zag.zac(fragment, getErrorResolutionIntent(fragment.requireContext(), i, "d"), i2), onCancelListener, null);
}
}
@@ -0,0 +1,139 @@
package com.google.android.gms.common;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.text.TextUtils;
import com.google.android.gms.common.util.DeviceProperties;
import com.google.android.gms.common.wrappers.Wrappers;
import com.google.errorprone.annotations.ResultIgnorabilityUnspecified;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class GoogleApiAvailabilityLight {
public static final String GOOGLE_PLAY_SERVICES_PACKAGE = "com.google.android.gms";
public static final String GOOGLE_PLAY_STORE_PACKAGE = "com.android.vending";
static final String TRACKING_SOURCE_DIALOG = "d";
static final String TRACKING_SOURCE_NOTIFICATION = "n";
public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = GooglePlayServicesUtilLight.GOOGLE_PLAY_SERVICES_VERSION_CODE;
private static final GoogleApiAvailabilityLight zza = new GoogleApiAvailabilityLight();
GoogleApiAvailabilityLight() {
}
public static GoogleApiAvailabilityLight getInstance() {
return zza;
}
public void cancelAvailabilityErrorNotifications(Context context) {
GooglePlayServicesUtilLight.cancelAvailabilityErrorNotifications(context);
}
public int getApkVersion(Context context) {
return GooglePlayServicesUtilLight.getApkVersion(context);
}
public int getClientVersion(Context context) {
return GooglePlayServicesUtilLight.getClientVersion(context);
}
@Deprecated
public Intent getErrorResolutionIntent(int i) {
return getErrorResolutionIntent(null, i, null);
}
public PendingIntent getErrorResolutionPendingIntent(Context context, int i, int i2) {
return getErrorResolutionPendingIntent(context, i, i2, null);
}
public String getErrorString(int i) {
return GooglePlayServicesUtilLight.getErrorString(i);
}
@ResultIgnorabilityUnspecified
public int isGooglePlayServicesAvailable(Context context) {
return isGooglePlayServicesAvailable(context, GOOGLE_PLAY_SERVICES_VERSION_CODE);
}
public boolean isPlayServicesPossiblyUpdating(Context context, int i) {
return GooglePlayServicesUtilLight.isPlayServicesPossiblyUpdating(context, i);
}
public boolean isPlayStorePossiblyUpdating(Context context, int i) {
return GooglePlayServicesUtilLight.isPlayStorePossiblyUpdating(context, i);
}
public boolean isUninstalledAppPossiblyUpdating(Context context, String str) {
return GooglePlayServicesUtilLight.zza(context, str);
}
public boolean isUserResolvableError(int i) {
return GooglePlayServicesUtilLight.isUserRecoverableError(i);
}
public void verifyGooglePlayServicesIsAvailable(Context context, int i) throws GooglePlayServicesRepairableException, GooglePlayServicesNotAvailableException {
GooglePlayServicesUtilLight.ensurePlayServicesAvailable(context, i);
}
public Intent getErrorResolutionIntent(Context context, int i, String str) {
if (i != 1 && i != 2) {
if (i != 3) {
return null;
}
Uri uriFromParts = Uri.fromParts("package", "com.google.android.gms", null);
Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
intent.setData(uriFromParts);
return intent;
}
if (context != null && DeviceProperties.isWearableWithoutPlayStore(context)) {
Intent intent2 = new Intent("com.google.android.clockwork.home.UPDATE_ANDROID_WEAR_ACTION");
intent2.setPackage("com.google.android.wearable.app");
return intent2;
}
StringBuilder sb = new StringBuilder("gcore_");
sb.append(GOOGLE_PLAY_SERVICES_VERSION_CODE);
sb.append("-");
if (!TextUtils.isEmpty(str)) {
sb.append(str);
}
sb.append("-");
if (context != null) {
sb.append(context.getPackageName());
}
sb.append("-");
if (context != null) {
try {
sb.append(Wrappers.packageManager(context).getPackageInfo(context.getPackageName(), 0).versionCode);
} catch (PackageManager.NameNotFoundException unused) {
}
}
String string = sb.toString();
Intent intent3 = new Intent("android.intent.action.VIEW");
Uri.Builder builderAppendQueryParameter = Uri.parse("market://details").buildUpon().appendQueryParameter("id", "com.google.android.gms");
if (!TextUtils.isEmpty(string)) {
builderAppendQueryParameter.appendQueryParameter("pcampaignid", string);
}
intent3.setData(builderAppendQueryParameter.build());
intent3.setPackage("com.android.vending");
intent3.addFlags(524288);
return intent3;
}
public PendingIntent getErrorResolutionPendingIntent(Context context, int i, int i2, String str) {
Intent errorResolutionIntent = getErrorResolutionIntent(context, i, str);
if (errorResolutionIntent == null) {
return null;
}
return PendingIntent.getActivity(context, i2, errorResolutionIntent, com.google.android.gms.internal.common.zzd.zza | 134217728);
}
public int isGooglePlayServicesAvailable(Context context, int i) {
int iIsGooglePlayServicesAvailable = GooglePlayServicesUtilLight.isGooglePlayServicesAvailable(context, i);
if (GooglePlayServicesUtilLight.isPlayServicesPossiblyUpdating(context, iIsGooglePlayServicesAvailable)) {
return 18;
}
return iIsGooglePlayServicesAvailable;
}
}
@@ -0,0 +1,9 @@
package com.google.android.gms.common;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class GooglePlayServicesIncorrectManifestValueException extends GooglePlayServicesManifestException {
public GooglePlayServicesIncorrectManifestValueException(int i) {
super(i, "The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected " + GoogleApiAvailabilityLight.GOOGLE_PLAY_SERVICES_VERSION_CODE + " but found " + i + ". You must have the following declaration within the <application> element: <meta-data android:name=\"com.google.android.gms.version\" android:value=\"@integer/google_play_services_version\" />");
}
}
@@ -0,0 +1,20 @@
package com.google.android.gms.common;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class GooglePlayServicesManifestException extends IllegalStateException {
private final int zza;
public GooglePlayServicesManifestException(int i, String str) {
super(str);
this.zza = i;
}
public int getActualVersion() {
return this.zza;
}
public int getExpectedVersion() {
return GoogleApiAvailabilityLight.GOOGLE_PLAY_SERVICES_VERSION_CODE;
}
}
@@ -0,0 +1,9 @@
package com.google.android.gms.common;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class GooglePlayServicesMissingManifestValueException extends GooglePlayServicesManifestException {
public GooglePlayServicesMissingManifestValueException() {
super(0, "A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name=\"com.google.android.gms.version\" android:value=\"@integer/google_play_services_version\" />");
}
}
@@ -0,0 +1,11 @@
package com.google.android.gms.common;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class GooglePlayServicesNotAvailableException extends Exception {
public final int errorCode;
public GooglePlayServicesNotAvailableException(int i) {
this.errorCode = i;
}
}
@@ -0,0 +1,18 @@
package com.google.android.gms.common;
import android.content.Intent;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class GooglePlayServicesRepairableException extends UserRecoverableException {
private final int zza;
public GooglePlayServicesRepairableException(int i, String str, Intent intent) {
super(str, intent);
this.zza = i;
}
public int getConnectionStatusCode() {
return this.zza;
}
}
@@ -0,0 +1,114 @@
package com.google.android.gms.common;
import android.app.Activity;
import android.app.Dialog;
import android.app.PendingIntent;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import androidx.fragment.app.Fragment;
import com.google.android.gms.common.internal.zag;
import com.google.errorprone.annotations.ResultIgnorabilityUnspecified;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class GooglePlayServicesUtil extends GooglePlayServicesUtilLight {
public static final String GMS_ERROR_DIALOG = "GooglePlayServicesErrorDialog";
@Deprecated
public static final String GOOGLE_PLAY_SERVICES_PACKAGE = "com.google.android.gms";
@Deprecated
public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = GooglePlayServicesUtilLight.GOOGLE_PLAY_SERVICES_VERSION_CODE;
public static final String GOOGLE_PLAY_STORE_PACKAGE = "com.android.vending";
private GooglePlayServicesUtil() {
}
@Deprecated
public static Dialog getErrorDialog(int i, Activity activity, int i2) {
return getErrorDialog(i, activity, i2, null);
}
@Deprecated
public static PendingIntent getErrorPendingIntent(int i, Context context, int i2) {
return GoogleApiAvailabilityLight.getInstance().getErrorResolutionPendingIntent(context, i, i2);
}
@Deprecated
public static String getErrorString(int i) {
return GooglePlayServicesUtilLight.getErrorString(i);
}
public static Context getRemoteContext(Context context) {
return GooglePlayServicesUtilLight.getRemoteContext(context);
}
public static Resources getRemoteResource(Context context) {
return GooglePlayServicesUtilLight.getRemoteResource(context);
}
@ResultIgnorabilityUnspecified
@Deprecated
public static int isGooglePlayServicesAvailable(Context context) {
return GooglePlayServicesUtilLight.isGooglePlayServicesAvailable(context);
}
@Deprecated
public static boolean isUserRecoverableError(int i) {
return GooglePlayServicesUtilLight.isUserRecoverableError(i);
}
@ResultIgnorabilityUnspecified
@Deprecated
public static boolean showErrorDialogFragment(int i, Activity activity, int i2) {
return showErrorDialogFragment(i, activity, i2, null);
}
@Deprecated
public static void showErrorNotification(int i, Context context) {
GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
if (GooglePlayServicesUtilLight.isPlayServicesPossiblyUpdating(context, i) || GooglePlayServicesUtilLight.isPlayStorePossiblyUpdating(context, i)) {
googleApiAvailability.zaf(context);
} else {
googleApiAvailability.showErrorNotification(context, i);
}
}
@Deprecated
public static Dialog getErrorDialog(int i, Activity activity, int i2, DialogInterface.OnCancelListener onCancelListener) {
if (true == GooglePlayServicesUtilLight.isPlayServicesPossiblyUpdating(activity, i)) {
i = 18;
}
return GoogleApiAvailability.getInstance().getErrorDialog(activity, i, i2, onCancelListener);
}
@Deprecated
public static int isGooglePlayServicesAvailable(Context context, int i) {
return GooglePlayServicesUtilLight.isGooglePlayServicesAvailable(context, i);
}
@ResultIgnorabilityUnspecified
@Deprecated
public static boolean showErrorDialogFragment(int i, Activity activity, int i2, DialogInterface.OnCancelListener onCancelListener) {
return showErrorDialogFragment(i, activity, null, i2, onCancelListener);
}
@ResultIgnorabilityUnspecified
public static boolean showErrorDialogFragment(int i, Activity activity, Fragment fragment, int i2, DialogInterface.OnCancelListener onCancelListener) {
if (true == GooglePlayServicesUtilLight.isPlayServicesPossiblyUpdating(activity, i)) {
i = 18;
}
int i3 = i;
GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
if (fragment == null) {
return googleApiAvailability.showErrorDialogFragment(activity, i3, i2, onCancelListener);
}
Dialog dialogZaa = googleApiAvailability.zaa(activity, i3, zag.zac(fragment, GoogleApiAvailability.getInstance().getErrorResolutionIntent(activity, i3, "d"), i2), onCancelListener, null);
if (dialogZaa == null) {
return false;
}
googleApiAvailability.zad(activity, dialogZaa, GMS_ERROR_DIALOG, onCancelListener);
return true;
}
}
@@ -0,0 +1,236 @@
package com.google.android.gms.common;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.UserManager;
import android.util.Log;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.util.ClientLibraryUtils;
import com.google.android.gms.common.util.DeviceProperties;
import com.google.android.gms.common.util.PlatformVersion;
import com.google.android.gms.common.util.UidVerifier;
import com.google.android.gms.common.wrappers.Wrappers;
import com.google.errorprone.annotations.ResultIgnorabilityUnspecified;
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicBoolean;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class GooglePlayServicesUtilLight {
static final int GMS_AVAILABILITY_NOTIFICATION_ID = 10436;
static final int GMS_GENERAL_ERROR_NOTIFICATION_ID = 39789;
public static final String GOOGLE_PLAY_GAMES_PACKAGE = "com.google.android.play.games";
@Deprecated
public static final String GOOGLE_PLAY_SERVICES_PACKAGE = "com.google.android.gms";
@Deprecated
public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = 12451000;
public static final String GOOGLE_PLAY_STORE_PACKAGE = "com.android.vending";
static boolean zza = false;
private static boolean zzb = false;
@Deprecated
static final AtomicBoolean sCanceledAvailabilityNotification = new AtomicBoolean();
private static final AtomicBoolean zzc = new AtomicBoolean();
GooglePlayServicesUtilLight() {
}
@Deprecated
public static void cancelAvailabilityErrorNotifications(Context context) {
if (sCanceledAvailabilityNotification.getAndSet(true)) {
return;
}
try {
NotificationManager notificationManager = (NotificationManager) context.getSystemService("notification");
if (notificationManager != null) {
notificationManager.cancel(GMS_AVAILABILITY_NOTIFICATION_ID);
}
} catch (SecurityException e) {
Log.d("GooglePlayServicesUtil", "Suppressing Security Exception %s in cancelAvailabilityErrorNotifications.", e);
}
}
public static void enableUsingApkIndependentContext() {
zzc.set(true);
}
@Deprecated
public static void ensurePlayServicesAvailable(Context context, int i) throws GooglePlayServicesRepairableException, GooglePlayServicesNotAvailableException {
int iIsGooglePlayServicesAvailable = GoogleApiAvailabilityLight.getInstance().isGooglePlayServicesAvailable(context, i);
if (iIsGooglePlayServicesAvailable != 0) {
Intent errorResolutionIntent = GoogleApiAvailabilityLight.getInstance().getErrorResolutionIntent(context, iIsGooglePlayServicesAvailable, "e");
Log.e("GooglePlayServicesUtil", "GooglePlayServices not available due to error " + iIsGooglePlayServicesAvailable);
if (errorResolutionIntent != null) {
throw new GooglePlayServicesRepairableException(iIsGooglePlayServicesAvailable, "Google Play Services not available", errorResolutionIntent);
}
throw new GooglePlayServicesNotAvailableException(iIsGooglePlayServicesAvailable);
}
}
@Deprecated
public static int getApkVersion(Context context) {
try {
return context.getPackageManager().getPackageInfo("com.google.android.gms", 0).versionCode;
} catch (PackageManager.NameNotFoundException unused) {
Log.w("GooglePlayServicesUtil", "Google Play services is missing.");
return 0;
}
}
@Deprecated
public static int getClientVersion(Context context) {
Preconditions.checkState(true);
return ClientLibraryUtils.getClientVersion(context, context.getPackageName());
}
@Deprecated
public static PendingIntent getErrorPendingIntent(int i, Context context, int i2) {
return GoogleApiAvailabilityLight.getInstance().getErrorResolutionPendingIntent(context, i, i2);
}
@Deprecated
public static String getErrorString(int i) {
return ConnectionResult.zza(i);
}
@Deprecated
public static Intent getGooglePlayServicesAvailabilityRecoveryIntent(int i) {
return GoogleApiAvailabilityLight.getInstance().getErrorResolutionIntent(null, i, null);
}
public static Context getRemoteContext(Context context) {
try {
return context.createPackageContext("com.google.android.gms", 3);
} catch (PackageManager.NameNotFoundException unused) {
return null;
}
}
public static Resources getRemoteResource(Context context) {
try {
return context.getPackageManager().getResourcesForApplication("com.google.android.gms");
} catch (PackageManager.NameNotFoundException unused) {
return null;
}
}
public static boolean honorsDebugCertificates(Context context) {
try {
if (!zza) {
PackageInfo packageInfo = Wrappers.packageManager(context).getPackageInfo("com.google.android.gms", 64);
GoogleSignatureVerifier.getInstance(context);
if (packageInfo == null || GoogleSignatureVerifier.zzb(packageInfo, false) || !GoogleSignatureVerifier.zzb(packageInfo, true)) {
zzb = false;
} else {
zzb = true;
}
}
} catch (PackageManager.NameNotFoundException e) {
Log.w("GooglePlayServicesUtil", "Cannot find Google Play services package name.", e);
} finally {
zza = true;
}
return zzb || !DeviceProperties.isUserBuild();
}
@ResultIgnorabilityUnspecified
@Deprecated
public static int isGooglePlayServicesAvailable(Context context) {
return isGooglePlayServicesAvailable(context, GOOGLE_PLAY_SERVICES_VERSION_CODE);
}
@Deprecated
public static boolean isGooglePlayServicesUid(Context context, int i) {
return UidVerifier.isGooglePlayServicesUid(context, i);
}
@Deprecated
public static boolean isPlayServicesPossiblyUpdating(Context context, int i) {
if (i == 18) {
return true;
}
if (i == 1) {
return zza(context, "com.google.android.gms");
}
return false;
}
@Deprecated
public static boolean isPlayStorePossiblyUpdating(Context context, int i) {
if (i == 9) {
return zza(context, "com.android.vending");
}
return false;
}
public static boolean isRestrictedUserProfile(Context context) {
if (!PlatformVersion.isAtLeastJellyBeanMR2()) {
return false;
}
Object systemService = context.getSystemService("user");
Preconditions.checkNotNull(systemService);
Bundle applicationRestrictions = ((UserManager) systemService).getApplicationRestrictions(context.getPackageName());
return applicationRestrictions != null && "true".equals(applicationRestrictions.getString("restricted_profile"));
}
@Deprecated
public static boolean isSidewinderDevice(Context context) {
return DeviceProperties.isSidewinder(context);
}
@Deprecated
public static boolean isUserRecoverableError(int i) {
return i == 1 || i == 2 || i == 3 || i == 9;
}
@Deprecated
public static boolean uidHasPackageName(Context context, int i, String str) {
return UidVerifier.uidHasPackageName(context, i, str);
}
static boolean zza(Context context, String str) {
ApplicationInfo applicationInfo;
boolean zEquals = str.equals("com.google.android.gms");
if (PlatformVersion.isAtLeastLollipop()) {
try {
Iterator<PackageInstaller.SessionInfo> it = context.getPackageManager().getPackageInstaller().getAllSessions().iterator();
while (it.hasNext()) {
if (str.equals(it.next().getAppPackageName())) {
return true;
}
}
} catch (Exception unused) {
return false;
}
}
try {
applicationInfo = context.getPackageManager().getApplicationInfo(str, 8192);
} catch (PackageManager.NameNotFoundException unused2) {
}
return zEquals ? applicationInfo.enabled : applicationInfo.enabled && !isRestrictedUserProfile(context);
}
/* JADX WARN: Removed duplicated region for block: B:45:0x00b2 */
@java.lang.Deprecated
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public static int isGooglePlayServicesAvailable(android.content.Context r10, int r11) {
/*
Method dump skipped, instruction units count: 304
To view this dump change 'Code comments level' option to 'DEBUG'
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.common.GooglePlayServicesUtilLight.isGooglePlayServicesAvailable(android.content.Context, int):int");
}
}
@@ -0,0 +1,161 @@
package com.google.android.gms.common;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.util.Log;
import com.google.android.gms.common.internal.Preconditions;
import com.google.errorprone.annotations.CheckReturnValue;
import com.google.errorprone.annotations.RestrictedInheritance;
import java.util.Set;
import javax.annotation.Nullable;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
@CheckReturnValue
@RestrictedInheritance(allowedOnPath = ".*java.*/com/google/android/gms/common/testing/.*", explanation = "Sub classing of GMS Core's APIs are restricted to testing fakes.", link = "go/gmscore-restrictedinheritance")
public class GoogleSignatureVerifier {
@Nullable
private static GoogleSignatureVerifier zza;
@Nullable
private static volatile Set zzb;
private final Context zzc;
private volatile String zzd;
public GoogleSignatureVerifier(Context context) {
this.zzc = context.getApplicationContext();
}
public static GoogleSignatureVerifier getInstance(Context context) {
Preconditions.checkNotNull(context);
synchronized (GoogleSignatureVerifier.class) {
if (zza == null) {
zzn.zze(context);
zza = new GoogleSignatureVerifier(context);
}
}
return zza;
}
@Nullable
static final zzj zza(PackageInfo packageInfo, zzj... zzjVarArr) {
if (packageInfo.signatures != null) {
if (packageInfo.signatures.length != 1) {
Log.w("GoogleSignatureVerifier", "Package has more than one signature.");
return null;
}
zzk zzkVar = new zzk(packageInfo.signatures[0].toByteArray());
for (int i = 0; i < zzjVarArr.length; i++) {
if (zzjVarArr[i].equals(zzkVar)) {
return zzjVarArr[i];
}
}
}
return null;
}
public static final boolean zzb(PackageInfo packageInfo, boolean z) {
PackageInfo packageInfo2;
if (!z) {
packageInfo2 = packageInfo;
} else if (packageInfo != null) {
if ("com.android.vending".equals(packageInfo.packageName) || "com.google.android.gms".equals(packageInfo.packageName)) {
ApplicationInfo applicationInfo = packageInfo.applicationInfo;
z = (applicationInfo == null || (applicationInfo.flags & 129) == 0) ? false : true;
}
packageInfo2 = packageInfo;
} else {
packageInfo2 = null;
}
if (packageInfo != null && packageInfo2.signatures != null) {
if ((z ? zza(packageInfo2, zzm.zza) : zza(packageInfo2, zzm.zza[0])) != null) {
return true;
}
}
return false;
}
private final zzx zzc(@Nullable String str, boolean z, boolean z2) {
zzx zzxVarZzc;
if (str == null) {
return zzx.zzc("null pkg");
}
if (str.equals(this.zzd)) {
return zzx.zzb();
}
if (zzn.zzg()) {
zzxVarZzc = zzn.zzb(str, GooglePlayServicesUtilLight.honorsDebugCertificates(this.zzc), false, false);
} else {
try {
PackageInfo packageInfo = this.zzc.getPackageManager().getPackageInfo(str, 64);
boolean zHonorsDebugCertificates = GooglePlayServicesUtilLight.honorsDebugCertificates(this.zzc);
if (packageInfo == null) {
zzxVarZzc = zzx.zzc("null pkg");
} else if (packageInfo.signatures == null || packageInfo.signatures.length != 1) {
zzxVarZzc = zzx.zzc("single cert required");
} else {
zzk zzkVar = new zzk(packageInfo.signatures[0].toByteArray());
String str2 = packageInfo.packageName;
zzx zzxVarZza = zzn.zza(str2, zzkVar, zHonorsDebugCertificates, false);
zzxVarZzc = (!zzxVarZza.zza || packageInfo.applicationInfo == null || (packageInfo.applicationInfo.flags & 2) == 0 || !zzn.zza(str2, zzkVar, false, true).zza) ? zzxVarZza : zzx.zzc("debuggable release cert app rejected");
}
} catch (PackageManager.NameNotFoundException e) {
return zzx.zzd("no pkg ".concat(str), e);
}
}
if (zzxVarZzc.zza) {
this.zzd = str;
}
return zzxVarZzc;
}
public boolean isGooglePublicSignedPackage(PackageInfo packageInfo) {
if (packageInfo == null) {
return false;
}
if (zzb(packageInfo, false)) {
return true;
}
if (zzb(packageInfo, true)) {
if (GooglePlayServicesUtilLight.honorsDebugCertificates(this.zzc)) {
return true;
}
Log.w("GoogleSignatureVerifier", "Test-keys aren't accepted on this build.");
}
return false;
}
public boolean isPackageGoogleSigned(@Nullable String str) {
zzx zzxVarZzc = zzc(str, false, false);
zzxVarZzc.zze();
return zzxVarZzc.zza;
}
public boolean isUidGoogleSigned(int i) {
zzx zzxVarZzc;
int length;
String[] packagesForUid = this.zzc.getPackageManager().getPackagesForUid(i);
if (packagesForUid != null && (length = packagesForUid.length) != 0) {
zzxVarZzc = null;
int i2 = 0;
while (true) {
if (i2 >= length) {
Preconditions.checkNotNull(zzxVarZzc);
break;
}
zzxVarZzc = zzc(packagesForUid[i2], false, false);
if (zzxVarZzc.zza) {
break;
}
i2++;
}
} else {
zzxVarZzc = zzx.zzc("no pkgs");
}
zzxVarZzc.zze();
return zzxVarZzc.zza;
}
}
@@ -0,0 +1,6 @@
package com.google.android.gms.common;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class GoogleSourceStampsChecker {
}
@@ -0,0 +1,6 @@
package com.google.android.gms.common;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class GoogleSourceStampsResult {
}
@@ -0,0 +1,62 @@
package com.google.android.gms.common;
import android.content.Context;
import android.util.Log;
import com.google.android.gms.common.internal.Preconditions;
import com.google.errorprone.annotations.CheckReturnValue;
import com.google.errorprone.annotations.RestrictedInheritance;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
@CheckReturnValue
@RestrictedInheritance(allowedOnPath = ".*javatests.*/com/google/android/gms/common/.*", explanation = "Sub classing of GMS Core's APIs are restricted to testing fakes.", link = "go/gmscore-restrictedinheritance")
public class PackageSignatureVerifier {
static volatile zzac zza;
private static zzad zzb;
private static zzad zza(Context context) {
zzad zzadVar;
synchronized (PackageSignatureVerifier.class) {
if (zzb == null) {
zzb = new zzad(context);
}
zzadVar = zzb;
}
return zzadVar;
}
public PackageVerificationResult queryPackageSignatureVerified(Context context, String str) {
boolean zHonorsDebugCertificates = GooglePlayServicesUtilLight.honorsDebugCertificates(context);
zza(context);
if (!zzn.zzf()) {
throw new zzae();
}
String strConcat = String.valueOf(str).concat(true != zHonorsDebugCertificates ? "-0" : "-1");
if (zza != null && zza.zza.equals(strConcat)) {
return zza.zzb;
}
zza(context);
zzx zzxVarZzc = zzn.zzc(str, zHonorsDebugCertificates, false, false);
if (zzxVarZzc.zza) {
zza = new zzac(strConcat, PackageVerificationResult.zzd(str, zzxVarZzc.zzd));
return zza.zzb;
}
Preconditions.checkNotNull(zzxVarZzc.zzb);
return PackageVerificationResult.zza(str, zzxVarZzc.zzb, zzxVarZzc.zzc);
}
public PackageVerificationResult queryPackageSignatureVerifiedWithRetry(Context context, String str) {
try {
PackageVerificationResult packageVerificationResultQueryPackageSignatureVerified = queryPackageSignatureVerified(context, str);
packageVerificationResultQueryPackageSignatureVerified.zzb();
return packageVerificationResultQueryPackageSignatureVerified;
} catch (SecurityException e) {
PackageVerificationResult packageVerificationResultQueryPackageSignatureVerified2 = queryPackageSignatureVerified(context, str);
if (!packageVerificationResultQueryPackageSignatureVerified2.zzc()) {
return packageVerificationResultQueryPackageSignatureVerified2;
}
Log.e("PkgSignatureVerifier", "Got flaky result during package signature verification", e);
return packageVerificationResultQueryPackageSignatureVerified2;
}
}
}
@@ -0,0 +1,50 @@
package com.google.android.gms.common;
import com.google.errorprone.annotations.CheckReturnValue;
import javax.annotation.Nullable;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
@CheckReturnValue
public class PackageVerificationResult {
private final String zza;
private final boolean zzb;
@Nullable
private final String zzc;
@Nullable
private final Throwable zzd;
private PackageVerificationResult(String str, int i, boolean z, @Nullable String str2, @Nullable Throwable th) {
this.zza = str;
this.zzb = z;
this.zzc = str2;
this.zzd = th;
}
public static PackageVerificationResult zza(String str, String str2, @Nullable Throwable th) {
return new PackageVerificationResult(str, 1, false, str2, th);
}
public static PackageVerificationResult zzd(String str, int i) {
return new PackageVerificationResult(str, i, true, null, null);
}
public final void zzb() {
if (this.zzb) {
return;
}
String str = this.zzc;
Throwable th = this.zzd;
String strConcat = "PackageVerificationRslt: ".concat(String.valueOf(str));
if (th == null) {
throw new SecurityException(strConcat);
}
throw new SecurityException(strConcat, th);
}
public final boolean zzc() {
return this.zzb;
}
}
@@ -0,0 +1,10 @@
package com.google.android.gms.common;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
final class ProGuardCanary {
static final String CANARY = "gms_proguard_canary";
private ProGuardCanary() {
}
}
@@ -0,0 +1,22 @@
package com.google.android.gms.common;
/* JADX INFO: loaded from: classes2.dex */
public final class R {
public static final class integer {
public static int google_play_services_version = 0x7f090004;
private integer() {
}
}
public static final class string {
public static int common_google_play_services_unknown_issue = 0x7f0d002f;
private string() {
}
}
private R() {
}
}
@@ -0,0 +1,26 @@
package com.google.android.gms.common;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class Scopes {
public static final String APP_STATE = "https://www.googleapis.com/auth/appstate";
public static final String CLOUD_SAVE = "https://www.googleapis.com/auth/datastoremobile";
public static final String DRIVE_APPFOLDER = "https://www.googleapis.com/auth/drive.appdata";
public static final String DRIVE_APPS = "https://www.googleapis.com/auth/drive.apps";
public static final String DRIVE_FILE = "https://www.googleapis.com/auth/drive.file";
public static final String DRIVE_FULL = "https://www.googleapis.com/auth/drive";
public static final String EMAIL = "email";
public static final String GAMES = "https://www.googleapis.com/auth/games";
public static final String GAMES_LITE = "https://www.googleapis.com/auth/games_lite";
public static final String LEGACY_USERINFO_EMAIL = "https://www.googleapis.com/auth/userinfo.email";
public static final String LEGACY_USERINFO_PROFILE = "https://www.googleapis.com/auth/userinfo.profile";
public static final String OPEN_ID = "openid";
@Deprecated
public static final String PLUS_LOGIN = "https://www.googleapis.com/auth/plus.login";
public static final String PLUS_ME = "https://www.googleapis.com/auth/plus.me";
public static final String PROFILE = "profile";
private Scopes() {
}
}
@@ -0,0 +1,130 @@
package com.google.android.gms.common;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.widget.FrameLayout;
import com.google.android.gms.common.api.Scope;
import com.google.android.gms.common.internal.zaaa;
import com.google.android.gms.common.internal.zaz;
import com.google.android.gms.dynamic.RemoteCreator;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class SignInButton extends FrameLayout implements View.OnClickListener {
public static final int COLOR_AUTO = 2;
public static final int COLOR_DARK = 0;
public static final int COLOR_LIGHT = 1;
public static final int SIZE_ICON_ONLY = 2;
public static final int SIZE_STANDARD = 0;
public static final int SIZE_WIDE = 1;
private int zaa;
private int zab;
private View zac;
private View.OnClickListener zad;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
@Retention(RetentionPolicy.SOURCE)
public @interface ButtonSize {
}
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
@Retention(RetentionPolicy.SOURCE)
public @interface ColorScheme {
}
public SignInButton(Context context) {
this(context, null);
}
private final void zaa(Context context) {
View view = this.zac;
if (view != null) {
removeView(view);
}
try {
this.zac = zaz.zaa(context, this.zaa, this.zab);
} catch (RemoteCreator.RemoteCreatorException unused) {
Log.w("SignInButton", "Sign in button not found, using placeholder instead");
int i = this.zaa;
int i2 = this.zab;
zaaa zaaaVar = new zaaa(context, null);
zaaaVar.zaa(context.getResources(), i, i2);
this.zac = zaaaVar;
}
addView(this.zac);
this.zac.setEnabled(isEnabled());
this.zac.setOnClickListener(this);
}
@Override // android.view.View.OnClickListener
public void onClick(View view) {
View.OnClickListener onClickListener = this.zad;
if (onClickListener == null || view != this.zac) {
return;
}
onClickListener.onClick(this);
}
public void setColorScheme(int i) {
setStyle(this.zaa, i);
}
@Override // android.view.View
public void setEnabled(boolean z) {
super.setEnabled(z);
this.zac.setEnabled(z);
}
@Override // android.view.View
public void setOnClickListener(View.OnClickListener onClickListener) {
this.zad = onClickListener;
View view = this.zac;
if (view != null) {
view.setOnClickListener(this);
}
}
@Deprecated
public void setScopes(Scope[] scopeArr) {
setStyle(this.zaa, this.zab);
}
public void setSize(int i) {
setStyle(i, this.zab);
}
public void setStyle(int i, int i2) {
this.zaa = i;
this.zab = i2;
zaa(getContext());
}
public SignInButton(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
@Deprecated
public void setStyle(int i, int i2, Scope[] scopeArr) {
setStyle(i, i2);
}
public SignInButton(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.zad = null;
TypedArray typedArrayObtainStyledAttributes = context.getTheme().obtainStyledAttributes(attributeSet, com.google.android.gms.base.R.styleable.SignInButton, 0, 0);
try {
this.zaa = typedArrayObtainStyledAttributes.getInt(com.google.android.gms.base.R.styleable.SignInButton_buttonSize, 0);
this.zab = typedArrayObtainStyledAttributes.getInt(com.google.android.gms.base.R.styleable.SignInButton_colorScheme, 2);
typedArrayObtainStyledAttributes.recycle();
setStyle(this.zaa, this.zab);
} catch (Throwable th) {
typedArrayObtainStyledAttributes.recycle();
throw th;
}
}
}
@@ -0,0 +1,60 @@
package com.google.android.gms.common;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
import com.google.android.gms.common.internal.Preconditions;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public class SupportErrorDialogFragment extends DialogFragment {
private Dialog zaa;
private DialogInterface.OnCancelListener zab;
private Dialog zac;
public static SupportErrorDialogFragment newInstance(Dialog dialog) {
return newInstance(dialog, null);
}
@Override // androidx.fragment.app.DialogFragment, android.content.DialogInterface.OnCancelListener
public void onCancel(DialogInterface dialogInterface) {
DialogInterface.OnCancelListener onCancelListener = this.zab;
if (onCancelListener != null) {
onCancelListener.onCancel(dialogInterface);
}
}
@Override // androidx.fragment.app.DialogFragment
public Dialog onCreateDialog(Bundle bundle) {
Dialog dialog = this.zaa;
if (dialog != null) {
return dialog;
}
setShowsDialog(false);
if (this.zac == null) {
this.zac = new AlertDialog.Builder((Context) Preconditions.checkNotNull(getContext())).create();
}
return this.zac;
}
@Override // androidx.fragment.app.DialogFragment
public void show(FragmentManager fragmentManager, String str) {
super.show(fragmentManager, str);
}
public static SupportErrorDialogFragment newInstance(Dialog dialog, DialogInterface.OnCancelListener onCancelListener) {
SupportErrorDialogFragment supportErrorDialogFragment = new SupportErrorDialogFragment();
Dialog dialog2 = (Dialog) Preconditions.checkNotNull(dialog, "Cannot display null dialog");
dialog2.setOnCancelListener(null);
dialog2.setOnDismissListener(null);
supportErrorDialogFragment.zaa = dialog2;
if (onCancelListener != null) {
supportErrorDialogFragment.zab = onCancelListener;
}
return supportErrorDialogFragment;
}
}
@@ -0,0 +1,18 @@
package com.google.android.gms.common;
import android.content.Intent;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
public class UserRecoverableException extends Exception {
private final Intent zza;
public UserRecoverableException(String str, Intent intent) {
super(str);
this.zza = intent;
}
public Intent getIntent() {
return new Intent(this.zza);
}
}
@@ -0,0 +1,14 @@
package com.google.android.gms.common.annotation;
import com.google.errorprone.annotations.Keep;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
@Keep
@Documented
public @interface KeepForSdk {
}
@@ -0,0 +1,13 @@
package com.google.android.gms.common.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
/* JADX INFO: loaded from: classes2.dex */
@Target({ElementType.TYPE})
@Documented
@Deprecated
public @interface KeepForSdkWithFieldsAndMethods {
}

Some files were not shown because too many files have changed in this diff Show More