mirror of
https://github.com/AkiChase/scrcpy-mask
synced 2025-02-22 14:42:15 +08:00
commit
68a7746b1e
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "scrcpy-mask",
|
"name": "scrcpy-mask",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.4.1",
|
"version": "0.4.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "scrcpy-mask"
|
name = "scrcpy-mask"
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
description = "A Tauri App"
|
description = "A Tauri App"
|
||||||
authors = ["AkiChase"]
|
authors = ["AkiChase"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -88,6 +88,7 @@ pub struct Adb;
|
|||||||
impl Adb {
|
impl Adb {
|
||||||
pub fn cmd_base() -> Command {
|
pub fn cmd_base() -> Command {
|
||||||
let adb_path = share::ADB_PATH.lock().unwrap().clone();
|
let adb_path = share::ADB_PATH.lock().unwrap().clone();
|
||||||
|
println!("{}", &adb_path);
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
{
|
{
|
||||||
let mut cmd = Command::new(adb_path);
|
let mut cmd = Command::new(adb_path);
|
||||||
|
@ -164,7 +164,10 @@ fn set_adb_path(adb_path: String, app: tauri::AppHandle) -> Result<(), String> {
|
|||||||
let path = std::path::PathBuf::from("store.bin");
|
let path = std::path::PathBuf::from("store.bin");
|
||||||
let store_res: Result<(), tauri_plugin_store::Error> =
|
let store_res: Result<(), tauri_plugin_store::Error> =
|
||||||
tauri_plugin_store::with_store(app, stores, path, |store| {
|
tauri_plugin_store::with_store(app, stores, path, |store| {
|
||||||
store.insert("adbPath".to_string(), serde_json::json!(adb_path))?;
|
store.insert(
|
||||||
|
"adbPath".to_string(),
|
||||||
|
serde_json::Value::String(adb_path.clone()),
|
||||||
|
)?;
|
||||||
*share::ADB_PATH.lock().unwrap() = adb_path;
|
*share::ADB_PATH.lock().unwrap() = adb_path;
|
||||||
Ok(())
|
Ok(())
|
||||||
});
|
});
|
||||||
@ -190,9 +193,14 @@ async fn main() {
|
|||||||
tauri_plugin_store::with_store(app.app_handle().clone(), stores, path, |store| {
|
tauri_plugin_store::with_store(app.app_handle().clone(), stores, path, |store| {
|
||||||
// load adb path
|
// load adb path
|
||||||
match store.get("adbPath") {
|
match store.get("adbPath") {
|
||||||
Some(value) => *share::ADB_PATH.lock().unwrap() = value.to_string(),
|
Some(value) => {
|
||||||
|
*share::ADB_PATH.lock().unwrap() = value.as_str().unwrap().to_string()
|
||||||
|
}
|
||||||
None => store
|
None => store
|
||||||
.insert("adbPath".to_string(), serde_json::json!("adb"))
|
.insert(
|
||||||
|
"adbPath".to_string(),
|
||||||
|
serde_json::Value::String("adb".to_string()),
|
||||||
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"productName": "scrcpy-mask",
|
"productName": "scrcpy-mask",
|
||||||
"version": "0.4.1",
|
"version": "0.4.2",
|
||||||
"identifier": "com.akichase.mask",
|
"identifier": "com.akichase.mask",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "pnpm dev",
|
"beforeDevCommand": "pnpm dev",
|
||||||
|
@ -79,7 +79,7 @@ onMounted(async () => {
|
|||||||
} else {
|
} else {
|
||||||
store.screenSizeW = payload.width;
|
store.screenSizeW = payload.width;
|
||||||
store.screenSizeH = payload.height;
|
store.screenSizeH = payload.height;
|
||||||
message.info("设备旋转");
|
message.info(t("pages.Device.deviceRotation"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -66,12 +66,14 @@ onActivated(async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
store.checkAdb = checkAdb;
|
|
||||||
await checkAdb();
|
|
||||||
await loadLocalStore();
|
await loadLocalStore();
|
||||||
store.checkUpdate = checkUpdate;
|
store.checkUpdate = checkUpdate;
|
||||||
store.showInputBox = showInputBox;
|
store.showInputBox = showInputBox;
|
||||||
if (store.checkUpdateAtStart) checkUpdate();
|
if (store.checkUpdateAtStart) checkUpdate();
|
||||||
|
store.checkAdb = checkAdb;
|
||||||
|
setTimeout(() => {
|
||||||
|
checkAdb();
|
||||||
|
}, 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
let checkAdbMessage: MessageReactive | null = null;
|
let checkAdbMessage: MessageReactive | null = null;
|
||||||
|
@ -36,7 +36,8 @@
|
|||||||
"wsClose": "Close",
|
"wsClose": "Close",
|
||||||
"wsConnect": "Control",
|
"wsConnect": "Control",
|
||||||
"adbDeviceError": "Unable to get available devices",
|
"adbDeviceError": "Unable to get available devices",
|
||||||
"adbConnectError": "Wireless connection failed"
|
"adbConnectError": "Wireless connection failed",
|
||||||
|
"deviceRotation": "Device rotation"
|
||||||
},
|
},
|
||||||
"Mask": {
|
"Mask": {
|
||||||
"inputBoxPlaceholder": "Input text and then press enter/esc",
|
"inputBoxPlaceholder": "Input text and then press enter/esc",
|
||||||
|
@ -36,7 +36,8 @@
|
|||||||
"wsClose": "断开",
|
"wsClose": "断开",
|
||||||
"wsConnect": "控制",
|
"wsConnect": "控制",
|
||||||
"adbDeviceError": "无法获取可用设备",
|
"adbDeviceError": "无法获取可用设备",
|
||||||
"adbConnectError": "无线连接失败"
|
"adbConnectError": "无线连接失败",
|
||||||
|
"deviceRotation": "设备旋转"
|
||||||
},
|
},
|
||||||
"Mask": {
|
"Mask": {
|
||||||
"keyconfigException": "按键方案异常,请删除此方案",
|
"keyconfigException": "按键方案异常,请删除此方案",
|
||||||
|
Loading…
Reference in New Issue
Block a user