I did it by installing optware here are the steps:
Optware
We need to install optware to manage packages in the apt-get style inside our android device. Of course, we won’t have all packages apt has, but we will have enough.
To install optware we need to access our device in debug mode this way we can access the console and run the optware install script.
To do so,
- install WIFI ADB in your device and run it, it will be accessible via
device-id:5555
.
- go to a linux (Debian, Ubuntu, ...) PC connected to the same network as the device and download the last Google ADT (download the right one for your linux platform)
add the following to the PATH system variable:
/folder_where_you_untar_adt/sdk/platform-tools
now download the optware script for android
- this script did not work for me out of the box due to unrecognized commands
- I did some modifications, for instance removing some controls (I did not care about the File Exists errors) and modifying some functions and calls to
adb shell
specifying the command between quotes (otherwise it would not work).
- Here you can see my file. You can compare it with the original using any merging tool to see the differences.
run your modified (or not) ./optware-install-via-adb.sh
run adb shell
this opens a shell to your device
if you type ls /data/opt
you should see a start.sh
(this is the
bootstrap for optware)
if you don't look at the optware script output there was some errors
(mostly related with some command it could not execute via adb or
something).
Now make cd /data/opt
Run start.sh
This should show you a Console and here you can type ipkg list
to see the packages you have available.
Dropbear
This is a SSH server useful to connect to your TV BOX. Here I assume you just runned start.sh
successfully. So inside your BusyBox (Console) do:
- type
ipkg install dropbear
-- to install the dropbear
- Then generate a server key:
dropbearkey -t rsa -f dropbear_rsa_host_key
- Now we will generate a key/pair to connect from a ssh client. This
is necessary because the root user in your android does not have a
password.
dropbearkey -t rsa -f id_rsa
dropbearkey -f id_rsa -y > id_rsa.pub
mkdir /data/dropbear/.ssh
cat id_rsa.pub > /data/dropbear/.ssh/authorized_keys
- Also convert the private key to a compatible format for openssh
dropbearconvert dropbear openssh id_rsa id_rsa_openssh
- Run
dropbear -r /data/dropbear/dropbear_rsa_host_key -E -s
- Now copy
id_rsa
and id_rsa_openssh
to your client
- If you use openssh in your client then type
ssh -i id_rsa_openssh root@your.tv.box.ip
Now you should have a busybox prompt in your hands
Reboot script
To ensure each time you reboot the bootstrap gets executed you have to:
Modify /data/opt/start.sh
by adding before the /bin/sh
line:
dropbear -r /data/dropbear/dropbear_rsa_host_key -E -s
Install the app Script Manager
In Script Manager click - Menu - Scripts - Browser and navigate to
the file /data/opt/start.sh. Then check the SU, Boot and Net icons.
This way each time your device is rebooted the start.sh
gets
executed with dropbear on.
I hope this helps you in some way,
Best regards