mirror of
https://github.com/meowarex/rl-mobile.git
synced 2026-06-18 05:23:12 +10:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d5fea843e | |||
| d6bc889387 | |||
| 8501ccb0a9 | |||
| ad6ebac6ce | |||
| 320148e774 | |||
| d8e119eb4b | |||
| 10e5dcf365 |
+9
-5
@@ -7,7 +7,6 @@ import android.app.PendingIntent
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.net.Uri
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.core.app.ActivityCompat
|
import androidx.core.app.ActivityCompat
|
||||||
@@ -51,15 +50,15 @@ class UpdateCheckWorker(
|
|||||||
.maxByOrNull { it.first }
|
.maxByOrNull { it.first }
|
||||||
?: return Result.success()
|
?: return Result.success()
|
||||||
|
|
||||||
val (version, release) = latestVersion
|
val (version, _) = latestVersion
|
||||||
if (current >= version) return Result.success()
|
if (current >= version) return Result.success()
|
||||||
|
|
||||||
Log.i(BuildConfig.TAG, "Update available: $version (installed $current)")
|
Log.i(BuildConfig.TAG, "Update available: $version (installed $current)")
|
||||||
postUpdateNotification(version.toString(), release.htmlUrl)
|
postUpdateNotification(version.toString())
|
||||||
return Result.success()
|
return Result.success()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun postUpdateNotification(version: String, releaseUrl: String) {
|
private fun postUpdateNotification(version: String) {
|
||||||
val nm = applicationContext.getSystemService<NotificationManager>() ?: return
|
val nm = applicationContext.getSystemService<NotificationManager>() ?: return
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
@@ -78,10 +77,15 @@ class UpdateCheckWorker(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val launchIntent = applicationContext.packageManager
|
||||||
|
.getLaunchIntentForPackage(applicationContext.packageName)
|
||||||
|
?.apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) }
|
||||||
|
?: return
|
||||||
|
|
||||||
val pendingIntent = PendingIntent.getActivity(
|
val pendingIntent = PendingIntent.getActivity(
|
||||||
applicationContext,
|
applicationContext,
|
||||||
0,
|
0,
|
||||||
Intent(Intent.ACTION_VIEW, Uri.parse(releaseUrl)).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) },
|
launchIntent,
|
||||||
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT,
|
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"tidalVersionCode": 9090,
|
"tidalVersionCode": 9090,
|
||||||
"tidalApkUrl": "https://github.com/meowarex/rl-mobile/releases/download/latest/tidal-stock.apk",
|
"tidalApkUrl": "https://github.com/meowarex/rl-mobile/releases/download/latest/tidal-stock.apk",
|
||||||
"patchesVersion": "0.9.5"
|
"patchesVersion": "0.9.7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -344,7 +344,7 @@
|
|||||||
|
|
||||||
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||||
|
|
||||||
const-string v0, "&platform=Radiant%20Lyrics"
|
const-string v0, "&platform=rl-mobile"
|
||||||
|
|
||||||
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user