(
State(state): State<AppState>,
Path(udid): Path<String>,
Json(payload): Json<UninstallPayload>,
)
| 2404 | } |
| 2405 | |
| 2406 | async fn uninstall_app( |
| 2407 | State(state): State<AppState>, |
| 2408 | Path(udid): Path<String>, |
| 2409 | Json(payload): Json<UninstallPayload>, |
| 2410 | ) -> Result<Json<Value>, AppError> { |
| 2411 | state.accessibility_cache.invalidate(&udid); |
| 2412 | if payload.bundle_id.trim().is_empty() { |
| 2413 | return Err(AppError::bad_request( |
| 2414 | "Request body must include `bundleId`.", |
| 2415 | )); |
| 2416 | } |
| 2417 | if android::is_android_id(&udid) { |
| 2418 | let action_udid = udid.clone(); |
| 2419 | run_android_action(state, move |android| { |
| 2420 | android.uninstall_app(&action_udid, &payload.bundle_id) |
| 2421 | }) |
| 2422 | .await?; |
| 2423 | return Ok(json(json_value!({ "ok": true }))); |
| 2424 | } |
| 2425 | let action_udid = udid.clone(); |
| 2426 | run_bridge_action(state.clone(), move |bridge| { |
| 2427 | bridge.uninstall_app(&action_udid, &payload.bundle_id) |
| 2428 | }) |
| 2429 | .await?; |
| 2430 | spawn_accessibility_warmup(state, udid); |
| 2431 | Ok(json(json_value!({ "ok": true }))) |
| 2432 | } |
| 2433 | |
| 2434 | async fn get_pasteboard( |
| 2435 | State(state): State<AppState>, |
nothing calls this directly
no test coverage detected