Remaping Mi Box S remote buttons(e.g. Netflix, Prime video)

by DjBeNI

I managed to remap prime video button by using Tasker app which I sideloaded to my box. The only downside is that you need to disable the app which uses the button(do this first as step 0.)

I will try to make a video tutorial but don't expect great English :)

Steps:

1. Sideload tasker.apk ( https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm ) and install it!

2. In the Mi box settings go to

Apps - Special app access - Display over other apps

and enable the Tasker app

3. Open the Tasker app and follow these steps (I can't see the Tasker app in my applications so I use X-plore to start it)

  1. Add profile - go to "profile" tab and add a profile (the plus thing)
  2. select "event", then at the bottom of the popup type "logcat entry". then select it.
  3. at the "Component" row, click the magnifying glass icon, a popup shows up then press "ok"

Tasker will probably need special permissions to continue and you will need to use ADB from your PC(google what ADB is and how to use it. Follow these steps:

1.Enable Developer options
Go to settings-Device Preferences-About-Build and press the Build 7 or 8 times to enable
2.Go to Developer options and enable "USB debugging".
3.Also in Developer options go to "Select USB Configuration" and select MTP(Media Transfer Protocol)
4.Download adb zip as shown in this tutorial:
https://www.xda-developers.com/install-adb-windows-macos-linux/
5.Start ADB in cmd and run this command
adb connect 192.168.1.xx (change ip to your box IP. You can find your IP in your wifi options) Your box will ask you to accept connection so press OK.
6.Run this two commands:

adb shell pm grant net.dinglisch.android.taskerm android.permission.READ_LOGS

adb shell am force-stop net.dinglisch.android.taskerm
  1. you should be at homescreen with a play button hovering, press it to start recording, then press the assistant key once, then stop recording(I used Android box remote app on my phone as a mouse because i couldn't press the button with a remote).

  2. now you see a huge list of logcat events, and look for something that looks like: "WindowsManager: interceptKeyTq keycode=191 interactive=true keyguardActive=false policyFlags=22000001"

  3. then set it to whatever task you want. Press the + button in tasks, add a name, and choose an action. I choosed App action which now opens TvMate app when I press Prime video button

4. Try your new button :) Optionally you could get rid of the Prime video(or Netflix) logo by printing a sticker over it :D

My perfectly designed button

If you need any help just ask!!

pete_ri

How does this not happy a million upvotes?! I've tried so many things, and this is the only one that actually worked. Thanks so much for the info and walkthrough :)

xZetsubou

This didn't works for me and I got stuck at the same point for 3 hrsAfter I delete ( Slideload Launcher ) and used x-polre to run tasker it works fine for me with button thank you <3

Note* ( People can copy the codes and use it if they didn't know how to click on record )

Component: WindowsManager

Filter: interceptKeyTq keycode=191 interactive=true keyguardActive=false policyFlags=22000001

( keycode=191 prime video )

( I think keycode=1001 for Netflix )

( Mi Stick TV )

Marcel_33a

Thank you so much u/DjBeNI!

I tried to use the Button Mapper and Key Mapper apps to change the Netflix and Live Tv apps without any success. The only one that really works for these buttons is Tasker app.

I changed my Live Tv button to other TV app installed on my mi box s and the Netflix button I changed to use the Menu button 82 that select the subtitles menu on My Family Cinema App.

vadimbz

How did you go over tasker's initial disclaimer screen? I can't do anything on neither with remote, nor with air mouse.

CuvisTheConqueror

So what are the advantages to this method vs. a dedicated app like Button Mapper?

Mr_CaryGrant

u/DjBeNI Really thanks! Finally I will use both of that useless buttons for me :)

vadimbz

So I figured it out, but there's one small issue: when tasker accessibility service is turner on, OK button on home screen opens context menu instead of launching app itself. Any way around it?

Filip769

from where you got the tasker apk?

allethunder

Thanks for the tutorial. I tried this on MiTV Stick but is stuck on the Tasker download. Google Play says it's not possible to install Tasker on my MiTV Stick, so I can't buy the app. Has anyone managed to overcome this step?

yashwinner

Thank you! Was looking for a way to remap the "Live" on the mi box remote and this is the only tutorial that worked.

seb71524

I don't find tasker for mibox s and I google it and I dound the apk, I install it on mibox s and then the window appears to tell me "that I need to purchase the full version". I Tried another versions and others apk but the sale problem

avshi114

I tried everything but only the Netflix button works. When I try to remap the Live button nothing happens. I disable the "Live Channels" app from android settings. It's like it made the button die.

moshe_shtain

What I didn't understand is, how did you run adb commands from pc, because there is a conflict: usb debugging enabled turns off the usb port as it turns out.

olegtishin

Thank you so much! I've been using Tasker for a few years now, but didn't know it could help me for this purpose. I finally reassigned my buttons. I am very grateful to you!

lionn016

Thanks for sharing! It worked for me. Although, when you remap the buttons to YouTube, the app starts but then suddenly closes.

MonsonJohn

Unfortunately it's not working on my Xiaomi Stick 4k...

Its says to buy the app from play store. Tried the trial/mod versions.

xFixx_me

Xiaomi Stick 4k - > could start tasker with sideloader and even log the button click, BUT no button to save profile after i choose log entry

back-arrow at left upper corner not working (

Double_A_92

Btw this also works with Automate which is free. So you don't need to use a cracked Tasker to bypass the licensing issues on TV.

Also use the software ScrCpy on your PC to connect to your Android TV and control it with a mouse and keyboard. Much easier than any of those remote apps for your smartphone.

https://forum.xda-developers.com/t/guide-remapping-android-tv-remote-buttons.4433617/