Repo Created

This commit is contained in:
Fr4nz D13trich 2025-11-15 17:44:12 +01:00
parent eb305e2886
commit a8c22c65db
4784 changed files with 329907 additions and 2 deletions

View file

@ -0,0 +1,56 @@
/*
* SPDX-FileCopyrightText: 2021, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
apply plugin: 'signing'
dependencies {
api project(':play-services-tapandpay')
implementation project(':play-services-base-core')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutineVersion"
}
android {
namespace "org.microg.gms.tapandpay.core"
compileSdkVersion androidCompileSdk
buildToolsVersion "$androidBuildVersionTools"
defaultConfig {
versionName version
minSdkVersion androidMinSdk
targetSdkVersion androidTargetSdk
}
sourceSets {
main {
java.srcDirs = ['src/main/kotlin']
}
}
lintOptions {
disable 'MissingTranslation'
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
kotlinOptions {
jvmTarget = 1.8
}
}
// Nothing to publish yet
//apply from: '../gradle/publish-android.gradle'
description = 'microG service implementation for play-services-tapandpay'

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ SPDX-FileCopyrightText: 2021, microG Project Team
~ SPDX-License-Identifier: Apache-2.0
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<service android:name="org.microg.gms.tapandpay.TapAndPayService"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.gms.tapandpay.service.BIND"/>
</intent-filter>
</service>
</application>
</manifest>

View file

@ -0,0 +1,143 @@
/*
* SPDX-FileCopyrightText: 2021, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package org.microg.gms.tapandpay
import android.os.Parcel
import android.util.Log
import android.util.SparseArray
import com.google.android.gms.common.Feature
import com.google.android.gms.common.api.CommonStatusCodes
import com.google.android.gms.common.api.Status
import com.google.android.gms.common.internal.ConnectionInfo
import com.google.android.gms.common.internal.GetServiceRequest
import com.google.android.gms.common.internal.IGmsCallbacks
import com.google.android.gms.tapandpay.TapAndPayStatusCodes.TAP_AND_PAY_NO_ACTIVE_WALLET
import com.google.android.gms.tapandpay.firstparty.GetActiveAccountResponse
import com.google.android.gms.tapandpay.firstparty.GetAllCardsResponse
import com.google.android.gms.tapandpay.firstparty.RefreshSeCardsResponse
import com.google.android.gms.tapandpay.internal.ITapAndPayService
import com.google.android.gms.tapandpay.internal.ITapAndPayServiceCallbacks
import com.google.android.gms.tapandpay.internal.firstparty.GetActiveAccountRequest
import com.google.android.gms.tapandpay.internal.firstparty.GetAllCardsRequest
import com.google.android.gms.tapandpay.internal.firstparty.RefreshSeCardsRequest
import com.google.android.gms.tapandpay.internal.firstparty.SetActiveAccountRequest
import org.microg.gms.BaseService
import org.microg.gms.common.GmsService
import org.microg.gms.utils.warnOnTransactionIssues
private const val TAG = "GmsTapAndPay"
class TapAndPayService : BaseService(TAG, GmsService.TAP_AND_PAY) {
override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) {
callback.onPostInitCompleteWithConnectionInfo(CommonStatusCodes.SUCCESS, TapAndPayImpl(), ConnectionInfo().apply {
features = arrayOf(
Feature("tapandpay", 1),
Feature("tapandpay_account_linking", 1),
Feature("tapandpay_add_service_listener", 1),
Feature("tapandpay_backup_and_restore_tokenize", 1),
Feature("tapandpay_block_payment_cards", 1),
Feature("tapandpay_check_contactless_eligibility", 1),
Feature("tapandpay_check_notification_governance", 1),
Feature("tapandpay_dismiss_quick_access_wallet", 1),
Feature("tapandpay_enable_secure_keyguard", 1),
Feature("tapandpay_felica_tos", 1),
Feature("tapandpay_get_active_wallet_infos", 1L),
Feature("tapandpay_get_all_cards_for_account", 1),
Feature("tapandpay_get_contactless_setup_configuration", 1),
Feature("tapandpay_get_data_for_backup", 1),
Feature("tapandpay_get_environment", 1L),
Feature("tapandpay_get_last_attestation_result", 1),
Feature("tapandpay_get_quick_access_tile_status", 1),
Feature("tapandpay_get_stable_hardware_id", 1L),
Feature("tapandpay_get_token_details", 1L),
Feature("tapandpay_get_token_status", 1L),
Feature("tapandpay_global_actions", 1),
Feature("tapandpay_has_eligible_tokenization_target", 1L),
Feature("tapandpay_issuer_api", 2),
Feature("tapandpay_issuer_tokenize", 1),
Feature("tapandpay_override_payment_network", 3L),
Feature("tapandpay_get_parental_consent_intent", 1L),
Feature("tapandpay_set_supervised_child_account_type_and_reset_onboarding_info", 1L),
Feature("tapandpay_get_is_supervised_child_wallet_user", 1L),
Feature("tapandpay_perform_secure_element_management_operation", 1L),
Feature("tapandpay_perform_tokenization_operation", 1L),
Feature("tapandpay_polling_frame_handler", 1L),
Feature("tapandpay_push_tokenize_session", 6),
Feature("tapandpay_push_tokenize", 1L),
Feature("tapandpay_quick_access_wallet", 1),
Feature("tapandpay_report_unlock", 1L),
Feature("tapandpay_request_delete_token", 1L),
Feature("tapandpay_request_select_token", 1L),
Feature("tapandpay_secureelement", 1),
Feature("tapandpay_send_wear_request_to_phone", 1),
Feature("tapandpay_settings", 2L),
Feature("tapandpay_screen_logging", 1L),
Feature("tapandpay_show_wear_card_management_view", 1),
Feature("tapandpay_sync_device_info", 1),
Feature("tapandpay_token_listing", 3),
Feature("tapandpay_token_listing_with_request", 1),
Feature("tapandpay_tokenize_account", 1),
Feature("tapandpay_tokenize_cache", 1),
Feature("tapandpay_tokenize_pan", 1),
Feature("tapandpay_transmission_event", 1),
Feature("tapandpay_wallet_feedback_psd", 1),
Feature("tapandpay_wallet_set_tap_doodle_enabled", 1L),
Feature("tapandpay_wallet_ui_shown_status", 1L),
Feature("tapandpay_set_receives_ineligible_card_notification", 1L)
)
})
}
}
class TapAndPayImpl : ITapAndPayService.Stub() {
override fun getAllCards(request: GetAllCardsRequest?, callbacks: ITapAndPayServiceCallbacks) {
Log.d(TAG, "getAllCards()")
callbacks.onAllCardsRetrieved(Status.SUCCESS, GetAllCardsResponse(emptyArray(), null, null, null, SparseArray(), ByteArray(0)))
}
override fun setActiveAccount(request: SetActiveAccountRequest?, callbacks: ITapAndPayServiceCallbacks) {
Log.d(TAG, "setActiveAccount(${request?.accountName})")
callbacks.onActiveAccountSet(Status.SUCCESS)
}
override fun getActiveAccount(request: GetActiveAccountRequest?, callbacks: ITapAndPayServiceCallbacks) {
Log.d(TAG, "getActiveAccount()")
callbacks.onActiveAccountDetermined(Status.SUCCESS, GetActiveAccountResponse(null))
}
override fun registerDataChangedListener(callbacks: ITapAndPayServiceCallbacks) {
Log.d(TAG, "registerDataChangedListener()")
callbacks.onStatus(Status.SUCCESS)
}
override fun getActiveWalletId(callbacks: ITapAndPayServiceCallbacks) {
Log.d(TAG, "getActiveWalletId: ")
callbacks.onActiveWalletIdRetrieved(Status(TAP_AND_PAY_NO_ACTIVE_WALLET), "")
}
override fun getTokenStatus(tokenProvider: Int, issuerTokenId: String, callbacks: ITapAndPayServiceCallbacks) {
Log.d(TAG, "getTokenStatus($tokenProvider, $issuerTokenId)")
callbacks.onTokenStatusRetrieved(Status(TAP_AND_PAY_NO_ACTIVE_WALLET), null)
}
override fun getStableHardwareId(callbacks: ITapAndPayServiceCallbacks) {
Log.d(TAG, "getStableHardwareId()")
callbacks.onStableHardwareIdRetrieved(Status.SUCCESS, "")
}
override fun refreshSeCards(request: RefreshSeCardsRequest?, callbacks: ITapAndPayServiceCallbacks) {
Log.d(TAG, "refreshSeCards()")
callbacks.onRefreshSeCardsResponse(Status.SUCCESS, RefreshSeCardsResponse())
}
override fun getListTokens(callbacks: ITapAndPayServiceCallbacks) {
Log.d(TAG, "getListTokensRequest: ")
callbacks.onListTokensRetrieved(Status.SUCCESS, emptyArray())
}
override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean =
warnOnTransactionIssues(code, reply, flags, TAG) { super.onTransact(code, data, reply, flags) }
}