Skip to content

Commit

Permalink
ReVancedUpdater: MicroG RE -> ReVanced GmsCore
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Ledda <leonardoledda@gmail.com>
  • Loading branch information
LeddaZ committed Mar 28, 2024
1 parent db9a220 commit 7a611c8
Show file tree
Hide file tree
Showing 64 changed files with 173 additions and 166 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<queries>
<package android:name="app.revanced.android.youtube" />
<package android:name="app.revanced.android.apps.youtube.music" />
<package android:name="com.mgoogle.android.gms" />
<package android:name="app.revanced.android.gms" />
</queries>

<application
Expand Down
19 changes: 9 additions & 10 deletions app/src/main/java/it/leddaz/revancedupdater/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ class MainActivity : AppCompatActivity() {
}

/**
* Detects if MicroG RE is installed.
* @return MicroG RE installation status
* Detects if ReVanced GmsCore is installed.
* @return ReVanced GmsCore installation status
*/
private fun isMicroGInstalled(): Boolean {
try {
Expand All @@ -161,7 +161,7 @@ class MainActivity : AppCompatActivity() {

/**
* Gets the installed and latest versions of YouTube ReVanced,
* ReVanced Music, MicroG RE and ReVanced Updater.
* ReVanced Music, ReVanced GmsCore and ReVanced Updater.
* @property callback callback used to detect if the download was
* successful
*/
Expand Down Expand Up @@ -203,7 +203,7 @@ class MainActivity : AppCompatActivity() {
"https://raw.githubusercontent.com/LeddaZ/revanced-repo/main/updater.json"
val updaterAPIUrl = "https://api.github.com/repos/LeddaZ/ReVancedUpdater/releases/latest"
val updaterCommitUrl = "https://api.github.com/repos/LeddaZ/ReVancedUpdater/commits/master"
val microGAPIUrl = "https://api.github.com/repos/WSTxda/MicroG-RE/releases/latest"
val microGAPIUrl = "https://api.github.com/repos/ReVanced/GmsCore/releases/latest"
var reVancedReply: ReVancedJSONObject
var updaterReleaseReply: UpdaterReleaseJSONObject
var updaterDebugReply: UpdaterDebugJSONObject
Expand Down Expand Up @@ -253,9 +253,8 @@ class MainActivity : AppCompatActivity() {
val microGRequest = StringRequest(GET, microGAPIUrl, { response ->
microGReply =
Gson().fromJson(response, object : TypeToken<MicroGJSONObject>() {}.type)
latestMicroGVersion = Version(microGReply.latestMicroGVersion)
microGDownloadUrl = "https://github.com/WSTxda/MicroG-RE/releases/download/" +
latestMicroGVersion + "/MicroG_RE_" + latestMicroGVersion + ".apk"
latestMicroGVersion = Version(microGReply.latestMicroGVersion.substring(1))
microGDownloadUrl = microGReply.assets.firstOrNull()?.latestMicroGUrl.toString()
callback.onSuccess()
}, {})

Expand Down Expand Up @@ -321,7 +320,7 @@ class MainActivity : AppCompatActivity() {
}

/**
* Downloads MicroG RE when the button is clicked.
* Downloads ReVanced GmsCore when the button is clicked.
* @property view the view which contains the button.
*/
fun downloadMicroG(view: View) {
Expand Down Expand Up @@ -377,7 +376,7 @@ class MainActivity : AppCompatActivity() {
getString(R.string.installed_app_version, APP_VERSION)
}
} else if (packageName == MICROG_PACKAGE) {
installedVersion.version = pInfo.versionName.substring(0, 3)
installedVersion.version = pInfo.versionName
installedTextView.text =
getString(R.string.installed_app_version, installedVersion.version)
} else {
Expand Down Expand Up @@ -426,7 +425,7 @@ class MainActivity : AppCompatActivity() {
updateStatusTextView.text = getString(R.string.update_available)
button.isEnabled = true
} else if (installedVersion.compareTo(latestVersion) == 0) {
if (packageName.startsWith("app.revanced")) {
if (packageName != MICROG_PACKAGE) {
var latestHash = getLatestReVancedHash()
if (packageName == MUSIC_PACKAGE)
latestHash = getLatestReVancedMusicHash()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@ import com.google.gson.annotations.SerializedName

data class MicroGJSONObject(
@SerializedName("tag_name")
val latestMicroGVersion: String
val latestMicroGVersion: String,

@SerializedName("assets")
val assets: List<Asset>,
)

data class Asset(
@SerializedName("browser_download_url")
val latestMicroGUrl: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object CommonStuff {
// Package names
const val REVANCED_PACKAGE = "app.revanced.android.youtube"
const val MUSIC_PACKAGE = "app.revanced.android.apps.youtube.music"
const val MICROG_PACKAGE = "com.mgoogle.android.gms"
const val MICROG_PACKAGE = "app.revanced.android.gms"
const val UPDATER_PACKAGE = "it.leddaz.revancedupdater"

/**
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-af-rZA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<string name="bottom_bar_refresh">Refresh</string>
<string name="none">none</string>
<string name="music_download_button_description">Download ReVanced Music</string>
<string name="microg_download_button_description">Download MicroG RE</string>
<string name="microg_download_button_description">Download ReVanced GmsCore</string>
<string name="updater_download_button_description">Download ReVanced Updater</string>
<string name="invalid">invalid</string>
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-af/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-ar-rSA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<string name="bottom_bar_refresh">Refresh</string>
<string name="none">none</string>
<string name="music_download_button_description">Download ReVanced Music</string>
<string name="microg_download_button_description">Download MicroG RE</string>
<string name="microg_download_button_description">Download ReVanced GmsCore</string>
<string name="updater_download_button_description">Download ReVanced Updater</string>
<string name="invalid">invalid</string>
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-ca-rES/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<string name="bottom_bar_refresh">Refresh</string>
<string name="none">none</string>
<string name="music_download_button_description">Download ReVanced Music</string>
<string name="microg_download_button_description">Download MicroG RE</string>
<string name="microg_download_button_description">Download ReVanced GmsCore</string>
<string name="updater_download_button_description">Download ReVanced Updater</string>
<string name="invalid">invalid</string>
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-ca/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-cs-rCZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<string name="bottom_bar_refresh">Refresh</string>
<string name="none">none</string>
<string name="music_download_button_description">Download ReVanced Music</string>
<string name="microg_download_button_description">Download MicroG RE</string>
<string name="microg_download_button_description">Download ReVanced GmsCore</string>
<string name="updater_download_button_description">Download ReVanced Updater</string>
<string name="invalid">invalid</string>
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-da-rDK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<string name="bottom_bar_refresh">Refresh</string>
<string name="none">none</string>
<string name="music_download_button_description">Download ReVanced Music</string>
<string name="microg_download_button_description">Download MicroG RE</string>
<string name="microg_download_button_description">Download ReVanced GmsCore</string>
<string name="updater_download_button_description">Download ReVanced Updater</string>
<string name="invalid">invalid</string>
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-de-rDE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<string name="bottom_bar_refresh">Refresh</string>
<string name="none">none</string>
<string name="music_download_button_description">Download ReVanced Music</string>
<string name="microg_download_button_description">Download MicroG RE</string>
<string name="microg_download_button_description">Download ReVanced GmsCore</string>
<string name="updater_download_button_description">Download ReVanced Updater</string>
<string name="invalid">invalid</string>
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-el-rGR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<string name="bottom_bar_refresh">Refresh</string>
<string name="none">none</string>
<string name="music_download_button_description">Download ReVanced Music</string>
<string name="microg_download_button_description">Download MicroG RE</string>
<string name="microg_download_button_description">Download ReVanced GmsCore</string>
<string name="updater_download_button_description">Download ReVanced Updater</string>
<string name="invalid">invalid</string>
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<string name="invalid_version_detected">Invalid version detected. Uninstall existing apps.</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="microg_dialog_title">MicroG RE not installed</string>
<string name="microg_dialog_text">MicroG RE is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="microg_dialog_title">ReVanced GmsCore not installed</string>
<string name="microg_dialog_text">ReVanced GmsCore is required to log in to your Google account on ReVanced apps. Do you want to install it now?</string>
<string name="bottom_bar_about">About</string>
<string name="about_dialog_title">About this app</string>
<string name="download_button_text">Download</string>
Expand Down
Loading

0 comments on commit 7a611c8

Please sign in to comment.