Skip to content

Deviceless Setup Instructions

If you have a Cosmog tier that includes access to deviceless mapping, you can follow these instructions to get them up and running. Setting up a virtualized Android environment is significantly less painful than configuring and managing ATVs.

Requirements

  • An arm64 (probably Ampere) machine running Linux (Ubuntu suggested)
    • Note: this github issue suggests that it's possible to run in an Ubuntu VM on Apple Silicon macOS devices, though I haven't tested this personally
    • I personally use Hetzner Ampere VMs for this. The 16 vCPU, 32GB RAM option can support about 300 workers at full speed, for about $20/month.
  • Docker
  • A Cosmog access level that includes deviceless mapping
  • Enough other Cosmog-connected devices to handle proxying Play Integrity attestations, or a Cinnabar subscription

Setup Steps

  1. Create a directory for your config files. I use ~/redroid-cosmog, but anything works

  2. Create a docker-compose.yml file with the following contents

    yml
    services:
        redroid1:
            privileged: true
            volumes:
                - ./data1:/data
            ports:
                - 127.0.0.1:5555:5555
            command:
                - androidboot.redroid_gpu_mode=guest
            container_name: redroid1
            image: 'abing7k/redroid:a11_magisk_arm'
            restart: always

    Copy the redroid1 block as many times as you want containers with Cosmog running. Make sure to change the external port number. On the aforementioned Netcup VPSs I'm using, I can run 10 Android containers with 50 workers each without much issue. I don't suggest attempting to run more than 50 workers in a single container (and unless otherwise negotiated, that's the max a Cosmog license allows).

  3. Create a file called send_configs.sh with the following contents, and then make sure to give it executable permissions

    bash
    #! /bin/bash
    
    adb connect localhost:5555
    adb -s localhost:5555 push ./configs/1.json /data/local/tmp/cosmog.json
    adb -s localhost:5555 shell am start -n com.sy1vi3.cosmog/com.sy1vi3.cosmog.MainActivity
    
    # copy for any other containers you have, making sure to change port numbers and config file names
    
    sleep 10
  4. Create Cosmog config files at ./configs/<1, 2, ...>.json (update the number accordingly to what's in the shell script). I suggest this default configuration.

    json
    {
        "device_id": "my_epic_virtual_device",
        "rotom_worker_endpoint": "wss://rotom.com:7070",
        "rotom_device_endpoint": "wss://rotom.com:7070/control",
        "use_local_safetynet": false,
        "public_ip": "36.21.50.90",
        "workers": 17,
        "token": "super secret token",
        "rotom_secret": "shhh dont tell anyone",
        "injection_delay_ms": 5000,
        "pogo_heartbeat_timeout_ms": 5000,
        "concurrent_login_override": 6,
        "worker_spawn_delay_override": 3500
    }
  5. Use ADB to install the Cosmog APK inside the redroid container. You will first need to install ADB, and then run adb -s localhost:5555 install cosmog.apk to install it.

  6. Install PM2, and start the send_configs script with the command pm2 start ./send_configs.sh --restart-delay 20000. This is needed because Redroid decides to clear /data/local/tmp every so often for some reason I haven't figured out yet.

  7. Cosmog should begin running

  8. Optional - set up Houndour. This is a tool that pays attention to Rotom and restarts a Cosmog deviceless container if it sees it inactive for too long, and properly configured can also take care of making mapping start up on server boot.

  9. Suggested - configure swap memory on your server with a size equal to the machine's actual memory. This can prevent OOM crashes that happen with many workers on one VPS sometimes, and doesn't hurt performance.

Some Notes on Deviceless Mapping

For almost all Cosmog users, deviceless scanning will still require you to have some amount of real devices connected, for the purposes of solving Play Integrity. Devices connected solely for solving Play Integrity do not count against usage limits.

This is only intended for very large-scale mapping, and as such isn't available in the lower tiers. After a certain point, you will get significantly better performance using ATVs as merely Play Integrity solvers, and letting all actual scanning devices run virtually.