mirror of
https://github.com/meowarex/rl-mobile.git
synced 2026-08-26 22:17:44 +10:00
feat(waze patch): waze media menu browse source options
This commit is contained in:
@@ -140,6 +140,22 @@ enum class KnownPatch(
|
|||||||
titleRes = R.string.patch_waze_integration_title,
|
titleRes = R.string.patch_waze_integration_title,
|
||||||
descRes = R.string.patch_waze_integration_desc,
|
descRes = R.string.patch_waze_integration_desc,
|
||||||
default = Disabled,
|
default = Disabled,
|
||||||
|
advancedOptions = listOf(
|
||||||
|
PatchOption.Choice(
|
||||||
|
key = "browse_root",
|
||||||
|
titleRes = R.string.patch_waze_browse_root_title,
|
||||||
|
entries = listOf(
|
||||||
|
ChoiceEntry(R.string.patch_waze_root_auto, value = "ROOT_AUTO"),
|
||||||
|
ChoiceEntry(R.string.patch_waze_root_home, value = "HOME_V2::home_page_v2_id"),
|
||||||
|
ChoiceEntry(
|
||||||
|
R.string.patch_waze_root_recents,
|
||||||
|
value = "RECENTLY_PLAYED::home/pages/CONTINUE_LISTEN_TO/view-all",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
defaultIndex = 0,
|
||||||
|
token = "RL_WAZE_ROOT_ID",
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
LyricsProgressPill(
|
LyricsProgressPill(
|
||||||
order = 40,
|
order = 40,
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@ sealed interface PatchOption {
|
|||||||
data class Choice(
|
data class Choice(
|
||||||
override val key: String,
|
override val key: String,
|
||||||
@StringRes override val titleRes: Int,
|
@StringRes override val titleRes: Int,
|
||||||
@StringRes override val descRes: Int,
|
@StringRes override val descRes: Int = 0,
|
||||||
val entries: List<ChoiceEntry>,
|
val entries: List<ChoiceEntry>,
|
||||||
val defaultIndex: Int = 0,
|
val defaultIndex: Int = 0,
|
||||||
val requiresOption: String? = null,
|
val requiresOption: String? = null,
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ private fun PatchOption.toSpec(resolve: (Int) -> String): OptionSpec = when (thi
|
|||||||
is PatchOption.Choice -> OptionSpec.Choice(
|
is PatchOption.Choice -> OptionSpec.Choice(
|
||||||
key = key,
|
key = key,
|
||||||
title = resolve(titleRes),
|
title = resolve(titleRes),
|
||||||
description = resolve(descRes),
|
description = if (descRes != 0) resolve(descRes) else "",
|
||||||
entries = entries.map { resolve(it.labelRes) },
|
entries = entries.map { resolve(it.labelRes) },
|
||||||
defaultIndex = defaultIndex,
|
defaultIndex = defaultIndex,
|
||||||
values = entries.map { it.value ?: "" },
|
values = entries.map { it.value ?: "" },
|
||||||
|
|||||||
+33
@@ -378,6 +378,39 @@ private fun ChoiceOptionRow(
|
|||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (entries.size > 3) {
|
||||||
|
var expanded by rememberSaveable { mutableStateOf(false) }
|
||||||
|
val selectedLabel = entries.getOrNull(selectedIndex).orEmpty()
|
||||||
|
|
||||||
|
Box(modifier = Modifier.fillMaxWidth()) {
|
||||||
|
OutlinedButton(
|
||||||
|
onClick = { expanded = true },
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = selectedLabel,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
DropdownMenu(
|
||||||
|
expanded = expanded,
|
||||||
|
onDismissRequest = { expanded = false },
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
) {
|
||||||
|
entries.forEachIndexed { index, entry ->
|
||||||
|
DropdownMenuItem(
|
||||||
|
text = { Text(entry) },
|
||||||
|
onClick = {
|
||||||
|
onSelect(index)
|
||||||
|
expanded = false
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return@Column
|
||||||
|
}
|
||||||
SingleChoiceSegmentedButtonRow(modifier = Modifier.fillMaxWidth()) {
|
SingleChoiceSegmentedButtonRow(modifier = Modifier.fillMaxWidth()) {
|
||||||
entries.forEachIndexed { index, entry ->
|
entries.forEachIndexed { index, entry ->
|
||||||
SegmentedButton(
|
SegmentedButton(
|
||||||
|
|||||||
@@ -288,6 +288,10 @@
|
|||||||
>Reveals TIDAL\'s hidden Debug Menu in Settings. (Unlocks Feature Flags & the legacy Debug Options)</string>
|
>Reveals TIDAL\'s hidden Debug Menu in Settings. (Unlocks Feature Flags & the legacy Debug Options)</string>
|
||||||
<string name="patch_waze_integration_title">Waze Integration</string>
|
<string name="patch_waze_integration_title">Waze Integration</string>
|
||||||
<string name="patch_waze_integration_desc">Control TIDAL playback from the Waze app</string>
|
<string name="patch_waze_integration_desc">Control TIDAL playback from the Waze app</string>
|
||||||
|
<string name="patch_waze_browse_root_title">Media Menu</string>
|
||||||
|
<string name="patch_waze_root_auto">Auto Menu</string>
|
||||||
|
<string name="patch_waze_root_home">Home</string>
|
||||||
|
<string name="patch_waze_root_recents">Recents</string>
|
||||||
<string name="patch_enable_legacy_ui_title">Enable Legacy UI</string>
|
<string name="patch_enable_legacy_ui_title">Enable Legacy UI</string>
|
||||||
<string
|
<string
|
||||||
name="patch_enable_legacy_ui_desc"
|
name="patch_enable_legacy_ui_desc"
|
||||||
|
|||||||
+16
-1
@@ -219,7 +219,22 @@
|
|||||||
"extensionFiles": ["radiant/WazeInitReceiver.smali", "radiant/WazeServiceConnection.smali"],
|
"extensionFiles": ["radiant/WazeInitReceiver.smali", "radiant/WazeServiceConnection.smali"],
|
||||||
"title": "Waze Integration",
|
"title": "Waze Integration",
|
||||||
"description": "Control TIDAL playback from the Waze app",
|
"description": "Control TIDAL playback from the Waze app",
|
||||||
"default": true
|
"default": true,
|
||||||
|
"advancedOptions": [
|
||||||
|
{
|
||||||
|
"type": "choice",
|
||||||
|
"key": "browse_root",
|
||||||
|
"title": "Media Menu",
|
||||||
|
"entries": ["Auto Menu", "Home", "Recents"],
|
||||||
|
"values": [
|
||||||
|
"ROOT_AUTO",
|
||||||
|
"HOME_V2::home_page_v2_id",
|
||||||
|
"RECENTLY_PLAYED::home/pages/CONTINUE_LISTEN_TO/view-all"
|
||||||
|
],
|
||||||
|
"defaultIndex": 0,
|
||||||
|
"token": "RL_WAZE_ROOT_ID"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "DebugMenuUnlock",
|
"id": "DebugMenuUnlock",
|
||||||
|
|||||||
@@ -1,27 +1,59 @@
|
|||||||
--- a/pb/c.smali
|
--- a/pb/c.smali
|
||||||
+++ b/pb/c.smali
|
+++ b/pb/c.smali
|
||||||
@@ -700,0 +701,24 @@
|
@@ -801,6 +801,26 @@
|
||||||
+ iget-object v15, v1, Lcom/aspiro/wamp/util/y$a;->b:Ljava/lang/String;
|
-
|
||||||
+
|
+
|
||||||
+ const-string/jumbo v14, "com.waze"
|
.line 236
|
||||||
|
:goto_8
|
||||||
|
+ const-string/jumbo v5, "com.waze"
|
||||||
+
|
+
|
||||||
+ invoke-static {v15, v14}, Lkotlin/jvm/internal/n;->b(Ljava/lang/Object;Ljava/lang/Object;)Z # check caller
|
+ invoke-static {v3, v5}, Lkotlin/jvm/internal/n;->b(Ljava/lang/Object;Ljava/lang/Object;)Z # package match
|
||||||
+
|
+
|
||||||
+ move-result v12
|
+ move-result v5
|
||||||
+
|
+
|
||||||
+ if-eqz v12, :rl_waze_done
|
+ if-eqz v5, :rl_waze_done
|
||||||
+
|
+
|
||||||
+ iget-object v15, v1, Lcom/aspiro/wamp/util/y$a;->d:Ljava/lang/String; # caller cert
|
+ const-string/jumbo v5, "03:63:7f:6c:5d:8f:60:4e:6f:db:79:a6:ff:bf:a5:78:de:4e:31:8f:8d:a2:2f:c6:10:66:65:24:7f:88:07:d7" # Waze cert
|
||||||
+
|
+
|
||||||
+ const-string v14, "03:63:7f:6c:5d:8f:60:4e:6f:db:79:a6:ff:bf:a5:78:de:4e:31:8f:8d:a2:2f:c6:10:66:65:24:7f:88:07:d7" # Waze cert
|
+ invoke-static {v2, v5}, Lkotlin/jvm/internal/n;->b(Ljava/lang/Object;Ljava/lang/Object;)Z # cert match
|
||||||
+
|
+
|
||||||
+ invoke-static {v15, v14}, Lkotlin/jvm/internal/n;->b(Ljava/lang/Object;Ljava/lang/Object;)Z # check cert
|
+ move-result v5
|
||||||
+
|
+
|
||||||
+ move-result v12 # cert match
|
+ if-eqz v5, :rl_waze_done
|
||||||
+
|
|
||||||
+ if-eqz v12, :rl_waze_done # reject mismatch
|
|
||||||
+
|
+
|
||||||
+ goto :goto_9 # trust Waze
|
+ goto :goto_9 # trust Waze
|
||||||
+
|
+
|
||||||
+ :rl_waze_done
|
+ :rl_waze_done
|
||||||
+
|
+
|
||||||
|
invoke-static {}, Landroid/os/Process;->myUid()I
|
||||||
|
-
|
||||||
|
+
|
||||||
|
.line 237
|
||||||
|
@@ -957,6 +977,26 @@
|
||||||
|
:goto_b
|
||||||
|
if-eqz v2, :cond_14
|
||||||
|
-
|
||||||
|
+
|
||||||
|
+ const-string/jumbo v1, "com.waze"
|
||||||
|
+
|
||||||
|
+ invoke-static {v3, v1}, Lkotlin/jvm/internal/n;->b(Ljava/lang/Object;Ljava/lang/Object;)Z # package match
|
||||||
|
+
|
||||||
|
+ move-result v1
|
||||||
|
+
|
||||||
|
+ if-eqz v1, :rl_waze_recent_root_done_2
|
||||||
|
+
|
||||||
|
+ new-instance v1, Landroidx/media/MediaBrowserServiceCompat$BrowserRoot;
|
||||||
|
+
|
||||||
|
+ const-string/jumbo v4, "__RL_WAZE_ROOT_ID__"
|
||||||
|
+
|
||||||
|
+ const/4 v5, 0x0
|
||||||
|
+
|
||||||
|
+ invoke-direct {v1, v4, v5}, Landroidx/media/MediaBrowserServiceCompat$BrowserRoot;-><init>(Ljava/lang/String;Landroid/os/Bundle;)V
|
||||||
|
+
|
||||||
|
+ return-object v1
|
||||||
|
+
|
||||||
|
+ :rl_waze_recent_root_done_2
|
||||||
|
+
|
||||||
|
.line 306
|
||||||
|
.line 307
|
||||||
|
iget-object v1, v0, Lpb/c;->c:Ljava/util/Map;
|
||||||
|
|||||||
Reference in New Issue
Block a user