Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/pull_strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Process strings
run: |
gradlew processStringsFromCrowdin
./gradlew processStringsFromCrowdin
env:
ORG_GRADLE_PROJECT_githubPackagesUsername: ${{ github.actor }}
ORG_GRADLE_PROJECT_githubPackagesPassword: ${{ secrets.GITHUB_TOKEN }}
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## [5.50.3-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.50.3-dev.1...v5.50.3-dev.2) (2026-02-16)


### Bug Fixes

* **GmsCore support:** Handle GmsCore flavors when checking for updates ([2aa19f5](https://github.com/ReVanced/revanced-patches/commit/2aa19f5995fd050c40b15331a77d58144a5a1f69))
* Use positional substitutes in strings where multiple are present ([aa8c87f](https://github.com/ReVanced/revanced-patches/commit/aa8c87f8650bd5def5f726f02be5d62d72a3007b))

## [5.50.3-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.50.2...v5.50.3-dev.1) (2026-02-16)


### Bug Fixes

* **GmsCore support:** Rename MicroG GmsCore specific strings as well and rename app specific strings correctly ([c2ac1f0](https://github.com/ReVanced/revanced-patches/commit/c2ac1f04a0ac180555a9d19e7ff41525487fbc6d))

## [5.50.2](https://github.com/ReVanced/revanced-patches/compare/v5.50.1...v5.50.2) (2026-02-15)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
import android.provider.Settings;
import android.util.Pair;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;

import app.revanced.extension.shared.requests.Requester;
import app.revanced.extension.shared.requests.Route;
import app.revanced.extension.shared.settings.BaseSettings;
import app.revanced.extension.shared.ui.CustomDialog;

import org.json.JSONObject;

import java.net.HttpURLConnection;
Expand Down Expand Up @@ -219,11 +222,17 @@ private void checkUpdates(Activity context) {
Utils.runOnBackgroundThread(() -> {
try {
PackageManager manager = context.getPackageManager();
String installedVersion = manager.getPackageInfo(packageName, 0).versionName;
var installedVersion = manager.getPackageInfo(packageName, 0).versionName;

// GmsCore adds suffixes for flavor builds. Remove the suffix for version comparison.
int suffixIndex = installedVersion.indexOf('-');
if (suffixIndex != -1)
installedVersion = installedVersion.substring(0, suffixIndex);
String finalInstalledVersion = installedVersion;

Logger.printDebug(() -> "Installed GmsCore version: " + installedVersion);
Logger.printDebug(() -> "Installed GmsCore version: " + finalInstalledVersion);

String latestVersion = getLatestVersion.get();
var latestVersion = getLatestVersion.get();

if (latestVersion == null || latestVersion.isEmpty()) {
Logger.printDebug(() -> "Could not get latest GmsCore version");
Expand All @@ -235,7 +244,7 @@ private void checkUpdates(Activity context) {

// Compare versions
if (!installedVersion.equals(latestVersion)) {
Logger.printInfo(() -> "GmsCore update available. Installed: " + installedVersion
Logger.printInfo(() -> "GmsCore update available. Installed: " + finalInstalledVersion
+ ", Latest: " + latestVersion);

showUpdateDialog(context, installedVersion, latestVersion);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M
org.gradle.parallel = true
android.useAndroidX = true
kotlin.code.style = official
version = 5.50.2
version = 5.50.3-dev.2
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fun gmsCoreSupportPatch(
) = bytecodePatch(
name = "GmsCore support",
description = "Allows the app to work without root by using a different package name when patched " +
"using a GmsCore instead of Google Play Services.",
"using a GmsCore instead of Google Play Services.",
) {
val gmsCoreVendorGroupIdOption = stringOption(
key = "gmsCoreVendorGroupId",
Expand Down Expand Up @@ -88,8 +88,9 @@ fun gmsCoreSupportPatch(
}

implementation.instructions.forEachIndexed insnLoop@{ index, instruction ->
val string = ((instruction as? Instruction21c)?.reference as? StringReference)?.string
?: return@insnLoop
val string =
((instruction as? Instruction21c)?.reference as? StringReference)?.string
?: return@insnLoop

// Apply transformation.
val transformedString = transform(string) ?: return@insnLoop
Expand All @@ -111,15 +112,15 @@ fun gmsCoreSupportPatch(
"com.google.android.gms",
in GMS_PERMISSIONS,
in GMS_AUTHORITIES,
-> if (string.startsWith("com.google")) {
-> if (string.startsWith("com.google")) {
string.replace("com.google", gmsCoreVendorGroupId)
} else {
"$gmsCoreVendorGroupId.$string"
}

in APP_PERMISSIONS,
in APP_AUTHORITIES,
-> "$toPackageName.$string"
-> "$toPackageName.$string"

else -> null
}
Expand Down Expand Up @@ -191,7 +192,7 @@ fun gmsCoreSupportPatch(
mainActivityOnCreateFingerprint.method.addInstruction(
0,
"invoke-static/range { p0 .. p0 }, $EXTENSION_CLASS_DESCRIPTOR->" +
"checkGmsCore(Landroid/app/Activity;)V",
"checkGmsCore(Landroid/app/Activity;)V",
)

// Change the vendor of GmsCore in the extension.
Expand Down Expand Up @@ -232,35 +233,39 @@ fun gmsCoreSupportResourcePatch(
execute {
addResources("shared", "misc.gms.gmsCoreSupportResourcePatch")

val toPackageName = setOrGetFallbackPackageName(toPackageName)

document("AndroidManifest.xml").use { document ->
document.getElementsByTagName("permission").asSequence().forEach { node ->
val nameElement = node.attributes.getNamedItem("android:name")
nameElement.textContent = toPackageName + nameElement.textContent
node.attributes.getNamedItem("android:name").apply {
APP_PERMISSIONS += textContent

textContent = "$toPackageName.$textContent"
}
}

document.getElementsByTagName("uses-permission").asSequence().forEach { node ->
val nameElement = node.attributes.getNamedItem("android:name")
if (nameElement.textContent in GMS_PERMISSIONS) {
nameElement.textContent.replace("com.google", gmsCoreVendorGroupId)
node.attributes.getNamedItem("android:name").apply {
if (textContent in GMS_PERMISSIONS) {
textContent.replace("com.google", gmsCoreVendorGroupId)
} else if (textContent in APP_PERMISSIONS) {
textContent = "$toPackageName.$textContent"
}
}
}

document.getElementsByTagName("provider").asSequence().forEach { node ->
val providerElement = node.attributes.getNamedItem("android:authorities")

providerElement.textContent = providerElement.textContent.split(";")
.joinToString(";") { authority ->
if (authority.startsWith("com.google")) {
authority.replace("com.google", gmsCoreVendorGroupId)
} else {
"$gmsCoreVendorGroupId.$authority"
node.attributes.getNamedItem("android:authorities").apply {
textContent = textContent.split(";")
.joinToString(";") { authority ->
APP_AUTHORITIES += authority
"$toPackageName.$authority"
}
}
}
}

document.getNode("manifest")
.attributes.getNamedItem("package").textContent =
setOrGetFallbackPackageName(toPackageName)
.attributes.getNamedItem("package").textContent = toPackageName

document.getNode("queries").appendChild(
document.createElement("package").apply {
Expand Down Expand Up @@ -336,7 +341,7 @@ private object Constants {
)

val GMS_AUTHORITIES = setOf(
"google.android.gms.fileprovider",
"com.google.android.gms.fileprovider",
"com.google.android.gms.auth.accounts",
"com.google.android.gms.chimera",
"com.google.android.gms.fonts",
Expand All @@ -346,7 +351,11 @@ private object Constants {
"subscribedfeeds",
)

val APP_PERMISSIONS = mutableSetOf<String>()
val APP_PERMISSIONS = mutableSetOf(
"org.microg.gms.STATUS_BROADCAST",
"org.microg.gms.EXTENDED_ACCESS",
"org.microg.gms.PROVISION"
)

val APP_AUTHORITIES = mutableSetOf<String>()
}
Loading