ADBTuner: A "channel tuning" application for networked Google TV / Android TV devices

I'm having the issue using chomecast with google tv dongles. It seems to be time-based though I haven't been keeping a log (though perhaps I should start). I am running 4 dongles, and I do the approvals in pairs, and the approvals seem to happen in sync with those pairings. This eliminates external factors such as internet interruptions etc since the failures don't "cross the device groups" and seems to suggest some sort of expiration. I don't run any other external applications on/against the dongles.just adbtuner.

Even with the authorization popups, tuning does continue to work for a while if I just ignore it (I run everything in compatibility mode, if that makes a difference) but eventually it will finally start failing to tune because of the authorization issue (after perhaps a week or two..I've only let it go to that point once and it was a while ago so I don't recall the exact amount of time). I'm not sure if that gave you any additional information, but at least it's an additional data point.

Google search says:

Since Android 12 the adb authorization has an expiration date which can be disabled in developer options on the Android device

https://www.reddit.com/r/AndroidQuestions/s/mYqFp8A52n

You don't need to refresh, there's a switch in developer options to 'disable adb authorization timeout'. Just flip that one on and your current adb authorization should remain enabled. On stock Android it's the 3rd one down under the section 'debugging'

1 Like

Yep I found that post too a while back. Unfortunately, like the OP in that reddit post, the chromecasts don't seem to have that option that I can see.

On the other hand, they do have a "Verify Apps over USB" option which I can turn off. Maybe I can try that and see if it quits caring about the expired keys?

Try:

adb shell settings put global adb_allowed_connection_time 0

1 Like

Cool :slight_smile: That's exactly what the OP from the reddit post was asking for. Do you know if there's an easy-button way to do that from the adbtuner docker container, or do I need to add the adbtuner sdk stuff to another device in order to send that command?

Edit: I set up the adb tools on my laptop and was able to connect into each of the chromecasts to issue that command (also did the logcat thing for good measure...nothing jumped out at me as weird in the output). I'll keep an eye on these and report back my findings one way or the other as to if the connection time command had any effect. Thanks, Aman :slight_smile:

1 Like

Based on my testing thus far I'm not convinced that the ADB connection prompts are related to expiring authorizations.

But for testing purposes I just pushed an update to ADBTuner that automatically sets the adb_allowed_connection_time configuration option to see if it changes anything. Please post here if it helps.

1 Like

I have been using ADBTUNER since the initial release and have never had expiring authorizations. I only use FireSticks 4K.

@turtletank Same for me with ah4c. No expired authorizations in over a year of use -- using 6x FireStick 4K Max and Max 2. Maybe this is something device(s) or Android version(s) specific?

FireOS is old based on Android 11

2 Likes

is this under experimental or latest?

1 Like

Both

Thanks for the update.
Definitly always into anyting that stops us from having to keep allowing connection.
I think it helps when apps behave and require less baby-sitting.
The less i have to do the better.

1 Like

Mine have been behaving these days but I'm going to get the latest build anyway and report back if I get a reauth prompt. I have mine all set to the same priority so all 4 devices get exercised randomly.

So doing a "deep dive" on this now that I'm aware that DEFAULT_ADB_ALLOWED_CONNECTION_TIME exists.

Lets take a look at the Android source:

This "security" feature is most certainly a thing. It was added in Android 10.
https://cs.android.com/android/_/android/platform/frameworks/base/+/9e7b06efe38977cc083964700f2459b175380c69

 public static final long DEFAULT_ADB_ALLOWED_CONNECTION_TIME = 604800000;

        /**
         * When the user first connects their device to a system a prompt is displayed to allow
         * the adb connection with an option to 'Always allow' connections from this system. If the
         * user selects this always allow option then the connection time is stored for the system.
         * This setting is the time in ms within which a subsequent connection from an always
         * allowed system is allowed to reconnect without user interaction.
         ...
         */

From the above, the default for this is 7 days. Note: this is 7 days from the last successful connection, not 7 days from the initial connection.

A configuration option for this was added to the UI in 2020, I'm not sure what version of Android that corresponds with. Perhaps this explains the assumption that it's Android 12 related even though it existed prior to that.
https://cs.android.com/android/_/android/platform/packages/apps/Settings/+/3d8974723a2f6b11eafbcbac0229d363021de877

Implementation:
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java

The public keys are actually being stored in a secure Android KeyStore. If keys exist in /data/misc/adb/adb_keys they are automatically added to this keystore as needed.

With every connection, the stored "last connection time" attribute is updated for the associated key within the KeyStore. In addition, there is a background process that runs once a day to update the "last connection time" for any persistent connections.

Now with all this being said, I'm still unsure how to explain how I was able to take an Onn device out of the closet that hadn't been used in six months and connect without a prompt. :man_shrugging:

AH4C shells out to the cli version of adb which maintains an active connection. ADBTuner closes connections after each action. This probably explains why the popups were more common in ADBTuner even though the issue should technically affect both.

TLDR;
Hopefully this configuration change does help with devices that aren't used at least once a week. I think there might be some other things that might be causing failed authorizations, but this is a good start. Thanks @tmm1 for the heads up.

2 Likes

Just catching up after adding some more channels via this tool. ADBTuner is awesome.

Is this configuration change (the adb shell command tmm1 suggested above) something we're meant to enter manually if we're having authorization issues, or is it now incorporated into ADBTuner?

The current version ADBTuner will automatically set this configuration option on all connected devices.

2 Likes

The Deep Link to MSNBC is (randomly) back to working for me on my FireStick 4K. I still have the sim screen however. Before now I was getting a different channel loaded on the FireStick from the NBC app.

Anyone using linkpi and hls stream?

My adbtuner seems to get stuck trying to load the stream if I use hls, no issues when using .ts

Ok so im poking around this feed trying to understand it all... a few questions before i get the encoder etc
1 will this work with Optimum TV and or Fios TV
2 Is this replacing the missing NBC and Paramount channels??
3 do i still use Reg TVE in channels for unbroken channels??
4 Where do i get a channel list to import into this if any??

Thanks for any feedback