You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR makes the Mapbox backend reuse the maps/module Context already selected by MapsContextLoader, instead of reconstructing a new GmsCore-side base context from the embedding app Context and a package string. MultiArchLoader now resolves package/version/APK metadata from the wrapped maps context instead of hardcoding Constants.GMS_PACKAGE_NAME.
Upstream already uses MapsContextLoader to choose the maps/module context for initialization, but the Mapbox runtime path still rebuilds its own base context in MapContext and still hardcodes package identity in MultiArchLoader. The problem with that shape was discussed earlier in the Mapbox thread on ReVanced/GmsCore#308, and was also discussed in microg/GmsCore#3367.
The API between play-services-maps and play-services-maps-core is defined by Google, not us. If we change it, things are going to break.
The interface com.google.android.gms.maps.internal.ICreator is from Google.
The requirement of a no-argument constructor (specifically without a Context argument) is from Google.
This change will break things in two ways:
Apps that use the play-services-maps library from Google (that is most apps displaying a map) will not be able to do so anymore when run on a device with microG (they will try to invoke the no-argument constructor on com.google.android.gms.maps.internal.CreatorImpl which no longer exists)
Apps that use the play-services-maps library from microG (probably very few) will not be able to do so anymore when run on a device with original Google Play Services (they will try to invoke the constructor with Context argument, which doesn't exist in Play Services).
The API between play-services-maps and play-services-maps-core is defined by Google, not us. If we change it, things are going to break.
The interface com.google.android.gms.maps.internal.ICreator is from Google.
The requirement of a no-argument constructor (specifically without a Context argument) is from Google.
Understood, I will review options. That was part of my pre f867ebd change, but you bring up some other points I need to consider as well. I will look into this, thank you for your feedback.
I think you are tackling this from the wrong angle. Instead, figure out what inside play-services-maps-core-mapbox currently requires access to the context of the gms package and either eliminate those needs or use other techniques to fulfill those needs. As we do have access to the class loader that loads play-services-maps-core-mapbox, this should already give us almost all we need.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes the Mapbox backend reuse the maps/module Context already selected by MapsContextLoader, instead of reconstructing a new GmsCore-side base context from the embedding app Context and a package string. MultiArchLoader now resolves package/version/APK metadata from the wrapped maps context instead of hardcoding Constants.GMS_PACKAGE_NAME.
Upstream already uses MapsContextLoader to choose the maps/module context for initialization, but the Mapbox runtime path still rebuilds its own base context in MapContext and still hardcodes package identity in MultiArchLoader. The problem with that shape was discussed earlier in the Mapbox thread on ReVanced/GmsCore#308, and was also discussed in microg/GmsCore#3367.