From 93d1c58b80c3e1af1c7817f7d1a7c6b1eb9011c7 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Thu, 4 Jan 2024 22:51:52 +0100 Subject: [PATCH] Update bookworm --- builder/pwnagotchi.json.pkr.hcl | 8 ++++---- builder/raspberrypi32.yml | 25 ++----------------------- pwnagotchi/agent.py | 8 ++++---- pwnagotchi/defaults.toml | 1 - pwnagotchi/ui/view.py | 12 ++++++++++-- requirements.txt | 4 ---- 6 files changed, 20 insertions(+), 38 deletions(-) diff --git a/builder/pwnagotchi.json.pkr.hcl b/builder/pwnagotchi.json.pkr.hcl index 8f8bf7c1..72d27956 100644 --- a/builder/pwnagotchi.json.pkr.hcl +++ b/builder/pwnagotchi.json.pkr.hcl @@ -22,8 +22,8 @@ variable "pwn_version" { } source "arm" "rpi64-pwnagotchi" { - file_checksum_url = "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-06/2023-12-05-raspios-bookworm-arm64-lite.img.xz.sha256" - file_urls = ["https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-06/2023-12-05-raspios-bookworm-arm64-lite.img.xz"] + file_checksum_url = "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz.sha256" + file_urls = ["https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz"] file_checksum_type = "sha256" file_target_extension = "xz" file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] @@ -51,8 +51,8 @@ source "arm" "rpi64-pwnagotchi" { } } source "arm" "rpi32-pwnagotchi" { - file_checksum_url = "https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-12-06/2023-12-05-raspios-bookworm-armhf-lite.img.xz.sha256" - file_urls = ["https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-12-06/2023-12-05-raspios-bookworm-armhf-lite.img.xz"] + file_checksum_url = "https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-12-11/2023-12-11-raspios-bookworm-armhf-lite.img.xz.sha256" + file_urls = ["https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-12-11/2023-12-11-raspios-bookworm-armhf-lite.img.xz"] file_checksum_type = "sha256" file_target_extension = "xz" file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] diff --git a/builder/raspberrypi32.yml b/builder/raspberrypi32.yml index 96ae642e..ccd7c5ae 100644 --- a/builder/raspberrypi32.yml +++ b/builder/raspberrypi32.yml @@ -85,12 +85,6 @@ opwngrid: source: "https://github.com/jayofelony/pwngrid.git" url: "https://github.com/jayofelony/pwngrid/releases/download/v1.10.5/pwngrid-1.10.5-armhf.zip" - torch: - wheel: "torch-2.1.0a0+gita8e7c98-cp311-cp311-linux_armv6l.whl" - url: "https://github.com/Sniffleupagus/Torch4Pizero/releases/download/py0torch-bookworm/torch-2.1.0a0+gita8e7c98-cp311-cp311-linux_armv6l.whl" - torchvision: - wheel: "torchvision-0.16.0+fbb4cc5-cp311-cp311-linux_armv6l.whl" - url: "https://github.com/Sniffleupagus/Torch4Pizero/releases/download/py0torch-bookworm/torchvision-0.16.0+fbb4cc5-cp311-cp311-linux_armv6l.whl" apt: downgrade: - libpcap-dev_1.9.1-4_armhf.deb @@ -337,27 +331,12 @@ repo: https://github.com/jayofelony/pwnagotchi-torch.git dest: /usr/local/src/pwnagotchi - - name: download torch whl - get_url: - url: "{{ packages.torch.url }}" - dest: /usr/local/src/ - - - name: download torchvision whl - get_url: - url: "{{ packages.torchvision.url }}" - dest: /usr/local/src/ - - - name: install 32-bit pwnagotchi wheel and dependencies with 32-bit torch wheels - pip: - name: - - "{{ packages.torch.url }}" - - "{{ packages.torchvision.url }}" - extra_args: "--no-cache-dir --break-system-packages" - - name: build pwnagotchi wheel command: "pip install . --no-cache-dir --break-system-packages" args: chdir: /usr/local/src/pwnagotchi + environment: + ARCHFLAGS: "-arch armv6l" - name: create /usr/local/share/pwnagotchi/ folder file: diff --git a/pwnagotchi/agent.py b/pwnagotchi/agent.py index 178a4acb..e5715f4d 100644 --- a/pwnagotchi/agent.py +++ b/pwnagotchi/agent.py @@ -14,12 +14,12 @@ from pwnagotchi.automata import Automata from pwnagotchi.log import LastSession from pwnagotchi.bettercap import Client from pwnagotchi.mesh.utils import AsyncAdvertiser -from pwnagotchi.ai.train import AsyncTrainer +# from pwnagotchi.ai.train import AsyncTrainer RECOVERY_DATA_FILE = '/root/.pwnagotchi-recovery' -class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer): +class Agent(Client, Automata, AsyncAdvertiser): def __init__(self, view, config, keypair): Client.__init__(self, config['bettercap']['hostname'], config['bettercap']['scheme'], @@ -28,7 +28,7 @@ class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer): config['bettercap']['password']) Automata.__init__(self, config, view) AsyncAdvertiser.__init__(self, config, view, keypair) - AsyncTrainer.__init__(self, config) + # AsyncTrainer.__init__(self, config) self._started_at = time.time() self._filter = None if not config['main']['filter'] else re.compile(config['main']['filter']) @@ -129,7 +129,7 @@ class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer): time.sleep(1) def start(self): - self.start_ai() + # self.start_ai() self._wait_bettercap() self.setup_events() self.set_starting() diff --git a/pwnagotchi/defaults.toml b/pwnagotchi/defaults.toml index 46893ba4..2b6fb3e5 100644 --- a/pwnagotchi/defaults.toml +++ b/pwnagotchi/defaults.toml @@ -3,7 +3,6 @@ main.lang = "en" main.confd = "/etc/pwnagotchi/conf.d/" main.custom_plugin_repos = [ "https://github.com/jayofelony/pwnagotchi-torch-plugins/archive/master.zip", - "https://github.com/evilsocket/pwnagotchi-plugins-contrib/archive/master.zip", "https://github.com/tisboyo/pwnagotchi-pisugar2-plugin/archive/master.zip", "https://github.com/nullm0ose/pwnagotchi-plugin-pisugar3/archive/master.zip", "https://github.com/Sniffleupagus/pwnagotchi_plugins/archive/master.zip", diff --git a/pwnagotchi/ui/view.py b/pwnagotchi/ui/view.py index 990fa09a..be7fb0c7 100644 --- a/pwnagotchi/ui/view.py +++ b/pwnagotchi/ui/view.py @@ -16,8 +16,8 @@ from pwnagotchi.ui.components import * from pwnagotchi.ui.state import State from pwnagotchi.voice import Voice -WHITE = 0x00 -BLACK = 0xff +WHITE = 0xff +BLACK = 0x00 ROOT = None @@ -28,6 +28,14 @@ class View(object): # setup faces from the configuration in case the user customized them faces.load_from_config(config['ui']['faces']) + self._invert = config['ui']['invert'] + + if self._invert: + global WHITE + global BLACK + WHITE = 0x00 + BLACK = 0xff + self._agent = None self._render_cbs = [] self._config = config diff --git a/requirements.txt b/requirements.txt index c344481f..609840e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,10 +18,6 @@ scapy shimmy; platform_machine!="armv6l" smbus2 spidev -stable_baselines3; platform_machine!="armv6l" -stable_baselines3==1.8.0; platform_machine=="armv6l" toml -torch==2.0.1 -torchvision==0.15.2 tweepy websockets \ No newline at end of file