Chimera: Fix connection to unsupported services (#2243)

Do not take action of service if unset. Also do not overwrite the action as proposed by the client

Fixes issue in 64307c1c194d21f5794a5d8789ecdd280b301e7d

Co-authored-by: Marvin W <git@larma.de>
This commit is contained in:
DaVinci9196 2024-03-19 18:42:21 +08:00 • committed by Cuynu
commit 774d4edbc2
3 changed files with 7 additions and 2 deletions

View file

@ -106,6 +106,7 @@ public enum GmsService {
THUNDERBIRD(226, "com.google.android.gms.thunderbird.service.START"),
NEARBY_EXPOSURE(236, "com.google.android.gms.nearby.exposurenotification.START"),
GMS_COMPLIANCE(257, "com.google.android.gms.gmscompliance.service.START"),
BLOCK_STORE(258, "com.google.android.gms.auth.blockstore.service.START"),
FIDO_SOURCE_DEVICE(262, "com.google.android.gms.fido.sourcedevice.service.START"),
FAST_PAIR(265, "com.google.android.gms.nearby.fastpair.START"),
MATCHSTICK_LIGHTER(268, "com.google.android.gms.matchstick.lighter.service.START"),

View file

@ -736,6 +736,7 @@
<action android:name="com.google.android.gms.auth.api.identity.service.credentialsaving.START" />
<action android:name="com.google.android.gms.auth.api.phone.service.InternalService.START" />
<action android:name="com.google.android.gms.auth.api.signin.service.START" />
<action android:name="com.google.android.gms.auth.blockstore.service.START"/>
<action android:name="com.google.android.gms.auth.config.service.START" />
<action android:name="com.google.android.gms.auth.cryptauth.cryptauthservice.START" />
<action android:name="com.google.android.gms.auth.proximity.devicesyncservice.START" />
@ -783,6 +784,7 @@
<action android:name="com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START" />
>>>>>>> 048a6e59 (Add identity sign-in service (#2130))
<action android:name="com.google.android.gms.identity.service.BIND" />
<<<<<<< HEAD
<<<<<<< HEAD
<action android:name="com.google.android.gms.auth.service.START" />
<action android:name="com.google.android.gms.common.service.START" />
@ -791,6 +793,9 @@
<action android:name="com.google.android.gms.gass.START" />
<action android:name="com.google.android.gms.audit.service.START" />
=======
=======
<action android:name="com.google.android.gms.inappreach.service.START"/>
>>>>>>> 48c4ec57 (Chimera: Fix connection to unsupported services (#2243))
<action android:name="com.google.android.gms.instantapps.START" />
<action android:name="com.google.android.gms.kids.service.START" />
<action android:name="com.google.android.gms.learning.internal.dynamitesupport.START" />

View file

@ -33,12 +33,11 @@ class ServiceProvider : ContentProvider() {
val context = context!!
var intent = Intent(serviceAction).apply { `package` = context.packageName }
var resolveInfo = context.packageManager.resolveService(intent, 0)
if (resolveInfo == null && GmsService.byAction(serviceAction) != null) {
if (resolveInfo == null && GmsService.byAction(serviceAction).ACTION != null) {
// Try again with action as defined in GmsService
val overrideAction = GmsService.byAction(serviceAction).ACTION
val overrideActionIntent = Intent(overrideAction).apply { `package` = context.packageName }
resolveInfo = context.packageManager.resolveService(overrideActionIntent, 0)
if (resolveInfo != null) intent = overrideActionIntent
}
if (resolveInfo != null) {
intent.setClassName(resolveInfo.serviceInfo.packageName, resolveInfo.serviceInfo.name)