mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
show url prefix for debugging
This commit is contained in:
parent
9cea9ce457
commit
2fbd0a7a5e
1 changed files with 1 additions and 2 deletions
|
|
@ -4,7 +4,6 @@ import android.graphics.Bitmap
|
|||
import android.net.Uri
|
||||
import android.util.Base64
|
||||
import com.geeksville.mesh.MeshProtos
|
||||
import com.geeksville.util.anonymize
|
||||
import com.google.zxing.BarcodeFormat
|
||||
import com.google.zxing.MultiFormatWriter
|
||||
import com.journeyapps.barcodescanner.BarcodeEncoder
|
||||
|
|
@ -44,7 +43,7 @@ data class Channel(
|
|||
// Let the path optionally include the # character (or not) so we can work with old URLs generated by old versions of the app
|
||||
val pathRegex = Regex("$prefixRoot#?(.*)")
|
||||
val (base64) = pathRegex.find(urlStr)?.destructured
|
||||
?: throw MalformedURLException("Not a meshtastic URL: ${urlStr.anonymize(40)}")
|
||||
?: throw MalformedURLException("Not a meshtastic URL: ${urlStr.take(40)}")
|
||||
val bytes = Base64.decode(base64, base64Flags)
|
||||
|
||||
return MeshProtos.ChannelSettings.parseFrom(bytes)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue