Update: 2026-05-15 03:57:01
This commit is contained in:
@@ -33,11 +33,8 @@ object RideDataMerger {
|
|||||||
lastRequest = newPart
|
lastRequest = newPart
|
||||||
lastTimestamp = now
|
lastTimestamp = now
|
||||||
|
|
||||||
// Wait a bit to see if more data comes from the other source before emitting
|
// Speed optimization: If the very first source has the price, emit INSTANTLY. No delays.
|
||||||
scope.launch {
|
emitIfReady()
|
||||||
delay(1500) // Wait 1.5s for the other source
|
|
||||||
emitIfReady()
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// Merge into current
|
// Merge into current
|
||||||
lastRequest = current.copy(
|
lastRequest = current.copy(
|
||||||
@@ -59,7 +56,7 @@ object RideDataMerger {
|
|||||||
|
|
||||||
// Criteria for "Ready": We have at least a price
|
// Criteria for "Ready": We have at least a price
|
||||||
if (ride.priceJod != null) {
|
if (ride.priceJod != null) {
|
||||||
Log.d("JordanBot", "🔀 MERGED RIDE READY: $ride")
|
Log.d("JordanBot", "⚡ FLASH ACCEPT: RIDE READY IN MILLISECONDS: $ride")
|
||||||
onRideReady?.invoke(ride)
|
onRideReady?.invoke(ride)
|
||||||
lastRequest = null // Clear to avoid double emission
|
lastRequest = null // Clear to avoid double emission
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package com.jordanbot.autoride.parser
|
|||||||
import com.jordanbot.autoride.model.RideRequest
|
import com.jordanbot.autoride.model.RideRequest
|
||||||
|
|
||||||
class PetraRideParser : NotificationParser {
|
class PetraRideParser : NotificationParser {
|
||||||
// Note: Package name might vary (e.g. com.PetraRide_Captain), updating to generic if needed
|
// Note: Official package name from Google Play Store
|
||||||
override val packageName = "com.petraride.captain"
|
override val packageName = "com.PetraRide_Captain"
|
||||||
|
|
||||||
override fun parse(title: String, text: String): RideRequest? {
|
override fun parse(title: String, text: String): RideRequest? {
|
||||||
var price: Double? = null
|
var price: Double? = null
|
||||||
|
|||||||
@@ -35,7 +35,11 @@ class RideAccessibilityService : AccessibilityService() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun isSupportedApp(pkg: String): Boolean {
|
private fun isSupportedApp(pkg: String): Boolean {
|
||||||
return pkg == "com.ubercab.driver" || pkg == "com.careem.adma" || pkg == "me.jeeny.driver"
|
return pkg == "com.ubercab.driver" ||
|
||||||
|
pkg == "com.careem.adma" ||
|
||||||
|
pkg == "me.com.easytaxista" || // Jeeny
|
||||||
|
pkg == "com.PetraRide_Captain" || // Petra Ride
|
||||||
|
pkg == "com.taxif.driver" // TaxiF
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun scrapeScreen(root: AccessibilityNodeInfo, pkg: String): RideRequest? {
|
private fun scrapeScreen(root: AccessibilityNodeInfo, pkg: String): RideRequest? {
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ $platformInput = $input['platform'] ?? 'Unknown';
|
|||||||
$platformMap = [
|
$platformMap = [
|
||||||
'com.ubercab.driver' => 'Uber',
|
'com.ubercab.driver' => 'Uber',
|
||||||
'com.careem.adma' => 'Careem',
|
'com.careem.adma' => 'Careem',
|
||||||
'me.jeeny.driver' => 'Jeeny',
|
'me.com.easytaxista' => 'Jeeny',
|
||||||
'com.petraride.driver' => 'Petra Ride',
|
'com.PetraRide_Captain' => 'Petra Ride',
|
||||||
'com.taxif.driver' => 'TaxiF'
|
'com.taxif.driver' => 'TaxiF'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -3,20 +3,25 @@
|
|||||||
# Make sure device is connected
|
# Make sure device is connected
|
||||||
adb devices
|
adb devices
|
||||||
|
|
||||||
echo "إرسال إشعار أوبر تجريبي..."
|
echo "إرسال إشعارات تجريبية..."
|
||||||
|
|
||||||
# Uber mock notification
|
# Uber mock notification
|
||||||
adb shell cmd notification post -t "Uber" -S "bigtext" "1.50 JOD" "Pick up: Abdoun, 2 min, 0.5 km. Drop-off: 7th Circle. 1.50 JOD. Cash" com.ubercab.driver
|
adb shell cmd notification post -t "Uber" -S "bigtext" "New Ride" "السعر: 2.50 JOD. الوقت: 5 min." com.ubercab.driver
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
echo "إرسال إشعار كريم تجريبي..."
|
|
||||||
# Careem mock notification
|
# Careem mock notification
|
||||||
adb shell cmd notification post -t "Careem" -S "bigtext" "New Ride" "Pickup in 3 mins. Expected fare JOD 2.00" com.careem.adma
|
adb shell cmd notification post -t "Careem" -S "bigtext" "طلب جديد" "سعر الرحلة 3.0 دينار أردني. يبعد 8 دقائق." com.careem.adma
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
echo "إرسال إشعار جيني تجريبي..."
|
|
||||||
# Jeeny mock notification
|
# Jeeny mock notification
|
||||||
adb shell cmd notification post -t "Jeeny" -S "bigtext" "طلب جديد" "السعر: 1.20 دينار. المسافة: 1 كم" me.jeeny.driver
|
adb shell cmd notification post -t "Jeeny" -S "bigtext" "طلب جديد" "السعر: 1.20 دينار. المسافة: 1 كم" me.com.easytaxista
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
# Petra Ride mock notification
|
||||||
|
adb shell cmd notification post -t "Petra Ride" -S "bigtext" "تنبيه" "1.00 JOD" com.PetraRide_Captain
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
# TaxiF mock notification
|
||||||
|
adb shell cmd notification post -t "TaxiF" -S "bigtext" "رحلة جديدة" "السعر: 2 JOD" com.taxif.driver
|
||||||
|
|
||||||
echo "تم إرسال الإشعارات التجريبية."
|
echo "تم إرسال الإشعارات التجريبية."
|
||||||
|
|||||||
Reference in New Issue
Block a user