Dockerized Android is a container-based framework that permits to execute and Android Emulator inside Docker and keep an eye on it by way of a browser. This endeavor has been complicated in an effort to supply a place to begin for integrating mobile coverage portions into Cyber Levels however it may be used for any objective. Anyway, for building and checking out functions the endeavor urged is docker-android.
As discussed all over the transient description above this endeavor has been created in an effort to supply a place to begin for the advent of mobile coverage portions into Cyber Levels. For this causes the decisions already complicated and those who might be added all over the function will lend a hand the person to make more straightforward to setup a sensible simulation (for example for cover coaching). This README is moderately lengthy, perhaps you simply wanna skip to the “How you can run” phase.
The next alternatives are lately to be had:
- Run an Android Emulator in Docker
- Control the system throughout the internet browser
- Prepare packages
- Allow port forwarding
- Reboot the system
- Emulate SMS
- Use the terminal from the internet browser
- Connect additionally a bodily system
- Customise startup behaviour (see Configuration phase)
- Simply get ready a couple of cases
The endeavor consists by way of 3 number one items:
- Dockerized Android Core
- Dockerized Android UI
- Dockerized Android Example Supervisor (non-compulsory)
The next unravel supplies an overview of the particular building of the 2 necessary portions
The Core segment is the one that executes all of the processes had to run an Android Com-ponent (Emulated or Actual) inside a Docker container, additionally ex-posing some alternatives to the outdoor.
It’s with remember that one of the vital an important complicated phase becauseit has to keep watch over other processes in an effort to supply a choice of alternatives. The above unravel displays a transparent difference between long-lived processes,get started processes and util scripts. But even so, this unravel displays that there are 6 long-lived processes, this can be a little inaccuracy added to offer an strange research of the Core segment, in reality there are two other flavours of the Core segment:
- Core for Emulator
- Core for Actual Device
The principle architectural distinction is the only in regards to the long-lived processess: the Core for Emulator runs the long-lived emulator procedure whilst the Core for Actual Device runs the long-lived scrcpy procedure to show and keep an eye on the bodily system. The opposite portions are moderately similar with only some now not extraordinary sense to make use of a unique behaviour in line with the kind of the Core segment.
The UI segment supplies a easy way to make use of all of the alternatives uncovered by way of the backend and likewise provides the facility to show and keep an eye on the system. The person has to manually insert the care for of the Core segment and the corresponding ports (the port uncovered by way of the backend and the port uncovered by way of websockify); by way of this data setup it’s possible to modify the default ports (which may also be 4242 for the backend and 6080 for websockify).
Example Supervisor Phase
The Example Supervisor segment has the process to offer all of the informations(i.e., addresses and ports) in regards to the running Cores by way of a unmarried REST API. That is finished by way of writing a easy JSON configuration file that contains all of the details about the Cores which are provide into the docker-compose in an effort to avoid the painful approach of manually in conjunction with one by one. The advance of the JSON configuration file is the next:
"name": [Generic string to identify the device],
"care for": [Address of the component],
"core_port": [Port of the backend],
"vnc_port": [Port of VNC]
The secsi/dockerized-android-core-bare does not obtain any machine symbol and you are able to mount the folder on your host machine the place you will have all of the SDK folders
With the intention to see a complete instance on learn to run the platform it’s possible you are able to watch the docker-compose to be had all over the foundation tick list. This setup contains two other cores and likewise the non-compulsory Example Supervisor segment. When you understood the way it works it’s possible you are able to trade it to fulfill any wishes you will have.
Docker and Docker Compose need to be put in on your machine.
This platform behaves in a lot of ways in line with the host OS, here’s a desk that summarizes the present compatibility:
|Linux||Space house home windows||OS X|
|Core for Emulator||Whole compatibility||Now not supported (alternatively)||Now not supported|
|Core for Actual Device||Whole compatibility||Whole compatibility||Workaround|
For Space house home windows and OS X you need to use a Linux VM with nested virtualization.
To test in case your Linux machine helps nested virtualization it’s possible you are able to run the next instructions:
sudo apt organize cpu-checker
OS X Workaround for Actual Device
To make use of the Core for Actual Device on OS X it’s possible you are able to:
- Use the adb of the host
- Use wi-fi connection
adb -H host.docker.within devices
One line command to run
The command to start out out the usage of the framework with two cores and a example supervisor is solely:
You may additionally collect the photographs your self throught the scripts situated all over the utils folder
Likelihood is that you are able to configure some alternatives to customise the setup by way of ENV variables, the next desk supplies an inventory of them all:
|Phase||ENV Decide||Default price||Description|
|Core||CUSTOM_APP_DEFAULT_PORT||4242||Node.js backend port|
|Core||DEVICEINFO||Unset, however behaves like true||Lets in/Disables the system wisdom function|
|Core||TERMINAL||Unset, however behaves like true||Lets in/Disables the terminal function|
|Core||APK||Unset, however behaves like true||Lets in/Disables the organize APK function|
|Core||FORWARD||Unset, however behaves like true||Lets in/Disables the port ahead function|
|Core||SMS||Unset, however behaves like true||Lets in/Disables the SMS emulation function|
|Core||REBOOT||Unset, however behaves like true||Lets in/Disables the reboot function|
|Core||INSTALL_ON_STARTUP||false||Lets in/Disables the function that permits to position in all of the apks situated all over the/root/dockerized-android/apk folde|
|Core||ENABLE_UNKNOWN_SOURCES||false||Lets in the organize from unknown property|
|Core||REAL_DEVICE_SERIAL||unset||If there is also a few bodily system attached this price should be set to the serial of the system that are meant to be managed another way all of the different alternatives would possibly not paintings|
|Example Supervisor||DEFAULT_PORT||7373||Port of the REST API|
The REAL_DEVICE_SERIAL variable is fundamental if there is also a few bodily system hooked up because of if lacking not the remainder will paintings.
In spite of everything there’s a checklist of uncovered ports by way of each segment:
|Core||6080||Websockify (for noVNC)|
|Example Supervisor||7373||REST API|