Skip to content

Commit

Permalink
copy_dir and cfg removed
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuele-em committed Aug 8, 2023
1 parent b665066 commit 37ff340
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions ffi/src/server.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::task::PyInteropTask;
use crate::util::{socketaddr_to_py, string_to_key};
use crate::util::{socketaddr_to_py, string_to_key, copy_dir};

Check warning on line 2 in ffi/src/server.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, stable, --exclude windows-redirector --exclude macos-certificate-truster)

unused import: `copy_dir`
#[allow(unused_imports)]
use anyhow::{anyhow, Result};
use mitmproxy::intercept_conf::InterceptConf;
Expand All @@ -14,8 +14,8 @@ use mitmproxy::packet_sources::{ipc, PacketSourceConf, PacketSourceTask};
use mitmproxy::shutdown::ShutdownTask;
use pyo3::prelude::*;
use std::net::SocketAddr;
use std::path::Path;
use std::sync::Arc;
use std::path::Path;

Check warning on line 18 in ffi/src/server.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, stable, --exclude windows-redirector --exclude macos-certificate-truster)

unused import: `std::path::Path`
use tokio::{sync::broadcast, sync::mpsc, sync::Notify};
use x25519_dalek::PublicKey;

Expand All @@ -35,10 +35,8 @@ impl Server {
self.closing = true;
#[cfg(target_os = "macos")]
{
if Path::new("/Applications/MitmproxyAppleTunnel.app").exists() {
std::fs::remove_dir_all("/Applications/MitmproxyAppleTunnel.app").expect(
"Failed to remove MitmproxyAppleTunnel.app from Applications folder",
);
if Path::new("/Applications/MitmproxyAppleTunnel.app").exists() {
std::fs::remove_dir_all("/Applications/MitmproxyAppleTunnel.app").expect("Failed to remove MitmproxyAppleTunnel.app from Applications folder");
}
}
log::info!("Shutting down.");
Expand Down Expand Up @@ -303,10 +301,7 @@ pub fn start_os_proxy(
}
#[cfg(target_os = "macos")]
{
copy_dir(
Path::new("mitmproxy_rs/MitmProxyAppleTunnel.app/"),
Path::new("/Applications/MitmproxyAppleTunnel.app/"),
);
copy_dir( Path::new("mitmproxy_rs/MitmProxyAppleTunnel.app/"), Path::new("/Applications/MitmproxyAppleTunnel.app/"));
let conf = MacosConf;
pyo3_asyncio::tokio::future_into_py(py, async move {
let (server, conf_tx) = Server::init(conf, handle_connection, receive_datagram).await?;
Expand Down

0 comments on commit 37ff340

Please sign in to comment.