Convert qline_scripts from submodule to regular directory in root repo

master_clone
Faiz Hashmi 4 months ago
parent b3ded8e675
commit dd01a64e8a

@ -1 +0,0 @@
Subproject commit b6fff9571133e5657cbad945a5a0baa3bc69500c

@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Parse command line arguments
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-ip)
DEVICE_IP="$2"
shift # past argument
shift # past value
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
if [[ -z "$DEVICE_IP" ]]; then
echo "Usage: sh clear_logs.sh -ip <device_ip:port>"
exit 1
fi
LOG_PATH="/storage/emulated/0/Android/data/com.example.hmg_qline.hmg_qline/files/logs"
# Remove all files in the logs directory on the device
adb -s $DEVICE_IP shell rm -rf "$LOG_PATH/*"
echo "✅ Logs cleared on $DEVICE_IP"

@ -0,0 +1,86 @@
#!/usr/bin/env bash
# ===== Config =====
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
LOG_PATH="/storage/emulated/0/Android/data/com.example.hmg_qline.hmg_qline/files/logs"
# ===== Parse Arguments =====
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-ipfile)
IP_FILE="$2"
shift # past argument
shift # past value
;;
*)
echo "Unknown option: $1"
echo "Usage: sh clear_logs_all.sh -ipfile <device_ips.txt>"
exit 1
;;
esac
done
if [[ -z "$IP_FILE" ]]; then
echo "Usage: sh clear_logs_all.sh -ipfile <device_ips.txt>"
exit 1
fi
# ===== Wi-Fi Check =====
wifi_interface=$(networksetup -listallhardwareports | \
awk '/Wi-Fi|AirPort/{getline; print $2}')
current_ssid=$(networksetup -getairportnetwork "$wifi_interface" 2>/dev/null | \
awk -F': ' '{print $2}' | tr '[:upper:]' '[:lower:]')
expected_ssid="cloud solutions"
if [[ "$current_ssid" != "$expected_ssid" ]]; then
echo "❌ Not connected to required Wi-Fi network: $expected_ssid"
echo "🔌 Current network: ${current_ssid:-Not connected}"
exit 1
fi
echo "✅ Connected to correct Wi-Fi: Cloud Solutions"
# ===== Read IPs =====
if [[ ! -f "$IP_FILE" ]]; then
echo "❌ IP file not found at $IP_FILE"
exit 1
fi
ipList=()
while IFS= read -r line; do
[[ -n "$line" ]] && ipList+=("$line")
done < "$IP_FILE"
if [[ ${#ipList[@]} -eq 0 ]]; then
echo "❌ No IPs found in file"
exit 1
fi
echo "✅ Found ${#ipList[@]} IPs"
printf '%s\n' "${ipList[@]}"
# ===== Connect to Devices and Clear Logs =====
for ip in "${ipList[@]}"; do
cleanIP="${ip%%:*}"
echo "🔌 Connecting to $cleanIP..."
output=$(adb connect "$cleanIP:5555" 2>&1)
if [[ "$output" == *connected* ]]; then
echo "✅ Connected to $cleanIP"
else
echo "❌ Failed to connect to $cleanIP: $output"
continue
fi
echo "🧹 Clearing logs on $cleanIP..."
adb -s "$cleanIP:5555" shell rm -rf "$LOG_PATH/*"
if [[ $? -eq 0 ]]; then
echo "✅ Logs cleared on $cleanIP"
else
echo "❌ Failed to clear logs on $cleanIP"
fi
done
echo "✅ Done! Logs cleared on all devices."

@ -0,0 +1,111 @@
#!/usr/bin/env bash
# ===== Config =====
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
APP_NAME="com.example.hmg_qline.hmg_qline/.MainActivity"
LOG_DIR="$SCRIPT_DIR/logs"
TIMEOUT_SECONDS=5
run_with_timeout() {
perl -e 'alarm $ARGV[0]; exec @ARGV[1..$#ARGV]' "$TIMEOUT_SECONDS" "$@"
}
# ===== Parse Arguments =====
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-ipfile)
IP_FILE="$2"
shift # past argument
shift # past value
;;
*)
echo "Unknown option: $1"
echo "Usage: sh connect_devices.sh -ipfile <device_ips.txt>"
exit 1
;;
esac
done
if [[ -z "$IP_FILE" ]]; then
echo "Usage: sh connect_devices.sh -ipfile <device_ips.txt>"
exit 1
fi
# ===== Wi-Fi Check =====
wifi_interface=$(networksetup -listallhardwareports | \
awk '/Wi-Fi|AirPort/{getline; print $2}')
current_ssid=$(networksetup -getairportnetwork "$wifi_interface" 2>/dev/null | \
awk -F': ' '{print $2}' | tr '[:upper:]' '[:lower:]')
expected_ssid="cloud solutions"
if [[ "$current_ssid" != "$expected_ssid" ]]; then
echo "❌ Not connected to required Wi-Fi network: $expected_ssid"
echo "🔌 Current network: ${current_ssid:-Not connected}"
exit 1
fi
echo "✅ Connected to correct Wi-Fi: Cloud Solutions"
# Create log dir
mkdir -p "$LOG_DIR"
# ===== Read IPs =====
if [[ ! -f "$IP_FILE" ]]; then
echo "❌ IP file not found at $IP_FILE"
exit 1
fi
ipList=()
while IFS= read -r line; do
[[ -n "$line" ]] && ipList+=("$line")
done < "$IP_FILE"
if [[ ${#ipList[@]} -eq 0 ]]; then
echo "❌ No IPs found in file"
exit 1
fi
echo "✅ Found ${#ipList[@]} IPs"
printf '%s\n' "${ipList[@]}"
# ===== Connect to Devices =====
success_ips=()
failed_ips=()
for ip in "${ipList[@]}"; do
cleanIP="${ip%%:*}" # strip port if exists
device="$cleanIP:5555"
echo "🔌 Connecting to $cleanIP..."
output=$(run_with_timeout adb connect "$device" 2>&1)
status=$?
if [[ $status -ne 0 || "$output" != *connected* ]]; then
echo "❌ Failed to connect to $cleanIP: $output"
failed_ips+=("$cleanIP")
else
echo "✅ Connected to $cleanIP"
success_ips+=("$cleanIP")
fi
done
echo "✅ Connection complete."
echo "\n====== Summary ======"
echo "✅ Success (${#success_ips[@]}):"
if [[ ${#success_ips[@]} -gt 0 ]]; then
printf ' - %s\n' "${success_ips[@]}"
else
echo " - None"
fi
echo "❌ Failed (${#failed_ips[@]}):"
if [[ ${#failed_ips[@]} -gt 0 ]]; then
printf ' - %s\n' "${failed_ips[@]}"
else
echo " - None"
fi

@ -0,0 +1,206 @@
#!/usr/bin/env bash
# ===== Config =====
APP_NAME="com.example.hmg_qline.hmg_qline/.MainActivity"
TIMEOUT_SECONDS=5
run_with_timeout() {
perl -e 'alarm $ARGV[0]; exec @ARGV[1..$#ARGV]' "$TIMEOUT_SECONDS" "$@"
}
# ===== Parse Arguments =====
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-ipfile)
IP_FILE="$2"
shift # past argument
shift # past value
;;
-version)
APP_VERSION="$2"
shift # past argument
shift # past value
;;
*)
echo "Unknown option: $1"
echo "Usage: sh deploy_qline.sh -ipfile <device_ips.txt> -version <app_version>"
exit 1
;;
esac
done
if [[ -z "$IP_FILE" ]]; then
echo "Usage: sh deploy_qline.sh -ipfile <device_ips.txt> -version <app_version>"
exit 1
fi
if [[ -z "$APP_VERSION" ]]; then
echo "Usage: sh deploy_qline.sh -ipfile <device_ips.txt> -version <app_version>"
exit 1
fi
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
APK_PATH="$SCRIPT_DIR/apks/qline_opd_v${APP_VERSION}_prod.apk"
# ===== Wi-Fi Check =====
wifi_interface=$(networksetup -listallhardwareports | \
awk '/Wi-Fi|AirPort/{getline; print $2}')
current_ssid=$(networksetup -getairportnetwork "$wifi_interface" 2>/dev/null | \
awk -F': ' '{print $2}' | tr '[:upper:]' '[:lower:]')
expected_ssid="cloud solutions"
if [[ "$current_ssid" != "$expected_ssid" ]]; then
echo "❌ Not connected to required Wi-Fi network: $expected_ssid"
echo "🔌 Current network: ${current_ssid:-Not connected}"
exit 1
fi
echo "✅ Connected to correct Wi-Fi: Cloud Solutions"
# ===== Disconnect All Devices =====
echo "🔌 Disconnecting all devices..."
adb disconnect
# ===== Read IPs =====
if [[ ! -f "$IP_FILE" ]]; then
echo "❌ IP file not found at $IP_FILE"
exit 1
fi
ipList=()
while IFS= read -r line; do
[[ -n "$line" ]] && ipList+=("$line")
done < "$IP_FILE"
if [[ ${#ipList[@]} -eq 0 ]]; then
echo "❌ No IPs found in file"
exit 1
fi
echo "✅ Found ${#ipList[@]} IPs"
printf '%s\n' "${ipList[@]}"
# ===== Connect and Deploy =====
success_ips=()
failed_ips=()
for ip in "${ipList[@]}"; do
cleanIP="${ip%%:*}" # strip port if exists
device="$cleanIP:5555"
echo "🔌 Connecting to $cleanIP..."
output=$(run_with_timeout adb connect "$device" 2>&1)
status=$?
if [[ $status -ne 0 || "$output" != *connected* ]]; then
echo "❌ Failed to connect to $cleanIP: $output"
failed_ips+=("$cleanIP (connect)")
continue
fi
echo "📱 Processing $device..."
echo "📦 Installing APK..."
if ! adb -s "$device" install -r "$APK_PATH"; then
echo "❌ Install failed on $cleanIP"
failed_ips+=("$cleanIP (install)")
continue
fi
echo "🚀 Launching app..."
if ! adb -s "$device" shell am start -n "$APP_NAME"; then
echo "❌ Launch failed on $cleanIP"
failed_ips+=("$cleanIP (launch)")
continue
fi
success_ips+=("$cleanIP")
done
echo "✅ Deployment complete."
echo "\n====== Summary ======"
echo "✅ Success (${#success_ips[@]}):"
if [[ ${#success_ips[@]} -gt 0 ]]; then
printf ' - %s\n' "${success_ips[@]}"
else
echo " - None"
fi
echo "❌ Failed (${#failed_ips[@]}):"
if [[ ${#failed_ips[@]} -gt 0 ]]; then
printf ' - %s\n' "${failed_ips[@]}"
else
echo " - None"
fi
# Calling ==> ./deploy_qline.sh -ipfile device_ips_all.txt -version 9.2
# /Users/zik/Library/Android/sdk/platform-tools
# *********************** WOMEN HEALTH (Riyadh) ***********************
# 1st Floor (OBG)
# 10.71.50.45 - v9
# 10.71.50.50 - v9
# 10.71.50.57 - v9
# 10.71.50.52 - v9
# 2nd Floor (OBG)
# 10.71.50.46 - v9
# 10.71.50.47 - v9
# 10.71.50.48 - v9
# 10.71.50.49 - v9
# 6th Floor (IVF)
# 10.71.50.53 - v9.3 qline_opd_v9.3_bg_fix_prod
# 10.71.50.56 - v9
# *********************** HMG-KHOBAR ***********************
# 10.90.82.236 - v8.9
# *********************** TAKHASSUSI ***********************
# (G-FLOOR) ORTHOPEDIC
# 10.70.194.105 - v9.2
# 10.70.194.87 - v9.2
# *********************** SUWAIDI ***********************
# 10.80.31.37 - v9.3 (SWD Oncology & Family Med WA)
# 10.80.30.220 - v9 (SWD Oncology & Family Med WA)
# 10.80.31.67 - v9 (SWD Internal Med & Other Clinics WA)
# 10.80.31.80 - v9 (SWD Internal Med & Other Clinics WA)
# 10.80.31.100 - v9.3 (SWD PEDIATRIC & Other WA) -> qline_opd_v9.3_android_14.apk
# 10.80.31.103 - v9.3 (SWD PEDIATRIC & Other WA) -> qline_opd_v9.3_android_14.apk
# 10.80.31.104 - v9.3 (SWD OB-GYN & Other Clinics Waiting Area) -> qline_opd_v9.3_android_14.apk
# 10.80.30.234 - v9.3 (SWD OB-GYN & Other Clinics Waiting Area) -> qline_opd_v9.3_android_14.apk
# Deploy version 9 to all devices
# sh deploy_qline.sh -ipfile device_ips_all.txt -version 9
# Deploy to Khobar location only
# sh deploy_qline.sh -ipfile device_ips_khobar.txt -version 8.9
# Deploy to Takhassusi hospital
# sh deploy_qline.sh -ipfile device_ips_tak.txt -version 8.9
# Deploy to Women's Health center
# sh deploy_qline.sh -ipfile device_ips_tak_women.txt -version 9

@ -0,0 +1,59 @@
10.70.194.105
10.70.194.87
10.70.6.139
10.70.6.141
10.70.6.142
10.70.6.114
10.70.6.143
10.70.6.49
10.70.6.56
10.70.6.144
10.70.6.158
10.70.6.119
10.70.6.156
10.70.6.109
10.70.6.102
10.70.6.107
10.70.6.137
10.70.6.93
10.70.6.147
10.70.6.148
10.70.6.98
10.70.6.112
10.70.6.96
10.70.6.145
10.70.6.91
10.90.82.236
10.71.50.45
10.71.50.46
10.71.50.47
10.71.50.48
10.71.50.49
10.71.50.50
10.71.50.52
10.71.50.53
10.71.50.56
10.71.50.57
10.80.31.37
10.80.30.220
10.80.31.67
10.80.31.80
10.80.31.103
10.80.31.100
10.80.31.104
10.80.30.234
10.80.30.227
10.80.32.31
10.80.35.165
10.80.35.212
10.80.35.218
10.80.31.28
10.80.35.211
10.80.36.111
10.80.32.16
10.80.35.219
10.80.36.114
10.80.36.135
10.80.36.138
10.80.36.132
10.80.36.139

@ -0,0 +1,33 @@
10.80.31.37
10.80.30.220
10.80.31.67
10.80.31.80
10.80.31.103
10.80.31.100
10.80.31.104
10.80.30.234
10.80.30.227
10.80.32.31
10.80.35.165
10.80.35.212
10.80.35.218
10.80.31.28
10.80.35.211
10.80.36.111
10.80.32.16
10.80.35.219
10.80.36.114
10.80.36.135
10.80.36.138
10.80.36.132
10.80.36.139
10.80.26.74
10.80.26.78
10.80.35.108
10.80.36.145
10.80.20.106
10.80.20.110
10.80.31.148

@ -0,0 +1,27 @@
10.70.6.139
10.70.6.141
10.70.6.142
10.70.6.114
10.70.6.143
10.70.6.49
10.70.6.56
10.70.6.144
10.70.6.158
10.70.6.119
10.70.6.156
10.70.6.109
10.70.6.102
10.70.6.107
10.70.6.137
10.70.6.93
10.70.6.147
10.70.6.148
10.70.6.98
10.70.6.112
10.70.6.96
10.70.6.145
10.70.6.91
10.70.6.157
10.70.6.159
10.70.6.128

@ -0,0 +1,11 @@
10.71.50.45
10.71.50.46
10.71.50.47
10.71.50.48
10.71.50.49
10.71.50.50
10.71.50.52
10.71.50.53
10.71.50.56
10.71.50.57

@ -0,0 +1,67 @@
#!/usr/bin/env bash
# ===== Config =====
LOG_DIR="$(pwd)/logs"
LOG_PATH="/storage/emulated/0/Android/data/com.example.hmg_qline.hmg_qline/files/logs"
# ===== Parse Arguments =====
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-ipfile)
IP_FILE="$2"
shift # past argument
shift # past value
;;
*)
echo "Unknown option: $1"
echo "Usage: sh extract_all_logs.sh -ipfile <device_ips.txt>"
exit 1
;;
esac
done
if [[ -z "$IP_FILE" ]]; then
echo "Usage: sh extract_all_logs.sh -ipfile <device_ips.txt>"
exit 1
fi
# ===== Read IPs =====
if [[ ! -f "$IP_FILE" ]]; then
echo "❌ IP file not found at $IP_FILE"
exit 1
fi
ipList=()
while IFS= read -r line; do
[[ -n "$line" ]] && ipList+=("$line")
done < "$IP_FILE"
if [[ ${#ipList[@]} -eq 0 ]]; then
echo "❌ No IPs found in file"
exit 1
fi
echo "✅ Found ${#ipList[@]} IPs"
printf '%s\n' "${ipList[@]}"
# ===== Extract Logs from All Devices =====
for ip in "${ipList[@]}"; do
cleanIP="${ip%%:*}"
echo "🔌 Connecting to $cleanIP..."
output=$(adb connect "$cleanIP:5555" 2>&1)
if [[ "$output" == *connected* ]]; then
echo "✅ Connected to $cleanIP"
else
echo "❌ Failed to connect to $cleanIP: $output"
continue
fi
echo "📥 Extracting logs from $cleanIP..."
adb -s "$cleanIP:5555" shell ls "$LOG_PATH"
adb -s "$cleanIP:5555" pull "$LOG_PATH" "$LOG_DIR"
done
echo "✅ Done! Logs extracted from all devices."

@ -0,0 +1,70 @@
#!/usr/bin/env bash
# ===== Config =====
LOG_DIR="$(pwd)/logs"
LOG_PATH="/storage/emulated/0/Android/data/com.example.hmg_qline.hmg_qline/files/logs"
# ===== Parse Arguments =====
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-ip)
DEVICE_IP="$2"
shift # past argument
shift # past value
;;
*)
echo "Unknown option: $1"
echo "Usage: sh extract_logs.sh -ip <device_ip:port>"
exit 1
;;
esac
done
if [[ -z "$DEVICE_IP" ]]; then
echo "Usage: sh extract_logs.sh -ip <device_ip:port>"
exit 1
fi
# ===== Create Local Log Directory =====
mkdir -p "$LOG_DIR"
# ===== Connect to Device =====
cleanIP="${DEVICE_IP%%:*}" # strip port if exists
echo "🔌 Connecting to $cleanIP..."
output=$(adb connect "$cleanIP:5555" 2>&1)
if [[ "$output" == *connected* ]]; then
echo "✅ Connected to $cleanIP"
else
echo "❌ Failed to connect to $cleanIP: $output"
exit 1
fi
# ===== Check if Device is Available =====
if ! adb -s "$DEVICE_IP" get-state >/dev/null 2>&1; then
echo "❌ Device $DEVICE_IP is not available via ADB"
exit 1
fi
# ===== Check if Log Directory Exists on Device =====
echo "📁 Checking if log directory exists on device..."
if ! adb -s "$DEVICE_IP" shell "test -d '$LOG_PATH'" 2>/dev/null; then
echo "❌ Log directory not found on device: $LOG_PATH"
echo "💡 Available directories in Android/data/com.example.hmg_qline.hmg_qline/files/:"
adb -s "$DEVICE_IP" shell "ls -la /storage/emulated/0/Android/data/com.example.hmg_qline.hmg_qline/files/" 2>/dev/null || echo "❌ Could not list files directory"
exit 1
fi
# ===== List Log Files =====
echo "📋 Listing log files on device..."
adb -s "$DEVICE_IP" shell "ls -la '$LOG_PATH'"
# ===== Extract Logs =====
echo "📥 Extracting logs from $DEVICE_IP..."
if adb -s "$DEVICE_IP" pull "$LOG_PATH" "$LOG_DIR"; then
echo "✅ Logs extracted successfully from $DEVICE_IP to $LOG_DIR"
else
echo "❌ Failed to extract logs from $DEVICE_IP"
exit 1
fi

@ -0,0 +1,111 @@
#!/usr/bin/env bash
# ===== Config =====
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
APP_PACKAGE="com.example.hmg_qline.hmg_qline"
TIMEOUT_SECONDS=5
run_with_timeout() {
perl -e 'alarm $ARGV[0]; exec @ARGV[1..$#ARGV]' "$TIMEOUT_SECONDS" "$@"
}
# ===== Parse Arguments =====
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-ipfile)
IP_FILE="$2"
shift # past argument
shift # past value
;;
*)
echo "Unknown option: $1"
echo "Usage: sh kill_qline.sh -ipfile <device_ips.txt>"
exit 1
;;
esac
done
if [[ -z "$IP_FILE" ]]; then
echo "Usage: sh kill_qline.sh -ipfile <device_ips.txt>"
exit 1
fi
# ===== Wi-Fi Check =====
wifi_interface=$(networksetup -listallhardwareports | \
awk '/Wi-Fi|AirPort/{getline; print $2}')
current_ssid=$(networksetup -getairportnetwork "$wifi_interface" 2>/dev/null | \
awk -F': ' '{print $2}' | tr '[:upper:]' '[:lower:]')
expected_ssid="cloud solutions"
if [[ "$current_ssid" != "$expected_ssid" ]]; then
echo "❌ Not connected to required Wi-Fi network: $expected_ssid"
echo "🔌 Current network: ${current_ssid:-Not connected}"
exit 1
fi
echo "✅ Connected to correct Wi-Fi: Cloud Solutions"
# ===== Read IPs =====
if [[ ! -f "$IP_FILE" ]]; then
echo "❌ IP file not found at $IP_FILE"
exit 1
fi
ipList=()
while IFS= read -r line; do
[[ -n "$line" ]] && ipList+=("$line")
done < "$IP_FILE"
if [[ ${#ipList[@]} -eq 0 ]]; then
echo "❌ No IPs found in file"
exit 1
fi
echo "✅ Found ${#ipList[@]} IPs"
printf '%s\n' "${ipList[@]}"
# ===== Connect and Kill App =====
success_ips=()
failed_ips=()
for ip in "${ipList[@]}"; do
cleanIP="${ip%%:*}" # strip port if exists
device="$cleanIP:5555"
echo "🔌 Connecting to $cleanIP..."
output=$(run_with_timeout adb connect "$device" 2>&1)
status=$?
if [[ $status -ne 0 || "$output" != *connected* ]]; then
echo "❌ Failed to connect to $cleanIP: $output"
failed_ips+=("$cleanIP (connect)")
continue
fi
echo "📱 Processing $device..."
echo "❌ Force-stopping app..."
if ! adb -s "$device" shell am force-stop "$APP_PACKAGE"; then
echo "❌ Force-stop failed on $cleanIP"
failed_ips+=("$cleanIP (kill)")
continue
fi
success_ips+=("$cleanIP")
done
echo "✅ Kill operation complete."
echo "\n====== Summary ======"
echo "✅ Success (${#success_ips[@]}):"
if [[ ${#success_ips[@]} -gt 0 ]]; then
printf ' - %s\n' "${success_ips[@]}"
else
echo " - None"
fi
echo "❌ Failed (${#failed_ips[@]}):"
if [[ ${#failed_ips[@]} -gt 0 ]]; then
printf ' - %s\n' "${failed_ips[@]}"
else
echo " - None"
fi

@ -0,0 +1,71 @@
*********************** WOMEN HEALTH (Riyadh) ***********************
1st Floor (OBG)
10.71.50.45 - v9
10.71.50.50 - v9
10.71.50.57 - v9 v9.3 qline_opd_v9.3_bg_fix_prod
10.71.50.52 - v9
2nd Floor (OBG)
10.71.50.46 - v9
10.71.50.47 - v9
10.71.50.48 - v9
10.71.50.49 - v9
6th Floor (IVF)
10.71.50.53 - v9.3 qline_opd_v9.3_bg_fix_prod
10.71.50.56 - v9
*********************** HMG-KHOBAR ***********************
10.90.82.236 - v8.9
*********************** TAKHASSUSI ***********************
(G-FLOOR) ORTHOPEDIC
10.70.194.105 - v8.9
10.70.194.87 - v8.9
*********************** SUWAIDI ***********************
10.80.31.37 - v9.3 (SWD Oncology & Family Med WA) -> qline_opd_v9.3_android_14.apk
10.80.30.220 - v9 (SWD Oncology & Family Med WA) -> qline_opd_v9.3_android_14.apk
10.80.31.67 - v9 (SWD Internal Med & Other Clinics WA) -> qline_opd_v9.3_android_14.apk
10.80.31.80 - v9 (SWD Internal Med & Other Clinics WA) -> qline_opd_v9.3_android_14.apk
10.80.31.103 - v9.3 (SWD PEDIATRIC & Other WA) -> qline_opd_v9.3_android_14.apk
10.80.31.100 - v9.3 (SWD PEDIATRIC & Other WA) -> qline_opd_v9.3_android_14.apk
10.80.31.104 - v9.3 (SWD OB-GYN & Other Clinics Waiting Area) -> qline_opd_v9.3_android_14.apk
10.80.30.234 - v9.3 (SWD OB-GYN & Other Clinics Waiting Area) -> qline_opd_v9.3_android_14.apk
10.80.30.227 - v9.3 (SWD CARDIOLOGY & Other WA) -> qline_opd_v9.3_android_14.apk
10.80.32.31 - v9.3 (SWD CARDIOLOGY & Other WA) -> qline_opd_v9.3_android_14.apk
10.80.35.165 - v9.3 (SWD Urology & Other WA) -> qline_opd_v9.3_android_14.apk
10.80.35.212 - v9.3 (SWD Urology & Other WA) -> qline_opd_v9.3_android_14.apk
10.80.35.218 - v9.3 (SWD General Surgery & Other Waiting Area) -> qline_opd_v9.3_android_14.apk
10.80.31.28 - v9.3 (SWD General Surgery & Other Waiting Area) -> qline_opd_v9.3_android_14.apk
10.80.35.211 - v9.3 (SWD ENT & Other WA) -> qline_opd_v9.3_android_14.apk
10.80.36.111 - v9.3 (SWD ENT & Other WA) -> qline_opd_v9.3_android_14.apk
10.80.32.16 - v9.3 (SWD PULMONARY and Other WA) -> qline_opd_v9.3_android_14.apk
10.80.35.219 - v9.3 (SWD Ophthalmology & Other WA) -> qline_opd_v9.3_android_14.apk
10.80.36.114 - v9.3 (SWD Ophthalmology & Other WA) -> qline_opd_v9.3_android_14.apk
10.80.36.135 - v9.3 (SWD Dermatology / Wound Care / Plastic Surgery & Other WA) -> qline_opd_v9.3_android_14.apk
10.80.36.138 - v9.3 (SWD Dermatology / Wound Care / Plastic Surgery & Other WA) -> qline_opd_v9.3_android_14.apk
10.80.36.132 - v9.3 (SWD Gastroenterology / NEUROLOGY / DIABETIC EDUCATOR / GP Departments WA ) -> qline_opd_v9.3_android_14.apk
10.80.36.139 - v9.3 (SWD Gastroenterology / NEUROLOGY / DIABETIC EDUCATOR / GP Departments WA ) -> qline_opd_v9.3_android_14.apk
10.80.26.78 - v9.3 (SWD ORTHOPEDIC / SPINAL SURGERY / NEURO SURGERY/ PAIN CLINIC / Departments) -> qline_opd_v9.3_android_14.apk
10.80.26.74 - v9.3 (SWD ORTHOPEDIC / SPINAL SURGERY / NEURO SURGERY/ PAIN CLINIC / Departments) -> qline_opd_v9.3_android_14.apk
10.80.35.108 - v9.3 SWD Ophthalmology & Other WA -> qline_opd_v9.3_android_14.apk
10.80.36.145 - v9.3 SWD Dental & Other WA -> qline_opd_v9.3_android_14.apk
10.80.20.110 - v9.3 SWD Physiotherapy Male WA -> qline_opd_v9.3_android_14.apk
10.80.20.106 - v9.3 SWD Physiotherapy Female WA -> qline_opd_v9.3_android_14.apk
10.80.31.148 - v9.3 SWD Oncology & Family Med WA -> qline_opd_v9.3_android_14.apk

@ -0,0 +1,99 @@
#!/usr/bin/env bash
# ===== Config =====
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
APP_NAME="com.example.hmg_qline.hmg_qline/.MainActivity"
LOG_DIR="$SCRIPT_DIR/logs"
# ===== Parse Arguments =====
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-ipfile)
IP_FILE="$2"
shift # past argument
shift # past value
;;
*)
echo "Unknown option: $1"
echo "Usage: sh restart_qline.sh -ipfile <device_ips.txt>"
exit 1
;;
esac
done
if [[ -z "$IP_FILE" ]]; then
echo "Usage: sh restart_qline.sh -ipfile <device_ips.txt>"
exit 1
fi
# ===== Wi-Fi Check ====
wifi_interface=$(networksetup -listallhardwareports | \
awk '/Wi-Fi|AirPort/{getline; print $2}')
current_ssid=$(networksetup -getairportnetwork "$wifi_interface" 2>/dev/null | \
awk -F': ' '{print $2}' | tr '[:upper:]' '[:lower:]')
expected_ssid="cloud solutions"
if [[ "$current_ssid" != "$expected_ssid" ]]; then
echo "❌ Not connected to required Wi-Fi network: $expected_ssid"
echo "🔌 Current network: ${current_ssid:-Not connected}"
exit 1
fi
echo "✅ Connected to correct Wi-Fi: Cloud Solutions"
# Create log dir
mkdir -p "$LOG_DIR"
# ===== Read IPs =====
if [[ ! -f "$IP_FILE" ]]; then
echo "❌ IP file not found at $IP_FILE"
exit 1
fi
ipList=()
while IFS= read -r line; do
[[ -n "$line" ]] && ipList+=("$line")
done < "$IP_FILE"
if [[ ${#ipList[@]} -eq 0 ]]; then
echo "❌ No IPs found in file"
exit 1
fi
echo "✅ Found ${#ipList[@]} IPs"
printf '%s\n' "${ipList[@]}"
# ===== Connect to Devices =====
for ip in "${ipList[@]}"; do
cleanIP="${ip%%:*}" # strip port if exists
echo "🔌 Connecting to $cleanIP..."
output=$(adb connect "$cleanIP:5555" 2>&1)
if [[ "$output" == *connected* ]]; then
echo "✅ Connected to $cleanIP"
else
echo "❌ Failed to connect to $cleanIP: $output"
fi
done
# ===== Get Connected Devices =====
devices=$(adb devices | awk 'NR>1 && $2=="device" {print $1}')
for device in $devices; do
echo "📱 Processing $device..."
echo "❌ Closing app if running..."
adb -s "$device" shell am force-stop "${APP_NAME%%/*}"
echo "🚀 Launching app..."
adb -s "$device" shell am start -n "$APP_NAME"
log_file="$LOG_DIR/logs_${device//[^a-zA-Z0-9]/_}.txt"
echo "📝 Logging to $log_file"
adb -s "$device" logcat -s flutter > "$log_file" &
done
echo "✅ Done! Logs are saved to $LOG_DIR"

@ -0,0 +1,98 @@
#!/usr/bin/env bash
# ===== Config =====
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
APP_PACKAGE="com.example.hmg_qline.hmg_qline"
LOG_DIR="$SCRIPT_DIR/logs"
# ===== Parse Arguments =====
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-ipfile)
IP_FILE="$2"
shift # past argument
shift # past value
;;
*)
echo "Unknown option: $1"
echo "Usage: sh uninstall_qline.sh -ipfile <device_ips.txt>"
exit 1
;;
esac
done
if [[ -z "$IP_FILE" ]]; then
echo "Usage: sh uninstall_qline.sh -ipfile <device_ips.txt>"
exit 1
fi
# ===== Wi-Fi Check ====
wifi_interface=$(networksetup -listallhardwareports | \
awk '/Wi-Fi|AirPort/{getline; print $2}')
current_ssid=$(networksetup -getairportnetwork "$wifi_interface" 2>/dev/null | \
awk -F': ' '{print $2}' | tr '[:upper:]' '[:lower:]')
expected_ssid="cloud solutions"
if [[ "$current_ssid" != "$expected_ssid" ]]; then
echo "❌ Not connected to required Wi-Fi network: $expected_ssid"
echo "🔌 Current network: ${current_ssid:-Not connected}"
exit 1
fi
echo "✅ Connected to correct Wi-Fi: Cloud Solutions"
# Create log dir
mkdir -p "$LOG_DIR"
# ===== Read IPs =====
if [[ ! -f "$IP_FILE" ]]; then
echo "❌ IP file not found at $IP_FILE"
exit 1
fi
ipList=()
while IFS= read -r line; do
[[ -n "$line" ]] && ipList+=("$line")
done < "$IP_FILE"
if [[ ${#ipList[@]} -eq 0 ]]; then
echo "❌ No IPs found in file"
exit 1
fi
echo "✅ Found ${#ipList[@]} IPs"
printf '%s\n' "${ipList[@]}"
# ===== Connect to Devices =====
for ip in "${ipList[@]}"; do
cleanIP="${ip%%:*}" # strip port if exists
echo "🔌 Connecting to $cleanIP..."
output=$(adb connect "$cleanIP:5555" 2>&1)
if [[ "$output" == *connected* ]]; then
echo "✅ Connected to $cleanIP"
else
echo "❌ Failed to connect to $cleanIP: $output"
fi
done
# ===== Get Connected Devices =====
devices=$(adb devices | awk 'NR>1 && $2=="device" {print $1}')
for device in $devices; do
echo "📱 Processing $device..."
echo "❌ Uninstalling app..."
adb -s "$device" uninstall "$APP_PACKAGE"
if [[ $? -eq 0 ]]; then
echo "✅ Successfully uninstalled $APP_PACKAGE from $device"
else
echo "❌ Failed to uninstall $APP_PACKAGE from $device"
fi
done
echo "✅ Done! Uninstallation process completed."
Loading…
Cancel
Save