Update config and add schema files
This commit is contained in:
parent
6d75421bc0
commit
f2afa7e7be
7 changed files with 6002 additions and 41 deletions
19
Cargo.toml
19
Cargo.toml
|
|
@ -29,6 +29,7 @@ anyhow = "1.0"
|
|||
chrono = { version = "0.4", features = ["serde"] }
|
||||
log = "0.4"
|
||||
android_logger = "0.14"
|
||||
env_logger = "0.11"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
tokio = { version = "1.41", features = ["rt-multi-thread", "macros"] }
|
||||
|
|
@ -41,19 +42,5 @@ tauri-build = { version = "2", features = ["codegen"] }
|
|||
default = ["custom-protocol"]
|
||||
custom-protocol = ["tauri/custom-protocol"]
|
||||
|
||||
[lints.rust]
|
||||
unused_imports = "warn"
|
||||
unused_variables = "warn"
|
||||
unused_mut = "warn"
|
||||
unsafe_code = "deny"
|
||||
missing_debug_implementations = "warn"
|
||||
|
||||
[lints.clippy]
|
||||
all = "warn"
|
||||
pedantic = "warn"
|
||||
nursery = "warn"
|
||||
cargo = "warn"
|
||||
unwrap_used = "warn"
|
||||
expect_used = "warn"
|
||||
panic = "warn"
|
||||
todo = "warn"
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
|||
1
gen/schemas/acl-manifests.json
Normal file
1
gen/schemas/acl-manifests.json
Normal file
File diff suppressed because one or more lines are too long
1
gen/schemas/capabilities.json
Normal file
1
gen/schemas/capabilities.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"default":{"identifier":"default","description":"BotOS default capabilities","local":true,"windows":["main"],"permissions":["core:default","dialog:default","opener:default","notification:default","http:default","geolocation:default",{"identifier":"http:default","allow":[{"url":"https://**"},{"url":"http://**"}]}]}}
|
||||
2993
gen/schemas/desktop-schema.json
Normal file
2993
gen/schemas/desktop-schema.json
Normal file
File diff suppressed because it is too large
Load diff
2993
gen/schemas/linux-schema.json
Normal file
2993
gen/schemas/linux-schema.json
Normal file
File diff suppressed because it is too large
Load diff
31
src/lib.rs
31
src/lib.rs
|
|
@ -1,10 +1,3 @@
|
|||
//! BotOS - Android launcher powered by General Bots
|
||||
//!
|
||||
//! Minimal Android OS replacement using Tauri + botui
|
||||
//! - Replaces default launcher (home screen)
|
||||
//! - Access to camera, GPS, notifications
|
||||
//! - Connects to General Bots server
|
||||
|
||||
use tauri::Manager;
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
|
|
@ -21,7 +14,6 @@ fn init_logger() {
|
|||
env_logger::init();
|
||||
}
|
||||
|
||||
/// Tauri command: Get device info
|
||||
#[tauri::command]
|
||||
fn get_device_info() -> serde_json::Value {
|
||||
serde_json::json!({
|
||||
|
|
@ -31,18 +23,17 @@ fn get_device_info() -> serde_json::Value {
|
|||
})
|
||||
}
|
||||
|
||||
/// Tauri command: Send message to bot server
|
||||
#[tauri::command]
|
||||
async fn send_to_bot(message: String, server_url: String) -> Result<String, String> {
|
||||
let client = reqwest::Client::new();
|
||||
|
||||
|
||||
let response = client
|
||||
.post(&format!("{}/api/messages", server_url))
|
||||
.post(format!("{server_url}/api/messages"))
|
||||
.json(&serde_json::json!({ "text": message }))
|
||||
.send()
|
||||
.await
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
|
||||
response.text().await.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
|
|
@ -57,21 +48,19 @@ pub fn run() {
|
|||
.plugin(tauri_plugin_notification::init())
|
||||
.plugin(tauri_plugin_http::init())
|
||||
.plugin(tauri_plugin_geolocation::init())
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
get_device_info,
|
||||
send_to_bot
|
||||
])
|
||||
.invoke_handler(tauri::generate_handler![get_device_info, send_to_bot])
|
||||
.setup(|app| {
|
||||
log::info!("BotOS initialized, loading botui...");
|
||||
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
let window = app.get_webview_window("main").unwrap();
|
||||
window.open_devtools();
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
window.open_devtools();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error running BotOS");
|
||||
.unwrap_or_else(|e| log::error!("BotOS failed to start: {e}"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,10 +22,7 @@
|
|||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": ["apk", "aab"],
|
||||
"android": {
|
||||
"minSdkVersion": 24
|
||||
},
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"icons/icon.png"
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue