From 6d85983db0c0bcdc809c703c32569a52c0532db2 Mon Sep 17 00:00:00 2001 From: xytovl Date: Wed, 9 Oct 2024 21:42:49 +0000 Subject: [PATCH] fix(wivrn client start button): handle different android package names --- src/ui/wivrn_wired_start_box.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ui/wivrn_wired_start_box.rs b/src/ui/wivrn_wired_start_box.rs index 94799f0..76b11e4 100644 --- a/src/ui/wivrn_wired_start_box.rs +++ b/src/ui/wivrn_wired_start_box.rs @@ -123,11 +123,17 @@ impl AsyncComponent for WivrnWiredStartBox { Some(&[ "-c", concat!( + "set -e;", + // package from store is org.meumeu.wivrn + // package from github is org.meumeu.wivrn.github + // locally built one is org.meumeu.wivrn.local + // select by preference "local", then "github" and last store one + "PACKAGE=$(adb shell pm list packages org.meumeu.wivrn | sort | tail -1 | sed 's/package://');", "adb reverse tcp:9757 tcp:9757 && ", - "adb shell am force-stop org.meumeu.wivrn && ", + "adb shell am force-stop $PACKAGE && ", // wait for force-stop "sleep 1 && ", - "adb shell am start -a android.intent.action.VIEW -d \"wivrn+tcp://127.0.0.1\" org.meumeu.wivrn" + "adb shell am start -a android.intent.action.VIEW -d \"wivrn+tcp://127.0.0.1\" $PACKAGE" ) ]), None