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"] }
|
chrono = { version = "0.4", features = ["serde"] }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
android_logger = "0.14"
|
android_logger = "0.14"
|
||||||
|
env_logger = "0.11"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
tokio = { version = "1.41", features = ["rt-multi-thread", "macros"] }
|
tokio = { version = "1.41", features = ["rt-multi-thread", "macros"] }
|
||||||
|
|
@ -41,19 +42,5 @@ tauri-build = { version = "2", features = ["codegen"] }
|
||||||
default = ["custom-protocol"]
|
default = ["custom-protocol"]
|
||||||
custom-protocol = ["tauri/custom-protocol"]
|
custom-protocol = ["tauri/custom-protocol"]
|
||||||
|
|
||||||
[lints.rust]
|
[lints]
|
||||||
unused_imports = "warn"
|
workspace = true
|
||||||
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"
|
|
||||||
|
|
|
||||||
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
23
src/lib.rs
23
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;
|
use tauri::Manager;
|
||||||
|
|
||||||
#[cfg(target_os = "android")]
|
#[cfg(target_os = "android")]
|
||||||
|
|
@ -21,7 +14,6 @@ fn init_logger() {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Tauri command: Get device info
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
fn get_device_info() -> serde_json::Value {
|
fn get_device_info() -> serde_json::Value {
|
||||||
serde_json::json!({
|
serde_json::json!({
|
||||||
|
|
@ -31,13 +23,12 @@ fn get_device_info() -> serde_json::Value {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Tauri command: Send message to bot server
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
async fn send_to_bot(message: String, server_url: String) -> Result<String, String> {
|
async fn send_to_bot(message: String, server_url: String) -> Result<String, String> {
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
|
|
||||||
let response = client
|
let response = client
|
||||||
.post(&format!("{}/api/messages", server_url))
|
.post(format!("{server_url}/api/messages"))
|
||||||
.json(&serde_json::json!({ "text": message }))
|
.json(&serde_json::json!({ "text": message }))
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
|
|
@ -57,21 +48,19 @@ pub fn run() {
|
||||||
.plugin(tauri_plugin_notification::init())
|
.plugin(tauri_plugin_notification::init())
|
||||||
.plugin(tauri_plugin_http::init())
|
.plugin(tauri_plugin_http::init())
|
||||||
.plugin(tauri_plugin_geolocation::init())
|
.plugin(tauri_plugin_geolocation::init())
|
||||||
.invoke_handler(tauri::generate_handler![
|
.invoke_handler(tauri::generate_handler![get_device_info, send_to_bot])
|
||||||
get_device_info,
|
|
||||||
send_to_bot
|
|
||||||
])
|
|
||||||
.setup(|app| {
|
.setup(|app| {
|
||||||
log::info!("BotOS initialized, loading botui...");
|
log::info!("BotOS initialized, loading botui...");
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
{
|
{
|
||||||
let window = app.get_webview_window("main").unwrap();
|
if let Some(window) = app.get_webview_window("main") {
|
||||||
window.open_devtools();
|
window.open_devtools();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("error running BotOS");
|
.unwrap_or_else(|e| log::error!("BotOS failed to start: {e}"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,7 @@
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"active": true,
|
"active": true,
|
||||||
"targets": ["apk", "aab"],
|
"targets": "all",
|
||||||
"android": {
|
|
||||||
"minSdkVersion": 24
|
|
||||||
},
|
|
||||||
"icon": [
|
"icon": [
|
||||||
"icons/icon.png"
|
"icons/icon.png"
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue