Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import org.microg.gms.auth.phone.SmsRetrieverRequestType.RETRIEVER
import org.microg.gms.auth.phone.SmsRetrieverRequestType.USER_CONSENT
import org.microg.gms.common.Constants
import org.microg.gms.utils.getSignatures
import java.nio.charset.StandardCharsets
import java.security.MessageDigest
Expand Down Expand Up @@ -140,7 +139,6 @@ class SmsRetrieverCore(private val context: Context, override val lifecycle: Lif

private fun sendUserConsentBroadcast(request: SmsRetrieverRequest, messageBody: String) {
val userConsentIntent = Intent(context, UserConsentPromptActivity::class.java)
userConsentIntent.setPackage(Constants.GMS_PACKAGE_NAME)
userConsentIntent.putExtra(EXTRA_MESSENGER, Messenger(object : Handler(Looper.getMainLooper()) {
override fun handleMessage(msg: Message) {
if (Binder.getCallingUid() == Process.myUid()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ public static String getOpenSourceSoftwareLicenseInfo(Context context) {
* @return The Context object of the Buddy APK or null if the Buddy APK is not installed on the device.
*/
public static Context getRemoteContext(Context context) {
String packageName = Constants.GMS_PACKAGE_NAME;
if (Constants.USER_MICROG_PACKAGE_NAME.equals(context.getPackageName())) {
packageName = Constants.USER_MICROG_PACKAGE_NAME;
}
try {
return context.createPackageContext(Constants.GMS_PACKAGE_NAME, Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY);
return context.createPackageContext(packageName, Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY);
} catch (PackageManager.NameNotFoundException unused) {
return null;
}
Expand Down
8 changes: 4 additions & 4 deletions play-services-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ android {
}

defaultConfig {
applicationId = "app.revanced.android.gms"
applicationId = "com.google.android.gms"

versionName version
versionCode appVersionCode
Expand All @@ -131,7 +131,7 @@ android {
multiDexKeepProguard file('multidex-keep.pro')

manifestPlaceholders = [appLabel: "@string/gms_app_name"]
resValue "string", "package_id", "app.revanced.android.gms"
resValue "string", "package_id", "com.google.android.gms"

buildConfigField "String", "SAFETYNET_KEY", "\"${localProperties.get("safetynet.key", "")}\""
buildConfigField "String", "RECAPTCHA_SITE_KEY", "\"${localProperties.get("recaptcha.siteKey", "")}\""
Expand Down Expand Up @@ -183,11 +183,11 @@ android {
}
"user" {
dimension 'target'
applicationId = "org.microg.gms"
applicationId = "app.revanced.android.gms"
versionNameSuffix "-user"
manifestPlaceholders = [appLabel: "@string/limited_services_app_name"]
matchingFallbacks = ['default']
resValue "string", "package_id", "org.microg.gms"
resValue "string", "package_id", "app.revanced.android.gms"
}
"hms" {
dimension 'maps'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
import android.os.Process;
import android.util.Log;

import com.google.android.gms.BuildConfig;
import com.google.android.gms.chimera.container.DynamiteContext;
import com.google.android.gms.chimera.container.DynamiteModuleInfo;
import com.google.android.gms.chimera.container.FilteredClassLoader;

import org.microg.gms.common.Constants;

import java.io.File;
import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -49,7 +48,7 @@ public static DynamiteContext createDynamiteContext(String moduleId, Context ori
}
try {
DynamiteModuleInfo moduleInfo = new DynamiteModuleInfo(moduleId);
Context gmsContext = originalContext.createPackageContext(Constants.GMS_PACKAGE_NAME, 0);
Context gmsContext = originalContext.createPackageContext(BuildConfig.APPLICATION_ID, 0);
Context originalAppContext = originalContext.getApplicationContext();

DynamiteContext dynamiteContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import androidx.annotation.StringRes;
import androidx.webkit.WebViewClientCompat;

import com.google.android.gms.BuildConfig;
import com.google.android.gms.R;

import org.json.JSONArray;
Expand Down Expand Up @@ -137,7 +138,7 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (uriPath != null && uriPath.contains("/signup")) {
String biz = uri.getQueryParameter("biz");
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
intent.setPackage(GMS_PACKAGE_NAME);
intent.setPackage(BuildConfig.APPLICATION_ID);
intent.putExtra(EXTRA_URL, biz != null ? GOOGLE_SIGNUP_URL + "?biz=" + biz : GOOGLE_SIGNUP_URL);
startActivityForResult(intent, REQUEST_CODE_SIGNUP);
return true;
Expand Down Expand Up @@ -461,7 +462,7 @@ public void onException(Exception exception) {

private void notifyGcmGroupUpdate(String accountName) {
Intent intent = new Intent(ACTION_GCM_REGISTER_ACCOUNT);
intent.setPackage(Constants.GMS_PACKAGE_NAME);
intent.setPackage(BuildConfig.APPLICATION_ID);
intent.putExtra(KEY_GCM_REGISTER_ACCOUNT_NAME, accountName);
sendBroadcast(intent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import android.os.RemoteException;

import androidx.core.app.PendingIntentCompat;
import com.google.android.gms.BuildConfig;
import com.google.android.gms.common.api.CommonStatusCodes;
import com.google.android.gms.common.internal.GetServiceRequest;
import com.google.android.gms.common.internal.IGmsCallbacks;
Expand Down Expand Up @@ -50,7 +51,7 @@ public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest reque
}
if (packageName == null) packageName = GMS_PACKAGE_NAME;
Intent intent = new Intent(ACTION_PLAY_GAMES_UPGRADE);
intent.setPackage(GMS_PACKAGE_NAME);
intent.setPackage(BuildConfig.APPLICATION_ID);
intent.putExtra(EXTRA_GAME_PACACKE_NAME, packageName);
Bundle bundle = new Bundle();
bundle.putParcelable("pendingIntent", PendingIntentCompat.getActivity(this, packageName.hashCode(), intent, FLAG_UPDATE_CURRENT, false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import androidx.core.app.PendingIntentCompat;
import androidx.legacy.content.WakefulBroadcastReceiver;

import com.google.android.gms.BuildConfig;
import com.squareup.wire.Message;

import org.microg.gms.checkin.LastCheckinInfo;
Expand Down Expand Up @@ -506,7 +507,7 @@ private void handleLoginResponse(LoginResponse loginResponse) {

private void notifyGcmConnected() {
Intent intent = new Intent(ACTION_GCM_CONNECTED);
intent.setPackage(Constants.GMS_PACKAGE_NAME);
intent.setPackage(BuildConfig.APPLICATION_ID);
sendBroadcast(intent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.core.content.ContextCompat
import androidx.core.graphics.drawable.DrawableCompat
import com.google.android.gms.BuildConfig
import com.google.android.gms.R
import org.microg.gms.accountsettings.ui.bridge.OcAdvertisingIdBridge
import org.microg.gms.accountsettings.ui.bridge.OcAndroidIdBridge
Expand Down Expand Up @@ -332,7 +333,7 @@ class MainActivity : AppCompatActivity() {
Log.d(TAG, "updateVerifyNotification: notificationId: $notificationId")
if (notificationId == -1) return
Intent(ACTION_GCM_NOTIFY_COMPLETE).apply {
setPackage(GMS_PACKAGE_NAME)
setPackage(BuildConfig.APPLICATION_ID)
putExtra(EXTRA_NOTIFICATION_ACCOUNT, accountName)
}.let { sendBroadcast(it) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import android.util.Log
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.lifecycleScope
import com.google.android.gms.BuildConfig
import com.google.android.gms.auth.api.identity.AuthorizationRequest
import com.google.android.gms.auth.api.identity.AuthorizationResult
import com.google.android.gms.auth.api.identity.ClearTokenRequest
Expand Down Expand Up @@ -45,7 +46,6 @@ import org.microg.gms.auth.signin.getServerAuthTokenManager
import org.microg.gms.auth.signin.performSignIn
import org.microg.gms.auth.signin.scopeUris
import org.microg.gms.common.AccountUtils
import org.microg.gms.common.Constants
import org.microg.gms.common.GmsService
import org.microg.gms.common.PackageUtils
import java.util.concurrent.atomic.AtomicInteger
Expand Down Expand Up @@ -107,7 +107,7 @@ class AuthorizationServiceImpl(val context: Context, val packageName: String, ov
defaultAccount?.name?.let { setAccountName(it) }
}.build()
val intent = Intent(context, AuthSignInActivity::class.java).apply {
`package` = Constants.GMS_PACKAGE_NAME
`package` = BuildConfig.APPLICATION_ID
putExtra("config", SignInConfiguration(packageName, options))
}
AuthorizationResult(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.content.Intent
import android.os.Parcel
import android.util.Log
import androidx.core.app.PendingIntentCompat
import com.google.android.gms.BuildConfig
import com.google.android.gms.auth.folsom.RecoveryRequest
import com.google.android.gms.auth.folsom.RecoveryResult
import com.google.android.gms.auth.folsom.SharedKey
Expand All @@ -35,7 +36,6 @@ import com.google.android.gms.common.internal.GetServiceRequest
import com.google.android.gms.common.internal.IGmsCallbacks
import org.microg.gms.BaseService
import org.microg.gms.auth.folsom.ui.GenericActivity
import org.microg.gms.common.Constants.GMS_PACKAGE_NAME
import org.microg.gms.common.GmsService
import org.microg.gms.utils.warnOnTransactionIssues

Expand Down Expand Up @@ -149,7 +149,7 @@ class KeyRetrievalServiceImpl(val context: Context) : IKeyRetrievalService.Stub(
callback: IKeyRetrievalCallback?, accountName: String?, type: Int, metadata: ApiMetadata?
) {
Log.d(TAG, "Not implemented startUxFlow accountName:$accountName type:$type metadata:$metadata")
val intent = Intent().apply { setClassName(GMS_PACKAGE_NAME, GenericActivity::class.java.name) }
val intent = Intent().apply { setClassName(BuildConfig.APPLICATION_ID, GenericActivity::class.java.name) }
val pendingIntent = PendingIntentCompat.getActivity(context, 0, intent, FLAG_UPDATE_CURRENT, false)
val states = Status(CommonStatusCodes.SUCCESS, "UX flow PendingIntent retrieved.", pendingIntent)
callback?.onResult(states)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.content.Intent
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.google.android.gms.BuildConfig
import com.google.android.gms.R
import com.google.android.gms.auth.api.identity.BeginSignInRequest
import com.google.android.gms.auth.api.identity.GetSignInIntentRequest
Expand All @@ -20,7 +21,6 @@ import com.google.android.gms.common.api.CommonStatusCodes
import com.google.android.gms.common.api.Status
import com.google.android.gms.common.internal.safeparcel.SafeParcelableSerializer
import org.microg.gms.auth.AuthConstants
import org.microg.gms.common.Constants

const val ACTION_ASSISTED_SIGN_IN = "com.google.android.gms.auth.api.credentials.ASSISTED_SIGNIN"
const val GET_SIGN_IN_INTENT_REQUEST = "get_sign_in_intent_request"
Expand Down Expand Up @@ -98,7 +98,7 @@ class AssistedSignInActivity : AppCompatActivity() {
Log.d(TAG, "prepareSignIn options:$googleSignInOptions")
val signInConfiguration = SignInConfiguration(clientPackageName!!, googleSignInOptions!!)
val intent = Intent(this, AuthSignInActivity::class.java).apply {
`package` = Constants.GMS_PACKAGE_NAME
`package` = BuildConfig.APPLICATION_ID
putExtra("config", signInConfiguration)
putExtra("nonce", signInIntentRequest?.nonce)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.core.app.PendingIntentCompat
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.lifecycleScope
import com.google.android.gms.BuildConfig
import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.Feature
import com.google.android.gms.common.api.Status
Expand All @@ -29,7 +30,6 @@ import com.google.android.gms.credential.manager.common.ISettingsCallback
import com.google.android.gms.credential.manager.firstparty.internal.ICredentialManagerService
import com.google.android.gms.credential.manager.invocationparams.CredentialManagerInvocationParams
import org.microg.gms.BaseService
import org.microg.gms.common.Constants
import org.microg.gms.common.GmsService
import org.microg.gms.common.GooglePackagePermission
import org.microg.gms.common.PackageUtils
Expand Down Expand Up @@ -63,7 +63,7 @@ private class CredentialManagerServiceImpl(private val context: Context, overrid
lifecycleScope.launchWhenStarted {
runCatching {
val intent = Intent().apply {
setClassName(Constants.GMS_PACKAGE_NAME, PASSWORD_MANAGER_CLASS_NAME)
setClassName(BuildConfig.APPLICATION_ID, PASSWORD_MANAGER_CLASS_NAME)
putExtra(EXTRA_KEY_ACCOUNT_NAME, params.account.name)
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.core.os.bundleOf
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.lifecycleScope
import com.google.android.gms.BuildConfig
import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.Scopes
import com.google.android.gms.common.api.CommonStatusCodes
Expand Down Expand Up @@ -51,7 +52,6 @@ import org.microg.gms.auth.AuthConstants
import org.microg.gms.auth.AuthManager
import org.microg.gms.auth.AuthPrefs
import org.microg.gms.auth.signin.checkAccountAuthStatus
import org.microg.gms.common.Constants
import org.microg.gms.common.GmsService
import org.microg.gms.common.PackageUtils
import org.microg.gms.games.achievements.AchievementsApiClient
Expand Down Expand Up @@ -580,7 +580,7 @@ class GamesServiceImpl(val context: Context, override val lifecycle: Lifecycle,

private fun getGamesIntent(action: String, block: Intent.() -> Unit = {}) = Intent(action).apply {
// Jump to internal page implementation
setPackage(Constants.GMS_PACKAGE_NAME)
setPackage(BuildConfig.APPLICATION_ID)
putExtra(EXTRA_ACCOUNT_KEY, Integer.toHexString(account.name.hashCode()))
putExtra(EXTRA_GAME_PACKAGE_NAME, packageName)
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import androidx.appcompat.app.AlertDialog
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.gms.BuildConfig
import com.google.android.gms.R
import com.google.android.gms.common.Scopes
import com.google.android.gms.games.snapshot.SnapshotMetadataEntity
Expand All @@ -41,7 +42,6 @@ import kotlinx.coroutines.withContext
import org.microg.gms.auth.AuthConstants
import org.microg.gms.auth.AuthManager
import org.microg.gms.auth.signin.SignInConfigurationService
import org.microg.gms.common.Constants
import org.microg.gms.games.ACTION_VIEW_ACHIEVEMENTS
import org.microg.gms.games.ACTION_VIEW_LEADERBOARDS
import org.microg.gms.games.ACTION_VIEW_LEADERBOARDS_SCORES
Expand Down Expand Up @@ -348,7 +348,7 @@ class GamesUiFragment : BottomSheetDialogFragment() {
}
}?.adapter = LeaderboardsAdapter(context, loadLeaderboards) { leaderboard ->
val intent = Intent(ACTION_VIEW_LEADERBOARDS_SCORES)
intent.setPackage(Constants.GMS_PACKAGE_NAME)
intent.setPackage(BuildConfig.APPLICATION_ID)
intent.putExtra(EXTRA_GAME_PACKAGE_NAME, clientPackageName)
intent.putExtra(EXTRA_ACCOUNT_KEY, Integer.toHexString(currentAccount?.name.hashCode()))
intent.putExtra(EXTRA_LEADERBOARD_ID, leaderboard.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class GcmInGmsService : LifecycleService() {
handleIntent(intent)
} else {
val intent = Intent(ACTION_GCM_RECONNECT).apply {
setPackage(Constants.GMS_PACKAGE_NAME)
setPackage(BuildConfig.APPLICATION_ID)
}
sendBroadcast(intent)
}
Expand Down Expand Up @@ -270,7 +270,7 @@ class GcmInGmsService : LifecycleService() {
val content = notificationData.content ?: return
val intentExtras = notificationData.intentActions?.primaryPayload?.extras ?: return
val intent = Intent(this, MainActivity::class.java).apply {
`package` = Constants.GMS_PACKAGE_NAME
`package` = BuildConfig.APPLICATION_ID
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_MULTIPLE_TASK
intentExtras.forEach { putExtra(it.key, it.value_) }
putExtra(KEY_NOTIFICATION_ID, notificationId)
Expand Down Expand Up @@ -309,9 +309,9 @@ class GcmInGmsService : LifecycleService() {
}
Log.d(TAG, "updateGroupsWithAccount extras: $extras")
val intent = Intent(GcmConstants.ACTION_GCM_SEND).apply {
setPackage(Constants.GMS_PACKAGE_NAME)
setPackage(BuildConfig.APPLICATION_ID)
putExtras(extras)
putExtra(GcmConstants.EXTRA_APP, Intent().apply { setPackage(Constants.GMS_PACKAGE_NAME) }.let { PendingIntentCompat.getBroadcast(this@GcmInGmsService, 0, it, 0, false) })
putExtra(GcmConstants.EXTRA_APP, Intent().apply { setPackage(BuildConfig.APPLICATION_ID) }.let { PendingIntentCompat.getBroadcast(this@GcmInGmsService, 0, it, 0, false) })
}.also {
it.putExtra(GcmConstants.EXTRA_MESSENGER, Messenger(object : Handler(Looper.getMainLooper()) {
override fun handleMessage(msg: Message) {
Expand Down Expand Up @@ -387,7 +387,7 @@ class GcmInGmsService : LifecycleService() {
} else {
Log.d(TAG, "registerGcmInGms: sendBroadcast: ${intent.action}")
Intent(intent.action).apply {
setPackage(Constants.GMS_PACKAGE_NAME)
setPackage(BuildConfig.APPLICATION_ID)
putExtras(intent)
}.let { sendBroadcast(it) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import android.os.LocaleList
import android.util.Log
import androidx.core.app.NotificationManagerCompat
import androidx.core.content.edit
import com.google.android.gms.BuildConfig
import google.internal.notifications.v1.AppBlockState
import google.internal.notifications.v1.AppRegistration
import google.internal.notifications.v1.AppRegistrationContainer
Expand Down Expand Up @@ -128,7 +129,7 @@ class ChimeGmsRegistrationHelper(val context: Context) {
private fun buildDeviceContext() = GmsDeviceContext.build {
languageTag = if (SDK_INT >= 24) LocaleList.getDefault().get(0).toLanguageTag() else Locale.getDefault().language
gmsDeviceProfile = GmsDeviceProfile.build {
val packageInfo = context.packageManager.getPackageInfo(Constants.GMS_PACKAGE_NAME, 0)
val packageInfo = context.packageManager.getPackageInfo(BuildConfig.APPLICATION_ID, 0)
density = context.resources.displayMetrics.density
versionName = packageInfo.versionName
release = Build.VERSION.RELEASE
Expand Down
Loading