Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 20 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARK Drop is designed for easy file transfer. You can use QR codes to quickly sen
> [!WARNING]
> ARK Drop is currently under heavy development and should be used with caution. It has not undergone extensive testing and may contain bugs, vulnerabilities, or unexpected behavior.

## Development
## Tech Stack

ARK Drop is built using [Tauri](https://tauri.app/) with [SvelteKit](https://kit.svelte.dev/).

Expand All @@ -17,79 +17,61 @@ ARK Drop is built using [Tauri](https://tauri.app/) with [SvelteKit](https://kit

[SvelteKit](https://kit.svelte.dev/) is an application framework built on Svelte. Unlike traditional frameworks, SvelteKit shifts work to a compile step during the build process, resulting in code that directly updates the DOM when the application's state changes, enhancing performance.

## Running ARK Drop Locally
## Development

You can use either `cargo tauri` CLI or `npm` CLI commands to run ARK Drop locally.
### Prerequisites

### Installing `cargo tauri`
- [Rust](https://rustup.rs/)
- [Node.js](https://nodejs.org/)

To install `cargo tauri`, run:
### Install Dependencies

```sh
cargo install tauri-cli
npm install
```

### Starting the Tauri Development Window

To start the Tauri development window, run:
### Run Development Server

```sh
npm run tauri dev
```

or

```sh
cargo tauri dev
```

This command builds the Rust code and opens the webview to display your web app. You can make changes to your web app, and if your tooling supports it, the webview will update automatically, similar to a browser.

## Building the Project
## Build

Tauri will detect your operating system and build a corresponding bundle. To build the project, run:
Tauri will detect your operating system and build a corresponding bundle.

```sh
npm run tauri build
```

or

```sh
cargo tauri build
```

This process will build your frontend, compile the Rust binary, gather all external binaries and resources, and produce platform-specific bundles and installers.

For more information about Tauri builds, refer to the [Tauri building guide](https://tauri.app/v1/guides/building/).

## Dependencies
For more information, refer to the [Tauri building guide](https://tauri.app/v1/guides/building/).

Cross compilation building is done easiest via cross library.
## Android Build

- [Cross](https://github.com/cross-rs/cross)
Cross-compilation is easiest using [Cross](https://github.com/cross-rs/cross). Alternatively, you can set up the NDK and build manually.

Alternatively you can setup the NDK and build manually

### Building for Android

Make sure you have added the nessecary targets to build for android
### Add Android Targets

```sh
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
```

Build the cdylib for all the targets
### Build for Android Targets

Using Cross:
```sh
cross build -p drop_core --target aarch64-linux-android
cross build -p drop_core --target armv7-linux-androideabi
cross build -p drop_core --target i686-linux-android
cross build -p drop_core --target x86_64-linux-android
```

Generate the bindings using uniffi for kotlin

Or using cargo-ndk:
```sh
cargo run -p uniffi-bingen generate --library target/x86_64-linux-android/debug/libdrop_core.so --language=kotlin --out-dir ./bindings
cargo install cargo-ndk
cargo ndk -o ./target/release/jniLibs --target aarch64-linux-android --target armv7-linux-androideabi --target i686-linux-android --target x86_64-linux-android build -p drop_core --release
```
5 changes: 3 additions & 2 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ impl IrohInstance {
ticket_str: String,
output_dir: PathBuf,
handle: Arc<FileTransferHandle>,
display_name: Option<String>,
) -> IrohResult<Collection> {
// Parse ticket to extract confirmation
let (ticket, confirmation) = TicketWrapper::parse(&ticket_str)?;
Expand All @@ -229,9 +230,9 @@ impl IrohInstance {
IrohError::DownloadError(format!("Failed to create receiving directory: {}", e))
})?;

// Create receiver profile
// Create receiver profile with provided name or default to "Anonymous"
let profile = ReceiverProfile {
name: "Anonymous".to_string(),
name: display_name.unwrap_or_else(|| "Anonymous".to_string()),
avatar_b64: None,
};

Expand Down
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@tauri-apps/plugin-clipboard-manager": "^2.3.0",
"@tauri-apps/plugin-dialog": "^2.4.0",
"@tauri-apps/plugin-opener": "^2.5.0",
"@tauri-apps/plugin-store": "^2.4.1",
"html5-qrcode": "^2.3.8",
"qrcode": "^1.5.4"
},
Expand Down
2 changes: 2 additions & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ tauri = { version = "2.9.1", features = ["tray-icon"] }
tauri-plugin-opener = "2.5.0"
tauri-plugin-dialog = "2.4.0"
tauri-plugin-clipboard-manager = "2.3.0"
tauri-plugin-store = "2.4.1"
dirs = "6.0.0"
open = "5.3.2"
whoami = "1.5.2"

anyhow = { workspace = true }

Expand Down
3 changes: 2 additions & 1 deletion src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"dialog:default",
"clipboard-manager:default",
"clipboard-manager:allow-read-text",
"clipboard-manager:allow-write-text"
"clipboard-manager:allow-write-text",
"store:default"
]
}
Loading
Loading