Windows ADB Bridge App

It now has 489 channels. Do the delete and append of the DirecTV SAT (Los Angeles) pack again and hopefully the channels are all there and working.

======================================
Success! Converted 489 channels.
Saved output to: directv_sat_la.json
======================================

It's no trouble, I made a batch script to convert M3U files to the proper json format for the app.

care to share?

I have made a few changes to improve the reliability of the app. I am testing it and will push the update in a few days after I make sure the the changes don't cause any unintended issues.

@Bobby_Vaughn and @bnhf

Gentlemen, we have success! Thank you again for all of your help!

Its built for the DirecTV M3U files. I need to make it more universal. You open command prompt in the folder the converter script and m3u txt file are in. Run this command
convert_m3u.bat input.txt output.json
example for the last run was
convert_m3u.bat directv_sat_la.txt directv_sat_la.json

<# : batch script wrapper
@echo off
setlocal

if "%~1"=="" (
    echo Usage: convert_m3u.bat input.txt output.json
    echo Example: convert_m3u.bat directv_sat_la.txt directv_sat_la.json
    exit /b 1
)

:: Set environment variables for the PowerShell script to read
set "INPUT_FILE=%~1"
set "OUTPUT_FILE=%~2"

:: Execute the PowerShell logic written below
powershell -NoProfile -ExecutionPolicy Bypass -Command "Invoke-Expression ([System.IO.File]::ReadAllText('%~f0'))"

exit /b %ERRORLEVEL%
#>

# --- PowerShell Logic Begins Here ---
$InputFile = $env:INPUT_FILE
$OutputFile = $env:OUTPUT_FILE

if ([string]::IsNullOrWhiteSpace($OutputFile)) {
    $OutputFile = "output.json"
}

# 1. Read the M3U content
$content = Get-Content $InputFile

$channels = @()
$currentChannel = @{}

# 2. Parse the lines
foreach ($line in $content) {
    if ($line.StartsWith('#EXTINF')) {
        # Extract Gracenote ID
        if ($line -match 'tvc-guide-stationid="(.*?)"') {
            $currentChannel.tvc_guide_stationid = $matches[1]
        } else {
            $currentChannel.tvc_guide_stationid = ""
        }
        
        # Extract Name
        $name = $line.Substring($line.IndexOf(',') + 1).Trim()
        $currentChannel.name = $name
        
        # Format the ID string (lowercase, replace non-alphanumeric with hyphens)
        $id = $name.ToLower() -replace '[^a-z0-9]', '-' -replace '-+', '-' -replace '^-|-$', ''
        $currentChannel.id = "$id-dtv"
    }
    elseif ($line.StartsWith('http')) {
        # Extract the deep link (everything after /tuner/ and convert ~ to /)
        $dl = $line.Substring($line.IndexOf('/tuner/') + 7) -replace '~', '/'
        $currentChannel.deep_link_content_id = $dl
        $currentChannel.provider_id = 'directv'
        
        # Ensure ordered properties for clean JSON output
        $obj = [ordered]@{
            name = $currentChannel.name
            id = $currentChannel.id
            provider_id = $currentChannel.provider_id
            deep_link_content_id = $currentChannel.deep_link_content_id
            tvc_guide_stationid = $currentChannel.tvc_guide_stationid
        }
        
        $channels += $obj
        $currentChannel = @{}
    }
}

# 3. Build Provider Header
$providerObj = [ordered]@{
    id = "directv"
    name = "DirecTV Ultimate"
    package_name = "com.att.tv"
    component = "com.clientapp.MainActivity"
    fire_package_name = "com.att.tv"
    fire_component = "com.clientapp.MainActivity"
    url_template = "dtvnow://deeplink.directvnow.com/play/channel/{id}"
    splash_delay_ms = 3000
}

# 4. Construct Final Object
$finalObj = [ordered]@{
    providers = @($providerObj)
    channels = $channels
}

# 5. Output formatted JSON
$finalObj | ConvertTo-Json -Depth 5 | Set-Content -Path $OutputFile -Encoding UTF8

Write-Host ""
Write-Host "======================================"
Write-Host "Success! Converted $($channels.Count) channels."
Write-Host "Saved output to: $OutputFile"
Write-Host "======================================"

I'll add the YouTube M3U support to it in the near future and post the updated file.

Our Onn Sticks must have different OS versions or something, I don't have either of those options. I did find "Stay Awake" (set to 'screen will never sleep') in the 'Developer options,' but I can't find any setting for "Networked standby."

That ok. You should be fine. This next release will have improvements in connecting with the streamers. If a network glitch happens, it will connect and not cause a hang up or freeze in the system. I also added a restart ADB button if it does happen.

In the instructions for ADB Bridge it mentions to turn Wireless Debugging on if the setting exists. I can confirm that this is automatically disabled every time the Onn stick is restarted. This does not, however, seem to affect the operation otherwise.

1 Like

That sucks. That is what happened with the CCwGTV devices when they updated to I think Android 16. Which Onn device do you have that does that?

https://www.walmart.com/ip/onn-Google-TV-Full-HD-Streaming-Device-New-2023/2262757145
and
https://www.walmart.com/ip/ONN-4K-STREAMING/18355665352

For some reason, it doesn't seem to matter if that's enabled or disabled. That 3rd streaming stick that I've been having trouble with won't work at all today. I'm starting to think it's something with the stick - going to factory reset and reconfigure.

On the newer versions, I added support for direct connection with a powered USB hub to connect the Google TV Streamers over USB instead of Wi-Fi to send the ADB commands. This overcomes the resetting the wireless debugging. The good thing is that the Onn sticks do not use a lot of power. You could run 2 of them off the same 3amp powered USB hub. I'll provide a really good how to later in the week. I use my CCWGTV that does the same wifi debug reset and it works fine with the powered hub.

Same with fire stick 4k max, hooked one up to power meter and it was only drawing a couple watts idling at home screen.

These things don't need to sleep and it avoids delays etc.

My server PC is in the basement. The 4-port HDMI encoder with Onn sticks is on the 2nd floor near my office where I can operate the sticks with the remotes, via VLC windows. I'm not sure the Onn remotes would reach the basement.

Good afternoon, and thank you for all the work put into this app. I have the app set up, and my provider is Spectrum. Since Spectrum doesn't use deep links, I have it configured to use keypress tuning. The keypresses work fine with the provider, but the channel setup doesn't seem to pass them through to the app. Is there anything I might be able to try to get this working? Thank you in advance for any help you can provide!

Show me an example channel macros setup you are using along with the provider settings you are using for Spectrum.
What setup are you using for the tuners?

These are the settings for the provider.


This is the setup for one of the channels.

I am using an Nvidia Shield TV for the tuner. I also tried a Chromecast with Google TV.

Your package name should be com.spectrum.stva.androidtv
Your Activity should be com.spectrum.stva.androidtv.ui.HostedMainActivity
You shouldn't need a URL Template since it is a macros tune.
How are you connecting the Nvidia Shield to the app? What are your Tuner settings?
Do you have it in developer mode?

These are my tuner settings:


Yes, the Nvidia Shield is in developer mode.
The Spectrum app will launch, but it won't tune the channel.
If I add the macros to tune the channel to the Provider settings it will tune the channel just fine.

Even after you add the correct Package Name and Activity to the provider?

Yes, even after I added the correct Package Name and Activity to the provider.