When I was searching for a way to set up a proxy on Amazon Fire Tv (Fire OS 6), I found this helpful article: Viewing Secure (SSL/HTTPS) Traffic From Your App on Fire TVs Running Fire OS 6.
But after the third time I opened the control panel and entered an IP address and the port details, I decided to find a more efficient way.
So I explored the KeyEvent docs and found there all the keyevent commands that we will need to enable/disable a proxy:
Back button: adb shell input keyevent 4
Open Control Panel: adb shell am start -n com.amazon.ssm/.ControlPanel
Go down: adb shell input keyevent 20
Enter/Select: adb shell input keyevent 66
Go right: adb shell input keyevent 22
Go left: adb shell input keyevent 21
Delete forward: adb shell input keyevent 112
The last thing that we need is to find a way to run all the commands in one line. What I found is that when we need to run input key events, it’s more efficient and faster to concatenate commands with $$. And when we need to use other commands, we should use &&.
Enable proxy one line command:
adb shell “input keyevent 4 && am start -n com.amazon.ssm/.ControlPanel &&input keyevent 20 $$ input keyevent 20 $$ input keyevent 20 $$ input keyevent 20 $$ input keyevent 20 $$ input keyevent 20 $$ input keyevent 66 $$ input keyevent 22 $$ input keyevent 22 $$ input keyevent 66 $$ input keyevent 20 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 && input text ‘192.168.188.1‘ && input keyevent 20 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 $$ input keyevent 112 && input text ‘8888‘ && input keyevent 20 $$ input keyevent 20 $$ input keyevent 22 $$ input keyevent 66 $$ input keyevent 4″
Disable proxy one line command:
adb shell “input keyevent 4 && am start -n com.amazon.ssm/.ControlPanel &&input keyevent 20 $$ input keyevent 20 $$ input keyevent 20 $$ input keyevent 20 $$ input keyevent 20 $$ input keyevent 20 $$ input keyevent 66 $$ input keyevent 21 $$ input keyevent 21 $$ input keyevent 66 $$ input keyevent 20 $$ input keyevent 22 $$ input keyevent 66 $$ input keyevent 4”
If you are wondering why I used back keyevent ( keyevent 4) at the begining, it’s just before hiding the screensaver, prior to strating the process.
And Delete froward ( keyevent 112) was used in order to clean the field before entering the updated value.
Enjoy!