unified rayhunter-daemon binary for all devices

Replace per-device features with config "display" field with the value
set at install time.
This commit is contained in:
oopsbagel
2025-07-17 11:04:50 -07:00
committed by Will Greenberg
parent 5b59efa4c8
commit 22d927aa25
13 changed files with 85 additions and 118 deletions

View File

@@ -91,7 +91,7 @@ async fn setup_rootshell(adb_device: &mut ADBUSBDevice) -> Result<()> {
}
async fn setup_rayhunter(mut adb_device: ADBUSBDevice) -> Result<ADBUSBDevice> {
let rayhunter_daemon_bin = include_bytes!(env!("FILE_RAYHUNTER_DAEMON_ORBIC"));
let rayhunter_daemon_bin = include_bytes!(env!("FILE_RAYHUNTER_DAEMON"));
adb_at_syscmd(&mut adb_device, "mkdir -p /data/rayhunter").await?;
install_file(
@@ -103,7 +103,9 @@ async fn setup_rayhunter(mut adb_device: ADBUSBDevice) -> Result<ADBUSBDevice> {
install_file(
&mut adb_device,
"/data/rayhunter/config.toml",
CONFIG_TOML.as_bytes(),
CONFIG_TOML
.replace("#display = \"orbic\"", "display = \"orbic\"")
.as_bytes(),
)
.await?;
install_file(
@@ -194,11 +196,11 @@ async fn install_file_impl(
.stat(dest)
.context("Failed to stat transfered file")?;
if file_info.file_size == 0 {
bail!("File transfer unseccessful\nFile is empty");
bail!("File transfer unsuccessful\nFile is empty");
}
let ouput = adb_command(adb_device, &["sha256sum", dest])?;
if !ouput.contains(&file_hash) {
bail!("File transfer unseccessful\nBad hash expected {file_hash} got {ouput}");
let output = adb_command(adb_device, &["sha256sum", dest])?;
if !output.contains(&file_hash) {
bail!("File transfer unsuccessful\nBad hash expected {file_hash} got {output}");
}
Ok(())
}

View File

@@ -41,11 +41,13 @@ async fn run_install(admin_ip: String, admin_password: String) -> Result<()> {
telnet_send_file(
addr,
"/data/rayhunter/config.toml",
crate::CONFIG_TOML.as_bytes(),
crate::CONFIG_TOML
.replace("#display = \"orbic\"", "display = \"tmobile\"")
.as_bytes(),
)
.await?;
let rayhunter_daemon_bin = include_bytes!(env!("FILE_RAYHUNTER_DAEMON_TMOBILE"));
let rayhunter_daemon_bin = include_bytes!(env!("FILE_RAYHUNTER_DAEMON"));
telnet_send_file(
addr,
"/data/rayhunter/rayhunter-daemon",

View File

@@ -154,11 +154,13 @@ async fn tplink_run_install(
telnet_send_file(
addr,
&format!("{sdcard_path}/config.toml"),
crate::CONFIG_TOML.as_bytes(),
crate::CONFIG_TOML
.replace("#display = \"orbic\"", "display = \"tplink\"")
.as_bytes(),
)
.await?;
let rayhunter_daemon_bin = include_bytes!(env!("FILE_RAYHUNTER_DAEMON_TPLINK"));
let rayhunter_daemon_bin = include_bytes!(env!("FILE_RAYHUNTER_DAEMON"));
telnet_send_file(
addr,

View File

@@ -101,11 +101,13 @@ async fn wingtech_run_install(admin_ip: String, admin_password: String) -> Resul
telnet_send_file(
addr,
"/data/rayhunter/config.toml",
crate::CONFIG_TOML.as_bytes(),
crate::CONFIG_TOML
.replace("#display = \"orbic\"", "display = \"wingtech\"")
.as_bytes(),
)
.await?;
let rayhunter_daemon_bin = include_bytes!(env!("FILE_RAYHUNTER_DAEMON_WINGTECH"));
let rayhunter_daemon_bin = include_bytes!(env!("FILE_RAYHUNTER_DAEMON"));
telnet_send_file(
addr,
"/data/rayhunter/rayhunter-daemon",