Compare commits

...
Author SHA1 Message Date
FojadrachiandClaude Opus 5.5 e0dd61fbb4 feat: Jam-Host abgeben, Einladen-Code mittig (1.7.0)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 11:12:43 +01:00
FojadrachiandClaude Opus 5.5 e3c534c569 fix(diag): Video-IDs ohne Ziffern und Titel/Namen in JSON-Zeilen entfernen
Gleiche Regel wie PC und Server (playtube-jam/src/diag.js).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 00:02:47 +01:00
9 changed files with 64 additions and 29 deletions
+2 -2
View File
@@ -19,8 +19,8 @@ android {
applicationId = "de.fojadrachi.playtube" applicationId = "de.fojadrachi.playtube"
minSdk = 26 minSdk = 26
targetSdk = 36 targetSdk = 36
versionCode = 11 versionCode = 12
versionName = "1.6.1" versionName = "1.7.0"
// Update-Quelle: eigener Gitea-Server (kein GitHub/Google Play). // Update-Quelle: eigener Gitea-Server (kein GitHub/Google Play).
buildConfigField("String", "UPDATE_SERVER", "\"https://git.fojadrachi.de\"") buildConfigField("String", "UPDATE_SERVER", "\"https://git.fojadrachi.de\"")
@@ -20,14 +20,20 @@ object DiagReport {
private val EMAIL = Regex("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}") private val EMAIL = Regex("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}")
private val URL_QUERY = Regex("(?i)(https?://[^\\s?#\"']+)[?#][^\\s\"']*") private val URL_QUERY = Regex("(?i)(https?://[^\\s?#\"']+)[?#][^\\s\"']*")
private val WORD = Regex("[A-Za-z0-9_-]+") private val WORD = Regex("[A-Za-z0-9_-]+")
private val JSON_PRIVATE = Regex("(?i)(\"(?:title|artist|author|album|name|query|q|search)\"\\s*:\\s*)\"(?:[^\"\\\\]|\\\\.)*\"")
private val CAMEL = Regex("^([A-Z][a-z]+)+$")
private val CONTROL = Regex("[\\u0000-\\u0008\\u000b-\\u001f\\u007f\\u202a-\\u202e\\u2066-\\u2069]") private val CONTROL = Regex("[\\u0000-\\u0008\\u000b-\\u001f\\u007f\\u202a-\\u202e\\u2066-\\u2069]")
/** YouTube-Video-ID: 11 Zeichen, Gross- und Kleinbuchstaben gemischt plus Ziffer, `_` oder `-`. */ /**
fun looksLikeVideoId(word: String): Boolean = * YouTube-Video-ID: 11 Zeichen aus `[A-Za-z0-9_-]`, entweder Buchstaben plus Ziffer/`_`/`-` oder
word.length == 11 && * mindestens zwei Grossbuchstaben ohne normale Schreibweise (nicht "Verbindunge", "ServerError").
word.all { it.isLetterOrDigit() && it.code < 128 || it == '_' || it == '-' } && */
word.any { it in 'A'..'Z' } && word.any { it in 'a'..'z' } && fun looksLikeVideoId(word: String): Boolean {
word.any { it.isDigit() || it == '_' || it == '-' } if (word.length != 11 || !word.all { it in 'A'..'Z' || it in 'a'..'z' || it in '0'..'9' || it == '_' || it == '-' }) return false
val letters = word.any { it.isLetter() }
if (word.any { it.isDigit() || it == '_' || it == '-' }) return letters
return word.count { it in 'A'..'Z' } >= 2 && word.any { it in 'a'..'z' } && !CAMEL.matches(word)
}
private fun looksLikeSecret(word: String): Boolean = private fun looksLikeSecret(word: String): Boolean =
word.length >= 20 && word.any { it.isDigit() } && word.any { it.isLetter() } word.length >= 20 && word.any { it.isDigit() } && word.any { it.isLetter() }
@@ -39,6 +45,7 @@ object DiagReport {
text = SECRET.replace(text) { "${it.groupValues[1]}${it.groupValues[2]}[entfernt]" } text = SECRET.replace(text) { "${it.groupValues[1]}${it.groupValues[2]}[entfernt]" }
text = EMAIL.replace(text, "[e-mail]") text = EMAIL.replace(text, "[e-mail]")
text = URL_QUERY.replace(text) { "${it.groupValues[1]}?[…]" } text = URL_QUERY.replace(text) { "${it.groupValues[1]}?[…]" }
text = JSON_PRIVATE.replace(text) { "${it.groupValues[1]}\"[entfernt]\"" }
text = WORD.replace(text) { text = WORD.replace(text) {
when { when {
looksLikeVideoId(it.value) -> "[video]" looksLikeVideoId(it.value) -> "[video]"
@@ -309,7 +309,18 @@ class JamActivity : AppCompatActivity() {
Unit Unit
} }
} else null } else null
members.addView(row(name, info, image = null, initial = m.name.take(1).uppercase(), action1 = null, action2 = kick).apply { // Host-Rolle abgeben (nur an jemanden, der gerade verbunden ist).
val makeHost = if (state.isHost && m.id != state.you && m.online) {
R.drawable.ic_crown to {
AlertDialog.Builder(this)
.setMessage(getString(R.string.jam_make_host_confirm, m.name))
.setPositiveButton(R.string.jam_make_host) { _, _ -> JamHub.send("transfer", "memberId" to m.id) }
.setNegativeButton(R.string.pc_cancel, null)
.show()
Unit
}
} else null
members.addView(row(name, info, image = null, initial = m.name.take(1).uppercase(), action1 = makeHost, action2 = kick).apply {
alpha = if (m.online) 1f else 0.5f alpha = if (m.online) 1f else 0.5f
}) })
} }
@@ -276,6 +276,7 @@ object JamHub {
"not_allowed" -> str(R.string.jam_error_not_allowed) "not_allowed" -> str(R.string.jam_error_not_allowed)
"queue_full" -> str(R.string.jam_error_queue_full) "queue_full" -> str(R.string.jam_error_queue_full)
"bad_video" -> str(R.string.jam_error_bad_video) "bad_video" -> str(R.string.jam_error_bad_video)
"offline" -> str(R.string.jam_error_offline)
"playlist_not_found" -> str(R.string.jam_error_playlist) "playlist_not_found" -> str(R.string.jam_error_playlist)
"rate_limited" -> str(R.string.jam_error_rate_limited) "rate_limited" -> str(R.string.jam_error_rate_limited)
else -> str(R.string.jam_error_other, error) else -> str(R.string.jam_error_other, error)
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Krone: "Zum Host machen" in der Teilnehmerliste des Jams -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFAAAAAA"
android:pathData="M5,16L3,5l5.5,5L12,4l3.5,6L21,5l-2,11H5zM19,19c0,0.6 -0.4,1 -1,1H6c-0.6,0 -1,-0.4 -1,-1v-1h14v1z" />
</vector>
+2
View File
@@ -383,6 +383,7 @@
<TextView <TextView
android:id="@+id/jamInviteCode" android:id="@+id/jamInviteCode"
android:layout_width="match_parent" android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:letterSpacing="0.1" android:letterSpacing="0.1"
@@ -393,6 +394,7 @@
<TextView <TextView
android:id="@+id/jamInviteLink" android:id="@+id/jamInviteLink"
android:layout_width="match_parent" android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/text_muted" android:textColor="@color/text_muted"
android:textIsSelectable="true" android:textIsSelectable="true"
+3
View File
@@ -96,6 +96,9 @@
<string name="jam_client_web">Browser</string> <string name="jam_client_web">Browser</string>
<string name="jam_kick">Entfernen</string> <string name="jam_kick">Entfernen</string>
<string name="jam_kick_confirm">%1$s aus dem Jam entfernen?</string> <string name="jam_kick_confirm">%1$s aus dem Jam entfernen?</string>
<string name="jam_make_host">Zum Host machen</string>
<string name="jam_make_host_confirm">%1$s zum Host machen? Du gibst damit die Host-Rechte ab.</string>
<string name="jam_error_offline">Diese Person ist gerade nicht verbunden.</string>
<string name="jam_play_now">Jetzt spielen</string> <string name="jam_play_now">Jetzt spielen</string>
<string name="jam_remove">Entfernen</string> <string name="jam_remove">Entfernen</string>
<string name="jam_added">Hinzugefügt: %1$s</string> <string name="jam_added">Hinzugefügt: %1$s</string>
@@ -23,6 +23,16 @@ class DiagReportTest {
assertEquals("a b", DiagReport.sanitize("a\u0000b")) assertEquals("a b", DiagReport.sanitize("a\u0000b"))
} }
@Test
fun removesIdsWithoutDigitsAndJsonTitles() {
assertEquals("jam: lade [video]", DiagReport.sanitize("jam: lade JZYXtUJcTws"))
assertEquals(
"Player: {\"artist\":\"[entfernt]\",\"id\":\"[video]\",\"title\":\"[entfernt]\",\"paused\":true}",
DiagReport.sanitize("Player: {\"artist\":\"Band\",\"id\":\"Rlg9P5i1bkQ\",\"title\":\"Mein Song\",\"paused\":true}"),
)
assertEquals("Verbindunge ServerError PlaytubeApp", DiagReport.sanitize("Verbindunge ServerError PlaytubeApp"))
}
@Test @Test
fun recognizesVideoIds() { fun recognizesVideoIds() {
assertTrue(DiagReport.looksLikeVideoId("dQw4w9WgXcQ")) assertTrue(DiagReport.looksLikeVideoId("dQw4w9WgXcQ"))
+10 -20
View File
@@ -1,27 +1,17 @@
## Playtube für Android 1.6.1 ## Playtube für Android 1.7.0
- **„Jetzt senden“ schickt immer einen Bericht:** Bisher passierte nach einer frischen Installation nichts - **Host abgeben:** Als Host kannst du die Rolle im Jam an jemand anderen übergeben – in der Liste „Dabei“ auf die
(„Keine neuen Einträge“). Jetzt geht auch ohne neue Einträge ein kurzer Bericht mit App-Version, Gerät Krone neben dem Namen tippen und bestätigen.
und dem Vermerk „manuell gesendet“ raus – so lässt sich prüfen, ob der Versand klappt. - **„Freunde einladen“:** Code und Link stehen jetzt mittig.
- **Jam genauer synchron:** Kleine Abweichungen werden unhörbar über ein leicht angepasstes Tempo ausgeglichen
(die Tonhöhe bleibt gleich); gesprungen wird erst ab 1 Sekunde Abweichung und mit Vorhalt.
Neu in 1.6.0: Diagnosedaten (Abstürze und Verbindungsfehler, ohne Cookies, Anmeldedaten, Suchanfragen oder Alles Weitere wie in 1.6.1. Voraussetzung: Android 8.0 oder neuer.
Songtitel), abschaltbar über das Zahnrad am rechten Rand. Details: playtube-ppp-eula.pages.dev/playtube/privacy/#diag
Voraussetzung: Android 8.0 oder neuer.
--- ---
## Playtube for Android 1.6.1 ## Playtube for Android 1.7.0
- **"Send now" always sends a report:** after a fresh install nothing happened ("No new entries"). Now a short - **Hand over host:** as host you can pass the role in a jam to someone else – tap the crown next to their name in
report with app version, device and the note "sent manually" goes out even without new entries – so you can the "Listening" list and confirm.
check that sending works. - **"Invite friends":** the code and link are now centered.
- **Jam stays more closely in sync:** small offsets are corrected inaudibly by slightly adjusting the playback
speed (pitch stays the same); it only seeks once the offset reaches 1 second, with a lead time.
New in 1.6.0: diagnostic data (crashes and connection errors, no cookies, sign-in data, searches or song titles), Everything else as in 1.6.1. Requires Android 8.0 or newer.
can be turned off via the gear button on the right edge. Details: playtube-ppp-eula.pages.dev/playtube/privacy/#diag
Requires Android 8.0 or newer.