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: 2023 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-pay')
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.pay.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-pay'

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ SPDX-FileCopyrightText: 2023 microG Project Team
~ SPDX-License-Identifier: Apache-2.0
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity-alias
android:name="com.google.android.gms.pay.main.PayActivity"
android:exported="true"
android:process=":ui"
android:targetActivity="org.microg.gms.pay.PayActivity">
<intent-filter>
<action android:name="com.google.android.gms.pay.PAY" />
<action android:name="com.google.android.gms.pay.PAY_OPTIONAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity-alias>
<activity
android:name="org.microg.gms.pay.PayActivity"
android:exported="true"
android:process=":ui" />
<service android:name="org.microg.gms.pay.PayService">
<intent-filter>
<action android:name="com.google.android.gms.pay.service.BIND" />
</intent-filter>
</service>
<service
android:name="org.microg.gms.pay.ThirdPartyPayService"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.gms.pay.service.THIRD_PARTY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
</application>
</manifest>

View file

@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package org.microg.gms.pay
import android.app.Activity
import android.os.Bundle
import android.view.Gravity
import android.widget.TextView
class PayActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(TextView(this).apply {
text = "Not yet supported:\n${intent?.action}"
gravity = Gravity.CENTER
})
}
}

View file

@ -0,0 +1,99 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package org.microg.gms.pay
import android.os.Parcel
import com.google.android.gms.common.Feature
import com.google.android.gms.common.api.CommonStatusCodes
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.pay.internal.IPayService
import org.microg.gms.BaseService
import org.microg.gms.common.GmsService
import org.microg.gms.utils.warnOnTransactionIssues
private const val TAG = "PayService"
class PayService : BaseService(TAG, GmsService.PAY) {
override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) {
callback.onPostInitCompleteWithConnectionInfo(CommonStatusCodes.SUCCESS, PayServiceImpl(), ConnectionInfo().apply {
features = arrayOf(
Feature("pay", 10),
Feature("pay_attestation_signal", 1),
Feature("pay_pay_capabilities", 1),
Feature("pay_feature_check", 1),
Feature("pay_get_card_centric_bundle", 1),
Feature("pay_get_passes", 1),
Feature("pay_get_pay_api_availability_status", 3),
Feature("pay_get_se_prepaid_card", 1),
Feature("pay_debit_se_prepaid_card", 1),
Feature("pay_get_specific_bulletin", 1),
Feature("pay_get_transit_cards", 1),
Feature("pay_get_wallet_status", 1),
Feature("pay_global_actions", 1),
Feature("pay_gp3_support", 1),
Feature("pay_homescreen_sorting", 3),
Feature("pay_homescreen_bulletins", 2),
Feature("pay_onboarding", 2),
Feature("pay_mark_tos_accepted_for_partner", 1),
Feature("pay_move_card_on_other_device", 1),
Feature("pay_passes_field_update_notifications", 1),
Feature("pay_passes_notifications", 2),
Feature("pay_payment_method", 1),
Feature("pay_payment_method_action_tokens", 2),
Feature("pay_payment_method_server_action", 1),
Feature("pay_provision_se_prepaid_card", 1),
Feature("pay_request_module", 1),
Feature("pay_reverse_purchase", 1),
Feature("pay_save_passes", 5),
Feature("pay_save_passes_jwt", 3),
Feature("pay_save_purchased_card", 1),
Feature("pay_sync_bundle", 2),
Feature("pay_settings", 1),
Feature("pay_topup_se_prepaid_card", 1),
Feature("pay_list_commuter_pass_renewal_options_for_se_prepaid_card", 1),
Feature("pay_transactions", 6),
Feature("pay_update_bundle_with_client_settings", 1),
Feature("pay_clock_skew_millis", 1),
Feature("pay_se_postpaid_transactions", 1),
Feature("pay_se_prepaid_transactions", 1),
Feature("pay_get_clock_skew_millis", 1),
Feature("pay_renew_commuter_pass_for_se_prepaid_card", 1),
Feature("pay_remove_se_postpaid_token", 1),
Feature("pay_change_se_postpaid_default_status", 1),
Feature("pay_wear_payment_methods", 2),
Feature("pay_wear_closed_loop_cards", 1),
Feature("pay_perform_wear_operation", 1),
Feature("pay_delete_se_prepaid_card", 1),
Feature("pay_transit_issuer_tos", 1),
Feature("pay_get_se_mfi_prepaid_cards", 1),
Feature("pay_get_last_user_present_timestamp", 1),
Feature("pay_mdoc", 7),
Feature("pay_get_se_feature_readiness_status", 1),
Feature("pay_recover_se_card", 1),
Feature("pay_set_wallet_item_surfacing", 2),
Feature("pay_set_se_transit_default", 1),
Feature("pay_get_wallet_bulletins", 2),
Feature("pay_mse_operation", 1),
Feature("pay_clear_bulletin_interaction_for_dev", 1),
Feature("pay_get_pending_intent_for_wallet_on_wear", 2),
Feature("pay_get_predefined_rotating_barcode_values", 1),
Feature("pay_get_mdl_refresh_timestamps", 1),
Feature("pay_store_mdl_refresh_timestamp", 1),
Feature("pay_perform_id_card_operation", 1),
Feature("pay_block_closed_loop_cards", 1),
Feature("pay_delete_data_for_tests", 1),
Feature("pay_perform_closed_loop_operation", 1)
)
})
}
}
class PayServiceImpl : IPayService.Stub() {
override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean =
warnOnTransactionIssues(code, reply, flags, TAG) { super.onTransact(code, data, reply, flags) }
}

View file

@ -0,0 +1,92 @@
/*
* SPDX-FileCopyrightText: 2024 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package org.microg.gms.pay
import android.util.Log
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.pay.CheckReadinessForEmoneyRequest
import com.google.android.gms.pay.GetMdocCredentialRequest
import com.google.android.gms.pay.GetPayApiAvailabilityStatusRequest
import com.google.android.gms.pay.GetPendingIntentForWalletOnWearRequest
import com.google.android.gms.pay.NotifyCardTapEventRequest
import com.google.android.gms.pay.NotifyEmoneyCardStatusUpdateRequest
import com.google.android.gms.pay.PayApiAvailabilityStatus
import com.google.android.gms.pay.PushEmoneyCardRequest
import com.google.android.gms.pay.SavePassesRequest
import com.google.android.gms.pay.SyncBundleRequest
import com.google.android.gms.pay.internal.IPayServiceCallbacks
import com.google.android.gms.pay.internal.IThirdPartyPayService
import org.microg.gms.BaseService
import org.microg.gms.common.GmsService
private const val TAG = "ThirdPartyPayService"
class ThirdPartyPayService : BaseService(TAG, GmsService.PAY) {
override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) {
callback.onPostInitCompleteWithConnectionInfo(CommonStatusCodes.SUCCESS, ThirdPartyPayServiceImpl().asBinder(), ConnectionInfo().apply {
features = arrayOf(
Feature("pay_get_pay_api_availability_status", 3),
Feature("pay_save_passes", 5),
Feature("pay_save_passes_jwt", 3),
Feature("pay_sync_bundle", 2),
Feature("pay_get_pending_intent_for_wallet_on_wear", 2),
Feature("pay_get_mdoc_credential_pending_intent", 1),
Feature("pay_notify_card_tap_event", 1),
Feature("pay_check_readiness_for_emoney", 1),
Feature("pay_push_emoney_card", 1),
Feature("pay_notify_emoney_card_status_update", 1)
)
})
}
}
class ThirdPartyPayServiceImpl : IThirdPartyPayService.Stub() {
override fun getPayApiAvailabilityStatus(request: GetPayApiAvailabilityStatusRequest?, callback: IPayServiceCallbacks) {
Log.d(TAG, "onPayApiAvailabilityStatus: Reporting NOT_ELIGIBLE")
callback.onPayApiAvailabilityStatus(Status.SUCCESS, PayApiAvailabilityStatus.NOT_ELIGIBLE)
}
override fun savePasses(request: SavePassesRequest?, callback: IPayServiceCallbacks) {
Log.d(TAG, "savePasses: return SERVICE_MISSING")
callback.onPendingIntent(Status(CommonStatusCodes.SERVICE_MISSING))
}
override fun syncBundle(request: SyncBundleRequest?, callback: IPayServiceCallbacks?) {
Log.d(TAG, "syncBundle Not yet implemented")
}
override fun getPendingForWalletOnWear(request: GetPendingIntentForWalletOnWearRequest?, callback: IPayServiceCallbacks?) {
Log.d(TAG, "getPendingForWalletOnWear Not yet implemented")
}
override fun getMdocCredential(request: GetMdocCredentialRequest?, callback: IPayServiceCallbacks?) {
Log.d(TAG, "getMdocCredential Not yet implemented")
}
override fun notifyCardTapEvent(request: NotifyCardTapEventRequest?, callback: IPayServiceCallbacks?) {
Log.d(TAG, "notifyCardTapEvent Not yet implemented")
}
override fun checkReadinessForEmoney(request: CheckReadinessForEmoneyRequest?, callback: IPayServiceCallbacks?) {
Log.d(TAG, "checkReadinessForEmoney Not yet implemented")
}
override fun pushEmoneyCard(request: PushEmoneyCardRequest?, callback: IPayServiceCallbacks?) {
Log.d(TAG, "pushEmoneyCard Not yet implemented")
}
override fun notifyEmoneyCardStatusUpdate(request: NotifyEmoneyCardStatusUpdateRequest?, callback: IPayServiceCallbacks?) {
Log.d(TAG, "notifyEmoneyCardStatusUpdate Not yet implemented")
}
}