Skip to content

Commit

Permalink
more testing needs to be done for mac and linux, see if update is com…
Browse files Browse the repository at this point in the history
…patable with windows
  • Loading branch information
Reece Johnson committed May 29, 2024
1 parent a76cb8e commit 446d5a3
Show file tree
Hide file tree
Showing 9 changed files with 489 additions and 342 deletions.
313 changes: 134 additions & 179 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ repository = "https://github.com/callmeclover/jerry"
build = "build.rs"
edition = "2021"

keywords = ["robot", "automation", "malware", "jerry"]
categories = ["robot", "automation", "malware"]

[package.metadata.winres]
LegalCopyright = "Copyright © callmeclover 2024"
FileDescription = "stupid robot nuisance"

[dependencies]
enigo = "0.2.0"
enigo = "0.2.1"
screenshots = "0.8.6"
tts = "0.26.0"
tts = { version = "0.26.0", features = ["speech_dispatcher_0_9"], default-features = false }
rand = "0.8.4"
tokio = { version = "1.35.1", features = ["full"] }
serde = { version = "1.0.195", features = ["derive"] }
Expand All @@ -26,25 +29,28 @@ time = "0.3.31"
chrono = "0.4.31"
ansi_term = "0.12.1"
regex = "1.10.3"
rsautogui = "0.2.2"
reqwest = { version = "0.12.3", features = ["blocking"] }
cgisf_lib = "0.2.1"
ping = "0.5.2"
tracing = "0.1.40"
cached = { version = "0.51.3", features = ["async"] }

[dependencies.windows]
[target.'cfg(windows)'.dependencies.windows]
version = "0.56.0"
optional = true
features = [
"Gaming_Input",
"UI_Input_Preview_Injection",
]

[target.'cfg(unix)'.dependencies.daemonize]
version = "0.5.0"
optional = true

[build-dependencies]
winres = "0.1"

[features]
invisibility = []
invisibility = ["dep:daemonize"]
advanced = ["dep:windows"]
#microphone = []
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,46 @@
# jerry

stupid robot nuisance.
i built this to be that though, so...

presses keys and f*cks with your mouse. occasionally talks.
presses keys and f\*cks with your mouse. occasionally talks.

## versions

currently, there are 3 versions (not including crosses of any):

- default (basic movement and window)
- invisibility (no console window)
- advanced (advanced movement feature)

**the `advanced` feature requires administrator privileges. this is why it is seperate from `default`.**
**the `advanced` feature requires administrator privileges. this is why it is seperate from `default`. it also depends on the `windows` crate, so it does not support linux/macos.**

**the `invisibility` feature has no console window, so it cannot be regularly exited out of. see [this notice](#other-little-notice) for info on killing a hidden instance.**

i will also not be publishing any invisible builds for jerry beyond [v0.3.4](https://github.com/callmeclover/jerry/releases/tag/v0.3.4). build it yourself with `cargo build --features invisible`.

## little notice

i, @callmeclover, hold 0 responsibility over what this thing does, [**especially forks**](#on-the-topic-of-forks). you are on your own if he does anything bad.

## other little notice

the invisible version hides the console window, so you need to kill his process in task manager if he gets out of hand.

he doesn't cloak himself, so his process name is `jerry.exe`.

## on the topic of forks
jerry is, technically, considered malware. as the [wiki page](https://wikipedia.com/wiki/Malware) states, *"[Malware] is any software intentionally designed to cause disruption to a computer, server, client, or computer network,"* which is exactly what jerry does.

jerry is, technically, considered malware. as the [wiki page](https://wikipedia.com/wiki/Malware) states, _"[Malware] is any software intentionally designed to cause disruption to a computer, server, client, or computer network,"_ which is exactly what jerry does.

i have no intent to cause any amount of harm with this program. this is purely a passion project to learn more rust, and test my coding abilities.

when you fork this project, or a fork of this project, you take all responsibility for that fork. i, @callmeclover, hold no responsibility over the actions of forks.
when you fork this project, or a fork of this project, you take all responsibility for that fork. i, @callmeclover, hold no responsibility over the actions of forks.

## developing

if you're on windows you can already build jerry to boot (`cargo build`). if you are on linux, mac, or pretty much anything other than windows, you can't really run it (probably, no testing has been done) because jerry depends on the `windows` crate. you can, however, use [cross](https://github.com/cross-rs/cross) for cross-compilation.

multi-platform support will be added in a future update, but this will require a rewrite of some features, including `invisibility` and `advanced`.

on linux you will need [`libspeechd-dev`](https://github.com/brailcom/speechd), `libclang1`, and `clang`. view the repo for speechd's build instructions, but you can also check your package manager, e.g. `sudo apt install libspeechd-dev libclang1 clang` on a debian/ubuntu based distro.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() {
}

if let Err(e) = res.compile() {
eprintln!("{}", e);
eprintln!("{e}");
std::process::exit(1);
}
}
Expand Down
29 changes: 15 additions & 14 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
use cached::proc_macro::cached;
#[allow(unused_imports)]
use dialoguer::{theme::ColorfulTheme, Confirm};
use serde::{Deserialize, Serialize};
use std::{fs, path::Path};
use toml::{de::Error, from_str, to_string_pretty};
use cached::{proc_macro::cached, SizedCache};
#[derive(Debug, serde::Serialize, serde::Deserialize, Default, Clone, Eq, Hash, PartialEq)]

#[derive(Debug, Serialize, Deserialize, Default, Clone, Eq, Hash, PartialEq)]
pub struct Config {
#[allow(dead_code)] // Disable dead code warning for the entire struct
basic: Basic,
#[allow(dead_code)] // Disable dead code warning for the entire struct
extra: Extra,
pub extra: Extra,
}

#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Hash)]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Hash)]
#[allow(clippy::struct_excessive_bools)]
struct Basic {
#[allow(dead_code)]
use_mouse: bool,
Expand All @@ -29,12 +32,13 @@ struct Basic {
do_gen_tts: bool,
}

#[derive(Debug, serde::Serialize, serde::Deserialize, Default, Clone, Hash, PartialEq, Eq)]
struct Extra {
#[derive(Debug, Serialize, Deserialize, Default, Clone, Hash, PartialEq, Eq)]
#[allow(clippy::struct_excessive_bools)]
pub struct Extra {
#[allow(dead_code)]
do_debugging: bool,
pub do_debugging: bool,
#[allow(dead_code)]
enable_debugging_extras: bool,
pub enable_debugging_extras: bool,
#[allow(dead_code)]
use_external_sentence_api: bool,
#[allow(dead_code)]
Expand All @@ -43,7 +47,7 @@ struct Extra {

impl Default for Basic {
fn default() -> Self {
Basic {
Self {
#[allow(dead_code)]
use_mouse: true,
#[allow(dead_code)]
Expand All @@ -62,10 +66,7 @@ impl Default for Basic {
}
}

#[cached(
ty = "SizedCache<String, Config>",
create = "{ SizedCache::with_size(1) }",
)]
#[cached]
pub fn get_config() -> Config {
loop {
if Path::new("./config.toml").exists() {
Expand Down Expand Up @@ -128,7 +129,7 @@ pub fn get_config() -> Config {
}
}

pub async fn get_options(config: Config) -> Vec<(&'static str, usize)> {
pub fn get_options(config: &Config) -> Vec<(&'static str, usize)> {
let mut options: Vec<(&'static str, usize)> = vec![];

if config.basic.use_mouse {
Expand Down
Loading

0 comments on commit 446d5a3

Please sign in to comment.